OpenPose  1.0.0rc2
OpenPose: A Real-Time Multi-Person Key-Point Detection And Multi-Threading C++ Library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
op::FaceExtractor Class Referenceabstract

#include <faceExtractor.hpp>

Inherited by op::FaceExtractorCaffe.

Public Member Functions

 FaceExtractor (const Point< int > &netInputSize, const Point< int > &netOutputSize, const std::vector< HeatMapType > &heatMapTypes={}, const ScaleMode heatMapScale=ScaleMode::ZeroToOne)
 
virtual ~FaceExtractor ()
 
void initializationOnThread ()
 
virtual void forwardPass (const std::vector< Rectangle< float >> &faceRectangles, const cv::Mat &cvInputData)=0
 
Array< float > getHeatMaps () const
 
Array< float > getFaceKeypoints () const
 

Protected Member Functions

virtual void netInitializationOnThread ()=0
 

Protected Attributes

const Point< int > mNetOutputSize
 
Array< float > mFaceImageCrop
 
Array< float > mFaceKeypoints
 
Array< float > mHeatMaps
 
const ScaleMode mHeatMapScaleMode
 
const std::vector< HeatMapTypemHeatMapTypes
 

Detailed Description

Face keypoint extractor class.

Constructor & Destructor Documentation

op::FaceExtractor::FaceExtractor ( const Point< int > &  netInputSize,
const Point< int > &  netOutputSize,
const std::vector< HeatMapType > &  heatMapTypes = {},
const ScaleMode  heatMapScale = ScaleMode::ZeroToOne 
)
explicit

Constructor of the FaceExtractor class.

Parameters
netInputSizeSize at which the cropped image (where the face is located) is resized.
netOutputSizeSize of the final results. At the moment, it must be equal than netOutputSize.
virtual op::FaceExtractor::~FaceExtractor ( )
virtual

Virtual destructor of the HandExtractor class. Required to allow inheritance.

Member Function Documentation

virtual void op::FaceExtractor::forwardPass ( const std::vector< Rectangle< float >> &  faceRectangles,
const cv::Mat &  cvInputData 
)
pure virtual

This function extracts the face keypoints for each detected face in the image.

Parameters
faceRectangleslocation of the faces in the image. It is a length-variable std::vector, where each index corresponds to a different person in the image. Internally, a op::Rectangle<float> (similar to cv::Rect for floating values) with the position of that face (or 0,0,0,0 if some face is missing, e.g. if a specific person has only half of the body inside the image).
cvInputDataOriginal image in cv::Mat format and BGR format.

Implemented in op::FaceExtractorCaffe.

Array<float> op::FaceExtractor::getFaceKeypoints ( ) const

This function returns the face keypoins. VERY IMPORTANT: use getFaceKeypoints().clone() if the keypoints are going to be edited in a different thread.

Returns
A Array with all the face keypoints. It follows the pose structure, i.e. the first dimension corresponds to all the people in the image, the second to each specific keypoint, and the third one to (x, y, score).
Array<float> op::FaceExtractor::getHeatMaps ( ) const
void op::FaceExtractor::initializationOnThread ( )

This function must be call before using any other function. It must also be called inside the thread in which the functions are going to be used.

virtual void op::FaceExtractor::netInitializationOnThread ( )
protectedpure virtual

Implemented in op::FaceExtractorCaffe.

Member Data Documentation

Array<float> op::FaceExtractor::mFaceImageCrop
protected
Array<float> op::FaceExtractor::mFaceKeypoints
protected
Array<float> op::FaceExtractor::mHeatMaps
protected
const ScaleMode op::FaceExtractor::mHeatMapScaleMode
protected
const std::vector<HeatMapType> op::FaceExtractor::mHeatMapTypes
protected
const Point<int> op::FaceExtractor::mNetOutputSize
protected

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