资源简介
用MATLAB将低分辨率处理成高分辨率,实现放大功能。
代码片段和文件信息
function [SupResol] = SuperresCode(Low MFactor ColorProcMethod Model)
if nargin < 4
load MatlabR2007aSupResModel.mat;
end
if nargin < 3
ColorProcMethod = ‘L‘;
end
BoundarySize = 9;
warning off;
BiC = imresize(LowMFactor ‘bicubic‘);
warning on;
BiC = padarray(BiC [BoundarySizeBoundarySize] ‘symmetric‘‘both‘);
[SupResol] = SuperresMexInt(BiC MFactor ColorProcMethod Model);
SupResol = SupResol(BoundarySize+1:end-BoundarySizeBoundarySize+1:end-BoundarySize:);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function [SupResol] = SuperresMexInt(BiC MFactor ColorProcMethod Model)
[IHeightIWidthColorDim] = size(BiC);
if ColorDim > 1 %%% if color
if ColorProcMethod == ‘C‘
%%% proc. each RGB channel independently
RBiC = BiC(::1);
GBiC = BiC(::2);
BBiC = BiC(::3);
SupResol = zeros(size(BiC));
[SupResol(::1)] = SuperresMexInt(RBiC MFactor ColorProcMethod Model);
[SupResol(::2)] = SuperresMexInt(GBiC MFactor ColorProcMethod Model);
[SupResol(::3)] = SuperresMexInt(BBiC MFactor ColorProcMethod Model);
%%% proc. each RGB channel independently
else
%%% proc. luminance component only
CBiC = double(BiC)/255;
YIQ = rgb2ntsc(CBiC);
Lum = YIQ(::1);
[SupResolLum] = SuperresMexInt(Lum*255 MFactor ColorProcMethod Model);
YIQ(::1) = SupResolLum/255;
SupResol = ntsc2rgb(YIQ);
SupResol = SupResol*255;
%%% proc. luminance component only
end
else
BiC = double(BiC)/255*2-1;
if MFactor == 2
[SupResol] = SuperresCodeMex(BiC Model.M2 MFactor);
elseif MFactor == 3
[SupResol] = SuperresCodeMex(BiC Model.M3 MFactor);
elseif MFactor == 4
[SupResol] = SuperresCodeMex(BiC Model.M4 MFactor);
else
display(‘Mag. factor should be [234].‘);
return;
end
SupResol = (SupResol+1)/2*255;
end
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2014-03-10 16:47 高分辨处理\
文件 63570 2014-03-08 23:33 高分辨处理\2 (6).jpg
文件 40054 2008-04-30 15:50 高分辨处理\Butterfly.bmp
文件 1628311 2008-06-22 14:53 高分辨处理\MatlabR2007aSupResModel.mat
文件 2110 2008-06-22 17:47 高分辨处理\SuperresCode.m
文件 26271 2008-07-02 20:28 高分辨处理\SuperresCodeMex.mexa64
文件 26648 2008-07-02 20:28 高分辨处理\SuperresCodeMex.mexglx
文件 28672 2008-07-02 20:28 高分辨处理\SuperresCodeMex.mexw32
文件 433 2014-03-10 16:35 高分辨处理\Test.m
文件 185 2008-06-22 06:41 高分辨处理\Usage.txt
评论
共有 条评论