How can i count the pixels for different value in image histogram ?

i want to count pixels like how many pixels are red ,green,blue in image and also wants to count image histogram pixels .how can i do this please suggest me . thanks

1 Comment

First you need to define exactly when a pixel is to be considered red, green, or blue. For example is [2/255 1/255 1/255] to be considered Red or Black or White ?

Sign in to comment.

Answers (1)

See demos for things like that in my File Exchange: http://www.mathworks.com/matlabcentral/fileexchange/?term=authorid%3A31862
Also, see attached demo for histograms of RGB images.
Next read this: http://www.mathworks.com/matlabcentral/answers/6200-tutorial-how-to-ask-a-question-on-answers-and-get-a-fast-answer and attach your image with the green and brown frame icon if you want any more advice.

Asked:

on 28 Nov 2015

Answered:

on 28 Nov 2015

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!