This repository was archived by the owner on Mar 29, 2026. It is now read-only.
Skeleton-based dynamic branch erasure for green mark turns#14
Open
Copilot wants to merge 6 commits into
Open
Conversation
…erasure Replace fixed rectangular erasure regions with skeleton-aware connected component analysis. The junction zone around each green mark is defined dynamically based on the mark position and approach line center. Branches are identified individually via connected components and classified by their entry direction, then only the unwanted branches are dilated and erased from the binary image. Co-authored-by: rotarymars <144909199+rotarymars@users.noreply.github.com>
Co-authored-by: rotarymars <144909199+rotarymars@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Update green mark turning algorithm for dynamic coordinates
Skeleton-based dynamic branch erasure for green mark turns
Mar 12, 2026
Member
|
@copilot I'm not sure whether you are good at reading images, but look at this. |
…mask protection - Replaced mark-width-based dilation (mark_w // 2) with actual binary line width measurement at the approach line - Added keep_mask that protects approach line and desired turn branch skeleton pixels from being erased by dilation bleed - Added explicit protection for skeleton pixels inside the junction zone that belong to kept branches (these were zeroed for connected component analysis) Co-authored-by: rotarymars <144909199+rotarymars@users.noreply.github.com>
Co-authored-by: rotarymars <144909199+rotarymars@users.noreply.github.com>
Contributor
Author
Fixed in 891f722 and 65bdfd0. The over-aggressive erasure was caused by two issues:
In tests, the approach line now retains 100% of its width near the junction (was being thinned from 16px to 1px before). Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

The green mark turning algorithm erased fixed rectangular regions (
modified[0:erase_bottom, 0:line_cx]) regardless of where skeleton branches actually were. This replaces that with connected-component analysis on the skeleton to identify and erase only the actual unwanted branches.Approach
line_cx), so the disconnection region always covers the real intersectioncv2.connectedComponentsWithStatsseparates individual branches. Each is classified by its entry point direction relative to the mark center (approach/left/right/top)Signature change
The skeleton was already computed immediately before the call site in
Linetrace_Camera_Pre_callback, so this just threads it through.💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.