From a6df67e8bcd5159cde27556f4f6a315f8dc2215f Mon Sep 17 00:00:00 2001 From: shamikam Date: Mon, 16 Jan 2017 02:56:17 +0530 Subject: First Commit --- macros/checkSCE.sci | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 macros/checkSCE.sci (limited to 'macros/checkSCE.sci') 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 + -- cgit