26 #ifndef MLN_LINEAR_LOG_HH
27 # define MLN_LINEAR_LOG_HH
33 # include <mln/linear/convolve.hh>
34 # include <mln/make/w_window2d.hh>
46 LoG_5x5(const Image<I>& input);
50 LoG_7x7(const Image<I>& input);
54 LoG_13x13(const Image<I>& input);
58 LoG_17x17(const Image<I>& input);
61 # ifndef MLN_INCLUDE_ONLY
69 LoG_5x5(const Image<I>& input)
71 trace::entering(
"linear::LoG_5x5");
72 mln_precondition(exact(input).is_valid());
73 int ws[] = { +0, 0, -1, 0, 0,
79 trace::exiting("linear::LoG_5x5");
88 LoG_7x7(const Image<I>& input)
90 trace::entering(
"linear::LoG_7x7");
91 mln_precondition(exact(input).is_valid());
92 int ws[] = { +0, 0, -1, -1, -1, 0, 0,
93 +0, -1, -3, -3, -3, -1, 0,
94 -1, -3, 0, 7, 0, -3, -1,
95 -1, -3, 7, 24, 7, -3, -1,
96 -1, -3, 0, 7, 0, -3, -1,
97 +0, -1, -3, -3, -3, -1, 0,
98 +0, 0, -1, -1, -1, 0, 0 };
100 trace::exiting("linear::LoG_7x7");
106 template <typename I>
109 LoG_13x13(const Image<I>& input)
111 trace::entering(
"linear::LoG_13x13");
112 mln_precondition(exact(input).is_valid());
113 int ws[] = { +0, 0, 0, 0, 0, -1, -1, -1, 0, 0, 0, 0, 0,
114 +0, 0, 0, -1, -1, -2, -2, -2, -1, -1, 0, 0, 0,
115 +0, 0, -2, -2, -3, -3, -4, -3, -3, -2, -2, 0, 0,
116 +0, -1, -2, -3, -3, -3, -2, -3, -3, -3, -2, -1, 0,
117 +0, -1, -3, -3, -1, 4, 6, 4, -1, -3, -3, -1, 0,
118 -1, -2, -3, -3, 4, 14, 19, 14, 4, -3, -3, -2, -1,
119 -1, -2, -4, -2, 6, 19, 24, 19, 6, -2, -4, -2, -1,
120 -1, -2, -3, -3, 4, 14, 19, 14, 4, -3, -3, -2, -1,
121 +0, -1, -3, -3, -1, 4, 6, 4, -1, -3, -3, -1, 0,
122 +0, -1, -2, -3, -3, -3, -2, -3, -3, -3, -2, -1, 0,
123 +0, 0, -2, -2, -3, -3, -4, -3, -3, -2, -2, 0, 0,
124 +0, 0, 0, -1, -1, -2, -2, -2, -1, -1, 0, 0, 0,
125 +0, 0, 0, 0, 0, -1, -1, -1, 0, 0, 0, 0, 0 };
126 mln_ch_convolve(I,
int) output = convolve(input, make::w_window2d(ws));
133 template <typename I>
136 LoG_17x17(const Image<I>& input)
138 trace::entering(
"linear::LoG_17x17");
139 mln_precondition(exact(input).is_valid());
140 int ws[] = { +0, 0, 0, 0, 0, 0,-1,-1,-1,-1,-1, 0, 0, 0, 0, 0, 0,
141 +0, 0, 0, 0,-1,-1,-1,-1,-1,-1,-1,-1,-1, 0, 0, 0, 0,
142 +0, 0,-1,-1,-1,-2,-3,-3,-3,-3,-3,-2,-1,-1,-1, 0, 0,
143 +0, 0,-1,-1,-2,-3,-3,-3,-3,-3,-3,-3,-2,-1,-1, 0, 0,
144 +0,-1,-1,-2,-3,-3,-3,-2,-3,-2,-3,-3,-3,-2,-1,-1, 0,
145 +0,-1,-2,-3,-3,-3, 0, 2, 4, 2, 0,-3,-3,-3,-2,-1, 0,
146 -1,-1,-3,-3,-3, 0, 4,10,12,10, 4, 0,-3,-3,-3,-1,-1,
147 -1,-1,-3,-3,-2, 2,10,18,21,18,10, 2,-2,-3,-3,-1,-1,
148 -1,-1,-3,-3,-3, 4,12,21,24,21,12, 4,-3,-3,-3,-1,-1,
149 -1,-1,-3,-3,-2, 2,10,18,21,18,10, 2,-2,-3,-3,-1,-1,
150 -1,-1,-3,-3,-3, 0, 4,10,12,10, 4, 0,-3,-3,-3,-1,-1,
151 +0,-1,-2,-3,-3,-3, 0, 2, 4, 2, 0,-3,-3,-3,-2,-1, 0,
152 +0,-1,-1,-2,-3,-3,-3,-2,-3,-2,-3,-3,-3,-2,-1,-1, 0,
153 +0, 0,-1,-1,-2,-3,-3,-3,-3,-3,-3,-3,-2,-1,-1, 0, 0,
154 +0, 0,-1,-1,-1,-2,-3,-3,-3,-3,-3,-2,-1,-1,-1, 0, 0,
155 +0, 0, 0, 0,-1,-1,-1,-1,-1,-1,-1,-1,-1, 0, 0, 0, 0,
156 +0, 0, 0, 0, 0, 0,-1,-1,-1,-1,-1, 0, 0, 0, 0, 0, 0 };
157 mln_ch_convolve(I,
int) output = convolve(input, make::w_window2d(ws));
158 trace::exiting("linear::LoG_17x17");
162 # endif // ! MLN_INCLUDE_ONLY
169 #endif // ! MLN_LINEAR_LOG_HH