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.

44 lines
1.3 KiB

/*
//图片基本处理
*/
#ifndef ImgBasicDeal_H_
#define ImgBasicDeal_H_
#include <vector>
#include <thread>
#include "CheckDefine.h"
#include "ImgCheckConfig.h"
using namespace std;
class ImgBasicDeal
{
public:
ImgBasicDeal();
~ImgBasicDeal();
/// @brief 画结果信息到图片上
/// @return
int DrawResult(cv::Mat &image_draw, CheckResult result);
/// @brief 对图像预处理
/// @param srcimg 原始图 输出 原始图或镜像图
/// @param resizeimg 裁剪resize到 固定大小的图片
/// @param bfilpSrcimg 是否镜像原始图
/// @return
int DrawResult_small(cv::Mat &image_draw, int i, int j, CheckResult result);
int preDealImg(cv::Mat &srcimg, cv::Mat &image_resize, bool bfilpSrcImg = true);
int DrawPointList(cv::Mat &image_draw, std::vector<cv::Point> plist);
cv::Point CalcTextPosition(cv::Point pt, int radius, cv::Size text_size, cv::Size image_size, ERROR_TYPE_ type);
public:
int font_face = cv::FONT_HERSHEY_SIMPLEX;
double font_scale = 0.5;
int thickness = 1;
cv::Scalar Color_Brightness_roi = cv::Scalar(0, 255, 0);
cv::Scalar Color_Brightness_text = cv::Scalar(0, 255, 0);
cv::Scalar DrawBlobErrorCorleList[ERROR_TYPE_COUNT];
private:
};
#endif