How to match texture similarity in images?
Asked Answered
G

3

14

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.

Goofball answered 22/5, 2011 at 13:58 Comment(0)
U
33

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.

Unquestioned answered 22/5, 2011 at 15:17 Comment(4)
Thanks this seems more lightweight than implementing all the GLCM texture measures in OpenCV. Could you please provide some more info on the histogram of FFT, links maybe? The others are great.Goofball
what is "histogram of FFT"? Does it make sense to build a histogram on top of Fourier transform? May be simply choose from FT some frequency range relevant to notion of texture and use this range as a texture featureJennee
By histogram of FFT I mean first applying FFT and then using some information as features. Using every frequency as featurer yields too much unneeded information. So you can choose the following features: ratio of sum of high frequency in X direction divided by y direction, ratio of high frequencies divided by low frequencies (causion: never use DC frequency), etcUnquestioned
P.s. If you are using libraries (like openCV) you can extract more advanced features like surf, spark, sift, lbp etc. I gave example of a simple feature which you can write by yourself.Unquestioned
J
6

I'd suggest to use wavelet analysis. Wavelets are localized in both time and frequency and give a better signal representation using multiresolution analysis than FT does.

Thre is a paper explaining a wavelete approach for texture description. There is also a comparison method.

You might need to slightly modify an algorithm to process images of arbitrary shape.

Jennee answered 23/5, 2011 at 9:40 Comment(2)
In the Haar wavelet section what is meant by "three detail images (LH, HL, and HH)"? The wavelet levels is ok, I have coded that hoever I didn't understand what is meant by the LH, HL and HH images in context of the Haar wavelet transform. If you would pls explain this a bit.Goofball
They are horizontal, vertical and diagonal features of image at particular level L. You can easily find explanation of that in the internet. For example link ceremade.dauphine.fr/~peyre/numerical-tour/tours/…Jennee
S
2

An interesting approach for this, is to use the Local Binary Patterns. Here is an basic example and some explanations : http://hanzratech.in/2015/05/30/local-binary-patterns.html

See that method as one of the many different ways to get features from your pictures. It corresponds to the 2nd step of DanielHsH's method.

Slipknot answered 22/10, 2015 at 15:42 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.