Convert Figma logo to code with AI

uzh-rpg logorpg_svo

Semi-direct Visual Odometry

2,085
860
2,085
193

Top Related Projects

Real-Time SLAM for Monocular, Stereo and RGB-D Cameras, with Loop Detection and Relocalization Capabilities

LSD-SLAM

An optimization-based multi-sensor state estimator

ORB-SLAM3: An Accurate Open-Source Library for Visual, Visual-Inertial and Multi-Map SLAM

Quick Overview

The rpg_svo repository from the UZH-RPG organization is a C++ implementation of the Semidirect Visual Odometry (SVO) algorithm, which is a fast and accurate visual odometry system for monocular, stereo, and RGBD cameras. It is designed to be used in robotics and computer vision applications that require real-time, low-latency pose estimation.

Pros

  • Real-time Performance: The SVO algorithm is designed to run in real-time, making it suitable for applications that require low-latency pose estimation.
  • Accuracy: The SVO algorithm has been shown to provide accurate pose estimates, even in challenging environments with limited texture or illumination changes.
  • Flexibility: The rpg_svo implementation supports a variety of camera types, including monocular, stereo, and RGBD cameras.
  • Open-Source: The rpg_svo project is open-source, allowing users to inspect, modify, and contribute to the codebase.

Cons

  • Complexity: Implementing and integrating the SVO algorithm can be complex, especially for users who are new to visual odometry and computer vision.
  • Dependency on External Libraries: The rpg_svo project depends on several external libraries, such as Eigen, OpenCV, and ROS, which may add complexity to the installation and setup process.
  • Limited Documentation: The project's documentation, while generally good, could be more comprehensive, especially for users who are new to the SVO algorithm or the rpg_svo implementation.
  • Potential Performance Issues: While the SVO algorithm is designed for real-time performance, the performance of the rpg_svo implementation may be affected by the hardware and software environment in which it is running.

Code Examples

// Initializing the SVO pipeline
svo::PipelineConfig config;
svo::Pipeline pipeline(config);

// Adding a camera to the pipeline
svo::CameraPtr camera = svo::Camera::fromYamlFile("camera_config.yaml");
pipeline.addCamera(camera);

// Processing a frame
svo::FramePtr frame = svo::Frame::create(camera, image_data, timestamp);
pipeline.processFrame(frame);

// Retrieving the current pose
Eigen::Isometry3d pose = pipeline.getCurrentPose();

This code demonstrates how to initialize the SVO pipeline, add a camera to the pipeline, process a frame, and retrieve the current pose estimate.

// Registering a callback for new pose estimates
pipeline.registerPoseCallback([](const Eigen::Isometry3d& pose) {
    // Handle the new pose estimate
    std::cout << "New pose: " << pose.translation().transpose() << std::endl;
});

This code shows how to register a callback function that will be called whenever a new pose estimate is available.

// Saving a map
svo::MapPtr map = pipeline.getMap();
map->save("map.bin");

This code demonstrates how to save the current map to a binary file.

Getting Started

To get started with the rpg_svo project, follow these steps:

  1. Clone the repository:

    git clone https://github.com/uzh-rpg/rpg_svo.git
    
  2. Install the required dependencies, which include Eigen, OpenCV, and ROS. The specific installation steps may vary depending on your operating system and development environment.

  3. Build the project using the provided build scripts or your preferred build system (e.g., CMake).

  4. Configure the SVO pipeline by creating a YAML file with the necessary camera parameters and other settings.

  5. Run the SVO pipeline with your camera data, either from a live feed or pre-recorded files.

  6. Optionally, you can integrate the SVO pipeline into your own application or use the provided visualization tools to inspect the results.

For more detailed instructions, please refer to the project's documentation and README file.

Competitor Comparisons

Real-Time SLAM for Monocular, Stereo and RGB-D Cameras, with Loop Detection and Relocalization Capabilities

Pros of ORB_SLAM2

  • More robust loop closure detection and map reuse capabilities
  • Better performance in large-scale environments
  • Supports monocular, stereo, and RGB-D cameras

Cons of ORB_SLAM2

  • Higher computational requirements
  • More complex implementation and setup process
  • Slower initialization compared to SVO

Code Comparison

ORB_SLAM2 feature extraction:

void Frame::ExtractORB(int flag, const cv::Mat &im)
{
    if(flag==0)
        (*mpORBextractorLeft)(im,cv::Mat(),mvKeys,mDescriptors);
    else
        (*mpORBextractorRight)(im,cv::Mat(),mvKeysRight,mDescriptorsRight);
}

SVO feature detection:

void FrameHandlerMono::detectFeatures(
    FramePtr frame,
    const ImgPyr& img_pyr)
{
  Corners corners(grid_size_, cell_size_);
  for(int i=0; i<Config::nPyrLevels(); ++i)
    feature_detection::FastDetector::detectNoMaxSupp(
        img_pyr[i], frame->fts_, i, Config::triangMinCornerScore(), corners);
}

ORB_SLAM2 uses ORB features, while SVO employs FAST corners for feature detection. ORB_SLAM2's approach is more computationally intensive but provides more robust features for matching and loop closure. SVO's method is faster and more suitable for real-time applications with limited computational resources.

LSD-SLAM

Pros of LSD-SLAM

  • Produces dense, semi-dense 3D maps
  • Works in large-scale environments
  • Performs loop closure detection

Cons of LSD-SLAM

  • Higher computational requirements
  • Less suitable for resource-constrained platforms
  • May struggle in environments with limited texture

Code Comparison

LSD-SLAM (C++):

void DepthMap::updateKeyframe(Frame* newFrame)
{
    currentFrame = newFrame;
    for(int y=3;y<height-3;y++)
        for(int x=3;x<width-3;x++)
            updatePixelValue(x,y);
}

SVO (C++):

void FrameHandlerMono::addImage(const cv::Mat& img, double timestamp)
{
    if(!startFrameProcessingCommon(timestamp))
        return;
    // process frame
    processFrame();
    // finish processing
    finishFrameProcessingCommon();
}

Both repositories implement visual SLAM systems, but LSD-SLAM focuses on semi-dense mapping while SVO prioritizes speed and efficiency. LSD-SLAM is better suited for applications requiring detailed environment reconstruction, while SVO is more appropriate for resource-constrained platforms like drones or mobile devices.

An optimization-based multi-sensor state estimator

Pros of VINS-Fusion

  • Supports multi-sensor fusion (visual-inertial, GPS, wheel odometry)
  • Provides loop closure for improved accuracy and drift reduction
  • Offers both monocular and stereo camera support

Cons of VINS-Fusion

  • Higher computational complexity due to multi-sensor fusion
  • Requires more careful parameter tuning for optimal performance
  • May have slower initialization compared to SVO

Code Comparison

VINS-Fusion (C++):

void System::ProcessIMU(double dt, const Vector3d &linear_acceleration, const Vector3d &angular_velocity)
{
    if (!initialized_)
    {
        return;
    }
    estimator.processIMU(dt, linear_acceleration, angular_velocity);
}

SVO (C++):

void FrameHandlerMono::addImage(const cv::Mat& img, const double timestamp)
{
  if(!startFrameProcessingCommon(timestamp))
    return;
  // process frame
  FramePtr frame(new Frame(cam_, img, timestamp));
  // ...
}

Both repositories use C++ and ROS integration, but VINS-Fusion focuses on multi-sensor fusion while SVO emphasizes efficient visual odometry. VINS-Fusion's code structure reflects its more complex sensor handling, while SVO's code is more streamlined for monocular visual processing.

ORB-SLAM3: An Accurate Open-Source Library for Visual, Visual-Inertial and Multi-Map SLAM

Pros of ORB_SLAM3

  • More comprehensive SLAM system with support for monocular, stereo, and RGB-D cameras
  • Includes loop closing and relocalization capabilities
  • Active development with recent updates and improvements

Cons of ORB_SLAM3

  • Higher computational complexity compared to SVO
  • Potentially slower processing speed for real-time applications
  • Steeper learning curve due to increased complexity

Code Comparison

ORB_SLAM3:

// Feature extraction and matching
void Frame::ExtractORB(int flag, const cv::Mat &im, const int x0, const int x1)
{
    vector<int> vLapping = {x0,x1};
    monoLeft = (*mpORBextractorLeft)(im,cv::Mat(),mvKeys,mDescriptors,vLapping);
}

SVO:

// Direct image alignment
void FrameHandlerMono::processFrameBundle()
{
    // directly minimize photometric error on image
    size_t n_tracked = tracker_->trackFrameBundle(
        new_frames_, last_frames_);
}

Both implementations focus on different aspects of visual odometry, with ORB_SLAM3 emphasizing feature extraction and matching, while SVO utilizes direct image alignment for tracking.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

SVO

This code implements a semi-direct monocular visual odometry pipeline.

Video: http://youtu.be/2YnIMfw6bJY

Paper: http://rpg.ifi.uzh.ch/docs/ICRA14_Forster.pdf

Disclaimer

SVO has been tested under ROS Groovy, Hydro and Indigo with Ubuntu 12.04, 13.04 and 14.04. This is research code, any fitness for a particular purpose is disclaimed.

Licence

The source code is released under a GPLv3 licence. A closed-source professional edition is available for commercial purposes. In this case, please contact the authors for further info.

Citing

If you use SVO in an academic context, please cite the following publication:

@inproceedings{Forster2014ICRA,
  author = {Forster, Christian and Pizzoli, Matia and Scaramuzza, Davide},
  title = {{SVO}: Fast Semi-Direct Monocular Visual Odometry},
  booktitle = {IEEE International Conference on Robotics and Automation (ICRA)},
  year = {2014}
}

Documentation

The API is documented here: http://uzh-rpg.github.io/rpg_svo/doc/

Instructions

See the Wiki for more instructions. https://github.com/uzh-rpg/rpg_svo/wiki

Contributing

You are very welcome to contribute to SVO by opening a pull request via Github. I try to follow the ROS C++ style guide http://wiki.ros.org/CppStyleGuide