マスクで指定する範囲の色の平均値を取得

2019/09/19

Python2.7.8, OpenCV4.1.1

ret,thresh = cv2.threshold(gray,127,255,1)
datos_rgb = cv2.mean(img, mask=thresh)[::-1]
r = int(datos_rgb[1])
g = int(datos_rgb[2])
b = int(datos_rgb[3])


RGB average of circles
https://stackoverflow.com/questions/43086715/rgb-average-of-circles