Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

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

未关闭
#177 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
55/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
活跃
技术栈
python

调研方向

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.

由索引模型根据 Issue 内容生成。

描述

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

主要语言
Python
星标
7
派生
4
平均合并
3 小时 58 分钟
30 天内合并 PR
35

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

FireDynamics/LEDSmokeAnalysis 的其他 Issue

查看 FireDynamics/LEDSmokeAnalysis 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。