获取IntelRealSense d435i 相机内参

获取IntelRealSense d435i 相机内参

摘要

本文提供了一种获取IntelRealSense d435i相机内参的方法。

实现

#include <iostream>
#include <librealsense2/rs.hpp>

using namespace std;
using namespace rs2;

int main()
{
	pipeline pipe;
	frameset frames;
	config cfg;

	//cfg.enable_stream(RS2_STREAM_DEPTH, 640, 480, RS2_FORMAT_Z16, 30);
	cfg.enable_stream(RS2_STREAM_COLOR, 640, 480, RS2_FORMAT_BGR8, 30);
	
	pipe.start(cfg);
	for (int i = 1; i < 20; i++)pipe.wait_for_frames();
	frames = pipe.wait_for_frames();

	auto color= frames.get_color_frame();
	//auto depth = frames.get_depth_frame();

	stream_profile color_profile = color.get_profile();
	//stream_profile depth_profile = depth.get_profile();
	
	auto rvsprofile = video_stream_profile(color_profile);
	//auto dvsprofile = video_stream_profile(depth_profile);
	
	rs2_intrinsics a = rvsprofile.get_intrinsics();
	//rs2_intrinsics a = dvsprofile.get_intrinsics();
	
	cout << "fx:\t" << a.fx << endl;
	cout << "fy:\t" << a.fy << endl;
	cout << "ppx:\t" << a.ppx << endl;
	cout << "ppy:\t" << a.ppy << endl;
	return 0;
}

提示1:代码时之前找到之后改的,但是现在找不到原链接了,这里只是记录一下,如果侵权请联系我删除。

提示2:不同分辨率和传感器可以通过cfg调整。


  • 1
    点赞
  • 27
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 5
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 5
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

wdmcs

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值