36 #ifdef ICL_HAVE_OPENCL 65 if(givenInAxisAngle) {
68 this->v[0] = vn[0] * s;
69 this->v[1] = vn[1] * s;
70 this->v[2] = vn[2] * s;
83 res.
w =
w*q.
w -
v[0]*q.
v[0] -
v[1]*q.
v[1] -
v[2]*q.
v[2];
84 res.
v[0] =
w*q.
v[0] +
v[0]*q.
w +
v[1]*q.
v[2] -
v[2]*q.
v[1];
85 res.
v[1] =
w*q.
v[1] -
v[0]*q.
v[2] +
v[1]*q.
w +
v[2]*q.
v[0];
86 res.
v[2] =
w*q.
v[2] +
v[0]*q.
v[1] -
v[1]*q.
v[0] +
v[2]*q.
w;
105 return math::Mat4 (1-2*yy-2*zz, 2*x*y-2*
w*z, 2*x*z+2*
w*y, 0,
106 2*x*y+2*
w*z, 1-2*xx-2*zz, 2*y*z-2*
w*x, 0,
107 2*x*z-2*
w*y, 2*y*z+2*
w*x, 1-2*xx-2*yy, 0,
119 qOut = (*this) * qOut;
186 std::vector<unsigned char> &groupMap,
core::Img32f *depthImage) = 0;
205 std::vector<unsigned char> &groupMap,
core::Img32f *depthImage);
218 std::vector<unsigned char> &groupMap,
core::Img32f *depthImage);
236 std::vector<unsigned char> &groupMap,
core::Img32f *depthImage);
255 std::vector<unsigned char> &groupMap,
core::Img32f *depthImage);
271 std::vector<unsigned char> &groupMap,
core::Img32f *depthImage);
287 std::vector<unsigned char> &groupMap,
core::Img32f *depthImage);
338 #ifdef ICL_HAVE_OPENCL float z
Definition: Primitive3DFilter.h:223
void performAction(PointCloudObjectBase &pcObj, std::vector< unsigned char > &actionMap, std::vector< unsigned char > &groupMap, core::Img32f *depthImage)
perform the actual filter action
virtual ~FilterAction()
Definition: Primitive3DFilter.h:176
static const char * KERNEL_CODE
Definition: Primitive3DFilter.h:345
FilterDepthImgAction(std::vector< unsigned char > formula, float value)
Constructor.
Definition: Primitive3DFilter.h:282
void performAction(PointCloudObjectBase &pcObj, std::vector< unsigned char > &actionMap, std::vector< unsigned char > &groupMap, core::Img32f *depthImage)
perform the actual filter action
FixedMatrix< icl32f, 4, 4 > Mat4
typedef for 4x4 fixed matrices
Definition: HomogeneousMath.h:49
setpos action
Definition: Primitive3DFilter.h:210
undocument this line if you encounter any issues!
Definition: Any.h:37
float w
scalar part
Definition: Primitive3DFilter.h:127
Base class for point cloud data types.
Definition: PointCloudObjectBase.h:98
float a
Definition: Primitive3DFilter.h:242
std::vector< unsigned char > formula
Definition: Primitive3DFilter.h:192
float b
Definition: Primitive3DFilter.h:241
virtual ~Primitive3DFilter()
Destructor.
Definition: Primitive3DFilter.h:321
Quaternion(const math::Vec3 &v, const float w, bool givenInAxisAngle=false)
Constructor.
Definition: Primitive3DFilter.h:64
Vec scale
scale (e.g., [2r 2r 2r] for a sphere with radius r)
Definition: Primitive3DFilter.h:154
std::string description
string describing the object (e.g., a robot link)
Definition: Primitive3DFilter.h:160
Definition: Primitive3DFilter.h:51
Wrapper for an OpenCL Kernel.
Definition: CLKernel.h:72
ColorAction(std::vector< unsigned char > formula, float r, float g, float b, float a)
Constructor.
Definition: Primitive3DFilter.h:231
Primitive3DFilter(const FilterConfig &config)
Constructor.
GeomColor geom_white(float alpha=255)
inline utililty function to create a white color instance
Definition: GeomDefs.h:48
utils::CLKernel kernelCreateGroupMap
Definition: Primitive3DFilter.h:341
unsigned long timestamp
timestamp of creation
Definition: Primitive3DFilter.h:157
FixedMatrix< T, COLS, ROWS > normalized(T norm=2) const
create a normalized version of this matrix
Definition: FixedMatrix.h:850
FilterAction()
Default constructor.
Definition: Primitive3DFilter.h:171
quaternion describing the orientation of the primitive
Definition: Primitive3DFilter.h:56
Quaternion conj() const
complex conjugate
Definition: Primitive3DFilter.h:91
utils::CLProgram program
Definition: Primitive3DFilter.h:339
float value
value
Definition: Primitive3DFilter.h:290
float r
parameters
Definition: Primitive3DFilter.h:239
utils::CLKernel kernelCreateActionMap
Definition: Primitive3DFilter.h:342
std::map< unsigned char, float > mapGroupBitToPadding
map groupBit to padding
Definition: Primitive3DFilter.h:310
IntensityAction(std::vector< unsigned char > formula, float value)
Constructor.
Definition: Primitive3DFilter.h:266
PrimitiveType type
the type of primitive
Definition: Primitive3DFilter.h:145
utils::CLBuffer formulabuffer
Definition: Primitive3DFilter.h:340
void performAction(PointCloudObjectBase &pcObj, std::vector< unsigned char > &actionMap, std::vector< unsigned char > &groupMap, core::Img32f *depthImage)
perform the actual filter action
unsigned char groupBit
internal group id (see PrimitiveGroup)
Definition: Primitive3DFilter.h:163
filterdepthimg action
Definition: Primitive3DFilter.h:279
virtual ~ColorAction()
Definition: Primitive3DFilter.h:233
intensity action
Definition: Primitive3DFilter.h:263
Ipp32s icl32s
32bit signed integer type for the ICL
Definition: BasicTypes.h:58
RemoveAction(std::vector< unsigned char > formula)
Constructor.
Definition: Primitive3DFilter.h:200
void performAction(PointCloudObjectBase &pcObj, std::vector< unsigned char > &actionMap, std::vector< unsigned char > &groupMap, core::Img32f *depthImage)
perform the actual filter action
a general filter action
Definition: Primitive3DFilter.h:168
void performAction(PointCloudObjectBase &pcObj, std::vector< unsigned char > &actionMap, std::vector< unsigned char > &groupMap, core::Img32f *depthImage)
perform the actual filter action
icl32s value
value
Definition: Primitive3DFilter.h:258
Wrapper for an OpenCL Buffer.
Definition: CLBuffer.h:52
float g
Definition: Primitive3DFilter.h:240
const Quaternion operator *(const Quaternion &q)
Hamilton product.
Definition: Primitive3DFilter.h:81
SetposAction(std::vector< unsigned char > formula, float x, float y, float z)
Constructor.
Definition: Primitive3DFilter.h:213
double length(T norm=2) const
Calculates the length of the matrix data vector.
Definition: FixedMatrix.h:835
FilterConfig(const std::string &filename)
Constructor.
Class for filtering point clouds according to a set of primitives and a filter configuration.
Definition: Primitive3DFilter.h:44
float x
parameters
Definition: Primitive3DFilter.h:221
Definition: Primitive3DFilter.h:52
color action
Definition: Primitive3DFilter.h:228
FilterConfig config
Definition: Primitive3DFilter.h:346
utils::CLBuffer groupmapbuffer
Definition: Primitive3DFilter.h:340
PrimitiveType
the primitive type
Definition: Primitive3DFilter.h:49
void toSceneObject(SceneObject *object, uint32_t slices=15, GeomColor const &color=geom_white(100))
renders this 3D primitive into the scene object (by adding a child object to SceneObject *object)
void apply(const std::vector< Primitive3D > &primitives, PointCloudObjectBase &pcObj, core::Img32f *depthImage=0)
applies the filter operation to the given point cloud
FilterAction(std::vector< unsigned char > formula)
Constructor.
Definition: Primitive3DFilter.h:174
math::Mat4 getTransformationMatrix()
convert to transformation matrix
Definition: Primitive3DFilter.h:98
ICLQt_API void color(float r, float g=-1, float b=-1, float alpha=255)
sets the current color to given r,g,b,alpha value
remove action
Definition: Primitive3DFilter.h:197
float value
value
Definition: Primitive3DFilter.h:274
Primitive3D(const PrimitiveType &type, const Vec &position, const Quaternion &orientation, const Vec &scale, unsigned long timestamp, const std::string &description="")
Constructor.
Definition: Primitive3DFilter.h:135
std::map< std::string, unsigned char > mapGroupIdToBit
map primitive group id to internal groupBit
Definition: Primitive3DFilter.h:304
Quaternion orientation
orientation of the primitive
Definition: Primitive3DFilter.h:151
math::Vec3 v
vector part
Definition: Primitive3DFilter.h:124
utils::CLBuffer actionmapbuffer
Definition: Primitive3DFilter.h:340
float y
Definition: Primitive3DFilter.h:222
virtual ~SetposAction()
Definition: Primitive3DFilter.h:215
virtual void performAction(PointCloudObjectBase &pcObj, std::vector< unsigned char > &actionMap, std::vector< unsigned char > &groupMap, core::Img32f *depthImage)=0
perform the actual filter action
utils::CLBuffer pcbuffer
Definition: Primitive3DFilter.h:340
void performAction(PointCloudObjectBase &pcObj, std::vector< unsigned char > &actionMap, std::vector< unsigned char > &groupMap, core::Img32f *depthImage)
perform the actual filter action
filter config
Definition: Primitive3DFilter.h:295
Definition: Primitive3DFilter.h:50
void setConfig(const FilterConfig &config)
set filter config
Definition: Primitive3DFilter.h:324
std::map< std::string, unsigned char > mapRegexToBit
map regular expression (matching the primitive description) to internal groupBit
Definition: Primitive3DFilter.h:307
math::Vec3 rotateVector(const math::Vec3 &vIn)
rotate a given vector according to the quaternion
Definition: Primitive3DFilter.h:116
virtual ~RemoveAction()
Definition: Primitive3DFilter.h:202
virtual ~IntensityAction()
Definition: Primitive3DFilter.h:268
Vec position
position of the primitive center
Definition: Primitive3DFilter.h:148
std::vector< utils::SmartPtr< FilterAction > > filterActions
all filter actions to be performed
Definition: Primitive3DFilter.h:313
virtual ~LabelAction()
Definition: Primitive3DFilter.h:252
Main class for OpenCL based accelleration.
Definition: CLProgram.h:259
virtual ~FilterDepthImgAction()
Definition: Primitive3DFilter.h:284
The SceneObject class defines visible objects in scenes or scene graph nodes.
Definition: SceneObject.h:140
label action
Definition: Primitive3DFilter.h:247
a primitive
Definition: Primitive3DFilter.h:132
LabelAction(std::vector< unsigned char > formula, icl32s value)
Constructor.
Definition: Primitive3DFilter.h:250