http://imagej.273.s1.nabble.com/Finding-the-location-of-lines-in-an-image-tp3699345p3699346.html
I didn't try yet to compile it.
I hope it might help you.
> I have a lot of pictures similar to this one
>
http://www.life.uiuc.edu/ainsworth/example/2007-05-10__7002.jpg>
> I have macros and plugins to detect the leaf and measure area if you
> draw a selection box around it, but I would like to have a solution
> that can take an image and find the leaf without user input. Last
> year I collected thousands and they were done with the macros and
> everyone who helped me is sick of it.
>
> I have a plugin that calculates a greeness index and I can threshold
> that to segment out most of the unwanted stuff. From there I've tried
> things to get rid of noise and then used find maxima to find my leaf.
> However, all the noise on the sides of the images causes problems,
> especially since it's mostly green stuff.
>
> I'd like to find the edges of the white square and crop the image
> (they sometimes vary a lot from image to image - another problem).
> Edge detection finds the edges well, but I don't know how to get any
> information about the lines. A linear Hough transformation seems like
> it would work, especially since I could just look for lines at 90
> degrees, but I can't find a plugin that implements it. However, I see
> posts about one for ImageJ.
>
> Anyone know where I can get a plugin for the Hough transform or do you
> know a better solution to crop the unwanted part? Also, do you know
> of some good ways to segment out the leaf of interest?
>
> Thanks for the help.
> Justin
>