Mentions légales du service

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

Use order and provided disparities to determine reprojection order

parent 02fb3227
No related branches found
No related tags found
No related merge requests found
...@@ -25,13 +25,19 @@ order = p.Results.order; ...@@ -25,13 +25,19 @@ order = p.Results.order;
relative = p.Results.relative; relative = p.Results.relative;
if isnumeric(dispX) if isnumeric(dispX)
dispX = num2cell(dispX); dispXcell = num2cell(dispX);
relative = true; relative = true;
else
dispXcell = dispX;
dispX = cell2mat(dispX);
end end
if isnumeric(dispY) if isnumeric(dispY)
dispY = num2cell(dispY); dispYcell = num2cell(dispY);
relative = true; relative = true;
else
dispYcell = dispY;
dispY = cell2mat(dispY);
end end
%% Initialize constants %% Initialize constants
...@@ -73,7 +79,13 @@ end ...@@ -73,7 +79,13 @@ end
[LFVal,LFDisp,LFLab,LFBuf] = deal(nan(LFSize)); [LFVal,LFDisp,LFLab,LFBuf] = deal(nan(LFSize));
LFSet = SR.FieldsToSet(LFVal,LFSize,LFPos,LFDisp,LFLab); LFSet = SR.FieldsToSet(LFVal,LFSize,LFPos,LFDisp,LFLab);
disps = [SRDisp{:}]; switch order
case 'ascend'
disps = max([dispX;dispY],[],1);
case 'descend'
disps = min([dispX;dispY],[],1);
end
[~,sortedLab] = sort(disps,order); [~,sortedLab] = sort(disps,order);
%% Build lightfield %% Build lightfield
...@@ -103,8 +115,8 @@ for lab = sortedLab ...@@ -103,8 +115,8 @@ for lab = sortedLab
ygv = reshape(1:SRSize(4),1,1,1,[]); ygv = reshape(1:SRSize(4),1,1,1,[]);
if relative if relative
dispX{lab} = (ugv-uref).*dispX{lab}; dispXcell{lab} = (ugv-uref).*dispXcell{lab};
dispY{lab} = (vgv-vref).*dispY{lab}; dispYcell{lab} = (vgv-vref).*dispYcell{lab};
end end
% Mask corresponding to query points inside super-ray boundary % Mask corresponding to query points inside super-ray boundary
...@@ -153,8 +165,8 @@ for lab = sortedLab ...@@ -153,8 +165,8 @@ for lab = sortedLab
% Perform disparity compensation if necessary % Perform disparity compensation if necessary
if ~dispComp if ~dispComp
SRX = SRX+dispX{lab}; SRX = SRX+dispXcell{lab};
SRY = SRY+dispY{lab}; SRY = SRY+dispYcell{lab};
end end
% Super-ray (query) coordinates (4D) % Super-ray (query) coordinates (4D)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment