ScanfM
ScanfM (Scan from Motion): A compact 3D scanning system using motion-based image reconstruction.
Author: Chințoiu Vlăduț-Andrei
GitHub Project Link: https://github.com/UPB-PMRust-Students/project-GameSkyRO
Description
ScanfM is a hardware-software system designed to bridge the gap between the physical and digital worlds through 3D reconstruction. Using Structure from Motion (SfM), the project utilizes an STM32F767ZI microcontroller, an ESP32, and an ESP32-CAM module to capture and transmit a series of precisely angled photographs of a physical object.
The object is placed on a rotating platform controlled by a servomotor, while a fixed ESP32-CAM module captures images at defined intervals. These images are triggered and ordered by the STM32 board and transmitted wirelessly for processing on a PC, where the 3D model is reconstructed using SfM algorithms. ScanfM enables 3D scanning with a clean separation between data acquisition (on-device) and processing (on-host).
Motivation
For as long as I can remember, I’ve been passionate about games and game development, especially in 3D. Initially, I was drawn to coding, thinking it was the heart of game creation. But I soon discovered that game development involves much more than writing code. In fact, 3D modeling, rigging, and animation are often the real creative and technical challenges.
Curious, I began exploring the world of 3D design. While my main passion still lies in programming, this new dimension of development sparked my interest. That curiosity led me to this project: one that aims to bridge the gap between the physical and digital worlds.
Objects are central to our existence, from housing and food to tools and entertainment. While we can’t always reshape the real world to match our imagination, the digital world knows no limit. To truly create, however, we need a foundation - a reference. This is where my 3D scanner comes in: a way to digitize real-world objects and bring them into the creative realm as manipulable assets for design, games, or visualization.
Architecture
Main components:
- STM32F767ZI board - handles the timing and processing of images during the 3D scanning process
- ESP32-CAM module - captures grayscale images of the object being scanned
- ESP32 - transmits the captured data via Wi-Fi from the STM32 to the computer for further processing
Secondary components
- Servomotor - rotates the object at precise angles to capture images from multiple perspectives.
- Button - initiates the 3D scanning sequence when pressed
- Lights - provides optimal illumination to enhance the contrast between the object and its background
Connections:
- ESP32-CAM <-> STM32 : UART
- STM32 <-> ESP32 : SPI
- ESP32 <-> PC : Wi-Fi
- STM32 <-> Secondary components : PWM/Digital
Log
Week 21 - 27 April
Established communication between the ESP32 and the STM board via SPI, along with connectivity between the ESP32 and my computer.
Week 28 April - 4 May
Tested functionality of ESP32-CAM module and different image formats.
Week 5 - 11 May
Week 12 - 18 May
Week 19 - 25 May
Hardware
- STM32F767ZI Board: Acts as the central controller, responsible for timing the capture of images and processing them. It coordinates the system and sends commands to other components.
- ESP32-CAM Module: A camera module used to capture grayscale images of the object. It is connected to the STM for image acquisition.
- ESP32: Used to wirelessly transmit the captured image data from the STM to a PC for further processing and 3D reconstruction.
- Servomotor: A motor used to rotate the object at precise angles to allow for multiple image captures from different perspectives.
- Button: Initiates the 3D scanning sequence when pressed, triggering the system to start the image capture process.
- Lights: Provide necessary illumination to enhance the contrast between the object and the background for clearer image capture.
Schematics
//TODO Place your KiCAD schematics here.
Bill of Materials
Device | Usage | Price |
---|---|---|
STM32F767ZI | Main microcontroller | 136 RON |
ESP32 | Transmitter | 17 RON |
ESP32-CAM Module | Camera module | 62 RON |
Servomotor SG90 | Servomotor | 10 RON |
MM Jumper Cables | Cables | 6 RON |
MF Jumper Cables | Cables | 6 RON |
FF Jumper Cables | Cables | 7 RON |
Resistors | Resistors | 15 RON |
Software
Library | Description | Usage |
---|---|---|
embassy | Modern, lightweight, and safe async framework for embedded systems | Used for async task handling and peripheral management |
esp-idf-hal | Embedded-hal implementation for Rust on ESP32 and ESP-IDF | Used for peripheral management |
esp-idf-svc | Type-Safe Rust Wrappers for various ESP-IDF services (WiFi, Network, Httpd, Logging, etc.) | Used for Wi-Fi management |