Login  Register

Re: edge detection

Posted by Michael Schmid on Mar 05, 2007; 11:22am
URL: http://imagej.273.s1.nabble.com/edge-detection-tp3700010p3700019.html

Hi Ru,

if you have a skeletonized image and you want to remove all
lines that have an end somewhere inside the image (instead of
ending at junction of lines or at the edge), you can have a
look at the method
   void cleanupExtraLines(ImageProcessor ip)
in
   class MaximumFinder
of the current version of ImageJ.

cleanupExtraLines expects that your lines have pixel values
between 1 and 254, 255 is the background, and pixel value
0 is left untouched.

Unfortunately, that method is not public and cannot be made
public without a few small modifications: One has to call
makeDirectionOffsets(ip) before.
So it would be best to paste the code into your plugin.
You will also need to copy the methods isLineOrDot and
isWithin from MaximumFinder since these will be called by
cleanupExtraLines, and the class variables IS_LINE, IS_DOT,
dirOffset, dirXoffset, dirYoffset used by these methods.

To access the code of MaximumFinder, you have to load a
fairly recent version of the ImageJ sources from
http://rsb.info.nih.gov/ij/download/src/
The code is not online in the "Developer resources" section
of the ImageJ Web page, which contains the old version 1.37.

Michael
________________________________________________________________
Michael Schmid                    email: [hidden email]
Institut fuer Allgemeine Physik, Technische Universitaet Wien
Wiedner Hauptstr. 8-10/134, A 1040 Wien, Austria
Tel. +43 1 58801-13452 or -13453, Fax +43 1 58801 13499
________________________________________________________________

On 3 Mar 2007, at 01:09, Ru Wang wrote:

> Hi,
>
> I meet a problem when I try to detect the grain boundary using  
> ImageJ 1.37.
> There are some unconected lines in the image. I just want to remove  
> them.
> But I didn't fund the related operations. If you have any clue on  
> it, could you
> please inform me? Thanks a lot.
>
> Ru