I have a large number (~50000) of square greyscale images, about 180x180 pixels. I need to efficiently scan them for containing significant block like regions. See the following pictures where I have drawn examples. However they could be scattered anywhere in the image and have fuzzy boundaries so some thresholding is necessary.
The output should be something like, "(x1,y1,x2,y2) average 95% white, (x3,y3,x4,y4) average 92% black", etc
What algorithms can scan images and pick up features like this, efficiently?