00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef DepthEngine_H
00020 #define DepthEngine_H
00021
00022 #include "cv.h"
00023 #include "highgui.h"
00024
00025 namespace uvsim
00026 {
00027
00028 class DepthEngine
00029 {
00030 public:
00031 static const int winSize = 10;
00032 static const int maxCount = 100;
00033 static const double quality = 0.01;
00034 static const double minDistance = 10;
00035 bool firstRun;
00036
00037
00038 IplImage *video, *image, *prevImage, *rectifiedImage, *prevRectifiedImage,
00039 *grey, *prevGrey, *pyramid, *prevPyramid,
00040 *swapTemp, *eig, *temp;
00041 CvPoint2D32f *points[2], *swapPoints;
00042 char *status;
00043 CvMat *H1, *H2, *fundamentalMatrix, *R1, *R2, *M1, *M2, *iM, *D1, *D2,
00044 *mx1, *my1, *mx2, *my2, *pair;
00045
00046
00047 IplImage *frame;
00048
00049
00050 int needToInit, nightMode, flags, addRemovePt, count;
00051 CvPoint pt;
00052 CvSize imageSize;
00053 public:
00054 DepthEngine (IplImage * frame);
00055 virtual ~DepthEngine();
00056 void init();
00057 void calculateOpticalFlow();
00058 void calculateDepth();
00059 void update(bool initialize = false);
00060 void drawPoints();
00061 };
00062
00063 }
00064
00065 #endif
00066
00067