首页 技术 正文
技术 2022年11月7日
0 收藏 758 点赞 827 浏览 959 个字

PCA需要先求数据的散布矩阵x*x’,再求其特征向量,那么随便一个400*450的图像,就是180000维,矩阵就是180000*180000,matlab无法容纳,那么通常的PCA对图像的降维,比如求eigenface是怎么实现的?难道都是很小的图像?修改举报添加评论 分享 • 邀请回答

 0

matlab中高维数组怎么做PCA?吕祺喜欢思考,爱美好的食物 修改话题经验

 Suppose you store the images as column vectors of length NxN (the 
number of pixels in each image) and that you have M images, you’ll end 
up with a matrix G (N^2 x M) :


CovMat = ——– G G^T 
M – 1

this is what you are trying to find the eigenvalues/eigenvectors for, 
right?

There is a trick widely used when doing PCA on sets of images, it is 
based on the fact that the (M x M) matrix:


lmCovMat = ——– G^T G 
M – 1

has the same non-zero eigenvalues of CovMat. So what you do is to 
compute the eigenvalues and eigenvectors of this low memory covariance 
matrix and then, for the eigenvectors, compute:

E = G lmE

where E is a matrix containing the wanted eigenvectors and lmE is the 
matrix of the eigenvectors compouted from the lmCovMat.

This is implemented already in the OpenCV libraries.

Hope it helps.

 

clear
[x]=load_imgs(‘training’);
x=x(1:100,:);
a1=x*x’;
b=x’*x;
[va,p]=eig(a1/27);
[vb,q]=eig(b/27);
%b/27*vb(:,1)==q(1)*vb(:,1);

相关推荐
python开发_常用的python模块及安装方法
adodb:我们领导推荐的数据库连接组件bsddb3:BerkeleyDB的连接组件Cheetah-1.0:我比较喜欢这个版本的cheeta…
日期:2022-11-24 点赞:878 阅读:8,996
Educational Codeforces Round 11 C. Hard Process 二分
C. Hard Process题目连接:http://www.codeforces.com/contest/660/problem/CDes…
日期:2022-11-24 点赞:807 阅读:5,510
下载Ubuntn 17.04 内核源代码
zengkefu@server1:/usr/src$ uname -aLinux server1 4.10.0-19-generic #21…
日期:2022-11-24 点赞:569 阅读:6,353
可用Active Desktop Calendar V7.86 注册码序列号
可用Active Desktop Calendar V7.86 注册码序列号Name: www.greendown.cn Code: &nb…
日期:2022-11-24 点赞:733 阅读:6,137
Android调用系统相机、自定义相机、处理大图片
Android调用系统相机和自定义相机实例本博文主要是介绍了android上使用相机进行拍照并显示的两种方式,并且由于涉及到要把拍到的照片显…
日期:2022-11-24 点赞:512 阅读:7,770
Struts的使用
一、Struts2的获取  Struts的官方网站为:http://struts.apache.org/  下载完Struts2的jar包,…
日期:2022-11-24 点赞:671 阅读:4,848