tags:

views:

11

answers:

1

hi,

i used image.HoughLine to find line in my image. i want to know the angle of each line. so i tried :

double deltaY = line.P2.Y - line.P1.Y;
double deltaX = line.P2.X - line.P1.X;
double angle;
if (deltaX != 0)
        angle = Math.Atan2(deltaY, deltaX);
else
        angle = 90;

but , it returns 0 and -1 , while the lines in image at least have 15 degree . ( i rotated the image myself ).

what's wrong? and what is Direction in LineSegment2D class, could it help ?

A: 

I Found myself the solution. you know what was the problem ? so simple, The Math.Atan2 function return the result in radian unit , so i converted it to degree and guess what? everything solved ;)

BTW, i still don't know what is the Direction and Length in LineSegment2D class, Emgu documentation didnt help me to find any clue.

Thanks StachOverFlow,

Tive