[Insight-users] GLCM Histogram computation speed

Luis Ibanez luis.ibanez at kitware.com
Sun May 29 16:06:55 EDT 2011


Hi Neil,

The number of historgram bins used in the
Coocurrence matrix generator will not have
a significant effect on the time that it takes
to run the filter.

This is because the pseudocode of this filter
is essentially:


    For every pixel: Pi
         for every neighbor  Pj
                  populate histogram entry (Pi,Pj)


The time to run the filter will be linearly proportional
to the number of pixels in the input image.

It will also be proportional to  (2R+1)^N
(R= neighborhood radius and N = Image dimension)


How big is your image ?
(in pixels along X,Y...)

What radius value are you using ?


       Luis

------------------------------------------------------------------

On Thu, May 26, 2011 at 4:21 PM, Neil Panjwani <paniwani at gmail.com> wrote:
> I'm using OTB to compute Haralick texture features locally.
> http://www.orfeo-toolbox.org/doxygen/classotb_1_1ScalarImageToTexturesFilter.html
> However, the filter is extremely slow (even in release mode). I've only run
> it on one GLCM offset at a time, and I will eventually need to run it over
> several and average the result. I believe the step which computes the GLCM
> histogram for each voxel is slowing it down.
> My question is with the use of a specific ITK filter:
> MaskedScalarImageToGreyLevelCooccurrenceMatrixGenerator
> http://www.itk.org/Doxygen318/html/classitk_1_1Statistics_1_1MaskedScalarImageToGreyLevelCooccurrenceMatrixGenerator.html
> I read a tutorial on texture and GLCM here:
> http://www.fp.ucalgary.ca/mhallbey/properties.htm
> which says the GLCM should be compressed first or I risk having too many 0s
> in my matrix.
> Is this true? Do I need to compress my data? If so, what's the best way of
> going about it?
> How is this related to the SetNumberOfBinsPerAxis() method, i.e. if the
> number of bins is fixed (default: 256) will the computation be faster if I
> compress my data?
> Note I also do have to set the input minimum and maximum, which affects the
> computation...
> Thanks in advance!
>
>
>
>
>
>
> _____________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Kitware offers ITK Training Courses, for more information visit:
> http://www.kitware.com/products/protraining.html
>
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-users
>
>


More information about the Insight-users mailing list