#pragma once #include #include #include #include "../job/MetaData.h" #include "../config/bean/CameraCalibrationCfg.h" #include "../camera/HBDCamera.h" #include using namespace ClipperLib; class RecoatCheckInfo { public: vector> 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 vg); //void DrawStatus(bool* isShow); static std::vector 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>& 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> 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; };