You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

98 lines
2.2 KiB

/*
* @Author: xiewenji 527774126@qq.com
* @Date: 2025-08-04 21:26:32
* @LastEditors: xiewenji 527774126@qq.com
* @LastEditTime: 2025-08-13 16:05:08
* @FilePath: /BOE_ZB_PLATE/AlgorithmModule/include/Pin_QX_Det.h
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
/*
* @Author: xiewenji 527774126@qq.com
* @Date: 2025-08-04 21:26:32
* @LastEditors: xiewenji 527774126@qq.com
* @LastEditTime: 2025-08-04 21:29:05
* @FilePath: /BOE_ZB_PLATE/AlgorithmModule/include/Pin_QX_Det.h
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
/*
//实现对部分缺陷 需要进行 数量 和距离上分析的
*/
#ifndef Pin_QX_Det_H_
#define Pin_QX_Det_H_
#include <opencv2/opencv.hpp>
#include <opencv2/opencv.hpp>
#include "CheckUtil.hpp"
#include "OtherDetBaseDefine.h"
#include "CheckErrorCodeDefine.hpp"
#include "ImageDetConfig.h"
#include "CheckConfigDefine.h"
#include "ImageStorage.h"
#include "AI_Factory.h"
#include "DetLog.h"
using namespace std;
using namespace cv;
// Pin脚缺陷检测
class Pin_QX_Det
{
public:
struct QX_Result
{
cv::Rect roi_src;
int area_pixel;
QX_Result()
{
roi_src = cv::Rect(0, 0, 0, 0);
area_pixel = 0;
}
};
struct Det_ROI_Config
{
cv::Rect roi;
std::vector<cv::Point> plist;
};
// 检测参数和结果
struct DetConfigResult
{
BaseCheckFunction *pBaseCheckFunction;
std::string strChannel;
bool bSaveResultImg;
DetConfigResult()
{
Init();
}
void Init()
{
pBaseCheckFunction = NULL;
strChannel = "";
bSaveResultImg = false;
}
};
public:
Pin_QX_Det(std::shared_ptr<DetLog>& log_ref);
~Pin_QX_Det();
int GetPinMask(const cv::Mat &img, DetConfigResult *pDetConfig, Mat &mask);
private:
int InitModel_Pin();
private:
bool m_bInitSucc; // 是否初始化成功
std::shared_ptr<DetLog>& m_pdetlog;
bool m_bshowimg;
cv::Mat showimg;
std::shared_ptr<AIFactory> AI_Factory;
private:
/* data */
};
#endif