Decimation / skeletonization algorithm with 4 known neighbors

I'm looking for a decimation / skeletonizing algorithm that works if I only know 4 neighbors, not 8. From all the algorithms I could find, I assume I have knowledge of diagonal neighbors.

Does anyone know of a decimation algorithm that also works if I only know the top, right, bottom, left neighbor?

The result should be as follows: http://www.cs.ru.nl/~ths/rt2/col/h9/thinning.GIF

This is not what I'm looking for: http://upload.wikimedia.org/wikipedia/commons/thumb/9/93/Skel.png/220px-Skel.png Form should be supported like in the first example

+3


source to share


1 answer


I would suggest using one of the 8-neighbor algorithms, but fed it with dummy information for diagonal cells, or otherwise modified part of the algorithm that considers neighbors.

Since you are not too specific about the things you are looking for, it is difficult to offer specific suggestions. Most algorithms will contain a part that looks like this:

for n in neighbours:
  do stuff

      



in this case you need to edit neighbours

.

Others will use some kind of mask or kernel function. Edit this core.

0


source







All Articles