ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

cv::Mat is not an array, it's a very complex class used to describe openCV image matrices. You cannot pass it directly to the XmlRpc functions.

By the looks of it you're trying to send an OpenCV image to an Rpc client or server. This can be done but you'll need to do a bit more work yourself.

There is an XmlRpc constructor which accepts arbitrary length data buffers, it's described here.

You'll need to first serialise your opencv image, effectively writing it to an image file in memory. You will use the imencode function to do this. You can then send the image using the XmlRpc constructor I described above.

The receiving side will need to use the opencv function imdecode to extract the original cv::Mat from the serialised data.

Hope this helps.