This commit is contained in:
Harrison Deng 2018-04-29 01:56:24 -05:00
parent 603143551e
commit df23c44b77
2 changed files with 11 additions and 3 deletions

View File

@ -5,7 +5,8 @@
* Author: Yunyang * Author: Yunyang
*/ */
#include "ContourAnalyzer.h" #include "../Shape/ContourAnalyzer.h"
#include <cmath> #include <cmath>
ContourAnalyzer::ContourAnalyzer() { ContourAnalyzer::ContourAnalyzer() {
@ -78,10 +79,14 @@ std::string ContourAnalyzer::contourToString(std::vector<cv::Point> contour) {
} }
} }
cv::Mat ContourAnalyzer::getDebugFrame(int step) { cv::Mat ContourAnalyzer::getDebugFrame(int step) const {
return stepFrames[step]; return stepFrames[step];
} }
std::vector<cv::Rect> ContourAnalyzer::getBounds() const {
return bounds;
}
ContourAnalyzer::~ContourAnalyzer() { ContourAnalyzer::~ContourAnalyzer() {
} }

View File

@ -15,6 +15,7 @@ cv::Mat originFrame;
std::vector<cv::Mat> stepFrames{4}; std::vector<cv::Mat> stepFrames{4};
std::vector<std::vector<cv::Point>> contours; std::vector<std::vector<cv::Point>> contours;
std::vector<std::vector<cv::Point>> prunedContours; std::vector<std::vector<cv::Point>> prunedContours;
std::vector<cv::Rect> bounds;
public: public:
ContourAnalyzer(); ContourAnalyzer();
@ -27,8 +28,10 @@ public:
void setFrame(cv::Mat frame); void setFrame(cv::Mat frame);
void drawShapePositions(cv::Mat &frame); void drawShapePositions(cv::Mat &frame);
std::string contourToString(std::vector<cv::Point>); std::string contourToString(std::vector<cv::Point>);
void convertContoursToBounds();
cv::Mat getDebugFrame(int step); cv::Mat getDebugFrame(int step) const;
std::vector<cv::Rect> getBounds() const;
}; };
#endif /* DETECTION_SHAPE_CONTOURANALYZER_H_ */ #endif /* DETECTION_SHAPE_CONTOURANALYZER_H_ */