Skip to main content

radon_heatmap_u8

Function radon_heatmap_u8 

Source
pub fn radon_heatmap_u8(
    img: &[u8],
    width: u32,
    height: u32,
    cfg: &DetectorConfig,
) -> Result<ResponseMap, ChessError>
Expand description

Compute the whole-image Radon response heatmap from a raw grayscale buffer.

img must be width * height bytes in row-major order. If cfg.upscale is enabled, the input is upscaled first (same path as crate::Detector) and the heatmap is returned at the working resolution of the upscaled + radon-supersampled image.

The heatmap data is row-major f32, length map.width() * map.height(). Values are non-negative.

ยงErrors

Returns ChessError::DimensionMismatch if img.len() != width * height. Returns ChessError::Upscale if the upscale configuration is invalid.