34 #ifndef __viva__utils__ 35 #define __viva__utils__ 38 #include "opencv2/highgui/highgui.hpp" 39 #include "opencv2/imgproc/imgproc.hpp" 44 #include <sys/types.h> 67 const static int SPACE;
68 const static int NONE;
80 const static string PATH_SEPARATOR;
85 static string tmpFilenameInFolder(
const string &folder =
"",
86 const string &ext =
".jpg");
88 static Rect bestSquareFrom(Rect &rectangle);
90 static void saveSquaredIn(
const Mat &image,
97 static void listdir(
const string &dirname, vector<string> &files,
bool returnPaths =
true);
101 static void listImages(
const string &dirname, vector<string> &files,
bool returnPaths =
true);
106 static bool isDir(
const string &fullpath);
110 static bool isFile(
const string &fullpath);
114 static void makeDir(
const string &fullpath);
118 static bool exists(
const string &fullpath);
123 static void getExtension(
const string &filename,
string &extension);
127 static void getFilename(
const string &path,
string &filename);
131 static void getBasename(
const string &path,
string &base);