Skip to content
Snippets Groups Projects
Commit 9e49012c authored by even's avatar even
Browse files

Aux view capture

parent 42c47e37
No related branches found
No related tags found
No related merge requests found
......@@ -108,7 +108,7 @@ void BSAccumulatorItem::paint (QPainter *painter,
addText (painter, QString ("R resolution : ")
+ QString::number (resol[0]) + QString (" pixels x ")
+ QString::number (resol[1]) + QString (" degrees"));
addText (painter, QString ("P sub-pixellisation level : ")
addText (painter, QString ("W sub-pixellisation level : ")
+ QString::number (hugues->getSubpix ()));
addText (painter, QString ("F selectivity : ")
+ QString::number (hugues->getSelectionThreshold ())
......
......@@ -47,6 +47,16 @@ public:
void paint (QPainter *painter,
const QStyleOptionGraphicsItem *option, QWidget *widget);
/**
* \brief Returns the accumulator width.
*/
inline int getWidth () const { return width; }
/**
* \brief Returns the accumulator height.
*/
inline int getHeight () const { return height; }
/**
* \brief Switches on or off the information text display modality.
*/
......
......@@ -65,7 +65,7 @@ bool BSAccumulatorView::processKeyEvent (QKeyEvent *event)
(event->modifiers () & Qt::ShiftModifier) == 0);
break;
case Qt::Key_P :
case Qt::Key_W :
processed = grid->subpixellise (
(event->modifiers () & Qt::ShiftModifier) != 0);
break;
......@@ -74,6 +74,14 @@ bool BSAccumulatorView::processKeyEvent (QKeyEvent *event)
processed = grid->setFilterSelectivity (
(event->modifiers () & Qt::ShiftModifier) == 0);
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;
break;
}
return processed;
}
......@@ -285,6 +285,7 @@ void BSDetectionWidget::switchIdetAnalyzer ()
{
idetview = new BSIdetView (&detector);
idetview->setImage (&loadedImage, gMap);
idetview->update ();
idetview->show ();
}
}
......@@ -877,7 +878,7 @@ void BSDetectionWidget::displayDetectionResult ()
// Update auxiliary view if not dragging
if (nodrag)
{
if (idetview != NULL) idetview->scene()->update ();
if (idetview != NULL) idetview->update ();
if (profileview != NULL)
{
profileview->buildScans (p1, p2);
......
......@@ -31,6 +31,9 @@ BSIdetItem::BSIdetItem (BSDetector *detector)
displayItem = DISPLAY_INTENSITY;
det = detector;
ds = NULL;
offx = 0;
offy = 0;
}
......@@ -49,7 +52,7 @@ void BSIdetItem::paint (QPainter *painter,
if (det->getBlurredSegments().empty () || det->getMaxTrials () > 0)
{
buildScans ();
// buildScans ();
paintStripes (painter);
}
}
......@@ -67,6 +70,9 @@ void BSIdetItem::setImage (QImage *image, VMap *idata)
void BSIdetItem::buildScans ()
{
if ((! det->getBlurredSegments().empty ()) && det->getMaxTrials () <= 0)
return;
if (ds != NULL)
{
delete ds;
......
......@@ -52,6 +52,16 @@ public:
else return ("No info");
}
/**
* \brief Returns the detection view width.
*/
inline int getWidth () const { return width; }
/**
* \brief Returns the detection view height.
*/
inline int getHeight () const { return height; }
/**
* \brief Increments the current stripe index.
* @param inc Direction (1 for rightwards, -1 for leftwards)
......@@ -70,8 +80,11 @@ public:
*/
void toggleDisplay (bool next);
/**
* \brief Sets the image scan area from the detection initial scan.
*/
void buildScans ();
protected:
private:
......@@ -137,11 +150,6 @@ private:
*/
void paintStripes (QPainter *painter);
/**
* \brief Sets the image scan area from the detection initial scan.
*/
void buildScans ();
};
#endif
......@@ -49,28 +49,43 @@ bool BSIdetView::processKeyEvent (QKeyEvent *event)
case Qt::Key_I :
idet->toggleDisplay ((event->modifiers () & Qt::ShiftModifier) == 0);
setWindowTitle (idet->itemTitle ());
idet->update ();
scene()->update ();
break;
case Qt::Key_P : // Capture
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;
case Qt::Key_Left :
idet->incX (-1);
idet->update ();
scene()->update ();
break;
case Qt::Key_Right :
idet->incX (1);
idet->update ();
scene()->update ();
break;
case Qt::Key_Up :
idet->incY (1);
idet->update ();
scene()->update ();
break;
case Qt::Key_Down :
idet->incY (-1);
idet->update ();
scene()->update ();
break;
}
return false;
}
void BSIdetView::update ()
{
idet->buildScans ();
scene()->update ();
}
......@@ -47,6 +47,11 @@ public:
*/
bool processKeyEvent (QKeyEvent *event);
/**
* \brief Update the initial detection widget.
*/
void update ();
private:
......
......@@ -65,6 +65,16 @@ public:
else return ("No profile");
}
/**
* \brief Returns the widget display width.
*/
inline int getWidth () const { return widWidth; }
/**
* \brief Returns the widget display height.
*/
inline int getHeight () const { return widHeight; }
/**
* \brief Increments the current stripe index.
* @param inc Direction (1 for leftwards, -1 for rightwards)
......
......@@ -73,6 +73,14 @@ bool BSProfileView::processKeyEvent (QKeyEvent *event)
prof->update ();
break;
case Qt::Key_P : // Capture
viewport()->grab (
QRect (QPoint (0, 0),
QSize (prof->getWidth(), prof->getHeight()))
).toImage().save ("profiles.png");
cout << "Profiles shot in capture.png" << endl;
break;
case Qt::Key_Up :
prof->incStripe (1);
prof->update ();
......
......@@ -21,6 +21,16 @@ public:
*/
~BSStructureItem ();
/**
* \brief Return the width.
*/
inline int getWidth () const { return w; }
/**
* \brief Return the height.
*/
inline int getHeight () const { return h; }
/**
* \brief Return the zoom factor.
*/
......
......@@ -115,6 +115,14 @@ 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");
cout << "Structure shot in capture.png" << endl;
break;
case Qt::Key_Plus : // Zoom in
grid->zoomIn ();
updateBackground ();
......
......@@ -71,9 +71,11 @@ Ctrl-y && Commute l'affichage des pixels des segments flous. \\
\newpage
\begin{tabular}{|rcl|}
\hline
\multicolumn{3}{|l|}{Contr\^ole de l'extraction : \hspace{9.0cm} .} \\
\multicolumn{3}{|l|}{Contr\^ole des fen\^etres auxiliaires :
\hspace{9.0cm} .} \\
i && Changement d'info \\
v && Commute l'affichage du texte \\
p && Capture la fen\^etre dans un fichier .png \\
\hline \hline
\multicolumn{3}{|l|}{Analyse des segments flous extraits :} \\
Ctrl-i && Commute le type d'affichage des scans \\
......@@ -84,7 +86,7 @@ $< \wedge > \vee$ && D\'ecalage de l'observation \\
\multicolumn{3}{|l|}{Analyse des accumulateurs :} \\
s && Taille de l'accumulateur (nombre de cellules) \\
r && R\'esolution (espace couvert par une cellule) \\
p && Sub-pixelisation (pour le vote) \\
w && Sub-pixelisation (pour le vote) \\
f && S\'electivit\'e du filtre \\
\hline \hline
\multicolumn{3}{|l|}{Analyse des profils :} \\
......
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