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 (ie 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
1) Find vertical cut line, which not contains white pixels.
2) Split the image vertically by the cut line.
3) Flip one of the image halves you got.
4) Concatinate images vertically.
5) Find connectes components.
6) Split it again and recombine halves to source image.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.