$search

but_plane_detector::Normals Class Reference

#include <normals.h>

List of all members.

Public Member Functions

cv::Vec4f getNormal (int i, int j, int step, float depthThreshold)
cv::Vec4f getNormalLSQ (int i, int j, int step, float depthThreshold)
cv::Vec4f getNormalLSQAround (int i, int j, int step, float depthThreshold)
cv::Vec4f getNormalLTS (int i, int j, int step, float depthThreshold, float outlierThreshold, int maxIter)
cv::Vec4f getNormalLTSAround (int i, int j, int step, float depthThreshold, float outlierThreshold, int maxIter)
 Normals (pcl::PointCloud< pcl::PointXYZ > &pointcloud, int normalType=NormalType::PCL, int neighborhood=4, float threshold=0.2, float outlierThreshold=0.02, int iter=3)
 Normals (cv::Mat &points, const sensor_msgs::CameraInfoConstPtr &cam_info, int normalType=NormalType::PCL, int neighborhood=4, float threshold=0.2, float outlierThreshold=0.02, int iter=3)

Static Public Member Functions

static Plane< float > LeastSquaresPlane (std::vector< cv::Vec3f > &points)

Public Attributes

sensor_msgs::CameraInfoConstPtr m_cam_info
cv::Mat m_planes
cv::Mat m_points
int m_quantbins
std::vector< cv::Vec3f > m_quantVectors

Private Member Functions

unsigned int getQuantVector (std::vector< cv::Vec3f > &vec, cv::Vec3f &vector)
void initQuantVectors (int n_bins, std::vector< cv::Vec3f > &vec)
void nextStep (int step, int &x, int &y, int &plusX, int &plusY)

Detailed Description

Class encapsulating normal computation from depth image

Definition at line 300 of file normals.h.


Constructor & Destructor Documentation

but_plane_detector::Normals::Normals ( cv::Mat &  points,
const sensor_msgs::CameraInfoConstPtr cam_info,
int  normalType = NormalType::PCL,
int  neighborhood = 4,
float  threshold = 0.2,
float  outlierThreshold = 0.02,
int  iter = 3 
)

Constructor - computes real point positions (in scene coordinates) and normals and initiates all variables

Parameters:
points Input CV_16UC depth matrix (raw input from kinect)
cam_info Camera info message (ROS)
normalType Type of normal computation method (NormalType enum)
See also:
NormalType()
Parameters:
neighborhood Neighborhood from which normals are computed
threshold Threshold for depth difference outlier marking (if depth of neighbor is greater than this threshold, point is skipped)
outlierThreshold Outlier threshold for least trimmed squares regression (max error between point depth and proposed plane)
iter Maximum RANSAC iterations

Definition at line 71 of file normals.cpp.

but_plane_detector::Normals::Normals ( pcl::PointCloud< pcl::PointXYZ > &  pointcloud,
int  normalType = NormalType::PCL,
int  neighborhood = 4,
float  threshold = 0.2,
float  outlierThreshold = 0.02,
int  iter = 3 
)

Constructor - computes real point positions (in scene coordinates) and normals and initiates all variables

Parameters:
pointcloud Point cloud
threshold Threshold for depth difference outlier marking (if depth of neighbor is greater than this threshold, point is skipped)
neighborhood Neighborhood from which normals are computed

Definition at line 282 of file normals.cpp.


Member Function Documentation

cv::Vec4f but_plane_detector::Normals::getNormal ( int  i,
int  j,
int  step,
float  depthThreshold 
)

Function computes normal for point (i, j) using direct computation (mean of surrounding triangles)

Parameters:
i row index
j column index
step Neighborhood to compute with
depthThreshold Threshold for depth difference outlier marking (if depth of neighbor is greater than this threshold, point is skipped)

Definition at line 444 of file normals.cpp.

cv::Vec4f but_plane_detector::Normals::getNormalLSQ ( int  i,
int  j,
int  step,
float  depthThreshold 
)

Function computes normal for point (i, j) using least squares regression

Parameters:
i row index
j column index
step Neighborhood to compute with
depthThreshold Threshold for depth difference outlier marking (if depth of neighbor is greater than this threshold, point is skipped)

Definition at line 535 of file normals.cpp.

cv::Vec4f but_plane_detector::Normals::getNormalLSQAround ( int  i,
int  j,
int  step,
float  depthThreshold 
)

Function computes normal for point (i, j) using least squares regression with using only outer neighborhood ring

Parameters:
i row index
j column index
step Neighborhood to compute with
depthThreshold Threshold for depth difference outlier marking (if depth of neighbor is greater than this threshold, point is skipped)

Definition at line 578 of file normals.cpp.

cv::Vec4f but_plane_detector::Normals::getNormalLTS ( int  i,
int  j,
int  step,
float  depthThreshold,
float  outlierThreshold,
int  maxIter 
)

Function computes normal for point (i, j) using least trimmed squares regression

Parameters:
i row index
j column index
step Neighborhood to compute with
depthThreshold Threshold for depth difference outlier marking (if depth of neighbor is greater than this threshold, point is skipped)
outlierThreshold Threshold for marking outliers in RANSAC (maximum difference from proposed plane)
maxIter Maximum RANSAC iterations

Definition at line 629 of file normals.cpp.

cv::Vec4f but_plane_detector::Normals::getNormalLTSAround ( int  i,
int  j,
int  step,
float  depthThreshold,
float  outlierThreshold,
int  maxIter 
)

Function computes normal for point (i, j) using least trimmed squares regression with using only outer neighborhood ring

Parameters:
i row index
j column index
step Neighborhood to compute with
depthThreshold Threshold for depth difference outlier marking (if depth of neighbor is greater than this threshold, point is skipped)
outlierThreshold Threshold for marking outliers in RANSAC (maximum difference from proposed plane)
maxIter Maximum RANSAC iterations

Definition at line 699 of file normals.cpp.

unsigned int but_plane_detector::Normals::getQuantVector ( std::vector< cv::Vec3f > &  vec,
cv::Vec3f &  vector 
) [private]

Helper function which returns bin index for given vector (not used, TODO)

Parameters:
vec Vector of computed quantization vectors
vector Vector whos bin we are computing

Definition at line 905 of file normals.cpp.

void but_plane_detector::Normals::initQuantVectors ( int  n_bins,
std::vector< cv::Vec3f > &  vec 
) [private]

Helper function which initializes quantization vectors (not used, TODO)

Parameters:
n_bins Number of quantization bins
vec Vector of computed quantization vectors

Definition at line 885 of file normals.cpp.

Plane< float > but_plane_detector::Normals::LeastSquaresPlane ( std::vector< cv::Vec3f > &  points  )  [static]

Function computes plane using least squares regression from given point set

Parameters:
points Vector of Vec3f points
Returns:
Plane object
See also:
Plane()

Definition at line 777 of file normals.cpp.

void but_plane_detector::Normals::nextStep ( int  step,
int &  x,
int &  y,
int &  plusX,
int &  plusY 
) [private]

Helper function for "Around" functions - sets next point on outer ring

Parameters:
step Maximum distance from center (neighborhood)
x Current x offset
y Current y offset
plusX Next x shift
plusY Next y shift

Definition at line 854 of file normals.cpp.


Member Data Documentation

Saved camera info (ROS)

Definition at line 397 of file normals.h.

Computed plane equation approximations (so the normals also) for each point

Definition at line 392 of file normals.h.

Computed real points - scene coordinates (in meters)

Definition at line 387 of file normals.h.

Helper if vector quantization is on - not used in this version (TODO)

Definition at line 407 of file normals.h.

Helper if vector quantization is on - not used in this version (TODO)

Definition at line 402 of file normals.h.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines


srs_env_model_percp
Author(s): Rostislav Hulik (ihulik@fit.vutbr.cz), Tomas Hodan, Michal Spanel (spanel@fit.vutbr.cz)
autogenerated on Tue Mar 5 14:55:20 2013