Git Product home page Git Product logo

laser-scanning's Introduction

laser-scanning

A 3D Scanner using Laser Structured Light, written in Python using OpenCV and NumPy.

Input:

input

Output (in PLY format):

output

Source footage thanks to professor Filippo Bergamasco (Ca Foscari University of Venice).

Usage

Camera Calibration

Before capturing the 3D model, a Camera Intrinsics calibration is expected. For this task you need to have some images with a calibration chessboard pattern. The calibration pattern is available in patterns/chessboard.pdf.

calibration pattern

After capturing the images, put them in the calibration_images folder and run this command:

python3 cameraCalibrator.py -v

You can omit the -v option if you don't want to see debug output.

After the calibration is completed the result will be saved in intrinsics.xml, ready to be loaded by the scanner.

Scanner

To start the scanner with a video file, run this command:

python3 scanner.py -v cup1.mp4

You can omit the -v option if you don't want to see debug output.

The resulting scan will be showed after finish and will be saved in output.ply.

You may need to adjust the HSV ranges for the laser in the head of scanner.py.

Performance

The tests were performed on a MacBook Pro (i7-9750H @ 2.60GHz, 32Gb RAM DDR4, macOS 10.15.5).

File name Video length Total Processing Time Frames Proc Time
cup1.mp4 62s 101s 79s
cup2.mp4 45s 89s 66s
puppet.mp4 53s 91s 73s
soap.mp4 72s 112s 88s

We divided the time spent in initialization and mesh saving from the time spent in frame processing, to get a better estimate of the average frame processing time. Subtracting the frame time from the total time, we get an average of 19 seconds per video of fixed processing time.

Given that the videos are 15FPS, and considering only the frame processing time, the average processing time per frame is 0.092 seconds, with an average speed of 0.73x.

Profiling

We run a benchmark with cProfile to measure the performance of the application:

profile

Most of the time is spent in:

  • Line Plane Intersection (~42%) โ€“ Difficult to do better in Python, since it involves a very long for loop, it may be useful to use less points
  • OpenCV Undistort (~16%) โ€“ Unavoidable processing time, already highly optimized by OpenCV in C++
  • Ray Calculation (~9%)
  • Plane Fitting (~7%)

laser-scanning's People

Contributors

giulioz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

laser-scanning's Issues

question

hi i have questions , does the system work with live video ? or it need to capture the video first the process it ?
will higher fps makes it faster ?

Bug

Traceback (most recent call last):
File "...\laser-scanning-master\cameraCalibrator.py", line 231, in
run(debug)
File "...\laser-scanning-master\cameraCalibrator.py", line 203, in run
imagePoints, (imagePoints.shape[0], imagePoints.shape[1], 1, 2)
IndexError: tuple index out of range

When I try to use camera calibrator I get this error. How to verify if my image set is correct and can be read as it should?

Sample data

Hey there :) cool repo...

Would you be able to supply the sample data of the cup?

Bug

SetViewPoint() failed because window height and width are not set

how to solve this problem?

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.