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
00033
00034
00035
00036
00037 #include <iostream>
00038 #include <ros/ros.h>
00039 #include <opencv2/highgui/highgui.hpp>
00040 #include <opencv2/core/core.hpp>
00041 #include <opencv2/opencv.hpp>
00042 #include <opencv/cv.h>
00043 #include <opencv/cvaux.h>
00044 #include <opencv/cxcore.h>
00045 #include <sensor_msgs/Image.h>
00046 #include <geometry_msgs/PoseStamped.h>
00047 #include <geometry_msgs/Pose2D.h>
00048 #include <image_transport/image_transport.h>
00049
00050
00051 using namespace std;
00052 using namespace cv;
00053
00054 class DetectionCV
00055 {
00056 ros::Publisher image_object_pub_;
00057
00058 image_transport::ImageTransport it_;
00059 image_transport::Subscriber camera_sub_;
00060
00061 ros::Subscriber object_pridict_sub_;
00062
00063 CvPoint object;
00064
00065 public:
00066 DetectionCV(ros::NodeHandle& nh_);
00067 ~DetectionCV(void);
00068
00069 protected:
00070 int p_initial_x;
00071 int p_initial_y;
00072 int p_initial_r;
00073 private:
00074 void object_detection(const sensor_msgs::ImageConstPtr& msg);
00075 double Sum(IplImage *srcImg,int nrow,int ncol);
00076 void ShowIndex(int row,int col,IplImage *srcImg);
00077 void ImageConvert(IplImage *srcImg,int nrow,int ncol);
00078 void sdf2circle(IplImage* Phi_0,int nrow,int ncol,int Next_X,int Next_Y,int r,CvSize ImgSize);
00079 void Heaviside(IplImage* phi,double epsilon,IplImage* H);
00080 void Delta(IplImage* phi,double epsilon,IplImage* Delta_h);
00081 void NeumannBoundCond(IplImage* phi);
00082 double binaryfit_C1(IplImage* Img,IplImage* H_phi,int nrow,int ncol);
00083 double binaryfit_C2(IplImage* Img,IplImage* H_phi,int nrow,int ncol);
00084 void EVOL_CV(IplImage* I,IplImage* phi,double nu,double lambda_1,double lambda_2,double timestep,double epsilon,int numIter);
00085 void ImageProcess_1(IplImage* phi,int nrow,int ncol);
00086 void PlanePoint(IplImage* ProcessImg_1,IplImage* SImg,int nrow,int ncol,CvPoint &PlanePoint);
00087 void CV_Detect(IplImage* UNImg,CvPoint &Plane);
00088
00089 };