Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - korovyev

Pages: [1]
1
Graphics / sf::Color check to see if image has a lot of red
« on: November 18, 2011, 05:35:08 pm »
Thanks for that. I know there are probably alot of easier approaches but I just want to use this as a little programming exercise for myself :roll: , sfml looks like its worth learning for me aswell.

2
Graphics / sf::Color check to see if image has a lot of red
« 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:
Code: [Select]
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?

Pages: [1]
anything