xpad¶
Defined in xtensor/xpad.hpp
-
enum
xt::pad_mode¶ Defines different algorithms to be used in
xt::pad:constant: Pads with a constant value.symmetric: Pads with the reflection of the vector mirrored along the edge of the array.reflect: Pads with the reflection of the vector mirrored on the first and last values of the vector along each axis.wrap: Pads with the wrap of the vector along the axis. The first values are used to pad the end and the end values are used to pad the beginning.periodic:== wrap(pads with periodic repetitions of the vector).
OpenCV to xtensor:
BORDER_CONSTANT == constantBORDER_REFLECT == symmetricBORDER_REFLECT_101 == reflectBORDER_WRAP == wrap
Values:
-
enumerator
constant¶
-
enumerator
symmetric¶
-
enumerator
reflect¶
-
enumerator
wrap¶
-
enumerator
periodic¶
-
template<class
E, classS= typename std::decay_t<E>::size_type, classV= typename std::decay_t<E>::value_type>
autoxt::pad(E &&e, const std::vector<std::vector<S>> &pad_width, pad_mode mode = pad_mode::constant, V constant_value = 0)¶ Pad an array.
- Return
The padded array.
- Parameters
e: The array.pad_width: Number of values padded to the edges of each axis:{{before_1, after_1}, ..., {before_N, after_N}}.mode: The type of algorithm to use. [default:xt::pad_mode::constant].constant_value: The value to set the padded values for each axis (used inxt::pad_mode::constant).
-
template<class
E, classS= typename std::decay_t<E>::size_type, classV= typename std::decay_t<E>::value_type>
autoxt::pad(E &&e, const std::vector<S> &pad_width, pad_mode mode = pad_mode::constant, V constant_value = 0)¶ Pad an array.
- Return
The padded array.
- Parameters
e: The array.pad_width: Number of values padded to the edges of each axis:{before, after}.mode: The type of algorithm to use. [default:xt::pad_mode::constant].constant_value: The value to set the padded values for each axis (used inxt::pad_mode::constant).
-
template<class
E, classS= typename std::decay_t<E>::size_type, classV= typename std::decay_t<E>::value_type>
autoxt::pad(E &&e, S pad_width, pad_mode mode = pad_mode::constant, V constant_value = 0)¶ Pad an array.
- Return
The padded array.
- Parameters
e: The array.pad_width: Number of values padded to the edges of each axis.mode: The type of algorithm to use. [default:xt::pad_mode::constant].constant_value: The value to set the padded values for each axis (used inxt::pad_mode::constant).