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.
97 lines
2.6 KiB
97 lines
2.6 KiB
/*
|
|
* @Author: your name
|
|
* @Date: 2022-04-20 15:49:50
|
|
* @LastEditTime: 2025-09-23 10:45:58
|
|
* @LastEditors: xiewenji 527774126@qq.com
|
|
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
|
* @FilePath: /ZCXD_MonitorPlatform/src/CoreLogicModule/include/CamDeal.h
|
|
*/
|
|
#ifndef ImageAllResult_H_
|
|
#define ImageAllResult_H_
|
|
#include <iostream>
|
|
#include <stdio.h>
|
|
#include <sys/time.h>
|
|
#include <opencv2/opencv.hpp>
|
|
#include <condition_variable>
|
|
#include <mutex>
|
|
#include <vector>
|
|
#include <thread>
|
|
#include <string>
|
|
#include <stdlib.h>
|
|
#include "Define_Product.hpp"
|
|
#include "CheckErrorCodeDefine.hpp"
|
|
#include "ImgCheckConfig.h"
|
|
#include "ImageDetConfig.h"
|
|
#include "DetLog.h"
|
|
#include "CheckResultJson.h"
|
|
using namespace std;
|
|
using namespace cv;
|
|
|
|
// 包含所有的图片检测结果,如 返回的结果,临时结果, 其他检测结果
|
|
class ImageAllResult
|
|
{
|
|
public:
|
|
enum DetStep
|
|
{
|
|
DetStep_NotDet,
|
|
DetStep_Deting,
|
|
DetStep_Complet,
|
|
};
|
|
struct AI_Det_MaskImg
|
|
{
|
|
cv::Rect roi;
|
|
cv::Mat AI_inImg;
|
|
cv::Mat AI_mask;
|
|
};
|
|
|
|
private:
|
|
/* data */
|
|
public:
|
|
ImageAllResult(/* args */);
|
|
~ImageAllResult();
|
|
|
|
void AddLog(std::string str);
|
|
// 添加图片信息
|
|
int AddDetImage(std::shared_ptr<shareImage> p);
|
|
DetStep getStep();
|
|
void setStep(DetStep step);
|
|
bool IsNotDet();
|
|
|
|
public:
|
|
// 裁切大小
|
|
cv::Rect CropRoi = cv::Rect(0, 0, 0, 0);
|
|
// 检测的原始图片
|
|
cv::Mat detImg;
|
|
// AI 推理的mask图片
|
|
cv::Mat AIMaskImg;
|
|
// 结果图片
|
|
cv::Mat resultImg;
|
|
|
|
float fscale_detToresult_x = 0;
|
|
float fscale_detToresult_y = 0;
|
|
|
|
int NG_num = 0;
|
|
int YS_num = 0;
|
|
int Ok_num = 0;
|
|
int NoJudge_num = 0;
|
|
|
|
public:
|
|
DetStep m_step = DetStep_NotDet;
|
|
std::string strBaseInfo = "";
|
|
std::string strChannel = "";
|
|
std::vector<std::string> LogList;
|
|
std::shared_ptr<DetLog> detlog;
|
|
std::shared_ptr<CheckResult> result; // 返回检测结果
|
|
std::shared_ptr<One_Image_CheckResult_> pDetResult; // 检测结果 后续主要对pDetResult 继续分析
|
|
std::shared_ptr<ProductBaseResult> productBaseResult; // 产品相关的基本结果信息
|
|
std::shared_ptr<CameraBaseResult> cameraBaseResult; // 相机相关的基本结果信息
|
|
|
|
std::vector<std::shared_ptr<AI_Det_MaskImg>> AI_Qx_MaskList;
|
|
std::mutex mtx_Det; // 互斥量
|
|
private:
|
|
PRINT_LOG_ m_PrintLog;
|
|
|
|
CheckResultJson m_CheckResultJson;
|
|
};
|
|
|
|
#endif |