Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032 #ifndef PLANE_DETECTION
00033 #define PLANE_DETECTION
00034
00035 #include <stereo_msgs/DisparityImage.h>
00036 #include <sensor_msgs/Image.h>
00037
00038 namespace fast_plane_detection {
00039
00040 class PlaneDetection {
00041
00042 public:
00043 PlaneDetection( int drange, int w, int h,
00044 bool find_table, std_msgs::Header img_header,
00045 bool search_y = true);
00046 ~PlaneDetection();
00047
00048 void Update(const stereo_msgs::DisparityImage::ConstPtr&
00049 disparity_image);
00050
00051 void GetPlaneParameters( float &alpha, float &beta, float &d,
00052 int &min_x, int &max_x,
00053 int &min_y, int &max_y);
00054 float GetSpreadX();
00055 float GetSpreadY();
00056 void GetLabels(sensor_msgs::Image &image);
00057 void GetHistY(sensor_msgs::Image &image,
00058 float &beta, float &disp);
00059 void GetHistX(sensor_msgs::Image &image,
00060 float &beta, float &disp);
00061 void GetSumOfSquaredError(float &error);
00062 void GetNInliers(int &n_inliers);
00063 void GetNDisp(int &n_disp);
00064 void GetMeanSquaredError(float &mean_error);
00065
00066 private:
00067
00068 void Update_Y( const stereo_msgs::DisparityImage::ConstPtr&
00069 disparity_image );
00070 void Update_X( const stereo_msgs::DisparityImage::ConstPtr&
00071 disparity_image );
00072
00074 sensor_msgs::Image labels_;
00075
00077 sensor_msgs::Image hist_y_;
00078 float tmp_beta_;
00079 float tmp_disp_;
00080
00082 sensor_msgs::Image hist_x_;
00083 float tmp_beta_x_;
00084 float tmp_disp_x_;
00085
00087 int drange_;
00088
00090 int width_, height_;
00091
00093 int min_x_; int max_x_;
00094 int min_y_; int max_y_;
00095
00098 bool find_table_;
00099 float min_beta_;
00100
00102 bool search_y_;
00103
00105 float alpha_;
00106 float beta_;
00107 float disp_;
00108
00110 float spread_d_y_;
00111 float spread_d_x_;
00112
00114 float err_;
00115
00117 int n_inliers_;
00118
00120 int n_disps_;
00121
00122 };
00123
00124 }
00125
00126 #endif //PLANE_DETECTION