Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
2
2019 FBSD
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Kerautret Bertrand
2019 FBSD
Commits
d8422a04
Commit
d8422a04
authored
6 years ago
by
even
Browse files
Options
Downloads
Patches
Plain Diff
Article: supervised mode revisited
parent
d1b32265
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
Article/method.tex
+95
-65
95 additions, 65 deletions
Article/method.tex
Code/Seg/BlurredSegment/bsdetector.cpp
+2
-2
2 additions, 2 deletions
Code/Seg/BlurredSegment/bsdetector.cpp
Code/Seg/BlurredSegment/bstracker.cpp
+1
-1
1 addition, 1 deletion
Code/Seg/BlurredSegment/bstracker.cpp
with
98 additions
and
68 deletions
Article/method.tex
+
95
−
65
View file @
d8422a04
...
...
@@ -211,16 +211,57 @@ dragging and the output blurred segment is displayed on-the-fly.
The method is quite 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 behavior for
particular
applications,
In order to temper this undesirable behavior for
interactive
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.
When selecting candidates for the fine detection stage, an option is left
to also reject points with a gradient vector in an opposite direction to
the gradient vector of the blurred segment start point.
In that case, called
{
\it
edge selection mode
}
, all the blurred segment
points have the same direction.
If they are not rejected, points with opposite gradients are aggregated
into a same blurred segment, allowing the detection of the two opposite
edges of a thin straight object. This is called
{
\it
line selection mode
}
.
This distinction is illustrated on
\RefFig
{
fig:edgeDir
}
.
\begin{figure}
[h]
\center
\begin{tabular}
{
c@
{
\hspace
{
0.2cm
}}
c
}
\includegraphics
[width=0.48\textwidth]
{
Fig
_
method/multiStroke
_
zoom.png
}
&
\includegraphics
[width=0.48\textwidth]
{
Fig
_
method/multiEdge
_
zoom.png
}
\end{tabular}
\begin{picture}
(1,1)(0,0)
{
\color
{
dwhite
}{
\put
(-260,-17.5)
{
\circle*
{
8
}}
\put
(-86,-17.5)
{
\circle*
{
8
}}
}}
\put
(-262.5,-20)
{
a
}
\put
(-89,-20)
{
b
}
\end{picture}
\caption
{
Blurred segment obtained in line selection mode (a) and in
edge selection mode (b) as a result of the test of the gradient
direction of added points.
In line selection mode, a thick blurred segment is built and
extended up to four tiles.
In edge selection mode, a thin blurred segment is built along
one of the two tile join edges.
Both join edges, drawn with distinct colors, are detected with
the multi-selection option.
They are much shorter than the whole join detected in line
selection mode, because the tiles are not perfectly aligned.
}
\label
{
fig:edgeDir
}
\end{figure}
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.
\input
{
Fig
_
method/algoMulti
}
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:
...
...
@@ -233,71 +274,60 @@ detection;
iii) points marked as occupied are rejected when selecting candidates for the
blurred segment extension in the fine tracking step.
\input
{
Fig
_
method/algoMulti
}
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,
as illustrated in
\RefFig
{
fig:voisins
}
.
The multi-detection detects both edges and the user may then select
the awaited one.
\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
{
Detection of close edges with different sharpness:
a) input selection across the edges,
b) gradient map,
c) in single mode, detection of only the edge with the higher gradient,
d) in multi-detection mode, detection of both edges.
}
\label
{
fig:voisins
}
\end{figure}
This detection procedure can be used to detect 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
\RefFig
{
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}
In edge selection mode (
\RefFig
{
fig:edgeDir
}
b), the multi-detection
algorithm is executed twice.
In the second run, the start point is rejected and only candidate points
with opposite gradient direction are considered to extend the blurred
segment.
%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,
%as illustrated in \RefFig{fig:voisins}.
%The multi-detection detects both edges and the user may then select
%the awaited one.
%
%\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{Detection of close edges with different sharpness:
% a) input selection across the edges,
% b) gradient map,
% c) in single mode, detection of only the edge with the higher gradient,
% d) in multi-detection mode, detection of both edges. }
% \label{fig:voisins}
%\end{figure}
On that example, when a straight feature detection is run
(
\RefFig
{
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 (
\RefFig
{
fig:edgeDir
}
b),
both edges (in different colors) are highlighted.
These two thin blurred segments are much shorter, probably because the
tiles are not perfectly aligned.
This example illustrates the versatility of the new detector.
%This detection procedure can be used to detect 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 \RefFig{fig:edgeDir}.
%On that example, when a straight feature detection is run
%(\RefFig{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 (\RefFig{fig:edgeDir} b),
%both edges (in different colors) are highlighted.
%These two thin blurred segments are much shorter, probably because the
%tiles are not perfectly aligned.
%This example illustrates the versatility of the new detector.
\subsection
{
Automatic blurred segment detection
}
...
...
This diff is collapsed.
Click to expand it.
Code/Seg/BlurredSegment/bsdetector.cpp
+
2
−
2
View file @
d8422a04
...
...
@@ -42,14 +42,14 @@ BSDetector::BSDetector ()
if
(
bstold
->
isThickenningOn
())
bstold
->
toggleThickenning
();
oldp
=
false
;
prefilteringOn
=
tru
e
;
prefilteringOn
=
fals
e
;
lsf1
=
(
prefilteringOn
?
new
LineSpaceFilter
()
:
NULL
);
filteringOn
=
false
;
lsf2
=
(
filteringOn
?
new
LineSpaceFilter
()
:
NULL
);
edgeDirection
=
0
;
// detects strokes (not only edges)
bsMinSize
=
DEFAULT_BS_MIN_SIZE
;
ccOn
=
tru
e
;
ccOn
=
fals
e
;
ccMinSize
=
DEFAULT_CONNECT_MIN_SIZE
;
recenteringOn
=
true
;
fittingOn
=
false
;
...
...
This diff is collapsed.
Click to expand it.
Code/Seg/BlurredSegment/bstracker.cpp
+
1
−
1
View file @
d8422a04
...
...
@@ -4,7 +4,7 @@
const
int
BSTracker
::
DEFAULT_FAST_TRACK_MAX_WIDTH
=
5
;
const
int
BSTracker
::
DEFAULT_FINE_TRACK_MAX_WIDTH
=
8
;
const
int
BSTracker
::
DEFAULT_FINE_TRACK_MAX_WIDTH
=
3
;
const
int
BSTracker
::
DEFAULT_ACCEPTED_LACKS
=
5
;
const
int
BSTracker
::
NO_VICINITY
=
10000
;
const
int
BSTracker
::
DEFAULT_VICINITY_THRESHOLD
=
10
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment