1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980 |
- #pragma once
- #include <string>
- #include <opencv2\opencv.hpp>
- #include <windows.h>
- #include <queue>
- //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>::Ptr 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;
- };
- //};
|