Ask Your Question

Revision history [back]

X,Y and RGB data

Hey, I got two cameras but somehow only one show a bar in the bottom with information of X,Y position of the mouse cursor along with the pixel RGB values. what do you think might be the reason?

X,Y and RGB data

Hey, I got two cameras but somehow only one show a bar in the bottom with information of X,Y position of the mouse cursor along with the pixel RGB values. what do you think might be the reason?

class image_converter:

    def __init__(self):
        '''Initialize ros publisher, ros subscriber'''
        # topic where we publish
        self.image_pub = rospy.Publisher("/kodak/image_raw2", Image)
        self.bridge = CvBridge()

        # subscribed Topic
        self.subscriber = rospy.Subscriber(
            "/kodak/image_raw", Image, self.callback)

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

        (rows, cols, channels) = cv_image.shape
        # if cols > 60 and rows > 60 :
        #cv2.circle(cv_image, (50,50), 10, 255)
        np_image = np.array(cv_image, dtype=np.uint8)