Mentions légales du service

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

Use order and provided disparities to determine reprojection order

parent d8c39e9f
Branches
No related tags found
No related merge requests found
......@@ -25,13 +25,19 @@ order = p.Results.order;
relative = p.Results.relative;
if isnumeric(dispX)
dispX = num2cell(dispX);
dispXcell = num2cell(dispX);
relative = true;
else
dispXcell = dispX;
dispX = cell2mat(dispX);
end
if isnumeric(dispY)
dispY = num2cell(dispY);
dispYcell = num2cell(dispY);
relative = true;
else
dispYcell = dispY;
dispY = cell2mat(dispY);
end
%% Initialize constants
......@@ -73,7 +79,13 @@ end
[LFVal,LFDisp,LFLab,LFBuf] = deal(nan(LFSize));
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);
%% Build lightfield
......@@ -103,8 +115,8 @@ for lab = sortedLab
ygv = reshape(1:SRSize(4),1,1,1,[]);
if relative
dispX{lab} = (ugv-uref).*dispX{lab};
dispY{lab} = (vgv-vref).*dispY{lab};
dispXcell{lab} = (ugv-uref).*dispXcell{lab};
dispYcell{lab} = (vgv-vref).*dispYcell{lab};
end
% Mask corresponding to query points inside super-ray boundary
......@@ -153,8 +165,8 @@ for lab = sortedLab
% Perform disparity compensation if necessary
if ~dispComp
SRX = SRX+dispX{lab};
SRY = SRY+dispY{lab};
SRX = SRX+dispXcell{lab};
SRY = SRY+dispYcell{lab};
end
% 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