Ask Your Question

SrSRG's profile - activity

2016-07-15 05:38:00 -0500 commented question remap single point does not give me the correct value

So the mappings work on the whole imframe if I remap it. but if i draw a circle in the remaped image using the mapx.at<float>(imframe.rows/2,imframe.cols/2) it does not follow the remapped image

2016-07-15 05:35:30 -0500 commented question remap single point does not give me the correct value

This is the code for creating the maps. This is basically a barrell distortion mapping // clean the room mapx.release(); mapy.release();

// allocate the maps
mapx.create( imframe.size(), CV_32FC1 );
mapy.create( imframe.size(), CV_32FC1 );

// the image size
int w = imframe.cols;
int h = imframe.rows;

for (int y = 0; y < h; y++) {
    int ty= y-Cy;
    for (int x = 0; x < w; x++) {
        int tx= x-Cx;
        int rt= tx*tx+ty*ty;

        mapx.at<float>(y,x) = (float)(tx*(1+kx*rt)+Cx);
    }
}

for (int y = 0;y < h; y++) {
    int ty= y-Cy;
    for (int x = 0; x < w; x++) {
        int tx= x-Cx;
        int rt= tx*tx+ty*ty;

        mapy.at<float>(y,x) = (float)(ty*(1+ky*rt)+Cy);
    }
}
2016-07-15 05:22:15 -0500 commented question remap single point does not give me the correct value

my mistake... the point can be mapx.at<float>(input.rows/2,input.cols/2) and still give me the wrong value

2016-07-15 05:10:05 -0500 asked a question remap single point does not give me the correct value

Hello!

I am trying to compute the remaped position of a specific point of an image but it does not give me the correct coordinate as I compare it with the remaped image.

is this correct?

Point2f relocated = Point2f(mapx.at<float>(input.rows,input.cols),mapy.at<float>(input.rows,input.cols));