I want to write a program that takes in a picture (or a series of pictures) and counts how many pixels of certain colors there are. I've never done anything like this before so I don't know what language to use or even where to get started. Any language recommendations, theories, or suggestions would be appreciated.
-
hi, and welcome to SO! As it is, your question is far too broad to be a good fit for this site. I would recommend that you pick a programming language (pretty much any common language will be able to do this) and give it a go. Use tutorials or old-fashioned books to learn the language. Once you've experimented a bit and have a more specific problem, feel free to update your question (or ask a new one). – Jeen Broekstra Feb 17 '14 at 04:24
3 Answers
About any programming language includes library for image processing.
So take the language you feel most comfortable with and work from there.
E.g.:
-
I appreciate it. Wasn't sure exactly what to search for but count pixels does make sense. I think I'll do it in C++. – Sage Feb 17 '14 at 01:30
-
16 years ago I wrote a content in image recognition tool in C. The book I liked was "digital image processing" by Rafael C. Gonzalez and Richard E. Woods. Although for just counting pixels ... you just need to copy and paste code but if the application is bigger this book is handy. – edelwater Feb 17 '14 at 01:34
It depends on the type of image that you are processing too. You can use whatever language you prefer or feel confortable with, most people will recommend using C/C++ for this because the program would be faster and image processing can take lots of time depending on what you are doing. For you algorithm it will depend on the size of the image to have an idea of processing time, but Java would do it as well.
Another thing that you should consider is that depending on the color format you may need to keep track of more info.
Cheers

- 1,816
- 1
- 13
- 22
MatLab Image processing Toolbox is able to do that. I noticed in one of the comment that you said you will use C++ to do it. If so, I recommend OpenCV Library. The configurations and installation maybe a bit of a hassle. But if you are planning to do more image processing stuff like that, I recommend that, as it will help make things alot easier as well as shorten your code pretty reasonably.

- 2,068
- 4
- 28
- 46
-
Im really doing to project to practice my programming (C++) skills and maybe turn it into a bigger project later. OpenCV looks very interesting though. I like all the documentation (since I will definitely be pretty lost at first). – Sage Feb 17 '14 at 04:46
-
-
In addition, thats another good thing about opencv! Just google opencv tutorial, etc, u find tons of them. This is because opencv is pretty popular. In addition, there's also stack overflow. (; – rockinfresh Feb 17 '14 at 06:19
-
Do consider upvoting my answer if you have found it useful by clicking the up arrow. Cheer (: – rockinfresh Feb 17 '14 at 06:20
-
I would but people down voted me too much and I don't have enough rep. Sorry man. – Sage Feb 18 '14 at 05:08
-
No probs, maybe next time when you have more rep. Helped you to rephrase your post to make it less broad and more direct, but unsure if it will be approved due to me changing almost the whole post. Do try make your questions more direct/specific next time. – rockinfresh Feb 18 '14 at 05:56
-
Ok. My edit suggestions was rejected. Just upvote one for you, but do ensure that such broad post will not occur again. – rockinfresh Feb 18 '14 at 05:58