#include<iostream>
#include<opencv2/opencv.hpp>
#define WINDOW_NAME "鼠标事件窗口"
#define EVENT_WINDOW "滚动条窗口"
#define PI 3.1415926
using namespace std;
using namespace cv;
void DrawCircle(Mat &img, Point center, int radius, Scalar color, int thickness = 2, int lineType = 8);
void DrawRectangle(Mat &img, Rect box);
void onMouse(int event, int x, int y, int flag, void *param);
void on_Trackbar_b(int, void *);
void on_Trackbar_g(int, void *);
void on_Trackbar_r(int, void *);
void on_Trackbar_switch(int, void *);
void on_Trackbar_proportion(int, void *);
void on_Trackbar_Thick(int, void *);
Rect g_rectangle;
bool g_bDrawingBox = false;
RNG g_rng(12345);
Point g_startpoint;
double g_angle;
Point g_currentPoint;
int g_CurRadius;
Scalar g_EllCurColor;
double proportion = 0;
int EllCurThick;
//滑动条
int g_nAlphaValueSlider_b, g_nAlphaValueSlider_g, g_nAlphaValueSlider_r, g_nAlphaValueSlider_switch, g_nAlphaValue
Opencv用鼠标画圆
最新推荐文章于 2024-08-31 19:06:36 发布
这篇博客详细介绍了如何利用OpenCV库结合鼠标事件,实现在图像上通过鼠标点击来绘制圆心和半径的圆形。内容涵盖了设置鼠标回调函数、获取鼠标坐标以及在图像上画圆的方法。
摘要由CSDN通过智能技术生成