I would like to read rgb or hsv values of a some image. I looked it up how to read it and I found a answer.
import cv2
image = cv2.imread("sample.jpg")
color = int(image[300, 300])
# if image type is b g r, then b g r value will be displayed.
# if image is gray then color intensity will be displayed.
print color
link: Get RGB value opencv python
but that code gave me an error like this: TypeError: only size-1 arrays can be converted to Python scalars
how can I fix this error? thank you.