When I use Yolo, I am getting serial output like:
D2 person -888 -2067 -124 -2067 -124 5 -124 -2067 27.1
The docs and code comments say this is
D2 type x y w h ? ? ? ? confidence
But how can the coordinates be negative and larger than the height and width of the image?
I found in YOLO.H the code that appears to be outputing this, but I don't understand what it's doing and why.
462 oss << "D2 ";
463 if (id.empty()) oss << "unknown "; else oss << jevois::replaceWhitespace(id) << ' ';
464 oss << x - 0.5F * w << ' ' << y - 0.5F * h << ' ';
465 oss << x + 0.5F * w << ' ' << y - 0.5F * h << ' ';
466 oss << x + 0.5F * w << ' ' << y + 0.5F * h << ' ';
467 oss << x + 0.5F * w << ' ' << y - 0.5F * h;
468 if (extra.empty() == false) oss << ' ' << extra;
I supposed I could try to back out what x, y, w, and h are from this output, but I don't understand the logic. I'm not a C++ programmer, so I'm guessing a bit about what's going on. It kind of looks like it's calculating the xy coords corners of the bounding box . If that's the case, why are these such large negative numbers?
<update.>So I did back out x, y, w and h from this code and I still can't figure it out. The numbers are large and negative and I've tried to see if I could massage them into x,y coords that I can use. Still no luck. Are these values being transformed in some other code that I'm not seeing?