I've been trying to find the best way to detect the 4 black squares on the paper and use them to isolate the paper in its own image.

I've been trying to find the best way to detect the 4 black squares on the paper and use them to isolate the paper in its own image.
