Accord.Imaging.Tools.TransformPoints C# (CSharp) Method

TransformPoints() public static method

Transforms the given points using this transformation matrix.
public static TransformPoints ( this fundamentalMatrix ) : System.Drawing.PointF[]
fundamentalMatrix this
return System.Drawing.PointF[]
        public static PointF[] TransformPoints(this float[,] fundamentalMatrix, params PointF[] points)
        {
            PointF[] r = new PointF[points.Length];

            for (int j = 0; j < points.Length; j++)
            {
                float[] a = new float[] { points[j].X, points[j].Y, 1 };
                float[] b = fundamentalMatrix.Dot(a);
                r[j] = new PointF(b[0] / b[2], b[1] / b[2]);
            }

            return r;
        }