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)
Show us your code as text please
class image_converter:
Code:
I added 2 parts of my code. Thanks
I format your code as above, becasue of idendation. Is that correct?
@GZ remove comment and you can edit your post and add code. If you want to track event in two windows you must use two cv2.setMouseCallback, one with "image1" and one with "image2"
This is a simplified code.
As you see in this picture (its not me LOL), in my case i dont have no information at the bottom of the window like he does. but in my other code the window opens up at the same time with my namedWindow.
https://2.bp.blogspot.com/-iTEorlb0d7...
Here it works