how can i find Plot histogram ?

 采纳的回答

Image Analyst
Image Analyst 2013-11-5

0 个投票

I assume you've looked up hist and histogram in the help and have gone over all the help documentation and didn't find what you were looking for. But I'm not sure what you want. Do you want help on plot()? On bar()? On hist(), histc(), or imhist()? Please expand on your question. Help us help you.

16 个评论

thank you,exactly question is that...:
1-Input partly dark with something at the back stage 2-) Plot histogram & image for Q1
% Display the original gray scale image.
subplot(2, 2, 1);
imshow(grayImage, []);
title('Original Grayscale Image', 'FontSize', fontSize);
% Enlarge figure to full screen.
set(gcf, 'Units', 'Normalized', 'OuterPosition', [0 0 1 1]);
% Give a name to the title bar.
set(gcf, 'Name', 'Demo by ImageAnalyst', 'NumberTitle', 'Off')
% Let's compute and display the histogram.
[pixelCount, grayLevels] = imhist(grayImage);
subplot(2, 2, 2);
bar(pixelCount);
grid on;
title('Histogram of original image', 'FontSize', fontSize);
xlim([0 grayLevels(end)]); % Scale x axis manually.
thank you so much,but one more thing when i run this code shown the empty graphic.i wrote
pic=imread('d:\image4.jpg'); grayimage=rgb2gray(pic);
what can i do ?
It should work. Attach your script and image file.
i uploaded result it's empty
You didn't upload your script or image. You just uploaded a screenshot. Upload the .m file and your .PNG file (or whatever image format you're using).
Wow, you're really making me work for it. Now, please attach your image file.
thank you so much,this Picture is not important,The important thing is writing in first question dark image so doesn't matter for me if there is any problem
MATLAB is case sensitive so grayImage is not the same as grayimage. See corrected code below:
fontSize = 20;
rgbImage=imread('D:\image4.jpg');
grayImage=rgb2gray(rgbImage);
% Display the original gray scale image.
subplot(2, 2, 1);
imshow(rgbImage, []);
title('Original RGB Image', 'FontSize', fontSize);
subplot(2, 2, 2);
imshow(grayImage, []);
title('Gray Scale Image', 'FontSize', fontSize);
% Enlarge figure to full screen.
set(gcf, 'Units', 'Normalized', 'OuterPosition', [0 0 1 1]);
% Give a name to the title bar.
set(gcf, 'Name', 'Demo by ImageAnalyst', 'NumberTitle', 'Off')
% Let's compute and display the histogram.
[pixelCount, grayLevels] = imhist(grayImage);
subplot(2, 2, 4);
bar(pixelCount);
grid on;
title('Histogram of Gray Scale Image', 'FontSize', fontSize);
xlim([0 grayLevels(end)]); % Scale x axis manually.
thank you so much for everything it's work..Sorry,i will ask last a question
1-) Determine & output pixel intensity values which needs improvements. 2-) Apply constrast strectching to pixel values determined in Question 1
Try imadjust().
betterImage = imadjust(badImage);

请先登录,再进行评论。

更多回答(0 个)

类别

标签

Community Treasure Hunt

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

Start Hunting!

Translated by