Skip to content

Robot Vision Demo provides depth-based navigation for robots using DepthAnything, processing camera feeds to generate structured navigation commands. The system analyzes depth data across image regions, detects objects, and visualizes results through a responsive web interface for real-time monitoring and control.

Notifications You must be signed in to change notification settings

realjules/robdog-vision

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Robot Vision Demo Using DepthAnything

A simple demonstration of using DepthAnything for depth-based robot navigation. This demo shows how to process real-time camera feed, estimate depth information, and generate structured navigation commands for a robot based on depth analysis.

Features

  • Real-time camera feed processing
  • Depth estimation using DepthAnything model
  • Region-based depth analysis for navigation
  • Object detection based on depth gradients
  • Automatic navigation command generation
  • Web-based visualization interface
  • Real-time depth visualization

Depth Analysis

The system uses DepthAnything to provide detailed depth information:

Region Analysis

  • Divides the image into 5 regions (center, top, bottom, left, right)
  • Provides depth statistics for each region:
    • Mean depth
    • Minimum depth
    • Maximum depth
    • Relative distance classification (near/far)

Object Detection

  • Detects objects based on depth gradients
  • For each object provides:
    • Position (normalized x, y coordinates)
    • Size (width and height as proportion of image)
    • Depth information (mean depth and relative distance)

Visualization

  • Generates depth map visualization
  • Shows region divisions
  • Highlights detected objects

Installation

  1. Create a virtual environment:
python -m venv venv
source venv/Scripts/activate
  1. Install requirements:
pip install -r requirements.txt

Usage

Main Application

  1. Start the server:
python app.py
  1. Open your web browser to http://localhost:53549/

  2. Allow camera access when prompted

  3. Click "Start Processing" to begin real-time processing

Depth Analysis Interface

  1. Start the depth analysis interface:
python web_interface.py
  1. Open your web browser to http://localhost:53549/

  2. Use the interface to:

    • Upload images for analysis
    • View depth maps and visualizations
    • See region-based depth analysis
    • Inspect detected objects

Command Line Usage

You can also use the depth analyzer directly from the command line:

python depth_analyzer.py path/to/image.jpg

This will:

  • Generate a depth analysis
  • Save visualization to 'depth_analysis.png'
  • Print detailed analysis results

Command Structure

The system generates JSON commands in the following format:

{
    "velocity_command": {
        "linear_velocity_mps": 0.5,    // Forward/backward speed (-1.0 to 1.0)
        "angular_velocity_radps": 0.2   // Turning speed (-1.0 to 1.0)
    },
    "gait_mode": "trotting",           // Robot's movement style
    "reasoning": "Moving forward to approach the target object while avoiding the obstacle on the left",
    "timestamp": "2024-01-31T17:00:03Z"
}

About

Robot Vision Demo provides depth-based navigation for robots using DepthAnything, processing camera feeds to generate structured navigation commands. The system analyzes depth data across image regions, detects objects, and visualizes results through a responsive web interface for real-time monitoring and control.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •