Entropy of an image

I want entropy applied on the entire image.

I tested it quickly using Scikit Image Entropy

I want implement the same in C++ using opencv, I found a solution on the stack overflow entropy for a gray image in opencv

Scikit Image implements it on the entire image where as the stackoverflow is giving a float value.

Are both the same?
If same/different, How to I implement the scikit implementation of entropy in opencv using C++?

what is your “use-case” here ? what do you want to achieve with it ?

  • the c++ version calculates a single entropy value for an image
  • the scipy one calculates entropy values for a pixel neighbourhood (a subimage), and sets the pixel value to the entropy of that subimage.

The scipy version gives higher values for edges in the entire image which is of interest for me.

I would like to implement with the same method for entropy as done on scikit image, entropy values for a pixels neighborhood(a subimage) and set the pixel value to the entropy of that subimage. Using OpenCV C++.

(did you mean: edges inside the image, or the image borders ?)
you will need a “sliding window”, and there’s a border condition

(and, how do you know the difference, if you dont have a working c++ impl ?)

[edit] oh wait, did you mean, it highlights the edges in your image ?
again, what is this for ? do you need an “edge detector” (like Canny or Sobel) ?