summaryrefslogtreecommitdiff
path: root/macros/checkCIE.sci
diff options
context:
space:
mode:
authorshamikam2017-01-16 02:56:17 +0530
committershamikam2017-01-16 02:56:17 +0530
commita6df67e8bcd5159cde27556f4f6a315f8dc2215f (patch)
treee806e966b06a53388fb300d89534354b222c2cad /macros/checkCIE.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/checkCIE.sci')
-rw-r--r--macros/checkCIE.sci27
1 files changed, 27 insertions, 0 deletions
diff --git a/macros/checkCIE.sci b/macros/checkCIE.sci
new file mode 100644
index 0000000..37cbdbe
--- /dev/null
+++ b/macros/checkCIE.sci
@@ -0,0 +1,27 @@
+function checkCIE(varargin)
+ intErr = varargin(1)
+ if ~isfield(intErr, 'SkewError') | ~isfield(intErr,'FocalLengthError' ) | ~isfield(intErr, 'PrincipalPointError') | ~isfield(intErr, 'RadDistortionError') | ~isfield(intErr, 'TanDistortionError' ) then
+ error(msprintf("An IntrinsicsEstimationErrors Struct expected."))
+ end
+
+ skewErr = intErr.SkewError;
+ flErr = intErr.FocalLengthError;
+ ppErr = intErr.PrincipalPointError;
+ rdErr = intErr.RadDistortionError;
+ tdErr = intErr.TanDistortionError;
+
+ if type(skewErr)~=1 | type(flErr)~=1 | type(ppErr)~=1 | type(rdErr)~=1 | type(tdErr)~=1 | ~isreal(skewErr) | ~isreal(flErr) | ~isreal(ppErr) | ~isreal(rdErr) | ~isreal(tdErr) then
+ error(msprintf("An IntrinsicsEstimationErrors Struct expected."))
+ end
+
+ [size11 size12] = size(skewErr);
+ [size21 size22] = size(flErr);
+ [size31 size32] = size(ppErr);
+ [size41 size42] = size(rdErr);
+ [size51 size52] = size(tdErr);
+
+ if (size11*size12)~=1 | (size21*size22)~=2 | (size31*size32)~=2 | (size41*size42)<2 | (size41*size42)>3 | (size51*size52)~=2 then
+ error(msprintf("An IntrinsicsEstimationErrors Struct expected."))
+ end
+
+endfunction