vision_msgs icon indicating copy to clipboard operation
vision_msgs copied to clipboard

Overload of createAABB2D() with signed int arguments

Open ugol-1 opened this issue 11 months ago • 3 comments

If the upper left corner of the bounding box has negative coordinates, the createAABB2D() with unsigned arguments will return an invalid result, because negative values will be converted to unsigned int. This can happen, for example, when data from cv::Rect returned by an OpenCV tracking algorithm is passed to createAABB2D().

Adding an overload with signed arguments would solve the problem.

ugol-1 avatar Jan 21 '25 20:01 ugol-1

How it is possible to have negative coordinates? These are in the image frame. There's no negative coordinate indices

SteveMacenski avatar Jan 21 '25 22:01 SteveMacenski

How it is possible to have negative coordinates? These are in the image frame. There's no negative coordinate indices

You can have bounding box outside (at least partially) of your image. Some OpenCV trackers return such bounding boxes.

ugol-1 avatar Jan 23 '25 00:01 ugol-1

OK - Feel free to open a PR to add that overload in :-)

SteveMacenski avatar Jan 23 '25 01:01 SteveMacenski