image processing displaying color of the particular plane in the histogram
    6 views (last 30 days)
  
       Show older comments
    
Hi, 
Is it possible to display histogram of color  in a color image from a  particular plane? like when we use imhist we get shades of grey bar below the histogram could we do that in color ? 
0 Comments
Answers (1)
  Image Analyst
      
      
 on 14 Jul 2020
        No, that's not a feature.  In fact there is no RGB histogram function.  You can extract each color channel into a monochrome image and then call imhist() and get the gray scale wedge underneath the histogram, but it will be in grayscale because it has no idea where (what color channel) the monochrome image array came from.
4 Comments
  Image Analyst
      
      
 on 18 Jul 2020
				
      Edited: Image Analyst
      
      
 on 18 Jul 2020
  
			So if you have a general cluster of points, like a random cloud, then the centroid of the cluster is the mean of the x, y, and x.  So assuming you have a color image, 
[redChannel, greenChannel, blueChannel] = imsplit(rgbImage);
midR = mean2(redChannel)
midG = mean2(greenChannel)
midB = mean2(blueChannel)
So those are the values.  Note that since they're the mean, and are probably non-integer values, there may be no pixel in your image that has the mean value (even if the mean were integer).
But now we come to where we need to understand exactly what "looking at the mid grey level from the color pixels in the three axis separately" means.  Does it mean that you want to zoom in on your plot to the middle, like this:
xlim([midR - 5, midR + 5]);
ylim([midG - 5, midG + 5]);
zlim([midB - 5, midB + 5]);
I really have no idea unless you explain that phrase much more accurately, or put up a picture of what you hope to obtain.
See Also
Categories
				Find more on Histograms in Help Center and File Exchange
			
	Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
