I am trying to extract entropy from matrices with zero elements in Matlab. From the definition of the entropy of the match matrix:

must be calculated where c ijmeans the record (i, j) of the match matrix. Thus, it seems to me that if there is one null entry, the entropy will be undefined. Are you setting some kind of lower limit for log (x) when x = 0, or how do you handle this?
Link to pdf with definition of entropy for GLCM: http://www.code.ucsd.edu/pcosman/glcm.pdf
EDIT: Thanks for the suggestions on working with the log (0), but the equation actually requires an estimate of 0 * log (0), which is 0. It would be easier to explain if I can use the formulas, but maybe my question was more mathematical, and therefore in the wrong forum.
source
share