cameramanager.h 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632
  1. #ifndef M_FRAMES_HPP
  2. #define M_FRAMES_HPP
  3. // Qt include.
  4. #include <QObject>
  5. #include <QVector>
  6. #include <QMetaType>
  7. #include <QVideoSink>
  8. #include <QCamera>
  9. #include <QMediaRecorder>
  10. #include <QMediaCaptureSession>
  11. #include <QImageCapture>
  12. #include <QPointer>
  13. #include <QThread>
  14. #include <m_opencv.h>
  15. #include <m_workthread.h>
  16. #include <mqtthandler.h>
  17. #include <mserial.h>
  18. #include <ymodem.h>
  19. #include <m_json.h>
  20. #include <m_loger.h>
  21. #include <QFuture>
  22. #include <QThreadPool>
  23. #include <ImageStitcher.h>
  24. #include <QSemaphore>
  25. #include <QQuickImageProvider>
  26. #include <QQmlImageProviderBase>
  27. #include <QImage>
  28. #include <QFile>
  29. #include <QTimer>
  30. #include <QElapsedTimer>
  31. #include <QVideoFrame>
  32. #include <pthread.h>
  33. //海康
  34. // #pragma pack(push, 4)
  35. // #include "MvCameraControl.h"
  36. // #pragma pack(pop)
  37. #include <MvCameraControl.h>
  38. #include <PixelType.h>
  39. //https://github.com/saki4510t/UVCCamera/pulls
  40. //https://gitee.com/dengly/UVCCamera
  41. //USBCamera: https://blog.csdn.net/hanshiying007/article/details/124118486
  42. #define CameraType 2 //0-QCamera , 1-OPENCV, 2-libuvc
  43. #define movZ_f "f80" //多图移动,正向80
  44. #define movZ_b "b80" //多图移动,反向80
  45. #define movX_f "f80" //多图移动,正向
  46. #define movX_b "b80" //多图移动,反向
  47. #define focux_f "f4" //单步对焦,正向
  48. #define focus_b "b4" //单步对焦,反向
  49. #define m_foucus_step_max 5
  50. #define focus_step_max 30
  51. //性能提升
  52. //https://blog.csdn.net/u012915226/article/details/115733359
  53. //https://blog.csdn.net/u012915226/article/details/121745861?spm=1001.2014.3001.5501
  54. //https://blog.csdn.net/aggs1990/article/details/125694175
  55. //自定义QVideoSink
  56. //https://blog.csdn.net/aggs1990/article/details/125361203?spm=1001.2014.3001.5501
  57. //github: 模块
  58. //https://github.com/erikmwerner/QUVCView/blob/master/uvccapture.cpp
  59. namespace Qt6QCamera {
  60. // 定义一个包含信号的发送类
  61. class SenderCustom : public QObject {
  62. Q_OBJECT
  63. public:
  64. // 定义一个信号,无参数
  65. signals:
  66. void signalToSend(const cv::Mat& frame);
  67. void signalQStr(const QString &qst);
  68. public:
  69. void sendSignal(const cv::Mat& frame) {
  70. emit signalToSend(frame); // 发送信号
  71. }
  72. void sendQStr(const QString &qst){
  73. signalQStr(qst);
  74. }
  75. };
  76. class FPSTimer : public QObject
  77. {
  78. Q_OBJECT
  79. public:
  80. explicit FPSTimer(QObject *parent = nullptr);
  81. public slots:
  82. void incrementFrame() { m_frame_count++; }
  83. void setInterval(int interval);
  84. void setRunning(bool running);
  85. bool isRunning();
  86. signals:
  87. void fpsUpdated(double);
  88. private slots:
  89. void onTimerTimeout();
  90. private:
  91. QTimer* m_timer = nullptr;
  92. QElapsedTimer* m_elapsed_timer = nullptr;
  93. int m_interval = 1000;
  94. int m_frame_count = 0;
  95. };
  96. //
  97. // Frames
  98. //
  99. struct RawFrame
  100. {
  101. int width;
  102. int height;
  103. MvGvspPixelType pixelType;
  104. QByteArray data; // 原始 buffer 拷贝
  105. };
  106. //! Frames listener.
  107. class Frames :public QObject//, public QQuickImageProvider //QObject //
  108. {
  109. Q_OBJECT
  110. QML_ELEMENT
  111. Q_PROPERTY( QVideoSink* videoSink READ videoSink WRITE setVideoSink NOTIFY videoSinkChanged )
  112. Q_PROPERTY( QString formatString READ formatString NOTIFY formatStringChanged )
  113. Q_PROPERTY( QString fpsString READ fpsString NOTIFY fpsStringChanged )
  114. Q_PROPERTY( QString qulityString READ qulityString NOTIFY qulityStringChanged )
  115. Q_PROPERTY( bool auto_clicked READ auto_clicked WRITE setChange NOTIFY btnStatusChanged )
  116. Q_PROPERTY( bool camera_sw READ camera_sw WRITE setCameraSw NOTIFY cameraStaChanged )
  117. Q_PROPERTY(QString cam_ExposureTime READ cam_ExposureTime WRITE setExposureTime NOTIFY exposureTimeChanged)
  118. Q_PROPERTY( bool recording READ recording NOTIFY recordingChanged )
  119. public:
  120. static void registerQmlType();
  121. explicit Frames(QObject * parent = nullptr);
  122. ~Frames() override;
  123. //! Set sink of video output.
  124. void setVideoSink( QVideoSink * newVideoSink );
  125. bool isDecoding() { return m_decoding; }
  126. //! \return Sink of video output.
  127. QVideoSink* videoSink() const { return m_videoSink; }
  128. //! set btn
  129. void setChange(bool stat_t);
  130. //! 相机状态
  131. void setCameraSw(bool stat_cam);
  132. void setExposureTime(const QString &exptime);
  133. //! \return Rotation angle.
  134. //! \return Format of video frame as string.
  135. QString formatString() const;
  136. //! \return FPS as string.
  137. QString fpsString() const;
  138. QString qulityString() const;
  139. QString cam_ExposureTime() const;
  140. bool auto_clicked() const;
  141. bool camera_sw() const;
  142. void saveImage();
  143. Q_INVOKABLE void captureImage();
  144. //抓图按钮:模拟MCU拍照指令(camera_tc=1),下一帧按序号保存/锐化/上传
  145. Q_INVOKABLE void manualCapture();
  146. //录制原始(未压缩)视频流:开始录制;停止时回填文件头并把视频流保存到文件系统
  147. Q_INVOKABLE bool startRecord();
  148. Q_INVOKABLE void stopRecord();
  149. bool recording() const { return m_recording; }
  150. //inline ImageProvider *getImageProvider() { return m_pImgProvider; }
  151. //ImageProvider* imageProvider() const;
  152. static void ImageCallBackEx(unsigned char * pData, MV_FRAME_OUT_INFO_EX* pFrameInfo, void* pUser);
  153. bool createFolder(const QString &path) {
  154. QDir dir(path);
  155. if (dir.exists()) {
  156. LOG("文件夹已存在:{}",path.toStdString());
  157. return true;
  158. }
  159. if (dir.mkpath(".")) {
  160. LOG("文件夹创建成功:{}",path.toStdString());
  161. return true;
  162. } else {
  163. ERROR("文件夹创建失败:{}",path.toStdString());
  164. return false;
  165. }
  166. }
  167. signals:
  168. //! Video sink changed.
  169. void videoSinkChanged();
  170. void cameraOpenFailed(const QString &err);
  171. void formatStringChanged();
  172. void fpsStringChanged();
  173. void qulityStringChanged();
  174. void exposureTimeChanged();
  175. void frameAvailable(const QVideoFrame &frame);
  176. void frameReady(QImage image);
  177. void btnStatusChanged();
  178. void sendFocusFlag(QString flag_sta);
  179. void cameraStaChanged(bool sta_cam);
  180. void serial_data(const QByteArray &m_byte);
  181. void signal_stitch();
  182. //hikrobot
  183. void startGrabbing(bool sta_cam);
  184. void signalGrabing(unsigned char * nData);
  185. void callQmlRefeshImg();
  186. void signal_m1s();
  187. void dataUpload(const QByteArray &data); //到mqtt
  188. void signal_photoerr();
  189. void stopGrabbing(bool sta_cam);
  190. void signal_photo_saved();
  191. void signal_wait_upload(const QString &path);
  192. void signal_cache_image(const QString &path);
  193. void signal_sharp_processed(const QString &name_sharp); //锐化/对比度后台处理完成,回主线程统一入队入库
  194. void stepCountChanged(const QString step);
  195. void recordingChanged();
  196. //录制结束,视频流已保存到path
  197. void recordFileSaved(const QString &path);
  198. public slots:
  199. void onMovDone(const QString stepcount){
  200. if(!camera_sw()){
  201. ERROR("Camera error!");
  202. setCameraSw(false);
  203. return;
  204. }
  205. m_qulityString = m_opencvfunc.Tenengrad(m_frame);
  206. LOG("onMovDone:{}",m_qulityString.toStdString());
  207. emit serial_data(m_json.ImageFunc(m_qulityString.toDouble()));
  208. emit qulityStringChanged();
  209. emit stepCountChanged(stepcount);
  210. }
  211. // void parseFrame(const cv::Mat& frame);
  212. void upload_handle(void);
  213. void handle_reult_upload(bool success, const QString &error);
  214. void onFPSUpdated(double fps);
  215. private slots:
  216. //! Init camera.
  217. void initCam();
  218. void handleGrab(bool sta_cam);
  219. //! 1s timer.
  220. void timer();
  221. //!
  222. void update_qulstr(QString q_str);
  223. //
  224. void saveMatAsJpeg(const QVideoFrame &frame);
  225. void onSharpProcessed(const QString &name_sharp);
  226. //void sendData(QByteArray m_byte);
  227. void displayFrame(const QVideoFrame &frame);
  228. void mov_x_z_run();
  229. void processFrameAsync(const RawFrame& frame);
  230. //录制中:把当前未压缩原始帧写入视频流文件(取流线程调用)
  231. void writeRecordFrame(const cv::Mat &frame);
  232. private:
  233. Q_DISABLE_COPY( Frames )
  234. //声明相机捕获对象
  235. //! Video sink of video output.
  236. //QPointer< QVideoSink > m_videoSink;
  237. QVideoSink *m_videoSink;
  238. //! Format string.
  239. QString m_formatString;
  240. //! FPS string.
  241. QString m_fpsString;
  242. //! FPS.
  243. int m_fps;
  244. //! 清晰度
  245. QString m_qulityString;
  246. //! Timer.
  247. QTimer *m_1s;
  248. //! QVideoFrame
  249. OpencvFunc m_opencvfunc;
  250. JsonFunc m_json;
  251. QFuture<void> m_grabThread;
  252. //独立上传队列:与param::ptlist(拼接输入)隔离,每保存一张锐化/对比度图立即入队逐张上传
  253. QStringList m_uploadQueue;
  254. bool m_isUploading = false; //是否正在上传,防止并发启动多个上传线程
  255. QJniObject *jClass;
  256. bool camera_sta;
  257. bool m_decoding;
  258. bool m_streaming_active = false;
  259. QImage m_image;
  260. int stitch_des;
  261. int m_width;
  262. int m_height;
  263. QString m_fExposureTime;
  264. //ImageProvider *m_pImgProvider;
  265. //libuvc
  266. mutable QMutex m_frameMutex; // 互斥锁,用于对帧队列的访问进行同步
  267. FPSTimer* m_fps_timer = nullptr;
  268. cv::Mat m_frame;
  269. int image_num = 1;
  270. int z_step = 0;
  271. int x_step = 0;
  272. //保护 image_num/z_step/x_step 及"取号-建名-存图-自增-移轴"整段流程,
  273. //saveMatAsJpeg 由 QtConcurrent 线程池并发调用,无锁会导致重号覆盖、序号跳变、轴重复移动
  274. mutable QMutex m_saveMutex;
  275. //锐化/对比度专用串行线程池(单线程):避免多个重CPU锐化任务同时抢占全局线程池,
  276. //导致取流线程(handleGrab)被挤占、MV_CC_GetImageBuffer 取流超时
  277. QThreadPool m_sharpPool;
  278. //原始视频流录制:录制期间由取流线程同步写入(内存占用恒定,不缓存帧),停止时回填文件头
  279. bool m_recording = false;
  280. QFile *m_recordFile = nullptr;
  281. QString m_recordPath;
  282. int m_recordWidth = 0;
  283. int m_recordHeight = 0;
  284. int m_recordStride = 0;
  285. int m_recordFrameCount = 0;
  286. QElapsedTimer m_recordElapsed;
  287. //保护录制状态与文件写入,startRecord/stopRecord(UI线程)与writeRecordFrame(取流线程)互斥
  288. mutable QMutex m_recordMutex;
  289. //图片归档路径
  290. QString picture_path_floader;
  291. QVector<cv::Mat> m_frame_buffer;
  292. int testJNI();
  293. int checkPermission(void)
  294. {
  295. int ret = 0;
  296. const static char* MY_JAVA_CLASS = "GetUsbPermission";
  297. ret = QJniObject::callStaticMethod<jint>(MY_JAVA_CLASS,"checkPermission","()I");
  298. return ret;
  299. }
  300. static inline QImage cvMatToQImage( const cv::Mat &inMat )
  301. {
  302. switch ( inMat.type() )
  303. {
  304. // 8-bit, 4 channel
  305. case CV_8UC4:
  306. {
  307. QImage image( inMat.data, inMat.cols, inMat.rows, inMat.step, QImage::Format_RGB32 );
  308. return image;
  309. }
  310. // 8-bit, 3 channel
  311. case CV_8UC3:
  312. {
  313. QImage image( inMat.data, inMat.cols, inMat.rows, inMat.step, QImage::Format_RGB888 );
  314. return image.rgbSwapped();
  315. }
  316. // 8-bit, 1 channel
  317. case CV_8UC1:
  318. {
  319. static QVector<QRgb> sColorTable;
  320. // only create our color table once
  321. if ( sColorTable.isEmpty() )
  322. {
  323. for ( int i = 0; i < 256; ++i )
  324. sColorTable.push_back( qRgb( i, i, i ) );
  325. }
  326. QImage image( inMat.data, inMat.cols, inMat.rows, inMat.step, QImage::Format_Indexed8 );
  327. image.setColorTable( sColorTable );
  328. return image;
  329. }
  330. default:
  331. qWarning() << "ASM::cvMatToQImage() - cv::Mat image type not handled in switch:" << inMat.type();
  332. break;
  333. }
  334. return QImage();
  335. }
  336. static cv::Mat QImageToCvMat(QImage inImage, bool inCloneImageData = true)
  337. {
  338. switch (inImage.format())
  339. {
  340. // 8-bit, 4 channel
  341. case QImage::Format_ARGB32:
  342. case QImage::Format_ARGB32_Premultiplied:
  343. {
  344. cv::Mat mat(inImage.height(), inImage.width(),
  345. CV_8UC4,
  346. const_cast<uchar*>(inImage.bits()),
  347. static_cast<size_t>(inImage.bytesPerLine())
  348. );
  349. return inCloneImageData ? mat.clone() : mat;
  350. }
  351. // 8-bit, 3 channel
  352. case QImage::Format_RGB32:
  353. {
  354. if (!inCloneImageData) {
  355. qWarning() << "QImageToCvMat() - Conversion requires cloning so we don't modify the original QImage data";
  356. }
  357. cv::Mat mat(inImage.height(), inImage.width(),
  358. CV_8UC4,
  359. const_cast<uchar*>(inImage.bits()),
  360. static_cast<size_t>(inImage.bytesPerLine())
  361. );
  362. cv::Mat matNoAlpha;
  363. cv::cvtColor(mat, matNoAlpha, cv::COLOR_BGRA2BGR); // drop the all-white alpha channel
  364. return matNoAlpha;
  365. }
  366. // 8-bit, 3 channel
  367. case QImage::Format_RGB888:
  368. {
  369. if (!inCloneImageData) {
  370. qWarning() << "QImageToCvMat() - Conversion requires cloning so we don't modify the original QImage data";
  371. }
  372. QImage swapped = inImage.rgbSwapped();
  373. cv::Mat mat(swapped.height(), swapped.width(),
  374. CV_8UC3,
  375. const_cast<uchar*>(swapped.bits()),
  376. static_cast<size_t>(swapped.bytesPerLine())
  377. );
  378. return inCloneImageData ? mat.clone() : mat;
  379. }
  380. // 8-bit, 1 channel
  381. case QImage::Format_Grayscale8:
  382. case QImage::Format_Indexed8:
  383. {
  384. cv::Mat mat(inImage.height(), inImage.width(),
  385. CV_8UC1,
  386. const_cast<uchar*>(inImage.bits()),
  387. static_cast<size_t>(inImage.bytesPerLine())
  388. );
  389. return inCloneImageData ? mat.clone() : mat;
  390. }
  391. #if QT_VERSION >= QT_VERSION_CHECK(5, 13, 0)
  392. case QImage::Format_Grayscale16:
  393. {
  394. cv::Mat mat(cv::Size(inImage.width(),inImage.height()),CV_16U,const_cast<uchar*>(inImage.bits()),cv::Mat::AUTO_STEP);
  395. return inCloneImageData ? mat.clone() : mat;
  396. }
  397. #endif
  398. default:
  399. qWarning() << "QImageToCvMat() - QImage format not handled in switch:" << inImage.format();
  400. break;
  401. }
  402. return cv::Mat();
  403. }
  404. bool IsColor(MvGvspPixelType enType)
  405. {
  406. switch(enType)
  407. {
  408. case PixelType_Gvsp_BGR8_Packed:
  409. case PixelType_Gvsp_YUV422_Packed:
  410. case PixelType_Gvsp_YUV422_YUYV_Packed:
  411. case PixelType_Gvsp_BayerGR8:
  412. case PixelType_Gvsp_BayerRG8:
  413. case PixelType_Gvsp_BayerGB8:
  414. case PixelType_Gvsp_BayerBG8:
  415. case PixelType_Gvsp_BayerGB10:
  416. case PixelType_Gvsp_BayerGB10_Packed:
  417. case PixelType_Gvsp_BayerBG10:
  418. case PixelType_Gvsp_BayerBG10_Packed:
  419. case PixelType_Gvsp_BayerRG10:
  420. case PixelType_Gvsp_BayerRG10_Packed:
  421. case PixelType_Gvsp_BayerGR10:
  422. case PixelType_Gvsp_BayerGR10_Packed:
  423. case PixelType_Gvsp_BayerGB12:
  424. case PixelType_Gvsp_BayerGB12_Packed:
  425. case PixelType_Gvsp_BayerBG12:
  426. case PixelType_Gvsp_BayerBG12_Packed:
  427. case PixelType_Gvsp_BayerRG12:
  428. case PixelType_Gvsp_BayerRG12_Packed:
  429. case PixelType_Gvsp_BayerGR12:
  430. case PixelType_Gvsp_BayerGR12_Packed:
  431. return true;
  432. default:
  433. return false;
  434. }
  435. }
  436. bool IsMono(MvGvspPixelType enType)
  437. {
  438. switch(enType)
  439. {
  440. case PixelType_Gvsp_Mono10:
  441. case PixelType_Gvsp_Mono10_Packed:
  442. case PixelType_Gvsp_Mono12:
  443. case PixelType_Gvsp_Mono12_Packed:
  444. return true;
  445. default:
  446. return false;
  447. }
  448. }
  449. //地址的转换函数
  450. bool ConvertToHexIp(unsigned int *nHexIP, unsigned int *nDecIP)
  451. {
  452. if ( nDecIP[0] < 0 || nDecIP[0] > 255
  453. || nDecIP[1] < 0 || nDecIP[1] > 255
  454. || nDecIP[2] < 0 || nDecIP[2] > 255
  455. || nDecIP[3] < 0 || nDecIP[3] > 255)
  456. {
  457. return false;
  458. }
  459. *nHexIP = (nDecIP[0] << 24) + (nDecIP[1] << 16) + (nDecIP[2] << 8) + nDecIP[3];
  460. return true;
  461. }
  462. }; // class Frames
  463. //! 原始视频流(.rawv)播放器:逐帧读取未压缩的原始帧并推送到 QVideoSink 播放
  464. class RawVideoPlayer : public QObject
  465. {
  466. Q_OBJECT
  467. QML_ELEMENT
  468. Q_PROPERTY( QVideoSink* videoSink READ videoSink WRITE setVideoSink NOTIFY videoSinkChanged )
  469. Q_PROPERTY( bool playing READ playing NOTIFY playingChanged )
  470. Q_PROPERTY( bool loaded READ loaded NOTIFY loadedChanged )
  471. Q_PROPERTY( int position READ position NOTIFY positionChanged )
  472. Q_PROPERTY( int frameCount READ frameCount NOTIFY frameCountChanged )
  473. Q_PROPERTY( QString source READ source NOTIFY sourceChanged )
  474. Q_PROPERTY( bool busy READ busy NOTIFY busyChanged )
  475. public:
  476. explicit RawVideoPlayer(QObject *parent = nullptr);
  477. QVideoSink* videoSink() const { return m_videoSink; }
  478. void setVideoSink(QVideoSink *newVideoSink);
  479. bool playing() const { return m_playing; }
  480. bool loaded() const { return m_loaded; }
  481. int position() const { return m_position; }
  482. int frameCount() const { return m_frameCount; }
  483. QString source() const { return m_source; }
  484. bool busy() const { return m_busy; }
  485. //打开原始视频流文件,成功后可调用 play()
  486. Q_INVOKABLE bool open(const QString &path);
  487. Q_INVOKABLE void play();
  488. //分析:识别视频帧中最清晰的一帧,锐化+对比度增强后保存为图片(与视频同目录)
  489. Q_INVOKABLE void analyzeSharpestFrame();
  490. //融合:对视频帧做景深融合,锐化+对比度增强后保存为图片(与视频同目录)
  491. Q_INVOKABLE void fuseVideoFrames();
  492. Q_INVOKABLE void pause();
  493. Q_INVOKABLE void stop();
  494. //定位到指定帧(立即刷新画面)
  495. Q_INVOKABLE void seek(int frameIndex);
  496. Q_INVOKABLE void close();
  497. //判断文件是否为原始视频流(.rawv)
  498. Q_INVOKABLE bool isRawVideo(const QString &path) const;
  499. signals:
  500. void videoSinkChanged();
  501. void playingChanged();
  502. void loadedChanged();
  503. void positionChanged();
  504. void frameCountChanged();
  505. void sourceChanged();
  506. void busyChanged();
  507. //分析结束:path为空表示失败,成功时图片已保存到path
  508. void analyzeFinished(const QString &path);
  509. //融合结束:path为空表示失败,成功时图片已保存到path
  510. void fuseFinished(const QString &path);
  511. private slots:
  512. void onTick();
  513. private:
  514. //读取并推送当前帧,失败返回false
  515. bool pushFrame();
  516. void setBusy(bool busy);
  517. //结果图片路径,命名与拍照图片一致:<视频时间戳>z0x0[_sharp]_<序号>.jpg
  518. QString resultPath(int serial, bool sharp) const;
  519. QFile m_file;
  520. QTimer m_timer;
  521. QVideoSink *m_videoSink = nullptr;
  522. QString m_source;
  523. int m_width = 0;
  524. int m_height = 0;
  525. int m_stride = 0;
  526. int m_fps = 0;
  527. int m_frameCount = 0;
  528. int m_position = 0;
  529. bool m_loaded = false;
  530. bool m_playing = false;
  531. //分析/融合任务进行中(进行中时不重复触发)
  532. bool m_busy = false;
  533. //同一视频内结果序号:分析结果与融合结果成对(_sharp_后缀)
  534. int m_resultSerial = 0;
  535. };
  536. } /* namespace Qt6QCamera */
  537. Q_DECLARE_METATYPE(cv::Mat)
  538. #endif // M_FRAMES_HPP