LiveView
最后更新
弃用通知
此页面描述了 Luxonis Hub 中已删除或替换的功能。功能可能受限,并且仅适用于 Hub Original 客户。请参阅最新指南以配置设备、管理设备群和部署应用程序。
每个机器人最多可以创建十个实时视图。
Python
1import robothub as rh
2
3live_view = rh.DepthaiLiveView(name="live_view", unique_key="rgb", width=1920, height=1080)通过加入矩形、线条和文本来呈现基本数据和神经网络结果,从而改善您的实时视图体验。
Python
1live_view.add_rectangle(rectangle=bbox, label=nn_config.labels[detection.label])
2live_view.add_text(text="Cool and important text.", coords=[100, 150])
3live_view.add_line(pt1=[x1, y1], pt2=[x2, y2])发布带有叠加数据的帧。叠加数据将在此调用中清除。请确保您的管道中有
h264 encoder,因为只能发布 h264 编码的帧。 h264 编码帧Python
1live_view.publish(h264_frame=h264_frame.getCvFrame())class
robothub.live_view.LiveView(abc.ABC)
static method
LiveView.get(unique_key: str = None, name: str = None) -> Optional[LiveView]: Optional[LiveView]Gets a Live View by its unique key or name. Name takes precedence over unique key. :param unique_key: Unique key of the Live View. :param name: Name of the Live View. :return: Live View with the given unique key or name. :raises ValueError: If neither name nor unique_key is specified.
static method
LiveView.get_by_name(name: str) -> Optional[LiveView]: Optional[LiveView]Gets a Live View by its name. :param name: Name of the Live View. :return: Live View with the given name. None if a Live View with the given name does not exist.
static method
LiveView.get_by_unique_key(unique_key: str) -> Optional[LiveView]: Optional[LiveView]Gets a Live View by its unique key. :param unique_key: Unique key of the Live View. :return: Live View with the given unique key. :raises ValueError: If a Live View with the given unique key does not exist.