#ifndef COMMON_H #define COMMON_H #include #include #include #include using namespace std; struct ShapeInfo { string type; cv::RotatedRect minAreaRect; vector points; vector ignores; vector needInits; bool implement; ShapeInfo(); ShapeInfo(const string& t, const cv::RotatedRect& rect, const vector& pts, const vector& ign, const vector& ni, bool imp); ShapeInfo copy() const; }; enum SHAPETYPE { CIRCULAR = 0, ELLIPTICAL = 1, SQUARE = 2, DIAMOND = 3, TRIANGLE = 4 }; inline const char* const SHAPETYPE_NAMES[] = {"circle", "ellipse", "square", "diamond", "triangle"}; struct SealInfo { int x1; int y1; int x2; int y2; double conf; int shape; cv::Mat cropped_img; cv::Mat extracted_img; std::string color_name; ShapeInfo shape_info; int angle; cv::Mat adj_img; cv::Mat rm_bd_img; std::vector txt_img; std::vector rec_img; }; namespace seal_data { class SealDataManager { public: static SealDataManager& getInstance() { static SealDataManager instance; return instance; } void setSealSet(const std::vector& seal_set) { this->seal_set = seal_set; } std::vector& getSealSet() { return seal_set; } bool hasSealSet() const { return !seal_set.empty(); } void clearSealSet() { seal_set.clear(); } private: SealDataManager() {} ~SealDataManager() {} SealDataManager(const SealDataManager&) = delete; SealDataManager& operator=(const SealDataManager&) = delete; std::vector seal_set; }; } // namespace seal_data #endif