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

Aux view capture

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