Skip to main content

Edge Detection & Line Co-ordinates

3 replies [Last post]
jgedge
Offline
Joined: 2010-04-07
Points: 0

Hi everyone,

Over the last couple of weeks I have been looking for a way to extract the co-ordinates of edges within an image after running an edge detection algorithm. From reading through this forum I am aware that in 2006(?) a similar post was posted and the response was that this wasn't possible at the time.

Has this changed? Is anyone aware of an algorithm that will allow this or have an idea of the way in which I could go about writing one?

In honesty I am a bit lost and this algorithm is pretty important to the project I am working on. Any help would be much appreciated.

Thanks in advance.

J

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
pentath
Offline
Joined: 2009-08-04
Points: 0

J,

Well, many edge detectors are just a kernel convolution over the image followed by a threshold to eliminate weak contrast boundaries. You can accomplish both in JAI with the 'Convolve' and 'Threshold' operators. If you need something more specific, you can always write up your own OpImage subclass.

Either way, once you have a PlanarImage where a simple comparison can tell you if an edge is at each position, then you need to write a for loop for all the pixels in that image, and as you find each pixel that contains a line, do something with that x/y position.

- Eric

Rafael Santos

> Hi everyone,
>
> Over the last couple of weeks I have been looking for a way to extract the co-ordinates of edges within an image after running an edge detection algorithm. From reading through this forum I am aware that in 2006(?) a similar post was posted and the response was that this wasn't possible at the time.
>
There are plenty of line detection algorithms out there (Hough transform
for starters).
Maybe there aren't any publicly implemented in Java/JAI. Wish I had more
free time :-)

> Has this changed? Is anyone aware of an algorithm that will allow this or have an idea of the way in which I could go about writing one?
>
Sure, if you want to detect simple straight lines Hough can be good
enough. If you want to identify/characterize more complex shapes there
are books on this, this is a pretty good one:
http://www.amazon.com/Shape-Analysis-Classification-Practice-Processing/...

Rafael

---------------------------------------------------------------------
To unsubscribe, e-mail: interest-unsubscribe@jai.dev.java.net
For additional commands, e-mail: interest-help@jai.dev.java.net

jgedge
Offline
Joined: 2010-04-07
Points: 0

Morning,

Thanks the help. I had a niggling feeling that was the case. I have been looking at the Hough Transformation but I think that given the time left in my honours project It may not be a realistic for me to try and implement it as the lines are far from perfectly straight or regular in any way.

As an aside I have been using your website extensively while learning my way around JAI. It has been a massive help. Its great to have so many examples and explanations in one place.

Thanks for the advice.

J.