How can I detect which shapes are tiled in this black and white tileable image, using python opencv?
The leftmost and rightmost white patches are continuation of each other and therefore should get detected.
I tried to offset/wrap the image horizontally and vertically and recheck the image for connected labels but if the patches are in the corner or very large, it would be quite tricky. Another option was to transform the image into polar coordinates (i.e. projecting on 3D sphere) and dealing with degrees instead of pixels, but it felt too complicated to do unless there are easier ways to go about it. A fast method I have in mind to do is
- Check if the patch is on the borders
- If yes, look for other labels that are on borders
- Check position of both labels if they line up (not sure how to do it yet).
- If they do, they belong to each other