Skip to content

Automated process of shooting photos and rotate a turntable/lazysusan to get images in a 360°/steps view. A 3D object can then be generated with a photogrammetry tool such as Agisoft PhotoScan/Metashape.

License

Notifications You must be signed in to change notification settings

neixlo/3DScanner

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

3DScanner

Automated process of shooting photos and rotate a turntable/lazysusan to get images in a 360°/steps view. A 3D object can then be generated with a photogrammetry tool such as Agisoft PhotoScan/Metashape.

What is this for?

This repo contains code an information to setup an automated turntable to make photos in certain steps once around an object. Its especially usefull for photogrammetry tasks where you'll need lots of photos once anround an object. With the option of multiple photo positions and a background photo, the workflow is opimized to work with photogrammetry tools like Agisofts PhotoScan/Metashape.

So you can create images like this:
exp_imgs.

Which can be further processed to:

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

Prerequisites

Needed Hardware and its setup is described below. The system is expected to be Linux (just tested with Linux Mint 18.3).

Hardware

Hardware setup

Setup as described in: https://www.hackster.io/ashleyblack/tb6600-stepper-motor-driver-tester-85a29e

Except of

  1. That I used an Arduino UNO and therfore the code /main/TB6600_Step_Driver.ino changed.

  2. The wiring of the driver stage is changing accordingly:
    ENA- --- to --- ArduinoUNO GND
    ENA+ --- to --- ArduinoUNO _Pin2
    DIR- --- to --- ArduinoUNO _GND
    DIR+ --- to --- ArduinoUNO _Pin3
    PUL- --- to --- ArduinoUNO _GND
    PUL+ --- to --- ArduinoUNO _Pin4
    B- --- to --- StepperMotor _black
    B+ --- to --- StepperMotor _green
    A- --- to --- StepperMotor _red
    A+ --- to --- StepperMotor _blue
    GND --- to --- PowerSupply _GND
    VCC --- to --- PowerSupply _+15V

  3. The switches all are OFF but switch 4 is ON

Installing

This installing instruction is made with anaconda. Open an terminal in the cloned directory and run following comands.

Create an conda environment.

conda create -n YOUR_ENV_NAME python=3.6.0

Activate your new environment.

conda activate YOUR_ENV_NAME

Install the needed requirements.

pip install -r requirements.txt

Usage

Activate your new environment.

conda activate YOUR_ENV_NAME

Run python interpreter.

python

Import the scanner class an make an

import scanner
sc = scanner.scanner()

Do a test shot.

sc.cam_shot('filepath_to_save_in', 'filename')

Rotate turntable/steper and shoot photos of 360° in 30° steps. You'll be ask to type in a scanning position, if you want an background image, etc.

sc.scan_process('filepath_to_save_in', 'name_of_object', 30)

The generated output should be images saved under a diffrent paths which are sorted after their view/camera position (e.g. upside, topview, ...).

If you gather 2x 360° runs (scan_process('path', 'apple', 18)) of photos in 18° steps, you'll get 2x 20 images as output. This output can be aligned in a photogrammetry tool and potentially look like this.

photos_aligned_in_photogrammetry_tool_2layers.

Example

You can find an example scannning process in the JupyterLab Notebook under /main/scanning_exp_pear.ipynb.

Best Practices

  1. Use feature richt Objects (e.g. featureless is a unicolor symetrical object).
  2. Do a lot of photos from every possible angel an view point.
  3. Setup a perfect lightning an really avoid any shadows, especially at the point of contact from object to surface.

Support

This code is not supported. Feel free to help yourself.

License

This project is licensed under the GNU General Public License version 3 - see the LICENSE file for details.

About

Automated process of shooting photos and rotate a turntable/lazysusan to get images in a 360°/steps view. A 3D object can then be generated with a photogrammetry tool such as Agisoft PhotoScan/Metashape.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages