Giter VIP home page Giter VIP logo

lidar_to_camera's Introduction

Lidar 3D Cloud Projection

This Project present how to associate regions in a camera image with Lidar points in 3D space.

For more details, please check my blog.

Dependencies for Running Locally

Basic Build Instructions

  1. Clone this repo.

  2. Make a build directory in the top level project directory: mkdir build && cd build

  3. Compile: cmake .. && make

  4. Run it: ./project_lidar_to_camera.

Steps

  1. Filtering Lidar Points

    The code below shows how a filter can be applied to remove Lidar points that do not satisfy a set of constraints, i.e. they are …

    1. … positioned behind the Lidar sensor and thus have a negative x coordinate.
    2. … too far away in x-direction and thus exceeding an upper distance limit.
    3. … too far off to the sides in y-direction and thus not relevant for collision detection
    4. … too close to the road surface in negative z-direction.
    5. … showing a reflectivity close to zero, which might indicate low reliability.
    for(auto it=lidarPoints.begin(); it!=lidarPoints.end(); ++it) {
        float maxX = 25.0, maxY = 6.0, minZ = -1.4; 
        if(it->x > maxX || it->x < 0.0 || abs(it->y) > maxY || it->z < minZ || it->r<0.01 )
        {
        	continue; // skip to next point
    	}
    }
  2. Convert current Lidar point into homogeneous coordinates and store it in the 4D variable X.

     X.at<double>(0, 0) = it->x;
     X.at<double>(1, 0) = it->y;
     X.at<double>(2, 0) = it->z;
     X.at<double>(3, 0) = 1;
    
  3. Then, apply the projection equation to map X onto the image plane of the camera and Store the result in Y.

    Y = P_rect_00 * R_rect_00 * RT * X;
    
  4. Once this is done, transform Y back into Euclidean coordinates and store the result in the variable pt.

    cv::Point pt;
    pt.x = Y.at<double>(0, 0) / Y.at<double>(0, 2);
    pt.y = Y.at<double>(1, 0) / Y.at<double>(0, 2);
    

lidar_to_camera's People

Contributors

williamhyin avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.