elifj+winWidth>width: moveRoi=image[i:winHeight+i,j:width] cv2.rectangle(showRecImage, (j,i), (width,winHeight+i), (0,0,255),1) print("222") break elifi+winHeight>height: moveRoi=image[i:height,j:winWidth+j] cv2.rectangle(showRecImage, (j,i), (winWidth+j,height), (0,0...
一、设置并保存ROI区域 #include "opencv2/opencv.hpp" #include <iostream> using namespace cv; using namespace std; Mat srcimg; void main() { Mat img = imread("E:\\1.png"); //imshow("原图", img); Mat logo = imread("E:\\110.jpg"); Mat imgROI = img(Rect(20, 20, logo.cols...