![]() |
RobWorkProject
25.2.11-
|
A point model. More...
#include <PointModel.hpp>
Inherits RANSACModel< PointModel, rw::math::Vector3D<> >.
Public Types | |
typedef rw::core::Ptr< PointModel > | Ptr |
Smart pointer type to this class. | |
![]() | |
typedef rw::core::Ptr< RANSACModel< PointModel, rw::math::Vector3D<> > > | Ptr |
Smart pointer type to this class. | |
Public Member Functions | |
PointModel () | |
Constructor. | |
PointModel (const rw::math::Vector3D<> &point) | |
Constructor. More... | |
virtual | ~PointModel () |
Destructor. | |
virtual double | fitError (const rw::math::Vector3D<> &sample) const |
Calculates the fitting error of a sample. More... | |
virtual bool | invalid () const |
Checks whether the model is invalid. More... | |
virtual int | getMinReqData () const |
Returns the number of samples required to create the model. More... | |
virtual double | refit (const std::vector< rw::math::Vector3D<>> &samples) |
Recalculates the model based on provided samples. More... | |
virtual bool | same (const PointModel &model, double threshold) const |
Tests whether the model is same to a threshold of another model. More... | |
rw::math::Vector3D | p () const |
Get point position. | |
![]() | |
RANSACModel () | |
Constructor. | |
virtual PointModel | make (const std::vector< rw::math::Vector3D<> > &data) const |
Creates a new model of this type using provided data. | |
virtual | ~RANSACModel () |
Destructor. | |
bool | operator< (const PointModel &model) const |
'Worse than' operator. More... | |
bool | operator> (const PointModel &model) const |
'Better than' operator. More... | |
virtual bool | belongsTo (const rw::math::Vector3D<> &sample, double threshold) const |
Check whether a sample belongs to the model. More... | |
virtual double | refit (const std::vector< rw::math::Vector3D<> > &data)=0 |
Recalculates the model based on provided samples. More... | |
size_t | getNumberOfInliers () const |
Get the number of inliers. | |
double | getQuality () const |
Get the model quality. More... | |
void | setQuality (double quality) |
Set the model quality. More... | |
std::vector< rw::math::Vector3D<> > & | getData () |
Access data. | |
const std::vector< rw::math::Vector3D<> > & | getData () const |
Access data. | |
std::vector< size_t > | getInlierIndices () const |
Get the vector of inlier indices. More... | |
Protected Attributes | |
rw::math::Vector3D | _model |
![]() | |
std::vector< rw::math::Vector3D<> > | _data |
double | _quality |
std::vector< size_t > | _indices |
Friends | |
std::ostream & | operator<< (std::ostream &out, const PointModel &model) |
Streaming operator. | |
Additional Inherited Members | |
![]() | |
static std::vector< PointModel > | findModels (const std::vector< rw::math::Vector3D<> > &data, int maxIterations, int dataRequired, double dataThreshold, double modelThreshold) |
Find models fitting a set of observations. More... | |
static PointModel | bestModel (const std::vector< PointModel > &models) |
Select the model with the largest number of inliers. More... | |
static PointModel | likelyModel (const std::vector< PointModel > &models) |
Select a model randomly, with a chance based on the number of inliers. More... | |
A point model.
|
inline |
Constructor.
point | [in] position |
|
virtual |
Calculates the fitting error of a sample.
Implements RANSACModel< PointModel, rw::math::Vector3D<> >.
|
inlinevirtual |
Returns the number of samples required to create the model.
No model will be found, if data size is less than this amount.
PointModel requires at least 1 sample.
Implements RANSACModel< PointModel, rw::math::Vector3D<> >.
|
virtual |
Checks whether the model is invalid.
Implements RANSACModel< PointModel, rw::math::Vector3D<> >.
|
virtual |
Recalculates the model based on provided samples.
|
virtual |
Tests whether the model is same to a threshold of another model.
This is used to filter down (merge) similar models found in the course of RANSAC algorithm execution.
Implements RANSACModel< PointModel, rw::math::Vector3D<> >.