opencv 截图并保存(转载) 代码功能:选择图像中矩形区,按S键截图并保存,Q键退出. #include<opencv2/opencv.hpp> #include<iostream> using namespace std;using namespace cv; Rect select;bool select_flag = false;Mat img, showImg; void S_on_Mouse(int event, int x, int y, int flags, vo
画直线 import numpy as np import cv2 # Create a black image img = np.zeros((512,512,3), np.uint8) # Draw a diagonal blue line with thickness of 5 px cv2.line(img,(0,0),(511,511),(255,0,0),5) cv2.imshow('line',img) cv2.waitKey() 画polygon import numpy as