35 for (
int i = -1; i <= 1; i++) {
36 for (
int j = -1; j <= 1; j++) {
38 exp((-30.0f) * cl::sycl::fabs(nbr.at(nbr.I_c, nbr.I_r) -
39 nbr.at(nbr.I_c + i, nbr.I_r + j)));
41 out += w * nbr.at(nbr.I_c + i, nbr.I_r + j);
56 using Type =
typename T::PixelType::data_type;
58 cl::sycl::float4 out(0, 0, 0, 0);
59 cl::sycl::float4 sum_w(0, 0, 0, 0);
61 for (
int i = -1; i <= 1; i++) {
62 for (
int j = -1; j <= 1; j++) {
63 cl::sycl::float4 p1(nbr.at(nbr.I_c, nbr.I_r)[0],
64 nbr.at(nbr.I_c, nbr.I_r)[1],
65 nbr.at(nbr.I_c, nbr.I_r)[2], 0);
66 cl::sycl::float4 p2(nbr.at(nbr.I_c + i, nbr.I_r + j)[0],
67 nbr.at(nbr.I_c + i, nbr.I_r + j)[1],
68 nbr.at(nbr.I_c + i, nbr.I_r + j)[2], 0);
69 cl::sycl::float4 w = exp((-30.0f) * cl::sycl::fabs(p1 - p2));
75 return typename T::PixelType(
static_cast<Type
>(out.x()),
76 static_cast<Type
>(out.y()),
77 static_cast<Type
>(out.z()));
This functor applies anisotropic diffusion for one channel.
float operator()(T nbr)
This functor applies a simplified version of the anisotropic diffusion for one channel.
This functor applies anisotropic diffusion for 3 channels.
T::PixelType operator()(T nbr)
This functor applies a simplified version of the anisotropic diffusion for 3 channels.