Skip to content

CorraPiano/3D-reconstruction

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

3D Reconstruction of a Rectangular Parallelepiped

Language Platform License

Overview

This project reconstructs a 3D rectangular parallelepiped from a single 2D image captured with an uncalibrated, zero-skew camera. It involves theoretical formulations and MATLAB implementations for vanishing lines, rectification mappings, and camera calibration, culminating in a 3D rendering of the results.

This project is part of the Image Analysis and Computer Vision (IACV) course (2024-2025) at Politecnico di Milano.

Features

  • Feature Extraction: Edge and corner detection using the Canny and Harris algorithms.
  • Homography & Rectification: Stratified method for affine and metric rectification.
  • Camera Calibration: Recovery of the camera calibration matrix.
  • 3D Reconstruction: Visualization of the computed parallelepiped.

Repository Structure

├── assets/              # Images used in the report and results
├── code/                # MATLAB scripts
│   ├── HomeworkIACV_code.m    # Full MATLAB code
│   ├── HomeworkIACV_code.mlx  # Main script for processing
│   ├── code_sections/         # Code sections
│   │   ├── feature_extraction.mlx     # Edge and corner detection
│   │   ├── rectification.mlx          # Homography and rectification functions
│   │   ├── calibration.mlx            # Camera calibration
│   │   ├── rendering.mlx              # 3D visualization
├── data/                # Report and documentation
│   ├── Homework Assignment 2024-25.pdf
│   ├── HomeworkIACV_report.pdf
│   ├── HomeworkIACV_results.pdf
├── README.md        # Project documentation

Installation & Usage

Prerequisites

Running the Code

  1. Clone the repository:
    git clone https://github.com/CorraPiano/3D-reconstruction.git
    cd 3D-reconstruction
  2. Open MATLAB and navigate to the code/ directory.
  3. Run the main script:
    HomeworkIACV_code

Sample Images

Below are the visual results of the reconstruction process. The initial image represents the raw input, while the final rendering showcases the reconstructed 3D parallelepiped.


Initial Image

Final 3D Rendering

Results & Discussion

The reconstruction process successfully recovered the depth and height of the parallelepiped, accurately computing the camera calibration matrix. The final 3D visualization provided insights into the spatial structure of the scene. Minor discrepancies in the curve reconstruction were observed, likely due to image quality and manual feature extraction limitations. Despite these, the overall approach proved effective for 3D reconstruction from a single image.

License

This project is licensed under the MIT License.

Contact

For inquiries, please reach out via GitHub issues.

About

Reconstruction of a 3D parallelepiped from a 2D image

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages