Last active
November 16, 2019 02:13
-
-
Save furushchev/437084d09f4ff602942edf11739d38ba to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import rospy | |
from sensor_msgs.msg import Image | |
from cv_bridge import CvBridge | |
def callback(msg): | |
rospy.loginfo(msg.width) | |
try: | |
frame = CvBridge().imgmsg_to_cv2(msg, "bgr8") | |
except: | |
rospy.logerr('error occured') | |
# 今までのYOLOの処理 | |
def main(): | |
rospy.init_node('sample') | |
sub = rospy.Subscriber('~input`, Image, callback, queue_size=1) | |
rospy.spin() | |
if __name__ == '__main__': | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment