需要创建两个函数文件
一
function g = intrans(f, varargin) %INTRANS Performs intensity (gray-level) transformations. % G = INTRANS(F, 'neg') computes the negative of input image F. % % G = INTRANS(F, 'log', C, CLASS) computes C*log(1 + F) and % multiplies the result by (positive) constant C. If the last two % parameters are omitted, C defaults to 1. Because the log is used % frequently to display Fourier spectra, parameter CLASS offers the % option to specify the class of the output as 'uint8' or % 'uint16'. If parameter CLASS is omitted, the output is of the % same class as the input. % % G = INTRANS(F, 'gamma', GAM) performs a gamma transformation on % the input image using parameter GAM (a required input). % % G = INTRANS(F, 'stretch', M, E) computes a contrast-stretching % transformation using the expression 1./(1 + (M./(F + % eps)).^E). Parameter M must be
1234567891011121314151617