[SciPy-user] circumference in raster image
Wed Jul 8 10:47:32 CDT 2009
>>> Attached is find_contours, an extension module that finds all
>>> in a 2D array at a specified iso-value. The contour position is
>>> interpolated between pixels. Let me know if you have any
>>> questions, etc.
>>> (Looking over the code, I'm surprised how well I documented and
>>> commented it... lucky break for anyone who wants to use or modify
>>> it, I
>>> guess.) It's GPL because it comes from a larger GPL'd project of
>>> but just ask me and I'll send it under a different license.
>> Thank you very much, I will try your code. This is the way I
>> thought I
>> might try (interpolating by a smooth function/polynomial), so it's
>> I do not have to dive into it :-)
> ok, I have tried find_contours() - it seems very suitable for my
Note of course that if the image starts out as binary, the exact same
problems that Gary described will apply: the contour segments will all
point in one of eight directions...
If the image originates as non-binary on the other hand, and instead
of thresholding at value X, you find the iso-contours at value X, you
might be able to get better values.
Probably worth doing some ground-truth testing with mockup images. I'd
be interested in the results.
More information about the SciPy-user