44 #include <opencv2/calib3d/calib3d_c.h> 48 const double PI = 3.14159265;
53 template<
class C>
inline 62 template<
class C>
inline 71 template<
class C>
inline 80 template<
class C,
class D =
int>
115 template<
class Po
intType>
117 return ((p1.x-p2.x)*(p1.x-p2.x)) +
118 ((p1.y-p2.y)*(p1.y-p2.y));
162 double ALVAR_EXPORT angle(CvPoint *A,CvPoint *B, CvPoint *C,CvPoint *D,
int isDirectionDependent);
191 template<
class C>
inline 197 }
else if (v.size() > 1) {
198 ret.push_back(v.at(1)-v.at(0));
199 for(
size_t i = 1; i < v.size(); ++i)
201 ret.push_back(v.at(i)-v.at(i-1));
204 return int(ret.size());
245 Index(
int a,
int b,
int c);
247 bool operator<(
const Index &index)
const;
257 int DimIndex(
int dim,
double val);
258 double DimVal(
int dim,
int index);
262 void AddDimension(
int binsize);
266 void Inc(
double dim0,
double dim1=0,
double dim2=0);
270 int GetMax(
double *dim0,
double *dim1=0,
double *dim2=0);
285 void Inc(
double dim0,
double dim1=0,
double dim2=0);
290 int GetMax(
double *dim0,
double *dim1=0,
double *dim2=0);
293 #if (_MSC_VER >= 1400) 294 inline void STRCPY(
char *to, rsize_t size,
const char *src) {
295 strcpy_s(to,size,src);
298 inline void STRCPY(
char *to,
size_t size,
const char *src) {
299 strncpy(to,src,size-1);
361 bool Descend(
const char *
id);
408 if (!SerializeClass(serializable) || !
Output()) {
417 if (!
Input() || !SerializeClass(serializable)) {
429 std::string
s = serializable.SerializeId();
430 if (!Descend(s.c_str()) || !serializable.Serialize(
this) || !Ascend()) {
436 bool Serialize(
int &data,
const std::string &name);
438 bool Serialize(
unsigned short &data,
const std::string &name);
440 bool Serialize(
unsigned long &data,
const std::string &name);
442 bool Serialize(
double &data,
const std::string &name);
444 bool Serialize(std::string &data,
const std::string &name);
446 bool Serialize(CvMat &data,
const std::string &name);
double ALVAR_EXPORT distance(CvPoint *A, CvPoint *B)
Compute the distance from A to B.
Serialization & operator<<(C &serializable)
Operator for outputting a serializable class into the defined filename or std::iostream.
int ALVAR_EXPORT exp_filt2(std::vector< double > &v, std::vector< double > &ret, bool clamp)
int ALVAR_EXPORT cross(CvPoint *A, CvPoint *B, CvPoint *C)
Computes the cross product AB x AC.
void ALVAR_EXPORT FitCVEllipse(const std::vector< PointDouble > &points, CvBox2D &ellipse_box)
Uses OpenCV routine to fit ellipse to a vector of points.
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).
bool IsInput()
Method for checking if we are inputting or outputting. Can be used from your serializable class...
ALVAR_EXPORT Point< CvPoint > PointInt
The default integer point type.
double ALVAR_EXPORT polyLinePointDist(CvPoint *PointList, int nPnts, CvPoint *C, int *index, int isClosedPolygon)
Calculates minimum distance from Point C to Polygon whose points are in list PointList.
int ALVAR_EXPORT dot(CvPoint *A, CvPoint *B, CvPoint *C)
Computes dot product AB.BC.
double ALVAR_EXPORT Deg2Rad(const C &v)
Converts an angle from degrees to radians.
N-dimensional Histograms calculating also the subpixel average for max bin.
void ALVAR_EXPORT out_matrix(const CvMat *m, const char *name)
Output OpenCV matrix for debug purposes.
std::map< Index, double > acc_dim0
int ALVAR_EXPORT Sign(const C &v)
Returns the sign of a number.
double ALVAR_EXPORT linePointDist(CvPoint *A, CvPoint *B, CvPoint *C, bool isSegment)
Computes the distance from point C to line (segment) AB.
Point(double vx, double vy)
D val
Additional value can be related to the point.
double ALVAR_EXPORT Rad2Deg(const C &v)
Converts an angle from radians to degrees.
std::map< Index, double > acc_dim1
Point(int vx=0, int vy=0)
Class for N-dimensional index to be used e.g. with STL maps.
double PointSquaredDistance(PointType p1, PointType p2)
Returns the squared distance of two points.
bool SerializeClass(C &serializable)
Method for serializing a serializable class. Used by operators << and >> .
std::map< Index, double > acc_dim2
std::vector< int > dim_binsize
Simple Point class meant to be inherited from OpenCV point-classes. For example: Point<CvPoint2D64f> ...
ALVAR_EXPORT Point< CvPoint2D64f > PointDouble
The default double point type.
void STRCPY(char *to, size_t size, const char *src)
This file implements the ALVAR exception class.
std::map< Index, int > bins
Class for serializing class content to/from file or std::iostream.
Class for N-dimensional Histograms.
Serialization & operator>>(C &serializable)
Operator for reading a serializable class from the defined filename or std::iostream.
This file defines library export definitions, version numbers and build information.
std::vector< int > val
The indices for each dimension are stored in val (last being the most significant) ...
double ALVAR_EXPORT Limit(double val, double min_val, double max_val)
Limits a number to between two values.
int ALVAR_EXPORT diff(const std::vector< C > &v, std::vector< C > &ret)
Calculates the difference between the consecutive vector elements.
double ALVAR_EXPORT angle(CvPoint *A, CvPoint *B, CvPoint *C, CvPoint *D, int isDirectionDependent)
Computes the angle between lines AB and CD.