OpenPose  1.7.0
The first real-time multi-person system to jointly detect human body, hand, facial, and foot keypoints
op::HandExtractorNet Class Referenceabstract

#include <handExtractorNet.hpp>

Inheritance diagram for op::HandExtractorNet:
op::HandExtractorCaffe

Public Member Functions

 HandExtractorNet (const Point< int > &netInputSize, const Point< int > &netOutputSize, const int numberScales=1, const float rangeScales=0.4f, const std::vector< HeatMapType > &heatMapTypes={}, const ScaleMode heatMapScaleMode=ScaleMode::ZeroToOneFixedAspect)
 
virtual ~HandExtractorNet ()
 
void initializationOnThread ()
 
virtual void forwardPass (const std::vector< std::array< Rectangle< float >, 2 >> handRectangles, const Matrix &cvInputData)=0
 
std::array< Array< float >, 2 > getHeatMaps () const
 
std::array< Array< float >, 2 > getHandKeypoints () const
 
bool getEnabled () const
 
void setEnabled (const bool enabled)
 

Protected Member Functions

virtual void netInitializationOnThread ()=0
 

Protected Attributes

const std::pair< int, float > mMultiScaleNumberAndRange
 
const Point< int > mNetOutputSize
 
Array< float > mHandImageCrop
 
std::array< Array< float >, 2 > mHandKeypoints
 
const ScaleMode mHeatMapScaleMode
 
const std::vector< HeatMapTypemHeatMapTypes
 
std::array< Array< float >, 2 > mHeatMaps
 
std::atomic< bool > mEnabled
 

Detailed Description

Hand keypoint extractor class.

Definition at line 13 of file handExtractorNet.hpp.

Constructor & Destructor Documentation

◆ HandExtractorNet()

op::HandExtractorNet::HandExtractorNet ( const Point< int > &  netInputSize,
const Point< int > &  netOutputSize,
const int  numberScales = 1,
const float  rangeScales = 0.4f,
const std::vector< HeatMapType > &  heatMapTypes = {},
const ScaleMode  heatMapScaleMode = ScaleMode::ZeroToOneFixedAspect 
)
explicit

Constructor of the HandExtractorNet class.

Parameters
netInputSizeSize at which the cropped image (where the hand is located) is resized.
netOutputSizeSize of the final results. At the moment, it must be equal than netOutputSize.
numberScalesNumber of scales to run. The more scales, the slower it will be but possibly also more accurate.
rangeScalesThe range between the smaller and bigger scale.

◆ ~HandExtractorNet()

virtual op::HandExtractorNet::~HandExtractorNet ( )
virtual

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

Member Function Documentation

◆ forwardPass()

virtual void op::HandExtractorNet::forwardPass ( const std::vector< std::array< Rectangle< float >, 2 >>  handRectangles,
const Matrix cvInputData 
)
pure virtual

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

Parameters
handRectangleslocation of the hands in the image. It is a length-variable std::vector, where each index corresponds to a different person in the image. Internally the std::vector, a std::array of 2 elements: index 0 and 1 for left and right hand respectively. Inside each array element, a op::Rectangle<float> (similar to cv::Rect for floating values) with the position of that hand (or 0,0,0,0 if some hand is missing, e.g., if a specific person has only half of the body inside the image).
cvInputDataOriginal image in Mat format and BGR format.

Implemented in op::HandExtractorCaffe.

◆ getEnabled()

bool op::HandExtractorNet::getEnabled ( ) const

◆ getHandKeypoints()

std::array<Array<float>, 2> op::HandExtractorNet::getHandKeypoints ( ) const

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

Returns
A std::array with all the left hand keypoints (index 0) and all the right ones (index 1). Each Array<float> 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).

◆ getHeatMaps()

std::array<Array<float>, 2> op::HandExtractorNet::getHeatMaps ( ) const

◆ initializationOnThread()

void op::HandExtractorNet::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.

◆ netInitializationOnThread()

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

Implemented in op::HandExtractorCaffe.

◆ setEnabled()

void op::HandExtractorNet::setEnabled ( const bool  enabled)

Member Data Documentation

◆ mEnabled

std::atomic<bool> op::HandExtractorNet::mEnabled
protected

Definition at line 78 of file handExtractorNet.hpp.

◆ mHandImageCrop

Array<float> op::HandExtractorNet::mHandImageCrop
protected

Definition at line 71 of file handExtractorNet.hpp.

◆ mHandKeypoints

std::array<Array<float>, 2> op::HandExtractorNet::mHandKeypoints
protected

Definition at line 72 of file handExtractorNet.hpp.

◆ mHeatMaps

std::array<Array<float>, 2> op::HandExtractorNet::mHeatMaps
protected

Definition at line 76 of file handExtractorNet.hpp.

◆ mHeatMapScaleMode

const ScaleMode op::HandExtractorNet::mHeatMapScaleMode
protected

Definition at line 74 of file handExtractorNet.hpp.

◆ mHeatMapTypes

const std::vector<HeatMapType> op::HandExtractorNet::mHeatMapTypes
protected

Definition at line 75 of file handExtractorNet.hpp.

◆ mMultiScaleNumberAndRange

const std::pair<int, float> op::HandExtractorNet::mMultiScaleNumberAndRange
protected

Definition at line 69 of file handExtractorNet.hpp.

◆ mNetOutputSize

const Point<int> op::HandExtractorNet::mNetOutputSize
protected

Definition at line 70 of file handExtractorNet.hpp.


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