【发布时间】:2021-11-01 15:18:03
【问题描述】:
请告诉如何获取整个图像的 rgb 值。我已经打印了每个像素的 rgb 值
import cv2
# LOAD AN IMAGE USING 'IMREAD'
img = cv2.imread("tiger.jpg")
# DISPLAYg
cv2.imshow("Tiger", img)
cv2.waitKey(0)
cv2.destroyAllWindows()
print(img.shape)
[x,y,z]=img.shape
count=0
for i in range(1,x-1):
for j in range(1,y-1):
print(img[i,j])
count=count+1
print(count)
【问题讨论】:
-
解释“整个图像的 RGB 值”。您是否尝试计算图像中红色的总量/百分比 (RGB)?
-
平均?中位数?最低限度?最大?
-
我正在尝试为图像提取单一 rgb 颜色。简而言之,我必须添加图像中所有像素的 rgb 值,我必须混合所有颜色。请帮忙。
-
请澄清您的具体问题或提供其他详细信息以准确突出您的需求。正如目前所写的那样,很难准确地说出你在问什么。
标签: python opencv computer-vision cv2