comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Contours driving me mad
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Contours driving me mad [message #22651] Wed, 29 November 2000 00:00
Alex Schuster is currently offline  Alex Schuster
Messages: 124
Registered: February 1997
Senior Member
Hi!

I am having trouble extracting contours from binary images. The images
contain the result of a search2d operation, the contour is extracted,
and the pixels inside the contour should be exactly those of the image.
That is: max( where( image ) - polyfillv( contx, conty, dim, dim ) ) eq
0 (assuming there are no holes inside).

My first approach was using an old routine I had written. I use the
roberts filter to get a contour image, march in one direction until I
find this contour line, and then follow it, creating the contour. This
works well for most cases, but sometimes my algorithm fails to get a
correct closed contour.
I also do not

I now switched to IDL's contour routine. It works better than mine in
finding closed contours, but has other problems. The results of where(
image ) and polyfillv differ, the image which I get from the contour is
one pixel smaller to the left and to the right than the original image,
but okay in the y direction.

Maybe a combination of erode and dilate would eliminate those pixels, I
will try this next. But maybe someone already did such a thing before?
The goal is that the user clicks at one location in an binary image, and
gets the contour of the area. Holes inside this area should also be
detected and contoured, that is what gives me trouble now, as the
difference image does not only contain the holes, as also many pixels at
the sides of the object.

Alex
--
Alex Schuster Wonko@weird.cologne.de PGP Key available
alex@pet.mpin-koeln.mpg.de
[Message index]
 
Read Message
Previous Topic: Re: Locating a (bitmap) file
Next Topic: Re: It costs how much?!!?!

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Oct 10 12:42:07 PDT 2025

Total time taken to generate the page: 0.88736 seconds