I have a distorted shot of my webcam. as a jpeg file, internal matrix and distortion factors: -
matrix intrisic matrix
(1137.0919189453125,0.0,383.99273681640625)
(0.0,264.17974853515625,312.74951171875)
(0.0,0.0,1.0)
matrix distortion :-
(-0.26913660764694214)
(0.22259517014026642)
(-0.0928017795085907)
(0.26249778270721436)
I don’t know how to load these distortion factors into CvMat to get an undistorted image using these distortion factors. Also, I want to do this only with javacv.
edit: - Also, I know the function
IplImage mapx=cvCreateImage(cvSize(src_img),IPL_DEPTH_32F,1);
IplImage mapy=cvCreateImage(cvSize(src_img),IPL_DEPTH_32F,1);
cvInitUndistortMap(CvMat intrinsic,CvMat distortion, IplImage mapx, IplImage mapy);
cvRemap(IplImage tm,IplImage src,IplImage mapx,IplImage mapy,CV_INTER_LINEAR|CV_WARP_FILL_OUTLIERS,cvScalarAll(0));
but I don’t know how to initialize the corresponding cvMats for the internal matrix and distortion coefficient.?
source
share