Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to match texture similarity in images?

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.

like image 607
AruniRC Avatar asked May 22 '11 13:05

AruniRC


People also ask

How do you find the similarity between two images?

The similarity of the two images is detected using the package “imagehash”. If two images are identical or almost identical, the imagehash difference will be 0. Two images are more similar if the imagehash difference is closer to 0.

How do you compare textures?

The best way to perform texture similarity analysis between images is to do a) texture analysis and b) image quality analysis. Then you compare the extracted features taken from the two images.

What is texture analysis in image processing?

Texture analysis refers to the characterization of regions in an image by their texture content. Texture analysis attempts to quantify intuitive qualities described by terms such as rough, smooth, silky, or bumpy as a function of the spatial variation in pixel intensities.


2 Answers

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.

like image 173
DanielHsH Avatar answered Nov 05 '22 18:11

DanielHsH


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.

like image 29
Andrey Sboev Avatar answered Nov 05 '22 20:11

Andrey Sboev