How to publish Iplimage ? [closed]
Hi! I would like to publish an Iplimage but i have some problems doing this. I use the code :
cv::Mat mat_image=cv::cvarrToMat(image); // image is Iplimage
cv_bridge::CvImage out_msg;
out_msg.encoding = sensor_msgs::image_encodings::TYPE_8UC1;
out_msg.image = mat_image;
pub3.publish(out_msg.toImageMsg());
But when i try to open the image with rviz there is the error : [...]Stream size does not match calculated image size in Image[...]
Thanks for helping !