This repo uses a stereo camera and gray-code-based structured light to realize dense 3D reconstruction.

Overview

Structured-light-stereo

This repo uses a stereo camera and gray-code-based structured light to realize dense 3D reconstruction.

pcd. pcd

How to use:

  • STEP 1: Setup the stereo camera and calibrate it with a Charuco marker. An example dataset is provided in ./data/stereo_calib_flir. You can play with it by running ./capture/charuco_calib.py. The calibration results will be saved in './data/stereo_calib_flir/stereo_calib_data.h5.
  • STEP 2: Connect your projector with your computer and run gray_code_encoder.py to project gray-code patterns. I used two FLIR cameras to build my stereo system and the driver script is ./capture_calib/double_flir_capture.py. An example dataset is in ./data/bag.
  • STEP 3: Run one of the three gray_code_decoder_*.py scripts to get the reconstructed point clouds. Differences among them are:
    • gray_code_decoder_disp.py: First recover a disparity map and rely on it to construct the point clouds. So the matching is column-direction only. This script can be the primary choice with good stereo calibration.
    • gray_code_decoder_tria_all_pts.py: First respectively construct the pixel-level camera-projector correspondences. Then triangulate the left-right camera pixels that correspond to the same projector's pixel. So the matching is 2D.
    • gray_code_decoder_tria_unique_pts.py: Same as above. But only pixels with unique correspondences are triangulated.
You might also like...
PyLog - Simple keylogger that uses pynput to listen to keyboard input.

Simple keylogger that uses pynput to listen to keyboard input. Outputs to a text file and the terminal. Press the escape key to stop.

CO2Ampel - This RaspberryPi project uses weather data to estimate the share of renewable energy in the power grid

CO2Ampel This RaspberryPi project uses weather data to estimate the share of ren

🏡 My Home Assistant Configs. Be sure to 🌟 my repo to follow the updates!
🏡 My Home Assistant Configs. Be sure to 🌟 my repo to follow the updates!

Home Assistant Configuration Here's my Home Assistant configuration. I have installed HA on a Lenovo ThinkCentre M93P Tiny with an Intel Dual-Core i5-

This repository hosts the code for Stanford Pupper and Stanford Woofer, Raspberry Pi-based quadruped robots that can trot, walk, and jump.
This repository hosts the code for Stanford Pupper and Stanford Woofer, Raspberry Pi-based quadruped robots that can trot, walk, and jump.

This repository hosts the code for Stanford Pupper and Stanford Woofer, Raspberry Pi-based quadruped robots that can trot, walk, and jump.

New armachat based on Raspberry Pi PICO an Circuitpython code

Armachat-circuitpython New Armachat based on Raspberry Pi PICO an Circuitpython code Software working features: send message with header and store to

Run this code to blink your ThinkPad LED with a hidden mysterious Morse code! ;)
Run this code to blink your ThinkPad LED with a hidden mysterious Morse code! ;)

TMorse Run this code to blink your ThinkPad LED with a hidden mysterious Morse code! ;) Compatible with python3.9+. No third-party library is required

This repository contains all the code and files needed to simulate the notspot quadrupedal robot using Gazebo and ROS.
This repository contains all the code and files needed to simulate the notspot quadrupedal robot using Gazebo and ROS.

Notspot robot simulation - Python version This repository contains all the files and code needed to simulate the notspot quadrupedal robot using Gazeb

Example code and projects for FeatherS2 and FeatherS2 Neo
Example code and projects for FeatherS2 and FeatherS2 Neo

FeatherS2 & FeatherS2 Neo This repo is a collection of code, firmware, and files

Code and build instructions for Snap, a simple Raspberry Pi and LED machine to show you how expensive the electricyty is at the moment

Code and build instructions for Snap, a simple Raspberry Pi and LED machine to show you how expensive the electricyty is at the moment. On row of LEDs shows the cost of the hour, the other row the cost of the day.

Comments
  • decoding problem

    decoding problem

    I checked your code carefully. In the decoding section, only the gray_code_decoder_disp.py file Function. The rest of the files show this error after execution. Traceback (most recent call last): File "C:/Users/APA/PycharmProjects/pythonProjectOpen3D/Structured-light-stereo-main/gray_code_decoder_tria_unique_pts.py", line 121, in error, projPixel = graycode.getProjPixel(pattern_list[0], j, i) TypeError: Required argument 'projPix' (pos 4) not found

    Process finished with exit code 1 In addition, and most importantly, the output file cannot be converted into a mesh. My goal is to use your code to convert the decode of the bag into an .obj file and display it in my program through Mashlab.

    opened by atroopa 3
  • 'disp_filter' is not defined in gray_code_decoder_disp.py

    'disp_filter' is not defined in gray_code_decoder_disp.py

    Hi, SILI1994 Thanks for your great work ! There is something to ask for your advice. When I run "gray_code_decoder_disp.py", I meet a problem is "NameError: name 'disp_filter' is not defined" I also can't find any function or py file named by 'disp_filter'. Could you give me any advice? thank you!

    opened by wjwang0816 2
  • Scalloped dots in the point cloud!

    Scalloped dots in the point cloud!

    Hello, I am generating point cloud data with my own images using gray_code_decoder_disp.py. But the point cloud is scalloped as seen in the photo. In other words, it consists of many small squares parallel to the plane of the camera.

    Point Cloud Photos:

    Full cloud: https://ibb.co/bWGD1DX Zoom to small squares : https://ibb.co/f1TMFQc Zoom squares side view: https://ibb.co/tL9xdqw

    Even though the surface of the piece I scanned is completely smooth and flat, the point cloud is formed in this way.

    opened by cagataykrdmr 1
Owner
FEI
FEI
Red Light Green Light Robot

Red Light Green Light Robot The primary problem addressed by our project is robotic follower behavior i.e. maintaining distance from a moving target.

Will Romano 2 Nov 20, 2021
A versatile program that uses the raspberry pi camera and provides it as a service

PiCameleon Is a daemon program meant to provide the RaspberryPi Camera as a service while running according to a configuration.

André Esser 52 Oct 16, 2022
Lenovo Legion 5 Pro 2021 Linux RGB Keyboard Light Controller

Lenovo Legion 5 Pro 2021 Linux RGB Keyboard Light Controller This util allows to drive RGB keyboard light on Lenovo Legion 5 Pro 2021 Laptop Requireme

null 36 Dec 16, 2022
A blender 2.9x addon for managing camera settings

TMG-Camera-Tools A blender 2.9x addon for managing camera settings Tutorial showcasing current features

Mainman002 12 Apr 16, 2022
Home assiatant Custom component: Camera Archiver

Camera archiver Archive your ftp camera meadia files on other ftp with files renaming and event creation. Event can be used for send information to el

null 1 Jan 6, 2022
Aqara Camera G3 integration for Home Assistant

Aqara Camera G3 integration for Home Assistant ATTENTION: The component only works after enabled telnet. Only supportd stream. Not support still image

null 14 Dec 18, 2022
Blender Camera Switcher

Blender Camera Switcher A simple camera switcher addon for blender. Useful when use reference image for camera. This addon will automatically fix the

Corgice 1 Jan 31, 2022
Philippe 1 Jan 9, 2022
Uses the Duke Energy Gateway to import near real time energy usage into Home Assistant

Duke Energy Gateway This is a custom integration for Home Assistant. It pulls near-real-time energy usage from Duke Energy via the Duke Energy Gateway

Michael Meli 28 Dec 23, 2022
A battery pack simulation tool that uses the PyBaMM framework

Overview of liionpack liionpack takes a 1D PyBaMM model and makes it into a pack. You can either specify the configuration e.g. 16 cells in parallel a

PyBaMM Team 40 Jan 5, 2023