From 357da3cde0fecbf8c17c5db4c577f644f7808fd8 Mon Sep 17 00:00:00 2001 From: Kerautret <bertrand.kerautret@univ-lyon2.fr> Date: Thu, 20 Dec 2018 01:28:14 +0100 Subject: [PATCH] Demo : add multiple points output --- Code/Seg/IPOLdemo/mainIPOL.cpp | 34 ++++++++++++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/Code/Seg/IPOLdemo/mainIPOL.cpp b/Code/Seg/IPOLdemo/mainIPOL.cpp index e8f1bc6..d599ec1 100755 --- a/Code/Seg/IPOLdemo/mainIPOL.cpp +++ b/Code/Seg/IPOLdemo/mainIPOL.cpp @@ -86,7 +86,8 @@ int main (int argc, char *argv[]) } fin.close(); } - + fout << "# Line detection generated from " << argv[0] << "with format : X1 Y1 X2 Y2 on each line" << std::endl; + // Blurred segment detection vector<BlurredSegment *> bss; BSDetector detector; @@ -110,6 +111,35 @@ int main (int argc, char *argv[]) nbseg ++; } } + vector<BlurredSegment *>::const_iterator it = bss.begin (); + while (it != bss.end ()) + { + // Affichage du premier point + vector<Pt2i> points = (*it)->getAllPoints (); + + fout << points.front().x() << " " << points.front().y() << " " + << points.back().x() << " " << points.back().y() << std::endl; + + // Affichage du DSS englobant + // vector<Pt2i> bnd; + // DigitalStraightSegment *dss = (*it)->getSegment (); + // if (dss != NULL) + // { + + // dss->getBounds (bnd, 0, 0, width, height, false); + // // cout << "DSS starts from (" << bnd.front().x() + // // << "," << bnd.front().y() << ")" << endl; + // auto b = bnd.begin(); + // for (auto &x: bnd){ + // cout << "DSS starts from (" << x.x() + // << "," << x.y() << ")" << endl; + + // } + // } + + it++; + } + std::cout << nbseg << " detections" << std::endl; } else @@ -119,7 +149,7 @@ int main (int argc, char *argv[]) bss = detector.getBlurredSegments (); } - fout << "# Line detection generated from " << argv[0] << "with format : X1 Y1 X2 Y2 on each line" << std::endl; + // Display if (! bss.empty ()) -- GitLab