似乎我是唯一一个使用 Opencv 2.4.3 遇到这个问题的人。
http://docs.opencv.org/modules/calib3d/doc/camera_calibration_and_3d_reconstruction.html 该官网公布了以下代码:
Size patternsize(8,6); //interior number of corners
Mat gray = ....; //source image
vector<Point2f> corners; //this will be filled by the detected corners
//CALIB_CB_FAST_CHECK saves a lot of time on images
//that do not contain any chessboard corners
bool patternfound = findChessboardCorners(gray, patternsize, corners,
CALIB_CB_ADAPTIVE_THRESH + CALIB_CB_NORMALIZE_IMAGE
+ CALIB_CB_FAST_CHECK);
if(patternfound)
cornerSubPix(gray, corners, Size(11, 11), Size(-1, -1),
TermCriteria(CV_TERMCRIT_EPS + CV_TERMCRIT_ITER, 30, 0.1));
drawChessboardCorners(img, patternsize, Mat(corners), patternfound);
gray
是Mat
, 直接用作void*
但在我的视觉工作室 2010 上,它一直说错误
Error 1 error C2664: 'cvFindChessboardCorners' : cannot convert parameter 1 from 'cv::Mat' to 'const void *' 22
而且,我尝试了以下方法,但仍然是同样的错误。
static_cast<void*>(gray)
Error 1 error C2440: 'static_cast' : cannot convert from 'cv::Mat' to 'void *' 21
(void*)gray
Error 1 error C2440: 'type cast' : cannot convert from 'cv::Mat' to 'void *' 21
我正在使用 OpenCV 2.4.3。请帮忙。