Better validation and error messages for saving non-standard features
TeleSculptor is currently configured to use ORB features by default and it saves them fine. It can be configured to use other features such as SURF in the track_features.conf file by setting descriptor_type := ocv_SURF. However, if descriptor_binary := false is not also set, the following runtime error will be thrown.
OpenCV Error: Unsupported format or combination of formats (type=5
) in buildIndex_, file <fletch path>/build/src/OpenCV/modules/flann/src/miniflann.cpp, line 315
2020-11-19 15:02:32.989 ERROR track_features.cxx(608): Exception caught: <fletch path>/build/src/OpenCV/modules/flann/src/miniflann.cpp:315: error: (-210) type=5
2020-11-19 15:02:32.989 ERROR track_features.cxx(608): in function buildIndex_
The same error happens if you run once with ORB and then go back and try to re-run with SURF, even if you properly configure the descriptor_binary := false flag. For the time being you can simply delete the results folder to fix the latter issue.
In the future it would be useful to have a more descriptive error such as a config check failure. Alternatively, and likely better, the descriptor_binary value to be deduced from the feature type and this config parameter could be removed.
Apparently a different error occurs with the inverse order of re-running: trying to do ORB with SURF features already saved caused:
<fletch dir>/install/include/eigen3/Eigen/src/Core/DenseCoeffsBase.h:162:
Eigen::DenseCoeffsBase<Derived, 0>::CoeffReturnType Eigen::DenseCoeffsBase<Derived, 0>::operator[](Eigen::Index) const
[with Derived = Eigen::CwiseNullaryOp<Eigen::internal::scalar_constant_op<int>, Eigen::Matrix<int, -1, 1> >; Eigen::DenseCoeffsBase<Derived, 0>::CoeffReturnType = int; Eigen::Index = long int]: Assertion `index >= 0 && index < size()'