lensdistortion.h
00001 /*
00002  * Distortion correction for SAL3D.
00003  * Copyright 2010 AQSENSE, S.L.
00004  */
00005 #if !defined (AQSENSE_SAL3D_LENS_DISTORTION_H)
00006 #define AQSENSE_SAL3D_LENS_DISTORTION_H
00007 
00008 #if defined (_MSC_VER) && (_MSC_VER >= 1020)
00009 #pragma once
00010 #endif
00011 
00012 #include "sal3d_def.h"
00013 
00014 enum sal3d_lens_dist_model_type
00015 {
00016     NoDistortion = 0,
00017     Tsai = 1,
00018     NLPoly3 = 2,
00019     TsaiReg = 3,
00020     Cubic = 4,
00021     MatrixLut = 5
00022 };
00023 
00024 static const int MAX_DISTORTION_COEFFS = 20;
00025 
00026 /* Distortion model public declaration. */
00027 typedef struct sal3d_lens_distortion
00028 {
00029     sal3d_lens_dist_model_type type;
00030     float coeffs[MAX_DISTORTION_COEFFS];
00031     float error_mean;
00032     float error_stddev;
00033     float error_max;
00034 } sal3d_lens_distortion;
00035 
00036 SAL3D_API(int) sal3d_lens_distortion_undistort (const sal3d_lens_distortion *model,
00037         const sal3d_point2d *p, sal3d_point2d *up, sal3d_error *e);
00038 
00039 #endif //AQSENSE_SAL3D_LENS_DISTORTION_H