Skip to content

Add optional preprocessing step to marker detection pipeline#21

Draft
qian-chu with Copilot wants to merge 10 commits into
mainfrom
copilot/add-optional-preprocess-step
Draft

Add optional preprocessing step to marker detection pipeline#21
qian-chu with Copilot wants to merge 10 commits into
mainfrom
copilot/add-optional-preprocess-step

Conversation

Copilot AI commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Marker detection preprocessing currently exposes overlapping controls: a preset flag plus per-stage booleans/floats, with preprocessing disabled by default. This change makes "mild" the default preset, renames the stronger presets to descriptive neutral names, and lets None disable preprocessing globally or per stage.

  • API Simplification

    • detect_markers(..., preprocess=...) now defaults to "mild".
    • preprocess now accepts str | None; None disables preset preprocessing.
    • preprocess_marker_frame() now uses nullable stage parameters instead of separate boolean toggles:
      • highlight_percentile=None disables highlight clipping
      • clahe_clip_limit=None or clahe_tile_grid_size=None disables CLAHE
      • gaussian_blur_sigma=None disables blur
      • sharpen_amount=None disables sharpening
  • Preset Cleanup

    • Kept "mild" as the general default.
    • Renamed "ir""strong_highlight_clipping".
    • Renamed "low_light""strong_local_contrast".
    • Aligned the "mild" preset with the literal defaults of preprocess_marker_frame().
  • Docs and Error Surface

    • Updated marker-detection docstrings to describe the preprocessing parameters directly rather than implying benchmarked lighting scenarios.
    • Clarified the disable semantics for preprocess=None and per-stage None values.
    • Improved invalid-preset messaging to enumerate supported preset names and the disable path.
  • Tests

    • Updated preprocessing tests for nullable stage controls.
    • Added coverage for the new default behavior and revised preset/error handling.
video.detect_markers(
    marker_family="36h11",
    preprocess="mild",
    preprocess_params={
        "highlight_percentile": None,
        "sharpen_amount": 0.5,
    },
)

preprocess_marker_frame(
    gray_frame,
    clahe_clip_limit=None,
    gaussian_blur_sigma=None,
    sharpen_amount=None,
)

Copilot AI added 3 commits June 23, 2026 15:13
Implement preprocess_marker_frame() helper and PREPROCESS_PRESETS in
pyneon/video/marker.py, extend detect_markers() and Video.detect_markers()
with preprocess/preprocess_params parameters, update docstring templates,
and add unit tests.
Copilot AI changed the title [WIP] Add optional preprocessing step to marker detection pipeline Add optional grayscale preprocessing to AprilTag/ArUco marker detection Jun 23, 2026
Copilot AI requested a review from qian-chu June 23, 2026 15:16
Copilot AI changed the title Add optional grayscale preprocessing to AprilTag/ArUco marker detection Simplify marker preprocessing defaults and make stage controls nullable Jun 23, 2026
@qian-chu qian-chu changed the title Simplify marker preprocessing defaults and make stage controls nullable Add optional preprocessing step to marker detection pipeline Jun 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants