how to create a histogram of R,G,B
    21 次查看(过去 30 天)
  
       显示 更早的评论
    
i have three component R(0-255),G(0-255),B(0-255) i draw 3 different histograms of each component of 8 bins but i need one 2-D histogram of 8 bins.
1 个评论
回答(3 个)
  Youssef  Khmou
      
 2013-6-19
        hi,
You mean putting them on one figure, with each component its corresponding color :
I=imread('autumn.tif');
R=imhist(I(:,:,1));
G=imhist(I(:,:,2));
B=imhist(I(:,:,3));
figure, plot(R,'r')
hold on, plot(G,'g')
plot(B,'b'), legend(' Red channel','Green channel','Blue channel');
hold off,
0 个评论
  Image Analyst
      
      
 2013-6-20
        What does this mean? Do you either want (1) histograms of each color channel (either on the same plot or on 3 separate plots), or (2) a scatterplot of the 3D color gamut? I have demos of each of those, just say what you want.
4 个评论
  Sumaiya Ali
 2022-2-19
				how can I get the x and y axis numbers for images when I use imshow() like in your output?
  Image Analyst
      
      
 2022-2-19
				@Sumaiya Ali what does "get" mean to you?  You can try xticks(), xticklabels(), axis('on', 'image'), or other things.  You have not explained very precisely what you want.
  Chinnu
 2020-5-13
        
      编辑:Image Analyst
      
      
 2020-5-13
  
      I=imread('autumn.tif'); 
R=imhist(I(:,:,1)); 
G=imhist(I(:,:,2)); 
B=imhist(I(:,:,3)); 
figure
plot(R,'r') 
hold on, 
plot(G,'g') 
plot(B,'b')
legend(' Red channel','Green channel','Blue channel');
hold off
另请参阅
类别
				在 Help Center 和 File Exchange 中查找有关 Histograms 的更多信息
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!






