00001 #ifndef CORNERS_H
00002 #define CORNERS_H
00003
00004 #include "mimasconfig.h"
00005
00006 #ifdef HAVE_LIBMINPACK
00007 #ifdef HAVE_LIBLAPACK
00008 #ifdef CAMERA_CALIBRATION_ENABLE
00009
00010 #include <iostream>
00011 #include <vector>
00012 #include <cmath>
00013
00014 #include "image.h"
00015 #include "corrcoef.h"
00016 #include "rgba.h"
00017 #include "camera.h"
00018
00019 namespace mimas {
00020 namespace camera_calibration {
00021
00037 class corner_detection {
00038
00039 public:
00041 typedef boost::numeric::ublas::matrix< point_f > MatrixPoint;
00042
00044 typedef boost::numeric::ublas::matrix< pixel_f > MatrixPixel;
00045
00047 typedef boost::numeric::ublas::matrix< double > Matrix;
00048
00050 typedef rgba< unsigned char > pixel_rgba;
00051
00052 private:
00053
00054 MatrixPixel mCorners;
00055 std::vector< unsigned char > cross[4];
00056 int size_x, size_y, size_window;
00057
00071 pixel_f findLocalCorner(image< pixel_rgba > img, int x, int y, int precision, int type_corner,
00072 double &corr, double min_corr) throw(mimasexception);
00073
00078 static void g4(int x, int y, double &xx, double &yy, Matrix &coeffs);
00079
00080
00081 public:
00094 corner_detection(int size_x, int size_y, int size_window, pixel_rgba white, pixel_rgba black);
00095
00097 ~corner_detection(void);
00098
00113 void findCorners(image< pixel_rgba > img, std::vector< pixel_f > pix, double min_corr)
00114 throw(mimasexception);
00115
00117 MatrixPixel getCorners() { return mCorners; }
00118
00119 };
00120
00123 }
00124 }
00125
00126 #endif
00127 #endif
00128 #endif
00129
00130 #endif