All Projects → jhdewitt → Sltk

jhdewitt / Sltk

Licence: mit
An OpenCV-based structured light processing toolkit.

Programming Languages

cpp
1120 projects

Projects that are alternatives of or similar to Sltk

3dv tutorial
An Invitation to 3D Vision: A Tutorial for Everyone
Stars: ✭ 571 (+278.15%)
Mutual labels:  3d-reconstruction, camera-calibration, opencv
Camera calibration api
A simple Python API for single camera calibration using opencv
Stars: ✭ 36 (-76.16%)
Mutual labels:  camera, camera-calibration, opencv
Rpindvi
Raspberry PI NDVI Code
Stars: ✭ 57 (-62.25%)
Mutual labels:  raspberry-pi, camera, opencv
Picamnn
Survelliance system with deep learning based people detection (YOLO)
Stars: ✭ 97 (-35.76%)
Mutual labels:  raspberry-pi, opencv
Phormatics
Using A.I. and computer vision to build a virtual personal fitness trainer. (Most Startup-Viable Hack - HackNYU2018)
Stars: ✭ 79 (-47.68%)
Mutual labels:  camera, opencv
Ev3dev Lang Java
A project to learn Java and create software for Mindstorms Robots using hardware supported by EV3Dev & the LeJOS way.
Stars: ✭ 79 (-47.68%)
Mutual labels:  raspberry-pi, opencv
Ofxmvg
OFX plugins for Multiple View Geometry
Stars: ✭ 64 (-57.62%)
Mutual labels:  camera, camera-calibration
Sobfu
real-time 3D reconstruction of non-rigidly deforming scenes using depth data
Stars: ✭ 113 (-25.17%)
Mutual labels:  3d-reconstruction, opencv
Hiitpi
A workout trainer Dash/Flask app that helps track your HIIT workouts by analyzing real-time video streaming from your sweet Pi using machine learning and Edge TPU..
Stars: ✭ 106 (-29.8%)
Mutual labels:  raspberry-pi, opencv
Arm Vo
Efficient monocular visual odometry for ground vehicles on ARM processors
Stars: ✭ 115 (-23.84%)
Mutual labels:  raspberry-pi, opencv
Raspisecurity
Home Surveillance for Raspberry
Stars: ✭ 128 (-15.23%)
Mutual labels:  raspberry-pi, opencv
Rpicam
Raspberry PI Surveillance Automation
Stars: ✭ 77 (-49.01%)
Mutual labels:  raspberry-pi, camera
Openframeworks
openFrameworks is a community-developed cross platform toolkit for creative coding in C++.
Stars: ✭ 8,652 (+5629.8%)
Mutual labels:  raspberry-pi, opencv
Picam
Elixir library used to capture MJPEG video on a Raspberry Pi using the camera module.
Stars: ✭ 96 (-36.42%)
Mutual labels:  raspberry-pi, camera
Opencv 3.2.0 Compiling On Raspberry Pi
Download, Compile, Build, and Install OpenCV 3.2.0 with Extra Modules on RPI running Jessie
Stars: ✭ 65 (-56.95%)
Mutual labels:  raspberry-pi, opencv
Androidfacedetection
Android 平台进行人脸检测的几种方案
Stars: ✭ 106 (-29.8%)
Mutual labels:  camera, opencv
Balena Cam
Network Camera with Raspberry Pi and WebRTC. Tutorial:
Stars: ✭ 120 (-20.53%)
Mutual labels:  raspberry-pi, camera
Yolo Powered robot vision
Stars: ✭ 133 (-11.92%)
Mutual labels:  raspberry-pi, opencv
Vidgear
A High-performance cross-platform Video Processing Python framework powerpacked with unique trailblazing features 🔥
Stars: ✭ 2,048 (+1256.29%)
Mutual labels:  raspberry-pi, opencv
Vgg Multiple View Geometry
A set of MATLAB utilities for multiple view geometry, provided alongside Hartley & Zisserman's "Multiple View Geometry in Computer Vision, Second Edition" (2004). Obtained from http://www.robots.ox.ac.uk/~vgg/hzbook/code/.
Stars: ✭ 62 (-58.94%)
Mutual labels:  3d-reconstruction, camera-calibration

SLTK

SLTK stands for Structured Light Took Kit. These are a collection of open source command line and GUI tools I have written with the intention of making operation of DIY structured light systems easier for myself. An effort has been made to separate the tools into logical units of work. It is possible to run the display program, the camera capture program, and the control program all on separate networked computers.

Here's an example of a sea shell generated from 74 aligned pointclouds captured using a raspberry pi v1 camera + sony mp-cl1 projector + arduino-based turntable (~5deg per turn): https://sketchfab.com/models/5def256988594fae93ceb69b59fabbcc

Two sets of raw+processed data from individual sea shell scans are available in the sampledata directory, along with the associated projector/camera calibration file.

Uses

  • Finding intrinsic camera calibration: 3x3 matrix + radial/tangential distortion coefficients
  • Finding intrinsic projector calibration: 3x3 matrix + radial/tangential distortion coefficients
  • Finding extrinsic matrix for a stereo camera + projector setup
  • Calculating correspondence map between camera and display pixels (screen or projector)
  • Generating 3D point clouds from correspondence data and intrinsic+extrinsic calibration data
  • Rendering a visualization of calibration data with rainbow color map and isolines of distortion magnitude per pixel
  • Displaying timed structured light patterns via graphics adapter to display or projector
  • Capturing timed images of structured light patterns via camera input
  • Automated rotation of objects using a basic arduino stepper motor turntable
  • Merging multiple point clouds for generating a static background point set to allow automated cleanup
  • Background subtraction for cleaning up 3D point clouds by specifying a "background" point set
  • Automated alignment of 3D point clouds (requires background subtraction to remove static objects)
  • Cultural Heritage Preservation

Synopsis

This collection of programs is intended to be used to create dense 3D pointclouds of semi-matte objects. This toolkit requires hardware in order to scan objects. Hardware tried for development includes:

  1. raspberry pi (v3 model b and zero)
  2. rpi camera (v1 and v2)
  3. flatscreen LCD monitor
  4. projector
  5. turntable

mjpeg-streamer [external tool]

This third party program (https://github.com/jacksonliam/mjpg-streamer) continuously captures images from a camera and streams them over the network. A fork is used in this case to specifically ensure support for the rpi camera, although it should be possible to use other cameras. Please see mjpg-streamer docs for more info. Requires: camera

sldisp

Tool for generating structured light patterns. Supports binary gray code, sinusoid, and monochrome RGB pattern outputs. Receives OSC messages and updates output pattern. Requires: display device (e.g. LCD screen, DLP projector), slcapture

slcapture.py

Main control program: streams images continuously from an mjpg-streamer server while triggering preset pattern sequences on an sldisp client. Each "scan" output is really just a directory of images, each taken while a specific structured light pattern is displayed. These scans are processed by slcrunch. Requires: mjpg-streamer, camera, sldisp, display device

slcrunch

A tool for processing image sequences of e.g. binary gray code patterns into raw correspondence data or 3D point clouds. Requires accurate projector-camera calibration file in order to generate useful point clouds. Takes a list of images as input. See sampledata directory for list format.

slcalibrate

A tool for camera and projector lens calibration, as well as camera-projector registration. For camera lens calibration, a flatscreen display is used to show binary gray code patterns and only camera~display correspondence data is required. For projector-camera calibration, a camera, projector, and a flat printed chessboard pattern is needed (see slcrunch -help for details). See wiki for more info.

chessgen

A tool for generating images of chess patterns for lens calibration. Specify edge length in pixels, number of x/y inner corners, and x/y image output dimensions.

plotlens

This program creates an image visualizing image distortion using calibration data input. Helpful for understanding quality of calibration data.

plyalign

(WIP) Tool for automatically aligning multiple .PLY 3D pointcloud files. Specify .PLY files in sequential order, and repeated rotation from scan to scan is estimated.

plymerge

Tool for merging multiple .PLY 3D pointcloud files. Combines all input files into one as-is with no alignment performed. Handy for making background subtraction files for speedy cleanup.

plytrim

Tool for trimming .PLY 3D pointcloud files. Input a primary/reference pointcloud + distance X: all points in primary set within X units of any point in reference are removed. Output file only contains points in primary set which have no neighbors within X units in reference set.

listcreator

This program creates a file containing a list of images in a sequence. Since image sequences need to be processed as a group, image filename lists are used to pass them to slcrunch and slcalibrate. Capture programs should generate lists automatically, as in slcapture.py. This tool is a manual fallback.

Prerequisites

Need installed: opencv2 pcl2 liblo sdl2 flann boost

Building

Built using: OpenCV(2.4.10), SDL2(2.0.3), liblo(0.28), exiftool(9.69), on Mac OS X 10.10.2, 10.11.6, 10.12

mjpg-streamer is used to ingest camera data https://github.com/jacksonliam/mjpg-streamer Some programs link with OpenCV, an open source image processing library http://opencv.org/ slcrunch calls the exiftool program for reading image metadata. http://www.sno.phy.queensu.ca/~phil/exiftool/ sldisp links with SDL2, a user interface library. More information at https://www.libsdl.org/ Some programs with liblo, an Open Sound Control library for packet communication. http://opensoundcontrol.org/implementations

I have prepared a basic Makefile; it should compile all the tools with "make" or individual ones with a target e.g. "make slcrunch". Could use some work.

Separation of tasks

sltk is split up into standalone command line programs, each meant to handle a separate set of tasks in a structured light processing workflow.

mjpg-streamer is run on a computer connected to a supported camera. sldisp is run on a computer connected to a flatscreen or projector. slcapture.py talks to the two programs above to display sequences of patterns and save images of each in a directory slcrunch processes a directory of images into a correspondence file, or into a 3D point cloud with appropriate calibration input file slcalibrate processes correspondence files and outputs calibration data for cameras and projectors

Typical lens calibration consists of a camera-monitor (flatscreen display) setup, with sldisp showing structured light patterns on the display. guppy_cap is used to capture image sequences, which are processed into camera-display correspondence data with slcrunch. Once you've collected enough different viewpoints of a flatscreen monitor, the correspondence data is passed to slcalibrate. Calibration output from slcalibrate includes camera matrix, camera distortion coefficients, and camera pixel dimensions.

Typical projector calibration consists of a camera-projector setup, with sldisp showing structured light patterns on the projector. guppy_cap is used to capture image sequences of a flat chess calibration pattern, which are processed into camera-chess-projector correspondence data with slcrunch Once you've collected enough different viewpoints of the chess pattern, the correspondence data is passed to slcalibrate. Calibration output includes camera matrix, camera distortion, projector matrix, projector distortion, etc. Separate calibration of lens and projector is strongly recomended.

Calibration output can be visualized using plotlens to see a color mapped distortion image.

slcalibrate can take previous calibration files for camera or projector, to reuse intrinsic calibration data. Used for camera-projector registration.

RPI example hardware

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].