HDR Deghosting: How to deal with Saturation


HDR Deghosting: How to deal with Saturation, http://www.cs.duke.edu/~junhu/CVPR2013/
资源截图
代码片段和文件信息
clear;

warning(‘off‘‘all‘);
addpath(‘utils‘);
addpath(‘patchmatch-2.1‘);
patha = ‘Data‘;

firstdir = dir(patha);
for indx = 3:size(firstdir1)

    subpatha = [patha ‘/‘ firstdir(indx).name];    
    subdir   = dir(subpatha);
    
    close all;
    clear im;
 
    count = 0;    
    for inds = 3:length(subdir)
        
        [~~extension] = fileparts(subdir(inds).name);
        extension = upper(extension);
        
        switch extension
            case {‘.PNG‘ ‘.BMP‘ ‘.JPG‘ ‘.TIF‘ ‘.TIFF‘}                

                 count           = count + 1;
                 imgStack{count} = imread([subpatha ‘/‘ subdir(inds).name]);
                 
                 if max(size(imgStack{count})) > 1600
                     ratio           = max(size(imgStack{count}1) ...
                                       size(imgStack{count}2)) / 1600;
                     imgStack{count} = imresize(imgStack{count} 1/ratio);                                      
                 end
                 
                 if isimg(imgStack{count})
                     
                     if isa(imgStack{count} ‘uint16‘)
                         imgStack{count} = uint8( double(imgStack{count}) * 255 / (2^16 - 1));                         
                     elseif isa(imgStack{count} ‘double‘)
                         imgStack{count} = uint8( imgStack{count} * 255);                         
                     end
                     
                 else
                     error(‘Invalid Img Type!‘);
                 end
                 
            otherwise
        end
        
    end
    
    N                  = numel(imgStack);   
    uv                 = cell(N1);
    latentImgs         = cell(N1);
    ppIMFs             = cell(N1);
    invppIMFs          = cell(N1);    
    
    idxRef             = ceil(count/2);    
    latentImgs{idxRef} = imgStack{idxRef};    
    idxPostRef         = idxRef + 1;
    idxPreRef          = idxRef - 1;
    keepRun            = true;
    
    tic;        
    
    while keepRun

        if idxPreRef >= 1
            idxRef = idxPreRef + 1;
            idxSrc = idxPreRef;
            
            fprintf(1 ‘Processing img %d and img %d : Finish 0/6‘ idxRef idxSrc);
            
            tempSrc   = imgStack{idxSrc};
            tempRef   = latentImgs{idxRef};
            [uv{idxSrc} latentImgs{idxSrc} ppIMFs{idxSrc} invppIMFs{idxSrc}] ...
                      = computemultiscale(tempSrctempRef);            
            idxPreRef = idxPreRef - 1;
        end           
        
        fprintf(‘
‘);
        
        if idxPostRef <= N
            idxRef = idxPostRef - 1;
            idxSrc = idxPostRef;
            
            fprintf(1 ‘Processing img %d and img %d : Finish 0/6‘ idxRef idxSrc);            
            
            tempSrc    = imgStack{idxSrc};
            tempRef    = latentImgs{idxRef};            
            [uv{idxSrc} latentImgs{idxSrc} ppIMFs{idxSrc}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     文件        2115  2012-11-13 16:11  version_0.0patchmatch-2.1CVSEntries
     文件          52  2012-11-04 20:55  version_0.0patchmatch-2.1CVSRoot
     文件          38  2012-11-04 20:55  version_0.0patchmatch-2.1CVSRepository
     文件     8108776  2012-11-21 21:28  version_0.0DataLadyImg1.jpg
     文件     8026285  2012-11-21 21:29  version_0.0DataLadyImg2.jpg
     文件     5267062  2012-11-21 21:29  version_0.0DataLadyImg3.jpg
     文件        5012  2013-08-05 09:25  version_0.0utilscomputemultiscale.m
     文件        2828  2013-08-05 09:32  version_0.0utilscomputeimfhist.m
     文件        1940  2013-08-05 09:26  version_0.0utilscomputepyramid.m
     文件        1106  2013-08-05 09:28  version_0.0utils ransfercolor.m
     文件        9821  2013-08-05 09:31  version_0.0utilscomputeimfIRLS.m
     文件        1004  2013-08-05 09:28  version_0.0utilssolvescreenedpossion.m
     文件         983  2013-08-04 21:56  version_0.0utilsimshowstack.m
     文件          85  2013-08-04 21:56  version_0.0utilsisequalsize.m
     文件        1535  2013-08-05 09:32  version_0.0utilscomputehisteqnnf.m
     文件        4266  2013-08-05 06:07  version_0.0utilscomputesinglescale.m
     文件         292  2013-08-05 07:02  version_0.0utilsisimg.m
     文件        1698  2012-11-10 19:26  version_0.0patchmatch-2.1patchdist.cpp
     文件        1447  2012-11-10 19:32  version_0.0patchmatch-2.1patchdist.m
     文件        1561  2012-11-10 19:46  version_0.0patchmatch-2.1uild_unix.sh
     文件       15364  2012-08-13 19:25  version_0.0patchmatch-2.1.DS_Store
     文件        1893  2012-08-24 15:15  version_0.0patchmatch-2.1allegro_emu.cpp
     文件        1185  2012-08-24 22:38  version_0.0patchmatch-2.1allegro_emu.h
     文件         782  2012-08-13 19:25  version_0.0patchmatch-2.1uild_mac.m
     文件         824  2012-08-13 19:25  version_0.0patchmatch-2.1uild_windows.bat
     文件        3051  2012-08-13 19:25  version_0.0patchmatch-2.1console_test_descriptor_mex.m
     文件         929  2012-08-13 19:25  version_0.0patchmatch-2.1console_test_knn.m
     文件        2817  2012-08-13 19:25  version_0.0patchmatch-2.1console_test_mex.m
     文件         411  2012-08-13 19:25  version_0.0patchmatch-2.1console_test_rot_scale.m
     文件      247429  2012-08-24 22:38  version_0.0patchmatch-2.1knn.cpp
     文件        6307  2012-08-24 22:38  version_0.0patchmatch-2.1knn.h
............此处省略34个文件信息

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件举报,一经查实,本站将立刻删除。

发表评论

评论列表(条)