Skip to main content

Module proposal

Module proposal 

Source
Expand description

Gradient-voting radial symmetry for ellipse center detection.

This module detects candidate ellipse/circle centers in grayscale images using a radial symmetry voting scheme. For each pixel with a strong gradient, votes are cast along the gradient direction at distances in [r_min, r_max]. Elliptical features produce peaks in the accumulator at their centers because gradient vectors from the boundary converge radially.

§Standalone usage

The module is self-contained and has no dependencies on ringgrid-specific types (board layouts, marker specs, etc.).

use ringgrid::proposal::{find_ellipse_centers, ProposalConfig};

let image = image::open("photo.png").unwrap().to_luma8();
let config = ProposalConfig {
    r_min: 5.0,
    r_max: 25.0,
    min_distance: 10.0,
    ..ProposalConfig::default()
};
let centers = find_ellipse_centers(&image, &config);
for c in &centers {
    println!("center at ({:.1}, {:.1}), score={:.1}", c.x, c.y, c.score);
}

Structs§

Proposal
A proposed ellipse center with its vote score.
ProposalConfig
Configuration for ellipse center detection via gradient-based radial symmetry voting.
ProposalResult
Proposals together with the vote heatmap for visualization or custom processing.

Functions§

find_ellipse_centers
Detect candidate ellipse centers via gradient-based radial symmetry voting.
find_ellipse_centers_with_heatmap
Detect candidate ellipse centers and return the vote heatmap.