Re: How to split a one-pixel-width graph into line segments?



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.

.



Relevant Pages

  • Re: How to split a one-pixel-width graph into line segments?
    ... problem is to split this graph into line segments under 8- ... neighbour => extremity of a segment ... >2 neighbours => junction of several segment ... In your example image of thinning result, it seems that by coloring in blue pixels with 1 or 2 neighbours and in red those with more neighbours, you can obtain the splitting result image. ...
    (sci.image.processing)
  • Re: Using a directed graph as an undirected one in a shortest path algorithm
    ... Your problem statement makes perfect sense to me. ... of "n"th nearest neighbours of each vertex in the graph. ... The OCaml code is less than half the ...
    (comp.programming)
  • Re: ICaptureGraphBuilder2::FindInterface() with IAMStreamConfig vs. ICreateDevEnum::CreateClassEnume
    ... >I've written two code segments for building a capture graph. ... >creates the video capture filter then relies on a call to ... >automatically complete the upstream segment of the graph. ... This adds a lot more code for each filter ...
    (microsoft.public.win32.programmer.directx.video)
  • Re: Tough little graph theory question
    ... Let G be a graph. ... Any two vertices joined by an edge have no common ... neighbours and any two vertices not joined by an edge have exactly one ... Finish the proof of regularity by showing that the complement of G ...
    (sci.math)
  • Re: Graph problem, is it NP-Complete?
    ... The graph has always a "line-like" structure, ... where each subsequence can only contain a particular unique value. ... If an interior value is greater than the sum of its neighbours, ...
    (comp.theory)