NimbRo ROS Soccer Package
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
IPM.hpp
1 // Compute IPM
2 // Author: Hafez Farazi <farazi@ais.uni-bonn.de>
3 
4 #pragma once
5 #include <opencv2/opencv.hpp>
6 #include <stdio.h>
7 #include <boost/iterator/iterator_concepts.hpp>
8 #include <vector>
9 #include <vision_module/Tools/Parameters.hpp>
10 #include <vision_module/Tools/LineSegment.hpp>
11 #include <vision_module/Inputs/Camera.hpp>
12 #include <vision_module/Tools/General.hpp>
13 using namespace std;
14 using namespace cv;
20 class IPM
21 {
22 public:
23  inline IPM(float diagonalAngleView)
24  {
25 
26  InitIPM( diagonalAngleView);
27  }
28  virtual ~IPM()
29  {
30 
31  }
32  bool GetHomographyNoYaw(float diagonalAngleView,Point3d cameraLocation, Point3d cameraOrintation,
33  Mat &topHomoFor, Mat &topHomoBack,
34  double &picYawDegree);
35  bool GetHomographyUseYaw(float diagonalAngleView,Point3d cameraLocation, Point3d cameraOrintation,
36  Mat &realHomoFor,Mat &realHomoBack,
37  Point2d outerCornetrsRes[4], Point2d gPoints[4],
38  Point3d transformedPoints[4], Point2d physicalCornersRes[4]);
39 private:
40  double ta, tb, tg;
41  Point3d GetPointOnZPlain(Point3d point1, Point3d point2, double z = 0);
42  Mat GetMultiplyExtrinsicRotationMatrix(Point3d vec, bool inv);
43  bool GetPoints(Point3d cameraLocation, Point3d cameraOrintation,
44  Point2d gPoints[4], Point2d cPoints[4],
45  Point3d transformedPoints[4],bool useYaw);
46 
47  bool InitIPM(float diagonalAngleView);
48 
49 };
For Inverse Perspective Mapping.
Definition: IPM.hpp:20