double reprojectionErrorCalculation(IplImage *rgbImage, CvMat *objectPoints, CvMat *imagePoints, CvMat *calibrationMatrix, CvMat *rotationMatrix, CvMat *translationVector){
IplImage* img=cvCreateImage(cvSize(rgbImage->width,rgbImage->height),rgbImage->depth,rgbImage->nChannels);
cvCopy(rgbImage,img);
int numPoints=objectPoints->height;
CvMat* translationMatrix=cvCreateMat(3,numPoints,CV_32FC1);
for(int i=0;i<3;i++){
float* ptr=(float*)(translationMatrix->data.ptr+i*translationMatrix->step);
float* ptrTranslation=(float*)(translationVector->data.ptr+i*translationVector->step);
for(int j=0;j<numPoints;j++){
*(ptr+j)=*ptrTranslation;
}
}
CvMat* objectPointsTranspose=cvCreateMat(3,numPoints,CV_32FC1);
cvTranspose(objectPoints,objectPointsTranspose);
CvMat* imagePointsHomogeneous=cvCreateMat(3,n
一个计算reprojection error的小程序
最新推荐文章于 2023-02-21 17:46:34 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)