opencv2对彩色图像直方图均衡化时,利用YUN取出Y通道,单独对Y通道进行均衡(注意img_yuv[:,:,0])
关键步骤:1、读取图像并转换为YUV色彩空间:img=cv2.imread('test.jpg')img_yuv=cv2.cvtColor(img,cv2.COLOR_BGR2YUV)2、获取Y通道,即yuv_img[:,:,0]并对Y通道进行均衡化处理,(补充:'Uchannel',yuv_img[:,:,1])和'Vchannel',yuv_img[:,:,2])):img_yuv[:,:,0