gadomski / cpd

C++ implementation of the Coherent Point Drift point set registration algorithm.
http://www.gadom.ski/cpd
GNU General Public License v2.0
385 stars 122 forks source link

Problem about using rigid #157

Closed tungtungyan closed 2 years ago

tungtungyan commented 2 years ago

I work with LiDAR data. I select one of the timestamp point cloud data and a scope of timestamp which show as a point cloud map. However, it show an error. matching: /usr/include/eigen3/Eigen/src/Core/Product.h:97: Eigen::Product<Lhs, Rhs, Option>::Product(const Lhs&, const Rhs&) [with _Lhs = Eigen::CwiseBinaryOp<Eigen::internal::scalar_product_op<double, double>, const Eigen::CwiseNullaryOp<Eigen::internal::scalar_constant_op, const Eigen::Matrix<double, 1, -1> >, const Eigen::PartialReduxExpr<const Eigen::Matrix<double, -1, -1>, Eigen::internal::member_sum, 0> >; _Rhs = Eigen::Transpose<const Eigen::PartialReduxExpr<const Eigen::Matrix<double, -1, -1>, Eigen::internal::member_sum, 0> >; int Option = 0; Eigen::Product<Lhs, Rhs, Option>::Lhs = Eigen::CwiseBinaryOp<Eigen::internal::scalar_product_op<double, double>, const Eigen::CwiseNullaryOp<Eigen::internal::scalar_constant_op, const Eigen::Matrix<double, 1, -1> >, const Eigen::PartialReduxExpr<const Eigen::Matrix<double, -1, -1>, Eigen::internal::member_sum, 0> >; Eigen::Product<Lhs, Rhs, Option>::Rhs = Eigen::Transpose<const Eigen::PartialReduxExpr<const Eigen::Matrix<double, -1, -1>, Eigen::internal::member_sum, 0> >]: Assertion `lhs.cols() == rhs.rows() && "invalid matrix product" && "if you wanted a coeff-wise or a dot product use the respective explicit functions"' failed.

My code: The type of M_map and M_input is Eigen::MatrixXd. cpd::Matrix fixed = M_map; cpd::Matrix moving = M_input; cpd::Rigid rigid; rigid.scale(true); cpd::RigidResult result = rigid.run(fixed, moving);

gadomski commented 2 years ago

Looks like your matrices aren't the same size, check the dimensions of both matrices. If they are the same size, please feel free to re-open w/ more information.