Image Component Library (ICL)
IterativeClosestPoint.h
Go to the documentation of this file.
1 /********************************************************************
2 ** Image Component Library (ICL) **
3 ** **
4 ** Copyright (C) 2006-2015 CITEC, University of Bielefeld **
5 ** Neuroinformatics Group **
6 ** Website: www.iclcv.org and **
7 ** http://opensource.cit-ec.de/projects/icl **
8 ** **
9 ** File : ICLGeom/src/ICLGeom/IterativeClosestPoint.h **
10 ** Module : ICLGeom **
11 ** Authors: Matthias Esau **
12 ** **
13 ** **
14 ** GNU LESSER GENERAL PUBLIC LICENSE **
15 ** This file may be used under the terms of the GNU Lesser General **
16 ** Public License version 3.0 as published by the **
17 ** **
18 ** Free Software Foundation and appearing in the file LICENSE.LGPL **
19 ** included in the packaging of this file. Please review the **
20 ** following information to ensure the license requirements will **
21 ** be met: http://www.gnu.org/licenses/lgpl-3.0.txt **
22 ** **
23 ** The development of this software was supported by the **
24 ** Excellence Cluster EXC 277 Cognitive Interaction Technology. **
25 ** The Excellence Cluster EXC 277 is a grant of the Deutsche **
26 ** Forschungsgemeinschaft (DFG) in the context of the German **
27 ** Excellence Initiative. **
28 ** **
29 ********************************************************************/
30 
31 #pragma once
32 #include <ICLGeom/Geom.h>
34 namespace icl{
35  namespace geom{
36  struct Vec8{
39  };
40  template<typename T>
42  public:
43 
44  struct Data;
45  Data *m_data;
46 
47  struct DistanceID {
48  float distance;
49  int id;
50  };
51 
52  IterativeClosestPoint(const std::string &clCode, int localSize2Dx, int localSize2Dy, int localSize1D, void (*subFunc)(const char * a, const char *b, char *c), math::Vec4 (*toVectorFunc)(const char* point));
53  void icp(const T* pointsA, const T* pointsB, int sizeA, int sizeB, float errorThreshold, float errorDeltaThreshold, int maxIterations, float* initialTransform, float* transformMatrix);
56 
57 // static void sub(const char * a, const char *b, char *c);
58 // static void add(const char * a, const char *b, char *c);
59 // static void mul(const char * a, float b, char *c);
60 // static void neutralElement(char * e);
61 // static math::Vec4 toVector(const char* point);
62 // static float getDistance(const char* a, const char* b);
63 // static void getCovariance(const char * a, const char *b, float* h);
64 // static void matrixMultiply(const char * a, char *b, const float* h);
65 // static float getError(const char* pointsA, const char* pointsB, const int* closestPoints, float(*distanceFunc)(const char*, const char*), size_t typeSize, int sizeA);
66 // static void getCovarianceSum(const char* pointsA, const char* pointsB, const int* closestPoints, float* covariance, void(*covarianceFunc)(const char*, const char*, float*), size_t typeSize, int sizeA);
67 // static void getRotatedPoints(const char* pointsA, char* pointsRotated, const float* rotationMatrix, void(*matrixMultiplyFunc)(const char * a, char *b, const float* r), size_t typeSize, int sizeA);
68 
69 // void icp(const char* pointsA, const char* pointsB, int sizeA, int sizeB, size_t typeSize, float errorThreshold, float errorDeltaThreshold, int maxIterations, float* initialTransform, float* transformMatrix, float(*distanceFunc)(const char*, const char*), void(*covarianceFunc)(const char*, const char*, float*), void(*matrixMultiplyFunc)(const char * a, char *b, const float* r), void (*subFunc)(const char * a, const char *b, char *c), void (*addFunc)(const char * a, const char *b, char *c), void (*mulFunc)(const char * a, float b, char *c), void (*neutralElementFunc)(char * e), math::Vec4 (*toVectorFunc)(const char* point));
70 // //searches for a closest point for every point in pointsA in the list of points from pointsB
71 // /// searches for a closest point for every point in pointsA in the list of points from pointsB
72 // /** @param pointsA the points of which the nearest neighbours are to be found
73 // * @param pointsB the points in which the nearest neighbours are searched
74 // * @param closestPoints indices of the nearest neighbours of pointsA in pointsB with the size of sizeA
75 // * @param distanceAcc pointer to a global memory with the size of sizeA*(sizeB+localSizeX-1)/localSizeX used to store temporary values for each local group for a point in PointsA
76 // * @param distanceFunc a function that works on the datatype of pointsA and pointsB and provides a distance between those 2 points
77 // * @param typeSize size of the type of pointsA and pointsB
78 // * @param sizeA number of points in pointsA
79 // * @param sizeB number of points in pointsB
80 // * @param localSizeX width of a local group
81 // * @param localsizeY height of a local group
82 // */
83 // void getClosestPoints(const char* pointsA, const char* pointsB, int* closestPoints, DistanceID* distanceAcc, float(*distanceFunc)(const char*, const char*), size_t typeSize, int sizeA, int sizeB, int localSizeX, int localSizeY);
84 
85 // /// builds a database with the closest neighbours of the representatives
86 // /** @param points list of points to be added to the database
87 // * @param closestPoints list of closest representatives to points
88 // * @param counters list of counters to avoid conflicts in
89 // * @param maxCounter maximum amount of neighbours for a single representative
90 // * @param repWidth maximum number of neighbours of a representativethe database
91 // * @param typeSize size of the type of points
92 // * @param sizePoints number of points in points
93 // * @param sizeReps number of representatives
94 // * @param localSizeX width of a local group
95 // */
96 // void buildRepDB(const char* points, const int* closestreps, int* counters, int* repDataBase, int repWidth, size_t typeSize, int sizePoints, int sizeReps, int localSizeX);
97 
98 // void getClosestPointsInDB(const char* pointsA, const int* closestRep, const char* pointsB, const int* pointsDB, const int* counters, int* closestPoints, DistanceID* distanceAcc, float(*distanceFunc)(const char*, const char*), size_t typeSize, int sizeA, int widthDB, int localSizeX, int localSizeY);
99  };
100  } // namespace geom
101 }
102 
Definition: IterativeClosestPoint.h:47
undocument this line if you encounter any issues!
Definition: Any.h:37
IterativeClosestPoint(const std::string &clCode, int localSize2Dx, int localSize2Dy, int localSize1D, void(*subFunc)(const char *a, const char *b, char *c), math::Vec4(*toVectorFunc)(const char *point))
Data * m_data
Definition: IterativeClosestPoint.h:44
Definition: IterativeClosestPoint.h:36
static IterativeClosestPoint< math::Vec4 > icpVec4()
int id
Definition: IterativeClosestPoint.h:49
float distance
Definition: IterativeClosestPoint.h:48
void icp(const T *pointsA, const T *pointsB, int sizeA, int sizeB, float errorThreshold, float errorDeltaThreshold, int maxIterations, float *initialTransform, float *transformMatrix)
static IterativeClosestPoint< Vec8 > icpVec8()
math::Vec4 pos
Definition: IterativeClosestPoint.h:37
Definition: IterativeClosestPoint.h:41
math::Vec4 col
Definition: IterativeClosestPoint.h:38