Ask Your Question

Revision history [back]

About 1 you can use triangulate method (you need to undistort points)

About initUndistortRectifyMap first map is 2d map and second a 1D map. First is x,y mapping and iI think second is an interpolation map

you can find explanation in 2.4 docor 3.2 doc

About coordinate system see StereoCalibrate :

R   Output rotation matrix between the 1st and the 2nd camera coordinate systems.

Coordinate system is described in Detailed Description of calib3d module (sorry there is no link to detail description available)

You can try example in opencv stereomatch and stereocalib and stereobm

About 1 you can use triangulate method (you need to undistort points)

About initUndistortRectifyMap first map is 2d map and second a 1D map. First is x,y mapping and iI I think second map is an interpolation map

you can find explanation in 2.4 docor 3.2 doc

About coordinate system see StereoCalibrate :

R   Output rotation matrix between the 1st and the 2nd camera coordinate systems.

Coordinate system is described in Detailed Description of calib3d module (sorry there is no link to detail description available)

You can try example in opencv stereomatch and stereocalib and stereobm

About 1 you can use triangulate method (you need to undistort points)

About initUndistortRectifyMap first map is 2d map and second a 1D map. First is x,y mapping and I think second map is an interpolation map

you can find explanation in 2.4 docor 3.2 doc

About coordinate system see StereoCalibrate :

R   Output rotation matrix between the 1st and the 2nd camera coordinate systems.

Coordinate system is described in Detailed Description of calib3d module (sorry there is no link to detail description available)

You can try example in opencv stereomatch and stereocalib and stereobm

About remap I wrote an example to zoom an image. Source image is 3x3 matrix and destination a 6x6 matrix. First map is CV_32FC2 which is converted in 16SC2 and 16SC1 map.

#include <opencv2/opencv.hpp> 
using namespace std;
using namespace cv;
int main(int argc, char **argv)
{
Mat x=(Mat_<uchar>(3,3)<<10,20,30,60,60,60,40,50,60);
Mat map1(2*x.rows,2*x.cols,CV_32FC2);
Mat map1a;
Mat map2a;

for (int i=0;i<map1.rows;i++)
    for (int j = 0; j<map1.cols; j++)
    {
        Vec2f v(j/2.,i/2.);
        map1.at<Vec2f>(i,j)=v;
    }
cout <<"Original image \n"<< x << "\n";
cout<< "Map CV_32FC2 for a zoom  X 2 \nResults [x0,y0,x1,y0,...]\n";
cout<<map1<<"\n";
Mat y;
remap(x,y,map1,Mat(), INTER_LINEAR);
cout<< "Image zoom x2 using CV_32FC2\n";
cout << y << "\n";
// Convert a 32FC2 map in 16SC2+Interpolation map
convertMaps(map1,Mat(),map1a,map2a,CV_16SC2);
cout <<" Map CV_16SC2 for a zoom  X 2 \nResults[x0, y0, x1, y0, ...]\n"<< map1a << "\n";
cout <<" Interpolation tab \n"<< map2a << "\n";

remap(x, y, map1a, map2a, INTER_LINEAR);
cout << y << "\n";
return 0;
}

results are

Original image
[ 10,  20,  30;
  60,  60,  60;
  40,  50,  60]
Map CV_32FC2 for a zoom  X 2
Results [x0,y0,x1,y0,...]
[0, 0, 0.5, 0, 1, 0, 1.5, 0, 2, 0, 2.5, 0;
 0, 0.5, 0.5, 0.5, 1, 0.5, 1.5, 0.5, 2, 0.5, 2.5, 0.5;
 0, 1, 0.5, 1, 1, 1, 1.5, 1, 2, 1, 2.5, 1;
 0, 1.5, 0.5, 1.5, 1, 1.5, 1.5, 1.5, 2, 1.5, 2.5, 1.5;
 0, 2, 0.5, 2, 1, 2, 1.5, 2, 2, 2, 2.5, 2;
 0, 2.5, 0.5, 2.5, 1, 2.5, 1.5, 2.5, 2, 2.5, 2.5, 2.5]
Image zoom x2 using CV_32FC2
[ 10,  15,  20,  25,  30,  15;
  35,  38,  40,  43,  45,  23;
  60,  60,  60,  60,  60,  30;
  50,  53,  55,  58,  60,  30;
  40,  45,  50,  55,  60,  30;
  20,  23,  25,  28,  30,  15]
 Map CV_16SC2 for a zoom  X 2
Results[x0, y0, x1, y0, ...]
[0, 0, 0, 0, 1, 0, 1, 0, 2, 0, 2, 0;
 0, 0, 0, 0, 1, 0, 1, 0, 2, 0, 2, 0;
 0, 1, 0, 1, 1, 1, 1, 1, 2, 1, 2, 1;
 0, 1, 0, 1, 1, 1, 1, 1, 2, 1, 2, 1;
 0, 2, 0, 2, 1, 2, 1, 2, 2, 2, 2, 2;
 0, 2, 0, 2, 1, 2, 1, 2, 2, 2, 2, 2]
 Interpolation tab
[0, 16, 0, 16, 0, 16;
 512, 528, 512, 528, 512, 528;
 0, 16, 0, 16, 0, 16;
 512, 528, 512, 528, 512, 528;
 0, 16, 0, 16, 0, 16;
 512, 528, 512, 528, 512, 528]
[ 10,  15,  20,  25,  30,  15;
  35,  38,  40,  43,  45,  23;
  60,  60,  60,  60,  60,  30;
  50,  53,  55,  58,  60,  30;
  40,  45,  50,  55,  60,  30;
  20,  23,  25,  28,  30,  15]