Пример #1
0
        /// <summary>
        /// returns edge binary image
        /// </summary>
        private static bool[,] GetEdgeImage(Bitmap bitmap)
        {
            //Bitmap gray = GetGrayscaleImage(bitmap);
            //create log filter

            var sigma = GetSigma();
            int m = GetM(sigma);

            var op = new LoG_Operator(m, sigma);

            //create image large enough to convolve based on grayscale image
            var paddedArray = PadImageForConvolution(bitmap, m);
            //paddedGray.Save(currentdir + "\\" + "paddedGray.bmp");

            //get convolved image output
            var stuf = op.Convolve(bitmap, paddedArray);

            //do zero crossing filter ==> output bitmap of he same size as myImage
            var edgeImage = new ZeroCrossingOperator().OperateOverArrayWithSize(stuf, bitmap.Width, bitmap.Height);

            return edgeImage;
        }
Пример #2
0
        /// <summary>
        /// returns edge binary image
        /// </summary>
        private static bool[,] GetEdgeImage(Bitmap bitmap)
        {
//Bitmap gray = GetGrayscaleImage(bitmap);
            //create log filter

            var sigma = GetSigma();
            int m     = GetM(sigma);

            var op = new LoG_Operator(m, sigma);


            //create image large enough to convolve based on grayscale image
            var paddedArray = PadImageForConvolution(bitmap, m);
            //paddedGray.Save(currentdir + "\\" + "paddedGray.bmp");

            //get convolved image output
            var stuf = op.Convolve(bitmap, paddedArray);


            //do zero crossing filter ==> output bitmap of he same size as myImage
            var edgeImage = new ZeroCrossingOperator().OperateOverArrayWithSize(stuf, bitmap.Width, bitmap.Height);

            return(edgeImage);
        }