Skip to main content

[JAI] Source code for Hough line detection under JAI

4 replies [Last post]
Anonymous

Here's some source for a Hough transform under JAI.

I started with the implementation for byte images, and then created the
one to handle float images. The latter does linear interpolation to
address the [probably harmless] binning artefacts that occur at critical
angles like 0,45 degrees - I've seen this in other Hough implementations
(e.g. HIPR2
http://homepages.inf.ed.ac.uk/rbf/HIPR2/images/sff1hou1.gif). The
parameterised lines are returned in an image property, just like the JAI
stats operations - say, Histogram. There's some code included that
highlights the peaks for testing purposes, and I've only written this
thing to deal with single-banded edge data, but enhancement for wider
application should be trivial. Alas, it's an UntiledOpImage, because
the algorithm as implemented walks the entire input image and for each
pixel, writes a sinusoid into the output image. It also uses [requires]
the second input band to contain edge gradient direction - this
restricts the writing of output sinusoids to a limited range around the
edge angle. This is done to speed up performance, and to avoid writing
junk votes into the output, which otherwise just serves to add a noisy
baseline under the Hough peaks.

I fooled around with a convolution kernel that helps peak identification
in the Byte loop, however this is not required in the interpolated Float
loop. Use of a kernel like this isn't part of a standard Hough
implementation, so it probably should be stripped. Same for the use of
an edge direction band - my implementation suits my own needs, but it's
a little too restrictive to make such a band mandatory.

Seems to work nicely.

I've read the JAI Joint Copyright Assignment & Patent form, and agree to
its terms.

Enjoy,

Jason.

[att1.html]
[hough-src.tar.gz]
---------------------------------------------------------------------
To unsubscribe, e-mail: interest-unsubscribe@jai.dev.java.net
For additional commands, e-mail: interest-help@jai.dev.java.net

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Mylanok
Offline
Joined: 2011-05-13

Hi!
How can i get the source? It don't seems to have any attached files :(
Ty!

lemi
Offline
Joined: 2006-02-14

HI!

Sorry for be slow, but where is the code?

lemi

Jason Grant

The code was attached to the post.

https://jai.dev.java.net/servlets/ReadMsg?
list=interest&msgNo=637&raw=true

On Fri, 2005-07-22 at 16:15 -0400, jai-interest@javadesktop.org wrote:

> HI!
>
> Sorry for be slow, but where is the code?
>
> lemi
> ---
> [Message sent by forum member 'lemi' (lemi)]
>
> http://www.javadesktop.org/forums/thread.jspa?messageID=100931𘩃
[att1.html]

lemi
Offline
Joined: 2006-02-14

Thanks for taking your time.
I read your post in the forum, there is no attachment.
But i already downloaded it from the newsgroup.
Will try it soon.

lemi