Drawing a line on an image using mouse clicks with Python OpenCV library
问题 I am trying to draw a line on an image using mouse operations. I am using OpenCV library. My code import matplotlib.pyplot as plt import cv2 src_window = 'CV2 Window' SHOW_DEBUG_STEPS = True drag = 0 select_flag = 0 x1 = 0 x2 = 0 y1 = 0 y2 = 0 point1 = [x1,y1] point2 = [x2,y2] SCALAR_YELLOW = (0.0,255.0,255.0) cap = cv2.VideoCapture('example_01.mp4') def closeAll(): cap.release() cv2.destroyAllWindows() def retn(ret): if not ret: print('Error reading the frame') closeAll() def frm(fFrame): if