Skip to content

An implementation of a software for generating accurate 3D object's point cloud using off-the-shelf components. It includes also camera calibration code

License

Notifications You must be signed in to change notification settings

MrCosta57/cloudforge3D

Repository files navigation

CloudForge3D

Description

This repository contains the implementation of a simple 3D laser scanner using off-the-shelf components. The scanner consists of a motorized turntable with a custom-designed fiducial marker and a planar marker placed behind it. The system projects a laser line on the target object, capturing the scene with a camera multiple times during rotation.
The output is a 3D point cloud representing the object's geometry.

The repository also includes code for camera calibration using a video file with a calibration chessboard marker.

Results

ball cat cube

Installation

# [OPTIONAL] create conda environment
conda create -n myenv python=3.11
conda activate myenv

# install requirements
pip install -r requirements.txt

Project structure

project-folder/
├── camera_calibration/
│   ├── data/
│       └── markers/
|   ├── output/
│   └── src/
├── point_cloud_generation/
│   ├── data/
│       └── markers/
|   ├── output/
│   └── src/
|── utils/
|── README.md
└── requirements.txt

Camera calibration

  1. Put the video file for camera calibration in the folder camera_calibration/data directory. The video should contain the calibration chessboard marker
  2. Run the following command to calibrate the camera
    python camera_calibration/src/calibrate.py
  3. The camera calibration parameters will be saved in the camera_calibration/output directory
Command Line Arguments for calibrate.py

--debug

Debug mode (display additional information)

--chessboard_size

Size of the chessboard

--window_scaling_factor

Scaling factor for the window size

--time_skip

Time interval to skip in milliseconds

--video_dir

Directory containing the video file

--video_name

Name of the video file

--output_dir

Directory to save the output file

--output_name

Name of the output file

It's possible to interrupt the video processing by pressing the Q key

Point cloud generation

  1. Put the video file for point cloud generation in the folder point_cloud_generation/data directory. The video should contain the back marker and the plate marker for a correct program execution
  2. Run the following command to generate the point cloud
    python point_cloud_generation/src/generate.py
  3. The point cloud will be saved in the point_cloud_generation/output directory
Command Line Arguments for generate.py

--debug

Debug mode (display additional information)

--window_scaling_factor

Scaling factor for the window size

--video_dir

Directory containing the video file

--video_name

Name of the video file

--output_dir

Directory to save the output file

--camera_params_dir

Directory containing the camera parameters file

--camera_params_name

Name of the camera parameters file

--plate_marker_info

Information about the object marker (seq_string, min_pattern_len, marker_radius_cm)

--back_marker_size

Size of the back marker (width_cm, height_cm)

If debug mode is enabled, the program will display different windows:

  1. Shapes frame: provide more information on the object contours and the geometric shapes fitted during the video processing
  2. Projection frame: shows the data related to points' projections, for checking the correctness of markers' coordinate systems and their extrinsic parameter identification
  3. Laser frame: contains all the points detected by the procedure for fitting the laser plane

It's possible to interrupt the video processing by pressing the Q key. If SPACE is pressed, the program will pause the video processing.

About

An implementation of a software for generating accurate 3D object's point cloud using off-the-shelf components. It includes also camera calibration code

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages