26 #ifndef MLN_LINEAR_SOBEL_2D_HH
27 # define MLN_LINEAR_SOBEL_2D_HH
35 # include <mln/trait/ch_value.hh>
36 # include <mln/trait/value/nature.hh>
38 # include <mln/metal/int.hh>
40 # include <mln/arith/plus.hh>
41 # include <mln/data/abs.hh>
42 # include <mln/fun/x2v/l1_norm.hh>
43 # include <mln/fun/vv2v/vec.hh>
44 # include <mln/linear/convolve_2x1d.hh>
59 sobel_2d_h(const Image<I>& input);
64 sobel_2d_v(const Image<I>& input);
70 sobel_2d(const Image<I>& input);
76 sobel_2d_l1_norm(const Image<I>& input);
80 # ifndef MLN_INCLUDE_ONLY
88 sobel_2d_h(const Image<I>& input)
90 trace::entering(
"linear::sobel_2d_h");
91 mln_precondition(exact(input).is_valid());
93 int wh[] = { -1, 0, 1 };
99 trace::exiting("linear::sobel_2d_h");
104 template <typename I>
107 sobel_2d_v(const Image<I>& input)
109 trace::entering(
"linear::sobel_2d_v");
110 mln_precondition(exact(input).is_valid());
112 int wh[] = { 1, 2, 1 };
118 trace::exiting("linear::sobel_2d_v");
123 template <typename I>
125 sobel_2d(const
Image<I>& input)
127 trace::entering(
"linear::sobel_2d");
128 mln_precondition(exact(input).is_valid());
131 J h = sobel_2d_h(input),
132 v = sobel_2d_v(input);
136 trace::exiting(
"linear::sobel_2d");
141 template <
typename I>
143 sobel_2d_l1_norm(const
Image<I>& input)
145 trace::entering(
"linear::sobel_2d_norm_l1");
146 mln_precondition(exact(input).is_valid());
149 G grad = sobel_2d(input);
150 fun::x2v::l1_norm<mln_value(G)> f;
153 trace::exiting("linear::sobel_2d");
157 # endif // ! MLN_INCLUDE_ONLY
164 #endif // ! MLN_LINEAR_SOBEL_2D_HH