I'm looking for a good method to detect whether an image has a repeating pattern of similar shapes or is just noise with no discernible pattern. This is best shown by looking at a couple of images:
- The method here would return True, and ideally identify that there are ~35 repeating shapes in the image (I wouldn't expect it necessarily to identify the cropped out shape in the lower right corner.
Returns TRUE
- The method here would return FALSE. While there are a lot of distinct shapes in this image, it is clear visually that there is no repeating pattern of similar shapes.
Returns FALSE
A few notes:
- The images are from patterns on a shirt. The shapes that repeat themselves aren't all exactly the same size, and may not be exactly evenly spaced. There may be anywhere from 10 shapes to several thousand shapes on a single image.
- I do not know in advance the size or characteristics of the shapes that repeat themselves. I'm taking these images from shirts so you can imagine there are many different types of repeating shapes.
- I've been using scipy.ndimage.measurements.label to identify all of the individual shapes in an image. I also use dilation to combine nearby shapes and can filter out really small shapes.
I've struggled to come up with a method that is flexible enough to work with the multitude of different patterns I'm dealing with but also rigid enough to reject noise.
Appreciate any help!