# Transforming part of an image to a square

I'm trying to detect pieces on a photographed checkerboard. Determining the corners of each square works fine, but for each of those squares I'd like to generate an image from the original image and the four corners. How can I do this?

Edit: To be clear, the four corners don't form a square (or even a rectangle) yet, as we're dealing with a photograph that could be taken at a rotation and at an angle. For instance, the corners might be

{{0, 3}, {5, 4}, {7, 10}, {0, 8}}


I'd like to transform the image in such a way that these points are mapped like this:

{0,  3} -> {0, 0}
{5,  4} -> {0, y}
{7, 10} -> {x, y}
{0,  8} -> {x, 0}


with x the width and y the height of the transformed image.

• Please add more detail, sample images and code to show exactly where you are at. Put yourself in our position (i.e. with no background and knowledge of your problem whatsoever) - what would you need in a question to answer it? – Yves Klett Apr 12 '16 at 7:38
• With ImageTake/ImageCrop? – Kuba Apr 12 '16 at 7:39
• How are people supposed to try things out without the picture you're speaking of? – J. M. is away Apr 12 '16 at 9:22
• FindGeometricTransform / ImagePerspectiveTransformation? – Niki Estner Apr 12 '16 at 9:29
• – Niki Estner Apr 12 '16 at 10:59