The nms function only returned one bounding box for me every time.
This was fixed for me by editing line 85 from:
auto tmpArea = (x2[idx] - x1[idx] + 1) (y2[idx] - y1[idx] + 1);
to:
auto tmpArea = (x2[idx] - x1[idx]) (y2[idx] - y1[idx]);
and line 157 from:
result.push_back(vec1[idx] - vec2[idx] + 1);
to:
result.push_back(vec1[idx] - vec2[idx]);
I am not sure if there is a reason behind adding the +1 after every subtraction, but after removing it I got great results from the nms() function.
Hi Martin,
The nms function only returned one bounding box for me every time.
This was fixed for me by editing line 85 from: auto tmpArea = (x2[idx] - x1[idx] + 1) (y2[idx] - y1[idx] + 1); to: auto tmpArea = (x2[idx] - x1[idx]) (y2[idx] - y1[idx]);
and line 157 from: result.push_back(vec1[idx] - vec2[idx] + 1); to: result.push_back(vec1[idx] - vec2[idx]);
I am not sure if there is a reason behind adding the +1 after every subtraction, but after removing it I got great results from the nms() function.