CameraCalibration 中的一些错误

本文介绍了在进行CameraCalibration时遇到的与Pangolin库有关的大小写错误,包括工程代码中的命名问题以及编译过程中出现的报错。为解决问题,需要将代码中的Pangolin统一修改为小写形式pangolin。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

CameraCalibration 依赖于Pangolin,后者的代码目前有些大小写的问题,由此导致CameraCalibration工程也有类似的问题。要将工程代码中的Pangolin改成pangolin。

此外,还有一处涉及Pangolin编译报错:

/home/yasi/opencv/Pangolin-master/pangolin/../pangolin/display.h: In constructor ‘pangolin::Handler2D::Handler2D()’:
/home/yasi/opencv/Pangolin-master/pangolin/../pangolin/display.h:478: error: ‘pangolin::Handler2D::in_view’ will be initialized after
/home/yasi/opencv/Pangolin-master/pangolin/../pangolin/display.h:477: error:   ‘bool pangolin::Handler2D::pressed’
/home/yasi/opencv/Pangolin-master/pangolin/../pangolin/display.h:465: error:   when initialized here

明明是合乎C++语法规范的代码,确报错。将Pangolin中的pangolin/display.h中的下面代码

struct PANGOLIN_API Handler2D : Handler
{

	Handler2D():in_view(false), pressed(false){};

	void Keyboard(View&, unsigned char key, int x, int y, bool pressed);
	void Mouse(View&, MouseButton button, int x, int y, bool pressed, int button_state);
	void MouseMotion(View&, int x, int y, int button_state);

	bool IsInsideView() const { return in_view; }
	bool IsPressed() const { return pressed; }
	GLint const* GetLastPos() const { return last_pos; }

protected:
	MouseButton button;
	bool pressed;
	bool in_view;
	GLint last_pos[2];
};

改成

struct PANGOLIN_API Handler2D : Handler
{
	Handler2D() {
			in_view = false;
			pressed = false;
	}

	void Keyboard(View&, unsigned char key, int x, int y, bool pressed);
	void Mouse(View&, MouseButton button, int x, int y, bool pressed, int button_state);
	void MouseMotion(View&, int x, int y, int button_state);

	bool IsInsideView() const { return in_view; }
	bool IsPressed() const { return pressed; }
	GLint const* GetLastPos() const { return last_pos; }

protected:
	MouseButton button;
	bool pressed;
	bool in_view;
	GLint last_pos[2];
};
就不再报错了,但还是不解。


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值