Is there any algorithm to detect a corner of an object on a picture? I have a list of pictures that look like this:
Top left

Bottom right

Now on picture 1 I expect top-left corner, on picture 2 I expect bottom-right, etc.
The algorithm that I need should "ensure" that the image on the picture is definitely top-left / bottom-right / etc (not just a noise, for example like on the picture below) and if it is - to return the X and Y of the corner.
The additional problem is there could be some noise on the picture as in case of picture with the bottom right corner. One more problem is that the picture of the corner can be slightly rotated.
Slightly rotated corner

UPD I should also make sure the image is the picture of the corner that I expect, because the image can look like this:
Noise

I would start in the corner of the image and then loop through the pixels to find the white pixel that is closest to the corner. Then when you find a white pixel, use the flood-fill algorithm to count how many contiguous white pixels you see. If this pixel count is above your noise threshold (maybe 20 pixels?), then consider this pixel as your corner. This should handle images that are slightly rotated.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With