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