Coder Social home page Coder Social logo

structured-light-stereo's Introduction

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 0: pip install opencv-python==4.5.4.60 opencv-contrib-python==4.5.4.60 (Version is necessary since the APIs are changed in higher versions.)

  • STEP 1: Setup the stereo camera and calibrate it with a Charuco board. 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.

Citation

This repo is part of our DP-simulator project. Please consider to cite our paper if you find this repo useful

@inproceedings{li2023learning,
  title={Learning to Synthesize Photorealistic Dual-pixel Images from RGBD frames},
  author={Li, Feiran and Guo, Heng and Santo, Hiroaki and Okura, Fumio and Matsushita, Yasuyuki},
  booktitle={2023 IEEE International Conference on Computational Photography (ICCP)},
  pages={1--11},
  year={2023},
  organization={IEEE}
}

structured-light-stereo's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

structured-light-stereo's Issues

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.

'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!

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.

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.