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.

  • $\begingroup$ 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? $\endgroup$
    – Yves Klett
    Apr 12, 2016 at 7:38
  • 1
    $\begingroup$ With ImageTake/ImageCrop? $\endgroup$
    – Kuba
    Apr 12, 2016 at 7:39
  • 1
    $\begingroup$ How are people supposed to try things out without the picture you're speaking of? $\endgroup$ Apr 12, 2016 at 9:22
  • 2
    $\begingroup$ FindGeometricTransform / ImagePerspectiveTransformation? $\endgroup$ Apr 12, 2016 at 9:29
  • 1
    $\begingroup$ Related: mathematica.stackexchange.com/a/63897/242, mathematica.stackexchange.com/a/13922/242 $\endgroup$ Apr 12, 2016 at 10:59


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.