1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82
| #ifndef INCLUDE_IMAGE_H #define INCLUDE_IMAGE_H #include "utility.h"
#include <pcl/point_cloud.h> #include <pcl/point_types.h> #include <pcl/io/pcd_io.h>
#include <opencv2/opencv.hpp> #include <opencv2/highgui/highgui.hpp>
using namespace std; using namespace cv;
namespace roadmarking { class Imageprocess { public: void pcgrid(Bounds &boundingbox, float resolution); void savepcgrid(Bounds &boundingbox, float resolution, const pcXYZIPtr &c); void savepcgrid(Bounds &boundingbox, float resolution, pcXYZIPtr &c, pcXYZIPtr &gc, pcXYZIPtr &ngc); void pc2imgI(const pcXYZIPtr &cloud, int whatcloud, Mat &img, float times_std); void pc2imgZ(const pcXYZIPtr &cloud, int whatcloud, Mat &img); void pc2imgD(const pcXYZIPtr &cloud, int whatcloud, Mat &img ,float k); void img2pc_g(const Mat &img, const pcXYZIPtr &incloud, pcXYZIPtr & outcloud); void img2pc_c(const Mat &img, const pcXYZIPtr &incloud, pcXYZIPtr & outcloud);
void img2pclabel_g(const Mat &img, const pcXYZIPtr &incloud, vector<pcXYZI> &outclouds, double dZ); void img2pclabel_c(const Mat &img, const pcXYZIPtr &incloud, vector<pcXYZI> &outclouds, double dZ);
Mat Sobelboundary(Mat img0); float caculateCurrentEntropy(Mat hist, int threshold); Mat maxEntropySegMentation(Mat inputImage); Mat ExtractRoadPixelIZD(const Mat & _binI,const Mat & _binZ,const Mat & _binD); Mat ExtractRoadPixelIZ (const Mat & _binI,const Mat & _binZ);
void RemoveSmallRegion(const Mat &_binImg, Mat &_binfilter, int AreaLimit); void CcaByTwoPass(const Mat & _binfilterImg, Mat & _labelImg); void CcaBySeedFill(const Mat& _binfilterImg, Mat & _lableImg); void ImgReverse(const Mat &img, Mat &img_reverse); void ImgFilling(const Mat &img, Mat &img_fill);
void LabelColor(const Mat & _labelImg, Mat & _colorImg); Scalar GetRandomColor();
void DetectCornerHarris(const Mat & src, const Mat & colorlabel, Mat & cornershow, Mat & cornerwithimg, int threshold); void DetectCornerShiTomasi(const Mat & src, const Mat & colorlabel, Mat & cornerwithimg, int minDistance, double mincorenerscore);
void Truncate( Mat & Img, Mat & TImg);
void saveimg(const Mat &ProjI, const Mat &ProjZ, const Mat &ProjD, const Mat &ProjImf, const Mat &GI, const Mat &GZ, const Mat &BZ, const Mat &BD, const Mat &GIR, const Mat &BI, const Mat &BIF, const Mat &Label, const Mat &Corner); void saveimg(std::string base_folder, int file_index, const Mat &ProjI, const Mat &ProjZ, const Mat &ProjImf, const Mat &GI, const Mat &GZ, const Mat &BZ, const Mat &GIR, const Mat &BI, const Mat &BIF, const Mat &Label); void saveimg(std::string base_folder, int file_index, const Mat &ProjI, const Mat &ProjZ, const Mat &ProjD, const Mat &ProjImf, const Mat &GI, const Mat &GZ, const Mat &BZ, const Mat &BD, const Mat &GIR, const Mat &BI, const Mat &BIF, const Mat &Label); void saveimg(const Mat &ProjI, const Mat &ProjImf, const Mat &GI, const Mat &BI, const Mat &BIF, const Mat &Label);
int nx, ny; int timin, tjmin; float minX, minY, minZ; float res; vector<vector<vector<int>>> CMatrixIndice; vector<vector<vector<int>>> GCMatrixIndice; vector<vector<vector<int>>> NGCMatrixIndice; int totallabel; vector<vector <int>> labelx; vector<vector <int>> labely;
protected: private: };
}
#endif
|