2
$\begingroup$

The problem: Only pattern-like images are supposed to be uploaded and be used as backgrounds to a site, photos should not. How would you detect if an image looks enough like itself to be regarded as a pattern?

$\endgroup$
2
$\begingroup$

I'm no expert in image processing, but generally, repeating patterns can be identified relatively easily in the frequency domain. This is true for signal as well as image processing.

From what I understand of your question, you want to check that each image is composed almost completely of some repeating pattern, and reject those which are not (for example, photos).

You might want to try a Fast Fourier Transform of the image, and look for peaks in the frequency domain. Here is a similar question on SO, and this accepted answer gives good suggestions - try FFT, Wavelet analysis and auto-correlation, in that order of chance of working effectively. The other answers also give links to good references, especially this link.

A google search for "Detect repeating pattern in images" should give you good references, such as this, this, this and this.

Most of these references look for unknown repeating patterns in a given image, and locate those patterns. You would need to perform some post-processing on this that ensures that the repeating pattern (almost) completely covers your image, and not a small portion of the image. This should rule out repeating patterns in parts of the image, say the pattern on a person's shirt.

$\endgroup$
  • $\begingroup$ What about a gradient, or irregular patterns like a Penrose tiling? $\endgroup$ – vonbrand Mar 17 '13 at 0:12
  • $\begingroup$ @vonbrand A gradient can be detected separately, and fairly easily. As for Penrose tiling, or other irregular patterns, things become difficult. Since the OP uses phrases like "similarities in the same image" and "image looks enough like itself", I assumed them to be regular patterns. There could be naive workarounds for irregular patterns, where a unique tile is identified, searched for in the image using something like auto-correlation (keeping in mind rotations can occur), identify the next uncovered tile, and repeat. There should be better ways, but I am not aware of them. $\endgroup$ – Paresh Mar 17 '13 at 13:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.