AForge.NET

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

Blob/color detection

Forum to discuss AForge.NET Framework, its features, API, how-tos, etc.

Blob/color detection

Postby parsa.engz » Sat Nov 11, 2017 1:54 am

Hello
I'm using Aforge to detect multiple colors in a live video streams and put rectangles on the detected colors. My question is about retrieving the color of detected objects?

How can I get the RGB values or the name of the color of a detected object?

In fact I can filter out 3 colors and track them in real time but I need the system to say the color or RGB of the object every time I show one of the object to the camera

Many thanks

Parsa
parsa.engz
 
Posts: 7
Joined: Fri Sep 30, 2016 1:36 pm

Re: Blob/color detection

Postby andrew.kirillov » Sat Nov 11, 2017 2:36 pm

Hello,

If you use Blob Counter to find your objects, then you can try using Blob.ColorMean to get blob's mean color. Color names is something you need to decide.
With best regards,
Andrew


Interested in supporting AForge.NET Framework?
User avatar
andrew.kirillov
Site Admin, AForge.NET Developer
 
Posts: 3245
Joined: Fri Jan 23, 2009 9:12 am
Location: UK

Re: Blob/color detection

Postby parsa.engz » Sun Nov 12, 2017 1:13 am

Thanks for the reply. Yes I'm using Blobcounter to find my object But I dont find the ColorMean? how should I use it?
here is the code

BlobCounter blobCounter = new BlobCounter();
blobCounter.FilterBlobs = true;
blobCounter.MinWidth = 25;
blobCounter.MinHeight = 25;
blobCounter.ProcessImage(grayscaledBitmap);
blobCounter.FilterBlobs = true; //I have added

Rectangle[] rects = blobCounter.GetObjectsRectangles();

the center point of each rect is the point I need to find it color?

Many thatks
Parsa
parsa.engz
 
Posts: 7
Joined: Fri Sep 30, 2016 1:36 pm

Re: Blob/color detection

Postby andrew.kirillov » Sun Nov 12, 2017 8:39 am

With best regards,
Andrew


Interested in supporting AForge.NET Framework?
User avatar
andrew.kirillov
Site Admin, AForge.NET Developer
 
Posts: 3245
Joined: Fri Jan 23, 2009 9:12 am
Location: UK




Return to AForge.NET Framework