color1.m

来自「MATLAB数字图像处理,彩色图像均衡化」· M 代码 · 共 35 行

M
35
字号
clc
clear all
mypath = 'D:\MATLAB7\work';
cd(mypath);
[fname,fpath] = uigetfile('*bmp','请选择图片');
cd(fpath);
f = imread(fname);
R = f(:,:,1);   
G = f(:,:,2);   
B = f(:,:,3);

R0 = histeq(R);
G0 = histeq(G);
B0 = histeq(B);

subplot(2,3,1);
imshow(f);
title 原图;

subplot(2,3,2);
imshow(R0);
title R

subplot(2,3,3);
imshow(G0);
title G

subplot(2,3,4);
imshow(B0);
title B

f0 = cat(3,R0,G0,B0);
subplot(2,3,5);
imshow(f0);
title 均衡化

⌨️ 快捷键说明

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