资源简介
用MATLAB写的高斯混合模型代码,实现背景减除,应用于连续图像序列

代码片段和文件信息
function demo1
%
% Encoding and retrieval of motion in a latent space of reduced dimensionality.
% This source code is the implementation of the algorithms described in
% Section 2.7.1 p.55 of the book “Robot Programming by Demonstration: A
% Probabilistic Approach“.
%
% Author: Sylvain Calinon 2009
% http://programming-by-demonstration.org
%
% This program loads a dataset finds a latent space of lower dimensionality
% encapsulating the important characteristics of thge motion using
% Principal Component Analysis (PCA) trains a Gaussian Mixture Model (GMM)
% using the data projected in this latent space re-projects the Gaussian
% in the original data space and plots the result. Training a GMM with
% EM algorithm usually fails to find a good local optimum when data are
% high-dimensional. By projecting the original dataset in a latent space
% as a pre-processing step GMM training can be performed in a robust way
% and the Gaussian parameters can be projected back to the orginal data
% space.
%
% This source code is given for free! However I would be grateful if you refer
% to the book (or corresponding article) in any academic publication that uses
% this code or part of it. Here are the corresponding BibTex references:
%
% @book{Calinon09book
% author=“S. Calinon“
% title=“Robot Programming by Demonstration: A Probabilistic Approach“
% publisher=“EPFL/CRC Press“
% year=“2009“
% note=“EPFL Press ISBN 978-2-940222-31-5 CRC Press ISBN 978-1-4398-0867-2“
% }
%
% @article{Calinon07
% title=“On Learning Representing and Generalizing a Task in a Humanoid Robot“
% author=“S. Calinon and F. Guenter and A. Billard“
% journal=“IEEE Transactions on Systems Man and Cybernetics Part B“
% year=“2007“
% volume=“37“
% number=“2“
% pages=“286--298“
% }
%% Definition of the number of components used in GMM and the number of
%% principal components.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
nbStates = 3;
nbPC = 2;
%% Load a dataset consisting of 3 demonstrations of a 4D signal
%% (3D spatial components + 1D temporal component).
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
load(‘data/data.mat‘);
[nbVarnbData] = size(Data);
%% Projection of the data in a latent space using PCA.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%Re-center the data
Data_mean = repmat(mean(Data(2:end:)2) 1 nbData);
centeredData = Data(2:end:) - Data_mean;
%Extract the eigencomponents of the covariance matrix
[Ev] = eig(cov(centeredData‘));
E = fliplr(E);
%Compute the transformation matrix by keeping the first nbPC eigenvectors
A = E(:1:nbPC);
%Project the data in the latent space
nbVar2 = nbPC+1;
Data2(1:) = Data(1:);
Data2(2:nbVar2:) = A‘ * centeredData;
%% Training of GMM by EM algorithm initialized by k-means clustering.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2009-04-03 15:32 GMM-latentSpace-v2.0\
目录 0 2009-04-03 15:32 GMM-latentSpace-v2.0\data\
文件 7984 2006-09-17 04:06 GMM-latentSpace-v2.0\data\data.mat
文件 102820 2008-10-15 05:59 GMM-latentSpace-v2.0\data\GMM-latentSpace-graph01.eps
文件 4806 2009-07-22 13:54 GMM-latentSpace-v2.0\demo1.m
文件 5553 2009-07-22 13:29 GMM-latentSpace-v2.0\EM.m
文件 1645 2009-07-22 13:25 GMM-latentSpace-v2.0\EM_init_kmeans.m
文件 958 2009-07-22 13:25 GMM-latentSpace-v2.0\gaussPDF.m
文件 1985 2009-07-22 13:35 GMM-latentSpace-v2.0\plotGMM.m
相关资源
- 阵列天线的matlab仿真
- MATLAB 经典程序源代码大全
- MATLAB小波软阈值去噪代码33473
- 天线阵的波束形成在MATLAB仿真程序及
- 非线性SVM算法-matlab实现
- 《MATLAB 智能算法超级学习手册》-程序
- 组合导航matlab程序
- 读取txt文件内容matlab代码实现
- Matlab实现基于相关的模板匹配程序
- matlab优化工具箱讲解
- 基于MATLAB的快速傅里叶变换
- 光纤传输中的分布傅立叶算法matlab实
- 基于matlab的图像处理源程序
- matlab 椭圆拟合程序
- 算术编码解码matlab源代码
- optical_flow 光流法 matlab 实现程序
- 引导图像滤波器 Matlab实现
- 分形几何中一些经典图形的Matlab画法
- OFDM系统MATLAB仿真代码
- SVM工具箱(matlab中运行)
- 图像小波变换MatLab源代码
- LU分解的MATLAB实现
- 冈萨雷斯数字图像处理matlab版(第三
- 替代数据法的matlab程序
- 用matlab实现的多站定位系统性能仿真
- 通过不同方法进行粗糙集属性约简m
- k近邻算法matlab实现
- matlab识别系统
- 神经网络分类matlab程序
- matlab正弦信号发生器的设计
评论
共有 条评论