Skip to content
Snippets Groups Projects
Commit 665dbbbc authored by evenp's avatar evenp
Browse files

Notions rewrited

parent b25a5c13
No related branches found
No related tags found
No related merge requests found
......@@ -7,7 +7,6 @@
\SetKwData{dsd}{$\vec{V}_0$}
\SetKwData{dirn}{$\vec{V}_G$}
\SetKwData{dire}{$\vec{V}_E$}
\SetKwData{dst}{$W_0$}
\SetKwData{ath}{$\varepsilon$}
%\SetKwData{on}{isExtending}
%\SetKwData{nb}{$n_E$}
......@@ -47,21 +46,22 @@
\SetKwFunction{rempt}{removePoint}
\SetKwFunction{thickness}{thickness}
\SetKwFunction{setath}{setMaxThickness}
\SetKwFunction{ang}{angle}
\SetKwFunction{ang}{$\angle$}
\SetKwFunction{dir}{direction}
\SetKwFunction{alignds}{alignScanner}
\SetKwFunction{centerline}{centerLine}
\Input{gradient magnitude map \gmap, gradient orientation map \vmap,
directional scan center \dsc, direction \dsd and thickness \dst,
initial assigned thickness \ath, edge gradient direction \dire}
directional scan center \dsc and direction \dsd,
maximal thickness \ath, reference edge gradient direction \dire,
maximal amount of successive detection fails \imax}
\Output{a detected blurred segment \bs}
\bs \takes $\emptyset$\;
\dirn \takes \ortho(\dsd, \dire)
\Comment*{Gets test gradient direction:
\dirn $\perp$ \dsd, \dirn$\cdot$\dire $> 0$}
\ds \takes \getads (\dsc, \dsd, \dst) \Comment*{Gets an ADS from input scan.}
\ds \takes \getads (\dsc, \dsd, 2\ath) \Comment*{Gets an ADS from input scan.}
\scan \takes \fscan (\ds)\;
\index \takes \locmax (\scan, \gmap, \gdiff, \vmap, \dirn)
\Comment*{Gets index of pixels with oriented gradient local max.}
......@@ -75,16 +75,16 @@
\While{\ninter $-$ \ntemp $\neq$ (\imax, \imax)}{
\nb \takes \nb $+$ $1$\;
\bsth \takes \thickness(\bs)\;
\If{\pinchcount = \pinchdelay}{
\If{\pinchcount $=$ \pinchdelay}{
\setath (\bs, \max (\ath, \thickness(\bs) + \half))\;
}
\If{\nb $>$ \adsdelay}{
\If{\nb = \adsdelay $+$ $1$ and \angle(\dir(\bs),\dsd) $>$ \devang}{
\If{\nb $=$ \adsdelay $+$ $1$ and \ang(\dir(\bs),\dsd) $>$ \devang}{
\niside \takes \ntside $+$ (\imax, \imax)
\Comment*{Too large deviation}
}
\alignds(\ds,\centerline(\bs))
\Comment*{Aligns scan stripe on blurred segment.}
\Comment*{Aligns scan strip on blurred segment.}
}
\ForEach{\side}{
\If{\niside $-$ \ntside $\leq$ \imax}{
......
......@@ -28,8 +28,9 @@
\SetKwFunction{bsinit}{initializeBlurredSegment}
\SetKwFunction{addpt}{addPoint}
\Input{gradient magnitude map \gmap,
input segment \is, assigned thickness \ath}
\Input{gradient magnitude map \gmap, input segment \is,
maximal thickness \ath,
maximal amount of successive detection fails \imax}
\Output{a detected blurred segment \bs}
\bs \takes $\emptyset$\;
......
......@@ -9,7 +9,7 @@
\SetKwData{crossang}{$\alpha_{min}$}
\SetKwData{vecbs}{$\vec{D}$}
\SetKwData{nb}{$n$}
\SetKwData{ang}{$angle$}
\SetKwData{ang}{$\angle$}
\SetKwData{bsstart}{$P$}
\SetKwData{dire}{$\vec{V}_E$}
\SetKwData{centerpt}{$C$}
......@@ -45,8 +45,8 @@
}{
\bsstart \takes \startpt (\bs)\;
\dire \takes \vmap $[$ \bsstart $]$\;
\centerpt \takes \centerline (\bs) $\cup$ \is\;
\bs \takes \finetrack (\gmap, \vmap, \centerpt, \vecbs, $2$ \ath, \ath, \dire)
\centerpt \takes \centerline (\bs) $\cap$ \is\;
\bs \takes \finetrack (\gmap, \vmap, \centerpt, \vecbs, \ath, \dire)
\Comment*{Runs fine tracking.}
\If{\size (\bs) $<$ \minsize}{
\bs \takes $\emptyset$ \Comment*{Not enough points.}
......
......@@ -28,15 +28,12 @@ Further extension is considered as useless.
On each side, the process stops after a fixed amount of successive extension
fails.
\input{Algos/algoInitial}
Three parameters are used in this step:
Two parameters are used in this step:
a minimal gradient magnitude $G_{min}$ to select candidates,
a maximal extent $N_E$ of the blurred segment,
and a maximal count $N_I$ of successive extent fails.
Nominal values are proposed for $G_{min}$ and $N_E$.
$N_I$ is set to a default value,
that can be adjusted according to the application context.
a maximal extent $N_E$ of the blurred segment.
Nominal values are proposed for them.
\input{Algos/algoInitial}
\subsection{Fine tracking step of single extraction}
......@@ -48,13 +45,11 @@ maxima of gradient magnitude found in the scan are tested untill a valid
one is found. Moreover the gradient orientation is checked when selecting
candidate points, using a rather strict maximal deviation value.
In order to avoid early stops when the detected segment escapes from the
scan stripe, the directional scanner is aligned on the blurred segment
scan strip, the directional scanner is aligned on the blurred segment
center line at each step. This alignment is only performed after a
predefined number of steps when the blurred segment direction gets
stable enough.
\input{Algos/algoFinal}
Moreover when the growing segment stops thickenning, the assigned maximal
thickness of the recognition algorithm is pinched to a near value to
the observed thickness. This pinch procedure avoids further inclusion of
......@@ -66,10 +61,12 @@ Finally, when any extension fail occurs, the amount of later successful
extensions must coincide to the fail count to validate these points.
This condition helps to detect more accurate segment ends.
Three new parameters are used in this step:
\input{Algos/algoFinal}
Three parameters are used in this step:
a gradient height $\delta_G$ to discriminate local gradient maxima,
a minimal count $N_P$ of successive extents without blurred segment thickening,
and a minimal extent $N_A$ before recentering the scan stripe.
and a minimal extent $N_A$ before recentering the scan strip.
Nominal values are proposed for all of them.
\subsection{Single blurred segment extraction}
......@@ -77,6 +74,9 @@ Nominal values are proposed for all of them.
The blurred segment extraction calls the initial detection, then the fine
tracking steps and applies optional validation tests to the output segment.
It is detailed in algorithm~/ref{algo:single}.
Parameters are the maximal thickness $\varepsilon$ assigned to the blurred
recognition algorithm, and the maximal amount $N_I$ of successive detection
fail accepted.
\input{Algos/algoSingle}
......
......@@ -50,7 +50,7 @@
\SetCommentSty{mycmtsty}
% Use \newtheorem{} for remarks and definitions.
\usepackage{amsthm}
\usepackage{amsthm,amssymb}
\newtheorem{definition}{Definition}
\newtheorem*{remark}{Remark}
......@@ -160,9 +160,9 @@ Compilation and execution instruction are included in the
%------------------------------------------------------------------------------
\section*{Acknowledgement}
This work was originated in the scope of the French GeoDib ANR project
("{\it G\'eom\'etrie des objets discrets bruit\'es}") held from 2006 to 2009
and aiming at developing theoretical notions and algorithms to process noisy
This work is a long-term outcome of French GeoDib ANR project
("{\it G\'eom\'etrie des objets discrets bruit\'es}") held from 2006 to 2009,
aiming at developing theoretical notions and algorithms to process noisy
discrete objects.
%------------------------------------------------------------------------------
......
File added
File added
File added
File added
\section{Required notions of discrete geometry}
\section{Used notions of discrete geometry}
Nouveau rappel des notions de geo discrete indispensables pour comprendre
les algos :
\begin{itemize}
\item Discrete straight line
\begin{itemize}
\item{Thickness $\mu$}
\end{itemize}
\item Blurred segment
In this section, the main notions of discrete geometry used in the
framework are briefly recalled.
A \textbf{digital straight line} $\mathcal{L}(a,b,c,\nu)$ is the set of
points $p=(x,y) \in \mathbb{Z}^2$, such that:
\begin{equation}
0 \leq ax + by - c < \nu, \mbox{ with } (a,b,c,\nu) \in \mathbb{Z}^4
\end{equation}
The example of $\mathcal{L}(7,5,45,18)$ is given in \RefFig{fig:bs}(a).
In this work, we use the following notations:
\begin{itemize}
\item{Assigned thickness}
\item{Optimal line}
\item{Main lines of the recognition algorithm}
\end{itemize}
\item Directional scanner
\item Adaptive directional scanner
\item director vector: $\vec{V}(\mathcal{L}) = (a,b)$
\item arithmetical width: $W(\mathcal{L}) = \nu$
\item shift to origin: $H(\mathcal{L}) = c$
\item period: $P(\mathcal{L}) = max(|a|,|b|)$
\item lower bounding line:
$L(\mathcal{L}) = \left\{(x',y')\in\mathbb{R}^2~|~ax'+by'=c\right\}$
\item upper bounding line:
$U(\mathcal{L}) = \left\{(x',y')\in\mathbb{R}^2~|~ax'+by'=c+\nu-1\right\}$
\item thickness:
$T(\mathcal{L})
= \frac{\textstyle W(\mathcal{L})-1}{\textstyle P(\mathcal{L})}$.
\end{itemize}
The thickness corresponds to the lowest value of the vertical and horizontal
distances between lower and upper bounding lines.
When $\nu = P(\mathcal{L})$, then $\mathcal{L}$ is the thinest 8-connected
line and is called a \textit{naive line}.
\begin{figure}[!htbp]
\begin{center}
\begin{picture}(1,5)(0,0)
% \put(0,0){\framebox(1,5)}
\end{picture}
\includegraphics[width=0.45\linewidth]{figures/dsl.pdf}
\begin{picture}(20,5)(0,0)
% \put(0,0){\framebox(10,5)}
\put(-232,2){$O$}
\put(-12,2){$x$}
\put(-232,222){$y$}
\put(-115,-6){$a$}
\end{picture}
\includegraphics[width=0.45\textwidth]{figures/bs.pdf}
\begin{picture}(1,5)(0,0)
% \put(0,0){\framebox(1,5)}
\put(-232,2){$O$}
\put(-12,2){$x$}
\put(-232,222){$y$}
\put(-115,-5){$b$}
\end{picture}
\caption{(a) Digital straight line $\mathcal{L}(7,5,45,18)$.
(b) Blurred segment of assigned thickness
$\varepsilon = \frac{17}{7}$, with convex hull in dashed
lines and optimal line $\mathcal{L}(7,5,45,18)$.}
\label{fig:bs}
\end{center}
\end{figure}
A \textbf{digital straight segment} is a subset of a digital straight line
restricted to $\left\{x~|~x\in [x_{min},x_{max}]\right\}$ if $|a|<|b|$,
to $\left\{y~|~y\in [y_{min},y_{max}]\right\}$ otherwise.
A \textbf{blurred segment} \cite{DebledAl06} $\mathcal{B}$ of assigned
thickness $\varepsilon$ is a set of points in $\mathbb{Z}^2$ that belong
to a digital straight line $\mathcal{L}$ of thickness
$T(\mathcal{L}) \leq \varepsilon$ (see \RefFig{fig:bs}(b)).
$\mathcal{L}$ is a \textit{covering line} of $\mathcal{B}$.
The covering line with minimal thickness is called the
\textit{optimal line} of $\mathcal{B}$.
The thickness $T(\mathcal{B})$ of the blurred segment is the thickness
of its optimal line.
The blurred segment detection is based on a grawing procedure where input
points are sequentially added and tested using a linear-time incremental
recognition algorithm \cite{DebledAl06}. This algorithm relies on the
maintenance of the blurred segment convex hull.
A \textbf{directional scan} $\Delta_S$ is an ordered partition of the grid
domain $\mathcal{G} \subset \mathbb{Z}^2$ restricted to a thick digital
straight line $\mathcal{D}$, called \textit{scan strip},
into naive segments $S_i$, called \textit{scans}, orthogonal to $\mathcal{D}$.
Each scan $S_i$ is a segment of a naive line $\mathcal{N}_i$,
called \textit{scan line}.
The directional scan is defined as:
\begin{equation}
\Delta_S = \left\{ S_i = \mathcal{D} \cap \mathcal{N}_i \cap \mathcal{G}
\left| \begin{array}{l}
\vec{V}(\mathcal{N}_i) \cdot \vec{V}(\mathcal{D}) = 0 \\
H(\mathcal{N}_i) = H(\mathcal{N}_{i-1}) + P(\mathcal{D})
\end{array} \right. \right\}
\end{equation}
In this definition, $\vec{V}(\mathcal{N}_i) \cdot \vec{V}(\mathcal{D}) = 0$
expresses the orthogonality between the scan lines $\mathcal{N}_i$
and the scan strip $\mathcal{D}$.
The shift $p(\mathcal{D})$ between successive scans $\mathcal{N}_{i-1}$
and $\mathcal{N}_i$ guarantees that all points of $\mathcal{D}$ are traversed
only one time.
The directional scan is completely defined by grid domain $\mathcal{G}$
and first scan $S_0$ (see \RefFig{fig:ads}(a)).
In FBSD, $S_0$ can be defined either by its two end points $P_1$ and $P_2$,
or by center point $C$, director vector $\vec{V}$ and length $L$.
The scans $S_i$ can then be iteratively accessed from start scan $S_0$
to last right and left scans.
\begin{figure}[!htbp]
\begin{center}
\begin{picture}(1,5)(0,0)
% \put(0,0){\framebox(1,5)}
\end{picture}
\includegraphics[width=0.45\textwidth]{figures/ds.pdf}
\begin{picture}(20,5)(0,0)
% \put(0,0){\framebox(10,5)}
\put(-236,-2){$O$}
\put(-12,-2){$x$}
\put(-236,234){$y$}
\put(-115,-6){$a$}
\put(-78,115){\vector(-4,-1){20}}
\put(-76,113){\makebox(4,4)[l]{$P_2$}}
\put(-208,46){\vector(4,1){20}}
\put(-214,44){\makebox(4,4)[r]{$P_1$}}
\end{picture}
\includegraphics[width=0.45\textwidth]{figures/ads.pdf}
\begin{picture}(1,5)(0,0)
% \put(0,0){\framebox(1,5)}
\put(-236,-2){$O$}
\put(-12,-2){$x$}
\put(-236,234){$y$}
\put(-115,-5){$b$}
\put(-78,115){\vector(-4,-1){20}}
\put(-76,113){\makebox(4,4)[l]{$P_2$}}
\put(-208,46){\vector(4,1){20}}
\put(-214,44){\makebox(4,4)[r]{$P_1$}}
\put(-95,189){\vector(-1,0){40}}
\put(-93,186){\makebox(4,4)[l]{$\mathcal{C}$}}
\end{picture}
\caption{(a) A directional scan with start scan $S_0$ in black,
odd scans in green, even scans in blue,
bounds of scan lines $\mathcal{N}_i$ in dashed lines and
bounds of scan strip $\mathcal{D}$ in blue lines.
(b) An adaptive directional scan.
The scan strip is dynamically fit to curve $\mathcal{C}$ position,
and the scans are continuously centered on $\mathcal{C}$.}
\label{fig:ads}
\end{center}
\end{figure}
An \textbf{adaptive directional scan} $\Delta_A$
is a dynamical version of the directional scan with continuous registration
of the scan strip to the center line $\mathcal{C}$ of a tracked linear feature.
Compared to static directional scans, here the scan strip adapts from
initial position $\mathcal{D}_0$ to update position $\mathcal{D}_i$,
and at each step, the scan moves within its scan line
(see \RefFig{fig:ads}(b)).
The adaptive directional scan is formally defined by:
Typically, The manuscript of an IPOL article submitted for peer-review should
include an introduction, a detailed explanation of the algorithm (it could
include some theoretical background, pseudo-code and/or block diagram, a
complexity analysis, and an explanation of the parameter values), commented
examples of the results and references to related publications. This content
can be adapted when the article is not about an algorithm (like dataset
articles).
\begin{equation}
\Delta_A = \left\{
S_i = \mathcal{D}_i \cap \mathcal{N}_i \cap \mathcal{G}
\left| \begin{array}{l}
\vec{V}(\mathcal{N}_i) \cdot \vec{V}(\mathcal{D}_0) = 0 \\
H(\mathcal{N}_i) = H(\mathcal{N}_{i-1}) + P(\mathcal{D}_0) \\
\mathcal{D}_{i} = \mathcal{L}(\widehat{C}_i, W(\mathcal{D}_0)), i > 0
\end{array} \right. \right\}
\label{eq:ads}
\end{equation}
where $\widehat{C}_{i}$ is a triplet composed of the director vector
$(a_i,b_i)$ and the shift to origin $c_i$ of an estimate at position $i$
of the curve $\mathcal{C}$ to track.
This last clause expresses the scan bounds update at iteration $i$.
In FBSD, the tracked linear feature is the blurred segment to detect.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment