MCPcopy Create free account
hub / github.com/davisking/dlib / sample_detection_from_sensor

Function sample_detection_from_sensor

examples/learning_to_track_ex.cpp:164–173  ·  view source on GitHub ↗

So here is our function that samples a detection from our simulated sensor. You tell it what object you want to sample a detection from and it returns a detection from that object.

Source from the content-addressed store, hash-verified

162// what object you want to sample a detection from and it returns a detection from that
163// object.
164detection sample_detection_from_sensor(long object_id)
165{
166 DLIB_CASSERT(object_id < num_objects,
167 "You can't ask to sample a detection from an object that doesn't exist.");
168 detection temp;
169 // Set the measurements equal to the object's true property values plus a little bit of
170 // noise.
171 temp.measurements = object_properties[object_id] + randm(num_properties,1,rnd)*0.1;
172 return temp;
173}
174
175// ----------------------------------------------------------------------------------------
176

Callers 2

make_random_detectionsFunction · 0.70

Calls 1

randmFunction · 0.50

Tested by

no test coverage detected