Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 14d0660f authored by DIB Elian's avatar DIB Elian
Browse files

Updated factorization

parent 1e177ded
No related branches found
No related tags found
No related merge requests found
function [LFB,C,U,S,V] = factorize(LFRef,varargin) function [LFB,C,U,S,V] = factorize(LFRef,k,varargin)
%FACTORIZE Summary of this function goes here %FACTORIZE Summary of this function goes here
% Detailed explanation goes here % Detailed explanation goes here
sz = size(LFRef); LFSize = size(LFRef);
Mask = isnan(LFRef); LFRef(Mask) = 0; ImgSize = LFSize(1:3);
vecResh = @(x) reshape(x,size(x,1)*size(x,2),[])'; ImgRes = LFSize(4:end);
boxResh = @(x,sz) reshape(x',sz);
LFRefvec = vecResh(LFRef); LFRef = reshape(LFRef,prod(ImgSize),prod(ImgRes));
Maskvec = vecResh(Mask);
kList = 1:size(LFRefvec,2); [LFB,C,U,S,V] = utils.factorize(LFRef,k);
if nargin>1
kList = varargin{1};
end
[U,S,V] = svd_nsq(LFRefvec); LFB = reshape(LFB ,[ImgSize,k,1]);
B = U*S;
C = V';
B(Maskvec) = NaN;
B = B(:,kList);
C = C(kList,:);
LFB = boxResh(B,[numel(kList),1,sz(3:end)]);
end end
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment