summaryrefslogtreecommitdiff
path: root/macros/checkCIE.sci
blob: 37cbdbe4d9a599c954acc9928652f497afb6cf3e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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