My Project
Classes | Namespaces | Typedefs | Functions | Variables
Util.h File Reference

This file implements generic utility functions and a serialization interface. More...

#include "Alvar.h"
#include "AlvarException.h"
#include <cmath>
#include <iomanip>
#include <iostream>
#include <map>
#include <opencv2/core.hpp>
#include <sstream>
#include <vector>

Go to the source code of this file.

Classes

struct  Point< C, D >
 Simple Point class meant to be inherited from OpenCV point-classes. For example: Point<cv::Point2d> p. More...
 
struct  Index
 Class for N-dimensional index to be used e.g. with STL maps. More...
 
class  Histogram
 Class for N-dimensional Histograms. More...
 
class  HistogramSubpixel
 N-dimensional Histograms calculating also the subpixel average for max bin. More...
 
class  Serialization
 Class for serializing class content to/from file or std::iostream. More...
 

Namespaces

 alvar
 Main ALVAR namespace.
 

Typedefs

typedef ALVAR_EXPORT Point< cv::Point > PointInt
 The default integer point type.
 
typedef ALVAR_EXPORT Point< cv::Point2d > PointDouble
 The default double point type.
 

Functions

template<class C >
int ALVAR_EXPORT Sign (const C &v)
 Returns the sign of a number.
 
template<class C >
double ALVAR_EXPORT Rad2Deg (const C &v)
 Converts an angle from radians to degrees.
 
template<class C >
double ALVAR_EXPORT Deg2Rad (const C &v)
 Converts an angle from degrees to radians.
 
template<class PointType >
double PointSquaredDistance (PointType p1, PointType p2)
 Returns the squared distance of two points. More...
 
int ALVAR_EXPORT dot (const cv::Point &A, const cv::Point &B, const cv::Point &C)
 Computes dot product AB.BC. More...
 
int ALVAR_EXPORT cross (const cv::Point &A, const cv::Point &B, const cv::Point &C)
 Computes the cross product AB x AC. More...
 
double ALVAR_EXPORT distance (const cv::Point &A, const cv::Point &B)
 Compute the distance from A to B. More...
 
double ALVAR_EXPORT linePointDist (const cv::Point &A, const cv::Point &B, const cv::Point &C, bool isSegment)
 Computes the distance from point C to line (segment) AB. More...
 
double ALVAR_EXPORT angle (const cv::Point &A, const cv::Point &B, const cv::Point &C, const cv::Point &D, int isDirectionDependent)
 Computes the angle between lines AB and CD. More...
 
double ALVAR_EXPORT polyLinePointDist (const std::vector< cv::Point > &points, const cv::Point &C, int *index, int isClosedPolygon)
 Calculates minimum distance from Point C to Polygon whose points are in list PointList. More...
 
void ALVAR_EXPORT FitCVEllipse (const std::vector< PointDouble > &points, cv::RotatedRect &ellipse_box)
 Uses OpenCV routine to fit ellipse to a vector of points. More...
 
int ALVAR_EXPORT exp_filt2 (std::vector< double > &v, std::vector< double > &ret, bool clamp)
 
template<class C >
int ALVAR_EXPORT diff (const std::vector< C > &v, std::vector< C > &ret)
 Calculates the difference between the consecutive vector elements. More...
 
int ALVAR_EXPORT find_zero_crossings (const std::vector< double > &v, std::vector< int > &corners, int offs=20)
 Finds zero crossings of given vector elements (sequence). More...
 
void ALVAR_EXPORT out_matrix (const cv::Mat &m, const char *name)
 Output OpenCV matrix for debug purposes.
 
double ALVAR_EXPORT Limit (double val, double min_val, double max_val)
 Limits a number to between two values. More...
 
void STRCPY (char *to, size_t size, const char *src)
 

Variables

const double PI = 3.14159265
 

Detailed Description

This file implements generic utility functions and a serialization interface.

Definition in file Util.h.