Skip to content
Snippets Groups Projects
Commit f7eecde8 authored by Andre Mühlenbrock's avatar Andre Mühlenbrock
Browse files

Changed API a bit for registration of multiple kinects via Grid.

parent f8239e86
No related branches found
No related tags found
No related merge requests found
...@@ -1312,8 +1312,8 @@ GridDetectionResult GridDetector::detectGrid(PointCloudImage pointCloud) { ...@@ -1312,8 +1312,8 @@ GridDetectionResult GridDetector::detectGrid(PointCloudImage pointCloud) {
MultipleGridDetectionResult GridDetector::findCorrespondencePoints(TArray<PointCloudImage> pointClouds) { TArray<TArray<FVector>> matchGridDetectionResults(TArray<GridDetectionResult> results) {
return MultipleGridDetectionResult(); return TArray<TArray<FVector>>();
} }
MotionControllerResult GridDetector::findMotionControllerInPointcloud(PointCloudImage, MotionControllerAssumptions controllerAssumptions) { MotionControllerResult GridDetector::findMotionControllerInPointcloud(PointCloudImage, MotionControllerAssumptions controllerAssumptions) {
......
...@@ -3,10 +3,22 @@ ...@@ -3,10 +3,22 @@
#include "MultiplePointCloudsRegistrator.h" #include "MultiplePointCloudsRegistrator.h"
MultiplePointCloudsRegistrator::MultiplePointCloudsRegistrator() MultiplePointCloudsRegistrator::MultiplePointCloudsRegistrator(int pPointCloudCount)
: pointCloudCount(pPointCloudCount)
{ {
correspondencePoints = new TArray<pcl::PointCloud<pcl::PointXYZ>>[pPointCloudCount];
} }
MultiplePointCloudsRegistrator::~MultiplePointCloudsRegistrator() MultiplePointCloudsRegistrator::~MultiplePointCloudsRegistrator()
{ {
delete[] correspondencePoints;
correspondencePoints = nullptr;
} }
void MultiplePointCloudsRegistrator::addCorrespondencePoints(TArray<TArray<FVector>> points) {
}
TArray<FTransform> MultiplePointCloudsRegistrator::registrateInto(int pointCloudID) {
return TArray<FTransform>();
}
\ No newline at end of file
...@@ -25,21 +25,6 @@ struct PointCloudImage { ...@@ -25,21 +25,6 @@ struct PointCloudImage {
{} {}
}; };
/*
* Struct which contains the results of grid detection in multiple
* point clouds.
*
* In this case, I simply use array of arrays so the user can simply
* use the hole points and give them directly to the multiple point cloud
* registrator instead of returning a TArray<GridDetectionResult>.
*/
struct MultipleGridDetectionResult {
TArray<bool> gridFound;
TArray<TArray<FVector>> holePoints;
TArray<FTransform> gridTransform;
};
/* /*
* Result of a grid detection in a single point cloud. * Result of a grid detection in a single point cloud.
*/ */
...@@ -47,7 +32,7 @@ struct MultipleGridDetectionResult { ...@@ -47,7 +32,7 @@ struct MultipleGridDetectionResult {
struct GridDetectionResult { struct GridDetectionResult {
bool gridFound = false; bool gridFound = false;
// Mid points of the grid holes (not sorted yet): // Mid points of the grid holes (not sorted yet!):
TArray<FVector> centersOfFoundHoles; TArray<FVector> centersOfFoundHoles;
// Location of the grid center: // Location of the grid center:
...@@ -100,13 +85,6 @@ public: ...@@ -100,13 +85,6 @@ public:
GridDetector(); GridDetector();
~GridDetector(); ~GridDetector();
/*
* Finds correspondence points between the given point clouds. For each image, this algorithm
* can return multiple points.
*/
MultipleGridDetectionResult findCorrespondencePoints(TArray<PointCloudImage> pointClouds);
/* /*
* Detect the grid in a single point cloud. * Detect the grid in a single point cloud.
*/ */
...@@ -114,6 +92,14 @@ public: ...@@ -114,6 +92,14 @@ public:
GridDetectionResult detectGrid(PointCloudImage pointCloud); GridDetectionResult detectGrid(PointCloudImage pointCloud);
/**
* Matches all the hole centers of the grid detection result and returns for each GridDetectionResult
* an array with the matched hole centers (that means that a specific hole center has the same index
* in each array, considering the orientation).
*/
TArray<TArray<FVector>> matchGridDetectionResults(TArray<GridDetectionResult> results);
/* /*
* Finds the motion controller positions in a given point cloud by finding the grid and use * Finds the motion controller positions in a given point cloud by finding the grid and use
* assumptions about where the motion controllers are relative to the grid. * assumptions about where the motion controllers are relative to the grid.
......
...@@ -4,13 +4,41 @@ ...@@ -4,13 +4,41 @@
#include "CoreMinimal.h" #include "CoreMinimal.h"
#include "GridDetector.h"
THIRD_PARTY_INCLUDES_START
#include <pcl/io/pcd_io.h>
#include <pcl/point_types.h>
#include <pcl/registration/transformation_estimation.h>
#include <pcl/registration/transformation_estimation_svd.h>
THIRD_PARTY_INCLUDES_END
/** /**
* *
*/ */
class VRKINECTREGISTRATION_API MultiplePointCloudsRegistrator class VRKINECTREGISTRATION_API MultiplePointCloudsRegistrator
{ {
private:
int pointCloudCount;
TArray<pcl::PointCloud<pcl::PointXYZ>>* correspondencePoints;
public: public:
MultiplePointCloudsRegistrator(); MultiplePointCloudsRegistrator(int pointCloudCount);
~MultiplePointCloudsRegistrator(); ~MultiplePointCloudsRegistrator();
/**
* Adds correspondence points of multiple pointclouds.
*/
void addCorrespondencePoints(TArray<TArray<FVector>> points);
/**
* Registrates all the point clouds into the pointcloud of the given pointCloudID.
*
* The transform with the id of the given point cloud id will be the identity.
*/
TArray<FTransform> registrateInto(int pointCloudID);
}; };
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment