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

Add stdout debugging for normalization #107

Closed gadomski closed 7 years ago

gadomski commented 7 years ago

@alexsmartens can you pull down this branch, test (either with env CTEST_OUTPUT_ON_FAILURE=1 make test or test/normalization), and put the output in this pull request's discussion? Thanks.

alexsmartens commented 7 years ago

There is the issue that I have:

$ CTEST_OUTPUT_ON_FAILURE=1 make test Running tests... Test project /home/alex/Downloads/cpd/build Start 1: affine 1/9 Test #1: affine ........................... Passed 2.35 sec Start 2: gauss_transform 2/9 Test #2: gauss_transform .................. Passed 0.37 sec Start 3: nonrigid 3/9 Test #3: nonrigid ......................... Passed 33.65 sec Start 4: normalization 4/9 Test #4: normalization ....................***Exception: Other 0.09 sec Running main() from gtest_main.cc [==========] Running 1 test from 1 test case. [----------] Global test environment set-up. [----------] 1 test from FishTest [ RUN ] FishTest.CanBeRetrieved fixed mean: -1.0044e-06 1.76923e-07 fixed dimensions: 91 by 2 moving mean: -1.0044e-06 1.76923e-07 moving dimensions: 91 by 2 scale: 1 normalization: /usr/include/eigen3/Eigen/src/Core/CwiseBinaryOp.h:110: Eigen::CwiseBinaryOp<BinaryOp, Lhs, Rhs>::CwiseBinaryOp(const Lhs&, const Rhs&, const BinaryOp&) [with BinaryOp = Eigen::internal::scalar_sum_op; LhsType = const Eigen::CwiseUnaryOp<Eigen::internal::scalar_multiple_op, const Eigen::Matrix<double, -1, -1> >; RhsType = const Eigen::Matrix<double, -1, 1>; Eigen::CwiseBinaryOp<BinaryOp, Lhs, Rhs>::Lhs = Eigen::CwiseUnaryOp<Eigen::internal::scalar_multiple_op, const Eigen::Matrix<double, -1, -1> >; Eigen::CwiseBinaryOp<BinaryOp, Lhs, Rhs>::Rhs = Eigen::Matrix<double, -1, 1>]: Assertion `aLhs.rows() == aRhs.rows() && aLhs.cols() == aRhs.cols()' failed.

Start 5: rigid

5/9 Test #5: rigid ............................ Passed 0.26 sec Start 6: utils 6/9 Test #6: utils ............................ Passed 0.04 sec Start 7: version 7/9 Test #7: version .......................... Passed 0.00 sec Start 8: gauss_transform_fgt 8/9 Test #8: gauss_transform_fgt .............. Passed 0.23 sec Start 9: jsoncpp 9/9 Test #9: jsoncpp .......................... Passed 0.00 sec

89% tests passed, 1 tests failed out of 9

Total Test time (real) = 37.00 sec

The following tests FAILED: 4 - normalization (OTHER_FAULT) Errors while running CTest Makefile:105: recipe for target 'test' failed make: *** [test] Error 8

gadomski commented 7 years ago

I think I might have found the bug. It was a combination of two things I often screw up when working with Eigen (forgetting to replicate out vectors, and the fact that isApprox passes ok even if the matrix dimensions don't agree), and I'm glad your version of Eigen caught it.

If you can pull down this latest version of the branch and test, I would appreciate it.

Edit: To be clear, this bug is only in the test suite, not in the code itself, so this won't fix/change any of your original issues.

alexsmartens commented 7 years ago

Thank you Pete!

$ make test Running tests... Test project /home/alex/Downloads/cpd/build Start 1: affine 1/9 Test #1: affine ........................... Passed 2.25 sec Start 2: gauss_transform 2/9 Test #2: gauss_transform .................. Passed 0.36 sec Start 3: nonrigid 3/9 Test #3: nonrigid ......................... Passed 31.93 sec Start 4: normalization 4/9 Test #4: normalization .................... Passed 0.00 sec Start 5: rigid 5/9 Test #5: rigid ............................ Passed 0.25 sec Start 6: utils 6/9 Test #6: utils ............................ Passed 0.04 sec Start 7: version 7/9 Test #7: version .......................... Passed 0.00 sec Start 8: gauss_transform_fgt 8/9 Test #8: gauss_transform_fgt .............. Passed 0.23 sec Start 9: jsoncpp 9/9 Test #9: jsoncpp .......................... Passed 0.00 sec

100% tests passed, 0 tests failed out of 9

Total Test time (real) = 35.06 sec