필터 지우기
필터 지우기

how do I display the histogram of each image D1, D2, D3, and D4 by using the corresponding image using the subplot command? Each histogram should contain 256 pixels values

조회 수: 6 (최근 30일)
a=imread('C:\Users\Nathan Donatell\Pictures\SanDiego.jpg');
g = rgb2gray(a);
b = im2double(g);
c= mat2gray(a);
D1=c .^(1/4);
D2=c .^(1/2);
D3=c .^(2/2);
D4=c .^(3/2);
subplot(2,2,1); imshow(D1); title('1/4');
subplot(2,2,2); imshow(D2); title('1/2');
subplot(2,2,3); imshow(D3); title('2/2');
subplot(2,2,4); imshow(D4); title('3/2');

답변 (1개)

Walter Roberson
Walter Roberson 2018년 11월 10일
a=imread('C:\Users\Nathan Donatell\Pictures\SanDiego.jpg');
g = rgb2gray(a);
b = im2double(g);
c= mat2gray(a);
D1=c .^(1/4);
D2=c .^(1/2);
D3=c .^(2/2);
D4=c .^(3/2);
subplot(2,4,1); imshow(D1); title('1/4');
subplot(2,4,5); imhist(D1, 256*1/4);
subplot(2,4,2); imshow(D2); title('1/2');
subplot(2,4,6); imhist(D2, 256*1/2);
subplot(2,4,3); imshow(D3); title('2/2');
subplot(2,4,7); imhist(D3, 256*2/2);
subplot(2,4,4); imshow(D4); title('3/2');
subplot(2,4,8); imhist(D4, 256*3/2);

카테고리

Help CenterFile Exchange에서 Subplots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by