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.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Shweta LodhaRank #31 · 39.8K reputationPosted Jun 16, 2014, 4:04 AM EDT
http://www.c-sharpcorner.com/UploadFile/0f68f2/color-detecting-in-an-image-in-C-Sharp/
Please have a look.
Shweta LodhaRank #31 · 39.8K reputationPosted Jun 16, 2014, 4:07 AM EDT
chandan singh7 reputationPosted Jun 16, 2014, 4:12 AM EDT
Mark Abb2 reputationPosted Jul 2, 2014, 11:58 PM EDT
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.
Janat AlJamal114 reputationPosted Dec 17, 2019, 5:38 AM EST
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.