def make_mask(limb, filename):
"""
Given a limb (right or left) and a name to save to
(in the baxter_tools/share/images/ directory),
create a mask of any dark objects in the image from the camera
and save it.
"""
image_sub = rospy.Subscriber(
'/cameras/' + limb + '_hand_camera/image',Image,callback)
try:
bridge = CvBridge()
cv_image = bridge.imgmsg_to_cv2(img, "bgr8")
except CvBridgeError, e:
print e
msk = cv2.threshold(img, 250, 255, cv2.THRESH_BINARY_INV)
return msk
评论列表
文章目录