Matrix entropy measure

311 Views Asked by At

I have a matrix (its dimension is $n$ x $m$) where each cell can be $0$ or $1$.

I would like to calculate an "entropy" measure on it that tells me how close are the ones together or how spread they are.

For example this matrix:

10000000
00000010
00111110
00000010

will receive a lower value than this:

01101001
00000000
01000100
00100100

How can I perform this calculation?

1

There are 1 best solutions below

0
On

You may be looking for an edge detection and approximate your "entropy" as the total length of edges in the $0,1$-Matrix (viewed as a black and white image). The Sobel operator can help you do this.

Check out $$e(M) := \| \mathcal S(M)\|_F$$ where $\mathcal S$ is the Sobel operator and $\|\cdot\|_F$ is the frobenius norm.