2

I have images with repeated patterns in them. I would like to find similar images based on having similar patterns.

The patterns are made of crosses, triangles, squares which are combined to form more complicated structures made of those "primitive shapes". For example, imagine a cross made of triangles or hexagons etc.

These decorations are found in wallpapers, carpets, kilims, wool sweaters and even some paintings.

An example image from wikipedia is here

My typical application is to find, say, sweaters with similar patterns in them. Ignoring colour for the moment.

I have tried to extract SIFT descriptors (using C++ and OpenCV) and match these between two images. However, they match tiny areas e.g. the vertex of a hexagon and a triangle but ideally I would like to match the actual shapes of the triangle and rectangle.

It works a bit better if I scaled down the images but still I sense I need a different approach than SIFT and friends.

Can anyone suggest other methods for these kind of problems?

bliako
  • 977
  • 1
  • 5
  • 16
  • If you have a large dataset of images you want to match against, you could train a CNN. – nz_21 Aug 22 '18 at 10:11
  • I do have a very large dataset but it is not labelled. Is there CNN flavour which is self-organised? – bliako Aug 22 '18 at 10:21

1 Answers1

1

If you know patterns you're looking for a priori, you can do old school template matching. It may not be as trendy as deep learning techniques but for constrained problems can be effective.

  1. Load in your N templates
  2. Load in the image you want to test against.
  3. Normalise the image and templates (possibly including conversion to grayscale and some histogram and white balance equilisation)
  4. Create some M perturbations of each template (ie, different scales, rotations, and perspective transforms)
  5. Do template between between your NxM templates and your image.

You can optimise the above slightly by doing the template matching in the Fourier domain since you only need to do the 2D FFT of the image once. You can also precalculate and store the pertubations - or better yet: store their Fourier transforms.

Spoonless
  • 561
  • 5
  • 14
  • Thanks for the hints. Maybe I can cut N random, small patches from each image and try template-matching them with every other image. The number of matches would give me an indication of similarity. WITHOUT having to create any labels for a training set. What worries me is the computational burden of the above for 13,000 images. – bliako Aug 23 '18 at 14:34