oa::image::distance_transform
Distance transform per plane, following distanceTransform: every pixel above threshold measures the chamfer distance to the nearest background pixel. DistanceType::L1 uses a 4-neighborhood with unit weights (exact Manhattan distance); DistanceType::L2 uses an 8-neighborhood with weights 1 / sqrt(2), the classic 3x3 chamfer approximation. The F32 output carries plane x height x width distances, zero on background. propagation_passes bounds the relaxation (zero selects height + width per plane, the worst-case propagation distance). Errors Returns an error unless the image is a nonempty FP32 NCHW/CHW image and threshold is finite.
Function Documentation
Distance transform per plane, following distanceTransform: every pixel above threshold measures the chamfer distance to the nearest background pixel. DistanceType::L1 uses a 4-neighborhood with unit weights (exact Manhattan distance); DistanceType::L2 uses an 8-neighborhood with weights 1 / sqrt(2), the classic 3x3 chamfer approximation. The F32 output carries plane x height x width distances, zero on background. propagation_passes bounds the relaxation (zero selects height + width per plane, the worst-case propagation distance). Errors Returns an error unless the image is a nonempty FP32 NCHW/CHW image and threshold is finite.