Visual Servoing Platform version 3.7.0
Loading...
Searching...
No Matches
catchImageMorphology.cpp
1/*
2 * ViSP, open source Visual Servoing Platform software.
3 * Copyright (C) 2005 - 2024 by Inria. All rights reserved.
4 *
5 * This software is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 * See the file LICENSE.txt at the root directory of this source
10 * distribution for additional information about the GNU GPL.
11 *
12 * For using ViSP with software that can not be combined with the GNU
13 * GPL, please contact Inria about acquiring a ViSP Professional
14 * Edition License.
15 *
16 * See https://visp.inria.fr for more information.
17 *
18 * This software was developed at:
19 * Inria Rennes - Bretagne Atlantique
20 * Campus Universitaire de Beaulieu
21 * 35042 Rennes Cedex
22 * France
23 *
24 * If you have questions regarding the use of this file, please contact
25 * Inria at visp@inria.fr
26 *
27 * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
28 * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
29 *
30 * Description:
31 * Test image morphology.
32 */
33
39
40#include <visp3/core/vpConfig.h>
41
42#if defined(VISP_HAVE_CATCH2)
43
44#include "common.hpp"
45#include <catch_amalgamated.hpp>
46#include <visp3/core/vpImageFilter.h>
47#include <visp3/core/vpImageMorphology.h>
48
49#ifdef ENABLE_VISP_NAMESPACE
50using namespace VISP_NAMESPACE_NAME;
51#endif
52TEST_CASE("Binary image morphology", "[image_morphology]")
53{
54 unsigned char image_data[8 * 16] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
55 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0,
56 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 1, 1, 0,
57 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1,
58 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1,
59 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0,
60 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1,
61 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0 };
62
63 vpImage<unsigned char> I(image_data, 8, 16, true);
64
65 SECTION("Dilatation")
66 {
67 SECTION("4-connexity")
68 {
70 vpImage<unsigned char> I_morpho_ref = I;
71 vpImage<unsigned char> I_morpho_tpl = I;
72 vpImage<unsigned char> I_morpho = I;
73
74 common_tools::imageDilatationRef(I_morpho_ref, connexity);
75 vpImageMorphology::dilatation(I_morpho_tpl, (unsigned char)1, (unsigned char)0, connexity);
77
78 CHECK((I_morpho_ref == I_morpho_tpl));
79 CHECK((I_morpho_ref == I_morpho));
80 }
81 SECTION("8-connexity")
82 {
84 vpImage<unsigned char> I_morpho_ref = I;
85 vpImage<unsigned char> I_morpho_tpl = I;
86 vpImage<unsigned char> I_morpho = I;
87
88 common_tools::imageDilatationRef(I_morpho_ref, connexity);
89 vpImageMorphology::dilatation(I_morpho_tpl, (unsigned char)1, (unsigned char)0, connexity);
91
92 CHECK((I_morpho_ref == I_morpho_tpl));
93 CHECK((I_morpho_ref == I_morpho));
94 }
95 }
96
97 SECTION("Erosion")
98 {
99 SECTION("4-connexity")
100 {
102 vpImage<unsigned char> I_morpho_ref = I;
103 vpImage<unsigned char> I_morpho_tpl = I;
104 vpImage<unsigned char> I_morpho = I;
105
106 common_tools::imageErosionRef(I_morpho_ref, connexity);
107 vpImageMorphology::erosion(I_morpho_tpl, (unsigned char)1, (unsigned char)0, connexity);
109
110 CHECK((I_morpho_ref == I_morpho_tpl));
111 CHECK((I_morpho_ref == I_morpho));
112 }
113
114 SECTION("8-connexity")
115 {
117 vpImage<unsigned char> I_morpho_ref = I;
118 vpImage<unsigned char> I_morpho_tpl = I;
119 vpImage<unsigned char> I_morpho = I;
120
121 common_tools::imageErosionRef(I_morpho_ref, connexity);
122 vpImageMorphology::erosion(I_morpho_tpl, (unsigned char)1, (unsigned char)0, connexity);
124
125 CHECK((I_morpho_ref == I_morpho_tpl));
126 CHECK((I_morpho_ref == I_morpho));
127 }
128
129 SECTION("8-connexity-size5")
130 {
131 vpImage<unsigned char> I_dilatation_ref(8, 16, 1);
132 I_dilatation_ref[0][0] = 0;
133 I_dilatation_ref[0][1] = 0;
134 I_dilatation_ref[0][2] = 0;
135 I_dilatation_ref[6][12] = 0;
136 I_dilatation_ref[7][12] = 0;
137 vpImage<unsigned char> I_dilatation = I;
138 vpImage<unsigned char> I_erosion_ref(8, 16, 0);
139 vpImage<unsigned char> I_erosion = I;
140
141 const int size = 5;
142 vpImageMorphology::dilatation(I_dilatation, size);
143 vpImageMorphology::erosion(I_erosion, size);
144
145 CHECK((I_dilatation_ref == I_dilatation));
146 CHECK((I_erosion_ref == I_erosion));
147 }
148 }
149
150 SECTION("Matlab reference")
151 {
152 SECTION("4-connexity")
153 {
155 vpImage<unsigned char> I_dilatation = I;
156 vpImageMorphology::dilatation<unsigned char>(I_dilatation, connexity);
157
158 unsigned char image_data_dilatation[8 * 16] = {
159 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0,
160 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1,
161 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1,
162 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1 };
163 vpImage<unsigned char> I_dilatation_ref(image_data_dilatation, 8, 16, true);
164 CHECK((I_dilatation_ref == I_dilatation));
165
166 vpImage<unsigned char> I_erosion = I_dilatation;
167 vpImageMorphology::erosion<unsigned char>(I_erosion, connexity);
168
169 unsigned char image_data_erosion[8 * 16] = {
170 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0,
171 0, 0, 0, 0, 1, 1, 1, 1, 0, 1, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1,
172 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0,
173 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0 };
174 vpImage<unsigned char> I_erosion_ref(image_data_erosion, 8, 16, true);
175 CHECK((I_erosion_ref == I_erosion));
176 }
177
178 SECTION("8-connexity")
179 {
181 vpImage<unsigned char> I_dilatation = I;
182 vpImageMorphology::dilatation<unsigned char>(I_dilatation, connexity);
183
184 unsigned char image_data_dilatation[8 * 16] = {
185 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1,
186 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
187 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1,
188 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1 };
189 vpImage<unsigned char> I_dilatation_ref(image_data_dilatation, 8, 16, true);
190 CHECK((I_dilatation_ref == I_dilatation));
191
192 vpImage<unsigned char> I_erosion = I_dilatation;
193 vpImageMorphology::erosion<unsigned char>(I_erosion, connexity);
194
195 unsigned char image_data_erosion[8 * 16] = {
196 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 0, 0,
197 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1,
198 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1,
199 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1 };
200 vpImage<unsigned char> I_erosion_ref(image_data_erosion, 8, 16, true);
201 CHECK((I_erosion_ref == I_erosion));
202 }
203 }
204}
205
206TEST_CASE("Gray image morphology", "[image_morphology]")
207{
209 common_tools::magicSquare(I, 17);
210
211 SECTION("Dilatation")
212 {
213 SECTION("4-connexity")
214 {
216 vpImage<unsigned char> I_morpho_ref = I;
217 vpImage<unsigned char> I_morpho = I;
218
219 common_tools::imageDilatationRef(I_morpho_ref, connexity);
221
222 CHECK((I_morpho_ref == I_morpho));
223 }
224 SECTION("8-connexity")
225 {
227 vpImage<unsigned char> I_morpho_ref = I;
228 vpImage<unsigned char> I_morpho = I;
229
230 common_tools::imageDilatationRef(I_morpho_ref, connexity);
232
233 CHECK((I_morpho_ref == I_morpho));
234 }
235
236 SECTION("8-connexity-size5")
237 {
238 const int size = 5;
239 vpImage<unsigned char> I_morpho(12, 12);
240 unsigned char count = 1;
241 for (int r = 0; r < 12; r++) {
242 for (int c = 0; c < 12; c++) {
243 I_morpho[r][c] = count;
244 count++;
245 }
246 }
247 unsigned char image_data_dilatation[12 * 12] = {
248 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 36, 36,
249 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 48, 48,
250 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 60, 60,
251 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 72, 72,
252 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 84, 84,
253 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 96, 96,
254 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 108, 108,
255 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 120, 120,
256 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 132, 132,
257 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 144, 144,
258 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 144, 144,
259 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 144, 144 };
260 vpImage<unsigned char> I_dilatation_ref(image_data_dilatation, 12, 12, true);
261
263
264 CHECK((I_dilatation_ref == I_morpho));
265 }
266 }
267
268 SECTION("Erosion")
269 {
270 SECTION("4-connexity")
271 {
273 vpImage<unsigned char> I_morpho_ref = I;
274 vpImage<unsigned char> I_morpho = I;
275
276 common_tools::imageErosionRef(I_morpho_ref, connexity);
278
279 CHECK((I_morpho_ref == I_morpho));
280 }
281
282 SECTION("8-connexity")
283 {
285 vpImage<unsigned char> I_morpho_ref = I;
286 vpImage<unsigned char> I_morpho = I;
287
288 common_tools::imageErosionRef(I_morpho_ref, connexity);
290
291 CHECK((I_morpho_ref == I_morpho));
292 }
293
294 SECTION("8-connexity-size5")
295 {
296 const int size = 5;
297 vpImage<unsigned char> I_morpho(12, 12);
298 unsigned char count = 1;
299 for (int r = 0; r < 12; r++) {
300 for (int c = 0; c < 12; c++) {
301 I_morpho[r][c] = count;
302 count++;
303 }
304 }
305 unsigned char image_data_erosion[12 * 12] = {
306 1, 1, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10,
307 1, 1, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10,
308 1, 1, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10,
309 13, 13, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22,
310 25, 25, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
311 37, 37, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46,
312 49, 49, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58,
313 61, 61, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70,
314 73, 73, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82,
315 85, 85, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94,
316 97, 97, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106,
317 109, 109, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118 };
318 vpImage<unsigned char> I_erosion_ref(image_data_erosion, 12, 12, true);
319
321
322 CHECK((I_erosion_ref == I_morpho));
323 }
324 }
325
326 SECTION("Matlab reference")
327 {
328 SECTION("4-connexity")
329 {
331 vpImage<unsigned char> I_dilatation = I;
332 vpImageMorphology::dilatation<unsigned char>(I_dilatation, connexity);
333
334 unsigned char image_data_dilatation[17 * 17] = {
335 174, 193, 212, 231, 250, 255, 255, 255, 255, 39, 58, 77, 96, 115, 134, 153, 154, 192, 211, 230, 249,
336 255, 255, 255, 255, 38, 57, 76, 95, 114, 133, 152, 170, 172, 210, 229, 248, 255, 255, 255, 255, 37,
337 56, 75, 94, 113, 132, 151, 170, 172, 190, 228, 247, 255, 255, 255, 255, 36, 55, 74, 93, 112, 131,
338 150, 169, 187, 190, 208, 246, 255, 255, 255, 255, 51, 54, 73, 92, 111, 130, 149, 168, 187, 189, 208,
339 226, 255, 255, 255, 255, 51, 53, 72, 91, 110, 129, 148, 167, 186, 204, 207, 226, 244, 255, 255, 255,
340 50, 68, 71, 90, 109, 128, 147, 166, 185, 204, 206, 225, 244, 255, 255, 255, 49, 68, 70, 89, 108,
341 127, 146, 165, 184, 203, 221, 224, 243, 255, 255, 255, 48, 67, 85, 88, 107, 126, 145, 164, 183, 202,
342 221, 223, 242, 255, 255, 255, 47, 66, 85, 87, 106, 125, 144, 163, 182, 201, 220, 238, 241, 255, 255,
343 255, 255, 65, 84, 102, 105, 124, 143, 162, 181, 200, 219, 238, 240, 255, 255, 255, 255, 45, 83, 102,
344 104, 123, 142, 161, 180, 199, 218, 237, 255, 255, 255, 255, 255, 45, 63, 101, 119, 122, 141, 160, 179,
345 198, 217, 236, 255, 255, 255, 255, 255, 44, 63, 81, 119, 121, 140, 159, 178, 197, 216, 235, 254, 255,
346 255, 255, 255, 43, 62, 81, 99, 136, 139, 158, 177, 196, 215, 234, 253, 255, 255, 255, 255, 42, 61,
347 80, 99, 117, 138, 157, 176, 195, 214, 233, 252, 255, 255, 255, 255, 41, 60, 79, 98, 117, 135, 156,
348 175, 194, 213, 232, 251, 255, 255, 255, 255, 40, 59, 78, 97, 116, 135, 135 };
349 vpImage<unsigned char> I_dilatation_ref(image_data_dilatation, 17, 17, true);
350 CHECK((I_dilatation_ref == I_dilatation));
351
352 vpImage<unsigned char> I_erosion = I_dilatation;
353 vpImageMorphology::erosion<unsigned char>(I_erosion, connexity);
354
355 unsigned char image_data_erosion[17 * 17] = {
356 174, 174, 193, 212, 231, 250, 255, 255, 38, 39, 39, 58, 77, 96, 115, 134, 153, 174, 192, 211, 230,
357 249, 255, 255, 37, 38, 38, 57, 76, 95, 114, 133, 152, 154, 192, 210, 229, 248, 255, 255, 36, 37,
358 37, 56, 75, 94, 113, 132, 151, 170, 172, 210, 228, 247, 255, 255, 36, 36, 36, 55, 74, 93, 112,
359 131, 150, 169, 172, 190, 228, 246, 255, 255, 51, 51, 36, 54, 73, 92, 111, 130, 149, 168, 187, 189,
360 208, 246, 255, 255, 50, 51, 51, 53, 72, 91, 110, 129, 148, 167, 186, 189, 207, 226, 255, 255, 49,
361 50, 50, 53, 71, 90, 109, 128, 147, 166, 185, 204, 206, 225, 244, 255, 48, 49, 49, 68, 70, 89,
362 108, 127, 146, 165, 184, 203, 206, 224, 243, 255, 47, 48, 48, 67, 70, 88, 107, 126, 145, 164, 183,
363 202, 221, 223, 242, 255, 255, 47, 47, 66, 85, 87, 106, 125, 144, 163, 182, 201, 220, 223, 241, 255,
364 255, 45, 47, 65, 84, 87, 105, 124, 143, 162, 181, 200, 219, 238, 240, 255, 255, 45, 45, 65, 83,
365 102, 104, 123, 142, 161, 180, 199, 218, 237, 240, 255, 255, 44, 45, 45, 83, 101, 104, 122, 141, 160,
366 179, 198, 217, 236, 255, 255, 255, 43, 44, 44, 63, 101, 119, 121, 140, 159, 178, 197, 216, 235, 254,
367 255, 255, 42, 43, 43, 62, 81, 119, 121, 139, 158, 177, 196, 215, 234, 253, 255, 255, 41, 42, 42,
368 61, 80, 99, 136, 138, 157, 176, 195, 214, 233, 252, 255, 255, 40, 41, 41, 60, 79, 98, 117, 138,
369 156, 175, 194, 213, 232, 251, 255, 255, 40, 40, 40, 59, 78, 97, 116, 135 };
370 vpImage<unsigned char> I_erosion_ref(image_data_erosion, 17, 17, true);
371 CHECK((I_erosion_ref == I_erosion));
372 }
373
374 SECTION("8-connexity")
375 {
377 vpImage<unsigned char> I_dilatation = I;
378 vpImageMorphology::dilatation<unsigned char>(I_dilatation, connexity);
379
380 unsigned char image_data_dilatation[17 * 17] = {
381 192, 211, 230, 249, 255, 255, 255, 255, 255, 57, 76, 95, 114, 133, 152, 154, 154, 210, 229, 248, 255,
382 255, 255, 255, 255, 255, 75, 94, 113, 132, 151, 170, 172, 172, 228, 247, 255, 255, 255, 255, 255, 255,
383 74, 93, 112, 131, 150, 169, 171, 190, 190, 246, 255, 255, 255, 255, 255, 255, 73, 92, 111, 130, 149,
384 168, 187, 189, 208, 208, 255, 255, 255, 255, 255, 255, 72, 91, 110, 129, 148, 167, 186, 188, 207, 226,
385 226, 255, 255, 255, 255, 255, 71, 90, 109, 128, 147, 166, 185, 204, 206, 225, 244, 244, 255, 255, 255,
386 255, 70, 89, 108, 127, 146, 165, 184, 203, 205, 224, 243, 255, 255, 255, 255, 255, 69, 88, 107, 126,
387 145, 164, 183, 202, 221, 223, 242, 255, 255, 255, 255, 255, 85, 87, 106, 125, 144, 163, 182, 201, 220,
388 222, 241, 255, 255, 255, 255, 65, 84, 86, 105, 124, 143, 162, 181, 200, 219, 238, 240, 255, 255, 255,
389 255, 255, 83, 102, 104, 123, 142, 161, 180, 199, 218, 237, 239, 255, 255, 255, 255, 255, 255, 101, 103,
390 122, 141, 160, 179, 198, 217, 236, 255, 255, 255, 255, 255, 255, 255, 63, 119, 121, 140, 159, 178, 197,
391 216, 235, 254, 255, 255, 255, 255, 255, 255, 81, 81, 120, 139, 158, 177, 196, 215, 234, 253, 255, 255,
392 255, 255, 255, 255, 80, 99, 99, 138, 157, 176, 195, 214, 233, 252, 255, 255, 255, 255, 255, 255, 79,
393 98, 117, 117, 156, 175, 194, 213, 232, 251, 255, 255, 255, 255, 255, 255, 78, 97, 116, 135, 135, 156,
394 175, 194, 213, 232, 251, 255, 255, 255, 255, 255, 59, 78, 97, 116, 135, 135 };
395 vpImage<unsigned char> I_dilatation_ref(image_data_dilatation, 17, 17, true);
396 CHECK((I_dilatation_ref == I_dilatation));
397
398 vpImage<unsigned char> I_erosion = I_dilatation;
399 vpImageMorphology::erosion<unsigned char>(I_erosion, connexity);
400
401 unsigned char image_data_erosion[17 * 17] = {
402 192, 192, 211, 230, 249, 255, 255, 255, 57, 57, 57, 76, 95, 114, 133, 152, 154, 192, 192, 211, 230,
403 249, 255, 255, 74, 57, 57, 57, 76, 95, 114, 133, 152, 154, 210, 210, 229, 248, 255, 255, 73, 73,
404 73, 74, 75, 94, 113, 132, 151, 170, 172, 228, 228, 247, 255, 255, 72, 72, 72, 73, 74, 93, 112,
405 131, 150, 169, 171, 190, 246, 246, 255, 255, 71, 71, 71, 72, 73, 92, 111, 130, 149, 168, 187, 189,
406 208, 255, 255, 255, 70, 70, 70, 71, 72, 91, 110, 129, 148, 167, 186, 188, 207, 226, 255, 255, 69,
407 69, 69, 70, 71, 90, 109, 128, 147, 166, 185, 204, 206, 225, 244, 255, 85, 69, 69, 69, 70, 89,
408 108, 127, 146, 165, 184, 203, 205, 224, 243, 255, 65, 65, 69, 69, 69, 88, 107, 126, 145, 164, 183,
409 202, 221, 223, 242, 255, 255, 65, 65, 84, 85, 87, 106, 125, 144, 163, 182, 201, 220, 222, 241, 255,
410 255, 255, 65, 65, 84, 86, 105, 124, 143, 162, 181, 200, 219, 238, 240, 255, 255, 63, 63, 83, 83,
411 102, 104, 123, 142, 161, 180, 199, 218, 237, 239, 255, 255, 81, 63, 63, 101, 101, 103, 122, 141, 160,
412 179, 198, 217, 236, 255, 255, 255, 80, 80, 63, 63, 119, 119, 121, 140, 159, 178, 197, 216, 235, 254,
413 255, 255, 79, 79, 79, 80, 81, 120, 120, 139, 158, 177, 196, 215, 234, 253, 255, 255, 78, 78, 78,
414 79, 80, 99, 138, 138, 157, 176, 195, 214, 233, 252, 255, 255, 59, 59, 59, 78, 79, 98, 117, 156,
415 156, 175, 194, 213, 232, 251, 255, 255, 255, 59, 59, 59, 78, 97, 116, 135 };
416 vpImage<unsigned char> I_erosion_ref(image_data_erosion, 17, 17, true);
417 CHECK((I_erosion_ref == I_erosion));
418 }
419 }
420}
421
422int main(int argc, char *argv[])
423{
424 Catch::Session session;
425 session.applyCommandLine(argc, argv);
426 int numFailed = session.run();
427 std::cout << (numFailed ? "Test failed" : "Test succeed") << std::endl;
428 return numFailed;
429}
430
431#else
432int main() { return EXIT_SUCCESS; }
433#endif
static void dilatation(vpImage< Type > &I, Type value, Type value_out, vpConnexityType connexity=CONNEXITY_4)
static void erosion(vpImage< Type > &I, Type value, Type value_out, vpConnexityType connexity=CONNEXITY_4)
Definition of the vpImage class member functions.
Definition vpImage.h:131