• 大小: 3.52MB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2023-11-11
  • 语言: Matlab
  • 标签: Retinex  图像增强  

资源简介

Retinex in matlab,用Retinex算法实现图像增强、HDR图像压缩等

资源截图

代码片段和文件信息

function Retinex = retinex_frankle_mccann(L nIterations)

% RETINEX_FRANKLE_McCANN: 
%         Computes the raw Retinex output from an intensity image based on the
%         original model described in:
%         Frankle J. and McCann J. “Method and Apparatus for Lightness Imaging“
%         US Patent #4384336 May 17 1983
%
% INPUT:  L           - logarithmic single-channel intensity image to be processed
%         nIterations - number of Retinex iterations
%
% OUTPUT: Retinex     - raw Retinex output
%
% NOTES:  - The input image is assumed to be logarithmic and in the range [0..1]
%         - To obtain the retinex “sensation“ prediction a look-up-table needs to
%         be applied to the raw retinex output
%         - For colour images apply the algorithm individually for each channel
%
% AUTHORS: Florian Ciurea Brian Funt and John McCann. 
%          Code developed at Simon Fraser University.
%
% For information about the code see: Brian Funt Florian Ciurea and John McCann
% “Retinex in Matlab“ by Proceedings of the IS&T/SID Eighth Color Imaging 
% Conference: Color Science Systems and Applications 2000 pp 112-121.
%
% paper available online at http://www.cs.sfu.ca/~colour/publications/IST-2000/
%
% Copyright 2000. Permission granted to use and copy the code for research and 
% educational purposes only.  Sale of the code is not permitted. The code may be 
% redistributed so long as the original source and authors are cited.

global RR IP OP NP Maximum
RR = L;
Maximum = max(L(:));                                 % maximum color value in the image
[nrows ncols] = size(L);

shift = 2^(fix(log2(min(nrows ncols)))-1);          % initial shift
OP = Maximum*ones(nrows ncols);                     % initialize Old Product

while (abs(shift) >= 1)
   for i = 1:nIterations
      CompareWith(0 shift);                         % horizontal step
      CompareWith(shift 0);                         % vertical step
   end
   shift = -shift/2;                                 % update the shift
end
Retinex = NP;

function CompareWith(s_row s_col)
global RR IP OP NP Maximum
IP = OP;
if (s_row + s_col > 0)
   IP((s_row+1):end (s_col+1):end) = OP(1:(end-s_row) 1:(end-s_col)) + ...
   RR((s_row+1):end (s_col+1):end) - RR(1:(end-s_row) 1:(end-s_col));
else
   IP(1:(end+s_row) 1:(end+s_col)) = OP((1-s_row):end (1-s_col):end) + ...
   RR(1:(end+s_row)1:(end+s_col)) - RR((1-s_row):end (1-s_col):end);
end
IP(IP > Maximum) = Maximum;                          % The Reset operation
NP = (IP + OP)/2;                                    % average with the previous Old Product
OP = NP;                                             % get ready for the next comparison

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件    3625304  2010-01-12 17:44  00Retinex in matlab\00Retinex in matlab.pdf

     文件     786612  2009-08-25 16:44  00Retinex in matlab\fig2.tiff

     文件     180122  2009-08-25 16:44  00Retinex in matlab\fig2_FRANKLE_4.tiff

     文件     153018  2009-08-25 16:44  00Retinex in matlab\fig2_McCANN99_4.tiff

     文件     793798  2009-08-25 16:45  00Retinex in matlab\fig3.tiff

     文件     103674  2009-08-25 16:45  00Retinex in matlab\fig3_McCANN99_4.tiff

     文件     787654  2009-08-25 16:46  00Retinex in matlab\fig5.tiff

     文件     792540  2009-08-25 16:47  00Retinex in matlab\fig5_FRANKLE_4.tiff

     文件     793118  2009-08-25 16:46  00Retinex in matlab\fig5_McCANN99_4.tiff

     文件       2775  2009-08-25 16:43  00Retinex in matlab\retinex_frankle_mccann.m

     文件       5392  2009-08-25 16:43  00Retinex in matlab\retinex_mccann99.m

     目录          0  2013-01-21 15:47  00Retinex in matlab

----------- ---------  ---------- -----  ----

              8024007                    12


评论

共有 条评论