1
0
mirror of https://github.com/opencv/opencv_contrib.git synced 2025-10-19 02:16:34 +08:00

add data transmission functions in DataTrans Class

This commit is contained in:
Wangyida
2015-07-17 21:38:38 +08:00
parent 391596a1b2
commit db396b9fb9
22 changed files with 251 additions and 30936 deletions

View File

@@ -45,15 +45,24 @@ the use of this software, even if advised of the possibility of such damage.
#ifndef __OPENCV_CNN_3DOBJ_HPP__
#define __OPENCV_CNN_3DOBJ_HPP__
#ifdef __cplusplus
#include <glog/logging.h>
#include <leveldb/db.h>
#include <caffe/proto/caffe.pb.h>
#include <opencv2/calib3d.hpp>
#include <opencv2/viz/vizcore.hpp>
#include <opencv2/highgui.hpp>
#include <opencv2/highgui/highgui_c.h>
//#include <opencv2/imgproc/imgproc.hpp>
#include <string>
#include <fstream>
#include <vector>
#include <stdio.h>
#include <iostream>
#include <string>
#include <set>
#include <string.h>
#include <stdlib.h>
#include <dirent.h>
using std::string;
/** @defgroup cnn_3dobj CNN based on Caffe aimming at 3D object recognition and pose estimation
*/
@@ -113,8 +122,21 @@ class CV_EXPORTS_W IcoSphere
*/
};
//! @}
class CV_EXPORTS_W DataTrans
{
private:
std::set<string> all_class_name;
std::map<string,int> class2id;
public:
DataTrans();
CV_WRAP void list_dir(const char *path,std::vector<string>& files,bool r);
CV_WRAP string get_classname(string path);
CV_WRAP int get_labelid(string fileName);
CV_WRAP void loadimg(string path,char* buffer,bool is_color);
CV_WRAP void convert(string imgdir,string outputdb,string attachdir,int channel,int width,int height);
};
//! @}
}}