资源简介
用于HDR图像去鬼影
代码片段和文件信息
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(‘\n‘);
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}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2014-11-02 21:06 version_0.1\
文件 6148 2014-11-02 21:06 version_0.1\.DS_Store
目录 0 2014-11-02 21:06 __MACOSX\
目录 0 2014-11-02 21:06 __MACOSX\version_0.1\
文件 120 2014-11-02 21:06 __MACOSX\version_0.1\._.DS_Store
目录 0 2014-11-02 20:16 version_0.1\Data\
目录 0 2014-11-02 20:16 version_0.1\Data\Lady\
文件 8108776 2012-11-21 13:28 version_0.1\Data\Lady\Img1.jpg
目录 0 2014-11-02 21:06 __MACOSX\version_0.1\Data\
目录 0 2014-11-02 21:06 __MACOSX\version_0.1\Data\Lady\
文件 212 2012-11-21 13:28 __MACOSX\version_0.1\Data\Lady\._Img1.jpg
文件 8026285 2012-11-21 13:29 version_0.1\Data\Lady\Img2.jpg
文件 212 2012-11-21 13:29 __MACOSX\version_0.1\Data\Lady\._Img2.jpg
文件 5267062 2012-11-21 13:29 version_0.1\Data\Lady\Img3.jpg
文件 212 2012-11-21 13:29 __MACOSX\version_0.1\Data\Lady\._Img3.jpg
文件 3563 2013-08-05 03:44 version_0.1\main.m
文件 212 2013-08-05 03:44 __MACOSX\version_0.1\._main.m
目录 0 2014-11-02 21:05 version_0.1\patchmatch-2.1\
文件 8196 2014-11-02 21:04 version_0.1\patchmatch-2.1\.DS_Store
目录 0 2014-11-02 21:06 __MACOSX\version_0.1\patchmatch-2.1\
文件 212 2014-11-02 21:04 __MACOSX\version_0.1\patchmatch-2.1\._.DS_Store
文件 1893 2012-08-24 09:15 version_0.1\patchmatch-2.1\allegro_emu.cpp
文件 212 2012-08-24 09:15 __MACOSX\version_0.1\patchmatch-2.1\._allegro_emu.cpp
文件 1185 2012-08-24 16:38 version_0.1\patchmatch-2.1\allegro_emu.h
文件 212 2012-08-24 16:38 __MACOSX\version_0.1\patchmatch-2.1\._allegro_emu.h
文件 1097 2014-11-02 20:54 version_0.1\patchmatch-2.1\build_mac.m
文件 120 2014-11-02 20:54 __MACOSX\version_0.1\patchmatch-2.1\._build_mac.m
文件 1926 2014-11-02 21:05 version_0.1\patchmatch-2.1\build_unix.sh
文件 171 2014-11-02 21:05 __MACOSX\version_0.1\patchmatch-2.1\._build_unix.sh
文件 3051 2012-08-13 13:25 version_0.1\patchmatch-2.1\console_test_desc
文件 212 2012-08-13 13:25 __MACOSX\version_0.1\patchmatch-2.1\._console_test_desc
............此处省略97个文件信息
- 上一篇:数字设计原理与实践(第三版)
- 下一篇:数字电子技术基础第五版教材 闫石.pdf
评论
共有 条评论