All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
handExtractorNet.hpp
Go to the documentation of this file.
#ifndef OPENPOSE_HAND_HAND_EXTRACTOR_HPP
#define OPENPOSE_HAND_HAND_EXTRACTOR_HPP
#include <atomic>
#include <opencv2/core/core.hpp> // cv::Mat
#include <openpose/core/common.hpp>
#include <openpose/core/enumClasses.hpp>
namespace op
{
class OP_API HandExtractorNet
{
public:
explicit HandExtractorNet(const Point<int>& netInputSize, const Point<int>& netOutputSize,
const unsigned short numberScales = 1, const float rangeScales = 0.4f,
const std::vector<HeatMapType>& heatMapTypes = {},
const ScaleMode heatMapScale = ScaleMode::ZeroToOne);
virtual ~HandExtractorNet();
void initializationOnThread();
virtual void forwardPass(const std::vector<std::array<Rectangle<float>, 2>> handRectangles,
const cv::Mat& 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:
const std::pair<unsigned short, float> mMultiScaleNumberAndRange;
const Point<int> mNetOutputSize;
Array<float> mHandImageCrop;
std::array<Array<float>, 2> mHandKeypoints;
// HeatMaps parameters
const ScaleMode mHeatMapScaleMode;
const std::vector<HeatMapType> mHeatMapTypes;
std::array<Array<float>, 2> mHeatMaps;
// Temporarily disable it
std::atomic<bool> mEnabled;
virtual void netInitializationOnThread() = 0;
private:
// Init with thread
std::thread::id mThreadId;
void checkThread() const;
DELETE_COPY(HandExtractorNet);
};
}
#endif // OPENPOSE_HAND_HAND_EXTRACTOR_HPP
DELETE_COPY
#define DELETE_COPY(className)
Definition: macros.hpp:34
cl::array
std::array< T, N > array
Definition: cl2.hpp:594
op::Point< int >
op::HandExtractorNet::mEnabled
std::atomic< bool > mEnabled
Definition: handExtractorNet.hpp:79
op::HandExtractorNet::mHandImageCrop
Array< float > mHandImageCrop
Definition: handExtractorNet.hpp:72
op::HandExtractorNet::mHeatMapScaleMode
const ScaleMode mHeatMapScaleMode
Definition: handExtractorNet.hpp:75
op::HandExtractorNet::mNetOutputSize
const Point< int > mNetOutputSize
Definition: handExtractorNet.hpp:71
common.hpp
op::ScaleMode::ZeroToOne
op::HandExtractorNet::mMultiScaleNumberAndRange
const std::pair< unsigned short, float > mMultiScaleNumberAndRange
Definition: handExtractorNet.hpp:70
op::HandExtractorNet::mHandKeypoints
std::array< Array< float >, 2 > mHandKeypoints
Definition: handExtractorNet.hpp:73
op::HandExtractorNet::mHeatMaps
std::array< Array< float >, 2 > mHeatMaps
Definition: handExtractorNet.hpp:77
op::ScaleMode
ScaleMode
Definition: enumClasses.hpp:6
op::Array< float >
op::Rectangle
Definition: rectangle.hpp:11
op::HandExtractorNet
Definition: handExtractorNet.hpp:14
cl::vector
std::vector< T, Alloc > vector
Definition: cl2.hpp:567
OP_API
#define OP_API
Definition: macros.hpp:19
enumClasses.hpp
op::HandExtractorNet::mHeatMapTypes
const std::vector< HeatMapType > mHeatMapTypes
Definition: handExtractorNet.hpp:76