Conscience Core
Public Member Functions | List of all members
conscience_core::detector_engine::CscDetectorEngineMultiple Class Reference

#include <CscDetectorEngineMultiple.h>

Inheritance diagram for conscience_core::detector_engine::CscDetectorEngineMultiple:
conscience_core::detector_engine::CscDetectorEngine

Public Member Functions

 CscDetectorEngineMultiple (const string &name, const vector< CscDetectorEngine * > &detectors={}, bool drawPredictionOnImage=false)
 
ptr< DetectionResultdetectOnImage (const DetectorSourceImage &image, ptr< DetectionParameters > parameters) override
 
void addDetector (CscDetectorEngine *detector, DetectorIsEnabledFunction shouldEnable=alwaysEnableDetector)
 
bool addDetectorIfNew (CscDetectorEngine *detector, DetectorIsEnabledFunction shouldEnable=alwaysEnableDetector)
 
void enableDuplicateDeletion (float iouThreshold)
 
void setDrawPredictionOnImage (bool drawPredictionOnImage)
 
virtual bool equals (CscDetectorEngine *) const override
 
- Public Member Functions inherited from conscience_core::detector_engine::CscDetectorEngine
void drawTarget (cv::Mat &image, float x, float y)
 
virtual ~CscDetectorEngine ()=default
 

Additional Inherited Members

- Protected Member Functions inherited from conscience_core::detector_engine::CscDetectorEngine
 CscDetectorEngine ()
 
void shiftDetectedObjectsForLense (const vector< CscWorldObject * > &resultObjList, const LenseParameter *lense) const
 
void safeAddRectangle (vector< CscRect2d > &rectangles, CscRect2d &rectangle, cv::Mat &image)
 
- Static Protected Member Functions inherited from conscience_core::detector_engine::CscDetectorEngine
static void drawDetectedObjectBox (cv::Mat &frame, const CscRect2d &boxRectangle, float estimatedDistanceMeter, float certitude, const string &objectName, const Vec3 &color=Vec3(255, 178, 50))
 

Detailed Description

This detector is a composite of detectors. It groups multiple detectors in a sequence. Every detector in the sequence will be called for each detection pass (detectOnImage), one after another if enabled. Indeed a detector can be disabled in a sequence for a given detection pass, depending on the current detection results (for instance, enable a detector only if a person has been detected by a previous detector in the sequence). To enable/disable a detector for a pass, you can give an activation function coming with the detector to addDetector(detector, activationFunction)

Detection results returned by each detecor is accumulated in a metged result which this multipleDetector will return. NOTE: results can be deduplicated based on modelId and rectangles intersection, please see enableDuplicateDeletion(..)

Constructor & Destructor Documentation

◆ CscDetectorEngineMultiple()

conscience_core::detector_engine::CscDetectorEngineMultiple::CscDetectorEngineMultiple ( const string &  name,
const vector< CscDetectorEngine * > &  detectors = {},
bool  drawPredictionOnImage = false 
)

Member Function Documentation

◆ addDetector()

void conscience_core::detector_engine::CscDetectorEngineMultiple::addDetector ( CscDetectorEngine detector,
DetectorIsEnabledFunction  shouldEnable = alwaysEnableDetector 
)
inline

Adds the given detector to this detectors sequence. shouldEnable is an activation function which will be called for each detection pass to know if detector should be called or not.

◆ addDetectorIfNew()

bool conscience_core::detector_engine::CscDetectorEngineMultiple::addDetectorIfNew ( CscDetectorEngine detector,
DetectorIsEnabledFunction  shouldEnable = alwaysEnableDetector 
)

return false if detector was not added because it's already present

See also
addDetector

◆ detectOnImage()

ptr< DetectionResult > conscience_core::detector_engine::CscDetectorEngineMultiple::detectOnImage ( const DetectorSourceImage image,
ptr< DetectionParameters parameters 
)
overridevirtual

◆ enableDuplicateDeletion()

void conscience_core::detector_engine::CscDetectorEngineMultiple::enableDuplicateDeletion ( float  iouThreshold)
inline

If this method is called, this detector will try to remove duplicate in detections from underlying detectors, using objectModelId, inclusion, and IoU ratio

◆ equals()

bool conscience_core::detector_engine::CscDetectorEngineMultiple::equals ( CscDetectorEngine other) const
overridevirtual

◆ setDrawPredictionOnImage()

void conscience_core::detector_engine::CscDetectorEngineMultiple::setDrawPredictionOnImage ( bool  drawPredictionOnImage)
inline

The documentation for this class was generated from the following files: