poseRenderer.hpp 1.7 KB
Newer Older
1 2
#ifndef OPENPOSE_POSE_POSE_RENDERER_HPP
#define OPENPOSE_POSE_POSE_RENDERER_HPP
G
gineshidalgo99 已提交
3 4

#include <memory> // std::shared_ptr
G
Gines Hidalgo 已提交
5
#include <openpose/core/array.hpp>
6
#include <openpose/core/point.hpp>
G
Gines Hidalgo 已提交
7 8
#include <openpose/core/renderer.hpp>
#include <openpose/utilities/macros.hpp>
G
gineshidalgo99 已提交
9 10 11 12 13 14 15 16
#include "poseExtractor.hpp"
#include "poseParameters.hpp"

namespace op
{
    class PoseRenderer : public Renderer
    {
    public:
17 18 19
        explicit PoseRenderer(const Point<int>& heatMapsSize, const Point<int>& outputSize, const PoseModel poseModel, const std::shared_ptr<PoseExtractor>& poseExtractor,
                              const bool blendOriginalFrame = true, const float alphaKeypoint = POSE_DEFAULT_ALPHA_KEYPOINT,
                              const float alphaHeatMap = POSE_DEFAULT_ALPHA_HEAT_MAP, const unsigned int elementToRender = 0u);
G
gineshidalgo99 已提交
20 21 22 23 24 25 26 27 28 29 30 31 32

        ~PoseRenderer();

        void initializationOnThread();

        bool getBlendOriginalFrame() const;

        bool getShowGooglyEyes() const;

        void setBlendOriginalFrame(const bool blendOriginalFrame);

        void setShowGooglyEyes(const bool showGooglyEyes);

33
        std::pair<int, std::string> renderPose(Array<float>& outputData, const Array<float>& poseKeypoints, const float scaleNetToOutput = -1.f);
G
gineshidalgo99 已提交
34 35

    private:
36 37
        const Point<int> mHeatMapsSize;
        const Point<int> mOutputSize;
G
gineshidalgo99 已提交
38
        const PoseModel mPoseModel;
G
Gines Hidalgo 已提交
39
        const std::map<unsigned int, std::string> mPartIndexToName;
G
gineshidalgo99 已提交
40 41 42 43 44 45 46 47 48 49
        const std::shared_ptr<PoseExtractor> spPoseExtractor;
        std::atomic<bool> mBlendOriginalFrame;
        std::atomic<bool> mShowGooglyEyes;
        // Init with thread
        float* pGpuPose;        // GPU aux memory

        DELETE_COPY(PoseRenderer);
    };
}

50
#endif // OPENPOSE_POSE_POSE_RENDERER_HPP