[Numpy-discussion] binary thinning

Bob Klimek klimek at grc.nasa.gov
Wed Dec 8 15:23:06 EST 2004

Peter Verveer wrote:

> Hi Bob,
> I noticed two problems:
> 1) you construct rotations of your structures with the nd_image.rotate 
> function. That will not work properly because this function uses 
> spline interpolation, which not necessarily produces exact results. In 
> this case you need to use another, exact rotation method, see my 
> implementation below.
> 2) I think (correct me if I am wrong) that the application of the 8 
> structures is sequential, not parallel as you do it.
> Below I give my implementation, which does not produce the exact same 
> result as shown on the webpage you refer to, although the result seems 
> to be a proper skeleton. This may be because the order in which the 
> structures are applied matters (I think). Could you maybe test that by 
> permutating the order in which the structures are applied? I would be 
> interested if this is true and if one can get the same result as on 
> the webpage by finding the right sequence...


Thanks much for getting back to me on this. Your sample code was very 
helpful!  :-)  I rewrote my function based on yours and I'm getting the 
same answer. So far I haven't been able to figure out why is it 
different from the web site and so far I haven't tried changing the 
order of the structuring elements. I'll try tomorrow. I'll let you know 
if I come up with anything new.


More information about the NumPy-Discussion mailing list