37 uint8_t constant_border_value)
46 const int sq_mask_size = mask_size * mask_size;
47 const int half_mask_size = mask_size / 2;
48 std::vector<intermediate_type> vals(sq_mask_size);
49 intermediate_type current_value = 0;
53 for(
int element_idx = 0, count = 0, index = 0; element_idx < src.
num_elements(); ++element_idx, count = 0, index = 0)
60 for(
int y = idy - half_mask_size; y <= idy + half_mask_size; ++y)
62 for(
int x = idx - half_mask_size; x <= idx + half_mask_size; ++x, ++index)
66 current_value =
tensor_elem_at(src,
id, border_mode, constant_border_value);
68 if(mask[index] == 255)
70 vals[count] =
static_cast<intermediate_type
>(current_value);
75 std::sort(vals.begin(), vals.begin() + count);
BorderMode
Methods available to handle borders.
#define ARM_COMPUTE_ERROR(...)
Print the given message then throw an std::runtime_error.
T tensor_elem_at(const SimpleTensor< T > &src, Coordinates coord, BorderMode border_mode, T constant_border_value)
Container for 2D border size.
DataType data_type() const override
Data type of the tensor.
#define ARM_COMPUTE_ERROR_ON(cond)
If the condition is true then an error message is printed and an exception thrown.
TensorShape shape() const override
Shape of the tensor.
This file contains all available output stages for GEMMLowp on OpenCL.
T x() const
Alias to access the size of the first dimension.
bool is_in_valid_region(const ValidRegion &valid_region, Coordinates coord)
Check if a coordinate is within a valid region.
#define ARM_COMPUTE_UNUSED(...)
To avoid unused variables warnings.
SimpleTensor< T > non_linear_filter(const SimpleTensor< T > &src, NonLinearFilterFunction function, unsigned int mask_size, MatrixPattern pattern, const uint8_t *mask, BorderMode border_mode, uint8_t constant_border_value)
Coordinates index2coord(const TensorShape &shape, int index)
Convert a linear index into n-dimensional coordinates.
Simple tensor object that stores elements in a consecutive chunk of memory.
Borders are left undefined.
T saturate_cast(T val)
Saturate a value of type T against the numeric limits of type U.
int num_elements() const override
Number of elements of the tensor.
Container for valid region of a window.
MatrixPattern
Available matrix patterns.
Any other matrix pattern.
convolution configure & src
NonLinearFilterFunction
Available non linear functions.
ValidRegion shape_to_valid_region(const TensorShape &a_shape, bool border_undefined=false, BorderSize border_size=BorderSize(0))
Create a valid region based on tensor shape, border mode and border size.
Non linear median filter.