Point Cloud Library (PCL)  1.14.1-dev
Functions
pcl::recognition::aux Namespace Reference

Functions

template<typename T >
bool compareOrderedPairs (const std::pair< T, T > &a, const std::pair< T, T > &b)
 
template<typename T >
sqr (T a)
 
template<typename T >
clamp (T value, T min, T max)
 
template<typename T >
void expandBoundingBox (T dst[6], const T src[6])
 Expands the destination bounding box 'dst' such that it contains 'src'. More...
 
template<typename T >
void expandBoundingBoxToContainPoint (T bbox[6], const T p[3])
 Expands the bounding box 'bbox' such that it contains the point 'p'. More...
 
template<typename T >
void set3 (T v[3], T value)
 v[0] = v[1] = v[2] = value More...
 
template<typename T >
void copy3 (const T src[3], T dst[3])
 dst = src More...
 
template<typename T >
void copy3 (const T src[3], pcl::PointXYZ &dst)
 dst = src More...
 
template<typename T >
void flip3 (T a[3])
 a = -a More...
 
template<typename T >
bool equal3 (const T a[3], const T b[3])
 a = b More...
 
template<typename T >
void add3 (T a[3], const T b[3])
 a += b More...
 
template<typename T >
void sum3 (const T a[3], const T b[3], T c[3])
 c = a + b More...
 
template<typename T >
void diff3 (const T a[3], const T b[3], T c[3])
 c = a - b More...
 
template<typename T >
void cross3 (const T v1[3], const T v2[3], T out[3])
 
template<typename T >
length3 (const T v[3])
 Returns the length of v. More...
 
template<typename T >
distance3 (const T a[3], const T b[3])
 Returns the Euclidean distance between a and b. More...
 
template<typename T >
sqrDistance3 (const T a[3], const T b[3])
 Returns the squared Euclidean distance between a and b. More...
 
template<typename T >
dot3 (const T a[3], const T b[3])
 Returns the dot product a*b. More...
 
template<typename T >
dot3 (T x, T y, T z, T u, T v, T w)
 Returns the dot product (x, y, z)*(u, v, w) = x*u + y*v + z*w. More...
 
template<typename T >
void mult3 (T *v, T scalar)
 v = scalar*v. More...
 
template<typename T >
void mult3 (const T *v, T scalar, T *out)
 out = scalar*v. More...
 
template<typename T >
void normalize3 (T v[3])
 Normalize v. More...
 
template<typename T >
sqrLength3 (const T v[3])
 Returns the square length of v. More...
 
template<typename T >
void projectOnPlane3 (const T x[3], const T planeNormal[3], T out[3])
 Projects 'x' on the plane through 0 and with normal 'planeNormal' and saves the result in 'out'. More...
 
template<typename T >
void identity3x3 (T m[9])
 Sets 'm' to the 3x3 identity matrix. More...
 
template<typename T >
void mult3x3 (const T m[9], const T v[3], T out[3])
 out = mat*v. More...
 
template<typename T >
void mult3x3 (const T x[3], const T y[3], const T z[3], const T m[3][3], T out[9])
 Let x, y, z be the columns of the matrix a = [x|y|z]. More...
 
template<class T >
void transform (const T t[12], const T p[3], T out[3])
 The first 9 elements of 't' are treated as a 3x3 matrix (row major order) and the last 3 as a translation. More...
 
template<class T >
void transform (const T t[12], T x, T y, T z, T out[3])
 The first 9 elements of 't' are treated as a 3x3 matrix (row major order) and the last 3 as a translation. More...
 
template<class T >
void transform (const Eigen::Matrix< T, 4, 4 > &mat, const pcl::PointXYZ &p, pcl::PointXYZ &out)
 Compute out = (upper left 3x3 of mat)*p + last column of mat. More...
 
template<class T >
void transform (const T t[12], const pcl::PointXYZ &p, T out[3])
 The first 9 elements of 't' are treated as a 3x3 matrix (row major order) and the last 3 as a translation. More...
 
template<typename T >
bool pointsAreCoplanar (const T p1[3], const T n1[3], const T p2[3], const T n2[3], T max_angle)
 Returns true if the points 'p1' and 'p2' are co-planar and false otherwise. More...
 
template<typename Scalar >
void array12ToMatrix4x4 (const Scalar src[12], Eigen::Matrix< Scalar, 4, 4 > &dst)
 
template<typename Scalar >
void matrix4x4ToArray12 (const Eigen::Matrix< Scalar, 4, 4 > &src, Scalar dst[12])
 
template<typename T >
void eigenMatrix3x3ToArray9RowMajor (const Eigen::Matrix< T, 3, 3 > &src, T dst[9])
 The method copies the input array 'src' to the eigen matrix 'dst' in row major order. More...
 
template<typename T >
void toEigenMatrix3x3RowMajor (const T src[9], Eigen::Matrix< T, 3, 3 > &dst)
 The method copies the input array 'src' to the eigen matrix 'dst' in row major order. More...
 
template<typename T >
void axisAngleToRotationMatrix (const T axis_angle[3], T rotation_matrix[9])
 brief Computes a rotation matrix from the provided input vector 'axis_angle'. More...
 
template<typename T >
void rotationMatrixToAxisAngle (const T rotation_matrix[9], T axis[3], T &angle)
 brief Extracts the angle-axis representation from 'rotation_matrix', i.e., computes a rotation 'axis' and an 'angle' of rotation about that axis from the provided input. More...
 

Function Documentation

◆ add3()

template<typename T >
void pcl::recognition::aux::add3 ( a[3],
const T  b[3] 
)

◆ array12ToMatrix4x4()

template<typename Scalar >
void pcl::recognition::aux::array12ToMatrix4x4 ( const Scalar  src[12],
Eigen::Matrix< Scalar, 4, 4 > &  dst 
)

Definition at line 366 of file auxiliary.h.

◆ axisAngleToRotationMatrix()

template<typename T >
void pcl::recognition::aux::axisAngleToRotationMatrix ( const T  axis_angle[3],
rotation_matrix[9] 
)

brief Computes a rotation matrix from the provided input vector 'axis_angle'.

The direction of 'axis_angle' is the rotation axis and its magnitude is the angle of rotation about that axis. 'rotation_matrix' is the output rotation matrix saved in row major order.

Definition at line 411 of file auxiliary.h.

References eigenMatrix3x3ToArray9RowMajor(), identity3x3(), length3(), and mult3().

Referenced by pcl::recognition::RotationSpaceCell::Entry::computeAverageRigidTransform().

◆ clamp()

template<typename T >
T pcl::recognition::aux::clamp ( value,
min,
max 
)

◆ compareOrderedPairs()

template<typename T >
bool pcl::recognition::aux::compareOrderedPairs ( const std::pair< T, T > &  a,
const std::pair< T, T > &  b 
)

Definition at line 55 of file auxiliary.h.

◆ copy3() [1/2]

template<typename T >
void pcl::recognition::aux::copy3 ( const T  src[3],
pcl::PointXYZ dst 
)

dst = src

Definition at line 125 of file auxiliary.h.

◆ copy3() [2/2]

template<typename T >
void pcl::recognition::aux::copy3 ( const T  src[3],
dst[3] 
)

◆ cross3()

template<typename T >
void pcl::recognition::aux::cross3 ( const T  v1[3],
const T  v2[3],
out[3] 
)

Definition at line 176 of file auxiliary.h.

Referenced by pcl::recognition::ObjRecRANSAC::computeRigidTransform().

◆ diff3()

template<typename T >
void pcl::recognition::aux::diff3 ( const T  a[3],
const T  b[3],
c[3] 
)

c = a - b

Definition at line 168 of file auxiliary.h.

Referenced by pcl::recognition::ObjRecRANSAC::computeRigidTransform().

◆ distance3()

template<typename T >
T pcl::recognition::aux::distance3 ( const T  a[3],
const T  b[3] 
)

Returns the Euclidean distance between a and b.

Definition at line 192 of file auxiliary.h.

References length3().

◆ dot3() [1/2]

template<typename T >
T pcl::recognition::aux::dot3 ( const T  a[3],
const T  b[3] 
)

Returns the dot product a*b.

Definition at line 207 of file auxiliary.h.

Referenced by pcl::recognition::ObjRecRANSAC::compute_oriented_point_pair_signature(), pointsAreCoplanar(), and projectOnPlane3().

◆ dot3() [2/2]

template<typename T >
T pcl::recognition::aux::dot3 ( x,
y,
z,
u,
v,
w 
)

Returns the dot product (x, y, z)*(u, v, w) = x*u + y*v + z*w.

Definition at line 214 of file auxiliary.h.

◆ eigenMatrix3x3ToArray9RowMajor()

template<typename T >
void pcl::recognition::aux::eigenMatrix3x3ToArray9RowMajor ( const Eigen::Matrix< T, 3, 3 > &  src,
dst[9] 
)

The method copies the input array 'src' to the eigen matrix 'dst' in row major order.

dst[0] = src(0,0); dst[1] = src(0,1); dst[2] = src(0,2); dst[3] = src(1,0); dst[4] = src(1,1); dst[5] = src(1,2); dst[6] = src(2,0); dst[7] = src(2,1); dst[8] = src(2,2);

Definition at line 388 of file auxiliary.h.

Referenced by axisAngleToRotationMatrix().

◆ equal3()

template<typename T >
bool pcl::recognition::aux::equal3 ( const T  a[3],
const T  b[3] 
)

a = b

Definition at line 143 of file auxiliary.h.

◆ expandBoundingBox()

template<typename T >
void pcl::recognition::aux::expandBoundingBox ( dst[6],
const T  src[6] 
)

Expands the destination bounding box 'dst' such that it contains 'src'.

Definition at line 82 of file auxiliary.h.

Referenced by pcl::recognition::BVH< UserData >::Node::Node().

◆ expandBoundingBoxToContainPoint()

template<typename T >
void pcl::recognition::aux::expandBoundingBoxToContainPoint ( bbox[6],
const T  p[3] 
)

Expands the bounding box 'bbox' such that it contains the point 'p'.

Definition at line 95 of file auxiliary.h.

Referenced by pcl::recognition::Hypothesis::computeBounds(), and pcl::recognition::ModelLibrary::Model::Model().

◆ flip3()

template<typename T >
void pcl::recognition::aux::flip3 ( a[3])

a = -a

Definition at line 134 of file auxiliary.h.

Referenced by rotationMatrixToAxisAngle().

◆ identity3x3()

template<typename T >
void pcl::recognition::aux::identity3x3 ( m[9])

Sets 'm' to the 3x3 identity matrix.

Definition at line 266 of file auxiliary.h.

Referenced by axisAngleToRotationMatrix().

◆ length3()

template<typename T >
T pcl::recognition::aux::length3 ( const T  v[3])

Returns the length of v.

Definition at line 185 of file auxiliary.h.

Referenced by axisAngleToRotationMatrix(), pcl::recognition::ORROctree::Node::computeRadius(), distance3(), and normalize3().

◆ matrix4x4ToArray12()

template<typename Scalar >
void pcl::recognition::aux::matrix4x4ToArray12 ( const Eigen::Matrix< Scalar, 4, 4 > &  src,
Scalar  dst[12] 
)

Definition at line 375 of file auxiliary.h.

◆ mult3() [1/2]

template<typename T >
void pcl::recognition::aux::mult3 ( const T *  v,
scalar,
T *  out 
)

out = scalar*v.

Definition at line 230 of file auxiliary.h.

◆ mult3() [2/2]

template<typename T >
void pcl::recognition::aux::mult3 ( T *  v,
scalar 
)

◆ mult3x3() [1/2]

template<typename T >
void pcl::recognition::aux::mult3x3 ( const T  m[9],
const T  v[3],
out[3] 
)

out = mat*v.

'm' is an 1D array of 9 elements treated as a 3x3 matrix (row major order).

Definition at line 274 of file auxiliary.h.

Referenced by pcl::recognition::ObjRecRANSAC::computeRigidTransform().

◆ mult3x3() [2/2]

template<typename T >
void pcl::recognition::aux::mult3x3 ( const T  x[3],
const T  y[3],
const T  z[3],
const T  m[3][3],
out[9] 
)

Let x, y, z be the columns of the matrix a = [x|y|z].

The method computes out = a*m. Note that 'out' is a 1D array of 9 elements and the resulting matrix is stored in row major order, i.e., the first matrix row is (out[0] out[1] out[2]), the second (out[3] out[4] out[5]) and the third (out[6] out[7] out[8]).

Definition at line 286 of file auxiliary.h.

◆ normalize3()

template<typename T >
void pcl::recognition::aux::normalize3 ( v[3])

◆ pointsAreCoplanar()

template<typename T >
bool pcl::recognition::aux::pointsAreCoplanar ( const T  p1[3],
const T  n1[3],
const T  p2[3],
const T  n2[3],
max_angle 
)

Returns true if the points 'p1' and 'p2' are co-planar and false otherwise.

The method assumes that 'n1' is a normal at 'p1' and 'n2' is a normal at 'p2'. 'max_angle' is the threshold used for the test. The bigger the value the larger the deviation between the normals can be which still leads to a positive test result. The angle has to be in radians.

Definition at line 345 of file auxiliary.h.

References clamp(), dot3(), and normalize3().

◆ projectOnPlane3()

template<typename T >
void pcl::recognition::aux::projectOnPlane3 ( const T  x[3],
const T  planeNormal[3],
out[3] 
)

Projects 'x' on the plane through 0 and with normal 'planeNormal' and saves the result in 'out'.

Definition at line 256 of file auxiliary.h.

References dot3(), and sum3().

Referenced by pcl::recognition::ObjRecRANSAC::computeRigidTransform().

◆ rotationMatrixToAxisAngle()

template<typename T >
void pcl::recognition::aux::rotationMatrixToAxisAngle ( const T  rotation_matrix[9],
axis[3],
T &  angle 
)

brief Extracts the angle-axis representation from 'rotation_matrix', i.e., computes a rotation 'axis' and an 'angle' of rotation about that axis from the provided input.

The output 'angle' is in the range [0, pi] and 'axis' is normalized.

Definition at line 437 of file auxiliary.h.

References flip3(), and toEigenMatrix3x3RowMajor().

Referenced by pcl::recognition::RigidTransformSpace::addRigidTransform().

◆ set3()

template<typename T >
void pcl::recognition::aux::set3 ( v[3],
value 
)

v[0] = v[1] = v[2] = value

Definition at line 109 of file auxiliary.h.

Referenced by pcl::recognition::RotationSpaceCell::Entry::Entry().

◆ sqr()

template<typename T >
T pcl::recognition::aux::sqr ( a)

Definition at line 64 of file auxiliary.h.

Referenced by sqrDistance3().

◆ sqrDistance3()

template<typename T >
T pcl::recognition::aux::sqrDistance3 ( const T  a[3],
const T  b[3] 
)

Returns the squared Euclidean distance between a and b.

Definition at line 200 of file auxiliary.h.

References sqr().

◆ sqrLength3()

template<typename T >
T pcl::recognition::aux::sqrLength3 ( const T  v[3])

Returns the square length of v.

Definition at line 249 of file auxiliary.h.

◆ sum3()

template<typename T >
void pcl::recognition::aux::sum3 ( const T  a[3],
const T  b[3],
c[3] 
)

c = a + b

Definition at line 159 of file auxiliary.h.

Referenced by pcl::recognition::ObjRecRANSAC::computeRigidTransform(), and projectOnPlane3().

◆ toEigenMatrix3x3RowMajor()

template<typename T >
void pcl::recognition::aux::toEigenMatrix3x3RowMajor ( const T  src[9],
Eigen::Matrix< T, 3, 3 > &  dst 
)

The method copies the input array 'src' to the eigen matrix 'dst' in row major order.

dst(0,0) = src[0]; dst(0,1) = src[1]; dst(0,2) = src[2]; dst(1,0) = src[3]; dst(1,1) = src[4]; dst(1,2) = src[5]; dst(2,0) = src[6]; dst(2,1) = src[7]; dst(2,2) = src[8];

Definition at line 401 of file auxiliary.h.

Referenced by rotationMatrixToAxisAngle().

◆ transform() [1/4]

template<class T >
void pcl::recognition::aux::transform ( const Eigen::Matrix< T, 4, 4 > &  mat,
const pcl::PointXYZ p,
pcl::PointXYZ out 
)

Compute out = (upper left 3x3 of mat)*p + last column of mat.

Definition at line 323 of file auxiliary.h.

◆ transform() [2/4]

template<class T >
void pcl::recognition::aux::transform ( const T  t[12],
const pcl::PointXYZ p,
out[3] 
)

The first 9 elements of 't' are treated as a 3x3 matrix (row major order) and the last 3 as a translation.

First, 'p' is multiplied by that matrix and then translated. The result is saved in 'out'.

Definition at line 333 of file auxiliary.h.

◆ transform() [3/4]

template<class T >
void pcl::recognition::aux::transform ( const T  t[12],
const T  p[3],
out[3] 
)

The first 9 elements of 't' are treated as a 3x3 matrix (row major order) and the last 3 as a translation.

First, 'p' is multiplied by that matrix and then translated. The result is saved in 'out'.

Definition at line 304 of file auxiliary.h.

Referenced by pcl::recognition::TrimmedICP< PointT, Scalar >::align(), pcl::recognition::Hypothesis::computeBounds(), and pcl::recognition::Hypothesis::computeCenterOfMass().

◆ transform() [4/4]

template<class T >
void pcl::recognition::aux::transform ( const T  t[12],
x,
y,
z,
out[3] 
)

The first 9 elements of 't' are treated as a 3x3 matrix (row major order) and the last 3 as a translation.

First, (x, y, z) is multiplied by that matrix and then translated. The result is saved in 'out'.

Definition at line 314 of file auxiliary.h.