MATLAB Answers

Re-extract final images after vectorizing a set of images

조회 수: 2(최근 30일)
fadams18
fadams18 9 Mar 2020
I have 20 images each of which is 175 x 200. then i create a matrix X and unfold each image into it. so that X becomes a (175*200, 20 ). I applied Non-negative matrix factorization on this X data. and reconstructed it into a X_hat matrix. Now I would like to extract the individual images back.
m=200;
n=175;
N=20;
X= [];
avg= zeros(m*n,1);
count=0;
for j=1:N
figure(1)
ff=['faces/stallone',num2str(j,'%02d'), '.jpg']; % Load images
u = imread(ff);% read into X
imshow(u)
set(gcf, 'Position',[100 100 500 500])
if (size(u,3)==1)
M= double(u);
else
M= double(rgb2gray(u));
end
pause(0.1);
R= reshape(M,m*n,1); % before (n,m) now (m*n,1)
X= [X,R]; % stack them into X
avg =avg +R;
count=count+1;
end
[ X_hat] = NMF(Q, X_hat,Winit,Hinit); % I applied NMF and obtained X_hat
How do I get the individual 20 images from this X_hat

  댓글 수: 0

로그인 to comment.

답변(0개)

이 질문에 답변하려면 로그인을(를) 수행하십시오.


Translated by