⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 imgeqmapping.m

📁 matlab图象增强代码集合。多个代码。英文。
💻 M
字号:
function ieq = imgeqmapping(img)
% Author: Javier Montoya (jmontoyaz@gmail.com).
%         http://www.lis.ic.unicamp.br/~jmontoya
%
% IMGEQMAPPING enhances the contrast of 'img' by using its equalized
% histogram.
% Input parameters:
%    img: image I (passed as a bidimensional matrix).
% Ouput parameters:
%    ieq: enhanced image.
%
% See also: IMGHISTEQ
%
% Usage:
%    I = imread('tire.tif');
%    J = imgeqmapping(I);
%    figure; imagesc(I); colormap('gray'); axis image; title('Input image');
%    figure; imagesc(J); colormap('gray'); axis image; title('Equalized image');

   ieqhist     = imghisteq(img);
   [rows,cols] = size(img);
   ieq         = zeros(rows, cols);   
   for i=1:1:rows
       for j=1:1:cols
           pxval    = img(i,j)+1;%此处无法通过。
           %提示:funciton '+' is not defined for values of class 'uint8'.
           ieq(i,j) = ieqhist(pxval)-1;
       end
   end

⌨️ 快捷键说明

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