简体   繁体   English

灰度共生矩阵// Python

[英]Grey Level Co-Occurrence Matrix // Python

I am trying to find the GLCM of an image using greycomatrix from skimage library. 我正在尝试使用skimage库中的greycomatrix查找图像的GLCM。 I am having issues with the selection of levels. 我在选择级别时遇到问题。 Since it's an 8-bit image, the obvious selection should be 256; 由于它是8位图像,因此显而易见的选择应该是256;否则,它应该是256。 however, if I select values such as 8 (for the purpose of binning and to prevent sparse matrices from forming), I am getting errors. 但是,如果我选择诸如8之类的值(出于合并目的并防止形成稀疏矩阵),则会出现错误。

QUESTIONS: 问题:

  • Does anyone know why? 有人知道为什么吗?
  • Can anyone suggest any ideas of binning these values into a 8x8 matrix instead of a 256x256 one? 谁能提出将这些值合并到8x8矩阵而不是256x256矩阵中的想法?

The simplest way for binning 8-bits images is to divide each value by 32. Then each pixel value is going to be in [0,8[. 合并8位图像的最简单方法是将每个值除以32。然后每个像素值将在[0,8 [。

Btw, more than avoiding sparse matrices (which are not really an issue), binning makes the GLCM more robust to noise. 顺便说一句,比避免稀疏矩阵(这不是真正的问题),分箱使GLCM对噪声更鲁棒。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM