Réponse acceptée

Image Analyst
Image Analyst le 5 Nov 2013

0 votes

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 commentaires

engineer 01
engineer 01 le 5 Nov 2013
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.
engineer 01
engineer 01 le 5 Nov 2013
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 ?
Image Analyst
Image Analyst le 5 Nov 2013
It should work. Attach your script and image file.
engineer 01
engineer 01 le 5 Nov 2013
i uploaded result it's empty
engineer 01
engineer 01 le 5 Nov 2013
Image Analyst
Image Analyst le 5 Nov 2013
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).
engineer 01
engineer 01 le 5 Nov 2013
ok
Image Analyst
Image Analyst le 5 Nov 2013
Wow, you're really making me work for it. Now, please attach your image file.
engineer 01
engineer 01 le 5 Nov 2013
engineer 01
engineer 01 le 5 Nov 2013
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.
engineer 01
engineer 01 le 5 Nov 2013
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
Image Analyst
Image Analyst le 5 Nov 2013
Try imadjust().
engineer 01
engineer 01 le 5 Nov 2013
how ?
Image Analyst
Image Analyst le 5 Nov 2013
betterImage = imadjust(badImage);

Connectez-vous pour commenter.

Plus de réponses (0)

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by