conv2d_valid#
- rlemasklib.RLEMask.conv2d_valid(kernel, stride=(1, 1), threshold=0.5)[source]#
Perform a 2D convolution with the given weighted kernel and threshold the result.
This function does not perform any padding and only returns the “valid” part of the convolution, similar to “valid” padding mode in deep learning frameworks as opposed to “same” or “full” padding.
- Parameters:
- Returns:
A new RLEMask object representing the convolved and thresholded mask.
- Return type: