$search
00001 00005 #ifndef _THERMALVIS_TOOLS_H_ 00006 #define _THERMALVIS_TOOLS_H_ 00007 00008 /***** General includes *****/ 00009 #include <stdlib.h> 00010 #include <stdio.h> 00011 #include <math.h> 00012 #include <unistd.h> 00013 #include <getopt.h> 00014 #include <math.h> 00015 #include <iostream> 00016 #include <fstream> 00017 #include <sys/stat.h> 00018 #include <dirent.h> 00019 #include <sstream> 00020 #include <string> 00021 #include <string.h> 00022 #include <assert.h> 00023 #include <fcntl.h> /* low-level i/o */ 00024 #include <unistd.h> 00025 #include <errno.h> 00026 #include <malloc.h> 00027 #include <sys/stat.h> 00028 #include <sys/types.h> 00029 #include <sys/time.h> 00030 #include <sys/mman.h> 00031 #include <sys/ioctl.h> 00032 00033 // Standard 00034 #include <stdlib.h> 00035 #include <stdio.h> 00036 #include <math.h> 00037 #include <iostream> 00038 #include <fstream> 00039 #include <limits.h> 00040 00041 #ifndef _WIN32 00042 // Linux 00043 #include <unistd.h> 00044 #include <getopt.h> 00045 00046 // Miscellaneous 00047 #include <sys/stat.h> 00048 #include <dirent.h> 00049 #endif 00050 00051 #include <stdio.h> 00052 #include <termios.h> 00053 #include <unistd.h> 00054 #include <sys/types.h> 00055 #include <sys/time.h> 00056 00057 //#include "opencv_resources.hpp" 00058 #include "sys/time.h" 00059 00060 #include "opencv2/calib3d/calib3d.hpp" 00061 #include "opencv2/imgproc/imgproc.hpp" 00062 #include "opencv2/highgui/highgui.hpp" 00063 #include "opencv2/features2d/features2d.hpp" 00064 #include "opencv2/gpu/gpu.hpp" 00065 #include <opencv2/video/video.hpp> 00066 00067 using namespace std; 00068 using namespace cv; 00069 00070 00072 int countElementsInFolder(const char* folderName, vector<string>& elementNames, int elementType); 00073 00074 void convertUcharToBinary(unsigned char val, int* binaryArray); 00075 00076 double lookupValue(double xi, double yi, double maxVal, const Mat& lookupMat); 00077 00078 double getInterpolatedVal(const Mat& img, Point2f& coord); 00079 00081 double calcLinePerpDistance(double *line1, double *line2); 00082 00084 double timeElapsedMS(struct timeval& timer, bool reset = true); 00085 00086 bool matricesAreEqual(Mat& mat1, Mat& mat2); 00087 Scalar getRandomColour(); 00088 00089 void addUniqueToVector(vector<unsigned int>& dst, vector<unsigned int>& src); 00090 00091 double asymmetricGaussianValue(double score, double mean, double loVar, double hiVar); 00092 00093 void randomSelection(vector<unsigned int>& src, vector<unsigned int>& dst, unsigned int max); 00094 00096 void redistortPoints(const vector<Point2f>& src, vector<Point2f>& dst, const Mat& cameraMatrix, const Mat& distCoeffs, const Mat& newCamMat=Mat::eye(3,3,CV_64FC1)); 00097 00099 long long int factorial(int num); 00100 00102 void getNextCombo(vector<unsigned int>& currentIndices, int r, int n); 00103 00105 double findEquivalentProbabilityScore(double* values, int quantity, double prob); 00106 00107 void readPoints(const char *filename, vector<Point2f>& pts); 00108 void writePoints(const char *filename, const vector<Point2f>& pts); 00109 00111 void convert_byte_to_binary_string(void* src, char* dst); 00112 00113 #endif