| 114 | |
| 115 | template <typename detection> |
| 116 | detection sample_detection_from_sensor(long object_id) |
| 117 | { |
| 118 | DLIB_CASSERT(object_id < num_objects, |
| 119 | "You can't ask to sample a detection from an object that doesn't exist."); |
| 120 | detection temp; |
| 121 | // Set the measurements equal to the object's true property values plus a little bit of |
| 122 | // noise. |
| 123 | temp.measurements = object_properties[object_id] + randm(num_properties,1,rnd)*0.1; |
| 124 | return temp; |
| 125 | } |
| 126 | |
| 127 | // ---------------------------------------------------------------------------------------- |
| 128 | |