Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

this is probably the most common rookie error there is ...

you're loading an image, but never check the outcome.

since the error came from cvtColor, obviously img_rgb was never loaded (wrong path)

lesson here: whenever you load anything, check !

img_rgb = cv2.imread('template.jpg')
if img_rgb == None: 
    raise Exception("could not load image !")