2
« on: November 18, 2011, 03:19:36 pm »
Hey I just recently started messing with SFML and it seems to be the answer to a problem my brother is having that he asked me for help with.
His problem is he has a folder on his machine with about 30,000 small images of envelopes. I havent seen these so i dont know what they look like but he has to get all the red ones out of the folder and into another folder (i think..).
It seems I should be able to create a program with sfml that loops through the pixels in these images using:
sf::Color Color = Image.GetPixel(r,c);
using the rgb values returned from that how would I be able to tell if the pixel is mostly red? I know red is 255,0,0 .. but for all shades of red is there a general rule in these rgb values that makes it red? e.g. in RGB does R>G && R>B make that pixel red?
also how do you think this would perform? is it too brute or is there a more elegant approach? maybe not sfml?