Computational image warping by Chessboard Mask

I’m trying figure out the best way to distort given image on chess-boarded mask.

Both have the same aspect ratio. Theoretically, I could calculate square edges and build a grid of points. And after, extrapolate each pattern pixel to approximate destination on mask based on parent square edges.

But maybe there is more elegant way to do it? With openCV or anything of computer vision algorithms?

Right. it shoudl be as you describe. Check ofxCv as it has some handy stuff for making your life easier with openCV. there is a Calibration class that has a findBoard method, that I think is the one you should use.

Where are you getting the warped image from?
another way would be to encode in the original chessboard the pixel position in its pixel value, so then you can use a shader and read the pixel values so you can extract the correct color from the to-be-warped-image.