Histogram equalization of grayscale images with NumPy

前端 未结 3 1238
独厮守ぢ
独厮守ぢ 2020-12-09 22:11

How to do histogram equalization for multiple grayscaled images stored in a NumPy array easily?

I have the 96x96 pixel NumPy data in this 4D format:

         


        
3条回答
  •  轮回少年
    2020-12-09 22:49

    As of today janeriksolem's url is broken.

    I found however this gist that links the same page and claims to perform histogram equalization without computing the histogram.

    The code is:

    img_eq = np.sort(img.ravel()).searchsorted(img)
    

提交回复
热议问题