forked from jhdewitt/sltk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
util.h
63 lines (53 loc) · 1.57 KB
/
util.h
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
#include <string>
#include <map>
#include <unistd.h>
#include <sys/time.h>
#include <vector>
#include <iostream>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <sys/types.h>
#include <sys/stat.h>
//#include "opencv2/core/core.hpp"
//#include "opencv2/imgproc/imgproc.hpp"
#ifndef UTIL_H
#define UTIL_H
struct exifstub{
std::string make;
std::string model;
std::string lens_info;
std::string lens_make;
std::string lens_model;
std::string serial_num;
std::string serial_num_lens;
std::string serial_num_internal;
float exposure_t;
float fnumber;
int iso;
int image_w;
int image_h;
float focal_length;
float scale_factor_35efl;
float hyperfocaldistance;
float fov;
float light_value;
};
typedef std::map<std::string,std::string> stringmap;
typedef std::map<std::string, stringmap > exifmap;
double curtime();
bool is_dir(const char *filename);
bool file_exists(const char * filename);
std::string get_pattern_filename( std::string pattern );
//cv::Rect maskToROI(cv::Mat img);
//bool readStringList( const std::string& filename, std::vector<std::string>& l );
bool getExif(std::string fname, stringmap &_map);
bool getExifMap(std::string fname, exifmap &m);
bool getExifList( std::vector< std::string > &fnames, std::vector< stringmap > &maps );
exifstub parseExifMap(exifmap m);
std::string getVal(stringmap m, std::string s);
void printStub(exifstub s);
char* findNextName( const char* pattern, int* n );
std::string findNextName( std::string pattern, int* n);
std::string checkExifMap( stringmap m, std::string q );
#endif