Algorithmix.Forensics.EdgeDetector.ScanFromRight C# (CSharp) Метод

ScanFromRight() публичный статический Метод

public static ScanFromRight ( Bitmap shred, Direction direction, double percentageIgnored = 0.15 ) : int[]
shred System.Drawing.Bitmap
direction Direction
percentageIgnored double
Результат int[]
        public static int[] ScanFromRight(Bitmap shred, Direction direction, double percentageIgnored = 0.15)
        {
            int startHeight = (int) (percentageIgnored*(shred.Height));
            int stopHeight = (int) ((1 - percentageIgnored)*(shred.Height));
            int[] edgePoints = new int[shred.Height];
            using (Image<Bgra, byte> image = new Image<Bgra, byte>(shred))
            {
                for (int row = 0; row < image.Height; row++)
                {
                    if (row < startHeight || row >= stopHeight)
                    {
                        edgePoints[row] = IgnorePoint;
                    }
                    else
                    {
                        for (int col = image.Width - 1; col >= 0; col--)
                        {
                            if (!(Math.Abs(image[row, col].Alpha - byte.MaxValue) < 0.0001)) continue;
                            edgePoints[row] = col;
                            break;
                        }
                    }
                }
            }
            return edgePoints;
        }