我正在使用“OpenCV”,我想在图像中显示一种颜色。现在我做了这个
img = cv2.imread('im02.jpg')
L1 = np.array([255,0,102])
U1 = np.array([255,0,102])
m1 = cv2.inRange(img, L1, U1)
r1 = cv2.bitwise_and(img, img, mask=m1)
#print(r1.any()) #know if all the image is black
cv2.imshow("WM", np.hstack([img, r1]))
这工作正常,但它的工作时,你需要一系列的色彩色调。但在我的例子中,我想知道RGB的精确值,当我在上下限写相同的值,但我想做得更好的时候,我怎么能在没有范围的情况下做到呢?你知道吗
非常感谢。你知道吗
我想我理解你的问题。试试这个:
start.png
看起来像这样-你的颜色介于绿色和蓝色之间:result.png
看起来像这样:相关问题 更多 >
编程相关推荐