Re: How to split a one-pixel-width graph into line segments?
- From: cherub <sg71.cherub@xxxxxxxxx>
- Date: Thu, 28 Jun 2007 11:07:14 -0000
On Jun 28, 10:24 am, BVertut <Benoit.Ver...@xxxxxxxxxxxxxxx> wrote:
cherub a écrit :
By a thinning algorithm, a one-pixel-width graph is obtained. My
problem is to split this graph into line segments under 8-
neighbourhood condition.
I found it is very tricky to accomplish the splitting task should
there exist bifurcations and loops. Can any one please give me a hint
which method/algorithm I should refer to?
Many thanks!
I think of a very easy method : just count the neighbours of each pixel
of the graph. If there is :
1 neighbour => extremity of a segment (graph vertex)
2 neighbours => inside a segment
>2 neighbours => junction of several segment (graph vertex)
In your example image of thinning result, it seems that by coloring in
blue pixels with 1 or 2 neighbours (8-connexity) and in red those with
more neighbours, you can obtain the splitting result image.
BVertut,
Thanks for the hints. However, the situation might be more tricky than
you thought.
For an instance, as shown in http://medicalimagingscience.googlegroups.com/web/L-shape.jpg
we have to admit that this L-shape is one line segment. But your rules
would fail for two red pixels, both of which have three neighbours
under 8-neighbour relationship.
Another example is shown in http://medicalimagingscience.googlegroups.com/web/cross-shape.jpg
Obviously, the outcome should be four line segments having a common
end point at the green pixel. However, your rules would identify all
the red pixels as graph vertex, which would lead 8 line segments...
And I would like to address that, there are loops in the original
graph. So when I previously tried a tracking method, it turned out to
be a very long list of rules to check a pixel to be a connect point or
not. And eventually, I still have failed in some unexpected scenarios.
That is why I am asking for some general methods/theories behind this
problem.
Afterall, I really appreciate your thinking and responding.
.
- Follow-Ups:
- References:
- Prev by Date: Algorithm for Detecting Magnification changes
- Next by Date: Re: How to split a one-pixel-width graph into line segments?
- Previous by thread: Re: How to split a one-pixel-width graph into line segments?
- Next by thread: Re: How to split a one-pixel-width graph into line segments?
- Index(es):
Relevant Pages
|