I want to make a program that finds the object in the picture.
I decided that it would be easiest to recognize it by color, because the background under the object could have any other color.
So far I managed to do it, but I don’t know what to do next …
The program filters pixels from the palette I have defined and the rest is changed to black.
Now I need to find the corners of the object that remained. To this end, I thought that the program should find X and Y of the remaining pixels (excluding black).
Respectively:
min X, min Y
max X, min Y
min X, max Y
max X, max Y
I add photos of what I stood on and I can’t handle it.
Do you have other example of images you want to post process? Do they all have dark and light areas splited with straight lines like in your example? And what do you want to do with it afterwards?
As you can see, your 4 points appears in but option I tried but the tricky part is now to actualy extract them from that set of options.
Now, once again the process to really extract those points will greatly depends on how similar your shapes are.
You say they are similar but what does it means? Are they all sheared rectangles? Are they all sheared to the right? Is the background always the same? Is there always a dark edge?
Without seeing more of the pictures you want to extract it will be quite hard to help you exracting those 4 corner points.