简体中文 English

 找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 221|回复: 1

Native中如何获取灰度Camera数据

[复制链接]

Native中如何获取灰度Camera数据

[复制链接]
DavidChen

主题

0

回帖

415

积分

版主

积分
415
2023-9-14 10:21:19 | 显示全部楼层 |阅读模式
本帖最后由 DavidChen 于 2023-9-26 11:06 编辑

示例代码(提取码:dcf0):
Demo

主要代码:
  1. // 帧数据,一般data是一个size为2的vector,data[0]是左camera数据,data[1]是右camera数据
  2. std::vector<uint8_t *> data;
  3. // 帧数据对应的位姿矩阵
  4. float twb[16];
  5. // 帧数据对应的时间戳
  6. double ts = -1;
  7. // 帧数据的宽
  8. int cam_w;
  9. // 帧数据的长
  10. int cam_h;

  11. get_camera_frame(data, cam_w, cam_h, twb, ts);

  12. log_debug("get_camera_frame {%d, %d} {%f, %f, %f} %d", cam_w, cam_h,
  13.       twb[0], twb[1], twb[2], data.size());

  14. data.clear();
复制代码


需要使功能生效,需要把下面附件中的render.yaml push 到盒子的sdcard路径下,如果该路径原来已经存在render.yaml,那么在该文件中添加 enable_get_camera_frame: true

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

×
楼主
DavidChen 楼主

主题

0

回帖

415

积分

版主

积分
415
2023-9-26 09:27:34 | 显示全部楼层
  1. // lr 0 6dof 手柄右手柄;1 6dof 手柄左手柄;2 3dof 手柄(主机)
  2. // pose 表示手柄位姿矩阵
  3. // 返回值 -1 表示调用失败,返回 0 表示调用成功
  4. int get_controller(int lr, float *pose);

  5. // lr 0 6dof 手柄右手柄;1 6dof 手柄左手柄;2 3dof 手柄(主机)
  6. // v 表示事件队列,获取之后可以遍历事件做对应的处理
  7. void pull_event(int lr, std::vector<struct yyss_event_info> &v);

  8. // 预留接口,用于APP向服务发送指令
  9. int command(int key, const std::string value, std::string &result);

  10. // 获取预测位姿,predictMs单位毫秒
  11. int get_predict_pose(float *pose, float predictMs);

  12. // 是否是bypass模式,当设置bypass为true时,渲染方式为直接上屏
  13. void set_bypass(bool bypass);

  14. // 获取手势信息,目前手势效果还在优化,未完全开放
  15. void get_hands(double &dt, std::vector<struct yyss_hand_pose_info> &hands,
  16.                std::vector<struct yyss_hand_key_info> &keys);

  17. // 帧数据,一般data是一个size为2的vector,data[0]是左camera数据,data[1]是右camera数据 std::vector<uint8_t *> data;
  18. // 帧数据对应的位姿矩阵 twb[16];
  19. // 帧数据对应的时间戳 ts;
  20. // 帧数据的宽 cam_w;
  21. // 帧数据的长 cam_h;
  22. void get_camera_frame(std::vector<uint8_t *> &data, int &cam_w, int &cam_h, float *twb, double &ts);

  23. // 获取运动轨迹
  24. void get_trajs(std::vector<float> &trajs);

  25. // 是否开启see through
  26. void set_seethrough(bool on);
复制代码
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|小黑屋|耀宇视芯论坛 | 苏ICP备2023041931号|苏公网安备32010502010808

GMT+8, 2024-9-20 00:39 , Processed in 0.052139 second(s), 17 queries .

快速回复