Add OpenCV window as panel to RViz
The kinect_tracking node finds a specific point inside the picture and paints it into each frame. I do create the Window with openCV like:
cv::Mat img;
namedWindow("kinect_tracking Depth Matrix in CV_8UC1", cv::WINDOW_NORMAL);
cv::imshow("kinect_tracking Depth Matrix in CV_8UC1", img);
cv::waitKey(3);
Now Rviz is highly customizable and can be used stripped down as a 3d view panel. I dont want to dig that deep, as rviz shows the picture via the add button, but the specific point that the node painted into the picture is missing, as both use the same input.
What are your suggestions to get the painted cv::Mat into Rviz without publishing it on a topic again? I would write a plugin if neccessary but dont see a way to get the cv::Mat in the node directly to Rviz. Maybe I should modify the Image panel, but where to start (this looks pretty rough)
EDIT This is what I ended up with, nice:
cv::Mat dImg8Flipped;
// edit image ....
// publish
pubImg.publish(cv_bridge::CvImage((*cv_ptr).header, sensor_msgs::image_encodings::TYPE_8UC1, dImg8Flipped).toImageMsg());
I do get various options compressed, parameters, raw etc. what seems to be done automatically by cv_bridge. mmh.