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

Revision history [back]

click to hide/show revision 1
initial version

I also encounter the same situation. This is how I solved it :

1) Convert your image to grayscale: frame = cv2.cvtColor(frame1, cv2.COLOR_BGR2GRAY) 2) Give the correct encoding to cv_bridge(in case you are using cv_bridge) : pub.publish(bridge.cv2_to_imgmsg(frame, "mono8")) 3) know your image size with : (frame.shape) and give that frame shape to your camera model yaml file. Hope this helps!!