pub fn connected_components_4(
input: &Tensor,
) -> Result<(Tensor, usize), ImgProcError>Expand description
4-connected component labeling. Input: [H, W] binary.
Connected-component labeling on a binary single-channel HWC image (4-connectivity).
Input pixels > 0 are foreground. Returns (label_map, num_labels) where
each connected component has a unique positive integer label, background is 0.