diff --git a/Article/Fig_method/algoMulti.tex b/Article/Fig_method/algoMulti.tex new file mode 100644 index 0000000000000000000000000000000000000000..a0054750e01b797bc7da4b01db9259387ad42412 --- /dev/null +++ b/Article/Fig_method/algoMulti.tex @@ -0,0 +1,43 @@ +\begin{algorithm}[h] + \SetAlgoLined + \SetKwInOut{Input}{input} + \SetKwInOut{Output}{output} + + \SetKwData{lm}{LocMax} + \SetKwData{nullset}{$\emptyset$} + \SetKwData{ortho}{$\vec{AB}_\perp$} + \SetKwData{eps}{$\varepsilon_{ini}$} + \SetKwData{pta}{$A$} + \SetKwData{ptb}{$B$} + \SetKwData{Result}{Result} + + \SetKwArray{occmask}{OccupancyMask} + \SetKwArray{bseg}{BlurredSegment} + \SetKwArray{bslist}{ListOfBlurredSegments} + + \SetKwFunction{locmax}{ComputeAndSortGradientLocalMax} + \SetKwFunction{sortgradmax}{SortByGradientMagnitude} + \SetKwFunction{taille}{Size} + \SetKwFunction{cardinal}{Card} + + \SetKwData{Begin}{Start} + \SetKwData{End}{End} + + \Input{Stroke points \pta, \ptb} + \Output{\textit{\bslist} $\rightarrow$ list of detected blurred segments} + \BlankLine + \bslist $\leftarrow$ \nullset\; + \occmask $\leftarrow$ \nullset\; + \lm $\leftarrow$ \locmax (\pta, \ptb)\; + \BlankLine + \For{$i \leftarrow 0$ \KwTo \taille(\lm)}{ + \bseg $\leftarrow$ detect (\lm[i], \ortho, \eps, \occmask)\; + \For{$j \leftarrow 0$ \KwTo \cardinal (\bseg)}{ + \occmask $\leftarrow$ \bseg[j]\; + } + \bslist $\leftarrow$ \bseg\; + } + + \caption{MultiDetection: + finds all blurred segments under an input stroke.} +\end{algorithm} diff --git a/Article/Fig_method/edgeDir.readme b/Article/Fig_method/edgeDir.readme new file mode 100644 index 0000000000000000000000000000000000000000..b7923f481987ed07c4cc7397772a8e4f962205c1 --- /dev/null +++ b/Article/Fig_method/edgeDir.readme @@ -0,0 +1,5 @@ +Images obtenues pas le test testEdgeDir.txt +suivi de la commande de detection multiple : Ctrl-M +avec deux modalites pilotees par Ctrl-E + +Sur gimp selection de la zone (34,166)(444,314). diff --git a/Article/Fig_method/multiEdge_capt.png b/Article/Fig_method/multiEdge_capt.png new file mode 100644 index 0000000000000000000000000000000000000000..b4e3f6ca0ac98557b607e9f47db25c09860b86a3 Binary files /dev/null and b/Article/Fig_method/multiEdge_capt.png differ diff --git a/Article/Fig_method/multiEdge_zoom.png b/Article/Fig_method/multiEdge_zoom.png new file mode 100644 index 0000000000000000000000000000000000000000..ad0c1abee3914b3d161a321225ed19f6ae6ba03e Binary files /dev/null and b/Article/Fig_method/multiEdge_zoom.png differ diff --git a/Article/Fig_method/multiStroke_capt.png b/Article/Fig_method/multiStroke_capt.png new file mode 100644 index 0000000000000000000000000000000000000000..083195576f14d01fbf0d2be9999a9a6301232b07 Binary files /dev/null and b/Article/Fig_method/multiStroke_capt.png differ diff --git a/Article/Fig_method/multiStroke_zoom.png b/Article/Fig_method/multiStroke_zoom.png new file mode 100644 index 0000000000000000000000000000000000000000..9c9f9261b1eb863a41eb6e291a399f984978c798 Binary files /dev/null and b/Article/Fig_method/multiStroke_zoom.png differ diff --git a/Article/Fig_method/testEdgeDir.txt b/Article/Fig_method/testEdgeDir.txt new file mode 100644 index 0000000000000000000000000000000000000000..7e3274e1defbf89e33c37c296bc3ab66c0a90d1a --- /dev/null +++ b/Article/Fig_method/testEdgeDir.txt @@ -0,0 +1,2 @@ +287 142 +326 103 diff --git a/Article/Fig_method/testVoisin.txt b/Article/Fig_method/testVoisin.txt new file mode 100644 index 0000000000000000000000000000000000000000..82d7ef2672a8f76f99255fe4dbca84beb65faf9b --- /dev/null +++ b/Article/Fig_method/testVoisin.txt @@ -0,0 +1,2 @@ +329 210 +323 245 diff --git a/Article/Fig_method/voisin.readme b/Article/Fig_method/voisin.readme new file mode 100644 index 0000000000000000000000000000000000000000..14eaff83963e65cefcc3f6a94e1915e161202d1f --- /dev/null +++ b/Article/Fig_method/voisin.readme @@ -0,0 +1,4 @@ +Images obtenues pas le test testvoisin.txt +suivi de la commande de detection de bords : Ctrl-E + +Sur gimp selection de la zone (282,90)(411,156). diff --git a/Article/Fig_method/voisinGrad_capt.png b/Article/Fig_method/voisinGrad_capt.png new file mode 100644 index 0000000000000000000000000000000000000000..602c946c76c80cffe1b584a8b5b1a1e749b39501 Binary files /dev/null and b/Article/Fig_method/voisinGrad_capt.png differ diff --git a/Article/Fig_method/voisinGrad_zoom.png b/Article/Fig_method/voisinGrad_zoom.png new file mode 100644 index 0000000000000000000000000000000000000000..c0523578542e2a6546d0316024368cf8f0552e25 Binary files /dev/null and b/Article/Fig_method/voisinGrad_zoom.png differ diff --git a/Article/Fig_method/voisinImage_capt.png b/Article/Fig_method/voisinImage_capt.png new file mode 100644 index 0000000000000000000000000000000000000000..b57890145fdcf06cf2a17969e305a754fef12820 Binary files /dev/null and b/Article/Fig_method/voisinImage_capt.png differ diff --git a/Article/Fig_method/voisinImage_zoom.png b/Article/Fig_method/voisinImage_zoom.png new file mode 100644 index 0000000000000000000000000000000000000000..7d198c97aa5c60d04863c8bbc1c9387ecc134e14 Binary files /dev/null and b/Article/Fig_method/voisinImage_zoom.png differ diff --git a/Article/Fig_method/voisinMulti_capt.png b/Article/Fig_method/voisinMulti_capt.png new file mode 100644 index 0000000000000000000000000000000000000000..9768fffe054c92f2a1992c743d01d5c5eb0303c6 Binary files /dev/null and b/Article/Fig_method/voisinMulti_capt.png differ diff --git a/Article/Fig_method/voisinMulti_zoom.png b/Article/Fig_method/voisinMulti_zoom.png new file mode 100644 index 0000000000000000000000000000000000000000..1f65858d139a536490e80c4bd356eec531d429ea Binary files /dev/null and b/Article/Fig_method/voisinMulti_zoom.png differ diff --git a/Article/Fig_method/voisinSingle_capt.png b/Article/Fig_method/voisinSingle_capt.png new file mode 100644 index 0000000000000000000000000000000000000000..53eb072fa2582a64f03f2e4d0a45912226577544 Binary files /dev/null and b/Article/Fig_method/voisinSingle_capt.png differ diff --git a/Article/Fig_method/voisinSingle_zoom.png b/Article/Fig_method/voisinSingle_zoom.png new file mode 100644 index 0000000000000000000000000000000000000000..4b729e9888faf38d65d24c579f7bd0b64c3e6af0 Binary files /dev/null and b/Article/Fig_method/voisinSingle_zoom.png differ diff --git a/Article/method.tex b/Article/method.tex index c2ce3b9ad21a9fa5594c619810641c8a667234f6..63adc79987dea8f28c6cc62bb1fd97d46bada938 100755 --- a/Article/method.tex +++ b/Article/method.tex @@ -2,7 +2,7 @@ \subsection{Workflow of the detection process} -The blurred segment detector workflow is summerized +The work-flow of the blurred segment detection process is summerized in the following figure. \begin{figure}[h] @@ -12,8 +12,8 @@ in the following figure. \put(-2,18){\scriptsize $(A,B)$} \put(-2,15){\vector(1,0){24}} \put(24,0){\framebox(56,30)} - \put(24,15){\makebox(56,10){Initial}} - \put(24,3){\makebox(56,10){detection}} + \put(24,16){\makebox(56,10){Initial}} + \put(24,4){\makebox(56,10){detection}} \put(86,18){\scriptsize $\mathcal{B}_{1}$} \put(80,15){\vector(1,0){22}} %\put(102,0){\framebox(56,30)} @@ -25,15 +25,15 @@ in the following figure. \put(159,18){\scriptsize $(C,\vec{D})$} \put(158,15){\vector(1,0){28}} \put(186,0){\framebox(56,30)} - \put(186,15){\makebox(56,10){Fine}} - \put(186,3){\makebox(60,10){tracking}} + \put(186,16){\makebox(56,10){Fine}} + \put(186,4){\makebox(60,10){tracking}} \put(250,18){\scriptsize $\mathcal{B}_2$} \put(242,15){\vector(1,0){24}} \put(266,0){\framebox(56,30){Filtering}} \put(330,18){\scriptsize $\mathcal{B}_3$} \put(322,15){\vector(1,0){22}} \end{picture} - \caption{The detection method work flow.} + \caption{The detection process main work-flow.} \label{fig:workflow} \end{figure} @@ -63,21 +63,108 @@ Setting $N=20$ shows a good behaviour on tested images. The fine track output segment is finally filtered to remove artifacts and outliers, and a solution blurred segment $\mathcal{B}_3$ is provided. -\subsection{The thinning process} +\subsection{Supervised blurred segment detection} + +In supervised context, the user draws an input stroke across the specific +edge he wants to extract from the image. +The detection method previously described is continuously run during mouse +dragging and the output blurred segment is displayed on-the-fly. + +The method is very sensitive to the local conditions of the initial detection +so that the output blurred segment may be quite unstable. +In order to temper this undesirable behaviour for particular applications, +the initial detection can be optionally run twice, the second fast scan being +aligned on the first detection output. +This strategy provides a first quick analysis of the local context before +extracting the segment and contributes to notably stabilize the overall +process. + +Another option, called multi-detection allows the detection of all the +segments crossed by the input stroke $AB$. +The multi-detection algorithm is displayed below. +First the positions $M_j$ of the local maxima of the gradient 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: +i) the initial detection takes $M_j$ and the orthogonal direction $AB_\perp$ +to the stroke as input to build a static scan of fixed width +$\varepsilon_{ini}$, and $M_j$ is used as start point of the blurred segment; +ii) a occupancy mask, initially empty, is filled in with the points of the +detected blurred segments $\mathcal{B}_{j3}$ at the end of each successful +detection; +iii) points marked as occupied are rejected when selecting candidates for the +blurred selegment extension in the fine tracking step. + +\input{Fig_method/algoMulti} +%\input{algo1} + +Beyond the possible detection of a large set of edges at once, the +multi-detection allows the detection of some unaccessible edges in +classical single detection mode. This is particularly the case of edges +that are quite close to a more salient edge with a higher gradient. +The multi-detection detects both edges and the user may then select +the awaited one. -\subsection{Multi-detection} +\begin{figure}[h] +\center + \begin{tabular}{c@{\hspace{0.2cm}}c@{\hspace{0.2cm}}c@{\hspace{0.2cm}}c} + \includegraphics[width=0.22\textwidth]{Fig_method/voisinImage_zoom.png} & + \includegraphics[width=0.22\textwidth]{Fig_method/voisinGrad_zoom.png} & + \includegraphics[width=0.22\textwidth]{Fig_method/voisinSingle_zoom.png} & + \includegraphics[width=0.22\textwidth]{Fig_method/voisinMulti_zoom.png} \\ + \parbox{0.22\textwidth}{\centering{\scriptsize{a)}}} & + \parbox{0.22\textwidth}{\centering{\scriptsize{b)}}} & + \parbox{0.22\textwidth}{\centering{\scriptsize{c)}}} & + \parbox{0.22\textwidth}{\centering{\scriptsize{d)}}} + \end{tabular} + \caption{Example of edge, detected only in multi-detection mode: + a) the stroke on the intensity image, + b) the gradient map, + c) the result of the classical single mode detection, + d) the result of the multi-detection. } + \label{fig:voisins} +\end{figure} + +This detection procedure can be used to dectect as well straight edges +as thin straight objects. In the first case, the gradient vectors of all +edge points are assumed to be oriented in the same direction. But if the +sign of the gradient direction is not considered, points with gradient in +opposite directions are merged to build the same blurred segment, allowing +the detection of both edges of a thin linear structure, like for instance +the tile joins of \RefFigure{fig:edgeDir}. + +\begin{figure}[h] +\center + \begin{tabular}{c@{\hspace{0.2cm}}c} + \includegraphics[width=0.46\textwidth]{Fig_method/multiStroke_zoom.png} & + \includegraphics[width=0.46\textwidth]{Fig_method/multiEdge_zoom.png} \\ + \parbox{0.46\textwidth}{\centering{\scriptsize{a) + Detection of straight lines}}} & + \parbox{0.46\textwidth}{\centering{\scriptsize{b) + Detection of straight edges}}} + \end{tabular} + \caption{Testing the gradient direction to detect as well edges as + linear structures from the same input stroke.} + \label{fig:edgeDir} +\end{figure} + +On that example, when a straight features detection is run +(\RefFigure{fig:edgeDir} a)), +a thick blurred segment which extends up to four tiles is provided. +When a straight edge detection is run, a very thin blurred segment is +built to follow only one join edge. +The multi-detection can also be applied to both thin object or edge detection. +In the latter case, the detection algorithm is run twice using opposite +directions, so that in the exemple of figure (\RefFigure{fig:edgeDir} b)), +both edges (in different colours) are highlighted. +These two thin blurred segments are much shorter, probably because the +tiles are not perfectly aligned. +This example illustrates our detector versatility. -Algo de multi-detection. +\subsection{Automatic blurred segment detection} -\subsection{Automatic detection} +Explication et b\'etail de l'algo \subsection{Implementation details} A directional scanner is encoded as an iterator that provides successively all the scan lines. - -Description de l'interface pour la d\'etection supervis\'ee d'un segment. - -Description de la d\'etection multiple. - -Description de la d\'etection automatique. diff --git a/Article/notions.tex b/Article/notions.tex index ee859f5aad1189b8f26bcb31807f5a615ea1b065..2d3368cc5fa625b6283b96df1c27194ba1fe2448 100755 --- a/Article/notions.tex +++ b/Article/notions.tex @@ -1,4 +1,4 @@ -\section{Base notions} +\section{Theoretical background} \subsection{Blurred segment}