12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 |
- #pragma once
- #include <string>
- #include <opencv2\opencv.hpp>
- #include <windows.h>
- #include <queue>
- #include <pcl\point_types.h>
- #include <pcl\point_cloud.h>
- //using namespace cv;
- using namespace std;
- //namespace graft_cv
- //{
- typedef struct
- {
- string img_name;
- cv::Mat image;
- } ImgParam;
- typedef struct
- {
- string pcd_name;
- pcl::PointCloud<pcl::PointXYZ> pcd;
- } PcdParam;
- typedef struct
- {
- int nIndex;
- queue<ImgParam>* imgQ;
-
- } ThreadParamSave;
- typedef struct
- {
- int nIndex;
- queue<PcdParam>* pcdQ;
- } ThreadParamSavePcd;
- typedef struct
- {
- string folder;
- int store_days;
- bool* state;
-
- } ThreadParamClean;
- int WINAPI TheadFuncClearn(LPVOID lpParam);
- int WINAPI TheadFuncSave(LPVOID lpParam);
- int WINAPI TheadFuncSavePcd(LPVOID lpParam);
- void getFiles( string path, vector<string>& files, time_t clean_time);
- class CImStoreManager{
- public:
- CImStoreManager();
- ~CImStoreManager();
- // return 0--ok, 1--failed(not exists)
- int setStoreDir(string& folder);
- void getStoreDir(string& folder);
- void setStoreDays(int days);
- //saveImage() return 0--ok, 1 -- invalid image or folder
- int saveImage(cv::Mat&img,string name_id);
- void restart_start_worker();
- int saveBinPly(pcl::PointCloud<pcl::PointXYZ>::Ptr pcd, string name_id);
- protected:
- int m_storeDays;
- string m_storeDir;
- bool is_valid_folder();
- HANDLE m_workHandle;
- HANDLE m_workHandleSave;
- HANDLE m_workHandleSavePcd;
- queue<ImgParam> m_images;
- queue<PcdParam> m_pcds;
- };
- //};
|