class HOG: def __init__(self, topic): print topic self.hog = HOGDetector() self.bridge = CvBridge() self.image_sub = rospy.Subscriber(topic, Image, self.callback) def callback(self, data): try: cv_image = self.bridge.imgmsg_to_cv2(data, "bgr8") img = self.hog.detect(cv_image) cv2.imshow("window", img) cv2.waitKey(20) except CvBridgeError, e: print e
class HOG: def __init__(self, topic): print topic self.hog = HOGDetector() self.bridge = CvBridge() self.image_sub = rospy.Subscriber(topic, Image, self.callback) def callback(self, data): try: cv_image = self.bridge.imgmsg_to_cv2(data, "bgr8") img = self.hog.detect(cv_image) cv2.imshow("window", img) cv2.waitKey(20) except CvBridgeError as e: print e
def __init__(self, topic): print topic self.hog = HOGDetector() self.bridge = CvBridge() self.image_sub = rospy.Subscriber(topic, Image, self.callback)