Emgu.CV.Structure.LineSegment2DF.GetExteriorAngleDegree C# (CSharp) Метод

GetExteriorAngleDegree() публичный Метод

Get the exterior angle between this line and otherLine
public GetExteriorAngleDegree ( LineSegment2DF otherLine ) : double
otherLine LineSegment2DF The other line
Результат double
        public double GetExteriorAngleDegree(LineSegment2DF otherLine)
        {
            PointF direction1 = Direction;
             PointF direction2 = otherLine.Direction;
             double radianAngle = Math.Atan2(direction2.Y, direction2.X) - Math.Atan2(direction1.Y, direction1.X);
             double degreeAngle = radianAngle * (180.0 / Math.PI);
             return
             degreeAngle <= -180.0 ? degreeAngle + 360 :
             degreeAngle > 180.0 ? degreeAngle - 360 :
             degreeAngle;
        }

Usage Example

        private void AddToFlowVectorImage(Image<Bgr, byte> flowVectorImage, LineSegment2DF flowVector)
        {
            var bgr = new HsvToBgrConverter(flowVector.GetExteriorAngleDegree(UnitVectorOfX), 1, 1).Convert();

            flowVectorImage.Draw(flowVector, bgr, 1);
        }
All Usage Examples Of Emgu.CV.Structure.LineSegment2DF::GetExteriorAngleDegree