PDetector Class Reference

Detailed Description

The PDetector class is the parent class for all detection algorithms which analyse an image or a video stream and return a list of detected objects (PDetectionList); typical instances are MotionDetector or FaceDetector.

dot_inline_dotgraph_12.png

PDetector instances are constructed through factory constructors for the specific object type.

Definition at line 50 of file PDetector.h.

#include <PDetector.h>

Constructor & Destructor Documentation

◆ PDetector() [1/2]

PDetector::PDetector ( )

Constructs an empty detector; use PDetector::Create() factory to instantiate a detector.

◆ PDetector() [2/2]

PDetector::PDetector ( const PDetector other)

Constructs a shared copy of other.

◆ ~PDetector()

virtual PDetector::~PDetector ( )
virtual

Destroys this object.

Member Function Documentation

◆ Create() [1/4]

static PResult PDetector::Create ( const PString productName,
const PProperties parameters,
PDetector detector 
)
static

Factory: creates a PDetector from the specified plugin and parameters (factory).

Returns PResult::C_OK if success, another result otherwise.

◆ Create() [2/4]

static PResult PDetector::Create ( const PPlugin plugin,
const PProperties parameters,
PDetector detector 
)
static

Factory: creates a PDetector from the specified plugin and parameters (factory).

Returns PResult::C_OK if success, another result otherwise.

◆ Create() [3/4]

static PResult PDetector::Create ( const PString productName,
const PProperties parameters,
const PString parametersPrefix,
PDetector detector 
)
static

Factory: creates a PDetector from the specified plugin and parameters (factory).

Returns PResult::C_OK if success, another result otherwise.

◆ Create() [4/4]

static PResult PDetector::Create ( const PPlugin plugin,
const PProperties parameters,
const PString parametersPrefix,
PDetector detector 
)
static

Factory: creates a PDetector from the specified plugin and parameters (factory).

Returns PResult::C_OK if success, another result otherwise.

◆ Detect() [1/2]

PResult PDetector::Detect ( const PFrame frame,
PDetectionList detectionList 
) const

Detects objects in the given input frame and returns a set of detections.

Returns PResult::C_OK if success, another result otherwise.

◆ Detect() [2/2]

PResult PDetector::Detect ( const PFrame frame,
const PProperties parameters,
const PString parametersPrefix,
PDetectionList detectionList 
) const

Detects objects in the given input frame and returns a set of detections.

Returns PResult::C_OK if success, another result otherwise.

◆ EnableLocaliser()

PResult PDetector::EnableLocaliser ( bool  enabled)

Enables or disables localiser.

Returns PResult::C_OK if success, another result otherwise (e.g. parameter not supported by this detector).

◆ GetLocaliser()

PDetector PDetector::GetLocaliser ( ) const

Gets localiser.

Returns localiser used (Null object if not used).

◆ GetMaxDetections()

papillon::int32 PDetector::GetMaxDetections ( ) const

Returns the maximum number of detections per image.

Returns -1 if the parameter is not supported by this detector.

◆ GetMaxDetectionSize()

PSizei PDetector::GetMaxDetectionSize ( ) const

Gets the maximum detection area.

Returns (0,0) if the parameter is not supported by this detector.

◆ GetMinDetectionSize()

PSizei PDetector::GetMinDetectionSize ( ) const

Gets the minimum detection area.

Returns (0,0) if the parameter is not supported by this detector.

◆ GetRegionOfInterest()

PRectanglei PDetector::GetRegionOfInterest ( ) const

Gets the region of interest.

Returns (0,0,0,0) if the parameter is not supported by this detector.

◆ GetThreshold()

float PDetector::GetThreshold ( ) const

Gets the threshold used for this detector.

Returns NaN if this parameter is not supported by this detector.

◆ IsLocaliserEnabled()

bool PDetector::IsLocaliserEnabled ( ) const

Returns true if localiser is enabled, false otherwise.

Returns false if the parameter is not supported by this detector.

◆ Localise()

PResult PDetector::Localise ( PDetectionList detectionList) const

Localises feature points for each detection in the list.

Returns PResult::C_OK if success, another result otherwise.

◆ operator=()

PDetector& PDetector::operator= ( const PDetector other)

Performs a shared copy of other to this object.

◆ SetLocaliser() [1/2]

PResult PDetector::SetLocaliser ( const PString localiserName = PString())

Sets localiser.

Parameters
localiserNameis PString with the name of detector ("" - use default localiser) Returns PResult::C_OK if success, another result otherwise (e.g. parameter not supported by this detector).

◆ SetLocaliser() [2/2]

PResult PDetector::SetLocaliser ( const PDetector localiser)

Sets localiser.

Parameters
localiseris PDetector object (null object for using default localiser) Returns PResult::C_OK if success, another result otherwise (e.g. parameter not supported by this detector).

◆ SetMaxDetections()

PResult PDetector::SetMaxDetections ( papillon::int32  maxDetections)

Sets the maximum number of detections per image.

Do not change the number of detections if the argument is negative. Returns PResult::C_OK if success, another result otherwise (e.g. parameter not supported by this detector).

◆ SetMaxDetectionSize() [1/2]

PResult PDetector::SetMaxDetectionSize ( const papillon::int32  maxDetectionSize)

Sets the maximum length of an object to detect in the scene, in pixels.

Returns PResult::C_OK if success, another result otherwise (e.g. parameter not supported by this detector).

◆ SetMaxDetectionSize() [2/2]

PResult PDetector::SetMaxDetectionSize ( const PSizei maxDetectionSize)

Sets the maximum area of an object to detect in the scene.

Returns PResult::C_OK if success, another result otherwise (e.g. parameter not supported by this detector).

◆ SetMinDetectionSize() [1/2]

PResult PDetector::SetMinDetectionSize ( const papillon::int32  minDetectionSize)

Sets the minimum length of an object to detect in the scene.

Returns PResult::C_OK if success, another result otherwise (e.g. parameter not supported by this detector).

◆ SetMinDetectionSize() [2/2]

PResult PDetector::SetMinDetectionSize ( const PSizei minDetectionSize)

Sets the minimum area of an object to detect in the scene, in pixels.

Returns PResult::C_OK if success, another result otherwise (e.g. parameter not supported by this detector).

◆ SetRegionOfInterest()

PResult PDetector::SetRegionOfInterest ( const PRectanglei roi)

Sets the region of interest to search the detector.

Returns PResult::C_OK if success, another result otherwise (e.g. parameter not supported by this detector).

◆ SetThreshold()

PResult PDetector::SetThreshold ( float  threshold)

Calls Set(C_PARAM_THRESHOLD, PFloat(threshold)) on this detector.

Returns PResult::C_OK if success, another result otherwise (e.g. parameter not supported by this detector).

Member Data Documentation

◆ C_PARAM_BOOL_LOCALISER

const PString PDetector::C_PARAM_BOOL_LOCALISER
static

"is localiser enabled" parameter (bool)

Definition at line 57 of file PDetector.h.

◆ C_PARAM_DETECTOR_LOCALISER

const PString PDetector::C_PARAM_DETECTOR_LOCALISER
static

"localiser" parameter (PDetector)

Definition at line 58 of file PDetector.h.

◆ C_PARAM_FLOAT_THRESHOLD

const PString PDetector::C_PARAM_FLOAT_THRESHOLD
static

"threshold" parameter(float)

Definition at line 52 of file PDetector.h.

◆ C_PARAM_INT32_MAX_DETECTIONS

const PString PDetector::C_PARAM_INT32_MAX_DETECTIONS
static

"max number of detections" parameter (int32)

Definition at line 56 of file PDetector.h.

◆ C_PARAM_RECTI_REGION_OF_INTEREST

const PString PDetector::C_PARAM_RECTI_REGION_OF_INTEREST
static

"region of interest" parameter (PRectanglei)

Definition at line 53 of file PDetector.h.

◆ C_PARAM_SIZEI_MAX_DETECTION_SIZE

const PString PDetector::C_PARAM_SIZEI_MAX_DETECTION_SIZE
static

"max detection size" parameter (PSizei)

Definition at line 55 of file PDetector.h.

◆ C_PARAM_SIZEI_MIN_DETECTION_SIZE

const PString PDetector::C_PARAM_SIZEI_MIN_DETECTION_SIZE
static

"min detection size" parameter (PSizei)

Definition at line 54 of file PDetector.h.