localhist.m

来自「is a matlab program for image processing」· M 代码 · 共 15 行

M
15
字号
% Program No:6
% Write an M-function for performing local histogram equalization

% function localhist(x)
f=imread('im_1_cameraman.tif');
f=im2double(f);
w=input('\nEnter the Neighborhood or Window size : ');
k=input('\nEnter the value of the constant k (value should be between 0 and 1) : ');
M=mean2(f);
z=colfilt(f,[w w],'sliding',@std);
m=colfilt(f,[w w],'sliding',@mean);
A=k*M./z;
g=A.*(f-m)+m;
imshow(f), figure, imshow(g);

⌨️ 快捷键说明

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