What does the parameter -1 in numpy shape[::-1] mean?
template = cv2.imread('template.jpg',0)
w, h = template.shape[::-1]
Here, it has nothing to do with numpy. You are accessing a tuple with [start:end:step] (see this question for more details), using a step of -1 means you reverse the order.