如何在Opencv中将黑色背景更改为白色



如何将黑色背景更改为白色

有没有办法将图像中的黑色区域改为白色??

在此处输入图像描述

此处为测试图像

试试这个:

import numpy as np
import cv2 
...
# image in this case is your image you want to eliminate black
image[np.where((image==[0,0,0]).all(axis=2))] = [255,255,255]

最新更新