//cut point recognization for scion plant #pragma once #include #include "data_def_api.h" #include "logger.h" #include "imstorage_manager.h" using namespace cv; namespace graft_cv{ class CScionCutPoint{ public: CScionCutPoint(ConfigParam&, CGcvLogger*pLog=0); ~CScionCutPoint(); int up_point_detect( ImgInfo*, Mat&, PositionInfo& posinfo ); void set_image_saver(CImStoreManager** ppis){m_ppImgSaver=ppis;} private: Mat m_binImg;// binary image Mat m_grayImg;//gray image string m_imgId; CImStoreManager**m_ppImgSaver; //·µ»ØÍ¼Æ¬£¬ÓÃÓÚµ÷ÊÔ ImgInfo* m_pImginfoBinFork;//fork-y, right-x int m_folder_th; ConfigParam& m_cparam;//global configure parameters CGcvLogger* m_pLogger; // image segment void img_segment(Mat&); void get_stem_local_img( const std::vector& hist, int stem_dia_min, int x0, int x1, int& stem_y_min, vector& hist_col, vector& hist_row, Mat& scionBinImg ); void get_cut_up_point( const std::vector& hist, int stem_fork_y, double r2_ratio_th, int average_window, int r2_window, int& ymin, int& ymax ); void get_slop_center( int stem_x0, int stem_x1, int slop_cent_y, int& slop_cent_x); void clear_imginfo(); }; };