Core module

Point

template<class T>
class Point_

The 2D point class.

Public Functions

Point_(T x_ = T{0}, T y_ = T{0})

The Point constructor.

~Point_()

The Point destructor.

Point_(const Point_ &p)

The Point constructor (copy).

Point_<T> &operator=(const Point_ &p)

Assignment operator.

Point_<T> &operator+=(const Point_ &p)
Point_<T> &operator-=(const Point_ &p)
Point_<T> operator-() const
Point_<T> &operator*=(T t)
Point_<T> &operator/=(T t)
T dot(const Point_ &p) const

Dot product.

T det(const Point_ &p) const

Determinant.

bool operator==(const Point_ &p) const
bool operator!=(const Point_ &p) const
bool operator<(const Point_ &p) const
bool operator>(const Point_ &p) const
double norm() const

Norm.

Point_<T> normalize() const

Normalization.

operator cv::Point_<T>() const

Implicit convertion to cv::Point_<T>.

Public Members

T x = {0}
T y = {0}

Array2D

template<class T>
class Array2D

The 2-dimensional array class.

This class is not supported by Python because this can be altered by Python’s buildin list.

Public Functions

Array2D()

The Array2D constructor.

Array2D(int rows, int cols)

The Array2D constructor.

Array2D(int rows, int cols, const T &value)

Allocate memory space and fill it with the specified value.

Parameters
  • [in] rows: Number of rows

  • [in] cols: Number of columns

  • [in] value: A value with which the array is filled

Array2D(const Array2D &ary)

The Array2D constructor (copy).

Array2D(Array2D &&ary)

The Array2D constructor (move).

Array2D<T> &operator=(const Array2D &ary)

Assignment operator (copy).

Array2D<T> &operator=(Array2D &&ary)

Assignment operator (move).

T &operator()(int i, int j) const

Accessor.

int cols() const

Return # of rows.

int rows() const

Return # of columns.

Random

class Random

Random number generator using Mersenne-twister.

Public Functions

LIME_METHOD_API Random(uint32_t seed = UINT_MAX)
LIME_METHOD_API int lime::Random::nextInt()

Generate a random 32-bit signed integer.

LIME_METHOD_API int lime::Random::nextInt(const int n)

Generate a random integer from [0, n-1].

LIME_METHOD_API double lime::Random::nextReal()

Generate a floating point random number from [0, 1).

LIME_METHOD_API double lime::Random::normal()

Generate a random number from normal distribution.

RandomQueue

template<class T>
class random_queue

Random queue.

Public Functions

random_queue()

Constructor.

~random_queue()

Destructor.

void push(const T &value)

Push value to the queue.

T pop()

Return a random value form the queue and remove it.

bool empty() const

Check if the queue is empty or not.

int size() const

Returns # of elements in the queue.