/* * ContourAnalyzer.h * * Created on: Apr 22, 2018 * Author: Yunyang */ #ifndef RECTANGLE_DETECTION_CONTOURANALYZER_H_ #define RECTANGLE_DETECTION_CONTOURANALYZER_H_ #include #include #include "../../UI.h" #include "../../UIListener.hpp" class ContourAnalyzer: public UIListener { int *lastKey; bool cannyRec = false; UI *ui; std::vector> contours; std::vector> inconsistentContours; std::vector> consistentContours; std::vector> prunedContours; std::vector bounds; public: int binLower = 60; int cannyLower = 35; int cannyUpper = 105; int epsilon = 48; ContourAnalyzer(UI* ui, int *lastKey); virtual ~ContourAnalyzer(); cv::Scalar selectColor { 0, 255, 0 }; cv::Scalar fontColor { 0, 0, 255 }; void analyze(); void drawContoursOntoMat(std::vector> &contours, cv::Mat &frame); std::string contourToString(std::vector); void convertContoursToBounds(); std::vector getBounds() const; void componentSetup(); }; #endif /* RECTANGLE_DETECTION_CONTOURANALYZER_H_ */