AForge.NET

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

HOW TO CHANGE BACKGROUND COLOR TO BLACK

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

HOW TO CHANGE BACKGROUND COLOR TO BLACK

Postby stylish066 » Fri Nov 24, 2017 6:31 pm

Hi,actually i want to detect coins from real images so in order to detect coins i want to change background color to black .I have used #colorfilter to change my background color to black, it works only with dark background color (like dark brow) but if background color is white then its does not work background color remain same. i used this code
{
ColorFiltering colorFilter = new ColorFiltering();
colorFilter.Red = new AForge.IntRange(0,90);
colorFilter.Green = new AForge.IntRange(0,90);
colorFilter.Blue = new AForge.IntRange(0, 90);
colorFilter.FillOutsideRange = false;
colorFilter.ApplyInPlace(imgInput.Bitmap);
}
but i want to change automatically background color to black whether the orignal background color is light or dark
could somebody send me whole code.
thanks in advance :)Image
stylish066
 
Posts: 1
Joined: Fri Nov 24, 2017 6:03 pm



Return to Image Processing and Computer Vision

cron