emgucv / emgucv

Emgu CV is a cross platform .Net wrapper to the OpenCV image processing library.
https://www.emgu.com/
Other
2.12k stars 581 forks source link

[BUG] LineSegment2D.Direction wrong #964

Open hagenah opened 2 months ago

hagenah commented 2 months ago

LineSegment2D.Direction returns the negative direction (P1-P2)/|P1-P2| instead of (P2-P1)/|P2-P1|.

Version: Emgu 4.9.0.5494

Sample source code:

Trace.WriteLine($"Direction: {new LineSegment2D(new Point(0,0),new Point(2,0)).Direction}");

Output: Direction: {X=-1, Y=0} Expected Output: Direction: {X=1, Y=0}

Remark: LineSegment2DF returns the correct direction.

emgucv commented 2 months ago

Thanks for pointing that out. Fixed in the above commit. I will be included in the up coming 4.10 release.