How to match texture similarity in images?

AruniRC picture AruniRC · May 22, 2011 · Viewed 16.9k times · Source

What are the ways in which to quantify the texture of a portion of an image? I'm trying to detect areas that are similar in texture in an image, sort of a measure of "how closely similar are they?"

So the question is what information about the image (edge, pixel value, gradient etc.) can be taken as containing its texture information.

Please note that this is not based on template matching.

Wikipedia didn't give much details on actually implementing any of the texture analyses.

Answer

DanielHsH picture DanielHsH · May 22, 2011

Do you want to find two distinct areas in the image that looks the same (same texture) or match a texture in one image to another? The second is harder due to different radiometry.

Here is a basic scheme of how to measure similarity of areas.

  1. You write a function which as input gets an area in the image and calculates scalar value. Like average brightness. This scalar is called a feature
  2. You write more such functions to obtain about 8 - 30 features. which form together a vector which encodes information about the area in the image
  3. Calculate such vector to both areas that you want to compare
  4. Define similarity function which takes two vectors and output how much they are alike.

You need to focus on steps 2 and 4.

Step 2.: Use the following features: std() of brightness, some kind of corner detector, entropy filter, histogram of edges orientation, histogram of FFT frequencies (x and y directions). Use color information if available.

Step 4. You can use cosine simmilarity, min-max or weighted cosine.

After you implement about 4-6 such features and a similarity function start to run tests. Look at the results and try to understand why or where it doesnt work. Then add a specific feature to cover that topic. For example if you see that texture with big blobs is regarded as simmilar to texture with tiny blobs then add morphological filter calculated densitiy of objects with size > 20sq pixels.

Iterate the process of identifying problem-design specific feature about 5 times and you will start to get very good results.