OS: ubuntu20.04
After setting the CMake option: -DCMAKE_BUILD_TYPE=Debug, and compiling the code, when running the executable program, the following error is reported:
bytetrack-test: /home/zfy/projects/bytetrack_zfy/eigen/Eigen/src/Core/PlainObjectBase.h:273: void Eigen::PlainObjectBase<Derived>::resize(Eigen::Index, Eigen::Index) [with Derived = Eigen::Matrix<double, 4, 1>; Eigen::Index = long int]: Assertion `(!(RowsAtCompileTime!=Dynamic) || (rows==RowsAtCompileTime)) && (!(ColsAtCompileTime!=Dynamic) || (cols==ColsAtCompileTime)) && (!(RowsAtCompileTime==Dynamic && MaxRowsAtCompileTime!=Dynamic) || (rows<=MaxRowsAtCompileTime)) && (!(ColsAtCompileTime==Dynamic && MaxColsAtCompileTime!=Dynamic) || (cols<=MaxColsAtCompileTime)) && rows>=0 && cols>=0 && "Invalid sizes when resizing a matrix or array."' failed.
./run.sh: line 1: 81013 Aborted (core dumped) ./build/bytetrack-test data/sample.mp4 data/txt_result
when setting the CMake option: -DCMAKE_BUILD_TYPE=Release, The above error will not occur.
I think we can optimize the following function to fix this bug.
Eigen::Vector4d KalmanBBoxTrack::tlwh() const {
if (mean.isZero(0)) { // Checking if 'mean' is uninitialized or zero
return _tlwh;
}
// Eigen::Vector4d ret = mean;
Eigen::Vector4d ret = mean.head(4); //modified
ret[2] *= ret[3];
ret[0] -= ret[2] / 2.0;
ret[1] -= ret[3] / 2.0;
return ret;
}