【发布时间】:2016-10-02 20:59:37
【问题描述】:
我正在尝试使用圆形网格执行相机校准。我一直没有成功,因为findCirclesGrid 总是返回 false,即使文件只是一个圆圈网格。我把它归结为这个简单的程序:
#include <iostream>
#include "opencv2/core.hpp"
#include "opencv2/imgproc.hpp"
#include "opencv2/highgui.hpp"
#include "opencv2/calib3d.hpp"
using namespace std;
using namespace cv;
int main(int argc, char *argv[]) {
Mat image;
// read an image
if (argc < 2)
image = imread("circleGridSmall.jpg");
else
image = imread(argv[1]);
if (!image.data) {
cout << "Image file not found\n";
return 1;
}
imshow("image", image);
waitKey(0);
bool found;
vector<Point2f> pointbuf;
found = findCirclesGrid( image, Size(8, 12), pointbuf);
printf("found: %d\n", found);
return 0;
}
还有这张简单的图片:
即使这样,findCirclesGrid 也会返回 false。我错过了什么?
【问题讨论】: