It is the process of taking pixels from one place in the image and locating them in another position in a new image.
To accomplish the mapping process, it might be necessary to do some interpolation for non-integer pixel locations, since there will not always be a one-to-one-pixel correspondence between source and destination images.
We can express the remap for every pixel location as:
where is the remapped image, the source image and is the mapping function that operates on .
Let’s think in a quick example. Imagine that we have an image and, say, we want to do a remap such that:
What would happen? It is easily seen that the image would flip in the direction. For instance, consider the input image:
observe how the red circle changes positions with respect to x (considering the horizontal direction):
In OpenCV, the function remap offers a simple remapping implementation.