Apply an edge finding (both vertical and horizontal) algorithm. Try to scale your image down first (< 100x100) and take the grey scale for optimization.
Try the simplistic kernel of
for horizontal edge and
for vertical edge,
I assume that your "rectangle" will look like
as it seems to be on the ground, so go through your filtered image and try to recognize those pattern with something like a machine learning algorithm
Either way, it's pretty tough...