0

我正在尝试使用OpenPose姿势估计库(C++)来输出身体位置信息,以便使用SuperCollider创建声音。

JSON信息作为文件输出,我想实时输出数据。我尝试查看 OpenPose 的源代码,但找不到指定输出格式的任何特定部分。“filestream”文件夹中的头文件似乎只包含变量声明,如下图:

#ifndef 
OPENPOSE_FILESTREAM_DATA_SAVER_HPP
#define 
OPENPOSE_FILESTREAM_DATA_SAVER_HPP

#include <openpose/core/common.hpp>
#include <openpose/utilities/string.hpp>

namespace op
{
    class OP_API FileSaver
    {
     protected:
        explicit FileSaver(const std::string& directoryPath);

        virtual ~FileSaver();

        std::string getNextFileName(const unsigned long long index) const;

        std::string getNextFileName(const std::string& fileNameNoExtension) const;

    private:
        const std::string mDirectoryPath;
    };
}

#endif // OPENPOSE_FILESTREAM_DATA_SAVER_HPP

我希望找到一个文件路径或类似的东西,引导我了解数据的输出方向。如果有人熟悉这个库并且可以指出我正确的方向,那将不胜感激。

我的计划是使用Quarks API通过OSC将关键点数据发送到 SuperCollider 。我正在使用 MacOS X 10.11.6。

4

1 回答 1

2

如果您已经下载了 openpose 示例代码,在文件openpose.cpp中,您会找到该行

DEFINE_string(write_json,"","Directory to write OpenPose output in JSON format. It includes body, hand, and face pose keypoints (2-D and 3-D), as well as pose candidates (if `--part_candidates` enabled).");

json输出文件的路径由main的参数--write_json指定。例如:

c:>openpose.exe --video "D:\user\video.avi"--write_json "D:\user\desktop\output.json"

输入是视频“ D:\user\video.avi ”,json 输出是“ D:\user\desktop\output.json

注意:如果不使用参数--write_json,则不会写入json输出。

更新 1:如果您想直接访问关键点,您可以按照如何访问姿势关键点

于 2019-07-17T02:16:18.580 回答