43 const std::array<int8_t, 9> sobel_3_x{ { -1, 0, 1, -2, 0, 2, -1, 0, 1 } };
44 const std::array<int8_t, 9> sobel_3_y{ { -1, -2, -1, 0, 0, 0, 1, 2, 1 } };
46 const std::array<int8_t, 25> sobel_5_x{ {
54 const std::array<int8_t, 25> sobel_5_y{ {
62 const std::array<int8_t, 49> sobel_7_x{ {
63 -1, -4, -5, 0, 5, 4, 1,
64 -6, -24, -30, 0, 30, 24, 6,
65 -15, -60, -75, 0, 75, 60, 15,
66 -20, -80, -100, 0, 100, 80, 20,
67 -15, -60, -75, 0, 75, 60, 15,
68 -6, -24, -30, 0, 30, 24, 6,
69 -1, -4, -5, 0, 5, 4, 1
72 const std::array<int8_t, 49> sobel_7_y{ {
73 -1, -6, -15, -20, -15, -6, -1,
74 -4, -24, -60, -80, -60, -24, -4,
75 -5, -30, -75, -100, -75, -30, -5,
77 5, 30, 75, 100, 75, 30, 5,
78 4, 24, 60, 80, 60, 24, 4,
79 1, 6, 15, 20, 15, 6, 1
82 const std::map<int, std::pair<const int8_t *, const int8_t *>> masks
84 { 3, { sobel_3_x.data(), sobel_3_y.data() } },
85 { 5, { sobel_5_x.data(), sobel_5_y.data() } },
86 { 7, { sobel_7_x.data(), sobel_7_y.data() } },
105 template <
typename T,
typename U>
121 switch(gradient_dimension)
123 case GradientDimension::GRAD_X:
125 constant_border_value);
127 case GradientDimension::GRAD_Y:
129 constant_border_value);
133 constant_border_value);
135 constant_border_value);
142 return std::make_pair(dst_x, dst_y);
BorderMode
Methods available to handle borders.
#define ARM_COMPUTE_ERROR(...)
Print the given message then throw an std::runtime_error.
Container for 2D border size.
void apply_2d_spatial_filter(Coordinates coord, const SimpleTensor< T > &src, SimpleTensor< U > &dst, const TensorShape &filter_shape, const V *filter_itr, double scale, BorderMode border_mode, T constant_border_value=T(0))
TensorShape shape() const override
Shape of the tensor.
This file contains all available output stages for GEMMLowp on OpenCL.
1 channel, 1 S32 per channel
bool is_in_valid_region(const ValidRegion &valid_region, Coordinates coord)
Check if a coordinate is within a valid region.
Coordinates index2coord(const TensorShape &shape, int index)
Convert a linear index into n-dimensional coordinates.
1 channel, 1 S16 per channel
Simple tensor object that stores elements in a consecutive chunk of memory.
int num_channels() const override
Number of channels of the tensor.
x and y gradient dimension
Borders are left undefined.
int num_elements() const override
Number of elements of the tensor.
std::pair< SimpleTensor< T >, SimpleTensor< T > > sobel(const SimpleTensor< U > &src, int filter_size, BorderMode border_mode, uint8_t constant_border_value, GradientDimension gradient_dimension)
Container for valid region of a window.
DataType
Available data types.
GradientDimension
Gradient dimension type.
convolution configure & src
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.