How to match texture similarity in images?

南楼画角 提交于 2019-11-28 16:55:06

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.

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.

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!