Question about initUndistortRectifyMap & remap function

I study opencv finsheye calibration document, and using initUndistortRectifyMap and remap function to get undistortion result. Then there ara some question:

1). The output of initUndistortRectifyMap map1 and map2 are 2 channels and 1 channel respectively. According to document about remap, I know the reason why map1 is 2 channels, but what is map2 meaning?
2). I use remap funcion, and try to let map2 be None, but get the wrong result, the pixel values in result are all (0, 1, 0). Why?



See convertMaps for details

1 Like

Hi crackwitz,

Thanks for your prompt reply.
There are some questions I still don’t understand:

  1. According to convertMaps page I know that the first output array contains the rounded coordinates. But I still don’t understand why the second output array contains indices in the interpolation tables ?

  2. I understand interpolation, but what is interpolation table doning? In my situation, map2 is a output array with size w*h, and value between 0~1024.

  3. In remap function, When map1 and map2 are both 1-channel, representing map_x and map_y, I can clearly understand what the remap function is doing.
    However, when map1 and map2 are 2-channel and 1-channel respectively, I am not sure what the remap function does.