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

FindTopTransparent() public static method

Find the top row of non-transparent pixels
public static FindTopTransparent ( Byte>.Image myImg ) : int
myImg Byte>.Image image to find top non-transparent pixels
return int
        public static int FindTopTransparent(Image<Bgra, Byte> myImg)
        {
            for (int ii = 0; ii < myImg.Rows; ii++)
            {
                for (int jj = 0; jj < myImg.Cols; jj++)
                {
                    if (myImg[ii, jj].Alpha > 55)
                    {
                        return ii;
                    }
                }
            }
            return 0;
        }