QtWidgetsApplication-master/QtWidgetsApplication.h
2025-05-28 10:47:46 +08:00

99 lines
3.0 KiB
C++
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#pragma once
#include <QThread>
#include <QtWidgets/QMainWindow>
#include "ui_QtWidgetsApplication.h"
#include <QGraphicsPixmapItem>
#include <QTimer.h>
#include <Spinnaker.h>
#include <SpinGenApi/SpinnakerGenApi.h>
#include <opencv2/opencv.hpp>
#include "M_camera.h"
#include "TCT.h"
#include <QSlider>
#include <QCheckBox>
#include <QDateTime>
#include <QFileDialog>
#include "haikang.h"
#include "Mycontrol.h"
class QtWidgetsApplication : public QMainWindow
{
Q_OBJECT
public:
QtWidgetsApplication(QWidget *parent = nullptr);
~QtWidgetsApplication();
int resetExposure(); // filr自动曝光
int configureExposure(double exposure); //设置曝光
void setSlideSpinboxCheckboxSync(); //让曝光增益的Slide和Spinbox同步
void HK_resetGain(); // HK设置增益
void HK_resetExposure(); // HK自动曝光
void HK_configureExposure(double exposure);
void HK_configureGain(double exposure); //HK调节增益
int configureGain(double gain); //设置增益
int resetGain(); //自动增益
QPixmap tct_pixmap;
QGraphicsPixmapItem* tct_pixmapItem;
QGraphicsScene* tct_scene; //TCT检测显示需要的
TCT* my_TCT; //创建模型处理的指针
QThread* m_infQthread; //模型处理的线程
QImage in_image; //经onnx模型检测后传回来的图片
QImage hikimage; //海康需要传入TCT时用
public slots:
void do_img_redy(ImagePtr pResultImage); //显示flir相机传回来的图像
void on_btnSingleImageSave_clicked(); //保存单张图片
void on_btnSaveDir_clicked(); //选择存储路径
void input_img(QImage image); //接收经过网络后的图片
void on_pb_model_clicked(); //TCT自动检测按钮
void do_hai_img_redy(MV_FRAME_OUT stImageInfo, void* handle); //将海康相机传回来的图片进行显示 //SB处理办法 弃用
void on_pb_camera_clicked(); //选择相机
void on_btnUp_clicked(); //Z向上
void on_btnDown_clicked(); //Z向下
void on_btnLeft_clicked(); //X向左
void on_btnRight_clicked(); //X向右
void on_btnForward_clicked(); //Y向前
void on_btnBackward_clicked(); //Y向后
void hai_img_redy(QImage image, void* handle); //将海康相机传回来的图片进行显示
signals:
void emit_img(QImage image); //将需要传入网络的图片传出去
private:
Ui::QtWidgetsApplicationClass ui;
HWND m_hwndDisplay; //显示控件的句柄
QPixmap pixmap;
QGraphicsPixmapItem* pixmapItem;
QGraphicsScene* m_scene; //相机显示
void* HK_handle = NULL; //海康相机的句柄
ImageProcessor processor;
ImagePtr pResultImage;
QThread* cam_thread; // 相机的线程
M_camera* cam_worker; // filr相机
haikang* Hacm_worker; // haikang相机
};
// 计算图像清晰度
double sharpnessSobel(cv::Mat image);