Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

提取ORB特征点时是不是应该按照灰度图读取图片? #10

Open
cowant opened this issue Aug 28, 2019 · 1 comment
Open

Comments

@cowant
Copy link

cowant commented Aug 28, 2019

第七章的代码读取图片时都是按彩色图读取的,但是FAST关键点不应该是基于灰度的算法吗?这里不明白为什么不是按照灰度图读取。在pose_estimation_2d2d.cpp的程序里如果按照灰度图读取图片,那么得到的R,t参数与按照彩色读取是不一样的:

  • 原来的读取参数为 CV_LOAD_IMAGE_COLOR
 Mat img_1 = imread(argv[1], CV_LOAD_IMAGE_COLOR);
 Mat img_2 = imread(argv[2], CV_LOAD_IMAGE_COLOR);
R is 
[0.9985534106102478, -0.05339308467584758, 0.006345444621108698;
 0.05321959721496264, 0.9982715997131746, 0.02492965459802003;
 -0.007665548311697523, -0.02455588961730239, 0.9996690690694516]
t is 
[-0.8829934995085544;
 -0.05539655431450562;
 0.4661048182498402]
  • 修改为cv::IMREAD_GRAYSCALE
 Mat img_1 = imread(argv[1], cv::IMREAD_GRAYSCALE);
 Mat img_2 = imread(argv[2], cv::IMREAD_GRAYSCALE);
R is 
[0.9956586755557854, -0.06056285980694839, 0.07068197650393594;
 0.05735576134499068, 0.9972677254086454, 0.04655534876684903;
 -0.07330837899609778, -0.04229921831748662, 0.9964118915883602]
t is 
[-0.9753492080965818;
 -0.2054788588410324;
 0.08045098405089755]
@gaoxiang12
Copy link
Owner

OpenCV本身接口支持彩色图像,内部应该会再转换一次,这个不影响。但是彩色图提的点和灰度图提的点会有一些区别,导致R,t计算结果也存在区别。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants