我试图使用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我希望找到一个文件路径或类似的东西,引导我走向输出数据的方向。如果有人熟悉这个图书馆,并能为我指出正确的方向,我将不胜感激。
我的计划是使用夸克API通过OSC将keypoint数据发送到SuperCollider。我使用的是MacOS X 10.11.6。
发布于 2019-07-17 02:16:18
如果您已经在openpose.cpp文件中下载了openpose示例代码,您将找到以下行
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的参数-写_json指定。例如:
c:>openpose.exe --视频“D:\user\video.avi”--写"D:\user\desktop\output.json“
输入是视频"D:\user\video.avi“,json输出是"D:\user\desktop\output.json”。
注意:如果不使用参数--写json,它将不会写入json输出。
更新1:如果您想直接访问关键点,可以遵循如何访问姿态关键点
https://stackoverflow.com/questions/57061757
复制相似问题