三 Detection in a Single Image

本教程指导如何在单张图片中使用AprilTag检测算法,包括参数配置、运行检测器及结果输出。适合视频流检测问题排查。

原文地址:http://wiki.ros.org/apriltags2_ros/Tutorials/Detection in a Single Image
描述:本教程教您如何在单个图像中使用此包进行标记和标记束检测。
单个图像检测器检测单个图像中的标签和标签束。典型的用例是检查视频流的单个帧中的检测,您可能认为这是有问题的。

1 Parameter Setup

config/settings.yaml和config/tags.yaml的设置与视频流检测器相同。

1.1 launch/single_image_client.launch

Here you must set the camera intrinsics fx, fy, cx and cy,You obtain these parameters typically from a camera intrinsics calibration。

2 Run the Detector

单个图像检测器基于ROS服务。您提供了图像的文件路径,服务器通过AprilTag检测器(与视频流节点相同的检测器)运行它,并提供检测结果并保存输出图像。服务器发布关于与视频流检测器相同的主题的结果,但是没有发布/tag_detections_image(而是将其保存为输出图像)。首先运行服务的服务器节点:

$ roslaunch apriltags2_ros single_image_server.launch

现在可以运行客户机来检测图像中的标签和标记包:

$ roslaunch apriltags2_ros single_image_client.launch image_load_path:=<FULL PATH TO INPUT IMAGE> image_save_path:=<FULL PATH TO OUTPUT IMAGE>

PNG图像工作良好(其他图像也可能工作,但尚未测试)。客户端将运行,您将看到服务器打印完成!如果一切顺利,客户端将退出(服务器将继续运行,等待另一个单独的图像检测服务调用)。输出图像将在指定的输出图像路径处。如果在config/settings.yaml中有tag_debug:1,那么中间的AprilTag 2算法的图像处理图像将在~/.ros as*.pnm图像文件中找到(其中~是您的主目录)。

翻译并改写为符合中文习惯的表达 Similarly, you can use this model for semantic segmentation as well. Semantic segmentation is the process of labeling each pixel and assigning them to the classes. While object detection deals with objects in bounding boxes, semantic segmentation creates a selection of the objects in a pixel-wise manner. Follow these steps: 1. T he first thing you need to do is to load your model: 2. The next step is to download the image that we want to perform segmentation on: Now that we have the image, we can use processor and model to get the output: Afterwards, you need to use the following functions to extract the result: However, in order to see the image, you can execute the following code: 3. T his code will convert the output of the model into the proper format to be visualized. Finally, you can see the image as shown in Figure 16.7, which is the identical semantically segmented image of the original image: Up to this point, you have learned how to use ViT models for image classification, object detection, and semantic segmentation. In the next section, you will learn about visual prompt models and how to use them. Visual prompt models Prompt-based models have been an attractive part of artificial intelligence in many aspects. These kinds of models can take guidance in the form of a pattern and create the respective output by understanding it. The prompt can be in many forms or data formats. Textual prompt-based models or visual prompt-based models are also available. A textual prompt is a free text that indicates what the model should do or provide as output. Similarly, a visual prompt is a visual guidance that helps the model understand the task or the instruction itself. Models such as CLIP are capable of understanding images and text at the same time and mapping them to a single vector space. In this vector space, text with similar semantic meaning to images (that visually present the same described objects or scenes
03-12
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值