Tamura granularity calculation

Hi all, I was wondering if anyone knows the underlying calculation or equation used to get Tamura Granularity in the image features node? I can’t find the literature that describes this exactly.

My issue is that it takes quite a long time to calculate the granularity but this feature works really well to estimate thresholds in my datasets. I was hoping to understand how it is calculated to see if there is anyway to speed up this process.

Hi @aseeber

The seminal paper by Tamura about textural features published in IEEE is the following:

After checking the -Image Feature- node, I notice that it uses all the processor of the computer, in my case 12, but it doesn’t fully use them 100% as shown in the snapshot below:

If you are running this node in a computer with several processors, I would recommend to use the -Parallel Chunk Start- and -Parallel Chunk End- nodes, to increase the use of parallelism, as shown below when using them with the Image Features nodes inside the parallel loop:

As a result, one can see that the processors are now fully employed leading eventually to a gain of time if the node is run in this way, as shown below:

Hope this hint helps.



For completeness, the actual implementation is here:


Thanks @imagejan and @aworker, I think this solves my problem.


1 Like

@aseeber thank you for your feedback and for validating the solution.


Not sure where to report node bugs, but we noticed while rewriting this that line 100 should be:

    border = Math.pow(2,  k);

Instead of:

    border = Math.pow(2, 2 * k);

Also, at line 170, we replaced 3 with 6 since this is maximum k.

So the first point is a bug fix and the second is a suggestion. @imagejan point in the right direction for bug reporting if you don’t mind.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.