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.
89 lines
2.0 KiB
89 lines
2.0 KiB
/*
|
|
* @Author: xiewenji 527774126@qq.com
|
|
* @Date: 2025-09-25 16:25:30
|
|
* @LastEditors: xiewenji 527774126@qq.com
|
|
* @LastEditTime: 2025-09-25 16:57:01
|
|
* @FilePath: /BOE_POL_ET_Detect/AlgorithmModule/include/AI_Mark_Det.h
|
|
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
|
*/
|
|
/*
|
|
//实现对部分缺陷 需要进行 数量 和距离上分析的
|
|
*/
|
|
#ifndef AI_Mark_Det_H_
|
|
#define AI_Mark_Det_H_
|
|
#include <opencv2/opencv.hpp>
|
|
#include "CheckUtil.hpp"
|
|
#include "OtherDetect.h"
|
|
#include "OtherDetBaseDefine.h"
|
|
#include "CheckErrorCodeDefine.hpp"
|
|
#include "ImageDetConfig.h"
|
|
#include "CheckConfigDefine.h"
|
|
#include "ImageStorage.h"
|
|
#include "AI_Factory.h"
|
|
using namespace std;
|
|
using namespace cv;
|
|
|
|
// 二次分割求面积
|
|
class AI_Mark_Det : public AIDetectBase
|
|
{
|
|
public:
|
|
// 检测参数和结果
|
|
struct DetConfigResult
|
|
{
|
|
|
|
std::string strCamName;
|
|
int nresult;
|
|
cv::Rect searchroi;
|
|
std::string strChannel;
|
|
bool bDebugsaveimg;
|
|
bool bDetSaveImg;
|
|
std::shared_ptr<DetLog> pdetlog;
|
|
cv::Rect markRoi;
|
|
|
|
DetConfigResult()
|
|
{
|
|
|
|
nresult = -1;
|
|
strCamName = "";
|
|
strChannel = "";
|
|
searchroi = cv::Rect(0, 0, 0, 0);
|
|
bDebugsaveimg = false;
|
|
bDetSaveImg = false;
|
|
markRoi = cv::Rect(0, 0, 0, 0);
|
|
}
|
|
};
|
|
|
|
public:
|
|
AI_Mark_Det(/* args */);
|
|
~AI_Mark_Det();
|
|
|
|
int Detect(const cv::Mat &img, DetConfigResult *pDetConfig);
|
|
|
|
private:
|
|
int Det_img(const cv::Mat &img, DetConfigResult *pDetConfig);
|
|
|
|
// 分析结果
|
|
int Analysisy(const cv::Mat &maskImg, DetConfigResult *pDetConfig);
|
|
|
|
// 存储过程图片
|
|
int SaveProcessImg(const cv::Mat &inImg, const cv::Mat &outImg, const cv::Mat &oldmask, DetConfigResult *pDetConfig);
|
|
|
|
private:
|
|
bool m_bModelSucc;
|
|
cv::Mat detimg123;
|
|
ImageStorage *m_pImageStorage;
|
|
|
|
std::shared_ptr<AIFactory> AI_Factory;
|
|
|
|
std::shared_ptr<DetLog> m_pdetlog;
|
|
|
|
int m_Show_Area;
|
|
float m_Show_Len;
|
|
cv::Point m_Len_P1;
|
|
cv::Point m_Len_P2;
|
|
|
|
private:
|
|
/* data */
|
|
};
|
|
|
|
#endif |