fine tuning with preparation for migration to bounding boxes instead of contours
This commit is contained in:
		@@ -14,6 +14,8 @@ void ContourAnalyzer::analyze() {
 | 
			
		||||
 | 
			
		||||
	if (*lastKey == 99) {
 | 
			
		||||
		cannyRec = !cannyRec;
 | 
			
		||||
	} else if (*lastKey == 118) {
 | 
			
		||||
		drawContours = !drawContours;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if (cannyRec) {
 | 
			
		||||
@@ -60,6 +62,10 @@ void ContourAnalyzer::analyze() {
 | 
			
		||||
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if (drawContours) {
 | 
			
		||||
		drawContoursOntoMat(prunedContours, *(ui->originalFrame()));
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void ContourAnalyzer::drawContoursOntoMat(std::vector<std::vector<cv::Point>> &contours, cv::Mat &frame) {
 | 
			
		||||
 
 | 
			
		||||
@@ -14,7 +14,7 @@
 | 
			
		||||
 | 
			
		||||
class ContourAnalyzer: public UIListener {
 | 
			
		||||
	int *lastKey;
 | 
			
		||||
	bool cannyRec = false;
 | 
			
		||||
	bool cannyRec = false, drawContours = false;
 | 
			
		||||
	UI *ui;
 | 
			
		||||
	std::vector<std::vector<cv::Point>> contours;
 | 
			
		||||
	std::vector<std::vector<cv::Point>> inconsistentContours;
 | 
			
		||||
@@ -23,12 +23,12 @@ class ContourAnalyzer: public UIListener {
 | 
			
		||||
	std::vector<cv::Rect> bounds;
 | 
			
		||||
 | 
			
		||||
public:
 | 
			
		||||
	int binLower = 60;
 | 
			
		||||
	int binLower = 52;
 | 
			
		||||
 | 
			
		||||
	int cannyLower = 35;
 | 
			
		||||
	int cannyUpper = 105;
 | 
			
		||||
	int cannyLower = 57;
 | 
			
		||||
	int cannyUpper = 3*cannyLower;
 | 
			
		||||
 | 
			
		||||
	int epsilon = 48;
 | 
			
		||||
	int epsilon = 53;
 | 
			
		||||
 | 
			
		||||
	ContourAnalyzer(UI* ui, int *lastKey);
 | 
			
		||||
	virtual ~ContourAnalyzer();
 | 
			
		||||
 
 | 
			
		||||
@@ -59,8 +59,8 @@ void UI::setOriginalFrame(cv::Mat frame) {
 | 
			
		||||
	frames[0] = frame;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
cv::Mat UI::getOriginalFrame() const {
 | 
			
		||||
	return frames[0];
 | 
			
		||||
cv::Mat* UI::originalFrame() {
 | 
			
		||||
	return &frames[0];
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
UI::~UI() {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user