liangdutiaojie.m

来自「直方图均衡化及亮度调整」· M 代码 · 共 26 行

M
26
字号
I=imread('girl.bmp');           % MATLAB自带的图像,如图3-3所示

J1 = imadjust(I,[0 0.5],[0.5 1],1);    % X方向是在[0,0.5]之间,Y方向在[0.5,1]之间

imwrite(J1,'girl2.bmp');

%J2 = imadjust(I,[0 1],[0 1],0.25); 
%J3 = imadjust(I,[0 1],[0 1],0.5); 
%J4 = imadjust(I,[0 1],[0 1],0.75); 
%J5 = imadjust(I,[0 1],[0 1],1.25); 
%J6 = imadjust(I,[0 1],[0 1],1.5); 
%J7 = imadjust(I,[0 1],[0 1],1.75); 
%J8 = imadjust(I,[0 1],[0 1],2); 

%subplot(3,3,1),imshow(J1),title('亮度调整后的图像-gamma=0');
%subplot(3,3,2),imshow(J2),title('亮度调整后的图像-gamma=0.25');
%subplot(3,3,3),imshow(J3),title('亮度调整后的图像-gamma=0.5');
%subplot(3,3,4),imshow(J4),title('亮度调整后的图像-gamma=0.75');
%subplot(3,3,5),imshow(I),title('原始图像-gamma默认值=1');
%subplot(3,3,6),imshow(J5),title('亮度调整后的图像-gamma=1.25');
%subplot(3,3,7),imshow(J6),title('亮度调整后的图像-gamma=1.5');
%subplot(3,3,8),imshow(J7),title('亮度调整后的图像-gamma=1.75');
%subplot(3,3,9),imshow(J8),title('亮度调整后的图像-gamma=2');

subplot(1,2,1),imshow(I),title('原始图像')
subplot(1,2,2),imshow(J1),title('亮度调整')

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?