Skip to main content

erode_mask

Function erode_mask 

Source
fn erode_mask(
    mask: &[u8],
    nx: usize,
    ny: usize,
    nz: usize,
    skip_outside: bool,
) -> Vec<u8> ⓘ
Expand description

One erosion with the 6-neighbour (strel_diamond) element. A neighbour outside the array counts as outside the mask, so a mask that reaches the array’s edge is eroded from it (the default: the Laplacian and gradient stencils have no neighbour there). With skip_outside, neighbours outside the array are skipped instead, as the reference’s erode_mask does (src/tgv.jl:218-222, 6c0886a, checkbounds), so such a mask is not eroded from the edge (TgvParams::reference_edge_erosion).