Mentions légales du service

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

Using inverse warping

parent 5e625a45
No related branches found
No related tags found
No related merge requests found
...@@ -112,28 +112,41 @@ for lab = 1:numLab ...@@ -112,28 +112,41 @@ for lab = 1:numLab
LFXsub = LFX(mgv{:},v); LFXsub = LFX(mgv{:},v);
LFYsub = LFY(mgv{:},v); LFYsub = LFY(mgv{:},v);
[Xq,Yq,LFXsub,LFYsub] = utils.gridCoords(LFXsub,LFYsub,SRXq,SRYq);
LFXsub = LFXsub(:); LFXsub = LFXsub(:);
LFYsub = LFYsub(:); LFYsub = LFYsub(:);
M = isnan(Xq)|isnan(Yq);
Xq(M) = 1;
Yq(M) = 1;
% Interpolate color % Interpolate color
for c = 1:numChan for c = 1:numChan
Colsub = Color(mgv{:},c,v); Colsub = Color(mgv{:},c,v);
Colsub = Colsub(:); Colsub = Colsub(:);
SRCol{lab}(:,:,c,v) = griddata(LFXsub,LFYsub,Colsub,SRXq,SRYq,Method); temp = griddata(LFXsub,LFYsub,Colsub,Xq,Yq,Method);
temp(M) = nan;
SRCol{lab}(:,:,c,v) = temp;
end end
% Interpolate disparity % Interpolate disparity
LFDispsub = LFDisp(mgv{:},v); LFDispsub = LFDisp(mgv{:},v);
LFDispsub = LFDispsub(:); LFDispsub = LFDispsub(:);
SRDisp{lab}(:,:,1,v) = griddata(LFXsub,LFYsub,LFDispsub,SRXq,SRYq,Method); temp = griddata(LFXsub,LFYsub,LFDispsub,Xq,Yq,Method);
temp(M) = nan;
SRDisp{lab}(:,:,1,v) = temp;
% Interpolate label % Interpolate label
Labelsub = Label(mgv{:},v); Labelsub = Label(mgv{:},v);
Labelsub = Labelsub(:); Labelsub = Labelsub(:);
Lab = griddata(LFXsub,LFYsub,Labelsub,SRXq,SRYq,'nearest'); temp = griddata(LFXsub,LFYsub,Labelsub,Xq,Yq,'nearest');
temp(M) = nan;
Lab = temp;
% Replace out of boundary values in label using cubic interpolation % Replace out of boundary values in label using cubic interpolation
NaNLab = isnan(griddata(LFXsub,LFYsub,Labelsub,SRXq,SRYq,'cubic')); NaNLab = isnan(griddata(LFXsub,LFYsub,Labelsub,Xq,Yq,'cubic'));
Lab(NaNLab) = nan; Lab(NaNLab) = nan;
SRLab{lab}(:,:,1,v) = Lab; SRLab{lab}(:,:,1,v) = Lab;
end end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment