How can I find the coordinates of the four corners in this "square" in Matlab? I tried with corner, regionprops('Extrema') and detectMinEigenFeatures with no luck. The problem is the blue square is not a perfect square, so I need some kind of sharpening edge technique or a more "intelligent" find-corner-algorithm to find them.

Because I'm a nice guy, I've translated the Tasos's explainations into code, check the comments :
RESULTS:
The distance (y-axis) vs angle (x-axis) plot:
The final detection: