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

Expe on synthetic images

parent 1318cda0
No related branches found
No related tags found
No related merge requests found
Showing
with 600 additions and 201 deletions
Article/Fig_hard/hardNew.png

375 KiB

Article/Fig_hard/hardOld.png

377 KiB

...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
\SetKwData{Begin}{Start} \SetKwData{Begin}{Start}
\SetKwData{End}{End} \SetKwData{End}{End}
\Input{Image \image, width \iwidth, height \iheight, resolution \resol} \Input{Image \image, width \iwidth, height \iheight, sweeping step \resol}
\Output{\textit{\bslist} $\rightarrow$ list of detected blurred segments} \Output{\textit{\bslist} $\rightarrow$ list of detected blurred segments}
\BlankLine \BlankLine
\bslist $\leftarrow$ \nullset\; \bslist $\leftarrow$ \nullset\;
...@@ -41,5 +41,5 @@ ...@@ -41,5 +41,5 @@
$y \leftarrow y~+$ \resol\; $y \leftarrow y~+$ \resol\;
} }
\caption{AutoDetect: finds all blurred segments in the image.} \caption{AutoDetect: finds all the blurred segments in the image.}
\end{algorithm} \end{algorithm}
...@@ -17,14 +17,14 @@ ...@@ -17,14 +17,14 @@
\SetKwFunction{locmax}{ComputeAndSortGradientLocalMax} \SetKwFunction{locmax}{ComputeAndSortGradientLocalMax}
\SetKwFunction{sortgradmax}{SortByGradientMagnitude} \SetKwFunction{sortgradmax}{SortByGradientMagnitude}
\SetKwFunction{updatemask}{UpdateOccupancyMask}
\SetKwFunction{taille}{Size} \SetKwFunction{taille}{Size}
\SetKwFunction{cardinal}{Card} \SetKwFunction{cardinal}{Card}
\SetKwData{Begin}{Start} \SetKwData{Begin}{Start}
\SetKwData{End}{End} \SetKwData{End}{End}
\Input{Stroke points \pta, \ptb} \Input{Stroke points \pta, \ptb, occupancy mask \mask}
\Input{Occupancy mask \mask}
\Output{\textit{\bslist} $\rightarrow$ list of detected blurred segments} \Output{\textit{\bslist} $\rightarrow$ list of detected blurred segments}
\BlankLine \BlankLine
\bslist $\leftarrow$ \nullset\; \bslist $\leftarrow$ \nullset\;
...@@ -32,11 +32,9 @@ ...@@ -32,11 +32,9 @@
\BlankLine \BlankLine
\For{$i \leftarrow 0$ \KwTo \taille(\lm)}{ \For{$i \leftarrow 0$ \KwTo \taille(\lm)}{
\bseg $\leftarrow$ detect (\lm[i], \ortho, \eps, \mask)\; \bseg $\leftarrow$ detect (\lm[i], \ortho, \eps, \mask)\;
\For{$j \leftarrow 0$ \KwTo \cardinal (\bseg)}{ \updatemask (\mask, \bseg)\;
\mask $\leftarrow$ \bseg[j]\;
}
\bslist $\leftarrow$ \bseg\; \bslist $\leftarrow$ \bseg\;
} }
\caption{MultiDetect: finds all blurred segments from input selection.} \caption{MultiDetect: finds all the selected blurred segments.}
\end{algorithm} \end{algorithm}
RESULTS FOR THE OLD DETECTOR
56.515 (pm 16.826) segments searches (local min) / image
21.223 (pm 5.31578) provided segments / image
10.898 (pm 1.88339) provided long segments / image
1.15 (pm 1.79798) undetected segments per image
96.8287 (pm 0.608812) % of points found
0.0154251 (pm 0.0252677) % of points found more than once (redetections)
6.92689 (pm 1.0261) % false points produced
Width difference : 2.08036 (0.266341) per matched segment
Absolute width difference : 2.10178 (0.264193) per matched segment
Angle difference : -0.00233791 (0.675674) degrees per matched segment
Absolute angle difference : 0.872721 (0.780913) per matched segment
Absolute long edge angle difference : 0.400459 (0.627538) per matched segment
RESULTS FOR THE NEW DETECTOR
61.405 (pm 15.4125) segments searches (local min) / image
27.334 (pm 6.37535) provided segments / image
9.03 (pm 2.15261) provided long segments / image
0.281 (pm 0.562455) undetected segments per image
96.8063 (pm 0.615733) % of points found
0.011969 (pm 0.0195106) % of points found more than once (redetections)
6.5253 (pm 0.94361) % false points produced
Width difference : 1.90539 (0.236267) per matched segment
Absolute width difference : 1.94935 (0.230798) per matched segment
Angle difference : 0.00697535 (0.724535) degrees per matched segment
Absolute angle difference : 0.916683 (0.754317) per matched segment
Long edge absolute angle difference : 0.336041 (0.595828) per matched segment
Article/Fig_synth/statsExample.png

69.4 KiB

\begin{tabular}{|l||rcl|rcl|}
\hline
Number of input segments per image
& 21.22 & $\pm$ & 5.32 & 27.33 & $\pm$ & 6.38 \\
Number of long input segments per image
& 10.90 & $\pm$ & 1.88 & 9.03 & $\pm$ & 2.15 \\
Number of undetected segments per image
& 1.15 & $\pm$ & 1.80 & 0.28 & $\pm$ & 0.56 \\
Percentage of true segment area found
& 96.83 & $\pm$ & 0.61 & 96.81 & $\pm$ & 0.62 \\
Percentage of false segment area found
& 6.9 & $\pm$ & 1.0 & 6.52 & $\pm$ & 0.94 \\
Width difference (in pixels) to input segment
& 2.08 & $\pm$ & 0.27 & 1.91 & $\pm$ & 0.24 \\
Angle difference (in degrees) to input segment
& 0.87 & $\pm$ & 0.78 & 0.92 & $\pm$ & 0.75 \\
Long segment angle difference (in degrees)
& 0.40 & $\pm$ & 0.63 & 0.34 & $\pm$ & 0.60 \\
\hline
\end{tabular}
Article/Fig_synth/statsnewBounds.png

2.97 KiB

Article/Fig_synth/statsnewPoints.png

3.38 KiB

Article/Fig_synth/statsoldBounds.png

3.02 KiB

Article/Fig_synth/statsoldPoints.png

3.34 KiB

...@@ -56,7 +56,7 @@ ...@@ -56,7 +56,7 @@
number = "6", number = "6",
pages = "1675--1684", pages = "1675--1684",
year = "2007", year = "2007",
doi = "10.1016/j.patcog.2006.10.005" optdoi = "10.1016/j.patcog.2006.10.005"
} }
...@@ -81,7 +81,7 @@ ...@@ -81,7 +81,7 @@
year = {2017}, year = {2017},
number = {2}, number = {2},
pages = {35-54}, pages = {35-54},
doi = {10.1016/j.patcog.2006.10.005} optdoi = {10.1016/j.patcog.2006.10.005}
} }
...@@ -124,7 +124,7 @@ ...@@ -124,7 +124,7 @@
optmonth = apr, optmonth = apr,
year = {2010}, year = {2010},
pages = {722--732}, pages = {722--732},
doi = {10.1109/TPAMI.2008.300} optdoi = {10.1109/TPAMI.2008.300}
} }
...@@ -147,7 +147,7 @@ ...@@ -147,7 +147,7 @@
publisher = {IEEE}, publisher = {IEEE},
year = {2015}, year = {2015},
pages = {507--511}, pages = {507--511},
doi = {10.1109/ICIP.2015.7350850} optdoi = {10.1109/ICIP.2015.7350850}
} }
...@@ -161,5 +161,5 @@ ...@@ -161,5 +161,5 @@
number = {01}, number = {01},
year = {2012}, year = {2012},
pages = {1255002}, pages = {1255002},
doi = {10.1142/S0218001412550026} optdoi = {10.1142/S0218001412550026}
} }
...@@ -9,6 +9,10 @@ detection followed by two refinement steps) is integrated as an option ...@@ -9,6 +9,10 @@ detection followed by two refinement steps) is integrated as an option
into the code of the new detector, so that both methods rely on the same into the code of the new detector, so that both methods rely on the same
optimized basic routines. optimized basic routines.
\input{expeSynthese}
\input{expeHard}
The first test compares the computation times of both detectors on a The first test compares the computation times of both detectors on a
selection of input strokes (\RefFig{fig:buro}). Results are displayed selection of input strokes (\RefFig{fig:buro}). Results are displayed
in \RefTab{tab:cmpOldNew}. in \RefTab{tab:cmpOldNew}.
......
The second test (\RefFig{fig:hard}) compares the performance of both
detectors on a quite difficult image with a lot of gradient noise.
The new detector provides less outliers and misaligned segments, and
globally more relevant informations to infere the structure of the brick wall.
\begin{figure}[h]
%\center
\begin{tabular}{
c@{\hspace{0.1cm}}c@{\hspace{0.1cm}}c@{\hspace{0.1cm}}}
\includegraphics[width=0.32\textwidth]{Fig_method/parpaings.png} &
\includegraphics[width=0.32\textwidth]{Fig_hard/hardOld.png} &
\includegraphics[width=0.32\textwidth]{Fig_hard/hardNew.png}
\begin{picture}(1,1)
{\color{dwhite}{
\put(-286,4.5){\circle*{8}}
\put(-171,4.5){\circle*{8}}
\put(-58,4.5){\circle*{8}}
}}
\put(-288.5,2){a}
\put(-173.5,2){b}
\put(-60.5,2){c}
\end{picture}
\end{tabular}
\caption{Evaluation on a quite textured image:
1) imput image,
2) results of the old detector,
3) results of the new detector.}
\label{fig:hard}
\end{figure}
The first test (\RefFig{fig:synth}) compares the performance of both
detectors on a set of 1000 synthesized images containing 10 randomly
placed straight segments with random width between 1 and 4 pixels.
Altough this perfect world context with low gradient noise tends to soften
the old detector weaknesses, the results of \RefTab{tab:synth} show slightly
better measurements of width and angle on long segments for the new detector.
The new detector generates more small segments that degrade the angle
estimations, but it produces a smaller amount of false detections and
succeeds in finding most of the segments.
\begin{figure}[h]
%\center
\begin{tabular}{
c@{\hspace{0.1cm}}c@{\hspace{0.1cm}}c@{\hspace{0.1cm}}c@{\hspace{0.1cm}}c}
\includegraphics[width=0.19\textwidth]{Fig_synth/statsExample.png} &
\includegraphics[width=0.19\textwidth]{Fig_synth/statsoldPoints.png} &
\includegraphics[width=0.19\textwidth]{Fig_synth/statsoldBounds.png} &
\includegraphics[width=0.19\textwidth]{Fig_synth/statsnewPoints.png} &
\includegraphics[width=0.19\textwidth]{Fig_synth/statsnewBounds.png}
\begin{picture}(1,1)
\put(-310,0){1)}
\put(-240,0){2)}
\put(-170,0){3)}
\put(-100,0){4)}
\put(-30,0){5)}
\end{picture}
\end{tabular}
\caption{Evaluation on synthesized images:
1) one of the test images,
2) output segments points from the old detector and
3) their minimal digital straight segments,
4) output segments points from the new detector and
5) their minimal digital straight segments.}
\label{fig:synth}
\end{figure}
\begin{table}
\centering
\input{Fig_synth/statsTable}
\caption{Measured performance of both detectors on a set of synthesized images.}
\label{tab:synth}
\end{table}
...@@ -257,6 +257,8 @@ In order to avoid multiple detections of the same edge, an occupancy mask, ...@@ -257,6 +257,8 @@ In order to avoid multiple detections of the same edge, an occupancy mask,
initially empty, collects the dilated points of all the blurred segments, initially empty, collects the dilated points of all the blurred segments,
so that these points can not be added to another segment. so that these points can not be added to another segment.
\input{Fig_method/algoMulti}
First the positions $M_j$ of the prominent local maxima of the gradient First the positions $M_j$ of the prominent local maxima of the gradient
magnitude found under the stroke are sorted from the highest to the lowest. magnitude found under the stroke are sorted from the highest to the lowest.
For each of them the main detection process is run with three modifications: For each of them the main detection process is run with three modifications:
...@@ -265,14 +267,13 @@ For each of them the main detection process is run with three modifications: ...@@ -265,14 +267,13 @@ For each of them the main detection process is run with three modifications:
$\vec{AB}_\perp$ to the stroke as input to build a static scan of fixed width $\vec{AB}_\perp$ to the stroke as input to build a static scan of fixed width
$2~\varepsilon_{ini}$, and $M_j$ is used as start point of the blurred $2~\varepsilon_{ini}$, and $M_j$ is used as start point of the blurred
segment; segment;
\item the occupancy mask is filled in with the points of the detected blurred \item the occupancy mask is filled in with the points of the dilated blurred
segments $\mathcal{B}_j''$ at the end of each successful detection; segments $\mathcal{B}_j''$ at the end of each successful detection
(a 21 pixels bowl is used to get the segment dilation);
\item points marked as occupied are rejected when selecting candidates for the \item points marked as occupied are rejected when selecting candidates for the
blurred segment extension in the fine tracking step. blurred segment extension in the fine tracking step.
\end{enumerate} \end{enumerate}
\input{Fig_method/algoMulti}
In edge selection mode (\RefFig{fig:edgeDir} b), the multi-detection In edge selection mode (\RefFig{fig:edgeDir} b), the multi-detection
algorithm is executed twice, first in main edge selection mode, then algorithm is executed twice, first in main edge selection mode, then
in opposite edge selection mode. in opposite edge selection mode.
...@@ -334,41 +335,41 @@ is described in Algorithm 2. A stroke that crosses the whole image, is ...@@ -334,41 +335,41 @@ is described in Algorithm 2. A stroke that crosses the whole image, is
swept in both direction, vertical then horizontal, from the center to swept in both direction, vertical then horizontal, from the center to
the borders. At each position, the multi-detection algorithm is run the borders. At each position, the multi-detection algorithm is run
to collect all the segments found under the stroke. to collect all the segments found under the stroke.
In the present work, the stroke sweeping step $\delta$ is set to 10 pixels.
\input{Fig_method/algoAuto} \input{Fig_method/algoAuto}
\RefFig{fig:evalAuto}b gives an idea of the automatic detection performance. %\RefFig{fig:evalAuto}b gives an idea of the automatic detection performance.
In the example of \RefFig{fig:noisy}, hardly perceptible edges are detected %In the example of \RefFig{fig:noisy}, hardly perceptible edges are detected
despite of a quite textured context. %despite of a quite textured context.
Unsurpringly the length of the detected edges is linked to the initial %Unsurpringly the length of the detected edges is linked to the initial
value of the assigned width, but a large value also augments the rate %value of the assigned width, but a large value also augments the rate
of interfering outliers insertion. %of interfering outliers insertion.
%
\begin{figure}[h] %\begin{figure}[h]
\center %\center \begin{tabular}{c@{\hspace{0.1cm}}c@{\hspace{0.1cm}}c}
\begin{tabular}{c@{\hspace{0.1cm}}c@{\hspace{0.1cm}}c} % \includegraphics[width=0.32\textwidth]{Fig_method/parpaings.png} &
\includegraphics[width=0.32\textwidth]{Fig_method/parpaings.png} & % \includegraphics[width=0.32\textwidth]{Fig_method/parpaings2.png} &
\includegraphics[width=0.32\textwidth]{Fig_method/parpaings2.png} & % \includegraphics[width=0.32\textwidth]{Fig_method/parpaings3.png}
\includegraphics[width=0.32\textwidth]{Fig_method/parpaings3.png} % \end{tabular}
\end{tabular} % \begin{picture}(1,1)(0,0)
\begin{picture}(1,1)(0,0) % {\color{dwhite}{
{\color{dwhite}{ % \put(-286,-25.5){\circle*{8}}
\put(-286,-25.5){\circle*{8}} % \put(-171,-25.5){\circle*{8}}
\put(-171,-25.5){\circle*{8}} % \put(-58,-25.5){\circle*{8}}
\put(-58,-25.5){\circle*{8}} % }}
}} % \put(-288.5,-28){a}
\put(-288.5,-28){a} % \put(-173.5,-28){b}
\put(-173.5,-28){b} % \put(-60.5,-28){c}
\put(-60.5,-28){c} % \end{picture}
\end{picture} % \caption{Automatic detection of blurred segments on a textured image.
\caption{Automatic detection of blurred segments on a textured image. % a) the input image,
a) the input image, % b) automatic detection result with initial assigned width set
b) automatic detection result with initial assigned width set % to 3 pixels,
to 3 pixels, % c) automatic detection result with initial assigned width set
c) automatic detection result with initial assigned width set % to 8 pixels.}
to 8 pixels.} % \label{fig:noisy}
\label{fig:noisy} %\end{figure}
\end{figure}
The automatic detection of blurred segments in a whole image is left The automatic detection of blurred segments in a whole image is left
available for testing in an online demonstration at the following address: \\ available for testing in an online demonstration at the following address: \\
......
This diff is collapsed.
...@@ -128,6 +128,11 @@ public: ...@@ -128,6 +128,11 @@ public:
*/ */
void switchHighlightColors (); void switchHighlightColors ();
/**
* \brief Switches the extraction stats display on or off.
*/
inline void switchStats () { stats = ! stats; }
/** /**
* \brief Switches the extraction result display on or off. * \brief Switches the extraction result display on or off.
*/ */
...@@ -241,6 +246,8 @@ private: ...@@ -241,6 +246,8 @@ private:
int background; int background;
/** Black level used to lighten background images. */ /** Black level used to lighten background images. */
int blevel; int blevel;
/** Flag indicating whether detection stats should be output. */
bool stats;
/** Flag indicating whether detection result should be output. */ /** Flag indicating whether detection result should be output. */
bool verbose; bool verbose;
...@@ -348,6 +355,11 @@ private: ...@@ -348,6 +355,11 @@ private:
*/ */
void displayBackground (); void displayBackground ();
/**
* \brief Writes the stats of the last detection in a file.
*/
void writeStats ();
/** /**
* \brief Writes the result of the last detection in a file. * \brief Writes the result of the last detection in a file.
*/ */
......
...@@ -271,6 +271,7 @@ BlurredSegment *BlurredSegmentProto::endOfBirth () ...@@ -271,6 +271,7 @@ BlurredSegment *BlurredSegmentProto::endOfBirth ()
DigitalStraightLine::DSL_THIN, DigitalStraightLine::DSL_THIN,
xmin, ymin, xmax, ymax); xmin, ymin, xmax, ymax);
} }
else return (NULL);
Pt2i aps (-1, -1), ape (-1, -1), apv (-1, -1); Pt2i aps (-1, -1), ape (-1, -1), apv (-1, -1);
if (convexhull != NULL) if (convexhull != NULL)
convexhull->antipodalEdgeAndVertex (aps, ape, apv); convexhull->antipodalEdgeAndVertex (aps, ape, apv);
......
...@@ -240,6 +240,12 @@ void DynamicalScannerO1::bindTo (int a, int b, int c) ...@@ -240,6 +240,12 @@ void DynamicalScannerO1::bindTo (int a, int b, int c)
nu = (templ_nu * new_n1) / old_n1; nu = (templ_nu * new_n1) / old_n1;
else else
nu = (templ_nu * new_ninf) / old_ninf; nu = (templ_nu * new_ninf) / old_ninf;
if (dlb < 0) // dlb should stay positive to avoid the direction change
{ // of the support line inequations.
dla = -dla;
dlb = -dlb;
c = -c;
}
dlc1 = c + nu / 2; dlc1 = c + nu / 2;
dlc2 = c - nu / 2; dlc2 = c - nu / 2;
} }
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