cvbridge imgmsg_to_cv2 adds vertical line to the rightmost pixels in the image

asked 2020-11-12 11:25:52 -0500

wintermute gravatar image

Hello,

I have a python script that takes images from raspicam_node:

    def __init__(self):
    self.bridge = CvBridge()
    self.image_sub = rospy.Subscriber("/raspicam_node/image_raw", Image, self.callback)

def callback(self, data):
    try:
        cv_image = self.bridge.imgmsg_to_cv2(data, desired_encoding='bgr8')
        cv2.imshow("cv_image", cv_image)
    except CvBridgeError as e:
        print(e)

when the cv_image is visualized by cv2.imshow, we notice a vertical line on the right of the image:

image description

I have checked the problem is not because of raspicam_node, as rqt_image_view does not show the white line on the source image.

any ideas why this could be?

best regards, C.

edit retag flag offensive close merge delete