채택된 답변

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

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

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Histograms에 대해 자세히 알아보기

태그

질문:

2013년 11월 5일

댓글:

2013년 11월 5일

Community Treasure Hunt

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

Start Hunting!

Translated by