DFX Extraction library v4.14.5
enabling applications to perform DFX blood flow analysis
Public Member Functions | List of all members
dfx::Frame Class Referenceabstract

Frame is a wrapper which links a VideoFrame with one or more Face objects and additional state needed for regions and channel construction. More...

#include "dfx/Frame.h"

Public Member Functions

virtual ~Frame ()
 Frame destructor.
 
virtual VideoFrame getVideoFrame () const =0
 Convenience method to retrieve the VideoFrame associated with this Frame instance. More...
 
virtual bool addFace (std::shared_ptr< dfx::Face > face)=0
 Add a face and associated data to the frame. More...
 
virtual std::vector< float > getQualityMetrics (float iso, float exposure)=0
 Calculates the quality metrics for the current frame. More...
 
virtual std::vector< float > getOpticalQualityMetrics ()=0
 Calculates the optical quality metrics for the current frame. More...
 
virtual int getStarRating (std::string &feedback)=0
 Provide the 5-star rating value for the current frame, available after a call to getQualityMetrics. More...
 
virtual int getOpticalQualityRating (std::string &feedback)=0
 Provide the 5-star rating value for the current frame, available after a call to getOpticalQualityMetrics. More...
 
virtual bool addMarker (const std::string &label)=0
 Adds a marker/label to a video frame. More...
 
virtual std::vector< std::string > getMarkers () const =0
 Returns the marker/labels in a video frame. More...
 
virtual std::vector< std::string > getDesiredFaceAttributes () const =0
 Returns a list of desired face attributes for this frame. More...
 
virtual std::vector< std::string > getDesiredDeviceAttributes () const =0
 Returns a list of desired device attributes for this frame. More...
 
virtual double getDeviceAttribute (const std::string &key) const =0
 Returns the value of a device attribute if it exists or zero. More...
 
virtual void setDeviceAttribute (const std::string &key, double value)=0
 add a device attribute More...
 
virtual std::vector< std::string > getFaceIdentifiers () const =0
 obtain the known face identifiers within this frame. More...
 
virtual std::vector< std::string > getRegionNames (const std::string &faceID) const =0
 obtains the names of regions which are defined for the face within this frame. More...
 
virtual std::vector< cv::Point > getRegionPolygon (const std::string &faceID, const std::string &regionName) const =0
 obtain the polygon for the region of interest. More...
 
virtual int32_t getRegionIntProperty (const std::string &faceID, const std::string &regionName, const std::string &property) const =0
 Regions can have numeric properties attached to them. More...
 
virtual cv::Mat getRegionHistogram (const std::string &faceID, const std::string &regionName) const =0
 obtain the histogram for a region of interest. More...
 

Detailed Description

Frame is a wrapper which links a VideoFrame with one or more Face objects and additional state needed for regions and channel construction.

In addition to the video image, a Frame will have Faces and addition state. It also enables client applications to augment the Frame with markers and device data like Acceleration and Rotation data if available.

Member Function Documentation

◆ addFace()

virtual bool dfx::Frame::addFace ( std::shared_ptr< dfx::Face face)
pure virtual

Add a face and associated data to the frame.

Multiple faces can be added if an image contains multiple faces.

Parameters
facedata to add to this Frame.
Returns
true if face successfully added, false if the limit on the number of faces has been reached.

◆ addMarker()

virtual bool dfx::Frame::addMarker ( const std::string &  label)
pure virtual

Adds a marker/label to a video frame.

If multiple events occur within a frame, multiple markers can be addedd and annotated against a frame.

Parameters
labelthe string marker identifier to add to the frame.
Returns
true if marker succesfully added, false if the limit on the number of markers has been reached.

◆ getDesiredDeviceAttributes()

virtual std::vector<std::string> dfx::Frame::getDesiredDeviceAttributes ( ) const
pure virtual

Returns a list of desired device attributes for this frame.

This enables the DFX engine to request additional properties like "acceleration", "rotation", etc. which it would like to have but which might not always be available depending upon the use case.

These attributes should be added with frame setDeviceAttribute() if they are available for the current frame.

Returns
the list of desired attribute names
See also
setDeviceAttribute

◆ getDesiredFaceAttributes()

virtual std::vector<std::string> dfx::Frame::getDesiredFaceAttributes ( ) const
pure virtual

Returns a list of desired face attributes for this frame.

This enables the DFX engine to request additional properties like "age", "gender", "weight" etc. which it would like to have but which might not always be available depending upon the use case.

These attributes should be added to the Face attribute map if they are available for the current frame.

Returns
the list of desired attribute names

◆ getDeviceAttribute()

virtual double dfx::Frame::getDeviceAttribute ( const std::string &  key) const
pure virtual

Returns the value of a device attribute if it exists or zero.

Parameters
keythe attribute name.
Returns
value the value of the attribute or zero.

◆ getFaceIdentifiers()

virtual std::vector<std::string> dfx::Frame::getFaceIdentifiers ( ) const
pure virtual

obtain the known face identifiers within this frame.

Every face is known by an identifier which uniquely identifies the face.

Returns
vector of face IDs currently known to this frame.

◆ getMarkers()

virtual std::vector<std::string> dfx::Frame::getMarkers ( ) const
pure virtual

Returns the marker/labels in a video frame.

Returns
returns a list of markers in this frame.

◆ getOpticalQualityMetrics()

virtual std::vector<float> dfx::Frame::getOpticalQualityMetrics ( )
pure virtual

Calculates the optical quality metrics for the current frame.

Returns
the quality metrics

◆ getOpticalQualityRating()

virtual int dfx::Frame::getOpticalQualityRating ( std::string &  feedback)
pure virtual

Provide the 5-star rating value for the current frame, available after a call to getOpticalQualityMetrics.

Parameters
thefeedback string
Returns
the 5-star rating
See also
getQualityMetrics

◆ getQualityMetrics()

virtual std::vector<float> dfx::Frame::getQualityMetrics ( float  iso,
float  exposure 
)
pure virtual

Calculates the quality metrics for the current frame.

Deprecated:
: Support for this method will be removed in a future release. Please use the getOpticalQualityMetrics instead.

The provided ISO and exposure settings along with the current frame image data are used to construct a set of quality metrics which are used by the exposure algorithm to determine if the ISO needs to be increased or decreased to improve the image quality.

Parameters
isothe current iso setting
exposurethe current exposure setting
Returns
the quality metrics

◆ getRegionHistogram()

virtual cv::Mat dfx::Frame::getRegionHistogram ( const std::string &  faceID,
const std::string &  regionName 
) const
pure virtual

obtain the histogram for a region of interest.

Parameters
faceIDidentifier for the face of interest.
regionNamewhich histogram is desired.
Returns
histogram for the region if it is known, empty cv::Mat if not known.

◆ getRegionIntProperty()

virtual int32_t dfx::Frame::getRegionIntProperty ( const std::string &  faceID,
const std::string &  regionName,
const std::string &  property 
) const
pure virtual

Regions can have numeric properties attached to them.

Parameters
faceIDidentifier for the face of interest.
regionNameto inspect the property of.
propertyto be returned
Returns
the numeric value of the property.

◆ getRegionNames()

virtual std::vector<std::string> dfx::Frame::getRegionNames ( const std::string &  faceID) const
pure virtual

obtains the names of regions which are defined for the face within this frame.

Parameters
faceIDidentifier for the face of interest.
Returns
vector of region names which can be retrieved for the face.

◆ getRegionPolygon()

virtual std::vector<cv::Point> dfx::Frame::getRegionPolygon ( const std::string &  faceID,
const std::string &  regionName 
) const
pure virtual

obtain the polygon for the region of interest.

Parameters
faceIDidentifier for the face of interest.
regionNamewhich points are needed for drawing.
Returns
vector of points forming a closed polygon shape for region of interest.

◆ getStarRating()

virtual int dfx::Frame::getStarRating ( std::string &  feedback)
pure virtual

Provide the 5-star rating value for the current frame, available after a call to getQualityMetrics.

Deprecated:
: Support for this method will be removed in a future release. Please use the getOpticalQualityRating instead.
Parameters
thefeedback string
Returns
the 5-star rating
See also
getQualityMetrics

◆ getVideoFrame()

virtual VideoFrame dfx::Frame::getVideoFrame ( ) const
pure virtual

Convenience method to retrieve the VideoFrame associated with this Frame instance.

return the associated VideoFrame

◆ setDeviceAttribute()

virtual void dfx::Frame::setDeviceAttribute ( const std::string &  key,
double  value 
)
pure virtual

add a device attribute

Device attributes are things like "acceleration" or "rotation".

When these attributes involve multiple values, like X and Y co-ordinates they should be expanded as "acceleration:x" and "acceleration:y".

Parameters
keythe attribute name.
valuethe value of the attribute.

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