From de5c9cf06ddeabbf0a1032496d5cefc71ec8f35c Mon Sep 17 00:00:00 2001 From: even <philippe.even@loria.fr> Date: Mon, 31 Dec 2018 20:56:38 +0100 Subject: [PATCH] Article: performance table corrected --- Article/Fig_auto/perfTable.tex | 17 +++++++--------- Article/Fig_synth/statsTable.tex | 6 +++--- Article/expe.tex | 14 ++++++------- Article/expeAuto.tex | 27 +++++++++++++------------- Article/method.tex | 16 +++++++-------- Article/notions.tex | 5 +++-- Code/Seg/BSTools/bsdetectionwidget.cpp | 14 +++++++++---- 7 files changed, 52 insertions(+), 47 deletions(-) diff --git a/Article/Fig_auto/perfTable.tex b/Article/Fig_auto/perfTable.tex index 3403915..4e829ce 100644 --- a/Article/Fig_auto/perfTable.tex +++ b/Article/Fig_auto/perfTable.tex @@ -1,18 +1,15 @@ -\begin{tabular}{|l||r|r|r|r|r|} +\begin{tabular}{|l||r|r|r|r|} \hline Measure $M$ & \multicolumn{1}{c|}{$T$ (ms)} & \multicolumn{1}{c|}{$N$} -& \multicolumn{1}{c|}{$N'$} & \multicolumn{1}{c|}{$L$ (pixels)} -& \multicolumn{1}{c|}{$W$ (pixels)} \\ +& \multicolumn{1}{c|}{$L$ (pixels)} & \multicolumn{1}{c|}{$W$ (pixels)} \\ \hline -$M_{old}$ on image of \RefFig{fig:auto} & 32.8 & 341 & 98 & 37.0 & 2.54 \\ -$M_{new}$ on image of \RefFig{fig:auto} & 28.3 & 385 & 101 & 32.4 & 2.21 \\ +$M_{old}$ on image of \RefFig{fig:auto} & 32.8 & 341 & 37.0 & 2.48 \\ +$M_{new}$ on image of \RefFig{fig:auto} & 28.3 & 385 & 32.4 & 2.20 \\ $M_{new}/M_{old}$ (\%) & \multicolumn{1}{l|}{86.3} & \multicolumn{1}{l|}{112.9} -& \multicolumn{1}{l|}{103.1} & \multicolumn{1}{l|}{87.6} -& \multicolumn{1}{l|}{87.0} \\ +& \multicolumn{1}{l|}{87.6} & \multicolumn{1}{l|}{88.7} \\ \hline -$M_{new}/M_{old}$ (\%) & & & & & \\ +$M_{new}/M_{old}$ (\%) & & & & \\ on CannyLines images -& 86.2 $\pm$ 2.3 & 109.8 $\pm$ 6.5 & 93.7 $\pm$ 7.1 -& 89.6 $\pm$ 5.4 & 84.8 $\pm$ 3.2 \\ +& 86.2 $\pm$ 2.3 & 109.8 $\pm$ 6.5 & 89.6 $\pm$ 5.4 & 84.8 $\pm$ 3.2 \\ \hline \end{tabular} diff --git a/Article/Fig_synth/statsTable.tex b/Article/Fig_synth/statsTable.tex index c7b013c..b4da315 100644 --- a/Article/Fig_synth/statsTable.tex +++ b/Article/Fig_synth/statsTable.tex @@ -2,11 +2,11 @@ \hline Detector : & \multicolumn{3}{c|}{old} & \multicolumn{3}{c|}{new} \\ \hline -Amount of detected segments per image +Detected blurred segments per image & 25.23 & $\pm$ & 6.66 & 23.72 & $\pm$ & 4.90 \\ -Amount of detected long segments per image +Detected long (> 40 pixels) blurred segments per image & 10.77 & $\pm$ & 1.96 & 11.62 & $\pm$ & 2.09 \\ -Amount of undetected input segments per image +Undetected input segments per image & 2.30 & $\pm$ & 2.83 & 0.47 & $\pm$ & 0.76 \\ Ratio of true detection (\%) : $\#(D\cap S)/\#S$ & 88.40 & $\pm$ & 4.31 & 89.81 & $\pm$ & 3.17 \\ diff --git a/Article/expe.tex b/Article/expe.tex index 99e66b1..e6f3cc9 100755 --- a/Article/expe.tex +++ b/Article/expe.tex @@ -20,16 +20,16 @@ matched input segment is measured. On such perfect image, the numerical error on the gradient extraction biases the line width measures. This bias was estimated in quasi ideal context (only one input segment, thus no risk of perturbation) -and the found value (1.4 pixels) was taken into account in the test. -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 width and angle measurements for the new detector. +and the found value (1.4 pixel) was taken into account in the test. +Although the effect of the old detector weaknesses should be reduced in +this low gradient noise context, the results of \RefTab{tab:synth} show +slightly better width and angle measurements for the new detector. The new detector shows more precise, with a smaller amount of false detections and succeeds in finding most of the input segments. -The second test (\RefFig{fig:hard}) visually compares the results of -both detectors on quite difficult images, even for other detectors from -the literature, with a lot of gradient noise. +The second test (\RefFig{fig:hard}) visually compares the results of both +detectors on quite noisy images, also difficult to process for other +detectors from the literature. 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] diff --git a/Article/expeAuto.tex b/Article/expeAuto.tex index 72ac08f..9f5b3bb 100755 --- a/Article/expeAuto.tex +++ b/Article/expeAuto.tex @@ -1,15 +1,16 @@ -The third series of tests aim at evaluating the performance of the new -detector wrt the previous one on a selection of more standard images. +The third campaign of tests aims at evaluating the performance of the new +detector with respect to the previous one on a selection of more standard +images. Compared measures $M$ are the execution time $T$, the amount $N$ of detected -blurred segments, the amount $N'$ of long (larger than 40 pixels) segments, -the mean length $L$ and the mean width $W$ of the detected segments. +blurred segments, the mean length $L$ and the mean width $W$ of the detected +segments. For the sake of objectivity, these results are also compared to the same -measurements made on the image data base used for the CannyLine line +measurements made on the 20 images data base used for the CannyLine line segment detector \cite{LuAl15}. \RefTab{tab:auto} gives the measures obtained on one of the selected images -(\RefFig{fig:auto}) and the result of a systematic test on the whole -CannyLine data base. +(\RefFig{fig:auto}) and the result of a systematic test on the CannyLine +data base. \begin{figure}[h] %\center \begin{tabular}{ @@ -55,17 +56,17 @@ CannyLine data base. \label{tab:auto} \end{table} -The new detector is faster and provides more blurred segments than the -previous one. -The details of \RefFig{fig:auto} d) and e) illustrate the improved -accuracy obtained. +The new detector is faster and finds more edges than the previous one. +The details of \RefFig{fig:auto} d) and e) illustrate the achieved +accuracy improvements. The output segments are thinner but also shorter. The control of the assigned width to fit to the detected segment width has the side effect of blocking the segment expansion when the remote parts are more noisy. +Found edges are thus more fragmented. The relevance of this behavior depends strongly on application requirements. -Therefore the control of the assigned width is left as an option the user -can let or cancel. +Therefore the control of the assigned width is left as an option, the user +can let or cancel it. In both case, it could be interesting to combine the detector with a tool to merge aligned segments. diff --git a/Article/method.tex b/Article/method.tex index 2cbedd8..0cc3781 100755 --- a/Article/method.tex +++ b/Article/method.tex @@ -15,16 +15,16 @@ The workflow of the detection process is summerized in the following figure. The initial detection consists in building and extending a blurred segment $\mathcal{B}$ based on the highest gradient points found in each scan -of a static directional scan based on an input segment $AB$. +of a static directional scan defined by the input stroke $AB$. Validity tests are then applied to decide of the detection poursuit. -They aim at rejecting a too short or too sparse blurred segment, or a -blurred segment with a too close orientation to the input segment $AB$. +They aim at rejecting too short or too sparse blurred segments, or +blurred segments with an orientation close to the input stroke $AB$. In case of positive response, the position $C$ and direction $\vec{D}$ of this initial blurred segment are extracted. -The fine tracking step consists on building and extending a blurred segment -$\mathcal{B}'$ based on points that correspond to local maxima of the +In the fine tracking step, another blurred segment $\mathcal{B}'$ is built +and extended with points that correspond to local maxima of the image gradient, ranked by magnitude order, and with gradient direction close to a reference gradient direction at the segment first point. At this refinement step, a control of the assigned width is applied @@ -34,7 +34,7 @@ appropriate direction. These two improvements are described in the following sections. The output segment $\mathcal{B}'$ is finally tested according to the -application needs. Too short, too sparse ot too fragmented segments +application needs. Too short, too sparse or too fragmented segments can be rejected. Length, sparsity or fragmentation thresholds are intuitive parameters left at the end user disposal. None of these tests are activated for the experimental stage in order @@ -88,9 +88,9 @@ escape from the directional scan. \end{figure} To overcome this issue, in the former work, an additional refinement step is -run using the better orientation estimated from the longer segment obtained. +run in the direction estimated from this longer segment. It is enough to completely detect most of the tested edges, but certainly -not all, especially if larger images with much longer edges are processed. +not all, especially if big size images with much longer edges are processed. As a solution, this operation could be itered as long as the blurred segment escapes from the directional scan using as any fine detection steps as necessary. diff --git a/Article/notions.tex b/Article/notions.tex index 2922a46..a35c9c0 100755 --- a/Article/notions.tex +++ b/Article/notions.tex @@ -62,8 +62,9 @@ also based on digital straight lines is also used in this work. \begin{definition} A directional scan $DS$ is an ordered partition restricted to the image domain $\mathcal{I}$ of a digital straight line $\mathcal{D}$, called the -{\it scan strip}, into scans $S_i$, each of them being a segment of a naive -line $\mathcal{N}_i$, called a {\it scan line}, orthogonal to $\mathcal{D}$. +\textbf{scan strip}, into scans $S_i$, each of them being a segment of a +naive line $\mathcal{N}_i$, called a \textbf{scan line}, orthogonal to +$\mathcal{D}$. \end{definition} \begin{equation} diff --git a/Code/Seg/BSTools/bsdetectionwidget.cpp b/Code/Seg/BSTools/bsdetectionwidget.cpp index 2567c72..b44ca6a 100755 --- a/Code/Seg/BSTools/bsdetectionwidget.cpp +++ b/Code/Seg/BSTools/bsdetectionwidget.cpp @@ -1466,6 +1466,8 @@ QSize BSDetectionWidget::setRandomImage (int type) int rw[nbsegs]; vector<BlurredSegment *> rbs[nbsegs]; + bool unbiasOn = true; + AbsRat biasVal (7, 5); bool dispEach = false; bool dispLast = false; int nbruns = 1000; @@ -1614,7 +1616,8 @@ if (nbIniPts[run] == 0) cout << "CARTE VIDE" << endl; DigitalStraightSegment *dss = (*bsit)->getSegment (); if (dss != NULL) { - dss = dss->erosion (7, 5); + if (unbiasOn) dss = dss->erosion (biasVal.numerator (), + biasVal.denominator ()); vector<Pt2i> dsspts; dss->getPoints (dsspts); vector<Pt2i>::iterator dssit = dsspts.begin (); @@ -1748,7 +1751,8 @@ if (nbIniPts[run] == 0) cout << "CARTE VIDE" << endl; DigitalStraightSegment *mydss = (*sit)->getSegment (); oldWidthBias[run] += (mydss->width () / (double) (mydss->period ())) * sqrt (bsl2) / sqrt (rdir[si].norm2 ()); - mydss = mydss->erosion (7, 5); + if (unbiasOn) mydss = mydss->erosion (biasVal.numerator (), + biasVal.denominator ()); oldWidth[run] += (mydss->width () / (double) (mydss->period ())) * sqrt (bsl2) / sqrt (rdir[si].norm2 ()); double wd = (mydss->width () / (double) (mydss->period ()) - rw[si]) @@ -1831,7 +1835,8 @@ if (nbIniPts[run] == 0) cout << "CARTE VIDE" << endl; DigitalStraightSegment *dss = (*bsit)->getSegment (); if (dss != NULL) { - dss = dss->erosion (7, 5); + if (unbiasOn) dss = dss->erosion (biasVal.numerator (), + biasVal.denominator ()); vector<Pt2i> dsspts; dss->getPoints (dsspts); vector<Pt2i>::iterator dssit = dsspts.begin (); @@ -1965,7 +1970,8 @@ if (nbIniPts[run] == 0) cout << "CARTE VIDE" << endl; DigitalStraightSegment *mydss = (*sit)->getSegment (); newWidthBias[run] += (mydss->width () / (double) (mydss->period ())) * sqrt (bsl2) / sqrt (rdir[si].norm2 ()); - mydss = mydss->erosion (7, 5); + if (unbiasOn) mydss = mydss->erosion (biasVal.numerator (), + biasVal.denominator ()); newWidth[run] += (mydss->width () / (double) (mydss->period ())) * sqrt (bsl2) / sqrt (rdir[si].norm2 ()); double wd = (mydss->width () / (double) (mydss->period ()) - rw[si]) -- GitLab