keypoints_to_image2d — REPRCONV keypoint op

• Data kinds: keypoints → image2d

• Call: import fullseye as fs; fs.ledger.keypoints_to_image2d(keypoints, shape=(64, 64)) (to call the implementation directly, import reprconv; reprconv.keypoints_to_image2d(keypoints, shape=(64, 64)); from the registry, opsreprconv.get("keypoints_to_image2d"))

Usage

Image coordinates (N,2) = (u, v) → a count image (H, W). The second exit from keypoints.

Adds 1 at row round(v), column round(u). The quantisation onto the pixel grid is the loss: round-tripping with keypoints_from_image2d shifts positions by up to 0.5 pixel (measured on 225 well-separated points: per axis RMS 0.2835 px = matches the theoretical value of uniform quantisation 1/sqrt(12) = 0.2887. As a 2-D distance it is sqrt(2) times that, 0.4009 px, theory sqrt(2/12) = 0.4082). ★ This too was once gotten wrong: the measured 2-D distance was put next to the 1-D theoretical value and almost read as "should be 0.29 but it is 0.40" -- mixing per-axis quantities with distance quantities makes a correct implementation look wrong. Nearby points fuse as connected components, so the round trip can also reduce the number of points (measured: 60 points placed at random become 54 points).

Out-of-range points are not silently dropped -- dropping them would make it impossible to tell whether "detections decreased" or "the image was too small".

Args:

keypoints: (N, 2) (u, v).

shape: (H, W).

Returns:

(H, W) float64 count image.

Raises:

ValueError: invalid shape / non-finite / there are out-of-range points / shape exceeds the limit.

References (sample data, literature)

• Sample-data catalog (download URLs / licences) — 2-D uses skimage.data (BSD/public domain) plus synthetic images; 3-D lists download URLs for real data sources (Stanford, PDS, …).

• Operator provenance and references — the sources of the research/methods this op family came from.

• The canonical algorithm (author, year) and its uses are named in the family usage guide above.

Runnable examples (verified samples that actually call this op)

• representation_roundtrip — py -3.11 examples/representation_roundtrip.py

Ops the type connects to (they accept image2d as input)

keypoints_from_image2d

Same category (keypoint)

keypoints_uv_to_points · points_zyx_to_keypoints_uv · keypoints_from_image2d · position_to_points · points_to_position


*Provenance: reprconv.py — REPRCONV operator registry. This per-op note is generated by tools/opdocs.py md (do not hand-edit).*

© 2026 Kazufumi Furuse — Fullseye operator documentation. Licensed under Apache-2.0.