lidar_to_img_test_v2.py 文件源码

python
阅读 26 收藏 0 点赞 0 评论 0

项目:self-driving-car-obstacle-detector 作者: ajimenezh 项目源码 文件源码
def callbackCamera(msg):
    print('callbackCamera: msg : seq=%d, timestamp=%010d:%09d'%(
        msg.header.seq, msg.header.stamp.secs, msg.header.stamp.nsecs
    ))

    try:
        cv_image = bridge.imgmsg_to_cv2(msg, "bgr8")
    except CvBridgeError as e:
        print(e)

    s = ('%010d%09d'%(
        msg.header.stamp.secs, msg.header.stamp.nsecs
    ))

    filepath = "./camera/" + s + ".jpg"

    #print filepath
    height, width, channels = cv_image.shape
    cv_image = cv_image[400:height-200, 0:width]
    cv2.imwrite(filepath, cv_image)

    detector.detect(filepath)

    pass
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号