【发布时间】:2013-07-14 00:09:19
【问题描述】:
我正在尝试让 OpenCV 2.4.5 识别来自我的网络摄像头的棋盘格图案。我无法让它工作,所以我决定尝试使用“完美”的图像来让它工作:
但它仍然无法正常工作——patternFound 每次都返回 false。有谁知道我做错了什么?
#include <stdio.h>
#include <opencv2/core/core.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/calib3d/calib3d.hpp>
#include <opencv2/highgui/highgui.hpp>
using namespace cv;
using namespace std;
int main(){
Size patternsize(8,8); //number of centers
Mat frame = imread("perfect.png"); //source image
vector<Point2f> centers; //this will be filled by the detected centers
bool patternfound = findChessboardCorners(frame,patternsize,centers);
cout<<patternfound<<endl;
drawChessboardCorners(frame, patternsize, Mat(centers), patternfound);
cvNamedWindow("window");
while(1){
imshow("window",frame);
cvWaitKey(33);
}
}
【问题讨论】:
标签: c++ opencv computer-vision camera-calibration