# MATLAB代做|FPGA代做-基于matlab从图像中检测人脸部分

### 时间：2020-10-21 21:26:55 点击：

核心提示：MATLAB代做|FPGA代做-基于matlab从图像中检测人脸部分...
function [Sest,d] =OMP(Phi,y,strue,K);

% Othogonal matching pursuit of Tropp et Gilbert
% Find greedy approx of s s.t. phi*s = y
% y : data
% phi : measurement matrix
% K :number of vectors used in the approx (typ. = S or M)
% Written by David Mary
% This script/program is released under the Commons Creative Licence
% with Attribution Non-commercial Share Alike (by-nc-sa)
% Disclaimer: the short answer, this script is for educational purpose only.

Sest=zeros(size(strue));
Pos=[]; % positions indexes of components of s
rtm1=y; % first residual
Phit=[]; % Matrix of the columns used to represent y
t=1; %iteration number
d=0; % error flag
%for t=1:length(Phi(:,1));
for t=1:K;
[i,j]=max(abs(Phi'*rtm1));
Pos=[Pos j];
Phit=[Phit Phi(:,j)];
sest=Phit\y;
rtm1=y-Phit*sest;
Sest(Pos)=sest;
error=norm(abs(Sest-strue),'inf');
if error < 1e-3
d=1;
disp('OMP : success')
break
end
end;
if d==0
disp('OMP : failed')
end

QQ ：1224848052

• 百度搜索
• 查阅资料过程中
• 论坛发现
• 百度贴吧发现
• 朋友介绍
• 没有相关文章
• 大名：
• 内容：