File Exchange

image thumbnail

Sparse set of Features for Texture Discrimination

version 1.1.0.0 (104 KB) by Omid Aghazadeh
This package implements the Features mentioned in the PhD thesis of Thomas Brox.

1 Download

Updated 18 May 2010

View Version History

View License

The feature vector is a 5(gray scale) or 15(colored) dimensional vector reflecting the contrast, texture strength and orientation and texture scale for each pixel. Texture scale is represented by the average speed of change of pixel intensity in a Total Variation framework while the texture strength and orientation are computed from 3 distinct components of the structure tensor undergone a nonlinear coupled isotropic matrix valued diffusion. The feature vector can directly be used in a texture segmentation framework.
You need to download the Nonlinear Coupled Diffusion package (submission 27604 available at http://www.mathworks.com/matlabcentral/fileexchange/27604-nonlinear-coupled-diffusion) to run this code.
The code is commented and the definitions of the input/output variables and usages are mentioned in the header of the discriminative_texture_feature.m. A sample script test_discriminative_texture shows the usage of the code as well as the usefulness of the gaussian regularization for speedups in the nonlinear diffusion process.
Note that you need to compile the mex file: thomas_mex.cpp before the first usage.

Cite As

Omid Aghazadeh (2020). Sparse set of Features for Texture Discrimination (https://www.mathworks.com/matlabcentral/fileexchange/27618-sparse-set-of-features-for-texture-discrimination), MATLAB Central File Exchange. Retrieved .

Comments and Ratings (4)

Hamid

sallam agaye mohandes

man dar morede *Age estimation from facial image* kar mikonam. aya mishe az in Code baraye analysis va estekhraje vizegihaye chorooke chehre (mesle pishanii) estefade kard?

mamnoon misham sge rahnemayiim konid??

swetylko

ah sure, but it is still not working with the same error.

tex = discriminative_texture_feature(I);
[sy sx d] = size(I);
tmp = zeros(size(I));
for i = 1 :size(tex,1)
tmp(i) = reshape(tex(i,:),[sy sx]);
end
textureimg = tmp(5);

My I size is: sy = 370, sx = 427, d = 3
and the size from tex is sy = 5, sx = 157990, d = 1

Omid Aghazadeh

you need to get the size of the original image and not that of the result.

swetylko

The code works great with the demo images but when I use my images there is an error:
??? Error using ==> reshape
To RESHAPE the number of elements must not change.

Error in ==> gettexture at 47
tmp(i) = reshape(tex(i,:),[sy sx]);

I'm using only the last one of the 5 images.
tex = discriminative_texture_feature(I);
[sy sx d] = size(tex)
for i = 1 :size(tex,1)
tmp(i) = reshape(tex(i,:),[sy sx]);
end
textureimg = tmp(1);

Where is my fault?

MATLAB Release Compatibility
Created with R2009b
Compatible with any release
Platform Compatibility
Windows macOS Linux
Acknowledgements

Inspired by: Nonlinear Coupled Diffusion

Inspired: Nonlinear Coupled Diffusion

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!