Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

there are some differences between the opencv3 and opencv2.4 bindings, - whith the 3.1 ones, the drawing calls like cv2.circle, cv2.rectangle or cv2.polylines return a new image , but the 2.4 versions do not (returns None)

so, in your case, cv2.polylines returns None, and you're trying to imshow() an invalid/empty image.

solution:

    cv2.polylines(frame,[pts],True, 255,2)
    cv2.imshow('img2',frame) # just show the frame, you've drawn into.

there are some differences between the opencv3 and opencv2.4 bindings, - whith the 3.1 ones, the drawing calls like cv2.circle, cv2.rectangle or cv2.polylines return a new image , but the 2.4 versions do not (returns None)

so, in your case, cv2.polylines returns None, and you're trying to imshow() an invalid/empty image.

solution:

    cv2.polylines(frame,[pts],True, 255,2)
    cv2.imshow('img2',frame) # just show the frame, you've drawn into.

there are some differences between the opencv3 and opencv2.4 bindings, - whith with the 3.1 ones, the drawing calls like cv2.circle, cv2.rectangle or cv2.polylines return a new image , but the 2.4 versions do not

so, in your case, cv2.polylines returns None, and you're trying to imshow() an invalid/empty image.

solution:

    cv2.polylines(frame,[pts],True, 255,2)
    cv2.imshow('img2',frame) # just show the frame, you've drawn into.