ByteTrack-cpp
ByteTrack-cpp copied to clipboard
Unnecessary calculations which add then subtract same variable
In the following code there are unnecessary calculations being performed as the same variable cancels itself out.
https://github.com/Vertical-Beach/ByteTrack-cpp/blob/d43805d461a714f65da039981bd5f5d21cf5cf59/src/Rect.cpp#L121
Instead it should be.
const float ua = (tlwh[2] + 1) * (tlwh[3] + 1) + box_area - iw * ih;