添加OpenCv

This commit is contained in:
2025-09-15 22:28:43 +08:00
parent c0593df9e1
commit 94282fb1d9
423 changed files with 622349 additions and 97439 deletions

View File

@@ -2,6 +2,12 @@
#define P10_INTELLIGENTPAGE_H
#include <QWidget>
#include <QPixmap>
#include <QTimer>
#include <QEvent>
#include <QMouseEvent>
#include <PublicFunctions/RtspPlayer.h> // 引入RTSP播放器头文件
#include <GlobalDefinitions/Variable.h>
namespace Ui {
class P10_IntelligentPage;
@@ -14,9 +20,38 @@ class P10_IntelligentPage : public QWidget
public:
explicit P10_IntelligentPage(QWidget *parent = nullptr);
~P10_IntelligentPage();
void setRtspUrl(const QString &url); // 设置RTSP地址接口
void WinInit(); // 初始化界面与逻辑
private slots:
void onFrameReady(const QImage &frame); // 接收新视频帧并显示
void onErrorOccurred(const QString &msg); // 接收错误信息并提示
// 按钮点击事件UI自动关联需确保.ui文件中按钮对象名一致
void on_But_Atlas_1_clicked(); // 切换摄像头1
void on_But_Atlas_2_clicked(); // 切换摄像头2
void on_But_Atlas_3_clicked(); // 暂停/继续播放
void on_But_Magnify_clicked(); // 图像放大
void on_But_Reduce_clicked(); // 图像缩小
private:
Ui::P10_IntelligentPage *ui;
// 事件过滤器(处理鼠标拖拽平移)
bool eventFilter(QObject *obj, QEvent *ev) override;
/* 图像尺寸与缩放参数 */
uint32_t Img_W = 0; // 图像原始宽度
uint32_t Img_H = 0; // 图像原始高度
float Img_Zoom = 1.0f; // 缩放比例默认100%
/* 鼠标拖拽参数 */
QPoint dragStart; // 拖拽起始点
bool dragging = false; // 拖拽状态标记
/* RTSP播放相关 */
RtspPlayer *m_rtspPlayer; // RTSP播放器实例
QString m_rtspUrl; // 当前使用的RTSP地址
};
#endif // P10_INTELLIGENTPAGE_H