Urgent.News

What's breaking now, across thousands of outlets.

Tech

YOLO Object Detection on Android for Robotics

YOLO Object Detection on Android for Robotics Introduction Object detection is an important capability for autonomous robots. A robot can use detections to identify people, vehicles, tools, obstacles, and other objects in its environment. YOLO-family models are widely used for real-time object detection. In this tutorial, we will design an Android application that captures camera frames and…

In this tutorial, we create an Android app to perform real-time YOLO object detection for robotics. The system architecture consists of CameraX for capturing frames, preprocessing, the YOLO model for inference, postprocessing, bounding boxes, and a robot perception layer. Kotlin is used for the Android project, which is organized into separate layers to prevent tight coupling between camera handling, inference, and rendering.

The YOLO model format depends on the chosen runtime. The project includes a Kotlin data class named Detection to represent detected objects with class ID, label, confidence, and bounding box information. CameraX's ImageAnalysis is used to obtain frames for inference. The preprocessing stage standardizes input size, performing rotation correction, resizing, color conversion, normalization, and tensor creation.

A YoloDetector class abstracts the inference process, running inference outside the main Android thread. Postprocessing involves confidence filtering, class filtering, bounding-box conversion, and non-maximum suppression to obtain final detections. The algorithm then draws bounding boxes over the live camera preview to display detection results.

To enable robotics, detection results are passed to a robot control layer, which can combine this information with depth, odometry, LiDAR, or other sensors. However, 2D bounding boxes should not be treated as physical distances unless additional calibration or depth information is available. To optimize performance for edge robotics, use a lightweight model, reduce inference resolution, reuse buffers, avoid unnecessary bitmap allocations, run inference off the UI thread, and measure latency and thermal behavior.

Testing should include various scenarios like indoor and outdoor scenes, low light, moving objects, multiple objects, and camera rotation. Additional testing should also measure end-to-end latency, including capture, inference, decision, and robot command. Ultimately, YOLO-style object detection can turn Android devices into valuable edge-vision components for robotics, working seamlessly with Kotlin, CameraX, and mobile inference runtimes.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

Android Computer Vision for Robot Navigation

Android Computer Vision for Robot Navigation Introduction Navigation requires a robot to understand its surroundings. Cameras can provide useful visual information such as obstacles, landmarks…

  • Android devices with cameras can provide visual data for robot navigation.
  • CameraX framework processes images to detect obstacles, landmarks, and people.
  • Vision data should be combined with other sensors for accurate navigation.

Object Detection on Android for Autonomous Robots

Object Detection on Android for Autonomous Robots Introduction Autonomous robots need to recognize objects in their environment.

  • Android devices can perform edge inference for object detection locally
  • Architecture includes CameraX, preprocessing, detection model, and postprocessing
  • Confidence filtering recommended with threshold of 0.6 for navigation

More from Monday 17 August →