From 42c47e37cadaa8c5fd4e9e1735d207662b36bbbd Mon Sep 17 00:00:00 2001
From: even <philippe.even@loria.fr>
Date: Wed, 5 Dec 2018 17:22:48 +0100
Subject: [PATCH] Article: adaptive scan

---
 Article/Fig_notions/bscone.tex | 28 +++++++++++
 Article/notions.tex            | 92 +++++++++++++++++++++++++---------
 2 files changed, 97 insertions(+), 23 deletions(-)
 create mode 100644 Article/Fig_notions/bscone.tex

diff --git a/Article/Fig_notions/bscone.tex b/Article/Fig_notions/bscone.tex
new file mode 100644
index 0000000..5342992
--- /dev/null
+++ b/Article/Fig_notions/bscone.tex
@@ -0,0 +1,28 @@
+\begin{picture}(200,85)(0,-17.5)
+  \put(0,17.5){\line(4,1){200}}
+  \put(0,-17.5){\line(4,1){200}}
+  \put(0,32.5){\line(4,-1){200}}
+  \put(0,67.5){\line(4,-1){200}}
+  \thicklines
+  \put(50,20){\framebox(100,10)}
+  \thinlines
+  \multiput(45,-6.25)(110,0){2}{\line(0,1){62.5}}
+  \multiput(40,-7.5)(120,0){2}{\line(0,1){65}}
+  \multiput(35,-8.75)(130,0){2}{\line(0,1){67.5}}
+  \multiput(30,-10)(140,0){2}{\line(0,1){70}}
+  \multiput(25,-11.25)(150,0){2}{\line(0,1){72.5}}
+  \multiput(20,-12.5)(160,0){2}{\line(0,1){75}}
+  \multiput(15,-13.75)(170,0){2}{\line(0,1){77.5}}
+
+  \multiput(50,28)(70,2){2}{\circle*{3}}
+  \multiput(55,24)(60,0){2}{\circle*{3}}
+  \multiput(60,20)(70,0){2}{\circle*{3}}
+  \multiput(65,21)(80,0){2}{\circle*{3}}
+  \multiput(70,25)(55,0){2}{\circle*{3}}
+  \multiput(75,26)(65,0){2}{\circle*{3}}
+  \multiput(80,22)(70,0){2}{\circle*{3}}
+  \multiput(85,24)(25,0){2}{\circle*{3}}
+  \multiput(90,27)(15,0){2}{\circle*{3}}
+  \multiput(100,26)(35,1){2}{\circle*{3}}
+  \put(95,28){\circle*{3}}
+\end{picture}
diff --git a/Article/notions.tex b/Article/notions.tex
index 5a2d709..a58374e 100755
--- a/Article/notions.tex
+++ b/Article/notions.tex
@@ -7,18 +7,18 @@ defined in the digital geometry literature \cite{KletteRosenfeld04}.
 Only the 2-dimensional case is considered here.
 
 \begin{definition}
-A digital line $\mathcal{D}$ with integer parameters $(a,b,c,\nu)$ is the set
+A digital line $\mathcal{L}$ with integer parameters $(a,b,c,\nu)$ is the set
 of points $P(x,y)$ of $\mathbb{Z}^2$ that satisfy : $0 \leq ax + by - c < \nu$.
 \end{definition}
 
 The parameter $\nu$ is the arithmetic width of the digital line.
-When $\nu = max (|a|, |b|)$, $\mathcal{D}$ is the narrowest 8-connected
+When $\nu = max (|a|, |b|)$, $\mathcal{L}$ is the narrowest 8-connected
 line and is called a naive line.
 
 \begin{definition}
 A blurred segment $\mathcal{B}$ of assigned width $\varepsilon$ is a set
-$\mathcal{S}_\varepsilon$ of points in $\mathbb{Z}^2$ that all belong
-to a digital line of arithmetical width $\varepsilon$.
+of points in $\mathbb{Z}^2$ that all belong to a digital line of
+arithmetical width $\varepsilon$.
 \end{definition}
 
 Linear time algorithms have been developed to recognize a blurred segment
@@ -128,28 +128,74 @@ c' = a'\cdot x_C + b'\cdot y_C - w / 2 + i\cdot w
 
 \subsection{Adaptive directional scan}
 
-Notions \`a d\'evelopper :
-\begin{itemize}
-\item Direction de scan
-\item Epaisseur de consigne du SF
-\item Largeur optimale du SF
-\end{itemize}
+We try to detect a blurred segment  inside a directional scan which position
+and orientation are given by the user, or defined in arbitrary direction in
+unsupervised mode.
+Most of the times, the detection stops where the segment escapes sideways
+froms the scan strip.
+Therefore a second search is run again using an other directional scan aligned
+on the detected segment.
+But we only have an estimation of this blurred segment direction, and the
+longer the real segment, the higher the probability to fail again on a
+blurred segment escape from the directional scan.
 
-Poser le pb : la direction est incompl\`etement estim\'ee, d'o\`u un risque
-de sortie de scan.
-\begin{picture}(300,20)
-\framebox(300,20){Illustration d'une sortie de scan avec les diff\'erentes
-\'epaisseurs en jeu}
-\end{picture}
+\begin{figure}[h]
+\center
+  \begin{picture}(300,40)
+  \end{picture}
+  \caption{Example of early detection failures
+           on side escapes from the directional scan.}
+  \label{fig:sideEscapes}
+\end{figure}
 
-La direction du segment ne peut \^etre connue qu'a posteriori.
+Even in ideal situation where the detected segment is a perfect line,
+its width is never null as a result of the discretization process.
+The estimated direction accuracy is mostly constrained by the length of
+the detected segment.
+To avoid these side escapes, the scan should not be a linear strip but
+rather a conic shape to take into account the blurred segment preimage.
+% Of course this problem is amplified when ideal BS are considered.
+% -> FAUX : c'est relativement plus penalisant sur 1 BS reduit a 2 pts
+% que sur un BS qu'on n'autorise pas a s'elargir.
+This side shift is amplified when we let the blurred segment the capacity 
+to get thicker in order to capture possible noisy features.
+The assigned width is then still greater than the detected minimal width,
+so that the segment can move within the directional scan.
+Knowing the detected BS shape and the image size, it is possible to
+define a conic scan area, but this solution is computationaly expensive
+because it leads to useless exploration of large image areas.
+
+\begin{figure}[h]
+\center
+  %\begin{picture}(300,40)
+  %\end{picture}
+  \input{Fig_notions/bscone}
+  \caption{Possible extension area based
+           on the detected blurred segment preimage.}
+  \label{fig:cone}
+\end{figure}
 
-La direction d'une droite discr\`ete s'affine au fur et \`a mesure de
-son d\'eveloppement. 
-Ainsi en va t-il des segments flous (a fortiori).
+The solution implemented in the former work was to let some arbitrary
+margin between the scan strip width and the assigned width to the detection,
+and to perform two fine detection steps, using for each of them the direction
+found at the former step.
+This process could be itered as long as the blurred segment escapes from
+the directional scanner using as any detection steps as necessary.
+But it produces a useless computational coast, because of the margin left,
+but also the multiple detection of the same segment start points.
 
-Il faut donc r\'eactualiser la direction du scan.
+\begin{figure}[h]
+\center
+  \begin{picture}(300,40)
+  \end{picture}
+  \caption{Example of blurred segment detection
+           using an adaptive directional scan.}
+  \label{fig:adaptiveScan}
+\end{figure}
 
-$N$ scans reste limit\'e.
+The solution we propose here is to dynamically adapt the scan direction
+on the detection result. At each position, the scan strip is updated
+using the BS direction and minimal width computed at the former position,
+that is :
+\[\mathcal{S}_i = \mathcal{L}_0 \cup \mathcal{D}_{i-1}\]
 
-D'o\`u le scan adaptatif $\rightarrow$ r\'eorientation de $\mathcal{S}$.
-- 
GitLab