aoles / EBImage

:art: Image processing toolbox for R
71 stars 28 forks source link

What is the haralick.scales argument to computeFeatures()? #24

Closed dlebauer closed 7 years ago

dlebauer commented 7 years ago

In the documentation, the function computeFeatures has a parameter haralick.scales with a default value of c(1, 2). The parameter is defined as:

A integer vector indicating the number of scales to use to compute the Haralick features.

However, it is not clear what this refers to, even after a brief look at the code https://github.com/aoles/EBImage/blob/master/R/computeFeatures.R#L248.

In the original Haralick paper (Haralick 1973.pdf), the author refers to using both the mean and range of each feature. However, it is not clear if this is related or even an optional output from the algorithm.

dlebauer commented 7 years ago

In addition, Following the function examples, setting this para.meter to different values does not change the output. For example:

library(EBImage)
example('computeFeatures')

all(computeFeatures.haralick(x, y, scales = 1) == computeFeatures.haralick(x, y, scales = c(1,2)))
##TRUE

identical(computeFeatures.haralick(x, y, scales = 1), computeFeatures.haralick(x, y, scales = c(2,6)))
##TRUE
aoles commented 7 years ago

The question has been already answered by @kevin05jan.

The reason why you were getting identical results for seemingly different function calls was due to wrong argument name: scales instead of haralick.scales.