Defines | Typedefs | Functions
tools.hpp File Reference

Declarations for generic tools not depending on libraries such as OpenCV, PCL and ROS. More...

#include <stdio.h>
#include <unistd.h>
#include <getopt.h>
#include <iostream>
#include <fstream>
#include <sys/stat.h>
#include <dirent.h>
#include <sstream>
#include <string>
#include <string.h>
#include <assert.h>
#include <fcntl.h>
#include <errno.h>
#include <malloc.h>
#include <sys/types.h>
#include <sys/time.h>
#include <sys/mman.h>
#include <sys/ioctl.h>
#include <cstdlib>
#include <cmath>
#include <limits.h>
#include <termios.h>
#include "opencv2/calib3d/calib3d.hpp"
#include "opencv2/imgproc/imgproc.hpp"
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/features2d/features2d.hpp"
#include "opencv2/gpu/gpu.hpp"
#include <opencv2/video/video.hpp>
Include dependency graph for tools.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define USE_CLAHE   0

Typedefs

typedef std::pair< unsigned
int, unsigned int > 
mypair

Functions

void addUniqueToVector (vector< unsigned int > &dst, vector< unsigned int > &src)
double asymmetricGaussianValue (double score, double mean, double loVar, double hiVar)
double calcLinePerpDistance (double *line1, double *line2)
 Calculates perpendicular distance between two "parallel" lines.
void calcParameters (const vector< double > &v, double &mean, double &stdev)
 Calculate the mean and standard deviation of a vector of doubles.
bool comparator (const mypair &l, const mypair &r)
void convert_byte_to_binary_string (void *src, char *dst)
 Converts a raw byte as an 8-bit character array of 1s and 0s.
void convertUcharToBinary (unsigned char val, int *binaryArray)
int countElementsInFolder (const char *folderName, vector< string > &elementNames, int elementType)
 Counts and returns a list of all specified elements within a folder.
double distBetweenPts (cv::Point3d &P1, cv::Point3d &P2)
 Distance between two 3D points in double format.
double distBetweenPts (cv::Point &P1, cv::Point &P2)
 Calculates the distance between two "Point" points.
double distBetweenPts2f (cv::Point2f &P1, cv::Point2f &P2)
 Calculates the distance between two "Point2f" points.
long long int factorial (int num)
 Calculates Factorial of an integer.
double findEquivalentProbabilityScore (double *values, int quantity, double prob)
 Selects the score which is minimally better than a specified proportion of all scores.
void findLinearModel (double *x, double *y, int termsToConsider, double &m, double &c)
double findMinimumSeparation (vector< cv::Point2f > &pts)
 Finds the minimum separation between any two points in a set.
double getInterpolatedVal (const cv::Mat &img, cv::Point2f &coord)
void getNextCombo (vector< unsigned int > &currentIndices, int r, int n)
 Gets next possible combination for an exhaustive combinatorial search.
cv::Scalar getRandomColour ()
double lookupValue (double xi, double yi, double maxVal, const cv::Mat &lookupMat)
bool matricesAreEqual (cv::Mat &mat1, cv::Mat &mat2)
cv::Point2f meanPoint (cv::Point2f &P1, cv::Point2f &P2)
 Generates a point that's half way in between the two input points.
double perpDist (cv::Point2f &P1, cv::Point2f &P2, cv::Point2f &P3)
 Calculates the perpindicular distance between a line (P1 to P2) and a point (P3)
void randomSelection (vector< unsigned int > &src, vector< unsigned int > &dst, unsigned int max)
void readPoints (const char *filename, vector< cv::Point2f > &pts)
void redistortPoints (const vector< cv::Point2f > &src, vector< cv::Point2f > &dst, const cv::Mat &cameraMatrix, const cv::Mat &distCoeffs, const cv::Mat &newCamMat=cv::Mat::eye(3, 3, CV_64FC1))
 Redistorts points using an established distortion model.
double timeElapsedMS (struct timeval &timer, bool reset=true)
 Calculates time elapsed since the last time the timer was reset.
void writePoints (const char *filename, const vector< cv::Point2f > &pts)

Detailed Description

Declarations for generic tools not depending on libraries such as OpenCV, PCL and ROS.

Definition in file tools.hpp.


Define Documentation

#define USE_CLAHE   0

Definition at line 67 of file tools.hpp.


Typedef Documentation

typedef std::pair<unsigned int,unsigned int> mypair

Definition at line 72 of file tools.hpp.


Function Documentation

void addUniqueToVector ( vector< unsigned int > &  dst,
vector< unsigned int > &  src 
)

Definition at line 653 of file tools.cpp.

double asymmetricGaussianValue ( double  score,
double  mean,
double  loVar,
double  hiVar 
)

Definition at line 630 of file tools.cpp.

double calcLinePerpDistance ( double *  line1,
double *  line2 
)

Calculates perpendicular distance between two "parallel" lines.

Definition at line 675 of file tools.cpp.

void calcParameters ( const vector< double > &  v,
double &  mean,
double &  stdev 
)

Calculate the mean and standard deviation of a vector of doubles.

Definition at line 746 of file tools.cpp.

bool comparator ( const mypair l,
const mypair r 
)

Definition at line 7 of file tools.cpp.

void convert_byte_to_binary_string ( void *  src,
char *  dst 
)

Converts a raw byte as an 8-bit character array of 1s and 0s.

Definition at line 804 of file tools.cpp.

void convertUcharToBinary ( unsigned char  val,
int *  binaryArray 
)

Definition at line 334 of file tools.cpp.

int countElementsInFolder ( const char *  folderName,
vector< string > &  elementNames,
int  elementType 
)

Counts and returns a list of all specified elements within a folder.

Definition at line 345 of file tools.cpp.

double distBetweenPts ( cv::Point3d &  P1,
cv::Point3d &  P2 
)

Distance between two 3D points in double format.

Definition at line 48 of file tools.cpp.

double distBetweenPts ( cv::Point P1,
cv::Point P2 
)

Calculates the distance between two "Point" points.

Definition at line 52 of file tools.cpp.

double distBetweenPts2f ( cv::Point2f &  P1,
cv::Point2f &  P2 
)

Calculates the distance between two "Point2f" points.

Definition at line 37 of file tools.cpp.

long long int factorial ( int  num)

Calculates Factorial of an integer.

Definition at line 689 of file tools.cpp.

double findEquivalentProbabilityScore ( double *  values,
int  quantity,
double  prob 
)

Selects the score which is minimally better than a specified proportion of all scores.

Definition at line 766 of file tools.cpp.

void findLinearModel ( double *  x,
double *  y,
int  termsToConsider,
double &  m,
double &  c 
)

Definition at line 87 of file tools.cpp.

double findMinimumSeparation ( vector< cv::Point2f > &  pts)

Finds the minimum separation between any two points in a set.

Definition at line 62 of file tools.cpp.

double getInterpolatedVal ( const cv::Mat &  img,
cv::Point2f &  coord 
)

Definition at line 202 of file tools.cpp.

void getNextCombo ( vector< unsigned int > &  currentIndices,
int  r,
int  n 
)

Gets next possible combination for an exhaustive combinatorial search.

Definition at line 701 of file tools.cpp.

cv::Scalar getRandomColour ( )

Definition at line 683 of file tools.cpp.

double lookupValue ( double  xi,
double  yi,
double  maxVal,
const cv::Mat &  lookupMat 
)

Definition at line 179 of file tools.cpp.

bool matricesAreEqual ( cv::Mat &  mat1,
cv::Mat &  mat2 
)

Definition at line 514 of file tools.cpp.

cv::Point2f meanPoint ( cv::Point2f &  P1,
cv::Point2f &  P2 
)

Generates a point that's half way in between the two input points.

Definition at line 82 of file tools.cpp.

double perpDist ( cv::Point2f &  P1,
cv::Point2f &  P2,
cv::Point2f &  P3 
)

Calculates the perpindicular distance between a line (P1 to P2) and a point (P3)

Definition at line 11 of file tools.cpp.

void randomSelection ( vector< unsigned int > &  src,
vector< unsigned int > &  dst,
unsigned int  max 
)

Definition at line 615 of file tools.cpp.

void readPoints ( const char *  filename,
vector< cv::Point2f > &  pts 
)

Definition at line 140 of file tools.cpp.

void redistortPoints ( const vector< cv::Point2f > &  src,
vector< cv::Point2f > &  dst,
const cv::Mat &  cameraMatrix,
const cv::Mat &  distCoeffs,
const cv::Mat &  newCamMat = cv::Mat::eye(3, 3, CV_64FC1) 
)

Redistorts points using an established distortion model.

*

*

Definition at line 391 of file tools.cpp.

double timeElapsedMS ( struct timeval &  timer,
bool  reset = true 
)

Calculates time elapsed since the last time the timer was reset.

Definition at line 492 of file tools.cpp.

void writePoints ( const char *  filename,
const vector< cv::Point2f > &  pts 
)

Definition at line 127 of file tools.cpp.



thermalvis
Author(s): Stephen Vidas
autogenerated on Sun Jan 5 2014 11:38:45