PDetection Class Reference

Detailed Description

The PDetection class represents something that has been detected by a PDetector.

It is composed of an object-type (PObjectType), the id of the detector used to detect it, the frame (a PFrame) in which is was detected, a feature map (PFeatureMap) which details where it is in a frame.

Optionally, PDetection can have an origin, which represents an offset coming from a local coordinates system. For example, it can be used to handle region-of-interest.

Finally, it also has a reliability value which gives a confidence between 0 and 1 of how well it was detected.

dot_inline_dotgraph_11.png

Definition at line 61 of file PDetection.h.

#include <PDetection.h>

Constructor & Destructor Documentation

◆ PDetection() [1/4]

PDetection::PDetection ( )

Constructs an empty detection.

  • Object type is set to UNKNOWN.
  • DetectorId is set to UNKNOWN.
  • Image is empty.
  • track (only for video processing)
  • FeatureMap is empty.
  • Confidence is set to 0.

◆ PDetection() [2/4]

PDetection::PDetection ( const PObjectType objectType,
const PGuid detectorId,
const PFrame frame,
const PFeatureMap featureMap,
float  reliability 
)

Constructs a detection from an object type, the detector id, a frame (an image), a feature map and a confidence value.

◆ PDetection() [3/4]

PDetection::PDetection ( const PGuid objectId,
const PGuid detectorId,
const PFrame frame,
const PObjectType objectType,
const PTrack track,
const PFeatureMap featureMap,
float  confidence 
)

Constructs a detection from an object id, the detector id, a frame (an image), object type, track, a feature map and a confidence value.

◆ PDetection() [4/4]

PDetection::PDetection ( const PDetection other)

Constructs a shared copy of other.

◆ ~PDetection()

virtual PDetection::~PDetection ( )
virtual

Destroys this object.

Member Function Documentation

◆ Bad()

static const PDetection& PDetection::Bad ( )
inlinestatic

Returns the constant holding the bad instance of a PDetection.

Definition at line 67 of file PDetection.h.

◆ GetConfidence()

float PDetection::GetConfidence ( ) const

Returns the reliability associated with this detection, in 0.0f..1.0f.

◆ GetDetectorId()

PGuid PDetection::GetDetectorId ( ) const

Returns the id of the detector that detected the object.

◆ GetFaceRectangle()

PFeatureRectangle PDetection::GetFaceRectangle ( ) const

Returns the FACE feature rectangle if it exists (e.g.

your detector is a Face Detector) or an invalid rectangle otherwise.

◆ GetFeatureMap()

const PFeatureMap& PDetection::GetFeatureMap ( ) const

Returns the feature map associated with this detection (read only).

◆ GetFeatureMapShared()

PFeatureMap& PDetection::GetFeatureMapShared ( )

Returns a shared instance of the feature map associated with this detection.

◆ GetFeaturePoints()

PList PDetection::GetFeaturePoints ( ) const

Returns the list of all feature points.

◆ GetFeatureRectangles()

PList PDetection::GetFeatureRectangles ( ) const

Returns the list of all feature rectangles.

◆ GetFrame()

const PFrame& PDetection::GetFrame ( ) const

Returns the frame associated with this detection (read-only).

◆ GetInterocularDistance()

float PDetection::GetInterocularDistance ( ) const

Returns the number of pixels between the center of the eyes if this PDetection is a face returns 0.0f otherwise.

◆ GetObjectId()

PGuid PDetection::GetObjectId ( ) const

Returns the unique id of the detected object.

◆ GetObjectType()

PObjectType PDetection::GetObjectType ( ) const

Returns the object type associated with this detection.

◆ GetOrigin()

const PPoint2Df& PDetection::GetOrigin ( ) const

Returns the origin of this detection.

Origin represents an offset coming from a local coordinates system. For example, it can be used to handle region-of-interest.

◆ GetProperties()

const PProperties& PDetection::GetProperties ( ) const

Gets any properties that might of been set (read-only).

◆ GetPropertiesShared()

PProperties& PDetection::GetPropertiesShared ( ) const

Returns a shared instance of properties handled by this detection.

Can be used to set any properties that might useful and associated with this detection, e.g. pose, quality, etc.

◆ GetTrack()

const PTrack& PDetection::GetTrack ( ) const

Returns the current track (read only).

◆ GetTrackShared()

PTrack& PDetection::GetTrackShared ( )

Returns a shared instance of the current track.

◆ IsValid()

bool PDetection::IsValid ( ) const

Returns true is this detection is valid, false otherwise.

See also
SetInvalid()

◆ operator=()

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

Performs a shared copy of other to this object.

◆ operator==()

bool PDetection::operator== ( const PDetection other) const

Returns true if this object is the same instance than other, false otherwise.

◆ Reset()

void PDetection::Reset ( )

Resets/clears this detection.

◆ SetConfidence()

void PDetection::SetConfidence ( float  reliability)

Sets the confidence associated with this detection.

◆ SetDetectorId()

void PDetection::SetDetectorId ( const PGuid detectorId)

Sets the id of of the detector that detected object.

◆ SetFeatureMap()

void PDetection::SetFeatureMap ( const PFeatureMap featureMap)

Sets the feature map associated with this detection.

◆ SetFrame()

void PDetection::SetFrame ( const PFrame frame)

Sets the frame associated with this detection.

◆ SetInvalid()

void PDetection::SetInvalid ( )

Invalidates this detection.

See also
IsValid()

◆ SetObjectType()

void PDetection::SetObjectType ( const PObjectType objectType)

Sets the object type associated with this detection.

◆ SetOrigin()

void PDetection::SetOrigin ( const PPoint2Df origin)

Sets the origin of this detection.

Origin represents an offset coming from a local coordinates system. For example, it can be used to handle region-of-interest.

◆ SetTrack()

void PDetection::SetTrack ( const PTrack track)

Sets the track to link this detection with a previous existing one.

◆ Translate()

void PDetection::Translate ( float  x,
float  y 
)

Translates all points and rectangles of this detection by the specified (x,y) values.

Friends And Related Function Documentation

◆ PDetectionImpl

friend class PDetectionImpl
friend

Definition at line 270 of file PDetection.h.