Normalizing images in OpenCV

前端 未结 3 1400
遥遥无期
遥遥无期 2021-01-31 03:25

I wrote the following code to work normalize an image using NORM_L1 in OpenCV. But the output image was just black.How to solve this ?

import cv2
import numpy as         


        
3条回答
  •  闹比i
    闹比i (楼主)
    2021-01-31 03:39

    When you normalize a matrix using NORM_L1, you are dividing every pixel value by the sum of absolute values of all the pixels in the image. As a result, all pixel values become much less than 1 and you get a black image. Try NORM_MINMAX instead of NORM_L1.

提交回复
热议问题