Skip to content
Snippets Groups Projects
Commit da5057c5 authored by even's avatar even
Browse files
parents 666ce8d2 098f40c2
No related branches found
No related tags found
No related merge requests found
......@@ -76,11 +76,11 @@ bool BSAccumulatorView::processKeyEvent (QKeyEvent *event)
break;
case Qt::Key_P : // Capture
viewport()->grab (
QRect (QPoint (0, 0),
QSize (grid->getWidth(), grid->getHeight()))
).toImage().save ("accu.png");
cout << "Accumulator shot in capture.png" << endl;
// viewport()->grab (
// QRect (QPoint (0, 0),
// QSize (grid->getWidth(), grid->getHeight()))
// ).toImage().save ("accu.png");
// cout << "Accumulator shot in capture.png" << endl;
break;
}
return processed;
......
......@@ -53,10 +53,10 @@ bool BSIdetView::processKeyEvent (QKeyEvent *event)
break;
case Qt::Key_P : // Capture
viewport()->grab (
QRect (QPoint (0, 0),
QSize (idet->getWidth(), idet->getHeight()))
).toImage().save ("firstDetection.png");
// viewport()->grab (
// QRect (QPoint (0, 0),
// QSize (idet->getWidth(), idet->getHeight()))
// ).toImage().save ("firstDetection.png");
cout << "First detection window shot in capture.png" << endl;
break;
......
......@@ -74,10 +74,10 @@ bool BSProfileView::processKeyEvent (QKeyEvent *event)
break;
case Qt::Key_P : // Capture
viewport()->grab (
QRect (QPoint (0, 0),
QSize (prof->getWidth(), prof->getHeight()))
).toImage().save ("profiles.png");
// viewport()->grab (
// QRect (QPoint (0, 0),
// QSize (prof->getWidth(), prof->getHeight()))
// ).toImage().save ("profiles.png");
cout << "Profiles shot in capture.png" << endl;
break;
......
......@@ -116,10 +116,10 @@ bool BSStructureView::processKeyEvent (QKeyEvent *event)
break;
case Qt::Key_P : // Capture
viewport()->grab (
QRect (QPoint (0, 0),
QSize (grid->getWidth(), grid->getHeight()))
).toImage().save ("structure.png");
// viewport()->grab (
// QRect (QPoint (0, 0),
// QSize (grid->getWidth(), grid->getHeight()))
// ).toImage().save ("structure.png");
cout << "Structure shot in capture.png" << endl;
break;
......
######################################################################
# Automatically generated by qmake (3.0) mer. nov. 7 21:11:32 2018
######################################################################
QT+=widgets
TEMPLATE = app
TARGET = ipolDemo
INCLUDEPATH += .. \
../BSTools \
../BlurredSegment \
../DirectionalScanner \
../ConvexHull \
../ImageTools
OBJECTS_DIR = obj
# Input
HEADERS += ../BlurredSegment/biptlist.h \
../BlurredSegment/blurredsegment.h \
../BlurredSegment/blurredsegmentproto.h \
../BlurredSegment/bsdetector.h \
../BlurredSegment/bstracker.h \
../BlurredSegment/linespacefilter.h \
../BSTools/bsaccumulatoritem.h \
../BSTools/bsaccumulatorview.h \
../BSTools/bsdetectionwidget.h \
../BSTools/bsidetitem.h \
../BSTools/bsidetview.h \
../BSTools/bsprofileitem.h \
../BSTools/bsprofileview.h \
../BSTools/bsstructureitem.h \
../BSTools/bsstructureview.h \
../BSTools/bswindow.h \
../ConvexHull/antipodal.h \
../ConvexHull/chvertex.h \
../ConvexHull/convexhull.h \
../DirectionalScanner/directionalscanner.h \
../DirectionalScanner/directionalscannero1.h \
../DirectionalScanner/directionalscannero2.h \
../DirectionalScanner/directionalscannero7.h \
../DirectionalScanner/directionalscannero8.h \
../DirectionalScanner/dynamicalscannero1.h \
../DirectionalScanner/dynamicalscannero2.h \
../DirectionalScanner/dynamicalscannero7.h \
../DirectionalScanner/dynamicalscannero8.h \
../DirectionalScanner/scannerprovider.h \
../DirectionalScanner/vhscannero1.h \
../DirectionalScanner/vhscannero2.h \
../DirectionalScanner/vhscannero7.h \
../DirectionalScanner/vhscannero8.h \
../ImageTools/absrat.h \
../ImageTools/digitalstraightline.h \
../ImageTools/digitalstraightsegment.h \
../ImageTools/pt2i.h \
../ImageTools/strucel.h \
../ImageTools/vmap.h \
../ImageTools/vr2i.h
SOURCES += mainIPOL.cpp \
../BlurredSegment/biptlist.cpp \
../BlurredSegment/blurredsegment.cpp \
../BlurredSegment/blurredsegmentproto.cpp \
../BlurredSegment/bsdetector.cpp \
../BlurredSegment/bstracker.cpp \
../BlurredSegment/linespacefilter.cpp \
../BSTools/bsaccumulatoritem.cpp \
../BSTools/bsaccumulatorview.cpp \
../BSTools/bsdetectionwidget.cpp \
../BSTools/bsidetitem.cpp \
../BSTools/bsidetview.cpp \
../BSTools/bsprofileitem.cpp \
../BSTools/bsprofileview.cpp \
../BSTools/bsstructureitem.cpp \
../BSTools/bsstructureview.cpp \
../BSTools/bswindow.cpp \
../ConvexHull/antipodal.cpp \
../ConvexHull/chvertex.cpp \
../ConvexHull/convexhull.cpp \
../DirectionalScanner/directionalscanner.cpp \
../DirectionalScanner/directionalscannero1.cpp \
../DirectionalScanner/directionalscannero2.cpp \
../DirectionalScanner/directionalscannero7.cpp \
../DirectionalScanner/directionalscannero8.cpp \
../DirectionalScanner/dynamicalscannero1.cpp \
../DirectionalScanner/dynamicalscannero2.cpp \
../DirectionalScanner/dynamicalscannero7.cpp \
../DirectionalScanner/dynamicalscannero8.cpp \
../DirectionalScanner/scannerprovider.cpp \
../DirectionalScanner/vhscannero1.cpp \
../DirectionalScanner/vhscannero2.cpp \
../DirectionalScanner/vhscannero7.cpp \
../DirectionalScanner/vhscannero8.cpp \
../ImageTools/absrat.cpp \
../ImageTools/digitalstraightline.cpp \
../ImageTools/digitalstraightsegment.cpp \
../ImageTools/pt2i.cpp \
../ImageTools/strucel.cpp \
../ImageTools/vmap.cpp \
../ImageTools/vr2i.cpp
Code/Seg/IPOLdemo/Input/couloir.gif

111 KiB

......@@ -4,12 +4,41 @@
#include "bsdetector.h"
#include "vmap.h"
#include <iostream>
#include <fstream>
void usage(std::string str)
{
std::cout << str << " : something is wrong with the prog parameter (not enough parameters or something wrong)... "<< std::endl;
}
int main (int argc, char *argv[])
{
// Calcul de la carte de gradient (utilise qt)
if (argc < 3)
{
usage(argv[0]);
exit(EXIT_FAILURE);
}
// getting parameters:
// - input file
string input_filename = argv[1];
// - output file
string output_filename = argv[2];
ofstream fout;
fout.open(output_filename.c_str(), std::fstream::out);
// Calcul de la carte de gradient (utilise qt)
QImage image;
image.load (QString ("../couloir.gif"));
image.load (QString (input_filename.c_str()));
int width = image.width ();
int height = image.height ();
int **tabImage = new int*[height];
......@@ -30,6 +59,8 @@ int main (int argc, char *argv[])
detector.setMaxTrials (-1);
detector.detectAll ();
fout << "# Line detection generated from " << argv[0] << "with format : X1 Y1 X2 Y2 on each line" << std::endl;
// Affichage
vector<BlurredSegment *> bss = detector.getBlurredSegments ();
if (! bss.empty ())
......@@ -39,22 +70,30 @@ int main (int argc, char *argv[])
{
// Affichage du premier point
vector<Pt2i> points = (*it)->getAllPoints ();
cout << "BS starts from (" << points.front().x()
<< "," << points.front().y() << ")" << endl;
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);
cout << "DSS starts from (" << bnd.front().x()
<< "," << bnd.front().y() << ")" << endl;
}
// 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++;
}
}
fout.close();
return (0);
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment