Algorithmix.Preprocessing.Preprocessing.GetCropZone C# (CSharp) Method

GetCropZone() private static method

Simple helper function for cropping the image after rotation
private static GetCropZone ( Byte>.Image myImg ) : Rectangle
myImg Byte>.Image
return System.Drawing.Rectangle
        private static Rectangle GetCropZone(Image<Bgra, Byte> myImg)
        {
            int top = 0;
            int left = 0;
            int bottom = myImg.Rows - 1;
            int right = myImg.Cols - 1;

            top = FindTopTransparent(myImg);
            left = FindLeftTransparent(myImg);
            bottom = FindBottomTransparent(myImg);
            right = FindRightTransparent(myImg);

            return new Rectangle(left, top, (right - left), (bottom - top));
        }