83 for (j = 0; j < src.cols; j++) {
85 for (k = 0; k < 5; k++) {
88 for (k = 0; k < 5; k++) {
91 for (k = 0, ii = i, jj = j - 2; k < 5; k++, jj++) {
93 m1[k] = src.at<
NMSTYPE>(ii, jj);
97 for (k = 0, ii = i + 1, jj = j - 2; k < 5; k++, jj++) {
99 b1[k] = src.at<
NMSTYPE>(ii, jj);
103 for (k = 0, ii = i + 2, jj = j - 2; k < 5; k++, jj++) {
105 b2[k] = src.at<
NMSTYPE>(ii, jj);
109 }
else if ((j >= 2) && (j < src.cols - 2)) {
110 for (k = 0, ii = i - 2, jj = j - 2; k < 5; k++, jj++) {
113 for (k = 0, ii = i - 1, jj = j - 2; k < 5; k++, jj++) {
116 for (k = 0, ii = i, jj = j - 2; k < 5; k++, jj++) {
117 m1[k] = src.at<
NMSTYPE>(ii, jj);
119 for (k = 0, ii = i + 1, jj = j - 2; k < 5; k++, jj++) {
120 b1[k] = src.at<
NMSTYPE>(ii, jj);
122 for (k = 0, ii = i + 2, jj = j - 2; k < 5; k++, jj++) {
123 b2[k] = src.at<
NMSTYPE>(ii, jj);
125 }
else if (j >= src.cols - 2) {
126 for (k = 0, ii = i - 2, jj = j - 2; k < 5; k++, jj++) {
129 for (k = 0, ii = i - 1, jj = j - 2; k < 5; k++, jj++) {
132 for (k = 0, ii = i, jj = j - 2; k < 5; k++, jj++) {
134 m1[k] = src.at<
NMSTYPE>(ii, jj);
138 for (k = 0, ii = i + 1, jj = j - 2; k < 5; k++, jj++) {
140 b1[k] = src.at<
NMSTYPE>(ii, jj);
144 for (k = 0, ii = i + 2, jj = j - 2; k < 5; k++, jj++) {
146 b2[k] = src.at<
NMSTYPE>(ii, jj);
152 dst.at<uchar>(i, j) =
result ? 255 : 0;
156 for (j = 0; j < src.cols; j++) {
158 for (k = 0; k < 5; k++) {
161 for (k = 0, ii = i - 1, jj = j - 2; k < 5; k++, jj++) {
163 t2[k] = src.at<
NMSTYPE>(ii, jj);
167 for (k = 0, ii = i, jj = j - 2; k < 5; k++, jj++) {
169 m1[k] = src.at<
NMSTYPE>(ii, jj);
173 for (k = 0, ii = i + 1, jj = j - 2; k < 5; k++, jj++) {
175 b1[k] = src.at<
NMSTYPE>(ii, jj);
179 for (k = 0, ii = i + 2, jj = j - 2; k < 5; k++, jj++) {
181 b2[k] = src.at<
NMSTYPE>(ii, jj);
185 }
else if ((j >= 2) && (j < src.cols - 2)) {
186 for (k = 0, ii = i - 2, jj = j - 2; k < 5; k++, jj++) {
189 for (k = 0, ii = i - 1, jj = j - 2; k < 5; k++, jj++) {
190 t2[k] = src.at<
NMSTYPE>(ii, jj);
192 for (k = 0, ii = i, jj = j - 2; k < 5; k++, jj++) {
193 m1[k] = src.at<
NMSTYPE>(ii, jj);
195 for (k = 0, ii = i + 1, jj = j - 2; k < 5; k++, jj++) {
196 b1[k] = src.at<
NMSTYPE>(ii, jj);
198 for (k = 0, ii = i + 2, jj = j - 2; k < 5; k++, jj++) {
199 b2[k] = src.at<
NMSTYPE>(ii, jj);
201 }
else if (j >= src.cols - 2) {
202 for (k = 0, ii = i - 2, jj = j - 2; k < 5; k++, jj++) {
205 for (k = 0, ii = i - 1, jj = j - 2; k < 5; k++, jj++) {
208 for (k = 0, ii = i, jj = j - 2; k < 5; k++, jj++) {
210 m1[k] = src.at<
NMSTYPE>(ii, jj);
214 for (k = 0, ii = i + 1, jj = j - 2; k < 5; k++, jj++) {
216 b1[k] = src.at<
NMSTYPE>(ii, jj);
220 for (k = 0, ii = i + 2, jj = j - 2; k < 5; k++, jj++) {
222 b2[k] = src.at<
NMSTYPE>(ii, jj);
228 dst.at<uchar>(i, j) =
result ? 255 : 0;
231 for (i = 2; i < src.rows - 2; i++) {
232 for (j = 0; j < src.cols; j++) {
234 for (k = 0, ii = i - 2, jj = j - 2; k < 5; k++, jj++) {
236 t1[k] = src.at<
NMSTYPE>(ii, jj);
240 for (k = 0, ii = i - 1, jj = j - 2; k < 5; k++, jj++) {
242 t2[k] = src.at<
NMSTYPE>(ii, jj);
246 for (k = 0, ii = i, jj = j - 2; k < 5; k++, jj++) {
248 m1[k] = src.at<
NMSTYPE>(ii, jj);
252 for (k = 0, ii = i + 1, jj = j - 2; k < 5; k++, jj++) {
254 b1[k] = src.at<
NMSTYPE>(ii, jj);
258 for (k = 0, ii = i + 2, jj = j - 2; k < 5; k++, jj++) {
260 b2[k] = src.at<
NMSTYPE>(ii, jj);
264 }
else if ((j >= 2) && (j < src.cols - 2)) {
265 for (k = 0, ii = i - 2, jj = j - 2; k < 5; k++, jj++) {
266 t1[k] = src.at<
NMSTYPE>(ii, jj);
268 for (k = 0, ii = i - 1, jj = j - 2; k < 5; k++, jj++) {
269 t2[k] = src.at<
NMSTYPE>(ii, jj);
271 for (k = 0, ii = i, jj = j - 2; k < 5; k++, jj++) {
272 m1[k] = src.at<
NMSTYPE>(ii, jj);
274 for (k = 0, ii = i + 1, jj = j - 2; k < 5; k++, jj++) {
275 b1[k] = src.at<
NMSTYPE>(ii, jj);
277 for (k = 0, ii = i + 2, jj = j - 2; k < 5; k++, jj++) {
278 b2[k] = src.at<
NMSTYPE>(ii, jj);
280 }
else if (j >= src.cols - 2) {
281 for (k = 0, ii = i - 2, jj = j - 2; k < 5; k++, jj++) {
283 t1[k] = src.at<
NMSTYPE>(ii, jj);
287 for (k = 0, ii = i - 1, jj = j - 2; k < 5; k++, jj++) {
289 t2[k] = src.at<
NMSTYPE>(ii, jj);
293 for (k = 0, ii = i, jj = j - 2; k < 5; k++, jj++) {
295 m1[k] = src.at<
NMSTYPE>(ii, jj);
299 for (k = 0, ii = i + 1, jj = j - 2; k < 5; k++, jj++) {
301 b1[k] = src.at<
NMSTYPE>(ii, jj);
305 for (k = 0, ii = i + 2, jj = j - 2; k < 5; k++, jj++) {
307 b2[k] = src.at<
NMSTYPE>(ii, jj);
314 dst.at<uchar>(i, j) =
result ? 255 : 0;
319 for (j = 0; j < src.cols; j++) {
321 for (k = 0, ii = i - 2, jj = j - 2; k < 5; k++, jj++) {
323 t1[k] = src.at<
NMSTYPE>(ii, jj);
327 for (k = 0, ii = i - 1, jj = j - 2; k < 5; k++, jj++) {
329 t2[k] = src.at<
NMSTYPE>(ii, jj);
333 for (k = 0, ii = i, jj = j - 2; k < 5; k++, jj++) {
335 m1[k] = src.at<
NMSTYPE>(ii, jj);
339 for (k = 0, ii = i + 1, jj = j - 2; k < 5; k++, jj++) {
341 b1[k] = src.at<
NMSTYPE>(ii, jj);
345 for (k = 0, ii = i + 2, jj = j - 2; k < 5; k++, jj++) {
348 }
else if ((j >= 2) && (j < src.cols - 2)) {
349 for (k = 0, ii = i - 2, jj = j - 2; k < 5; k++, jj++) {
350 t1[k] = src.at<
NMSTYPE>(ii, jj);
352 for (k = 0, ii = i - 1, jj = j - 2; k < 5; k++, jj++) {
353 t2[k] = src.at<
NMSTYPE>(ii, jj);
355 for (k = 0, ii = i, jj = j - 2; k < 5; k++, jj++) {
356 m1[k] = src.at<
NMSTYPE>(ii, jj);
358 for (k = 0, ii = i + 1, jj = j - 2; k < 5; k++, jj++) {
359 b1[k] = src.at<
NMSTYPE>(ii, jj);
361 for (k = 0, ii = i + 2, jj = j - 2; k < 5; k++, jj++) {
364 }
else if (j >= src.cols - 2) {
365 for (k = 0, ii = i - 2, jj = j - 2; k < 5; k++, jj++) {
367 t1[k] = src.at<
NMSTYPE>(ii, jj);
371 for (k = 0, ii = i - 1, jj = j - 2; k < 5; k++, jj++) {
373 t2[k] = src.at<
NMSTYPE>(ii, jj);
377 for (k = 0, ii = i, jj = j - 2; k < 5; k++, jj++) {
379 m1[k] = src.at<
NMSTYPE>(ii, jj);
383 for (k = 0, ii = i + 1, jj = j - 2; k < 5; k++, jj++) {
385 b1[k] = src.at<
NMSTYPE>(ii, jj);
389 for (k = 0, ii = i + 2, jj = j - 2; k < 5; k++, jj++) {
394 dst.at<uchar>(i, j) =
result ? 255 : 0;
398 for (j = 0; j < src.cols; j++) {
400 for (k = 0, ii = i - 1, jj = j - 2; k < 5; k++, jj++) {
402 t1[k] = src.at<
NMSTYPE>(ii, jj);
406 for (k = 0, ii = i - 1, jj = j - 2; k < 5; k++, jj++) {
408 t2[k] = src.at<
NMSTYPE>(ii, jj);
412 for (k = 0, ii = i, jj = j - 2; k < 5; k++, jj++) {
414 m1[k] = src.at<
NMSTYPE>(ii, jj);
418 for (k = 0, ii = i + 1, jj = j - 2; k < 5; k++, jj++) {
421 for (k = 0, ii = i + 2, jj = j - 2; k < 5; k++, jj++) {
424 }
else if ((j >= 2) && (j < src.cols - 2)) {
425 for (k = 0, ii = i - 2, jj = j - 2; k < 5; k++, jj++) {
426 t1[k] = src.at<
NMSTYPE>(ii, jj);
428 for (k = 0, ii = i - 1, jj = j - 2; k < 5; k++, jj++) {
429 t2[k] = src.at<
NMSTYPE>(ii, jj);
431 for (k = 0, ii = i, jj = j - 2; k < 5; k++, jj++) {
432 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++) {
440 }
else if (j >= src.cols - 2) {
441 for (k = 0, ii = i - 2, jj = j - 2; k < 5; k++, jj++) {
443 t1[k] = src.at<
NMSTYPE>(ii, jj);
447 for (k = 0, ii = i - 1, jj = j - 2; k < 5; k++, jj++) {
449 t2[k] = src.at<
NMSTYPE>(ii, jj);
453 for (k = 0, ii = i, jj = j - 2; k < 5; k++, jj++) {
455 m1[k] = src.at<
NMSTYPE>(ii, jj);
459 for (k = 0, ii = i + 1, jj = j - 2; k < 5; k++, jj++) {
462 for (k = 0, ii = i + 2, jj = j - 2; k < 5; k++, jj++) {
467 dst.at<uchar>(i, j) =
result ? 255 : 0;
bool OCVFindMaximum2(NMSTYPE *t1, NMSTYPE *t2, NMSTYPE *m1, NMSTYPE *b1, NMSTYPE *b2)