资源简介
用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的图像分割含GUI界面
- MATLAB ADOV 路由仿真代码
- turbo码的matlab仿真
- 基于BP神经网络的PID控制器的Matlab仿真
- matlab逻辑回归应用代码十分详细附数
- 各种滤波器程序 matlab
- AOA定位的扩展卡尔曼滤波定位算法M
- 对数极坐标变换matlab程序
- 地震波剖面图的形成matlab
- 倾斜界面求波的反透射系数matlab
- MATLAB课程设计报告
- 混沌logistic的matlab仿真
- L-K光流法matlab实现
- 利用bp神经网络实现0~9数字识别,
- 基于MATLAB的直接序列扩频通信系统误
- 潮流计算之前推回代法的matlab程序
- HHT MATLAB工具箱
- fft-piv矢量估计matlab代码
- 利用Matlab进行车辆检测与车型识别
- 压缩在感知之广义正交匹配追踪法G
- 压缩感知之分段正交匹配追踪法StOM
- 压缩感知之迭代硬阈值法IHT可直接运
- 导电煤质分界面平面的垂直入射的M
- 处理高密度椒盐噪声matlab代码
- matlab 相机标定工具箱
- 数学建模动态规划matlab编程与例题精
- 蚁群算法最短路径通用Matlab程序
- JPEG标准哈夫曼编码无损压缩Matlab
- mfsk调制解调matlab源程序
- 语音信号的双门限的端点检测MATLAB代
评论
共有 条评论