66 lines
1.8 KiB
C++
66 lines
1.8 KiB
C++
#pragma once
|
|
#include <opencv2/opencv.hpp>
|
|
#include <vlVG/VectorGraphics.hpp>
|
|
#include <clipper.hpp>
|
|
#include "../job/MetaData.h"
|
|
#include "../config/bean/CameraCalibrationCfg.h"
|
|
#include "../camera/HBDCamera.h"
|
|
#include <vector>
|
|
using namespace ClipperLib;
|
|
|
|
class RecoatCheckInfo {
|
|
public:
|
|
vector<vector<cv::Point>> m_Counter;
|
|
float m_PartArea;
|
|
};
|
|
|
|
class RecoatCheck
|
|
{
|
|
public:
|
|
RecoatCheck();
|
|
~RecoatCheck();
|
|
bool CheckOL(MetaData* metadata, unsigned int layer, unsigned char** img, int width, int high);
|
|
|
|
|
|
bool CheckWP(MetaData* metadata, unsigned int layer, unsigned char** img, int width, int high);
|
|
bool CheckWP2(MetaData* metadata, unsigned int layer);
|
|
//bool Check(MetaData* metadata, unsigned int layer);
|
|
void DrawPoly(vl::ref<vl::VectorGraphics> vg);
|
|
//void DrawStatus(bool* isShow);
|
|
static std::vector<int> GetLayerBorders(MetaData* metadata, unsigned int layer, PolyTree& m_Borders);
|
|
|
|
void TestCheck();
|
|
void SetCamera(HBDCamera* cam) { m_Camera = cam; }
|
|
//void DrawCapturePoint();
|
|
private:
|
|
cv::Mat generateMask2D(float allMasks[5][5], int row1, int row2);
|
|
bool RecoatCheckByContoursIntersect(PolyTree& borders, vector<vector<cv::Point2f>>& uncover, MetaData* metadata);
|
|
double Len(Path& p);
|
|
static void BuildTree(PolyTree* node);
|
|
static bool isBetween(IntPoint a, IntPoint b, IntPoint c);
|
|
double Dist(IntPoint a, IntPoint b);
|
|
|
|
public:
|
|
int m_MouseX;
|
|
int m_MouseY;
|
|
uint32_t m_CaptureTex;
|
|
private:
|
|
bool isDrawed;
|
|
bool isNeedDisp;
|
|
bool isDispUpdated;
|
|
vector<vector<cv::Point2f>> realc;
|
|
//Paths m_Borders;
|
|
PolyTree m_Borders;
|
|
Paths m_Solutions;
|
|
CRITICAL_SECTION cs;
|
|
CRITICAL_SECTION disp_cs;
|
|
cv::Mat m_WarpDst;
|
|
int m_DstWidth;
|
|
int m_DstHeight;
|
|
|
|
uint32_t m_DispTex;
|
|
ExtCfg* m_ExtCfg;
|
|
CameraCalibrationCfg* m_CameraCalibrationCfg;
|
|
HBDCamera* m_Camera;
|
|
};
|