How to detect a color in a 100 images different images within a second. The requirement is as follow:
INPUT = Continuous images i.e. 100 images per second
OUPUT = Save the image if a particualr color matched or delete the image from location
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Janat AlJamalPosted Dec 17, 2019, 10:38 AM
As mentioned, this can be performed using the LEADTOOLS SDK. If you're interested only in whether a given image contains a specific intensity value, consider examining the histogram of the image.
https://www.leadtools.com/help/leadtools/v20/dh/pc/histogramcommand.html
For example, this code snippet shows how to load an image, generate the histogram, and return based on whether at least one red pixel is present.
public static bool UseHistogramCommand(string filePath)
{
using (RasterCodecs codecs = new RasterCodecs())
{
RasterImage image = codecs.Load(filePath);
HistogramCommand hc = new HistogramCommand();
hc.Channel = HistogramCommandFlags.Red;
hc.Run(image);
return hc.Histogram[255] > 0;
}
}
Note disk read operations are relatively slow compared to data processing. At 100 images per second this would limit 10 milliseconds per image. If these are large images, the bottleneck would be disk.
Mark AbbPosted Jul 3, 2014, 3:58 AM
In all cases, you might be able doing this by using one of the following approaches:
1. Read the images data pixel-by-pixel and compare the pixel's color with your color. This is going to be slow, especially of the last pixel is the color you are looking for.
2. Use an SDK like LEADTOOLS that has optimized image processing functions. (Found this on Google, http://support.leadtools.com/CS/forums/6298/ShowPost.aspx)
3. If all images are palettized (contains palette), then you might be able create a custom solution to search the image's palettes without loading them.
chandan singhPosted Jun 16, 2014, 8:12 AM
Shweta LodhaPosted Jun 16, 2014, 8:07 AM
Shweta LodhaPosted Jun 16, 2014, 8:04 AM
http://www.c-sharpcorner.com/UploadFile/0f68f2/color-detecting-in-an-image-in-C-Sharp/
Please have a look.