AForge.NET

  :: AForge.NET Framework :: Articles :: Forums ::

[Solved]ExtractBlobsImage can't extract blob.image to bitmap

The forum is to discuss topics related to different areas of image processing and computer vision.

[Solved]ExtractBlobsImage can't extract blob.image to bitmap

Postby counov » Thu May 18, 2017 3:12 am

This is my code
Code: Select all
                Bitmap Ftemp = source.Clone() as Bitmap;
                FiltersSequence fseq = new FiltersSequence();
                fseq.Add(new Mean());
                fseq.Add(Grayscale.CommonAlgorithms.BT709);
                fseq.Add(new Threshold(150));
                fseq.Add(new Invert());
                Ftemp = fseq.Apply(Ftemp);

                BlobCounter bc = new BlobCounter();
                bc.FilterBlobs = true;
                bc.MinHeight = bc.MinWidth = 11;
                bc.MaxHeight = bc.MaxWidth = 47;
                bc.ProcessImage(Ftemp);
                Blob[] blobs = bc.GetObjectsInformation();
                debugmsg +="Got" + blobs.Length + " blob";
                bc.ExtractBlobsImage(Ftemp, blobs[0], false);
                Bitmap Btemp = blobs[0].Image.ToManagedImage();
                debugmsg += Btemp.Width + " " + Btemp.Height + "\r\n";

Uh.. It is working
I forget check Btemp null before I show it on picturebox
counov
 
Posts: 1
Joined: Sun May 07, 2017 5:21 am



Return to Image Processing and Computer Vision

cron