diff options
Diffstat (limited to 'macros/checkSCE.sci')
-rw-r--r-- | macros/checkSCE.sci | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/macros/checkSCE.sci b/macros/checkSCE.sci new file mode 100644 index 0000000..eea8fc9 --- /dev/null +++ b/macros/checkSCE.sci @@ -0,0 +1,29 @@ +function checkSCE(varargin) + stErrors = varargin(1) + + if ~isfield(stErrors,'Camera1IntrinsicsErrors' ) | ~isfield(stErrors,'Camera1ExtrinsicsErrors' ) | ~isfield(stErrors,'Camera2IntrinsicsErrors' ) | ~isfield(stErrors, 'RotationOfCamera2Error' ) | ~isfield(stErrors, 'TransOfCamera2Error') then + error(msprintf("A StereoCalibrationErrors struct expected.")) + end + + cam1intErr = stErrors.Camera1IntrinsicsErrors; + cam1extErr = stErrors.Camera1ExtrinsicsErrors; + cam2intErr = stErrors.Camera2IntrinsicsErrors; + + checkCIE(cam1intErr); + checkCEE(cam1extErr); + checkCIE(cam2intErr); + rotErr = stErrors.RotationOfCamera2Error; + transErr = stErrors.TransOfCamera2Error; + + if type(rotErr)~=1 | type(transErr)~=1 | ~isreal(rotErr) | ~isreal(transErr) then + error(msprintf("A StereoCalibrationErrors struct expected.")) + end + + [size11 size12] = size(rotErr); + [size21 size22] = size(transErr); + + if size11*size12~=3 | size21*size22~=3 then + error(msprintf("A StereoCalibrationErrors struct expected.")) + end +endfunction + |