Iterate on a picture and get the rgb value of each pixel

Hello
i try to iterate on a picture to get the rgb value of each pixel.
i try with cv2.rectange but there is a problem somwere(he need a double click?)
Thanks for your help.

i find it:

color = cap[y,x]
b,g,r = color[0],color[1],color[2]