ros-perception / vision_msgs

Algorithm-agnostic computer vision message types for ROS.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support compressed image messages

jveitchmichaelis opened this issue · comments

It'd be useful to support CompressedImage, as opposed to just Images. This is convenient for a few applications e.g. in our case we're sending a Detection2DArray over a socket to roslibpy to display on a website and we'd need to re-encode the data as a jpeg/png otherwise. In general if you're sending tons of bounding box cutouts, sending the raw pixel data can add up to more bytes than the entire compressed image.

I've tested this as a simple modification to Detection2D, which works fine. I'm happy to submit a PR for this if it'd be useful. Would a new message be preferable e.g. CompressedDetection2D, or would an optional parameter to Detection2D work instead?

Hi! Great idea for an addition. It pains me to add more message types with such a small difference, but I think that in this case it definitely makes sense. It would be significant extra overhead to using vision_msgs if you had to check each incoming message to see if it was compressed or not, and then pick the appropriate field. So CompressedDetection2D etc. would be preferable.

I've been too busy recently to review PRs, but please go ahead and submit one and I will review it as soon as I can.