web.py 文件源码

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

项目:BAR4Py 作者: bxtkezhan 项目源码 文件源码
def detectFromBlob(self, blob):
        '''
        Detect markers from web blob
        blob is image blob, type is bytes

        For example:
        >>> modelviews = webApp.detectFromBlob(blob)
        '''
        array = np.frombuffer(blob, np.uint8)
        if array.shape[0] < 1024: return {}
        frame = cv2.imdecode(array, 0)
        if frame is None: return {}
        frame = cv2.resize(frame, (self.args['PLAYER_RECT'][2], self.args['PLAYER_RECT'][3]))
        markers, area = (self.markerDetector.detect( frame, enFilter=True, enArea=True) or
                         ([], None))
        modelview_dict = {}
        for marker in markers:
            modelview_dict[marker.marker_id] = WebAPP.cvt2TJModelView(marker)
        return {'modelview': modelview_dict, 'area': area}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号