%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% This is a sample code for testing the algorithm in our paper
% ''Fast Alternating Linearization Methods for
% Minimizing the Sum of Two Convex Functions'', Donald Goldfarb,
% Shiqian Ma and Katya Scheinberg, Tech. Report, Columbia University,
% 2009 - 2010. Preprint available at:
% http://arxiv.org/pdf/0912.4571v2.pdf
%
% Author: Shiqian Ma
% Date : Apr. 20, 2010
% IEOR, Columbia University, Copyright (2010)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% get data
tic;
dataformat = 'surveillance-video-Hall';
opts = getdata(dataformat);
time_getdata = toc;
fprintf('%f seconds to get data ! \n', time_getdata);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%% Call ALM to solve the problem
tic; out_ALM = ALM_SADAL_smoothed(opts.D,opts); time_ALM = toc;
fprintf('*******************************************************************\n');
%%%%%%%%% print stats %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
fprintf('*******************************************************************\n');
fprintf('ALM : iter: %d, StopCrit: %3.2e, time: %f\n', ...
out_ALM.iter, out_ALM.StopCrit, time_ALM);
% plot the images
D = opts.D; X = out_ALM.X; Y = out_ALM.Y;
imn1 = 144; imn2 = 176; ind1 = 30; ind2 = 96; ind3 = 159;
subplot(3,3,1); imshow(reshape(D(:,ind1),imn1,imn2),[]); axis off; title('Video')
subplot(3,3,2); imshow(reshape(X(:,ind1),imn1,imn2),[]); axis off; title('Background')
subplot(3,3,3); imshow((reshape(Y(:,ind1),imn1,imn2)),[]); axis off; title('Foreground')
subplot(3,3,4); imshow(reshape(D(:,ind2),imn1,imn2),[]); axis off;
subplot(3,3,5); imshow(reshape(X(:,ind2),imn1,imn2),[]); axis off;
subplot(3,3,6); imshow((reshape(Y(:,ind2),imn1,imn2)),[]); axis off;
subplot(3,3,7); imshow(reshape(D(:,ind3),imn1,imn2),[]); axis off;
subplot(3,3,8); imshow(reshape(X(:,ind3),imn1,imn2),[]); axis off;
subplot(3,3,9); imshow((reshape(Y(:,ind3),imn1,imn2)),[]); axis off;
MATLAB数据处理模型代码 基于RPCA异常值检测代码.zip
需积分: 5 81 浏览量
2023-08-08
20:23:03
上传
评论 1
收藏 10.32MB ZIP 举报
Java徐师兄
- 粉丝: 1041
- 资源: 1981
最新资源
- 基于ATLAB + Psychtoolbox 心理学实验,情绪词汇效价判断
- 美赛数学建模算法-使用Matlab实现神经网络NeuralNetwork-包括BP+LVQ-国赛-题解.zip
- hb-mapper-makertbin.log
- dfcf_silence_upgrade_cfw_10.15.3_20240318163518_64.apk
- 美赛数学建模算法-使用Matlab实现多元分析MultivariteAnalysis-包括聚类分析+主成分分析-国赛-题解
- 构成学1.psd
- 美赛数学建模算法-使用Matlab实现线性规划LinearProgramming-国赛-题解.zip
- npp-7.2.2-Installer-语言修改器
- FY4B AGRI先进的静止轨道辐射成像仪波段响应函数
- 学习Demo影视推荐、音乐播放、地图
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈