• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# Imaging.BlobCounter类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中AForge.Imaging.BlobCounter的典型用法代码示例。如果您正苦于以下问题:C# BlobCounter类的具体用法?C# BlobCounter怎么用?C# BlobCounter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



BlobCounter类属于AForge.Imaging命名空间,在下文中一共展示了BlobCounter类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: calcDescriptorInfo

        public override void calcDescriptorInfo(Bitmap inImage)
        {
            shapeCount = new int[6];

            originalImage = image;
            image = imgProcessor.preProcessImage(inImage);

            g = Graphics.FromImage(originalImage);

            BlobCounter bCounter = new BlobCounter();
            bCounter.ProcessImage(image);
            Blob[] blobs = bCounter.GetObjectsInformation();

            SimpleShapeChecker shapeChecker = new SimpleShapeChecker();

            for (int i = 0; i < blobs.Length; i++)
            {
                if (blobs[i].Area < 100)
                {
                    continue;
                }
                List<IntPoint> edgePts = bCounter.GetBlobsEdgePoints(blobs[i]);
                checkShape(shapeChecker, edgePts);

            }

            g.Dispose();
        }
开发者ID:Buddhima,项目名称:MPEG7-FeatureExtractor,代码行数:28,代码来源:BlobHandler.cs


示例2: TemplateColorTracking

        /// <summary>
        /// Get rectangle contain object in current frame
        /// </summary>
        /// <param name="templateInfo">Tracking template information</param>
        /// <param name="source">Frame</param>
        /// <returns>Rectangle contain object</returns>
        public static Rectangle TemplateColorTracking(ImageStatistics templateInfo, ref UnmanagedImage source)
        {
            UnmanagedImage image = source.Clone();
            // create filter
            EuclideanColorFiltering filter = new EuclideanColorFiltering();
            // set center colol and radius
            filter.CenterColor = new RGB(
                (byte)templateInfo.Red.Mean,
                (byte)templateInfo.Green.Mean,
                (byte)templateInfo.Blue.Mean);
            filter.Radius = 30;
            // apply the filter
            filter.ApplyInPlace(image);

            image = Grayscale.CommonAlgorithms.BT709.Apply(image);

            OtsuThreshold threshold = new OtsuThreshold();
            threshold.ApplyInPlace(image);

            BlobCounter blobCounter = new BlobCounter();
            blobCounter.ObjectsOrder = ObjectsOrder.Size;
            blobCounter.ProcessImage(image);

            Rectangle rect = blobCounter.ObjectsCount > 0 ? blobCounter.GetObjectsRectangles()[0] : Rectangle.Empty;
            return rect;
        }
开发者ID:pinkuyt,项目名称:a-pod-project-team-3,代码行数:32,代码来源:ObjectDetector.cs


示例3: getBlobMaisAlto

        private Blob getBlobMaisAlto(String path)
        {
            try
            {
                Bitmap image = hslImage(path);

                // process image with blob counter
                BlobCounter blobCounter = new BlobCounter();
                blobCounter.ProcessImage(image);
                Blob[] blobs = blobCounter.GetObjectsInformation();

                Blob blobMaisAlto = blobs[0];

                // process each blob
                foreach (Blob blob in blobs)
                {
                    if (blob.CenterOfGravity.Y < blobMaisAlto.CenterOfGravity.Y)
                        blobMaisAlto = blob;
                }

                return blobMaisAlto;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
开发者ID:pablovin,项目名称:stardust,代码行数:27,代码来源:StarTrack.cs


示例4: blob_setter

        public static void blob_setter(Bitmap video , Bitmap grayImage , int height , int width)
        {
            BlobCounter blobCounter = new BlobCounter();
            // configure it to filter out small objects
            blobCounter.MinWidth = width;
            blobCounter.MinHeight = height;
             //       blobCounter.FilterBlobs = true;
            // set ordering - bigger objects go first
            blobCounter.ObjectsOrder = ObjectsOrder.Size;
            // locate blobs
            blobCounter.ProcessImage(grayImage);
            Rectangle[] rects = blobCounter.GetObjectsRectangles();

            foreach (Rectangle recs in rects)
                if (rects.Length > 0)
                {
                    Rectangle objectRect = rects[0];
                    Graphics g = Graphics.FromImage(video);
                    using (Pen pen = new Pen(Color.FromArgb(160, 255, 160), 3))
                    {
                        g.DrawRectangle(pen, objectRect);
                    }
                    g.Dispose();
                }
        }
开发者ID:Rohail1,项目名称:OOP-Project,代码行数:25,代码来源:Blob+Detection.cs


示例5: FinalVideo_NewFrame

 void FinalVideo_NewFrame(object sender, NewFrameEventArgs eventArgs)
 {
     Icon newIcon = new Icon(@"c:\users\gregster\documents\visual studio 2012\Projects\WebCamTrack\WebCamTrack\bin\Debug\favicon.ico");
     BlobCounter bc = new BlobCounter();
     EuclideanColorFiltering filter = new EuclideanColorFiltering();
     Bitmap video = (Bitmap)eventArgs.Frame.Clone();//sem filtro
     Bitmap video1 = (Bitmap)eventArgs.Frame.Clone();// imagem com filtro
     //
     filter.CenterColor = new RGB(0, 0, 0);
     filter.Radius = 100;
     filter.ApplyInPlace(video1);//aplicando o filtro
     bc.MinWidth = 5;
     bc.MinHeight = 5;
     bc.FilterBlobs = true;
     //  bc.ObjectsOrder = ObjectsOrder.Size;
     bc.ProcessImage(video1);// processando a imagem que ja foi filtrada para identificar objetos
     Rectangle[] rects = bc.GetObjectsRectangles();
     foreach (Rectangle recs in rects)
         if (rects.Length > 0)
         {
             Rectangle objectRect = rects[0];
             Graphics g = Graphics.FromImage(video);//identificar objetos a partir da imagem com filtro
             Graphics h = Graphics.FromImage(video1);
             using (Pen pen = new Pen(Color.FromArgb(160, 255, 160), 5))
             {
                 g.DrawIcon(newIcon, objectRect);
                // g.DrawRectangle(pen, objectRect);
                 h.DrawRectangle(pen, objectRect);
             }
             g.Dispose();
             h.Dispose();
         }
     pictureBox1.Image = video;
     pictureBox2.Image = video1;
 }
开发者ID:GustavoGregorio,项目名称:Projetos-pessoais,代码行数:35,代码来源:Form1.cs


示例6: Execute

        public override void Execute(Bitmap Image)
        {
            BlobCounter blobCounter = new BlobCounter();
            blobCounter.MinHeight = 75;
            blobCounter.MinWidth = 75;
            blobCounter.CoupledSizeFiltering = true;
            blobCounter.ProcessImage(Image);
            Blob[] blobs = blobCounter.GetObjects(Image);
            int maxSize = 0;
            Blob maxObject = new Blob(0, new Rectangle(0, 0, 0, 0));
            // find biggest blob
            if (blobs != null)
            {
                foreach (Blob blob in blobs)
                {
                    int blobSize = blob.Rectangle.Width * blob.Rectangle.Height;

                    if (blobSize > maxSize)
                    {
                        maxSize = blobSize;
                        maxObject = blob;
                    }
                }
                if (maxSize > 100)
                {
                    if (Validity == ValidLocation.TRUE)
                    {
                        if (System.Math.Sqrt((CurrY - maxObject.Rectangle.Top) * (CurrY - maxObject.Rectangle.Top) + (CurrX - (maxObject.Rectangle.Left + maxObject.Rectangle.Right) / 2) * (CurrX - (maxObject.Rectangle.Left + maxObject.Rectangle.Right) / 2)) > 20)
                        {
                            Validity = ValidLocation.FALSE;
                            TargetFoundCycle = 0;
                            return;
                        }
                        else
                        {
                            TargetFoundCycle++;
                        }
                    }
                    CurrX = (maxObject.Rectangle.Left + maxObject.Rectangle.Right) / 2;
                    CurrY = maxObject.Rectangle.Top;
                    Validity = ValidLocation.TRUE;
                }
                else
                {
                    Validity = ValidLocation.FALSE;
                    TargetFoundCycle = 0;
                }
            }
            else
            {
                TargetFoundCycle = 0;
                Validity = ValidLocation.FALSE;
                return;
            }
        }
开发者ID:nakibli,项目名称:MouseCam,代码行数:55,代码来源:CState.cs


示例7: ProcessImage

        /// <summary>
        /// Méthode qui analyse les images envoyées par le client
        /// Repère les formes présentes, les découpe et les enregistre en ficiers distincts
        /// </summary>
        public void ProcessImage()
        {
            using (CamCapturer.CamCapturer cam = new CamCapturer.CamCapturer())
            {
                Picture = cam.GetCapture();
                Copy = cam.GetCapture();
            }

            ShapeChecker = new SimpleShapeChecker();
            ShapeAnalyser = new BlobCounter();
            string date = DateTime.Now.Date.ToString("dMyyyy");
            FolderName = string.Format("Kuhlschrank-{0}", date);

            ShapeAnalyser.FilterBlobs = true;
            ShapeAnalyser.MinHeight = 200;
            ShapeAnalyser.MinWidth = 500;
            Directory.CreateDirectory(Path.Combine(Path.GetTempPath(), FolderName));

            BitmapData bitData = Picture.LockBits(new Rectangle(0, 0, Picture.Width, Picture.Height), ImageLockMode.ReadWrite, Picture.PixelFormat);

            ColorFiltering filter = new ColorFiltering();

            filter.Red = new IntRange(0, 64);
            filter.Green = new IntRange(0, 64);
            filter.Blue = new IntRange(0, 64);
            filter.FillOutsideRange = false;

            filter.ApplyInPlace(bitData);

            ShapeAnalyser.ProcessImage(bitData);
            Blob[] blobs = ShapeAnalyser.GetObjectsInformation();
            Picture.UnlockBits(bitData);

            for (int i = 0; i < blobs.Length; i++)
            {
                List<IntPoint> edgePoints = ShapeAnalyser.GetBlobsEdgePoints(blobs[i]);
                List<IntPoint> corners;
                ShapeChecker.IsConvexPolygon(edgePoints, out corners);

                IntPoint pt0 = corners[0];
                IntPoint pt1 = corners[1];
                IntPoint pt2 = corners[2];

                double width = Math.Sqrt(Math.Pow(pt1.X - pt0.X, 2) + Math.Pow(pt1.Y - pt0.Y, 2));
                double height = Math.Sqrt(Math.Pow(pt2.X - pt1.X, 2) + Math.Pow(pt2.Y - pt1.Y, 2));

                Rectangle crop = new Rectangle(corners[0].X, corners[1].Y, (int)width + 50, (int)height + 50);
                Bitmap target = new Bitmap(crop.Width, crop.Height);
                using (Graphics gr = Graphics.FromImage(target))
                    gr.DrawImage(Copy, new Rectangle(0, 0, target.Width, target.Height), crop, GraphicsUnit.Pixel);

                target.Save(string.Format(@"{0}\{1}\crop{2}.jpg", Path.GetTempPath(), FolderName, i));
            }
        }
开发者ID:pr0z,项目名称:Kuhlschrank,代码行数:58,代码来源:ShapeDetectionEngine.cs


示例8: Initialize

        public virtual void Initialize(Bitmap backgroundImage)
        {
            fSequence = new FiltersSequence();
            BlobCounter = new BlobCounter();

            BlobCounter.MinWidth = BlobCounter.MinHeight = Global.AppSettings.MinBlobSize;
            BlobCounter.MaxWidth = BlobCounter.MaxWidth = Global.AppSettings.MaxBlobSize;
            BlobCounter.FilterBlobs = Global.AppSettings.FilterBlobs;
            BlobCounter.ObjectsOrder = ObjectsOrder.None;

            Initialized = true;
        }
开发者ID:francoisvdv,项目名称:PwTouch,代码行数:12,代码来源:DetectorBase.cs


示例9: FrameProcessor

        public FrameProcessor(LaserController controller)
        {
            _controller = controller;
            var min_size_val = 8;

            bc = new BlobCounter();
            bc.FilterBlobs = true;
            bc.MinHeight = min_size_val;
            bc.MinWidth = min_size_val;
            bc.MaxHeight = min_size_val + 50;
            bc.MaxWidth = min_size_val + 50;
        }
开发者ID:GurtDotCom,项目名称:2015_Reference_Robot,代码行数:12,代码来源:FrameProcessor.cs


示例10: CropImage

        /// <summary>
        /// Celem metody jest przykadrowanie otrzymanego obrazka, tak aby widok zawierał jedynie kartkę papieru, oraz zwrócenie go do metody UploadFile
        /// </summary>
        /// <param name="img"></param>
        /// <returns></returns>
        public System.Drawing.Image CropImage(System.Drawing.Image img)
        {
            //DocumentSkewChecker skewChecker = new DocumentSkewChecker();
            //double angle = skewChecker.GetSkewAngle(image);
            //RotateBilinear rotationFilter = new RotateBilinear(-angle);
            //rotationFilter.FillColor = Color.White;
            //Bitmap rotatedImage = rotationFilter.Apply(image);

            Bitmap image = new Bitmap(img);

            UnmanagedImage grayImage = null;

            if (image.PixelFormat == PixelFormat.Format8bppIndexed)
            {
                grayImage = UnmanagedImage.FromManagedImage(image);
            }
            else
            {
                grayImage = UnmanagedImage.Create(image.Width, image.Height,
                    PixelFormat.Format8bppIndexed);
                Grayscale.CommonAlgorithms.BT709.Apply(UnmanagedImage.FromManagedImage(image), grayImage);
            }

            CannyEdgeDetector edgeDetector = new CannyEdgeDetector();
            UnmanagedImage edgesImage = edgeDetector.Apply(grayImage);

            OtsuThreshold thresholdFilter = new OtsuThreshold();
            thresholdFilter.ApplyInPlace(edgesImage);

            Dilatation DilatationFilter = new Dilatation();
            DilatationFilter.Apply(edgesImage);

            Opening OpeningFilter = new Opening();
            OpeningFilter.Apply(edgesImage);

            BlobCounter blobCounter = new BlobCounter();
            blobCounter.MinHeight = 32;
            blobCounter.MinWidth = 32;
            blobCounter.FilterBlobs = true;
            blobCounter.ObjectsOrder = ObjectsOrder.Size;

            blobCounter.ProcessImage(edgesImage);
            Blob[] blobs = blobCounter.GetObjectsInformation();

            ExtractBiggestBlob BiggestBlob = new ExtractBiggestBlob();
            Bitmap biggestBlobsImage = BiggestBlob.Apply(edgesImage.ToManagedImage());
            AForge.IntPoint BiggestBlogCorners = BiggestBlob.BlobPosition;

            Crop cropFilter = new Crop(new Rectangle(BiggestBlogCorners.X, BiggestBlogCorners.Y, biggestBlobsImage.Width, biggestBlobsImage.Height));
            Bitmap croppedImage = cropFilter.Apply(image);
            return croppedImage;
        }
开发者ID:BartekIL,项目名称:AutoCrop,代码行数:57,代码来源:Service.asmx.cs


示例11: FrameProcessor

        // set color ranges to keep
        public FrameProcessor(LaserController controller)
        {
            _controller = controller;
            var min_size_val = 4;

            bc = new BlobCounter();
            bc.FilterBlobs = true;
            bc.MinHeight = min_size_val;
            bc.MinWidth = min_size_val;
            bc.MaxHeight = min_size_val + 50;
            bc.MaxWidth = min_size_val + 50;

            AForge.Imaging.Filters.HSLFiltering hslFilter = new AForge.Imaging.Filters.HSLFiltering();
        }
开发者ID:GurtDotCom,项目名称:2015_Reference_Robot,代码行数:15,代码来源:FrameProcessor2.cs


示例12: Execute

 // 如果活动返回值,则从 CodeActivity<TResult>
 // 派生并从 Execute 方法返回该值。
 protected override void Execute(CodeActivityContext context)
 {
     // create an instance of blob counter algorithm
     BlobCounterBase bc = new BlobCounter();
     // set filtering options
     bc.FilterBlobs = true;
     bc.MinWidth = context.GetValue(最小宽度);
     bc.MinHeight = context.GetValue(最小高度);
     // set ordering options
     bc.ObjectsOrder = ObjectsOrder.Size;
     // process binary image
     bc.ProcessImage(context.GetValue(处理目标));
     var blobs = bc.GetObjectsInformation();
     context.SetValue(输出目标, blobs);
 }
开发者ID:manasheep,项目名称:Core3,代码行数:17,代码来源:从图像中分割图块.cs


示例13: Rectangle

        public static void Rectangle(WriteableBitmap bitmap, DrawingContext dc)
        {
            // locating objects
            BlobCounter blobCounter = new BlobCounter();
            blobCounter.FilterBlobs = true;
            blobCounter.MaxHeight = 375;
            blobCounter.MaxWidth = 375;
            System.Drawing.Bitmap image;
            using (var stream = new MemoryStream())
            {
                var encoder = new JpegBitmapEncoder();
                encoder.Frames.Add(BitmapFrame.Create(bitmap));
                encoder.Save(stream);
                image = new System.Drawing.Bitmap(stream);
            }
            blobCounter.ProcessImage(image);
            Blob[] blobs = blobCounter.GetObjectsInformation();

            // check for rectangles
            SimpleShapeChecker shapeChecker = new SimpleShapeChecker();

            foreach (var blob in blobs)
            {
                List<IntPoint> edgePoints = blobCounter.GetBlobsEdgePoints(blob);
                List<IntPoint> cornerPoints;

                // use the shape checker to extract the corner points
                if (shapeChecker.IsQuadrilateral(edgePoints, out cornerPoints))
                {
                    // only do things if the corners form a rectangle
                    if (shapeChecker.CheckPolygonSubType(cornerPoints) == PolygonSubType.Rectangle)
                    {
                        // here i use the graphics class to draw an overlay, but you
                        // could also just use the cornerPoints list to calculate your
                        // x, y, width, height values.
                        List<AForge.Point> Points = new List<AForge.Point>();
                        foreach (var point in cornerPoints)
                        {
                            Points.Add(new AForge.Point(point.X, point.Y));
                        }
                        var path = new PathFigure(new System.Windows.Point(Points.First().X, Points.First().Y), Points.Select(row => new System.Windows.Media.LineSegment(new System.Windows.Point(row.X, row.Y), false)), true);

                        dc.DrawGeometry(Brushes.Red, null, new PathGeometry(new PathFigure[] { path }));
                    }
                }
            }
        }
开发者ID:virrkharia,项目名称:dynamight,代码行数:47,代码来源:ImageProc.cs


示例14: FindPlate

        private WriteableBitmap FindPlate(IEnumerable<Rect> rects, WriteableBitmap image)
        {
            WriteableBitmap bestCandidate = null;
            
            foreach (var rect in rects)
            {
                var croppedImage = image.Crop(rect);
                var edgeFilter = new CannyEdgeDetector();
                var smoothFilter = new Median();
                var grayFilter = new Grayscale(0.2125, 0.7154, 0.0721);
                var blobCounter = new BlobCounter();
                var cutTop = croppedImage.PixelHeight * 0.3;

                croppedImage = croppedImage.Crop(new Rect(0, cutTop, croppedImage.PixelWidth, croppedImage.PixelHeight));

                var bitmap = (Bitmap)croppedImage;
                var grayImage = grayFilter.Apply(bitmap);

                bitmap = smoothFilter.Apply(grayImage);
                edgeFilter.ApplyInPlace(bitmap);
                blobCounter.ProcessImage(bitmap);

                var blobs = blobCounter.GetObjectsInformation();
                var possibleChars = new List<Rectangle>();

                foreach (var blob in blobs)
                {
                    var objRectangle = blob.Rectangle;
                    var ratio = (double)objRectangle.Height / (double)objRectangle.Width;
                    
                    if (ratio >= 1.16d && ratio <= 6.3d)
                    {
                        possibleChars.Add(objRectangle);
                    }
                }

                if (possibleChars.Count == 0)
                {
                    continue;
                }

                bestCandidate = croppedImage;
            }

            return bestCandidate;
        }
开发者ID:andremn,项目名称:SPS,代码行数:46,代码来源:PlateRecognizer.cs


示例15: ImageProcessor

        public ImageProcessor()
        {
            shapeChecker = new SimpleShapeChecker();
            hullFinder = new GrahamConvexHull();

            blobCounter = new BlobCounter();

            HotGoal = 0;

            greenPen = new Pen(Color.FromArgb(0, 255, 0), 1);
            yellowPen = new Pen(Color.FromArgb(255, 255, 0), 1);
            redPen = new Pen(Color.FromArgb(255, 0, 0), 2);
            orangePen = new Pen(Color.FromArgb(255, 127, 0), 1);
            purplePen = new Pen(Color.FromArgb(102, 51, 153), 1);
            redBrush = new SolidBrush(Color.FromArgb(255, 0, 0));
            blueBrush = new SolidBrush(Color.FromArgb(0, 0, 255));
        }
开发者ID:619Code,项目名称:DSVision,代码行数:17,代码来源:ImageProcessor.cs


示例16: blobRecognition

        private static Blob[] blobRecognition(Bitmap thresholdedInverted)
        {
            //Use the AForge.NET BlobCounter to perform Blob Recognition / Connected Region Analysis
            BlobCounter blobRecognition = new BlobCounter();

            //Filter out blobs that are abviously the wrong size to be characters
            blobRecognition.MinWidth = (int)(thresholdedInverted.Width * (BLOB_FILTER_MIN_DIMENSION_IMAGE_PERCENTAGE / 100));
            blobRecognition.MinHeight = (int)(thresholdedInverted.Height * (BLOB_FILTER_MIN_DIMENSION_IMAGE_PERCENTAGE / 100));
            blobRecognition.MaxWidth = (int)(thresholdedInverted.Width * (BLOB_FILTER_MAX_DIMENSION_IMAGE_PERCENTAGE / 100));
            blobRecognition.MaxHeight = (int)(thresholdedInverted.Height * (BLOB_FILTER_MAX_DIMENSION_IMAGE_PERCENTAGE / 100));
            blobRecognition.FilterBlobs = true;

            blobRecognition.ProcessImage(thresholdedInverted);
            Blob[] blobs = blobRecognition.GetObjectsInformation();

            return blobs;
        }
开发者ID:JoshKeegan,项目名称:CVWS.NET,代码行数:17,代码来源:SegmentByBlobRecognition.cs


示例17: KameraMyszka

        public KameraMyszka()
        {
            bc = new BlobCounter();
            bc.FilterBlobs = true;
            bc.MinWidth = 50;
            bc.MinHeight = 50;
            bc.ObjectsOrder = ObjectsOrder.Size;

            gestChance = new Dictionary<GEST, double>();

            /* coefficients for each hand */
            observed = new double[COEFF_COUNT, 2];

            InitializeComponent();
            globalHotkeys = new Hotkeys(HotkeysConstants.CTRL + HotkeysConstants.ALT + HotkeysConstants.SHIFT, Keys.Z, this);
            globalHotkeys2 = new Hotkeys(HotkeysConstants.CTRL + HotkeysConstants.ALT + HotkeysConstants.SHIFT, Keys.X, this);
        }
开发者ID:rampler,项目名称:KameraMyszkaEmguCV,代码行数:17,代码来源:KameraMyszka.cs


示例18: Apply

        public IEnumerable<Bitmap> Apply(Bitmap bitmap)
        {
            // assuming scanned background is white we need to invert for the algo to work
            var copy = new Invert().Apply(bitmap);

            copy = EnsureGrayscale(copy);
            new Threshold { ThresholdValue = 25 }.ApplyInPlace(copy);
            new FillHoles().ApplyInPlace(copy);

            var blobCounter = new BlobCounter
            {
                // set filtering options
                FilterBlobs = true,
                MinWidth = 50,
                MinHeight = 50,
            };

            blobCounter.ProcessImage(copy);
            var blobs = blobCounter.GetObjectsInformation();

            if (blobs.Any())
            {
                var invertedOriginal = new Invert().Apply(bitmap);
                foreach (var blob in blobs)
                {
                    // use inverted source to ensure correct edge colors
                    blobCounter.ExtractBlobsImage(invertedOriginal, blob, false);
                    var blobImage = blob.Image.ToManagedImage();

                    // straighten
                    var angle = new DocumentSkewChecker().GetSkewAngle(EnsureGrayscale(blobImage));
                    var rotationFilter = new RotateBilinear(-angle) { FillColor = Color.Black };
                    blobImage = rotationFilter.Apply(blobImage);

                    // crop
                    blobImage = new ExtractBiggestBlob().Apply(blobImage);

                    new Invert().ApplyInPlace(blobImage);
                    yield return blobImage;
                }
            }
            else
            {
                yield return bitmap;
            }
        }
开发者ID:x-skywalker,项目名称:Enhance,代码行数:46,代码来源:CropAndStraighten.cs


示例19: ExtractBlob

        public List<Blob> ExtractBlob()
        {
            // create instance of blob counter
            BlobCounter blobCounter = new BlobCounter();
            // process input image
            blobCounter.ProcessImage(ImageBitmap);
            
            // get information about detected objects   
            
            Blob[] blobArray = blobCounter.GetObjectsInformation();

            foreach(Blob blobdata in blobArray)
            {
                blobCounter.ExtractBlobsImage(ImageBitmap, blobdata, true);
            }
            
            return blobArray.ToList();
        }
开发者ID:geeksree,项目名称:cSharpGeeks,代码行数:18,代码来源:ImageProcessor.cs


示例20: DetectBlobs

        Blob[] DetectBlobs(Bitmap bmp)
        {
            Invert filter = new Invert();
            filter.ApplyInPlace(bmp);

            BlobCounter bc = new BlobCounter();
            bc.BackgroundThreshold = Color.FromArgb(8, 8, 8);

            bc.BlobsFilter = new BlobsFilter(bmp.Size);
            bc.FilterBlobs = true;

            bc.ProcessImage(bmp);

            // Revert back
            filter.ApplyInPlace(bmp);

            return bc.GetObjectsInformation();
        }
开发者ID:jazzlife,项目名称:pdf-ebook-reader,代码行数:18,代码来源:ConnectedBlobLayoutStrategy.cs



注:本文中的AForge.Imaging.BlobCounter类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Imaging.UnmanagedImage类代码示例发布时间:2022-05-24
下一篇:
C# AForge.IntPoint类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap