how images are encoded in rosbridge?

asked 2016-08-02 18:47:30 -0500

userRCH gravatar image

Hi! I need to send date collected from robots to a server for task computation offloading. For that, I'm using rosbridge to send Images from robots to an opencv program running on a remote server. The data I'm receiving on the server is a string in Base64 (because rosbridge encode images in Base64). The problem is when I convert this string to opencv:Mat, I get an empty matrix. I use this code to convert the string encoded in Base 64 to an opencv:Mat:

byte[] decoded=Base64.getMimeDecoder().decode(image); MatOfByte matrix=new MatOfByte(decoded); Mat outputImage = Highgui.imdecode(matrix, Highgui.CV_LOAD_IMAGE_COLOR);

I would like to know how rosbridge is encoding images? Is these another way to decode rosbridge images? thank you in advance!

edit retag flag offensive close merge delete