pyfeats
pyfeats copied to clipboard
GLRLM parameters
Hi, it's me again. This time the confusion occurs on the function glrlm_features()
. I've noticed that there exist a "mask" parameter to select the specific area in the image to compute the GLRLM. But when I compare the results of setting it to all zeros and of setting it to all ones, I surprisingly found they are exactly the same. I furtherly dived into the code to compute the primitive matrix, the parameter seems not be called in neither part. So maybe this is an omitted option? The experimental code is as listed below:
import pyfeats as pf
from pyfeats.textural.glrlm import glrlm_0
test_arr=np.array([[4,1,4,3,3],[2,2,2,0,2],[1,0,0,0,2],[3,1,1,1,2],[2,4,2,2,1]])
glrlm_feature,glrlm_lab=pf.glrlm_features(test_arr,None)
glrlm_feature1,glrlm_lab=pf.glrlm_features(test_arr,np.ones(test_img.shape))
glrlm_f0=glrlm_0(test_arr,np.ones(test_arr.shape),5,max(test_arr.shape),False)
glrlm_f01=glrlm_0(test_arr,np.zeros(test_arr.shape),5,max(test_arr.shape),False)
glrlm_feature1==glrlm_feature
glrlm_f0==glrlm_f01
For the specific feature, the mask is indeed ignored. It is a <TO BE DONE> section.
Yeah, maybe it had better for the "mask" parameter to be removed in glrlm_features()
, glrlm_0()
, etc. It's a little contradictory as it doesn't work as the comment says "Mask image N1 x N2 with 1 if pixels belongs to ROI, 0 else." Or perhaps you can adding the mask relative code in the future.
And, please forgive my poor English. Anyway, thanks for your codes, they really helps me a lot.