【视频去噪】基于SALT实现视频去噪附Matlab代码

简介: 【视频去噪】基于SALT实现视频去噪附Matlab代码

1 简介

Recent works on adaptive sparse and low-rank signal modeling have demonstrated their usefulness, especially in image/video processing applications. While a patch-based sparse model imposes local structure, low-rankness of the grouped patches exploits non-local correlation. Applying either approach alone usually limits performance in various low-level vision tasks. In this work, we propose a novel video denoising method, based on an online tensor reconstruction scheme with a joint adaptive sparse and low-rank model, dubbed SALT. An efficient and unsupervised online unitary sparsifying transform learning method is introduced to impose adaptive sparsity on the fly. We develop an efficient 3D spatio-temporal data reconstruction framework based on the proposed online learning method, which exhibits low latency and can potentially handle streaming videos. To the best of our knowledge, this is the first work that combines adaptive sparsity and low-rankness for video denoising, and the first work of solving the proposed problem in an online fashion. We demonstrate video denoising results over commonly used videos from public datasets. Numerical experiments show that the proposed video denoising method outperforms competing methods.

2 部分代码

function [Xr, outputParam] = SALT_videodenoising(data, param)%Function for denoising the gray-scale video using SALT denoising%algorithm.%%Note that all input parameters need to be set prior to simulation. We%provide some example settings using function SALT_videodenoise_param.%However, the user is advised to carefully choose optimal values for the%parameters depending on the specific data or task at hand.%% The SALT_videodenoising algorithm denoises an gray-scale video based% on joint Sparse And Low-rank Tensor Reconstruction (SALT) method. % Detailed discussion can be found in%% (1) "Joint Adaptive Sparsity and Low-Rankness on the Fly:%      An Online Tensor Reconstruction Scheme for Video Denoising",% written by B. Wen, Y. Li, L, Pfister, and Y Bresler, in Proc. IEEE% International Conference on Computer Vision (ICCV), Oct. 2017.%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Inputs -%       1. data : Video data / path. The fields are as follows -%                   - noisy: a*b*numFrame size gray-scale tensor for denoising%                   - oracle: path to the oracle video (for%                   PSNR calculation)%%       2. param: Structure that contains the parameters of the%       VIDOSAT_videodenoising algorithm. The various fields are as follows%       -%                   - sig: Standard deviation of the additive Gaussian%                   noise (Example: 20)%                   - onlineBMflag : set to true, if online VIDOSAT%                   precleaning is used.% Outputs -%       1. Xr - Image reconstructed with SALT_videodenoising algorithm.%       2. outputParam: Structure that contains the parameters of the%       algorithm output for analysis as follows%       -%                   - PSNR: PSNR of Xr, if the oracle is provided%                   - timeOut:   run time of the denoising algorithm%                   - framePSNR: per-frame PSNR values%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% parameter & initialization %%%%%%%%%%%%%%% (0) Load parameters and dataparam = SALT_videodenoise_param(param);noisy = data.noisy;                                 % noisy% (1-1) Enlarge the frame[noisy, param] = module_videoEnlarge(noisy, param);if param.onlineBMflag    data.ref = module_videoEnlarge(data.ref, param);  end[aa, bb, numFrame] = size(noisy);               % height / width / depth% (1-2) parametersdim                         =   param.dim;          % patch length, i.e., 8n3D                         =   param.n3D;          % TL tensor sizetempSearchRange             =   param.tempSearchRange;startChangeFrameNo          =   tempSearchRange + 1;   endChangeFrameNo            =   numFrame - tempSearchRange;  blkSize                     =   [dim, dim];  slidingDis                  =   param.strideTemporal;numFrameBuffer              =   tempSearchRange * 2 + 1;param.numFrameBuffer        =   numFrameBuffer;nFrame                      =   param.nFrame;% (1-3) 2D indexidxMat                      =   zeros([aa, bb] - blkSize + 1);idxMat([[1:slidingDis:end-1],end],[[1:slidingDis:end-1],end]) = 1;[indMatA, indMatB]          =   size(idxMat);param.numPatchPerFrame      =   indMatA * indMatB;% (1-4) buffer and output initializationIMout               =   zeros(aa, bb, numFrame);Weight              =   zeros(aa, bb, numFrame);buffer.YXT          =   zeros(n3D, n3D);buffer.D            =   kron(kron(dctmtx(dim), dctmtx(dim)), dctmtx(nFrame));%%%%%%%%%%%%%%% (2) Main Program - video streaming %%%%%%%%%%%%%tic;for frame = 1 : numFrame    display(frame);    % (0) select G_t    if frame < startChangeFrameNo        curFrameRange   =   1 : numFrameBuffer;        centerRefFrame  =   frame;    elseif frame > endChangeFrameNo        curFrameRange   =   numFrame - numFrameBuffer + 1 : numFrame;        centerRefFrame  =   frame - (numFrame - numFrameBuffer);    else        curFrameRange   =   frame - tempSearchRange : frame + tempSearchRange;        centerRefFrame  =   startChangeFrameNo;    end    % (1) Input buffer    tempBatch       =   noisy(:, :, curFrameRange);         extractPatch    =   module_video2patch(tempBatch, param);  % patch extraction    % (2) KNN << Block Matching (BM) >>% Options: Online / Offline BM    if param.onlineBMflag    % (2-1) online BM using pre-cleaned data        tempRef         =   data.ref(:, :, curFrameRange);        refPatch        =   module_video2patch(tempRef, param);        [blk_arr, ~, blk_pSize] = ...            module_videoBM_fix(refPatch, param, centerRefFrame);    else        % (2-2) using offline BM result        blk_arr         =   data.BMresult(:, :, frame);        blk_pSize       =   data.BMsize(:, :, frame);    end    % (3) Denoising current G_t using LR approximation    [denoisedPatch_LR, weights_LR] = ...        module_vLRapprox(extractPatch, blk_arr, blk_pSize, param);     % (4) Denoising current G_t using Online TL    [denoisedPatch_TL, frameWeights_TL, buffer] = ...        module_TLapprox(extractPatch, buffer, blk_arr, param);    % (5) fusion of the LR + TL + noisy here    denoisedPatch = denoisedPatch_LR + denoisedPatch_TL + extractPatch * param.noisyWeight;    weights = weights_LR + frameWeights_TL + param.noisyWeight;        % (6) Aggregation    [tempBatch, tempWeight]  =    ...        module_vblockAggreagtion(denoisedPatch, weights, param);    % (7) update reconstruction    IMout(:, :, curFrameRange) = IMout(:, :, curFrameRange) + tempBatch;    Weight(:, :, curFrameRange) = Weight(:, :, curFrameRange) + tempWeight;endoutputParam.timeOut = toc;% (3) Normalization and OutputXr = module_videoCrop(IMout, param) ./ module_videoCrop(Weight, param);outputParam.PSNR = PSNR3D(Xr - double(data.oracle));framePSNR = zeros(1, numFrame);for i = 1 : numFrame    framePSNR(1, i) = PSNR(Xr(:,:,i) - double(data.oracle(:,:,i)));endoutputParam.framePSNR = framePSNR;end

3 仿真结果

4 参考文献

[1] Wen B ,  Li Y ,  Pfister L , et al. Joint Adaptive Sparsity and Low-Rankness on the Fly: An Online Tensor Reconstruction Scheme for Video Denoising[C]// 2017 IEEE International Conference on Computer Vision (ICCV). IEEE, 2017.

博主简介:擅长智能优化算法、神经网络预测、信号处理、元胞自动机、图像处理、路径规划、无人机等多种领域的Matlab仿真,相关matlab代码问题可私信交流。

部分理论引用网络文献,若有侵权联系博主删除。


相关文章
|
3月前
|
安全
【2023高教社杯】D题 圈养湖羊的空间利用率 问题分析、数学模型及MATLAB代码
本文介绍了2023年高教社杯数学建模竞赛D题的圈养湖羊空间利用率问题,包括问题分析、数学模型建立和MATLAB代码实现,旨在优化养殖场的生产计划和空间利用效率。
191 6
【2023高教社杯】D题 圈养湖羊的空间利用率 问题分析、数学模型及MATLAB代码
|
3月前
|
存储 算法 搜索推荐
【2022年华为杯数学建模】B题 方形件组批优化问题 方案及MATLAB代码实现
本文提供了2022年华为杯数学建模竞赛B题的详细方案和MATLAB代码实现,包括方形件组批优化问题和排样优化问题,以及相关数学模型的建立和求解方法。
124 3
【2022年华为杯数学建模】B题 方形件组批优化问题 方案及MATLAB代码实现
|
3月前
|
机器学习/深度学习 监控 算法
基于深度学习网络的人员行为视频检测系统matlab仿真,带GUI界面
本仿真展示了基于GoogLeNet的人员行为检测系统在Matlab 2022a上的实现效果,无水印。GoogLeNet采用创新的Inception模块,高效地提取视频中人员行为特征并进行分类。核心程序循环读取视频帧,每十帧执行一次分类,最终输出最频繁的行为类别如“乐队”、“乒乓球”等。此技术适用于智能监控等多个领域。
69 4
|
3月前
|
数据采集 存储 移动开发
【2023五一杯数学建模】 B题 快递需求分析问题 建模方案及MATLAB实现代码
本文介绍了2023年五一杯数学建模竞赛B题的解题方法,详细阐述了如何通过数学建模和MATLAB编程来分析快递需求、预测运输数量、优化运输成本,并估计固定和非固定需求,提供了完整的建模方案和代码实现。
88 0
【2023五一杯数学建模】 B题 快递需求分析问题 建模方案及MATLAB实现代码
|
5月前
|
机器学习/深度学习 算法 计算机视觉
基于深度学习网络的USB摄像头实时视频采集与人脸检测matlab仿真
**摘要 (Markdown格式):** ```markdown - 📹 使用USB摄像头(Tttttttttttttt666)实时视频检测,展示基于YOLOv2在MATLAB2022a的实施效果: ``` Tttttttttttttt1111111111------------5555555555 ``` - 📺 程序核心利用MATLAB视频采集配置及工具箱(Dddddddddddddd),实现图像采集与人脸定位。 - 🧠 YOLOv2算法概览:通过S×S网格预测边界框(B个/网格),含坐标、类别概率和置信度,高效检测人脸。
|
4月前
|
机器学习/深度学习 算法 BI
基于深度学习网络的USB摄像头实时视频采集与手势检测识别matlab仿真
**摘要:** 本文介绍了使用MATLAB2022a实现的基于GoogLeNet的USB摄像头手势识别系统。系统通过摄像头捕获视频,利用深度学习的卷积神经网络进行手势检测与识别。GoogLeNet网络的Inception模块优化了计算效率,避免过拟合。手势检测涉及RPN生成候选框,送入网络进行分类。系统架构包括视频采集、手势检测与识别、以及决策反馈。通过GPU加速和模型优化保证实时性能,应用于智能家居等场景。
|
6月前
|
算法 计算机视觉
基于高斯混合模型的视频背景提取和人员跟踪算法matlab仿真
该内容是关于使用MATLAB2013B实现基于高斯混合模型(GMM)的视频背景提取和人员跟踪算法。算法通过GMM建立背景模型,新帧与模型比较,提取前景并进行人员跟踪。文章附有程序代码示例,展示从读取视频到结果显示的流程。最后,结果保存在Result.mat文件中。
|
6月前
|
数据安全/隐私保护
耐震时程曲线,matlab代码,自定义反应谱与地震波,优化源代码,地震波耐震时程曲线
地震波格式转换、时程转换、峰值调整、规范反应谱、计算反应谱、计算持时、生成人工波、时频域转换、数据滤波、基线校正、Arias截波、傅里叶变换、耐震时程曲线、脉冲波合成与提取、三联反应谱、地震动参数、延性反应谱、地震波缩尺、功率谱密度
基于混合整数规划的微网储能电池容量规划(matlab代码)
基于混合整数规划的微网储能电池容量规划(matlab代码)
|
6月前
|
数据安全/隐私保护
地震波功率谱密度函数、功率谱密度曲线,反应谱转功率谱,matlab代码
地震波格式转换、时程转换、峰值调整、规范反应谱、计算反应谱、计算持时、生成人工波、时频域转换、数据滤波、基线校正、Arias截波、傅里叶变换、耐震时程曲线、脉冲波合成与提取、三联反应谱、地震动参数、延性反应谱、地震波缩尺、功率谱密度

热门文章

最新文章