tcp_utils.py 文件源码

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

项目:pybot 作者: spillai 项目源码 文件源码
def send_image(s, im, scale=1.0, encode_param=[int(cv2.IMWRITE_JPEG_QUALITY),90]):
    # Will not upsample image for bandwidth reasons
    if scale < 1: 
        im = cv2.resize(im, None, fx=scale, fy=scale)
    result, imgencode = cv2.imencode('.jpg', im, encode_param)
    data = np.array(imgencode)
    stringData = data.tostring()
    s.send( str(len(stringData)).ljust(16))
    s.send( stringData )
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号