27 #ifndef MLN_LINEAR_LOG_HH
28 # define MLN_LINEAR_LOG_HH
36 # include <mln/linear/convolve.hh>
37 # include <mln/make/w_window2d.hh>
55 mln_ch_convolve(I,
int)
65 mln_ch_convolve(I,
int)
75 mln_ch_convolve(I,
int)
85 mln_ch_convolve(I,
int)
88 # ifndef MLN_INCLUDE_ONLY
95 mln_ch_convolve(I,
int)
98 mln_trace(
"linear::LoG_5x5");
99 mln_precondition(
exact(input).is_valid());
100 int ws[] = { +0, 0, -1, 0, 0,
105 mln_ch_convolve(I,
int) output =
convolve(input, make::w_window2d(ws));
111 template <typename I>
113 mln_ch_convolve(I,
int)
116 mln_trace(
"linear::LoG_7x7");
117 mln_precondition(
exact(input).is_valid());
118 int ws[] = { +0, 0, -1, -1, -1, 0, 0,
119 +0, -1, -3, -3, -3, -1, 0,
120 -1, -3, 0, 7, 0, -3, -1,
121 -1, -3, 7, 24, 7, -3, -1,
122 -1, -3, 0, 7, 0, -3, -1,
123 +0, -1, -3, -3, -3, -1, 0,
124 +0, 0, -1, -1, -1, 0, 0 };
125 mln_ch_convolve(I,
int) output =
convolve(input, make::w_window2d(ws));
131 template <typename I>
133 mln_ch_convolve(I,
int)
136 mln_trace(
"linear::LoG_13x13");
137 mln_precondition(
exact(input).is_valid());
138 int ws[] = { +0, 0, 0, 0, 0, -1, -1, -1, 0, 0, 0, 0, 0,
139 +0, 0, 0, -1, -1, -2, -2, -2, -1, -1, 0, 0, 0,
140 +0, 0, -2, -2, -3, -3, -4, -3, -3, -2, -2, 0, 0,
141 +0, -1, -2, -3, -3, -3, -2, -3, -3, -3, -2, -1, 0,
142 +0, -1, -3, -3, -1, 4, 6, 4, -1, -3, -3, -1, 0,
143 -1, -2, -3, -3, 4, 14, 19, 14, 4, -3, -3, -2, -1,
144 -1, -2, -4, -2, 6, 19, 24, 19, 6, -2, -4, -2, -1,
145 -1, -2, -3, -3, 4, 14, 19, 14, 4, -3, -3, -2, -1,
146 +0, -1, -3, -3, -1, 4, 6, 4, -1, -3, -3, -1, 0,
147 +0, -1, -2, -3, -3, -3, -2, -3, -3, -3, -2, -1, 0,
148 +0, 0, -2, -2, -3, -3, -4, -3, -3, -2, -2, 0, 0,
149 +0, 0, 0, -1, -1, -2, -2, -2, -1, -1, 0, 0, 0,
150 +0, 0, 0, 0, 0, -1, -1, -1, 0, 0, 0, 0, 0 };
151 mln_ch_convolve(I,
int) output =
convolve(input, make::w_window2d(ws));
158 template <typename I>
160 mln_ch_convolve(I,
int)
163 mln_trace(
"linear::LoG_17x17");
164 mln_precondition(
exact(input).is_valid());
165 int ws[] = { +0, 0, 0, 0, 0, 0,-1,-1,-1,-1,-1, 0, 0, 0, 0, 0, 0,
166 +0, 0, 0, 0,-1,-1,-1,-1,-1,-1,-1,-1,-1, 0, 0, 0, 0,
167 +0, 0,-1,-1,-1,-2,-3,-3,-3,-3,-3,-2,-1,-1,-1, 0, 0,
168 +0, 0,-1,-1,-2,-3,-3,-3,-3,-3,-3,-3,-2,-1,-1, 0, 0,
169 +0,-1,-1,-2,-3,-3,-3,-2,-3,-2,-3,-3,-3,-2,-1,-1, 0,
170 +0,-1,-2,-3,-3,-3, 0, 2, 4, 2, 0,-3,-3,-3,-2,-1, 0,
171 -1,-1,-3,-3,-3, 0, 4,10,12,10, 4, 0,-3,-3,-3,-1,-1,
172 -1,-1,-3,-3,-2, 2,10,18,21,18,10, 2,-2,-3,-3,-1,-1,
173 -1,-1,-3,-3,-3, 4,12,21,24,21,12, 4,-3,-3,-3,-1,-1,
174 -1,-1,-3,-3,-2, 2,10,18,21,18,10, 2,-2,-3,-3,-1,-1,
175 -1,-1,-3,-3,-3, 0, 4,10,12,10, 4, 0,-3,-3,-3,-1,-1,
176 +0,-1,-2,-3,-3,-3, 0, 2, 4, 2, 0,-3,-3,-3,-2,-1, 0,
177 +0,-1,-1,-2,-3,-3,-3,-2,-3,-2,-3,-3,-3,-2,-1,-1, 0,
178 +0, 0,-1,-1,-2,-3,-3,-3,-3,-3,-3,-3,-2,-1,-1, 0, 0,
179 +0, 0,-1,-1,-1,-2,-3,-3,-3,-3,-3,-2,-1,-1,-1, 0, 0,
180 +0, 0, 0, 0,-1,-1,-1,-1,-1,-1,-1,-1,-1, 0, 0, 0, 0,
181 +0, 0, 0, 0, 0, 0,-1,-1,-1,-1,-1, 0, 0, 0, 0, 0, 0 };
182 mln_ch_convolve(I,
int) output =
convolve(input, make::w_window2d(ws));
186 # endif // ! MLN_INCLUDE_ONLY
193 #endif // ! MLN_LINEAR_LOG_HH