Go to the documentation of this file. 1 #ifndef CONEPRIMITIVESHAPE_HEADER
2 #define CONEPRIMITIVESHAPE_HEADER
26 const Vec3f& n, std::pair< float, float >* dn)
const;
40 std::pair< size_t, float >* score)
const;
42 void Serialize(std::ostream* o,
bool binary =
true)
const;
46 m_cone.Serialize(array);
50 return m_cone.SerializedFloatSize();
67 std::pair< float, float >* param)
const;
82 size_t* uextent,
size_t* vextent);
83 void InBitmap(
const std::pair< float, float >& param,
float epsilon,
85 size_t vextent, std::pair< int, int >* inBmp)
const;
87 float epsilon,
size_t uextent,
size_t vextent,
90 float epsilon,
bool* uwrap,
bool* vwrap)
const;
92 float epsilon,
size_t uextent,
size_t vextent,
97 size_t vextent,
float epsilon,
int label);
99 bool InSpace(
size_t u,
size_t v,
float epsilon,
104 template<
class IteratorT >
105 void ParametersImpl(IteratorT begin, IteratorT end,
112 template<
class IteratorT >
113 void ConePrimitiveShape::ParametersImpl(IteratorT begin, IteratorT end,
116 bmpParams->resize(end - begin);
118 for (IteratorT i = begin; i != end; ++i, ++j)
124 for (
size_t j = 0; j < bmpParams->size(); ++j)
128 (*bmpParams)[j].second = ((*bmpParams)[j].second -
float(
M_PI)) * r;
133 for (
size_t j = 0; j < bmpParams->size(); ++j)
135 float l = (*bmpParams)[j].first;
136 (*bmpParams)[j].first = std::sin((*bmpParams)[j].second) * l;
137 (*bmpParams)[j].second = std::cos((*bmpParams)[j].second) * l;
152 return m_cone.SignedDistance(*((
const Vec3f*)x));
157 m_cone.Normal(*((
const Vec3f*)x), (
Vec3f*)gradient);
virtual size_t Identifier() const =0
virtual void Project(const Vec3f &p, Vec3f *pp) const =0
virtual bool Fit(const PointCloud &pc, float epsilon, float normalThresh, MiscLib::Vector< size_t >::const_iterator begin, MiscLib::Vector< size_t >::const_iterator end)=0
virtual void PreWrapBitmap(const GfxTL::AABox< GfxTL::Vector2Df > &bbox, float epsilon, size_t uextent, size_t vextent, MiscLib::Vector< char > *bmp) const
virtual float SignedDistance(const Vec3f &p) const =0
virtual bool InSpace(float u, float v, Vec3f *p, Vec3f *n) const =0
PrimtiveShape is a shape primitive in conjunction with a parametrization.
virtual void Normal(const Vec3f &p, Vec3f *n) const =0
virtual float NormalDeviation(const Vec3f &p, const Vec3f &n) const =0
virtual PrimitiveShape * LSFit(const PointCloud &pc, float epsilon, float normalThresh, MiscLib::Vector< size_t >::const_iterator begin, MiscLib::Vector< size_t >::const_iterator end, std::pair< size_t, float > *score) const =0
virtual float Distance(const Vec3f &p) const =0
virtual size_t SerializedSize() const =0
class DLL_LINKAGE ConePrimitiveShape
const typedef Point * const_iterator
virtual void Description(std::string *s) const =0
const Cone & Internal() const
virtual void SuggestSimplifications(const PointCloud &pc, MiscLib::Vector< size_t >::const_iterator begin, MiscLib::Vector< size_t >::const_iterator end, float distThresh, MiscLib::Vector< MiscLib::RefCountPtr< PrimitiveShape > > *suggestions) const
virtual void DistanceAndNormalDeviation(const Vec3f &p, const Vec3f &n, std::pair< float, float > *dn) const =0
pcl::PointIndices::Ptr indices(const PCG &g)
Retrieve the indices of the points of the point cloud stored in a point cloud graph that actually bel...
void operator()(const float *x, float *gradient) const
float operator()(const float *x) const
void Parameters(const Vec3f &p, std::pair< float, float > *param) const
unsigned int ConfidenceTests(unsigned int numTests, float epsilon, float normalThresh, float rms, const PointCloud &pc, const MiscLib::Vector< size_t > &indices) const
float RadiusAtLength(float length) const
virtual void Serialize(float *array) const
virtual size_t SerializedFloatSize() const
double v(double t, double v0, double a0, double j)
virtual void Parameters(const Vec3f &p, std::pair< float, float > *param) const =0
ConeLevMarFunc(const Cone &c)
virtual void BitmapExtent(float epsilon, GfxTL::AABox< GfxTL::Vector2Df > *bbox, MiscLib::Vector< std::pair< float, float > > *params, size_t *uextent, size_t *vextent)=0
virtual void InBitmap(const std::pair< float, float > ¶m, float epsilon, const GfxTL::AABox< GfxTL::Vector2Df > &bbox, size_t uextent, size_t vextent, std::pair< int, int > *inBmp) const =0
virtual void Transform(float scale, const Vec3f &translate)=0
Introduction Thank you for taking interest in our work and downloading this software This library implements the algorithm described in the paper R R R Klein Efficient RANSAC for Point Cloud Shape in Computer Graphics Blackwell June If you use this software you should cite the aforementioned paper in any resulting publication Please send comments or bug reports to Ruwen Roland BUT NOT LIMITED THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY OR CONSEQUENTIAL WHETHER IN STRICT OR EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE Example usage This section shows how to use the library to detect the shapes in a point cloud PointCloud pc
virtual void WrapComponents(const GfxTL::AABox< GfxTL::Vector2Df > &bbox, float epsilon, size_t uextent, size_t vextent, MiscLib::Vector< int > *componentImg, MiscLib::Vector< std::pair< int, size_t > > *labels) const
virtual void Serialize(std::ostream *o, bool binary=true) const =0
This is the one and only serialization function It stores all the parameters of the shape as well as ...
double s(double t, double s0, double v0, double a0, double j)
virtual LevMarFunc< float > * SignedDistanceFunc() const =0
unsigned int RequiredSamples() const
virtual void WrapBitmap(const GfxTL::AABox< GfxTL::Vector2Df > &bbox, float epsilon, bool *uwrap, bool *vwrap) const =0
virtual PrimitiveShape * Clone() const =0
virtual void Visit(PrimitiveShapeVisitor *visitor) const =0