Giter Site home page Giter Site logo

hdr_lf_capture's Introduction

HDR Light Field Capture

Hardware and software for capturing Hight Dynamic Range light fields.

The setup consists of an Arduino used to control the Stepper Motor and a Raspberry Pi used to send instructions to the Arduino and capture/receive images from the camera.

Arduino

Wiring

The Stepper Driver used in this setup is DQ542MA and the Stepper Motor used is NEMA 17 42BYGH-W811.

Connection between Stepper Driver and Arduino:

  • PUL+ from Driver to Arduino PIN7
  • PUL- from Driver to Arduino PIN5
  • DIR+ from Driver to Arduino PIN7
  • DIR- from Driver to Arduino PIN6
  • ENBL+ from Driver to Arduino PIN7

Connection between Stepper Driver and Stepper Motor:

  • A+ from Driver to Stepper BLACK wire
  • A- from Driver to Stepper GREEN wire
  • B+ from Driver to Stepper RED wire
  • B- from Driver to Stepper BLUE wire

Connection between Button and Arduino:

  • Button YELLOW wire to Arduino PINA0

DIP Switch Setting

The first three bits of the DIP switch are used to set the dynamic current. For an output current of 2.37A, SW 1, 2, 3 is set to OFF, OFF, ON.

Micro step resolution is set by the last four bits of the DIP switch. For 1600 pulse per revolution, SW 5, 6, 7, 8 is set to OFF, OFF, ON, ON.

Power Supply

The power supply for the Stepper Driver is 18V (3 parallel sets of 2 9V batteries in series).

Python

Dependencies

Installing libgphoto2:

sudo apt-get install libgphoto2-dev

Installing python-gphoto2 and pySerial for python3 with pip:

sudo pip3 install gphoto2
sudo pip3 install pyserial

Usage Examples

Specify the port and baud rate for the serial communication between Arduino and Raspberry Pi in python/camera.py:

port = '/dev/ttyACM0'
baud_rate = 9600

Set the parameters for HDR Light Field capture in python/gui.py:

camera_name = 'SonyA7r1'
# hdr_merging = False

(Optional) Merge the captured images into HDR light field (requires OpenCV):

from merge import merge_light_field
merge_light_field(capture_path, camera_name, n_exposures)

GUI

GUI allows for basic motor and camera control:

  • Motor speed can be set from 1 to 10. (disabled)
  • Camera location can range from 0 to 1000.
  • Number of exposures and stops can be set according to camera settings.
  • Number of views can range from 1 to 1001.
  • Click Capture to capture a single image.
  • Click Capture LF to capture HDR light field.

Uncomment relevant code in python/gui.py to enable different controls.

Release History

  • 0.2.0
    • Edited code structure and added more controls
    • CHANGE: Seperate control.py into and control.py and gui.py
  • 0.1.0
    • The first proper release
    • CHANGE: Add arduino and python
  • 0.0.1
    • Work in progress

hdr_lf_capture's People

Contributors

max1ao avatar ziyi-zhu avatar

Watchers

 avatar

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.