Skip to main content

[JAI] Source code for Hough line detection under JAI

4 replies [Last post]

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 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.



To unsubscribe, e-mail:
For additional commands, e-mail:

Reply viewing options

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

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

Joined: 2006-02-14


Sorry for be slow, but where is the code?


Jason Grant

The code was attached to the post.

On Fri, 2005-07-22 at 16:15 -0400, wrote:

> HI!
> Sorry for be slow, but where is the code?
> lemi
> ---
> [Message sent by forum member 'lemi' (lemi)]

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.