Struct ObjectDetection
pub struct ObjectDetection(/* private fields */);Expand description
Object Detection functionality.
Implementations§
§impl ObjectDetection
impl ObjectDetection
pub fn get_detections(&mut self) -> Vec<BoxPrediction>
pub fn get_detections(&mut self) -> Vec<BoxPrediction>
Obtain the object detections from the most recently processed frame.
Note that the algorithm comes with a built-in threshold (e.g. 0.6 - this differs per model): boxes with confidences lower than that value won’t be produced at all by this function.
pub fn has_box_moved(
&self,
prediction: &BoxPrediction,
timeout_seconds: f32,
) -> Result<bool, Error>
pub fn has_box_moved( &self, prediction: &BoxPrediction, timeout_seconds: f32, ) -> Result<bool, Error>
Check if a box has moved significantly since its initial detection.
This function should only be used for boxes from the most recent video
frame. This function only accepts boxes of particular classes, depending
on the exact product and platform. For boxes of other classes, it will
return ErrorCode::InvalidBox.
The function returns
falseif the box has not moved since its initial detection, or if it has not moved sincetimeout_seconds.trueif the box has moved
This function should not be called directly after restoring from a previous state.
This function should not be called with boxes obtained directly after
VideoIntelligence::single_image calls.
§Errors
Error::InvalidBoxError::InvalidHasMovedTimeout
pub fn reset_tracker(&mut self)
pub fn reset_tracker(&mut self)
This function is only available if the library was built with tracking support.
This resets the internal tracker state and resets all tracker ids and face identifications if applicable. It is recommended to call this whenever two consecutive frames are too different from each other, such as when switching to a different camera input or when the camera abruptly moved.
pub fn detector_version(&self) -> u32
pub fn detector_version(&self) -> u32
Returns a version number of the object detector neural network.