Skip to main content

pad_array

Function pad_array 

Source
pub fn pad_array<T, D>(
    input: &ArrayBase<OwnedRepr<T>, D>,
    pad_width: &[(usize, usize)],
    _mode: &MorphBorderMode,
    value: T,
) -> Result<ArrayBase<OwnedRepr<T>, D>, NdimageError>
where T: Float + FromPrimitive + Debug + Clone + AddAssign + DivAssign + 'static, D: Dimension + 'static,
Expand description

Apply padding to an array based on the specified border mode for morphological operations

§Arguments

  • input - Input array to pad
  • pad_width - Width of padding in each dimension (before, after)
  • mode - Border handling mode
  • constant_value - Value to use for constant mode

§Returns

  • Result<Array<T, D>> - Padded array