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

IsEqual() public static method

Compares two rectangles for equality, considering an acceptance threshold.
public static IsEqual ( this objA, Rectangle objB, int threshold ) : bool
objA this
objB System.Drawing.Rectangle
threshold int
return bool
        public static bool IsEqual(this Rectangle objA, Rectangle objB, int threshold)
        {
            return (Math.Abs(objA.X - objB.X) < threshold) &&
                   (Math.Abs(objA.Y - objB.Y) < threshold) &&
                   (Math.Abs(objA.Width - objB.Width) < threshold) &&
                   (Math.Abs(objA.Height - objB.Height) < threshold);
        }