summaryrefslogtreecommitdiff
path: root/macros/checkSCE.sci
diff options
context:
space:
mode:
authorshamikam2017-01-16 02:56:17 +0530
committershamikam2017-01-16 02:56:17 +0530
commita6df67e8bcd5159cde27556f4f6a315f8dc2215f (patch)
treee806e966b06a53388fb300d89534354b222c2cad /macros/checkSCE.sci
downloadFOSSEE_Image_Processing_Toolbox-master.tar.gz
FOSSEE_Image_Processing_Toolbox-master.tar.bz2
FOSSEE_Image_Processing_Toolbox-master.zip
First CommitHEADmaster
Diffstat (limited to 'macros/checkSCE.sci')
-rw-r--r--macros/checkSCE.sci29
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
+