43#include <pybind11/pybind11.h>
44#include <pybind11/embed.h>
47#include <ICPPlugin.hh>
48#include <OpenFlipper/BasePlugin/PythonFunctions.hh>
49#include <OpenFlipper/PythonInterpreter/PythonTypeConversions.hh>
51namespace py = pybind11;
53PYBIND11_EMBEDDED_MODULE(
ICP, m) {
55 QObject* pluginPointer = getPluginPointer(
"ICP");
58 std::cerr <<
"Error Getting plugin pointer for Plugin-ICP" << std::endl;
62 ICPPlugin* plugin = qobject_cast<ICPPlugin*>(pluginPointer);
65 std::cerr <<
"Error converting plugin pointer for Plugin-ICP" << std::endl;
71 py::class_< ICPPlugin,std::unique_ptr<ICPPlugin, py::nodelete> >
icp(m,
"ICP");
76 icp.def(py::init([plugin]() {
return plugin; }));
79 QCoreApplication::translate(
"PythonDocICP",
"Execute the ICP algorithm").toLatin1().data(),
80 py::arg(QCoreApplication::translate(
"PythonDocICP",
"Max Iteration count").toLatin1().data()),
81 py::arg(QCoreApplication::translate(
"PythonDocICP",
"MSE error threshold").toLatin1().data()),
82 py::arg(QCoreApplication::translate(
"PythonDocICP",
"Point distance threshold").toLatin1().data()),
83 py::arg(QCoreApplication::translate(
"PythonDocICP",
"Normal dot threshold in percent").toLatin1().data()),
84 py::arg(QCoreApplication::translate(
"PythonDocICP",
"Enable debug output").toLatin1().data()),
85 py::arg(QCoreApplication::translate(
"PythonDocICP",
"Enable auto resize").toLatin1().data()),
86 py::arg(QCoreApplication::translate(
"PythonDocICP",
"Interpolate Normals").toLatin1().data()),
87 py::arg(QCoreApplication::translate(
"PythonDocICP",
"Source object id").toLatin1().data()),
88 py::arg(QCoreApplication::translate(
"PythonDocICP",
"Target object id").toLatin1().data())
void icp(int _maxIterations, double _errorThreshold, double _distanceThreshold, double _normalDotThreshold, bool _debugOutput, bool _doResize, bool _interpolateNormals, int _sourceObjectID, int _targetObjectID)
void icp(const std::vector< VectorT > &_points1, const std::vector< VectorT > &_points2, VectorT &_cog1, VectorT &_cog2, double &_scale1, double &_scale2, QuaternionT &_rotation)
Compute rigid transformation from first point set to second point set.