Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

-coord ignores perspective: LEDs on oblique strips are placed several cm off in height

Aperta
#177 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
55/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
python

Direzione di ricerca

Start with LED.conversion_matrix and _calculate_3d_coordinates in ledsa/ledpositions/coordinates.py, then inspect the demo geometry in ledsa/demo/demo_setup.py. Trace how LED pixel positions and gaps from dead or ignored LEDs are handled, and add tests for an oblique strip, a vertical strip, and a missing LED. Done means positions follow LED spacing along the strip while the vertical strip remains effectively unchanged.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug

Problem

-coord interpolates the 3D position of every LED linearly between the two tape-measured edge LEDs of its strip, according to where the LED appears in the image. Under perspective that is exact only for a strip at constant depth along the camera's line of sight, such as a vertical strip seen straight on. Along a strip that runs towards or away from the camera, the near part appears stretched and the far part compressed, so the LEDs are placed too far towards the far end. Lens distortion adds to this.

Cause

LED.conversion_matrix builds a linear map from pixel to world coordinates through the two edge LEDs, and _calculate_3d_coordinates maps every LED of the strip with it after projecting its pixel position onto the line between them.

For a pinhole camera, an LED at the fraction t of the way along the strip appears at the fraction

s(t) = t·Z1 / ((1 − t)·Z0 + t·Z1)

of the way along its image, where Z0 and Z1 are the depths of the two edge LEDs along the optical axis. The linear map puts the LED at s(t) instead of t. The error is largest in the middle of the strip and vanishes for Z0 = Z1.

Size on the demo

For the demo geometry (demo_setup.py, camera at 7.29, 6.46, 2.30) and a lens without distortion. The camera's aim isn't recorded, so two plausible aims:

Strip Shape Height error mid-strip, camera aimed at the centre of the setup … aimed at the middle of strip 0
0 diagonal 10.5 cm 7.0 cm
2 diagonal 7.8 cm 5.1 cm
4 diagonal 8.2 cm 6.0 cm
6 diagonal 6.3 cm 4.4 cm
1, 3, 5 vertical < 1 cm < 1 cm

The demo's layers are 11.8 cm thick, so the middle LEDs of a diagonal strip can sit almost a layer too high (strip 0, whose top end is farther from the camera) or too low (strip 4, whose top end is nearer). A wrong LED height changes how its ray is split between the layers, which distorts the profile of a diagonal strip in height, and the temperature correction is interpolated at the wrong heights.

Proposed fix

Place each LED by its position counted along the strip: LED i of N sits at start + i/(N − 1) · (end − start). That is exact for a straight strip with uniform pitch, whatever the perspective or lens distortion.

The count has to include dead and ignored LEDs. Each of them leaves a gap of a whole number of spacings between neighbouring LEDs in the image, so the gaps can be found from the pixel spacing.

Tests: a synthetic oblique strip seen in perspective, a vertical strip whose positions must not change, and a strip with a missing LED.

Results of oblique strips change when they are re-run; vertical strips move by less than about 1 cm.

Related: #47

Lingua principale
Python
Stelle
7
Fork
4
Merge medio
3h 58m
PR unite (30g)
35

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di FireDynamics/LEDSmokeAnalysis

Tutte le issue di FireDynamics/LEDSmokeAnalysis

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.