1 | initial version |
You need to be using the remap function. It takes two tables, one for the x and one for the y, and you would apply it to each color separately.
Take a look at the basic tutorials to see how to do the simple things like reading in images and the basics of OpenCV. Here's the one for re-mapping images.