1、创建固定位置小视口
#include <opencv2/opencv.hpp>
bool isDragging = false;
cv::Point startPt;
void onMouse(int event, int x, int y, int flags, void* userdata) {
if (event == cv::EVENT_LBUTTONDOWN) {
isDragging = true;
startPt = cv::Point(x, y);
} else if (event == cv::EVENT_MOUSEMOVE && isDragging) {
cv::Mat* image = static_cast<cv::Mat