DSPRelated.com
Forums

seeking for a boolean-valued function to judge if a image block has diagonal edge or not...

Started by Joenyim Kim January 26, 2004
Dear all,

This should be an diagonal edge detection problem. I know one can use those
canning edge detector stuff to do some minus-plus operations and determine
the actual edge.

But I just want to have a boolean-valued function to answer yes-no whether a
diagonal edge presents in 8x8 image block or not. Is there a simpler(faster)
way of answering yes-no?

Thanks a lot,

-Jeonyim


If you know for certain that your line is 1 pixel in width, and is at
an angel of 45 degress, just use the masks details at
http://www.sgi.com/software/opengl/advanced97/notes/node153.html.
Or:
http://www.dai.ed.ac.uk/HIPR2/linedet.htm

If you don't know the exact angle or width, read on.

The basic way to detect an edge is using the gradient operator. In
image processing this is usually accomplished by the 'sobel' or
'prewitt' operators, which are simply 3x3 masks applied to every pixel
in the original image.

For each of these operators two masks are defined, one to calculate
the gradient in the horizontal direction (Gx), and one to calculate
the gradient in the vertical direction (Gy). From this you can find
out the magnitude and angle of the gradient:

Mag = Sqrt( Gx^2 + Gy^2)
Angle = tan^-1 ( Gy/Gx )

If you know the exact angle and position of the edge, this is not a
problem (You just scan the pixels along a known path, and decide if
the gradient is consistent with an edge). Otherwise, you'll need to
use a more sophisticated approach. I would suggest using the Hough
transform. (see: http://www.ins.itu.edu.tr/jeodezi/fotog/imag2.pdf)

I suggest referring to "R. Gonzalez and R. Woods Digital Image
Processing, Addison-Wesley Publishing Company". It's an excellent
book! Amazon link:
http://www.amazon.com/exec/obidos/tg/detail/-/0201180758/qid=1075204530//ref=sr_8_xs_ap_i1_xgl14/104-2074302-0434322?v=glance&s=books&n=507846


Good luck...
Erez

"Joenyim Kim" <jeonyimkim80@yahoo.com> wrote in message news:<bv3jka$31s$1@mozo.cc.purdue.edu>...
> Dear all, > > This should be an diagonal edge detection problem. I know one can use those > canning edge detector stuff to do some minus-plus operations and determine > the actual edge. > > But I just want to have a boolean-valued function to answer yes-no whether a > diagonal edge presents in 8x8 image block or not. Is there a simpler(faster) > way of answering yes-no? > > Thanks a lot, > > -Jeonyim