glcm

Python: taking the GLCM of a non-rectangular region

家住魔仙堡 提交于 2019-11-30 09:47:08
问题 I have been using the SLIC implementation of skimage to segment images in superpixels. I would like to use GLCMs to extract additional features from these superpixels for a classification problem. These superpixels are not rectangular. In MATLAB you can set pixels to NaN and they will be ignored by the algorithm (link). I could use this to make bounding boxes around the superpixels and then just setting the unused pixels to NaN. The greycomatrix function in skimage does not work entirely the

Python: taking the GLCM of a non-rectangular region

跟風遠走 提交于 2019-11-29 17:42:15
I have been using the SLIC implementation of skimage to segment images in superpixels. I would like to use GLCMs to extract additional features from these superpixels for a classification problem. These superpixels are not rectangular. In MATLAB you can set pixels to NaN and they will be ignored by the algorithm ( link ). I could use this to make bounding boxes around the superpixels and then just setting the unused pixels to NaN. The greycomatrix function in skimage does not work entirely the same as the MATLAB implementation however. When setting pixels to NaN the function fails on an assert