Convert colorspaces

We can convert between different colorspaces, e.g. from BGR to gray scale, with

cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)

The whole variety of available conversions can be found here

This can also be used to convert a single color, e.g. the HSV value of green in BGR is given by:

green = numpy.uint8([[[0,255,0 ]]])
hsv_green = cv2.cvtColor(green,cv2.COLOR_BGR2HSV)