58 for (j = 0; j < src.cols; j++) {
60 for (k = 0; k < 5; k++) {
63 for (k = 0; k < 5; k++) {
66 for (k = 0, ii = i, jj = j - 2; k < 5; k++, jj++) {
68 m1[k] = src.at<
NMSTYPE>(ii, jj);
72 for (k = 0, ii = i + 1, jj = j - 2; k < 5; k++, jj++) {
74 b1[k] = src.at<
NMSTYPE>(ii, jj);
78 for (k = 0, ii = i + 2, jj = j - 2; k < 5; k++, jj++) {
80 b2[k] = src.at<
NMSTYPE>(ii, jj);
84 }
else if ((j >= 2) && (j < src.cols - 2)) {
85 for (k = 0, ii = i - 2, jj = j - 2; k < 5; k++, jj++) {
88 for (k = 0, ii = i - 1, jj = j - 2; k < 5; k++, jj++) {
91 for (k = 0, ii = i, jj = j - 2; k < 5; k++, jj++) {
92 m1[k] = src.at<
NMSTYPE>(ii, jj);
94 for (k = 0, ii = i + 1, jj = j - 2; k < 5; k++, jj++) {
95 b1[k] = src.at<
NMSTYPE>(ii, jj);
97 for (k = 0, ii = i + 2, jj = j - 2; k < 5; k++, jj++) {
98 b2[k] = src.at<
NMSTYPE>(ii, jj);
100 }
else if (j >= src.cols - 2) {
101 for (k = 0, ii = i - 2, jj = j - 2; k < 5; k++, jj++) {
104 for (k = 0, ii = i - 1, jj = j - 2; k < 5; k++, jj++) {
107 for (k = 0, ii = i, jj = j - 2; k < 5; k++, jj++) {
109 m1[k] = src.at<
NMSTYPE>(ii, jj);
113 for (k = 0, ii = i + 1, jj = j - 2; k < 5; k++, jj++) {
115 b1[k] = src.at<
NMSTYPE>(ii, jj);
119 for (k = 0, ii = i + 2, jj = j - 2; k < 5; k++, jj++) {
121 b2[k] = src.at<
NMSTYPE>(ii, jj);
127 dst.at<uchar>(i, j) =
result ? 255 : 0;
131 for (j = 0; j < src.cols; j++) {
133 for (k = 0; k < 5; k++) {
136 for (k = 0, ii = i - 1, jj = j - 2; k < 5; k++, jj++) {
138 t2[k] = src.at<
NMSTYPE>(ii, jj);
142 for (k = 0, ii = i, jj = j - 2; k < 5; k++, jj++) {
144 m1[k] = src.at<
NMSTYPE>(ii, jj);
148 for (k = 0, ii = i + 1, jj = j - 2; k < 5; k++, jj++) {
150 b1[k] = src.at<
NMSTYPE>(ii, jj);
154 for (k = 0, ii = i + 2, jj = j - 2; k < 5; k++, jj++) {
156 b2[k] = src.at<
NMSTYPE>(ii, jj);
160 }
else if ((j >= 2) && (j < src.cols - 2)) {
161 for (k = 0, ii = i - 2, jj = j - 2; k < 5; k++, jj++) {
164 for (k = 0, ii = i - 1, jj = j - 2; k < 5; k++, jj++) {
165 t2[k] = src.at<
NMSTYPE>(ii, jj);
167 for (k = 0, ii = i, jj = j - 2; k < 5; k++, jj++) {
168 m1[k] = src.at<
NMSTYPE>(ii, jj);
170 for (k = 0, ii = i + 1, jj = j - 2; k < 5; k++, jj++) {
171 b1[k] = src.at<
NMSTYPE>(ii, jj);
173 for (k = 0, ii = i + 2, jj = j - 2; k < 5; k++, jj++) {
174 b2[k] = src.at<
NMSTYPE>(ii, jj);
176 }
else if (j >= src.cols - 2) {
177 for (k = 0, ii = i - 2, jj = j - 2; k < 5; k++, jj++) {
180 for (k = 0, ii = i - 1, jj = j - 2; k < 5; k++, jj++) {
183 for (k = 0, ii = i, jj = j - 2; k < 5; k++, jj++) {
185 m1[k] = src.at<
NMSTYPE>(ii, jj);
189 for (k = 0, ii = i + 1, jj = j - 2; k < 5; k++, jj++) {
191 b1[k] = src.at<
NMSTYPE>(ii, jj);
195 for (k = 0, ii = i + 2, jj = j - 2; k < 5; k++, jj++) {
197 b2[k] = src.at<
NMSTYPE>(ii, jj);
203 dst.at<uchar>(i, j) =
result ? 255 : 0;
206 for (i = 2; i < src.rows - 2; i++) {
207 for (j = 0; j < src.cols; j++) {
209 for (k = 0, ii = i - 2, jj = j - 2; k < 5; k++, jj++) {
211 t1[k] = src.at<
NMSTYPE>(ii, jj);
215 for (k = 0, ii = i - 1, jj = j - 2; k < 5; k++, jj++) {
217 t2[k] = src.at<
NMSTYPE>(ii, jj);
221 for (k = 0, ii = i, jj = j - 2; k < 5; k++, jj++) {
223 m1[k] = src.at<
NMSTYPE>(ii, jj);
227 for (k = 0, ii = i + 1, jj = j - 2; k < 5; k++, jj++) {
229 b1[k] = src.at<
NMSTYPE>(ii, jj);
233 for (k = 0, ii = i + 2, jj = j - 2; k < 5; k++, jj++) {
235 b2[k] = src.at<
NMSTYPE>(ii, jj);
239 }
else if ((j >= 2) && (j < src.cols - 2)) {
240 for (k = 0, ii = i - 2, jj = j - 2; k < 5; k++, jj++) {
241 t1[k] = src.at<
NMSTYPE>(ii, jj);
243 for (k = 0, ii = i - 1, jj = j - 2; k < 5; k++, jj++) {
244 t2[k] = src.at<
NMSTYPE>(ii, jj);
246 for (k = 0, ii = i, jj = j - 2; k < 5; k++, jj++) {
247 m1[k] = src.at<
NMSTYPE>(ii, jj);
249 for (k = 0, ii = i + 1, jj = j - 2; k < 5; k++, jj++) {
250 b1[k] = src.at<
NMSTYPE>(ii, jj);
252 for (k = 0, ii = i + 2, jj = j - 2; k < 5; k++, jj++) {
253 b2[k] = src.at<
NMSTYPE>(ii, jj);
255 }
else if (j >= src.cols - 2) {
256 for (k = 0, ii = i - 2, jj = j - 2; k < 5; k++, jj++) {
258 t1[k] = src.at<
NMSTYPE>(ii, jj);
262 for (k = 0, ii = i - 1, jj = j - 2; k < 5; k++, jj++) {
264 t2[k] = src.at<
NMSTYPE>(ii, jj);
268 for (k = 0, ii = i, jj = j - 2; k < 5; k++, jj++) {
270 m1[k] = src.at<
NMSTYPE>(ii, jj);
274 for (k = 0, ii = i + 1, jj = j - 2; k < 5; k++, jj++) {
276 b1[k] = src.at<
NMSTYPE>(ii, jj);
280 for (k = 0, ii = i + 2, jj = j - 2; k < 5; k++, jj++) {
282 b2[k] = src.at<
NMSTYPE>(ii, jj);
289 dst.at<uchar>(i, j) =
result ? 255 : 0;
294 for (j = 0; j < src.cols; j++) {
296 for (k = 0, ii = i - 2, jj = j - 2; k < 5; k++, jj++) {
298 t1[k] = src.at<
NMSTYPE>(ii, jj);
302 for (k = 0, ii = i - 1, jj = j - 2; k < 5; k++, jj++) {
304 t2[k] = src.at<
NMSTYPE>(ii, jj);
308 for (k = 0, ii = i, jj = j - 2; k < 5; k++, jj++) {
310 m1[k] = src.at<
NMSTYPE>(ii, jj);
314 for (k = 0, ii = i + 1, jj = j - 2; k < 5; k++, jj++) {
316 b1[k] = src.at<
NMSTYPE>(ii, jj);
320 for (k = 0, ii = i + 2, jj = j - 2; k < 5; k++, jj++) {
323 }
else if ((j >= 2) && (j < src.cols - 2)) {
324 for (k = 0, ii = i - 2, jj = j - 2; k < 5; k++, jj++) {
325 t1[k] = src.at<
NMSTYPE>(ii, jj);
327 for (k = 0, ii = i - 1, jj = j - 2; k < 5; k++, jj++) {
328 t2[k] = src.at<
NMSTYPE>(ii, jj);
330 for (k = 0, ii = i, jj = j - 2; k < 5; k++, jj++) {
331 m1[k] = src.at<
NMSTYPE>(ii, jj);
333 for (k = 0, ii = i + 1, jj = j - 2; k < 5; k++, jj++) {
334 b1[k] = src.at<
NMSTYPE>(ii, jj);
336 for (k = 0, ii = i + 2, jj = j - 2; k < 5; k++, jj++) {
339 }
else if (j >= src.cols - 2) {
340 for (k = 0, ii = i - 2, jj = j - 2; k < 5; k++, jj++) {
342 t1[k] = src.at<
NMSTYPE>(ii, jj);
346 for (k = 0, ii = i - 1, jj = j - 2; k < 5; k++, jj++) {
348 t2[k] = src.at<
NMSTYPE>(ii, jj);
352 for (k = 0, ii = i, jj = j - 2; k < 5; k++, jj++) {
354 m1[k] = src.at<
NMSTYPE>(ii, jj);
358 for (k = 0, ii = i + 1, jj = j - 2; k < 5; k++, jj++) {
360 b1[k] = src.at<
NMSTYPE>(ii, jj);
364 for (k = 0, ii = i + 2, jj = j - 2; k < 5; k++, jj++) {
369 dst.at<uchar>(i, j) =
result ? 255 : 0;
373 for (j = 0; j < src.cols; j++) {
375 for (k = 0, ii = i - 1, jj = j - 2; k < 5; k++, jj++) {
377 t1[k] = src.at<
NMSTYPE>(ii, jj);
381 for (k = 0, ii = i - 1, jj = j - 2; k < 5; k++, jj++) {
383 t2[k] = src.at<
NMSTYPE>(ii, jj);
387 for (k = 0, ii = i, jj = j - 2; k < 5; k++, jj++) {
389 m1[k] = src.at<
NMSTYPE>(ii, jj);
393 for (k = 0, ii = i + 1, jj = j - 2; k < 5; k++, jj++) {
396 for (k = 0, ii = i + 2, jj = j - 2; k < 5; k++, jj++) {
399 }
else if ((j >= 2) && (j < src.cols - 2)) {
400 for (k = 0, ii = i - 2, jj = j - 2; k < 5; k++, jj++) {
401 t1[k] = src.at<
NMSTYPE>(ii, jj);
403 for (k = 0, ii = i - 1, jj = j - 2; k < 5; k++, jj++) {
404 t2[k] = src.at<
NMSTYPE>(ii, jj);
406 for (k = 0, ii = i, jj = j - 2; k < 5; k++, jj++) {
407 m1[k] = src.at<
NMSTYPE>(ii, jj);
409 for (k = 0, ii = i + 1, jj = j - 2; k < 5; k++, jj++) {
412 for (k = 0, ii = i + 2, jj = j - 2; k < 5; k++, jj++) {
415 }
else if (j >= src.cols - 2) {
416 for (k = 0, ii = i - 2, jj = j - 2; k < 5; k++, jj++) {
418 t1[k] = src.at<
NMSTYPE>(ii, jj);
422 for (k = 0, ii = i - 1, jj = j - 2; k < 5; k++, jj++) {
424 t2[k] = src.at<
NMSTYPE>(ii, jj);
428 for (k = 0, ii = i, jj = j - 2; k < 5; k++, jj++) {
430 m1[k] = src.at<
NMSTYPE>(ii, jj);
434 for (k = 0, ii = i + 1, jj = j - 2; k < 5; k++, jj++) {
437 for (k = 0, ii = i + 2, jj = j - 2; k < 5; k++, jj++) {
442 dst.at<uchar>(i, j) =
result ? 255 : 0;
bool OCVFindMaximum2(NMSTYPE *t1, NMSTYPE *t2, NMSTYPE *m1, NMSTYPE *b1, NMSTYPE *b2)