【OpenCV】用cvCalibrateCamera2函数做标定出错,大家帮忙看下吧 20
用cvCalibrateCamera2做标定,编译通过,运行却出错。我用4张靶标图片,48个点,基本定义如下:CvMat*object_points=cvCreateMa...
用cvCalibrateCamera2做标定,编译通过,运行却出错。
我用4张靶标图片,48个点,基本定义如下:
CvMat *object_points = cvCreateMat(4*48, 3, CV_32FC1); // 定标点的世界坐标
CvMat *image_points = cvCreateMat(4*48, 2, CV_32FC1); // 定标点的图象坐标
CvMat *point_counts = cvCreateMat(4, 1, CV_32FC1);
cvSetData( point_counts, &numcorners, sizeof(int)); //numcorners=48
CvMat *distortion = cvCreateMat(1, 4, CV_32FC1); // 形变向量d
CvMat *cameraMatrix = cvCreateMat(3, 3, CV_32FC1); // 内参矩阵A
CvMat *transVects = cvCreateMat(4, 3, CV_32FC1); // 平移向量t
CvMat *rotMatrixes = cvCreateMat(4, 3, CV_32FC1); // 旋转矩阵R
编译通过,运行出错,提示:
unsupported format or combination of formats(the array of point counters must be 1-demensional integer vector),in function cvCalibrateCamera2,C:\User\VP\opencv\cv\src\cvcvcalibration.cpp(1307)
不知是什么原因?
函数定义:
void cvCalibrateCamera2( const CvMat* object_points, const CvMat* image_points,
const CvMat* point_counts, CvSize image_size,
CvMat* intrinsic_matrix, CvMat* distortion_coeffs,
CvMat* rotation_vectors=NULL,
CvMat* translation_vectors=NULL,
int flags=0 ); 展开
我用4张靶标图片,48个点,基本定义如下:
CvMat *object_points = cvCreateMat(4*48, 3, CV_32FC1); // 定标点的世界坐标
CvMat *image_points = cvCreateMat(4*48, 2, CV_32FC1); // 定标点的图象坐标
CvMat *point_counts = cvCreateMat(4, 1, CV_32FC1);
cvSetData( point_counts, &numcorners, sizeof(int)); //numcorners=48
CvMat *distortion = cvCreateMat(1, 4, CV_32FC1); // 形变向量d
CvMat *cameraMatrix = cvCreateMat(3, 3, CV_32FC1); // 内参矩阵A
CvMat *transVects = cvCreateMat(4, 3, CV_32FC1); // 平移向量t
CvMat *rotMatrixes = cvCreateMat(4, 3, CV_32FC1); // 旋转矩阵R
编译通过,运行出错,提示:
unsupported format or combination of formats(the array of point counters must be 1-demensional integer vector),in function cvCalibrateCamera2,C:\User\VP\opencv\cv\src\cvcvcalibration.cpp(1307)
不知是什么原因?
函数定义:
void cvCalibrateCamera2( const CvMat* object_points, const CvMat* image_points,
const CvMat* point_counts, CvSize image_size,
CvMat* intrinsic_matrix, CvMat* distortion_coeffs,
CvMat* rotation_vectors=NULL,
CvMat* translation_vectors=NULL,
int flags=0 ); 展开
2个回答
展开全部
CvMat *point_counts = cvCreateMat(4, 1, CV_32FC1);
改成
CvMat *point_counts = cvCreateMat(4, 1, CV_32SC1);
应该是整数
改成
CvMat *point_counts = cvCreateMat(4, 1, CV_32SC1);
应该是整数
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询