• 大小: 2.05MB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-10-01
  • 语言: 其他
  • 标签: 图像  

资源简介

麻省Hao-Yu Wu视频放大源程序

资源截图

代码片段和文件信息

% amplify_spatial_Gdown_temporal_ideal(vidFile outDir alpha 
%                                      level fl fh samplingRate 
%                                      chromAttenuation)
%
% Spatial Filtering: Gaussian blur and down sample
% Temporal Filtering: Ideal bandpass

% Copyright (c) 2011-2012 Massachusetts Institute of Technology 
% Quanta Research Cambridge Inc.
%
% Authors: Hao-yu Wu Michael Rubinstein Eugene Shih 
% License: Please refer to the LICENCE file
% Date: June 2012
%
function amplify_spatial_Gdown_temporal_ideal(vidFileoutDiralphalevel ...
                     flfhsamplingRate chromAttenuation)
 

    [~vidName] = fileparts(vidFile);

    outName = fullfile(outDir[vidName ‘-ideal-from-‘ num2str(fl) ...
                           ‘-to-‘ num2str(fh) ...
                           ‘-alpha-‘ num2str(alpha) ...
                           ‘-level-‘ num2str(level) ...
                           ‘-chromAtn-‘ num2str(chromAttenuation) ‘.avi‘]);


    % Read video
    vid = VideoReader(vidFile);
    % Extract video info
    vidHeight = vid.Height;
    vidWidth = vid.Width;
    nChannels = 3;
    fr = vid.frameRate;
    len = vid.NumberOfframes;
    temp = struct(‘cdata‘ zeros(vidHeight vidWidth nChannels ‘uint8‘) ‘colormap‘ []);

    startIndex = 1;
    endIndex = len-10;

    vidOut = VideoWriter(outName);
    vidOut.frameRate = fr;

    open(vidOut)


    % compute Gaussian blur stack
    disp(‘Spatial filtering...‘)
    Gdown_stack = build_GDown_stack(vidFile startIndex endIndex level);
    disp(‘Finished‘)
    
    
    % Temporal filtering
    disp(‘Temporal filtering...‘)
    filtered_stack = ideal_bandpassing(Gdown_stack 1 fl fh samplingRate);
    disp(‘Finished‘)
    
    %% amplify
    filtered_stack(:::1) = filtered_stack(:::1) .* alpha;
    filtered_stack(:::2) = filtered_stack(:::2) .* alpha .* chromAttenuation;
    filtered_stack(:::3) = filtered_stack(:::3) .* alpha .* chromAttenuation;



    %% Render on the input video
    disp(‘Rendering...‘)
    % output video
    k = 0;
    for i=startIndex:endIndex
        k = k+1
        temp.cdata = read(vid i);
        [rgbframe~] = frame2im(temp);
        rgbframe = im2double(rgbframe);
        frame = rgb2ntsc(rgbframe);

        filtered = squeeze(filtered_stack(k:::));

        filtered = imresize(filtered[vidHeight vidWidth]);

        filtered = filtered+frame;

        frame = ntsc2rgb(filtered);

        frame(frame > 1) = 1;
        frame(frame < 0) = 0;


        writeVideo(vidOutim2uint8(frame));
    end

    disp(‘Finished‘)
    close(vidOut);

end

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2013-03-04 03:17  EVM_Matlab\
     文件        2633  2013-03-04 03:17  EVM_Matlab\amplify_spatial_Gdown_temporal_ideal.m
     文件        5123  2013-03-04 03:17  EVM_Matlab\amplify_spatial_lpyr_temporal_butter.m
     文件        3808  2013-03-04 03:17  EVM_Matlab\amplify_spatial_lpyr_temporal_ideal.m
     文件        4916  2013-03-04 03:17  EVM_Matlab\amplify_spatial_lpyr_temporal_iir.m
     文件         495  2013-03-04 03:17  EVM_Matlab\blurDnClr.m
     文件         517  2013-03-04 03:17  EVM_Matlab\blurUpClr.m
     文件        1705  2013-03-04 03:17  EVM_Matlab\build_GDown_stack.m
     文件        1804  2013-03-04 03:17  EVM_Matlab\build_Lpyr_stack.m
     文件         105  2013-03-04 03:17  EVM_Matlab\ChangeLog.txt
     文件         730  2013-03-04 03:17  EVM_Matlab\create_mask.m
     文件        1190  2013-03-04 03:17  EVM_Matlab\ideal_bandpassing.m
     文件          62  2013-03-04 03:17  EVM_Matlab\install.m
     文件       17296  2013-03-04 03:17  EVM_Matlab\LICENSE.pdf
     文件         132  2013-03-04 03:17  EVM_Matlab\make.m
     目录           0  2013-03-04 03:17  EVM_Matlab\matlabPyrTools\
     文件         309  2013-03-04 03:17  EVM_Matlab\matlabPyrTools\binomialFilter.m
     文件        1731  2013-03-04 03:17  EVM_Matlab\matlabPyrTools\blur.m
     文件        1364  2013-03-04 03:17  EVM_Matlab\matlabPyrTools\blurDn.m
     文件        1931  2013-03-04 03:17  EVM_Matlab\matlabPyrTools\buildGpyr.m
     文件        2632  2013-03-04 03:17  EVM_Matlab\matlabPyrTools\buildLpyr.m
     文件        2713  2013-03-04 03:17  EVM_Matlab\matlabPyrTools\buildSCFpyr.m
     文件        2187  2013-03-04 03:17  EVM_Matlab\matlabPyrTools\buildSCFpyrLevs.m
     文件        3256  2013-03-04 03:17  EVM_Matlab\matlabPyrTools\buildSFpyr.m
     文件        1891  2013-03-04 03:17  EVM_Matlab\matlabPyrTools\buildSFpyrLevs.m
     文件        2064  2013-03-04 03:17  EVM_Matlab\matlabPyrTools\buildSpyr.m
     文件         861  2013-03-04 03:17  EVM_Matlab\matlabPyrTools\buildSpyrLevs.m
     文件        2644  2013-03-04 03:17  EVM_Matlab\matlabPyrTools\buildWpyr.m
     文件        1325  2013-03-04 03:17  EVM_Matlab\matlabPyrTools\cconv2.m
     文件       16966  2013-03-04 03:17  EVM_Matlab\matlabPyrTools\ChangeLog
     文件         814  2013-03-04 03:17  EVM_Matlab\matlabPyrTools\clip.m
............此处省略255个文件信息

评论

共有 条评论