문제

I know that 'meanColor()' prints the values of BGR, but how can I individually get those values?

For example:

img = "picture"

colors = img.meanColor()

print(colors)

And I get something like this (30,10,40)

Let say I want the 30.

How can I assign it on another variable?

Please explain your solution.

Thanks

도움이 되었습니까?

해결책

It's a tuple, so you can go like :

blue  = colors[0]
green = colors[1]
red   = colors[2]  
#or
b, g, r = colors
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top