Mentions légales du service

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

Using gridded interpolation

parent a93bdb0d
Branches main
No related tags found
No related merge requests found
...@@ -112,10 +112,7 @@ for lab = 1:numLab ...@@ -112,10 +112,7 @@ 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,LFYsub,Xq,Yq] = utils.gridCoords(LFXsub,LFYsub,SRXq,SRYq);
LFXsub = LFXsub(:);
LFYsub = LFYsub(:);
M = isnan(Xq)|isnan(Yq); M = isnan(Xq)|isnan(Yq);
...@@ -125,28 +122,25 @@ for lab = 1:numLab ...@@ -125,28 +122,25 @@ for lab = 1:numLab
% Interpolate color % Interpolate color
for c = 1:numChan for c = 1:numChan
Colsub = Color(mgv{:},c,v); Colsub = Color(mgv{:},c,v);
Colsub = Colsub(:); temp = interp2(LFYsub,LFXsub,Colsub,Yq,Xq,Method);
temp = griddata(LFXsub,LFYsub,Colsub,Xq,Yq,Method);
temp(M) = nan; temp(M) = nan;
SRCol{lab}(:,:,c,v) = temp; SRCol{lab}(:,:,c,v) = temp;
end end
% Interpolate disparity % Interpolate disparity
LFDispsub = LFDisp(mgv{:},v); LFDispsub = LFDisp(mgv{:},v);
LFDispsub = LFDispsub(:); temp = interp2(LFYsub,LFXsub,LFDispsub,Yq,Xq,Method);
temp = griddata(LFXsub,LFYsub,LFDispsub,Xq,Yq,Method);
temp(M) = nan; temp(M) = nan;
SRDisp{lab}(:,:,1,v) = temp; SRDisp{lab}(:,:,1,v) = temp;
% Interpolate label % Interpolate label
Labelsub = Label(mgv{:},v); Labelsub = Label(mgv{:},v);
Labelsub = Labelsub(:); temp = interp2(LFYsub,LFXsub,Labelsub,Yq,Xq,'nearest');
temp = griddata(LFXsub,LFYsub,Labelsub,Xq,Yq,'nearest');
temp(M) = nan; temp(M) = nan;
Lab = temp; 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,Xq,Yq,'cubic')); NaNLab = isnan(interp2(LFYsub,LFXsub,Labelsub,Yq,Xq,'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