Skip to content

Commit

Permalink
Updated README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
TheMariday committed Mar 11, 2024
1 parent f8329aa commit 1a9dca6
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 6 deletions.
20 changes: 16 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# L3D LED Mapper

[![Supported Python Version](https://img.shields.io/badge/python-3.9%20%7C%203.10%20%7C%203.11-blue)]()
[![Windows](https://github.com/TheMariday/L3D/actions/workflows/test_windows.yml/badge.svg)](https://github.com/TheMariday/L3D/actions/workflows/test_windows.yml)
[![Ubuntu](https://github.com/TheMariday/L3D/actions/workflows/test_ubuntu.yml/badge.svg)](https://github.com/TheMariday/L3D/actions/workflows/test_ubuntu.yml)
[![MacOS](https://github.com/TheMariday/L3D/actions/workflows/test_mac.yml/badge.svg)](https://github.com/TheMariday/L3D/actions/workflows/test_mac.yml)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)


This is a selection of tools to map LEDs into 2D and 3D space using only your webcam!

This works best in a dim environment so please make sure your camera isn't pointing at any other light sources! (Test in Step 1)
Expand Down Expand Up @@ -74,7 +74,7 @@ Set up your LEDs in front of your camera and run `python scripts/capture_sequenc

Change `--led_count` to however many LEDs you want to scan and `--output_dir` to whatever folder you would like to export the 2D maps to.

This will produce timestamped CSV files with the following format:
This will produce a timestamped CSV file with the following format:

```
led_id, x, y
Expand All @@ -83,12 +83,24 @@ led_id, x, y
Run `python scripts/capture_sequence.py --help` to list the optional parameters

## Step 5: Reconstruct a 3D map
*TODO*

To create a 3D map, run `capture_sequence` multiple times from different views of your LEDs,
this can either be done by moving your webcam around your LEDs or rotating your LEDs.

I would recommend at least 3 positions with around 20° between views.

Once you have a selection of 2D maps captured with the `capture_sequence` script, run `python scripts/reconstruct.py --input_dir my_scan`

This may take a while, however once complete will generate `reconstruction.csv` in the input directory

The below reconstruction uses 9 views, each 22.5° apart for optimal reconstruction

![alt text](docs/images/reconstruct.png "Reconstruct window")


## Step 6: Visualise!

Run `python scripts/visualise.py <filename>` to visualise 2D and 3D csv map files
Run `python scripts/visualise.py <filename>` to visualise 2D ~~and 3D~~ csv map files

# Feedback

Expand Down
Binary file added docs/images/reconstruct.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions scripts/reconstruct.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import logging
import argparse
import sys

from pathlib import Path
sys.path.append("./")

from lib.sfm.sfm import SFM
Expand All @@ -28,5 +28,5 @@
sfm.process()

sfm.print_points()
sfm.save_points("points3d.csv")
sfm.save_points(Path(args.input_dir) / "reconstruction.csv")
sfm.display()

0 comments on commit 1a9dca6

Please sign in to comment.