You can use the OpenCV library to find the position of a white square of size 100 x 100 pixels in a binary image. Here is the code snippet that does that:
main.py1057 chars35 lines
This code loads the binary image, create a kernel of size 100 x 100 pixels, and perform erosion and dilation operations to remove noise and find blobs. Then, it finds the contours in the binary image, and checks if any of them has the shape of a square of size 100 x 100 pixels. If it does, then it draws a blue rectangle around it. Finally, it saves the output image.
gistlibby LogSnag