Code covered by the BSD License  

Highlights from
Sparse set of Features for Texture Discrimination

Be the first to rate this file! 32 Downloads (last 30 days) File Size: 104.39 KB File ID: #27618
image thumbnail

Sparse set of Features for Texture Discrimination

by Omid Aghazadeh

 

15 May 2010 (Updated 18 May 2010)

This package implements the Features mentioned in the PhD thesis of Thomas Brox.

| Watch this File

File Information
Description

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.

Acknowledgements

The author wishes to acknowledge the following in the creation of this submission:
Nonlinear Coupled Diffusion
This submission has inspired the following:
Nonlinear Coupled Diffusion

MATLAB release MATLAB 7.9 (2009b)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (4)
10 Jun 2011 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?

10 Jun 2011 Omid Aghazadeh

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

20 Jun 2011 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

21 May 2012 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??

Please login to add a comment or rating.
Updates
18 May 2010

Updated the usage of Nonlinear_Diffusion.m to be able to use it much faster than before!

Tag Activity for this File
Tag Applied By Date/Time
discriminative texture Omid Aghazadeh 17 May 2010 12:12:13
nonlinear diffusion Omid Aghazadeh 17 May 2010 12:12:14
texture Omid Aghazadeh 17 May 2010 12:12:14
texture feature Omid Aghazadeh 17 May 2010 12:12:14
image processing Omid Aghazadeh 17 May 2010 12:12:14

Contact us at files@mathworks.com