Attachment 'octave-image-autopkgtest-log.txt'
Download 1 autopkgtest [11:04:11]: version 4.4
2 autopkgtest [11:04:11]: host dev; command line: /usr/bin/autopkgtest -B . -- null
3 autopkgtest [11:04:11]: testbed dpkg architecture: amd64
4 autopkgtest [11:04:11]: testbed running kernel: Linux 4.9.0-3-amd64 #1 SMP Debian 4.9.30-2 (2017-06-12)
5 autopkgtest [11:04:11]: @@@@@@@@@@@@@@@@@@@@ unbuilt-tree .
6 dpkg-source: info: using options from real-tree/debian/source/options: --extend-diff-ignore=inst/im2double.m|src/Makefile|src/config.h|src/config.log|src/config.status
7 autopkgtest [11:04:11]: testing package octave-image version 2.6.1-2
8 autopkgtest [11:04:11]: build not needed
9 autopkgtest [11:04:11]: test unit-tests: preparing testbed
10 Starting pkgProblemResolver with broken count: 0
11 Starting 2 pkgProblemResolver with broken count: 0
12 Done
13 autopkgtest [11:04:12]: test unit-tests: [-----------------------
14 /usr/share/octave-pkg-dev/check-pkg
15 Checking package...
16 echo Checking m files ...
17 warning: function /usr/share/octave/packages/image-2.6.1/im2double.m shadows a core library function
18 warning: called from
19 load_packages_and_dependencies at line 48 column 5
20 load_packages at line 47 column 3
21 pkg at line 411 column 7
22 /var/tmp/file8moa2S at line 6 column 5
23 [stdfilt]
24 >>>>> /usr/share/octave/packages/image-2.6.1/stdfilt.m
25 ***** test
26 im = stdfilt (ones (5));
27 assert (im, zeros (5));
28 1 test, 1 passed, 0 known failure, 0 skipped
29 [rangefilt]
30 >>>>> /usr/share/octave/packages/image-2.6.1/rangefilt.m
31 ***** test
32 im = rangefilt (ones (5));
33 assert (im, zeros (5));
34 1 test, 1 passed, 0 known failure, 0 skipped
35 [imtransform]
36 >>>>> /usr/share/octave/packages/image-2.6.1/imtransform.m
37 ***** demo
38 ## Various linear transforms
39 figure ();
40 im = [checkerboard(20, 2, 4); checkerboard(40, 1, 2)];
41 %input space corners
42 incp = [1 1; 160 1; 160 160; 1 160];
43 udata = [min(incp(:,1)) max(incp(:,1))];
44 vdata = [min(incp(:,2)) max(incp(:,2))];
45 subplot (2,3,1);
46 imshow (im)
47 hold on
48 plot (incp(:,1), incp(:,2), 'ob')
49 axis on
50 xlabel ('Original')
51
52 % Translation and scaling
53 outcp = incp * 2;
54 outcp(:,1) += 200;
55 outcp(:,2) += 500;
56 T = maketform ('affine', incp(1:3,:), outcp(1:3,:));
57 subplot (2,3,2);
58 [im2 xdata ydata] = imtransform (im, T, 'udata', udata,
59 'vdata', vdata, 'fillvalues', 1);
60 imh = imshow (im2); set (imh, 'xdata', xdata, 'ydata', ydata)
61 set (gca, 'xlim', xdata, 'ylim', ydata)
62 axis on, hold on, xlabel ('Translation / Scaling');
63 plot (outcp(:,1), outcp(:,2), 'or')
64
65 % Shear
66 outcp = [1 1; 160 1; 140 160; -19 160]; % affine only needs 3 control points
67 T = maketform ('affine', incp(1:3,:), outcp(1:3,:));
68 subplot (2,3,3);
69 [im2 xdata ydata] = imtransform (im, T, 'udata', udata,
70 'vdata', vdata, 'fillvalues', 1);
71 imh = imshow (im2); set (imh, 'xdata', xdata, 'ydata', ydata)
72 set (gca, 'xlim', xdata, 'ylim', ydata)
73 axis on, hold on, xlabel ('Shear');
74 plot (outcp(:,1), outcp(:,2), 'or')
75
76 % Rotation
77 theta = pi/4;
78 T = maketform ('affine', [cos(theta) -sin(theta); ...
79 sin(theta) cos(theta); 0 0]);
80 outcp = tformfwd (T, incp);
81 subplot (2,3,4);
82 [im2 xdata ydata] = imtransform (im, T, 'udata', udata,
83 'vdata', vdata, 'fillvalues', 1 );
84 imh = imshow (im2); set (imh, 'xdata', xdata, 'ydata', ydata)
85 set (gca, 'xlim', xdata, 'ylim', ydata)
86 axis on, hold on, xlabel ('Rotation');
87 plot (outcp(:,1), outcp(:,2), 'or')
88
89 % Reflection around x axis
90 outcp = incp;
91 outcp(:,2) *= -1;
92 T = cp2tform (incp, outcp, 'similarity');
93 subplot (2,3,5);
94 [im2 xdata ydata] = imtransform (im, T, 'udata', udata,
95 'vdata', vdata, 'fillvalues', 1 );
96 imh = imshow (im2); set (imh, 'xdata', xdata, 'ydata', ydata)
97 set (gca, 'xlim', xdata, 'ylim', ydata)
98 axis on, hold on, xlabel ('Reflection');
99 plot (outcp(:,1), outcp(:,2), 'or')
100
101 % Projection
102 outcp = [1 1; 160 -40; 220 220; 12 140];
103 T = maketform ('projective', incp, outcp);
104 subplot (2,3,6);
105 [im2 xdata ydata] = imtransform (im, T, 'udata', udata,
106 'vdata', vdata, 'fillvalues', 1 );
107 imh = imshow (im2); set (imh, 'xdata', xdata, 'ydata', ydata)
108 set (gca, 'xlim', xdata, 'ylim', ydata)
109 axis on, hold on, xlabel ('Projection');
110 plot (outcp(:,1), outcp(:,2), 'or')
111 ***** demo
112 ## Streched image
113 rad = 2; % minimum value: 4/pi
114 [uu vv] = meshgrid ((-2:2)/rad, (-2:2)/rad);
115 rescfactor = sin ((uu.^2 + vv.^2).^.5);
116 inpts = [(reshape (uu, numel (uu), 1)), (reshape (vv, numel (uu), 1))];
117 xx = rescfactor .* sign(uu);
118 yy = rescfactor .* sign(vv);
119 outpts = [reshape(xx, numel (xx), 1) reshape(yy, numel (yy), 1)];
120
121 T = cp2tform (inpts, outpts, "polynomial", 4);
122 figure;
123 subplot (1,2,1)
124 im = zeros (800, 800, 3);
125 im(:,:,1) = checkerboard (100) > 0.2;
126 im(:,:,3) = checkerboard (100) < 0.2;
127 [im2 xdata ydata] = imtransform (im, T, 'udata', [-2 2],
128 'vdata', [-2 2], 'fillvalues',
129 [0 1 0]);
130 imh = imshow (im2);
131 set (imh, 'xdata', xdata, 'ydata', ydata)
132 set (gca, 'xlim', xdata, 'ylim', ydata)
133 [im cmap] = imread ('default.img');
134 subplot (1,2,2)
135 [im2 xdata ydata] = imtransform (im, T, 'udata', [-1 1],
136 'vdata', [-1 1], 'fillvalues',
137 round (length (cmap) / 2));
138 imh = imshow (im2, cmap);
139 ***** test
140 im = checkerboard ();
141 incp = [0 0; 0 1; 1 1];
142 scl = 10;
143 outcp = scl * incp;
144 T = maketform ('affine', incp, outcp);
145 [im2 xdata ydata] = imtransform (im, T, 'udata', [0 1],
146 'vdata', [0 1], 'size', [500 500]);
147 assert (xdata, scl * ([0 1]))
148 assert (ydata, scl * ([0 1]))
149 assert (size (im2), [500 500])
150 ***** test
151 im = checkerboard ();
152 incp = [0 0; 0 1; 1 1];
153 scl = 10;
154 outcp = scl * incp;
155 xyscale = scl;
156 T = maketform ('affine', incp, outcp);
157 [im2 xdata ydata] = imtransform (im, T, 'xyscale', xyscale);
158 assert (size (im2), size (im), 1)
159 ***** test
160 im = checkerboard (100, 10, 4);
161 theta = 2 * pi;
162 T = maketform ("affine", [cos(theta) -sin(theta); ...
163 sin(theta) cos(theta); 0 0]);
164 im2 = imtransform (im, T, "nearest", "xdata", [1 800], "ydata", [1 2000]);
165 im = im(2:end-1, 2:end-1); %avoid boundaries
166 im2 = im2(2:end-1, 2:end-1);
167 assert (im, im2)
168 ***** test
169 im = checkerboard (20, 10, 4);
170 theta = pi/6;
171 T = maketform ('affine', [cos(theta) -sin(theta); ...
172 sin(theta) cos(theta); 0 0]);
173 [im2, xdata] = imtransform (im, T);
174 nu = columns(im);
175 nv = rows(im);
176 nx = xdata(2);
177 diag = sqrt (nu^2 + nv^2);
178 ang = atan (nv / nu);
179 assert (nx, diag * abs (cos (theta - ang)),
180 diag * 1 / size (im2, 2))
181 ***** test
182 im = rand (2);
183 tmat = [eye(2); 0 0];
184 T = maketform ("affine", tmat);
185 im2 = imtransform (im, T, "xdata", [1 3]);
186 assert (im2(:,3), zeros (2,1))
187 ***** test
188 im = rand (2);
189 tmat = [eye(2); 0 0];
190 T = maketform ('affine', tmat);
191 im2 = imtransform (im, T, "xdata", [1 3]);
192 assert (size (im2), [2 3])
193 ***** test
194 im = rand (2);
195 tmat = [eye(2); 0 0];
196 T = maketform ('affine', tmat);
197 im2 = imtransform (im, T, "xyscale", [0.5 0.5]);
198 assert (size (im2), [3 3])
199 7 tests, 7 passed, 0 known failure, 0 skipped
200 [iptcheckmap]
201 >>>>> /usr/share/octave/packages/image-2.6.1/iptcheckmap.m
202 ***** test ("iptcheckmap (jet(64), 'func', 'var', 2)"); # simple must work
203 ***** fail ("iptcheckmap (3, 'func', 'var', 2)"); # not a colormap
204 2 tests, 2 passed, 0 known failure, 0 skipped
205 [bwhitmiss]
206 >>>>> /usr/share/octave/packages/image-2.6.1/bwhitmiss.m
207 ***** test
208 bw1 = repmat ([0 1 0 1 1], [3 1]);
209 bw2 = repmat ([0 1 0 0 0], [3 1]);
210 assert (bwhitmiss (bw1, [1; 0; 1], [1 0 1]), logical (bw2))
211 assert (bwhitmiss (bw1, [0 1 0; -1 0 -1; 0 1 0]), logical (bw2))
212 1 test, 1 passed, 0 known failure, 0 skipped
213 [padarray]
214 >>>>> /usr/share/octave/packages/image-2.6.1/padarray.m
215 ***** demo
216 padarray([1,2,3;4,5,6],[2,1])
217 % pads [1,2,3;4,5,6] with a whole border of 2 rows and 1 columns of 0
218 ***** demo
219 padarray([1,2,3;4,5,6],[2,1],5)
220 % pads [1,2,3;4,5,6] with a whole border of 2 rows and 1 columns of 5
221 ***** demo
222 padarray([1,2,3;4,5,6],[2,1],0,'pre')
223 % pads [1,2,3;4,5,6] with a left and top border of 2 rows and 1 columns of 0
224 ***** demo
225 padarray([1,2,3;4,5,6],[2,1],'circular')
226 % pads [1,2,3;4,5,6] with a whole 'circular' border of 2 rows and 1 columns
227 % border 'repeats' data as if we tiled blocks of data
228 ***** demo
229 padarray([1,2,3;4,5,6],[2,1],'replicate')
230 % pads [1,2,3;4,5,6] with a whole border of 2 rows and 1 columns which
231 % 'replicates' edge data
232 ***** demo
233 padarray([1,2,3;4,5,6],[2,1],'symmetric')
234 % pads [1,2,3;4,5,6] with a whole border of 2 rows and 1 columns which
235 % is symmetric to the data on the edge
236 ***** assert (padarray ([1;2], [1]), [0;1;2;0]);
237 ***** assert (padarray ([3 4], [0 2]), [0 0 3 4 0 0]);
238 ***** assert (padarray ([1 2 3; 4 5 6], [1 2]),
239 [zeros(1, 7); 0 0 1 2 3 0 0; 0 0 4 5 6 0 0; zeros(1, 7)]);
240 ***** test
241 assert (padarray ([1 2 3; 4 5 6], [3 2 1]),
242 cat(3, zeros(8, 7),
243 [ [ zeros(3, 7) ]
244 [zeros(2, 2) [1 2 3; 4 5 6] zeros(2, 2) ]
245 [ zeros(3,7)] ],
246 zeros (8, 7)));
247 ***** assert (padarray ([1 2], [4 5]), padarray ([1 2], [4 5], 0));
248 ***** assert (padarray ([1 2], [4 5]), padarray ([1 2], [4 5], "both"));
249 ***** assert (padarray ([1;2], [1], i), [i; 1; 2; i]);
250 ***** assert (padarray ([1;2], [1], i, "pre"), [i; 1; 2]);
251 ***** assert (padarray ([1;2], [1], i, "post"), [1; 2; i]);
252 ***** assert (padarray ([1;2], [1], i, "both"), [i; 1; 2; i]);
253 ***** assert (padarray ([1 2], [0 1], i, "pre"), [i 1 2]);
254 ***** assert (padarray ([1 2], [0 1], i, "post"), [1 2 i]);
255 ***** assert (padarray ([1 2], [0 1], i, "both"), [i 1 2 i]);
256 ***** assert (padarray ([1 2], [0;1], i, "both"), [i 1 2 i]);
257 ***** test
258 A = [1 2 3; 4 5 6];
259 B = repmat (A, 7, 9);
260 assert (padarray (A, [1 2], "circular", "pre"), B(2:4,2:6));
261 assert (padarray (A, [1 2], "circular", "post"), B(3:5,4:8));
262 assert (padarray (A, [1 2], "circular", "both"), B(2:5,2:8));
263 ## This tests when padding is bigger than data
264 assert (padarray (A, [5 10], "circular", "both"), B(2:13,3:25));
265 ***** test
266 A = int8 ([1 2 3; 4 5 6]);
267 B = repmat (A, 7, 9);
268 assert (padarray (A, [1 2], "circular", "pre"), B(2:4,2:6));
269 assert (padarray (A, [1 2], "circular", "post"), B(3:5,4:8));
270 assert (padarray (A, [1 2], "circular", "both"), B(2:5,2:8));
271 ## This tests when padding is bigger than data
272 assert (padarray (A, [5 10], "circular", "both"), B(2:13,3:25));
273 ***** test
274 A = [1 2; 3 4];
275 B = kron (A, ones (10, 5));
276 assert (padarray (A, [9 4], "replicate", "pre"), B(1:11,1:6));
277 assert (padarray (A, [9 4], "replicate", "post"), B(10:20,5:10));
278 assert (padarray (A, [9 4], "replicate", "both"), B);
279 ## same with uint class
280 assert (padarray (uint8 (A), [9 4], "replicate", "pre"), uint8 (B(1:11,1:6)));
281 assert (padarray (uint8 (A), [9 4], "replicate", "post"), uint8 (B(10:20,5:10)));
282 assert (padarray (uint8 (A), [9 4], "replicate", "both"), uint8 (B));
283 ***** test
284 A = [1:3
285 4:6];
286 HA = [3:-1:1
287 6:-1:4];
288 VA = [4:6
289 1:3];
290 VHA = [6:-1:4
291 3:-1:1];
292 B = [VHA VA VHA
293 HA A HA
294 VHA VA VHA];
295 assert (padarray (A, [1 2], "symmetric", "pre"), B(2:4,2:6));
296 assert (padarray (A, [1 2], "symmetric", "post"), B(3:5,4:8));
297 assert (padarray (A, [1 2], "symmetric", "both"), B(2:5,2:8));
298 ## same with int class
299 assert (padarray (int16 (A), [1 2], "symmetric", "pre"), int16 (B(2:4,2:6)));
300 assert (padarray (int16 (A), [1 2], "symmetric", "post"), int16 (B(3:5,4:8)));
301 assert (padarray (int16 (A), [1 2], "symmetric", "both"), int16 (B(2:5,2:8)));
302 ***** assert (padarray (int8 ([1; 2]), [1]), int8 ([0; 1; 2; 0]));
303 ***** assert (padarray (uint8 ([3 4]), [0 2]), uint8 ([0 0 3 4 0 0]));
304 ***** assert (padarray (int16 ([1; 2]), [1], 4), int16 ([4; 1; 2; 4]));
305 ***** assert (padarray (uint16 ([1; 2]), [1], 0), uint16 ([0; 1; 2; 0]));
306 ***** assert (padarray (uint32 ([1; 2]), [1], 6, "post"), uint32 ([1; 2; 6]));
307 ***** assert (padarray (int32 ([1; 2]), [1], int32 (4), "pre"), int32 ([4; 1; 2]));
308 ***** test
309 in = [ 7 5 1 3
310 5 3 3 4
311 7 5 2 3
312 6 1 3 8];
313 padded = [
314 3 5 5 3 3 4 4 3 3 5 5 3 3 4 4 3 3 5 5 3 3 4 4 3
315 5 7 7 5 1 3 3 1 5 7 7 5 1 3 3 1 5 7 7 5 1 3 3 1
316 5 7 7 5 1 3 3 1 5 7 7 5 1 3 3 1 5 7 7 5 1 3 3 1
317 3 5 5 3 3 4 4 3 3 5 5 3 3 4 4 3 3 5 5 3 3 4 4 3
318 5 7 7 5 2 3 3 2 5 7 7 5 2 3 3 2 5 7 7 5 2 3 3 2
319 1 6 6 1 3 8 8 3 1 6 6 1 3 8 8 3 1 6 6 1 3 8 8 3
320 1 6 6 1 3 8 8 3 1 6 6 1 3 8 8 3 1 6 6 1 3 8 8 3
321 5 7 7 5 2 3 3 2 5 7 7 5 2 3 3 2 5 7 7 5 2 3 3 2
322 3 5 5 3 3 4 4 3 3 5 5 3 3 4 4 3 3 5 5 3 3 4 4 3
323 5 7 7 5 1 3 3 1 5 7 7 5 1 3 3 1 5 7 7 5 1 3 3 1
324 5 7 7 5 1 3 3 1 5 7 7 5 1 3 3 1 5 7 7 5 1 3 3 1
325 3 5 5 3 3 4 4 3 3 5 5 3 3 4 4 3 3 5 5 3 3 4 4 3
326 5 7 7 5 2 3 3 2 5 7 7 5 2 3 3 2 5 7 7 5 2 3 3 2
327 1 6 6 1 3 8 8 3 1 6 6 1 3 8 8 3 1 6 6 1 3 8 8 3
328 1 6 6 1 3 8 8 3 1 6 6 1 3 8 8 3 1 6 6 1 3 8 8 3
329 5 7 7 5 2 3 3 2 5 7 7 5 2 3 3 2 5 7 7 5 2 3 3 2
330 3 5 5 3 3 4 4 3 3 5 5 3 3 4 4 3 3 5 5 3 3 4 4 3
331 5 7 7 5 1 3 3 1 5 7 7 5 1 3 3 1 5 7 7 5 1 3 3 1
332 5 7 7 5 1 3 3 1 5 7 7 5 1 3 3 1 5 7 7 5 1 3 3 1
333 3 5 5 3 3 4 4 3 3 5 5 3 3 4 4 3 3 5 5 3 3 4 4 3
334 5 7 7 5 2 3 3 2 5 7 7 5 2 3 3 2 5 7 7 5 2 3 3 2
335 1 6 6 1 3 8 8 3 1 6 6 1 3 8 8 3 1 6 6 1 3 8 8 3
336 1 6 6 1 3 8 8 3 1 6 6 1 3 8 8 3 1 6 6 1 3 8 8 3
337 5 7 7 5 2 3 3 2 5 7 7 5 2 3 3 2 5 7 7 5 2 3 3 2];
338 for ite = 1:10
339 assert (padarray (in, [ite ite], "symmetric"), padded((11-ite):(14+ite),(11-ite):(14+ite)));
340 assert (padarray (in, [ite ite], "symmetric", "pre"), padded((11-ite):14,(11-ite):14));
341 assert (padarray (in, [ite ite], "symmetric", "post"), padded(11:(14+ite),11:(14+ite)));
342 endfor
343 ***** test
344 in = [ 7 5 4 9
345 6 4 5 1
346 5 3 3 3
347 2 6 7 3];
348 padded = [
349 3 3 3 3 5 3 3 3 3 3 5 3 3 3 3 3 5 3 3 3 3 3 5 3
350 7 3 7 6 2 6 7 3 7 6 2 6 7 3 7 6 2 6 7 3 7 6 2 6
351 3 3 3 3 5 3 3 3 3 3 5 3 3 3 3 3 5 3 3 3 3 3 5 3
352 5 1 5 4 6 4 5 1 5 4 6 4 5 1 5 4 6 4 5 1 5 4 6 4
353 4 9 4 5 7 5 4 9 4 5 7 5 4 9 4 5 7 5 4 9 4 5 7 5
354 5 1 5 4 6 4 5 1 5 4 6 4 5 1 5 4 6 4 5 1 5 4 6 4
355 3 3 3 3 5 3 3 3 3 3 5 3 3 3 3 3 5 3 3 3 3 3 5 3
356 7 3 7 6 2 6 7 3 7 6 2 6 7 3 7 6 2 6 7 3 7 6 2 6
357 3 3 3 3 5 3 3 3 3 3 5 3 3 3 3 3 5 3 3 3 3 3 5 3
358 5 1 5 4 6 4 5 1 5 4 6 4 5 1 5 4 6 4 5 1 5 4 6 4
359 4 9 4 5 7 5 4 9 4 5 7 5 4 9 4 5 7 5 4 9 4 5 7 5
360 5 1 5 4 6 4 5 1 5 4 6 4 5 1 5 4 6 4 5 1 5 4 6 4
361 3 3 3 3 5 3 3 3 3 3 5 3 3 3 3 3 5 3 3 3 3 3 5 3
362 7 3 7 6 2 6 7 3 7 6 2 6 7 3 7 6 2 6 7 3 7 6 2 6
363 3 3 3 3 5 3 3 3 3 3 5 3 3 3 3 3 5 3 3 3 3 3 5 3
364 5 1 5 4 6 4 5 1 5 4 6 4 5 1 5 4 6 4 5 1 5 4 6 4
365 4 9 4 5 7 5 4 9 4 5 7 5 4 9 4 5 7 5 4 9 4 5 7 5
366 5 1 5 4 6 4 5 1 5 4 6 4 5 1 5 4 6 4 5 1 5 4 6 4
367 3 3 3 3 5 3 3 3 3 3 5 3 3 3 3 3 5 3 3 3 3 3 5 3
368 7 3 7 6 2 6 7 3 7 6 2 6 7 3 7 6 2 6 7 3 7 6 2 6
369 3 3 3 3 5 3 3 3 3 3 5 3 3 3 3 3 5 3 3 3 3 3 5 3
370 5 1 5 4 6 4 5 1 5 4 6 4 5 1 5 4 6 4 5 1 5 4 6 4
371 4 9 4 5 7 5 4 9 4 5 7 5 4 9 4 5 7 5 4 9 4 5 7 5
372 5 1 5 4 6 4 5 1 5 4 6 4 5 1 5 4 6 4 5 1 5 4 6 4];
373 for ite = 1:10
374 assert (padarray (in, [ite ite], "reflect"), padded((11-ite):(14+ite),(11-ite):(14+ite)));
375 assert (padarray (in, [ite ite], "reflect", "pre"), padded((11-ite):14,(11-ite):14));
376 assert (padarray (in, [ite ite], "reflect", "post"), padded(11:(14+ite),11:(14+ite)));
377 endfor
378 26 tests, 26 passed, 0 known failure, 0 skipped
379 [lab2uint8]
380 >>>>> /usr/share/octave/packages/image-2.6.1/lab2uint8.m
381 ***** test
382 cm_uint8 = uint8 ([0 1 2 3 4 127 128 200 254 255]);
383 cm_uint8 = repmat (cm_uint8(:), [1 3]);
384 im2d_uint8 = reshape (cm_uint8, [5 2 3]);
385 imnd_uint8 = permute (im2d_uint8, [1 4 3 2]);
386
387 cm_uint16 = uint16 ([0 256 512 768 1024 32512 32768 51200 65024 65280]);
388 cm_uint16 = repmat (cm_uint16(:), [1 3]);
389 assert (lab2uint16 (cm_uint8), cm_uint16)
390 im2d_uint16 = reshape (cm_uint16, [5 2 3]);
391 assert (lab2uint16 (im2d_uint8), im2d_uint16)
392 assert (lab2uint16 (imnd_uint8), permute (im2d_uint16, [1 4 3 2]))
393
394 l1 = 100/255;
395 cm = [
396 0 -128 -128
397 l1 -127 -127
398 2*l1 -126 -126
399 3*l1 -125 -125
400 4*l1 -124 -124
401 127*l1 -1 -1
402 128*l1 0 0
403 200*l1 72 72
404 254*l1 126 126
405 100 127 127];
406 im2d = reshape (cm, [5 2 3]);
407 imnd = permute (im2d, [1 4 3 2]);
408
409 assert (lab2double (cm_uint8), cm)
410 assert (lab2double (im2d_uint8), im2d)
411 assert (lab2double (imnd_uint8), imnd)
412
413 assert (lab2single (cm_uint8), single (cm))
414 assert (lab2single (im2d_uint8), single (im2d))
415 assert (lab2single (imnd_uint8), single (imnd))
416 1 test, 1 passed, 0 known failure, 0 skipped
417 [imabsdiff]
418 >>>>> /usr/share/octave/packages/image-2.6.1/imabsdiff.m
419 ***** assert (imabsdiff (uint8 ([23 250]), uint8 ([26 50])), uint8 ([ 3 200])); # default to first class and abs works
420 ***** assert (imabsdiff (uint8 ([23 250]), uint8 ([24 50]), "uint16"), uint16 ([ 1 200])); # defining output class works (not in matlab)
421 ***** assert (imabsdiff (uint8 ([23 250]), uint8 ([24 255]), "int8"), int8 ([ 1 5])); # signed integers kinda work (not in matlab)
422 ***** assert (imabsdiff (logical ([ 1 0]), logical ([ 1 1])), double ([ 0 1])); # return double for two logical images
423 ***** fail ("imabsdiff (uint8 ([23 250]), 30"); # fails subtracting a scalar
424 ***** fail ("imabsdiff (uint8 ([23 250]), uint16 ([23 250]))"); # input need to have same class
425 6 tests, 6 passed, 0 known failure, 0 skipped
426 [imcast]
427 >>>>> /usr/share/octave/packages/image-2.6.1/imcast.m
428 ***** test
429 im = randi ([0 255], 40, "uint8");
430 assert (imcast (im, "uint8"), im2uint8 (im))
431 assert (imcast (im, "uint16"), im2uint16 (im))
432 assert (imcast (im, "single"), im2single (im))
433 assert (imcast (im, "uint8", "indexed"), im2uint8 (im, "indexed"))
434 assert (imcast (im, "uint16", "indexed"), im2uint16 (im, "indexed"))
435 assert (imcast (im, "single", "indexed"), im2single (im, "indexed"))
436 ***** test
437 im = randi ([1 256], 40, "double");
438 assert (imcast (im, "uint8"), im2uint8 (im))
439 assert (imcast (im, "uint8", "indexed"), im2uint8 (im, "indexed"))
440 assert (imcast (im, "single", "indexed"), im2single (im, "indexed"))
441 ***** test
442 im = randi ([0 65535], 40, "uint16");
443 assert (imcast (im, "uint8"), im2uint8 (im))
444 assert (imcast (im, "single"), im2single (im))
445 assert (imcast (im, "single", "indexed"), im2single (im, "indexed"))
446 ***** test
447 im = randi ([1 255], 40, "double");
448 assert (imcast (im, "uint8", "indexed"), im2uint8 (im, "indexed"))
449 assert (imcast (im, "single", "indexed"), im2single (im, "indexed"))
450 ***** test
451 im = rand (40);
452 assert (imcast (im, "uint8"), im2uint8 (im))
453 ***** error <unknown image of class> imcast (randi (127, 40, "int8"), "uint8")
454 ***** error <unsupported TYPE> imcast (randi (255, 40, "uint8"), "uint32")
455 ***** error <unsupported TYPE> imcast (randi (255, 40, "uint8"), "not a class")
456 ***** error <range of values> imcast (randi ([0 65535], 40, "uint16"), "uint8", "indexed")
457 9 tests, 9 passed, 0 known failure, 0 skipped
458 [label2rgb]
459 >>>>> /usr/share/octave/packages/image-2.6.1/label2rgb.m
460 ***** function map = test_colormap ()
461 map = [0 0 0; 0.5 0.5 0.5; 0.125 0.125 0.125];
462 ***** endfunction
463 ***** shared in, out, cmap
464 in = [ 0 1 1 0 2 2 0 3 3
465 0 1 1 0 2 2 0 3 3];
466
467 out = [255 0 0 255 128 128 255 32 32
468 255 0 0 255 128 128 255 32 32];
469 out(:,:,2) = out(:,:,3) = out(:,:,1);
470 out = uint8(out);
471
472 cmap = [0 0 0; 0.5 0.5 0.5; 0.125 0.125 0.125];
473 ***** assert (label2rgb (in, cmap), out);
474 ***** assert (label2rgb (uint8 (in), cmap), out);
475 ***** assert (label2rgb (in, "test_colormap"), out);
476 ***** assert (label2rgb (in, @test_colormap), out);
477
478 out(find (in == 0)) = 0;
479 ***** assert (label2rgb (in, cmap, "cyan"), out);
480 ***** assert (label2rgb (in, cmap, [0 1 1]), out);
481
482 in(1) = 10;
483 ***** error label2rgb (in, cmap);
484 ***** error label2rgb (in, cmap, 89);
485 ***** error label2rgb (in, cmap, "g", "wrong");
486 9 tests, 9 passed, 0 known failure, 0 skipped
487 [lab2rgb]
488 >>>>> /usr/share/octave/packages/image-2.6.1/lab2rgb.m
489 ***** assert (lab2rgb ([0 0 0]), [0, 0, 0], 1e-3)
490 ***** assert (lab2rgb ([53.24, 80.09, 67.20]), [1 0 0], 1e-3)
491 ***** assert (lab2rgb ([97.14, -21.55, 94.48]), [1 1 0], 1e-3)
492 ***** assert (lab2rgb ([87.74, -86.18, 83.18]), [0 1 0], 1e-3)
493 ***** assert (lab2rgb ([91.11, -48.09, -14.13]), [0 1 1], 1e-3)
494 ***** assert (lab2rgb ([32.30, 79.19, -107.86]), [0 0 1], 1e-3)
495 ***** assert (lab2rgb ([60.32, 98.24, -60.83]), [1 0 1], 1e-3)
496 ***** assert (lab2rgb ([100, 0.00, 0.00]), [1 1 1], 1e-3)
497 ***** assert (lab2rgb ([53.39, 0.00, 0.00]), [0.5 0.5 0.5], 1e-3)
498 ***** assert (lab2rgb ([39.77, 64.51, 54.13]), [0.75 0 0], 1e-3)
499 ***** assert (lab2rgb ([25.42, 47.91, 37.91]), [0.5 0 0], 1e-3)
500 ***** assert (lab2rgb ([9.66, 29.68, 15.24]), [0.25 0 0], 1e-3)
501 ***** assert (lab2rgb ([68.11, 48.39, 22.83]), [1 0.5 0.5], 1e-3)
502 ***** assert (lab2rgb ([150 130 130]), [2.714, 1.028, 0.492], 1e-3)
503 ***** test
504 lab_map = rand (64, 3);
505 lab_map(:,1) = lab_map(:,1) .* 100;
506 lab_map(:,2) = lab_map(:,2) .* 254 - 127;
507 lab_map(:,3) = lab_map(:,3) .* 254 - 127;
508 assert (rgb2lab (lab2rgb (lab_map)), lab_map, 5e-3);
509 ***** test
510 lab_img = rand (64, 64, 3);
511 lab_img(:,:,1) = lab_img(:,:,1) .* 100;
512 lab_img(:,:,2) = lab_img(:,:,2) .* 254 - 127;
513 lab_img(:,:,3) = lab_img(:,:,3) .* 254 - 127;
514 assert (rgb2lab (lab2rgb (lab_img)), lab_img, 5e-3);
515 ***** assert (lab2rgb (sparse ([0 0 0])), [0 0 0], 1e-3)
516 ***** assert (lab2rgb (sparse ([100, 0.00, 0.00])), [1 1 1], 1e-3)
517 ***** assert (class (lab2rgb (single([50 50 50]))), 'single')
518 ***** error lab2rgb ()
519 ***** error lab2rgb (1,2)
520 ***** error <invalid data type 'cell'> lab2rgb ({1})
521 ***** error <Lab must be a colormap or Lab image> lab2rgb (ones (2,2))
522 ***** test
523 lab = rand (16, 16, 3, 5);
524 lab(:,:,1,:) = lab(:,:,1,:) .* 100;
525 lab(:,:,2,:) = lab(:,:,2,:) .* 254 - 127;
526 lab(:,:,3,:) = lab(:,:,3,:) .* 254 - 127;
527 rgb = zeros (size (lab));
528 for i = 1:5
529 rgb(:,:,:,i) = lab2rgb (lab(:,:,:,i));
530 endfor
531 assert (lab2rgb (lab), rgb)
532 24 tests, 24 passed, 0 known failure, 0 skipped
533 [imnoise]
534 >>>>> /usr/share/octave/packages/image-2.6.1/imnoise.m
535 ***** assert(var(imnoise(ones(10)/2,'gaussian')(:)),0.01,0.005) # probabilistic
536 ***** assert(length(find(imnoise(ones(10)/2,'salt & pepper')~=0.5)),5,10) # probabilistic
537 ***** assert(var(imnoise(ones(10)/2,'speckle')(:)),0.01,0.005) # probabilistic
538 ***** test
539 A = imnoise (.5 * ones (100), 'poisson');
540 assert (class (A), 'double')
541 ***** test
542 A = imnoise (.5 * ones (100, 'single'), 'poisson');
543 assert (class (A), 'single')
544 ***** test
545 A = imnoise (128 * ones (100, 'uint8'), 'poisson');
546 assert (class (A), 'uint8')
547 ***** test
548 A = imnoise (256 * ones (100, 'uint16'), 'poisson');
549 assert (class (A), 'uint16')
550 ***** demo
551 A = imnoise (2^7 * ones (100, 'uint8'), 'poisson');
552 subplot (2, 2, 1)
553 imshow (A)
554 title ('uint8 image with poisson noise')
555 A = imnoise (2^15 * ones (100, 'uint16'), 'poisson');
556 subplot (2, 2, 2)
557 imshow (A)
558 title ('uint16 image with poisson noise')
559 A = imnoise (.5 * ones (100), 'poisson');
560 subplot (2, 2, 3)
561 imshow (A)
562 title ('double image with poisson noise')
563 A = imnoise (.5 * ones (100, 'single'), 'poisson');
564 subplot (2, 2, 4)
565 imshow (A)
566 title ('single image with poisson noise')
567 7 tests, 7 passed, 0 known failure, 0 skipped
568 [imtranslate]
569 >>>>> /usr/share/octave/packages/image-2.6.1/imtranslate.m
570 ***** test
571 obs = imtranslate (ones (5, 5), 2, 1, "crop");
572 exp = zeros (5, 5);
573 exp(1:4, 3:5) = 1;
574 assert (obs, exp, eps * 10)
575
576 obs = imtranslate (ones (5, 5), -2, -1, "crop");
577 exp = zeros (5, 5);
578 exp(2:5, 1:3) = 1;
579 assert (obs, exp, eps * 10)
580 1 test, 1 passed, 0 known failure, 0 skipped
581 [rgb2lab]
582 >>>>> /usr/share/octave/packages/image-2.6.1/rgb2lab.m
583 ***** assert (rgb2lab ([0 0 0]), [0, 0, 0], 1e-2)
584 ***** assert (rgb2lab ([1 0 0]), [53.24, 80.09, 67.20], 1e-2)
585 ***** assert (rgb2lab ([1 1 0]), [97.14, -21.55, 94.48], 1e-2)
586 ***** assert (rgb2lab ([0 1 0]), [87.74, -86.18, 83.18], 1e-2)
587 ***** assert (rgb2lab ([0 1 1]), [91.11, -48.09, -14.13], 1e-2)
588 ***** assert (rgb2lab ([0 0 1]), [32.30, 79.19, -107.86], 1e-2)
589 ***** assert (rgb2lab ([1 0 1]), [60.32, 98.24, -60.83], 1e-2)
590 ***** assert (rgb2lab ([1 1 1]), [100, 0.00, 0.00], 1e-2)
591 ***** assert (rgb2lab ([0.5 0.5 0.5]), [53.39, 0.00, 0.00], 1e-2)
592 ***** assert (rgb2lab ([0.75 0 0]), [39.77, 64.51, 54.13], 1e-2)
593 ***** assert (rgb2lab ([0.5 0 0]), [25.42, 47.91, 37.91], 1e-2)
594 ***** assert (rgb2lab ([0.25 0 0]), [9.66, 29.68, 15.24], 1e-2)
595 ***** assert (rgb2lab ([1 0.5 0.5]), [68.11, 48.39, 22.83], 1e-2)
596 ***** assert (rgb2lab ([1.5 1 1]), [111.47, 43.42, 17.98], 1e-2)
597 ***** test
598 rgb_map = rand (64, 3);
599 assert (lab2rgb (rgb2lab (rgb_map)), rgb_map, 2e-5);
600 ***** test
601 rgb_img = rand (64, 64, 3);
602 assert (lab2rgb (rgb2lab (rgb_img)), rgb_img, 2e-5);
603 ***** assert (rgb2lab (sparse ([0 0 1])), sparse ([32.30, 79.19, -107.86]), 1e-2)
604 ***** assert (rgb2lab (sparse ([0 1 1])), sparse ([91.11, -48.09, -14.13]), 1e-2)
605 ***** assert (rgb2lab (sparse ([1 1 1])), sparse ([100, 0.00, 0.00]), 1e-2)
606 ***** assert (rgb2lab (uint8([255 255 255])), [100, 0.00, 0.00], 1e-2)
607 ***** assert (class (rgb2lab (single([1 1 1]))), 'single')
608 ***** error rgb2lab ()
609 ***** error rgb2lab (1,2)
610 ***** error <invalid data type 'cell'> rgb2lab ({1})
611 ***** error <RGB must be a colormap or RGB image> rgb2lab (ones (2,2))
612 ***** test
613 rgb = rand (16, 16, 3, 5);
614 lab = zeros (size (rgb));
615 for i = 1:5
616 lab(:,:,:,i) = rgb2lab (rgb(:,:,:,i));
617 endfor
618 assert (rgb2lab (rgb), lab)
619 26 tests, 26 passed, 0 known failure, 0 skipped
620 [imregionalmin]
621 >>>>> /usr/share/octave/packages/image-2.6.1/imregionalmin.m
622 ***** test
623 a = [
624 7 3 9 3 10 3
625 4 2 3 10 1 3
626 1 4 6 9 4 10
627 8 7 9 3 4 8
628 5 9 3 3 8 9
629 3 6 9 4 1 10];
630
631 a4 = logical ([
632 0 0 0 1 0 0
633 0 1 0 0 1 0
634 1 0 0 0 0 0
635 0 0 0 1 0 0
636 0 0 1 1 0 0
637 1 0 0 0 1 0]);
638 assert (imregionalmin (a, 4), a4)
639 assert (imregionalmin (uint8 (a), 4), a4)
640 assert (imregionalmin (int8 (a), 4), a4)
641
642 a8 = logical ([
643 0 0 0 0 0 0
644 0 0 0 0 1 0
645 1 0 0 0 0 0
646 0 0 0 0 0 0
647 0 0 0 0 0 0
648 1 0 0 0 1 0]);
649 assert (imregionalmin (a), a8)
650 assert (imregionalmin (a, 8), a8)
651 assert (imregionalmin (uint8 (a), 8), a8)
652 assert (imregionalmin (int8 (a), 8), a8)
653 ***** test
654 a = [
655 4 8 5 -1 8 7
656 -1 4 0 7 1 1
657 6 1 2 6 7 0
658 6 1 5 -2 5 9
659 1 4 -1 0 0 2
660 4 6 1 0 7 1];
661
662 a4 = logical ([
663 0 0 0 1 0 0
664 1 0 1 0 0 0
665 0 1 0 0 0 1
666 0 1 0 1 0 0
667 1 0 1 0 0 0
668 0 0 0 0 0 1]);
669 assert (imregionalmin (a, 4), a4)
670 assert (imregionalmin (int8 (a), 4), a4)
671
672 a8 = logical ([
673 0 0 0 1 0 0
674 1 0 0 0 0 0
675 0 0 0 0 0 1
676 0 0 0 1 0 0
677 0 0 0 0 0 0
678 0 0 0 0 0 0]);
679 assert (imregionalmin (a), a8)
680 assert (imregionalmin (a, 8), a8)
681 assert (imregionalmin (int8 (a), 8), a8)
682 2 tests, 2 passed, 0 known failure, 0 skipped
683 [xyz2rgb]
684 >>>>> /usr/share/octave/packages/image-2.6.1/xyz2rgb.m
685 ***** assert (xyz2rgb ([0, 0, 0]), [0 0 0], 1e-3)
686 ***** assert (xyz2rgb ([0.4125, 0.2127, 0.0193]), [1 0 0], 1e-3)
687 ***** assert (xyz2rgb ([0.7700, 0.9278, 0.1385]), [1 1 0], 1e-3)
688 ***** assert (xyz2rgb ([0.3576, 0.7152, 0.1192]), [0 1 0], 1e-3)
689 ***** assert (xyz2rgb ([0.5380, 0.7873, 1.0694]), [0 1 1], 1e-3)
690 ***** assert (xyz2rgb ([0.1804, 0.07217, 0.9502]), [0 0 1], 1e-3)
691 ***** assert (xyz2rgb ([0.5929, 0.28484, 0.9696]), [1 0 1], 1e-3)
692 ***** assert (xyz2rgb ([0.9505, 1.0000, 1.0888]), [1 1 1], 1e-3)
693 ***** assert (xyz2rgb ([0.2034, 0.2140, 0.2330]), [0.5 0.5 0.5], 1e-3)
694 ***** assert (xyz2rgb ([0.2155, 0.1111, 0.0101]), [0.75 0 0], 1e-3)
695 ***** assert (xyz2rgb ([0.0883, 0.0455, 0.0041]), [0.5 0 0], 1e-3)
696 ***** assert (xyz2rgb ([0.0210, 0.0108, 0.0010]), [0.25 0 0], 1e-3)
697 ***** assert (xyz2rgb ([0.5276, 0.3812, 0.2482]), [1 0.5 0.5], 1e-3)
698 ***** assert (xyz2rgb ([1.5 1 1]), [1.5712, 0.7109 0.9717], 1e-3)
699 ***** test
700 xyz_map = rand (64, 3);
701 assert (rgb2xyz (xyz2rgb (xyz_map)), xyz_map, 3e-4);
702 ***** test
703 xyz_img = rand (64, 64, 3);
704 assert (rgb2xyz (xyz2rgb (xyz_img)), xyz_img, 3e-4);
705 ***** assert (xyz2rgb (sparse ([0 0 0])), [0 0 0], 1e-3)
706 ***** assert (class (xyz2rgb (single([0.5 0.5 0.5]))), 'single')
707 ***** error xyz2rgb ()
708 ***** error xyz2rgb (1,2)
709 ***** error <invalid data type 'cell'> xyz2rgb ({1})
710 ***** error <XYZ must be a colormap or XYZ image> xyz2rgb (ones (2,2))
711 ***** test
712 xyz = rand (16, 16, 3, 5);
713 rgb = zeros (size (xyz));
714 for i = 1:5
715 rgb(:,:,:,i) = xyz2rgb (xyz(:,:,:,i));
716 endfor
717 assert (xyz2rgb (xyz), rgb)
718 23 tests, 23 passed, 0 known failure, 0 skipped
719 [graythresh]
720 >>>>> /usr/share/octave/packages/image-2.6.1/graythresh.m
721 ***** shared img, histo
722 ## this is the old default.img that came with GNU Octave. While the current
723 ## is very very similar, is off just enough for us to get precision errors
724 img = uint8 (reshape ([138 138 138 142 142 138 142 138 138 117 105 81 69 61 53 40 49 45 40 36 40 45 53 49 65 73 121 166 210 243 247 247 247 239 235 178 154 170 150 150 162 174 190 190 194 186 178 170 154 182 198 174 117 138 138 142 138 142 142 146 142 138 138 130 109 97 81 73 69 57 53 53 57 61 61 69 73 77 105 121 158 219 243 243 247 243 243 243 206 150 158 158 158 150 158 182 186 190 194 186 174 190 206 198 162 138 142 138 142 146 138 142 142 138 146 142 134 142 130 121 101 97 85 85 81 81 81 85 93 85 73 57 61 93 150 194 215 239 243 243 243 223 166 138 158 158 154 142 162 178 190 190 198 186 182 186 174 162 182 146 142 138 142 142 146 142 146 146 146 146 142 142 142 134 125 101 85 73 65 69 73 73 57 40 53 49 57 69 85 125 166 182 178 178 174 150 130 121 146 146 150 142 166 182 190 182 174 166 162 170 194 198 138 138 146 146 138 146 146 146 146 142 150 146 146 142 130 93 65 45 45 49 45 40 49 40 49 49 49 49 61 81 113 142 150 154 154 146 142 134 125 125 138 134 125 146 162 178 178 178 166 186 202 206 186 142 142 142 134 142 146 142 150 142 146 142 146 146 130 81 53 49 49 45 49 40 36 36 32 36 36 36 53 73 89 125 150 146 134 138 146 138 146 138 142 117 117 113 117 146 166 174 178 182 178 178 170 146 142 142 138 142 146 142 142 146 150 138 146 142 130 73 49 40 49 57 65 69 73 61 61 53 57 53 61 77 77 97 113 138 134 130 138 142 150 146 150 134 138 121 121 101 121 150 158 154 142 150 162 166 178 138 138 146 142 142 142 142 146 146 142 142 130 73 57 49 36 49 65 77 85 89 85 81 81 81 85 93 93 97 105 117 125 150 158 154 162 162 166 154 134 150 130 125 113 138 182 174 154 130 178 227 239 239 134 138 142 138 142 142 146 146 138 150 125 61 49 32 32 45 49 57 65 85 101 105 101 101 109 125 117 113 109 138 134 125 166 178 170 162 150 170 162 170 150 146 150 138 125 162 186 182 142 206 247 247 243 138 138 138 138 142 142 146 146 146 130 85 45 45 36 40 53 45 57 69 97 125 130 130 134 138 146 142 134 142 158 138 117 146 174 170 174 178 170 174 170 166 154 162 158 130 134 170 178 158 190 243 247 247 142 142 142 142 142 146 146 142 138 89 53 45 40 45 45 49 57 77 93 125 138 150 154 158 158 162 154 150 166 174 142 73 125 174 178 174 182 182 178 178 174 166 174 174 162 125 154 170 174 170 227 247 251 142 138 142 142 142 142 142 138 105 61 40 40 32 40 40 49 61 89 117 146 154 158 162 170 170 174 162 166 174 182 150 65 146 166 174 186 198 198 198 190 178 178 174 174 158 134 154 198 194 174 202 251 251 146 142 142 142 146 150 138 134 69 40 40 36 32 40 45 45 65 101 134 150 158 166 174 178 174 174 174 170 170 174 142 73 150 162 178 194 202 202 194 194 178 178 154 134 125 138 154 198 194 186 190 243 251 150 146 146 146 146 150 130 109 53 45 28 40 40 36 32 49 73 101 130 154 162 170 170 170 178 182 178 178 174 158 142 121 146 158 178 174 186 190 186 186 174 146 105 109 113 130 150 178 202 190 186 243 251 146 146 146 146 150 142 109 73 49 40 32 40 40 45 40 53 69 93 130 154 162 170 174 178 182 182 186 182 178 154 146 130 138 142 150 170 182 178 174 166 150 117 97 105 113 130 150 150 174 182 190 243 251 146 146 154 146 150 134 105 53 40 45 45 40 40 36 36 40 69 105 134 162 170 174 178 182 182 182 186 190 186 178 170 158 154 150 162 182 182 174 174 174 150 113 109 113 113 130 150 162 186 186 190 239 251 154 150 146 150 146 125 77 49 36 40 36 40 36 28 40 36 77 113 138 150 170 170 174 186 190 190 190 194 190 186 194 190 170 162 174 194 174 182 170 170 158 121 113 113 113 146 158 170 210 215 215 206 243 150 146 150 150 150 113 57 49 40 45 45 49 49 40 32 45 85 113 142 170 178 174 182 194 190 194 194 198 198 198 210 210 182 162 170 190 182 186 170 170 162 130 121 113 121 146 154 150 198 215 206 210 215 150 150 150 150 150 105 49 45 40 49 49 57 40 49 49 53 85 121 158 182 178 174 182 198 194 194 194 194 202 202 194 186 174 154 162 166 178 174 170 170 170 158 117 113 130 150 154 121 182 194 206 215 206 158 150 150 150 146 97 45 36 49 49 49 40 40 49 49 65 97 130 154 174 174 174 186 194 194 194 194 198 198 186 170 158 154 158 138 158 162 170 190 182 174 170 138 138 142 154 134 142 146 170 206 219 215 150 150 158 158 150 85 36 40 40 40 40 45 45 49 49 65 97 130 146 166 166 174 182 190 194 194 194 194 190 182 162 158 150 158 182 186 178 198 206 198 190 174 154 174 174 142 142 170 170 166 202 223 219 158 150 150 150 146 85 40 45 40 40 36 45 53 45 49 53 93 117 130 154 162 174 190 186 194 194 194 190 186 178 162 162 170 174 182 198 210 206 210 198 198 182 170 178 174 158 154 194 194 174 198 210 215 150 154 158 150 150 85 49 45 40 40 32 36 53 40 45 53 81 109 142 158 158 174 178 182 190 190 194 190 190 178 170 174 178 186 190 190 206 215 202 206 194 186 178 182 174 154 170 198 210 186 186 202 215 150 154 150 154 150 97 45 40 40 40 36 36 45 40 45 73 89 113 142 158 158 174 174 182 186 186 194 186 182 178 174 170 105 166 206 186 190 202 198 194 190 182 182 174 166 154 162 198 215 202 182 202 219 154 150 154 150 146 117 61 45 45 45 36 53 53 49 53 77 93 101 125 158 162 174 174 178 174 186 190 182 182 186 182 182 77 125 198 194 186 190 190 178 178 178 162 162 162 154 186 210 227 210 190 206 223 154 150 154 150 154 138 65 45 45 45 40 49 49 40 53 65 77 89 113 150 158 166 166 170 178 182 186 182 170 170 170 162 81 117 186 190 186 182 178 186 174 166 162 150 130 154 194 227 227 219 202 202 219 154 154 150 154 146 146 89 45 40 45 40 49 49 36 40 57 65 89 109 138 146 158 158 170 170 178 182 178 162 150 158 154 113 146 186 182 178 182 178 170 170 162 146 138 138 146 202 223 231 219 210 190 215 130 130 130 130 130 130 109 45 53 40 32 36 40 45 53 61 65 81 97 117 130 138 150 158 158 178 170 162 158 138 142 150 146 166 178 174 174 170 170 170 162 158 138 117 117 142 202 223 239 223 215 186 206 61 61 65 69 69 65 57 36 40 36 32 40 40 53 57 53 57 69 93 105 109 130 138 142 154 162 150 138 142 125 121 150 162 170 170 166 170 170 170 166 162 138 121 113 130 170 202 223 227 231 202 178 182 45 49 45 40 40 40 45 45 45 45 36 40 32 49 61 61 57 65 73 81 101 109 121 130 142 146 121 89 93 117 113 134 154 174 166 162 166 170 170 162 154 150 142 150 223 186 194 215 231 227 206 182 174 49 40 45 45 49 49 45 49 49 49 49 40 36 45 57 69 65 61 65 69 85 93 109 109 117 109 89 57 57 81 97 113 154 162 166 162 170 158 158 162 154 162 174 231 239 178 186 210 231 239 210 194 178 49 36 49 45 49 49 49 45 45 49 49 36 40 40 45 36 53 53 53 57 57 69 69 73 69 61 57 45 45 65 89 105 125 142 146 150 150 154 162 170 174 223 235 247 231 178 178 206 227 227 223 198 190 40 53 36 45 40 40 40 40 45 40 40 45 45 45 45 40 53 49 49 45 53 45 32 36 36 36 36 40 49 45 61 73 89 93 97 113 125 142 186 202 239 239 243 251 239 198 166 194 215 235 227 215 202 40 45 36 32 36 40 40 45 40 40 45 49 45 49 45 49 40 40 45 49 40 45 45 45 49 49 32 40 49 40 49 57 69 81 101 134 170 206 235 243 243 239 247 251 247 210 170 186 202 231 231 227 210 49 45 49 40 40 40 49 45 40 40 45 45 45 40 45 45 45 49 40 49 40 49 45 45 36 40 40 45 45 45 45 65 121 150 210 239 243 243 247 243 243 247 251 251 239 223 178 174 194 219 239 231 219 36 45 45 40 40 49 40 45 49 49 40 40 45 49 40 40 45 49 45 40 49 45 40 40 40 49 40 45 40 49 49 121 162 215 247 247 247 247 247 243 247 251 251 251 247 239 223 194 186 202 215 210 210 36 45 45 40 40 49 40 45 32 36 49 36 45 49 40 40 45 40 36 40 45 45 40 40 40 36 45 32 40 49 57 121 142 215 243 247 243 247 243 247 251 251 251 251 247 247 247 227 186 194 190 190 182 40 32 45 32 45 40 45 45 49 45 40 45 49 36 40 45 32 40 45 45 49 45 45 45 45 53 49 53 45 45 40 69 97 186 239 243 247 247 247 251 251 251 251 251 243 243 231 202 202 206 206 186 170 53 40 40 40 40 40 36 32 32 36 45 53 49 32 36 32 36 32 40 49 40 40 45 40 40 53 45 49 49 40 32 40 49 138 219 235 247 247 251 251 251 251 251 247 243 235 198 206 210 198 190 186 186 73 69 61 57 61 49 53 40 49 45 40 49 49 49 57 57 53 49 53 53 45 40 45 40 45 49 45 49 45 40 32 53 69 101 215 231 247 247 247 247 251 251 251 243 235 219 194 202 202 186 186 190 194], [53 40]));
725 ***** assert (graythresh (img, "percentile"), 142/255);
726 ***** assert (graythresh (img, "percentile", 0.5), 142/255);
727 ***** assert (graythresh (img, "moments"), 142/255);
728 ***** assert (graythresh (img, "minimum"), 93/255);
729 ***** assert (graythresh (img, "maxentropy"), 150/255);
730 ***** assert (graythresh (img, "intermodes"), 99/255);
731 ***** assert (graythresh (img, "otsu"), 115/255);
732 histo = hist (img(:), 0:255);
733 ***** assert (graythresh (histo, "otsu"), 115/255);
734 ***** assert (graythresh (img, "mean"), 0.51445615982, 0.000000001); # here our results differ from ImageJ
735 9 tests, 9 passed, 0 known failure, 0 skipped
736 [im2bw]
737 >>>>> /usr/share/octave/packages/image-2.6.1/im2bw.m
738 ***** assert(im2bw ([0 0.4 0.5 0.6 1], 0.5), logical([0 0 0 1 1])); # basic usage
739 ***** assert(im2bw (uint8 ([0 100 255]), 0.5), logical([0 0 1])); # with a uint8 input
740 ***** warning <is already binary so nothing is done> bw = im2bw (logical ([0 1 0]));
741 ***** warning <is already binary so nothing is done> bw = im2bw (logical ([0 1 0]), 1);
742 ***** test
743 warning ("off", "all", "local");
744 assert (im2bw (logical ([0 1 0])), logical ([0 1 0]))
745 assert (im2bw (logical ([0 1 0]), 0), logical ([0 1 0]))
746 assert (im2bw (logical ([0 1 0]), 1), logical ([0 1 0]))
747 ***** assert (nnz (im2bw (uint8 ([0:255]), 0.9)), 26)
748 ***** test
749 img = uint8 ([0:255]);
750 s = 0;
751 for i=0:.1:1
752 s += nnz (im2bw (img, i));
753 endfor
754 assert (s, 1405)
755 ***** assert (nnz (im2bw (int16 ([-128:127]), 0.499)), 194)
756 ***** assert (nnz (im2bw (int16 ([-128:127]), 0.500)), 128)
757 ***** assert (nnz (im2bw (int16 ([-128:127]), 0.501)), 62)
758 ***** test
759 img = uint16 ([0:intmax("uint16")]);
760 s = 0;
761 for i=0:.1:1
762 s += nnz (im2bw (img, i));
763 endfor
764 assert (s, 360445)
765 ***** test
766 img = int16 ([intmin("int16"):intmax("int16")]);
767 s = 0;
768 for i=0:.1:1
769 s += nnz (im2bw (img, i));
770 endfor
771 assert (s, 360445)
772 ***** test
773 im = [((randn(10)/10)+.3) ((randn(10)/10)+.7)];
774 assert (im2bw (im, "Otsu"), im2bw (im, graythresh (im(:), "Otsu")))
775 assert (im2bw (im, "moments"), im2bw (im, graythresh (im(:), "moments")))
776 !!!!! test failed
777 horizontal dimensions mismatch (1x1 vs 199x1)
778 ***** test
779 im = [((randn(10)/10)+.3) ((randn(10)/10)+.7)];
780 im = reshape (im, [10 10 1 2]);
781 assert (im2bw (im, "Otsu"), im2bw (im, graythresh (im(:), "Otsu")))
782 assert (im2bw (im, "moments"), im2bw (im, graythresh (im(:), "moments")))
783 !!!!! test failed
784 graythresh: input must be an image or an histogram.
785 14 tests, 12 passed, 0 known failure, 0 skipped
786 [cp2tform]
787 >>>>> /usr/share/octave/packages/image-2.6.1/cp2tform.m
788 ***** function [crw, cap] = coords (npt = 1000, scale = 2, dtheta = pi/3, dx = 2, dy = -6, sig2noise = 1e32)
789 theta = (rand(npt, 1)*2-1)*2*pi;
790 R = rand(npt,1);
791 y = R.*sin(theta);
792 x = R.*cos(theta);
793 crw = [y x];
794
795 thetap = theta + dtheta;
796 Rap = R * scale;
797
798 yap = Rap.*sin(thetap);
799 yap = yap + dy;
800 yap = yap + rand (size (yap)) * norm (yap) / sig2noise;
801
802 xap = Rap.*cos(thetap);
803 xap = xap + dx;
804 xap = xap + rand (size (xap)) * norm (xap) / sig2noise;
805 cap = [yap xap];
806 ***** endfunction
807 ***** test
808 npt = 100000;
809 [crw, cap] = coords (npt);
810 ttype = 'projective';
811 T = cp2tform (crw, cap, ttype);
812 crw2 = tforminv (T, cap);
813 finalerr = norm (crw - crw2)/npt;
814 assert (finalerr < eps, "norm = %3.2e ( > eps)", finalerr)
815 ***** test
816 npt = 100000;
817 [crw, cap] = coords (npt);
818 ttype = 'affine';
819 T = cp2tform (crw, cap, ttype);
820 crw2 = tforminv (T, cap);
821 finalerr = norm (crw - crw2)/npt;
822 assert (finalerr < eps, "norm = %3.2e ( > eps)", finalerr)
823 ***** test
824 npt = 100000;
825 [crw, cap] = coords (npt);
826 ttype = 'nonreflective similarity';
827 T = cp2tform (crw, cap, ttype);
828 crw2 = tforminv (T, cap);
829 finalerr = norm (crw - crw2)/npt;
830 assert (finalerr < eps, "norm = %3.2e ( > eps)", finalerr)
831 ***** test
832 npt = 100000;
833 [crw, cap] = coords (npt);
834 cap(:,2) *= -1; % reflection around y axis
835 ttype = 'similarity';
836 T = cp2tform (crw, cap, ttype);
837 crw2 = tforminv (T, cap);
838 finalerr = norm (crw - crw2)/npt;
839 assert (finalerr < eps, "norm = %3.2e ( > eps)", finalerr)
840 ***** xtest
841 npt = 100000;
842 [crw, cap] = coords (npt);
843 ttype = 'polynomial';
844 ord = 2;
845 T = cp2tform (crw, cap, ttype, ord);
846 crw2 = tforminv (T, cap);
847 finalerr = norm (crw - crw2)/npt;
848 assert (finalerr < eps, "norm = %3.2e ( > eps)", finalerr)
849 ***** xtest
850 npt = 100000;
851 [crw, cap] = coords (npt);
852 ttype = 'polynomial';
853 ord = 3;
854 T = cp2tform (crw, cap, ttype, ord);
855 crw2 = tforminv (T, cap);
856 finalerr = norm (crw - crw2)/npt;
857 assert (finalerr < eps, "norm = %3.2e ( > eps)", finalerr)
858 ***** xtest
859 npt = 100000;
860 [crw, cap] = coords (npt);
861 ttype = 'polynomial';
862 ord = 4;
863 T = cp2tform (crw, cap, ttype, ord);
864 crw2 = tforminv (T, cap);
865 finalerr = norm (crw - crw2)/npt;
866 assert (finalerr < eps, "norm = %3.2e ( > eps)", finalerr)
867 !!!!! known failure
868 norm = 7.52e-16 ( > eps)
869 7 tests, 6 passed, 1 known failure, 0 skipped
870 [getrangefromclass]
871 >>>>> /usr/share/octave/packages/image-2.6.1/getrangefromclass.m
872 ***** shared img
873 img = ones (5);
874 ***** assert (getrangefromclass (double (img)), [0 1]); # double returns [0 1]
875 ***** assert (getrangefromclass (single (img)), [0 1]); # single returns [0 1]
876 ***** assert (getrangefromclass (logical (img)), [0 1]); # logical returns [0 1]
877 ***** assert (getrangefromclass (int8 (img)), [-128 127]); # checks int
878 ***** assert (getrangefromclass (uint8 (img)), [0 255]); # checks unit
879 ***** fail ("getrangefromclass ('string')"); # fails with strings
880 ***** fail ("getrangefromclass ({3, 4})"); # fails with cells
881 7 tests, 7 passed, 0 known failure, 0 skipped
882 [qtgetblk]
883 >>>>> /usr/share/octave/packages/image-2.6.1/qtgetblk.m
884 ***** demo
885 [vals,r,c]=qtgetblk(eye(4),qtdecomp(eye(4)),2)
886 % Returns 2 blocks, at [1,3] and [3,1] (2*2 zeros blocks)
887 ***** shared A,S
888 A=[ 1, 4, 2, 5,54,55,61,62;
889 3, 6, 3, 1,58,53,67,65;
890 3, 6, 3, 1,58,53,67,65;
891 3, 6, 3, 1,58,53,67,65;
892 23,42,42,42,99,99,99,99;
893 27,42,42,42,99,99,99,99;
894 23,22,26,25,99,99,99,99;
895 22,22,24,22,99,99,99,99];
896 S=qtdecomp(A,10);
897 ***** test
898 [va]=qtgetblk(A,S,8);
899 [vb,r,c]=qtgetblk(A,S,8);
900 [vc,i]=qtgetblk(A,S,8);
901 assert(va, vb);
902 assert(va, vc);
903 assert(i,[]);
904 assert(r,[]);
905 assert(c,[]);
906 R=[];
907 assert(va,R);
908 ***** test
909 [va]=qtgetblk(A,S,4);
910 [vb,r,c]=qtgetblk(A,S,4);
911 [vc,i]=qtgetblk(A,S,4);
912 assert(va, vb);
913 assert(va, vc);
914 assert(i, find(full(S)==4));
915 assert(r,[1;5]);
916 assert(c,[1;5]);
917 R=zeros(4,4,2);
918 R(:,:,1)=A(1:4,1:4);
919 R(:,:,2)=A(5:8,5:8);
920 assert(va,R);
921 ***** test
922 [va]=qtgetblk(A,S,2);
923 [vb,r,c]=qtgetblk(A,S,2);
924 [vc,i]=qtgetblk(A,S,2);
925 assert(va, vb);
926 assert(va, vc);
927 assert(i, find(full(S)==2));
928 assert(r,[7;5;7;1;3;1;3]);
929 assert(c,[1;3;3;5;5;7;7]);
930 R=zeros(2,2,7);
931 R(:,:,1)=A(7:8,1:2);
932 R(:,:,2)=A(5:6,3:4);
933 R(:,:,3)=A(7:8,3:4);
934 R(:,:,4)=A(1:2,5:6);
935 R(:,:,5)=A(3:4,5:6);
936 R(:,:,6)=A(1:2,7:8);
937 R(:,:,7)=A(3:4,7:8);
938 assert(va,R);
939 3 tests, 3 passed, 0 known failure, 0 skipped
940 [bwperim]
941 >>>>> /usr/share/octave/packages/image-2.6.1/bwperim.m
942 ***** test
943 in = [ 1 1 1 1 0 1 1 0 1 1
944 1 1 0 1 1 1 1 1 1 0
945 1 1 1 0 1 1 1 1 1 1
946 1 1 1 1 0 1 1 1 0 1
947 1 1 1 0 1 1 1 1 1 0
948 1 1 1 1 1 1 0 1 0 1
949 1 1 1 1 1 1 1 1 1 0
950 1 1 1 1 1 1 1 1 1 1
951 1 1 1 1 1 1 0 0 1 1
952 1 1 1 1 0 1 0 1 1 0];
953
954 out = [1 1 1 1 0 1 1 0 1 1
955 1 1 0 1 1 0 0 1 1 0
956 1 0 1 0 1 0 0 0 1 1
957 1 0 0 1 0 1 0 1 0 1
958 1 0 1 0 1 0 1 0 1 0
959 1 0 0 1 0 1 0 1 0 1
960 1 0 0 0 0 0 1 0 1 0
961 1 0 0 0 0 0 1 1 0 1
962 1 0 0 0 1 1 0 0 1 1
963 1 1 1 1 0 1 0 1 1 0];
964 assert (bwperim (in), logical (out))
965 assert (bwperim (in, 4), logical (out))
966
967 out = [1 1 1 1 0 1 1 0 1 1
968 1 1 0 1 1 1 1 1 1 0
969 1 1 1 0 1 1 0 1 1 1
970 1 0 1 1 0 1 0 1 0 1
971 1 0 1 0 1 1 1 1 1 0
972 1 0 1 1 1 1 0 1 0 1
973 1 0 0 0 0 1 1 1 1 0
974 1 0 0 0 0 1 1 1 1 1
975 1 0 0 1 1 1 0 0 1 1
976 1 1 1 1 0 1 0 1 1 0];
977 assert (bwperim (in, 8), logical (out))
978
979 out = [1 1 1 1 0 1 1 0 1 1
980 1 0 0 0 0 1 0 0 1 0
981 1 0 0 0 0 0 0 1 0 1
982 1 0 1 0 0 0 0 0 0 1
983 1 0 0 0 0 1 0 1 0 0
984 1 0 0 0 1 0 0 0 0 1
985 1 0 0 0 0 0 0 1 0 0
986 1 0 0 0 0 1 1 0 0 1
987 1 0 0 1 0 1 0 0 1 1
988 1 1 1 1 0 1 0 1 1 0];
989 assert (bwperim (in, [1 0 0; 0 1 0; 0 0 1]), logical (out))
990 ***** test
991 in = [ 0 0 0 0 0 0 0
992 0 0 5 0 0 1 9
993 0 Inf 9 7 0 0 0
994 0 1.5 5 7 1 0 0
995 0 0.5 -1 89 i 0 0
996 0 4 10 15 1 0 0
997 0 0 0 0 0 0 0];
998 out = [0 0 0 0 0 0 0
999 0 0 1 0 0 1 1
1000 0 1 0 1 0 0 0
1001 0 1 0 0 1 0 0
1002 0 1 0 0 1 0 0
1003 0 1 1 1 1 0 0
1004 0 0 0 0 0 0 0];
1005 assert (bwperim (in), logical (out))
1006 ***** test
1007 in = reshape (magic(16), [8 8 4]) > 50;
1008 out(:,:,1) = [
1009 1 1 0 1 0 1 1 1
1010 0 1 1 1 1 1 0 1
1011 0 1 1 1 1 1 0 1
1012 1 1 0 1 1 1 1 1
1013 1 1 1 1 1 1 1 1
1014 1 1 1 0 1 0 1 1
1015 1 1 1 0 1 0 1 1
1016 1 0 1 1 1 1 1 0];
1017 out(:,:,2) = [
1018 1 1 0 1 0 1 1 1
1019 0 1 1 0 1 1 0 1
1020 0 1 0 0 0 1 0 1
1021 1 0 1 0 0 0 1 1
1022 1 0 0 1 0 1 0 1
1023 1 0 1 0 1 0 1 1
1024 1 1 1 0 1 0 1 1
1025 1 0 1 1 1 1 1 0];
1026 out(:,:,3) = [
1027 1 1 0 1 0 1 1 1
1028 0 1 1 0 1 1 0 1
1029 0 1 0 0 0 1 0 1
1030 1 0 0 0 0 0 1 1
1031 1 0 0 1 0 1 0 1
1032 1 0 1 0 1 0 1 1
1033 1 1 1 0 1 0 1 1
1034 1 0 1 1 1 1 1 0];
1035 out(:,:,4) = [
1036 1 1 0 1 0 1 1 1
1037 0 1 1 1 1 1 0 1
1038 0 1 1 1 1 1 0 1
1039 1 1 1 1 1 1 1 1
1040 1 1 1 1 1 1 1 0
1041 1 1 1 0 1 0 1 1
1042 1 1 1 0 1 0 1 1
1043 1 0 1 1 1 1 1 0];
1044 assert (bwperim (in), logical (out))
1045
1046 out(:,:,1) = [
1047 1 1 0 1 0 1 1 1
1048 0 1 1 1 1 1 0 1
1049 0 1 1 1 1 1 0 1
1050 1 1 0 1 1 1 1 1
1051 1 1 1 1 1 1 1 1
1052 1 1 1 0 1 0 1 1
1053 1 1 1 0 1 0 1 1
1054 1 0 1 1 1 1 1 0];
1055 out(:,:,2) = [
1056 1 1 0 1 0 1 1 1
1057 0 1 1 1 1 1 0 1
1058 0 1 1 0 0 1 0 1
1059 1 1 1 1 0 1 1 1
1060 1 0 1 1 1 1 1 1
1061 1 0 1 0 1 0 1 1
1062 1 1 1 0 1 0 1 1
1063 1 0 1 1 1 1 1 0];
1064 out(:,:,3) = [
1065 1 1 0 1 0 1 1 1
1066 0 1 1 1 1 1 0 1
1067 0 1 0 0 0 1 0 1
1068 1 1 0 0 0 1 1 1
1069 1 0 1 1 1 1 1 1
1070 1 0 1 0 1 0 1 1
1071 1 1 1 0 1 0 1 1
1072 1 0 1 1 1 1 1 0];
1073 out(:,:,4) = [
1074 1 1 0 1 0 1 1 1
1075 0 1 1 1 1 1 0 1
1076 0 1 1 1 1 1 0 1
1077 1 1 1 1 1 1 1 1
1078 1 1 1 1 1 1 1 0
1079 1 1 1 0 1 0 1 1
1080 1 1 1 0 1 0 1 1
1081 1 0 1 1 1 1 1 0];
1082 assert (bwperim (in, 18), logical (out))
1083 ***** error bwperim ("text")
1084 ***** error bwperim (rand (10), 5)
1085 ***** error bwperim (rand (10), "text")
1086 ***** test
1087 a = false (5);
1088 a(1:4,2:4) = true;
1089
1090 p = false (5);
1091 p(1:4,[2 4]) = true;
1092 assert (bwperim (a, [0 0 0; 1 1 1; 0 0 0]), p)
1093 ***** test
1094 a = false (8, 8, 5);
1095 a(4:5,4:5,2:4) = true;
1096 a(2:7,2:7,3) = true;
1097 assert (bwperim (a, 26), a)
1098
1099 ## It is easy to forget that is correct
1100 b = a;
1101 b(4:5, 4:5, 3) = false;
1102 assert (bwperim (a), b)
1103
1104 c = a;
1105 c(3:6,3:6,3) = false;
1106 assert (bwperim (a, 4), c)
1107 8 tests, 8 passed, 0 known failure, 0 skipped
1108 [nlfilter]
1109 >>>>> /usr/share/octave/packages/image-2.6.1/nlfilter.m
1110 ***** demo
1111 ## creates a "wide" diagonal (although it can be performed more
1112 ## efficiently with "imdilate (A, true (3))")
1113 nlfilter (eye (10), [3 3], @(x) any (x(:) > 0))
1114 ***** assert (nlfilter (eye (4), [2 3], @(x) sum (x(:))),
1115 [2 2 1 0
1116 1 2 2 1
1117 0 1 2 2
1118 0 0 1 1]);
1119 ***** assert (nlfilter (eye (4), "indexed", [2 3], @(x) sum (x(:))),
1120 [4 2 1 2
1121 3 2 2 3
1122 2 1 2 4
1123 4 3 4 5]);
1124 ***** assert (nlfilter (eye (4), "indexed", [2 3], @(x, y) sum (x(:)) == y, 2),
1125 logical ([0 1 0 1
1126 0 1 1 0
1127 1 0 1 0
1128 0 0 0 0]));
1129 ***** assert (nlfilter (uint8 (eye (4)), "indexed", [2 3], @(x) sum (x(:))),
1130 [2 2 1 0
1131 1 2 2 1
1132 0 1 2 2
1133 0 0 1 1]);
1134 ***** assert (nlfilter (int16 (eye (4)), "indexed", [2 3], @(x) sum (x(:))),
1135 [4 2 1 2
1136 3 2 2 3
1137 2 1 2 4
1138 4 3 4 5]);
1139 ***** assert (nlfilter (uint8 (eye (4)), "indexed", [2 3], @(x) int8 (sum (x(:)))),
1140 int8 ([2 2 1 0
1141 1 2 2 1
1142 0 1 2 2
1143 0 0 1 1]));
1144 ***** test
1145 a = randi (10, 20, 20, 20);
1146 ## extra dimensions on matrix only
1147 assert (nlfilter (a, [5 5], @(x) max(x(:))), imdilate (a, ones (5)))
1148 ## extra dimensions on both matrix and block
1149 assert (nlfilter (a, [5 5 5], @(x) max(x(:))), imdilate (a, ones ([5 5 5])))
1150 ## extra dimensions and padding
1151 assert (nlfilter (a, [3 7], @(x) max(x(:))), imdilate (a, ones ([3 7])))
1152 assert (nlfilter (a, [3 7 3], @(x) max(x(:))), imdilate (a, ones ([3 7 3])))
1153 ***** test
1154 a = randi (10, 15, 15, 4, 8, 3);
1155 assert (nlfilter (a, [3 4 7 5], @(x) max(x(:))),
1156 imdilate (a, ones ([3 4 7 5])))
1157 ***** test
1158 a = randi (10, 15, 15, 4, 3, 8);
1159 ord = ordfiltn (a, 3, ones ([3 7 3 1 5]));
1160 assert (nlfilter (a, [3 7 3 1 5], @(x) sort (x(:))(3)), ord)
1161 assert (nlfilter (a, [3 7 3 1 5], @(x, y) sort (x(:))(y), 3), ord)
1162 9 tests, 9 passed, 0 known failure, 0 skipped
1163 [imclose]
1164 >>>>> /usr/share/octave/packages/image-2.6.1/imclose.m
1165 ***** shared in, out
1166 in = [ 0 0 0 1 1 1 0 0 1 1
1167 0 1 0 1 1 1 0 0 0 1
1168 1 1 1 1 1 0 0 0 0 0
1169 0 1 1 1 1 0 0 0 0 0
1170 0 0 0 1 0 0 0 0 1 0
1171 0 0 0 0 0 0 0 1 1 1
1172 0 0 0 0 1 0 1 0 1 0
1173 0 0 0 1 1 1 1 1 0 0
1174 0 0 0 0 1 1 1 0 0 0
1175 0 0 0 1 1 1 0 0 0 0];
1176
1177 out = [ 1 1 1 1 1 1 1 1 1 1
1178 1 1 1 1 1 1 0 0 0 1
1179 1 1 1 1 1 0 0 0 0 1
1180 1 1 1 1 1 0 0 0 0 1
1181 0 0 0 1 1 0 0 0 1 1
1182 0 0 0 1 1 1 1 1 1 1
1183 0 0 0 1 1 1 1 1 1 1
1184 0 0 0 1 1 1 1 1 0 0
1185 0 0 0 1 1 1 1 0 0 0
1186 0 0 0 1 1 1 1 0 0 0];
1187 ***** assert (imclose (logical (in), ones (3)), logical (out));
1188
1189 out = [99 99 16 16 16 73 74 64 64 64
1190 98 88 16 16 16 73 71 64 64 64
1191 93 88 88 61 61 61 68 70 70 70
1192 93 88 88 61 61 61 68 71 71 71
1193 93 93 88 61 61 61 68 75 66 66
1194 79 79 82 90 90 49 49 49 49 66
1195 79 79 82 91 91 48 46 46 46 66
1196 79 79 82 95 97 48 46 46 46 72
1197 18 18 94 96 84 48 46 46 46 59
1198 18 18 100 96 84 50 50 50 50 59];
1199 ***** assert (imclose (magic (10), ones (3)), out);
1200 ***** assert (imclose (uint8 (magic (10)), strel ("square", 3)), uint8 (out));
1201
1202 ## using a se that will be decomposed in 2 pieces
1203 out =[ 99 99 88 74 74 74 74 70 70 70
1204 98 93 88 74 74 74 74 70 70 70
1205 93 93 88 74 74 74 74 70 70 70
1206 93 93 88 74 74 74 74 71 71 71
1207 93 93 88 75 75 75 75 75 75 75
1208 93 93 90 90 90 72 72 72 72 72
1209 93 93 91 91 91 72 72 72 72 72
1210 93 93 93 95 97 72 72 72 72 72
1211 94 94 94 96 97 72 72 72 72 72
1212 100 100 100 97 97 72 72 72 72 72];
1213 ***** assert (imclose (magic (10), ones(5)), out);
1214
1215 ## using a weird non-symmetric and even-size se
1216 out =[ 92 99 16 16 16 70 74 58 58 58
1217 98 88 60 73 16 73 69 70 64 58
1218 88 81 88 60 60 60 69 69 70 70
1219 87 87 61 68 61 60 68 69 71 69
1220 86 93 87 61 61 61 68 75 68 69
1221 23 82 89 89 90 45 68 45 68 66
1222 23 23 82 89 91 48 45 45 45 66
1223 79 23 82 95 97 46 48 46 45 72
1224 18 79 94 96 78 50 46 46 46 59
1225 18 18 100 94 94 78 50 50 46 59];
1226 ***** assert (imclose (magic (10), [1 0 0 0; 1 1 1 0; 0 1 0 1]), out);
1227 5 tests, 5 passed, 0 known failure, 0 skipped
1228 [imfill]
1229 >>>>> /usr/share/octave/packages/image-2.6.1/imfill.m
1230 ***** test
1231 I = uint8 (5.*[1 1 1; 1 0 1; 1 1 1]);
1232 bw = logical ([1 1 1; 1 0 1; 1 1 1]);
1233 I2 = uint8 (5.*ones (3));
1234 bw2 = logical (ones (3));
1235
1236 assert (imfill (int8 (I)), int8 (I2))
1237 assert (imfill (int16 (I)), int16 (I2))
1238 assert (imfill (int32 (I)), int32 (I2))
1239 assert (imfill (int64 (I)), int64 (I2))
1240 assert (imfill (uint8 (I)), uint8 (I2))
1241 assert (imfill (uint16 (I)), uint16 (I2))
1242 assert (imfill (uint32 (I)), uint32 (I2))
1243 assert (imfill (uint64 (I)), uint64 (I2))
1244 assert (imfill (single (I)), single (I2))
1245 assert (imfill (double (I)), double (I2))
1246 assert (imfill (bw, "holes"), bw2)
1247 assert (imfill (uint8 (bw)), uint8 (bw2))
1248 ***** error <must be a binary or grayscale image>
1249 imfill (i + ones (3, 3)); # complex input
1250 ***** error <must be a binary or grayscale image>
1251 imfill (sparse (double (I))); # sparse input
1252 ***** error
1253 imfill ();
1254 ***** error
1255 imfill (true (3), 4, "holes", 5)
1256 ***** error <LOCATIONS must be a n-by-1 or n-by-d sized index array>
1257 imfill (false (3), ones (2, 3))
1258 ***** error <LOCATIONS must be a n-by-1 or n-by-d sized index array>
1259 imfill (false (3), ones (2, 3), 4)
1260 ***** error <interactive usage is not yet supported>
1261 imfill (false (3))
1262 ***** error <interactive usage is not yet supported>
1263 imfill (false (3), 0, 4)
1264 ***** warning <ignored LOCATIONS outside of image borders>
1265 bw = logical ([1 1 1; 1 0 1; 1 1 1]);
1266 assert (imfill (bw, [5 5]), bw)
1267 assert (imfill (bw, 15), bw)
1268
1269 bw = repmat (bw, [1 1 3]);
1270 assert (imfill (bw, 30), bw)
1271 assert (imfill (bw, [2 2 5]), bw)
1272 ***** test
1273 bw = logical ([1 0 0 0 0 0 0 0
1274 1 1 1 1 1 0 0 0
1275 1 0 0 0 1 0 1 0
1276 1 0 0 0 1 1 1 0
1277 1 1 1 1 0 1 1 1
1278 1 0 0 1 1 0 1 0
1279 1 0 0 0 1 0 1 0
1280 1 0 0 0 1 1 1 0]);
1281 bw2 = logical ([1 0 0 0 0 0 0 0
1282 1 1 1 1 1 0 0 0
1283 1 1 1 1 1 0 1 0
1284 1 1 1 1 1 1 1 0
1285 1 1 1 1 1 1 1 1
1286 1 0 0 1 1 1 1 0
1287 1 0 0 0 1 1 1 0
1288 1 0 0 0 1 1 1 0]);
1289 bw3 = logical ([1 0 0 0 0 0 0 0
1290 1 1 1 1 1 0 0 0
1291 1 1 1 1 1 0 1 0
1292 1 1 1 1 1 1 1 0
1293 1 1 1 1 0 1 1 1
1294 1 0 0 1 1 0 1 0
1295 1 0 0 0 1 0 1 0
1296 1 0 0 0 1 1 1 0]);
1297 assert (imfill (bw, "holes"), bw2)
1298 assert (imfill (bw, 8, "holes"), bw2)
1299 assert (imfill (bw, 4, "holes"), bw2)
1300 assert (imfill (bw, [3 3]), bw3)
1301 assert (imfill (bw, 19), bw3)
1302 assert (imfill (bw, [3 3], 4), bw3)
1303 assert (imfill (bw, 19, 4), bw3)
1304 assert (imfill (bw, [3 3], 8), bw2)
1305 assert (imfill (bw, 19, 8), bw2)
1306 assert (imfill (bw, [19; 20]), bw3)
1307 assert (imfill (bw, [19; 20], 4), bw3)
1308 assert (imfill (bw, [19; 20], 8), bw2)
1309 ***** warning <ignored LOCATIONS outside of image borders>
1310 bw = logical ([1 1 1 1 1 1 1
1311 1 0 0 0 0 0 1
1312 1 0 1 1 1 0 1
1313 1 0 1 0 1 0 1
1314 1 0 1 1 1 0 1
1315 1 0 0 0 0 0 1
1316 1 1 1 1 1 1 1]);
1317 bw44 = logical ([1 1 1 1 1 1 1
1318 1 0 0 0 0 0 1
1319 1 0 1 1 1 0 1
1320 1 0 1 1 1 0 1
1321 1 0 1 1 1 0 1
1322 1 0 0 0 0 0 1
1323 1 1 1 1 1 1 1]);
1324 bw9 = logical ([1 1 1 1 1 1 1
1325 1 1 1 1 1 1 1
1326 1 1 1 1 1 1 1
1327 1 1 1 0 1 1 1
1328 1 1 1 1 1 1 1
1329 1 1 1 1 1 1 1
1330 1 1 1 1 1 1 1]);
1331 assert (imfill (bw, "holes"), logical (ones (7)))
1332 assert (imfill (bw, [4 4]), bw44)
1333 assert (imfill (bw, 9), bw9)
1334 assert (imfill (bw, [4 4; 10 10]), bw44)
1335 ***** test
1336 bw = logical ([1 1 0 1 1]);
1337 assert (imfill (bw, "holes"), bw)
1338 bw = logical([1 1 0 1 1; 1 1 1 1 1]);
1339 assert (imfill (bw, "holes"), bw)
1340 ***** test
1341 I = zeros (5);
1342 I(:, [2 4]) = 1;
1343 I2_expected = [0 1 1 1 0
1344 0 1 1 1 0
1345 0 1 1 1 0
1346 0 1 1 1 0
1347 0 1 1 1 0];
1348 I2 = imfill (I, [0 0 0; 1 1 1; 0 0 0], "holes");
1349 assert (I2, I2_expected)
1350 ***** test
1351 I = zeros (5);
1352 I(:, [2 4]) = 1;
1353 I2_expected = I;
1354 I2 = imfill (I, [0 1 0; 0 1 0; 0 1 0], "holes");
1355 assert (I2, I2_expected)
1356 ***** test # this test is Matlab compatible
1357 I = zeros (5);
1358 I(:, [2 4]) = 1;
1359 I2_expected = inf .* ones (5);
1360 I2 = imfill (I, [0 0 0; 0 1 0; 0 0 0], "holes");
1361 assert (I2, I2_expected)
1362 ***** test
1363 I = false (5);
1364 I(:, [2 4]) = true;
1365 I2_expected = true (5);
1366 I2 = imfill (I, [0 0 0; 0 1 0; 0 0 0], "holes");
1367 assert (I2, I2_expected)
1368 ***** test
1369 I = uint8 ([10 20 80 85 20
1370 15 90 03 25 88
1371 05 85 02 50 83
1372 90 04 03 80 80
1373 10 81 83 85 30]);
1374 I2 = uint8 ([10 20 80 85 20
1375 15 90 80 80 88
1376 05 85 80 80 83
1377 90 80 80 80 80
1378 10 81 83 85 30]);
1379 I3 = uint8 ([10 20 80 85 20
1380 15 90 05 25 88
1381 05 85 05 50 83
1382 90 05 05 80 80
1383 10 81 83 85 30]);
1384 assert (imfill (I), I2)
1385 assert (imfill (I, 4), I2)
1386 assert (imfill (I, 4, "holes"), I2)
1387 assert (imfill (I, 8), I3)
1388 assert (imfill (I, "holes"), I2)
1389 ***** test
1390 v_line = [0 1 0; 0 1 0; 0 1 0];
1391 h_line = [0 0 0; 1 1 1; 0 0 0];
1392 im = [0 1 0 0 1 0];
1393
1394 assert (imfill (im, h_line, "holes"), [0 1 1 1 1 0])
1395 assert (imfill (im, v_line, "holes"), [0 1 0 0 1 0])
1396 assert (imfill (im', h_line, "holes"), [0 1 0 0 1 0]')
1397 assert (imfill (im', v_line, "holes"), [0 1 1 1 1 0]')
1398
1399 im = repmat (im, [1 1 5]);
1400 assert (imfill (im, h_line, "holes"), repmat ([0 1 1 1 1 0], [1 1 5]))
1401 assert (imfill (im, v_line, "holes"), im)
1402
1403 im = permute (im, [2 1 3]);
1404 assert (imfill (im, h_line, "holes"), im)
1405 assert (imfill (im, v_line, "holes"), repmat ([0 1 1 1 1 0]', [1 1 5]))
1406 ***** test
1407 im = logical ([0 0 0 0 0 0
1408 0 1 1 1 1 0
1409 0 1 0 0 1 0
1410 0 1 1 1 1 0
1411 0 0 0 0 0 0]);
1412 fi = logical ([0 0 0 0 0 0
1413 0 1 1 1 1 0
1414 0 1 1 1 1 0
1415 0 1 1 1 1 0
1416 0 0 0 0 0 0]);
1417
1418 assert (imfill (cat (3, im, im, im), 8, 'holes'), cat (3, fi, fi, fi))
1419 assert (imfill (cat (3, im, im, im), 'holes'), cat (3, im, im, im))
1420 assert (imfill (cat (3, fi, im, fi), 'holes'), cat (3, fi, fi, fi))
1421 ***** test
1422 emp = false (5, 6);
1423 im = logical ([0 0 0 0 0 0
1424 0 1 1 1 1 0
1425 0 1 0 1 0 1
1426 0 1 1 1 1 0
1427 0 0 0 0 0 0]);
1428 fi = logical ([0 0 0 0 0 0
1429 0 1 1 1 1 0
1430 0 1 1 1 1 1
1431 0 1 1 1 1 0
1432 0 0 0 0 0 0]);
1433 fi1 = logical ([0 0 0 0 0 0
1434 0 1 1 1 1 0
1435 0 1 1 1 0 1
1436 0 1 1 1 1 0
1437 0 0 0 0 0 0]);
1438 fi2 = logical ([0 0 0 0 0 0
1439 0 1 1 1 1 0
1440 0 1 0 1 1 1
1441 0 1 1 1 1 0
1442 0 0 0 0 0 0]);
1443
1444 assert (imfill (cat (3, im, im, im), [3 3 2]), cat (3, fi1, fi1, fi1))
1445 assert (imfill (cat (3, im, im, im), [3 5 2]), cat (3, fi2, fi2, fi2))
1446 assert (imfill (cat (3, im, im, im), [3 3 2; 3 5 2]), cat (3, fi, fi, fi))
1447 assert (imfill (cat (3, emp, im, emp), [3 3 2]), true (5, 6, 3))
1448 21 tests, 21 passed, 0 known failure, 0 skipped
1449 [makelut]
1450 >>>>> /usr/share/octave/packages/image-2.6.1/makelut.m
1451 ***** demo
1452 makelut(inline('sum(x(:))>=3','x'), 2)
1453 % Returns '1' if one or more values
1454 % in the input matrix are 1
1455 ***** assert(prod(makelut(inline('sum(x(:))==2','x'),2)==makelut(inline('sum(x(:))==a*b*c*d','x','a','b','c','d'),2,2/(3*4*5),3,4,5))); # test multiple params
1456 ***** assert(prod(makelut(inline('x(1,1)==1','x'),2)==[zeros(2^3,1);ones(2^3,1)])==1); # test 2-by-2
1457 ***** assert(prod(makelut(inline('x(1,1)==1','x'),3)==[zeros(2^8,1);ones(2^8,1)])==1); # test 3-by-3
1458 ***** assert(prod(makelut(inline('x(1,1)==1','x'),4)==[zeros(2^15,1);ones(2^15,1)])==1); # test 4-by-4
1459 ***** assert(prod(makelut(inline('x(2,1)==1','x'),3)==[zeros(2^7,1);ones(2^7,1);zeros(2^7,1);ones(2^7,1)])==1); # another test for 3-by-3
1460 5 tests, 5 passed, 0 known failure, 0 skipped
1461 [checkerboard]
1462 >>>>> /usr/share/octave/packages/image-2.6.1/checkerboard.m
1463 ***** demo
1464 ## Simplest case, default checkerboard size:
1465 ## 8 by 8 checkerboard, with squares 10 pixel wide
1466 board = checkerboard ();
1467 imshow (board)
1468 ***** demo
1469 ## Simplest case, default checkerboard size:
1470 ## 8 by 16 checkerboard, with squares 5 pixel wide
1471 board = checkerboard (5, 4, 8);
1472 imshow (board)
1473 ***** assert (checkerboard (0), zeros (0, 0))
1474 ***** assert (checkerboard (0, 3), zeros (0, 0))
1475 ***** assert (checkerboard (0, 2, 4), zeros (0, 0))
1476 ***** assert (checkerboard (0, 2, 4, 3), zeros (0, 0, 0))
1477 ***** assert (checkerboard (0, 2, 4, 3, 2), zeros (0, 0, 0, 0))
1478 ***** assert (checkerboard (1, 4, 2, 3, 0), zeros (8, 4, 6, 0))
1479 ***** assert (checkerboard (1, 4, 0, 3, 2), zeros (8, 0, 6, 4))
1480 ***** assert (checkerboard (2, 4, 0, 3, 2), zeros (16, 0, 12, 8))
1481 ***** test
1482 out = zeros (80);
1483 i1 = ((1:20:80) .+ (0:9)')(:);
1484 i2 = ((11:20:80) .+ (0:9)')(:);
1485 out(i1, i2) = 1;
1486 out(i2, i1) = 1;
1487 i1r = ((41:20:80) .+ (0:9)')(:);
1488 i2r = ((51:20:80) .+ (0:9)')(:);
1489 out(i2, i1r) = 0.7;
1490 out(i1, i2r) = 0.7;
1491 assert (checkerboard (), out)
1492 assert (checkerboard (10, 4, 4), out)
1493 assert (checkerboard (10, [4 4]), out)
1494 assert (checkerboard (10, [4; 4]), out)
1495 ***** test
1496 out = zeros (8);
1497 out(2:2:8, 1:2:8) = 1;
1498 out(1:2:8, 2:2:8) = 1;
1499 out(1:2:8, 6:2:8) = 0.7;
1500 out(2:2:8, 5:2:8) = 0.7;
1501 assert (checkerboard (1), out)
1502 assert (checkerboard (1, 4), out)
1503 assert (checkerboard (1, 4, 4), out)
1504 assert (checkerboard (1, [4 4]), out)
1505 ***** test
1506 out = zeros (10);
1507 out(2:2:10, 1:2:10) = 1;
1508 out(1:2:10, 2:2:10) = 1;
1509 out(1:2:10, 6:2:10) = 0.7;
1510 out(2:2:10, 7:2:10) = 0.7;
1511 assert (checkerboard (1, 5), out)
1512 assert (checkerboard (1, 5, 5), out)
1513 assert (checkerboard (1, [5 5]), out)
1514 ***** test
1515 out = zeros (20);
1516 out([1:4:20 2:4:20], [3:4:20 4:4:20]) = 1;
1517 out([3:4:20 4:4:20], [1:4:20 2:4:20]) = 1;
1518 out([1:4:20 2:4:20], [11:4:20 12:4:20]) = 0.7;
1519 out([3:4:20 4:4:20], [13:4:20 14:4:20]) = 0.7;
1520 assert (checkerboard (2, 5), out)
1521 assert (checkerboard (2, 5, 5), out)
1522 assert (checkerboard (2, [5 5]), out)
1523 ***** test
1524 out = zeros (4, 4, 4);
1525 out([1 3], 1, [1 3]) = 1;
1526 out([2 4], 2, [1 3]) = 1;
1527 out([1 3], 2, [2 4]) = 1;
1528 out([2 4], 1, [2 4]) = 1;
1529 out([1 3], 3, [1 3]) = 0.7;
1530 out([2 4], 4, [1 3]) = 0.7;
1531 out([1 3], 4, [2 4]) = 0.7;
1532 out([2 4], 3, [2 4]) = 0.7;
1533 assert (checkerboard (1, [2 2 2]), out)
1534 assert (checkerboard (1, 2, 2, 2), out)
1535 ***** test
1536 out = zeros (8, 8, 8);
1537 out([1 2 5 6], [1 2], [1 2 5 6]) = 1;
1538 out([3 4 7 8], [3 4], [1 2 5 6]) = 1;
1539 out([1 2 5 6], [3 4], [3 4 7 8]) = 1;
1540 out([3 4 7 8], [1 2], [3 4 7 8]) = 1;
1541 out([1 2 5 6], [5 6], [1 2 5 6]) = 0.7;
1542 out([3 4 7 8], [7 8], [1 2 5 6]) = 0.7;
1543 out([1 2 5 6], [7 8], [3 4 7 8]) = 0.7;
1544 out([3 4 7 8], [5 6], [3 4 7 8]) = 0.7;
1545 assert (checkerboard (2, [2 2 2]), out)
1546 assert (checkerboard (2, 2, 2, 2), out)
1547 14 tests, 14 passed, 0 known failure, 0 skipped
1548 [ordfiltn]
1549 >>>>> /usr/share/octave/packages/image-2.6.1/ordfiltn.m
1550 ***** shared b, f, s
1551 b = [ 0 1 2 3
1552 1 8 12 12
1553 4 20 24 21
1554 7 22 25 18];
1555
1556 f = [ 8 12 12 12
1557 20 24 24 24
1558 22 25 25 25
1559 22 25 25 25];
1560 ***** assert (ordfiltn (b, 9, true (3)), f);
1561
1562 f = [ 1 8 12 12
1563 8 20 21 21
1564 20 24 24 24
1565 20 24 24 24];
1566 ***** assert (ordfiltn (b, 8, true (3)), f);
1567
1568 f = [ 1 2 8 12
1569 4 12 20 21
1570 8 22 22 21
1571 20 24 24 24];
1572 ***** assert (ordfiltn (b, 7, true (3), "symmetric"), f);
1573
1574 f = [ 1 8 12 12
1575 4 20 24 21
1576 7 22 25 21
1577 7 22 25 21];
1578 ***** assert (ordfiltn (b, 3, true (3, 1)), f);
1579
1580 f = [ 1 8 12 12
1581 4 20 24 18
1582 4 20 24 18
1583 4 20 24 18];
1584 ***** assert (ordfiltn (b, 3, true (4, 1)), f);
1585
1586 f = [ 4 20 24 21
1587 7 22 25 21
1588 7 22 25 21
1589 7 22 25 21];
1590 ***** assert (ordfiltn (b, 4, true (4, 1)), f);
1591
1592 s = [0 0 1
1593 0 0 1
1594 0 0 1];
1595 f = [ 2 8 12 12
1596 9 20 22 21
1597 21 25 24 24
1598 21 25 24 24];
1599 ***** assert (ordfiltn (b, 8, true (3), s), f);
1600
1601 b(:,:,2) = b(:,:,1) - 1;
1602 b(:,:,3) = b(:,:,2) - 1;
1603 f(:,:,1) = [ 1 8 11 11
1604 8 20 21 21
1605 20 24 24 24
1606 20 24 24 24];
1607 f(:,:,2) = [ 6 10 11 11
1608 18 22 22 22
1609 20 24 24 24
1610 20 24 24 24];
1611 f(:,:,3) = [ 0 7 10 10
1612 7 19 20 20
1613 19 23 23 23
1614 19 23 23 23];
1615 ***** assert (ordfiltn (b, 25, true (3, 3, 3)), f);
1616 8 tests, 8 passed, 0 known failure, 0 skipped
1617 [imregionalmax]
1618 >>>>> /usr/share/octave/packages/image-2.6.1/imregionalmax.m
1619 ***** test
1620 a = [
1621 7 3 9 3 10 3
1622 4 2 3 10 1 3
1623 1 4 6 9 4 10
1624 8 7 9 3 4 8
1625 5 9 3 3 8 9
1626 3 6 9 4 1 10];
1627
1628 a4 = [
1629 1 0 1 0 1 0
1630 0 0 0 1 0 0
1631 0 0 0 0 0 1
1632 1 0 1 0 0 0
1633 0 1 0 0 0 0
1634 0 0 1 0 0 1];
1635 assert (imregionalmax (a, 4), logical (a4))
1636 a8 = [
1637 1 0 0 0 1 0
1638 0 0 0 1 0 0
1639 0 0 0 0 0 1
1640 0 0 0 0 0 0
1641 0 0 0 0 0 0
1642 0 0 0 0 0 1];
1643 assert (imregionalmax (a, 8), logical (a8))
1644 assert (imregionalmax (a), logical (a8))
1645 1 test, 1 passed, 0 known failure, 0 skipped
1646 [imhist]
1647 >>>>> /usr/share/octave/packages/image-2.6.1/imhist.m
1648 ***** shared nn, bb, enn, ebb
1649 [nn, bb] = imhist(logical([0 1 0 0 1]));
1650 ***** assert({nn, bb}, {[3 2]', [0 1]'})
1651 [nn, bb] = imhist([0 0.2 0.4 0.9 1], 5);
1652 ***** assert({nn, bb}, {[1 1 1 0 2]', [0 0.25 0.5 0.75 1]'})
1653 [nn, bb] = imhist([-2 0 0.2 0.4 0.9 1 5], 5);
1654 ***** assert({nn, bb}, {[2 1 1 0 3]', [0 0.25 0.5 0.75 1]'})
1655 [nn, bb] = imhist(uint8([0 32 255]), 256);
1656 enn = zeros(256, 1); enn([1, 33, 256]) = 1;
1657 ebb = 0:255;
1658 ***** assert({nn, bb}, {enn, ebb'})
1659 [nn, bb] = imhist(int8([-50 0 100]), 31);
1660 enn = zeros(31, 1); enn([10, 16, 28]) = 1;
1661 ebb = -128:8.5:127;
1662 ***** assert({nn, bb}, {enn, ebb'})
1663 5 tests, 5 passed, 0 known failure, 0 skipped
1664 [applylut]
1665 >>>>> /usr/share/octave/packages/image-2.6.1/applylut.m
1666 ***** demo
1667 lut = makelut (inline ('sum (x (:)) >= 3', 'x'), 3);
1668 S = applylut (eye (5), lut);
1669 disp (S)
1670 ## Everything should be 0 despite a diagonal which doesn't reach borders.
1671 ***** assert (prod (applylut (eye (3), makelut (@(x) x(1) == 1, 2)) == eye (3)), [1 1 1]);
1672 ***** assert (prod (applylut (eye (3), makelut (@(x) x(2,2) == 1, 3)) == eye (3)), [1 1 1]);
1673 ***** assert (prod (applylut (eye (3), makelut (@(x) x(3,3) == 1, 3)) ==
1674 applylut (eye (3), makelut (@(x) x(2,2) == 1, 2))),
1675 [1 1 1]);
1676 3 tests, 3 passed, 0 known failure, 0 skipped
1677 [lab2xyz]
1678 >>>>> /usr/share/octave/packages/image-2.6.1/lab2xyz.m
1679 ***** assert (lab2xyz ([0, 0, 0]), [0 0 0], 1e-3)
1680 ***** assert (lab2xyz ([53.24, 80.09, 67.20]), [0.4125, 0.2127, 0.0193], 1e-3)
1681 ***** assert (lab2xyz ([97.14, -21.55, 94.48]), [0.7700, 0.9278, 0.1385], 1e-3)
1682 ***** assert (lab2xyz ([87.74, -86.18, 83.18]), [0.3576, 0.7152, 0.1192], 1e-3)
1683 ***** assert (lab2xyz ([91.11, -48.09, -14.13]), [0.5380, 0.7873, 1.0694], 1e-3)
1684 ***** assert (lab2xyz ([32.30, 79.19, -107.86]), [0.1804, 0.07217, 0.9502], 1e-3)
1685 ***** assert (lab2xyz ([60.32, 98.24, -60.83]), [0.5929, 0.28484, 0.9696], 1e-3)
1686 ***** assert (lab2xyz ([100, 0.00, 0.00]), [0.9505, 1.0000, 1.0888], 1e-3)
1687 ***** assert (lab2xyz ([53.39, 0.00, 0.00]), [0.2034, 0.2140, 0.2330], 1e-3)
1688 ***** assert (lab2xyz ([39.77, 64.51, 54.13]), [0.2155, 0.1111, 0.0101], 1e-3)
1689 ***** assert (lab2xyz ([25.42, 47.91, 37.91]), [0.0883, 0.0455, 0.0041], 1e-3)
1690 ***** assert (lab2xyz ([9.66, 29.68, 15.24]), [0.02094, 0.0108, 0.00098], 1e-3)
1691 ***** assert (lab2xyz ([68.11, 48.39, 22.83]), [0.5276, 0.3812, 0.2482], 1e-3)
1692 ***** assert (lab2xyz ([150 130 130]), [4.596, 2.931, 0.519], 1e-3)
1693 ***** test
1694 lab_map = rand (64, 3);
1695 lab_map(:,1) = lab_map(:,1) .* 100;
1696 lab_map(:,2) = lab_map(:,2) .* 254 - 127;
1697 lab_map(:,3) = lab_map(:,3) .* 254 - 127;
1698 assert (xyz2lab (lab2xyz (lab_map)), lab_map, 1e-5);
1699 ***** test
1700 lab_img = rand (64, 64, 3);
1701 lab_img(:,:,1) = lab_img(:,:,1) .* 100;
1702 lab_img(:,:,2) = lab_img(:,:,2) .* 254 - 127;
1703 lab_img(:,:,3) = lab_img(:,:,3) .* 254 - 127;
1704 assert (xyz2lab (lab2xyz (lab_img)), lab_img, 1e-5);
1705 ***** assert (lab2xyz (sparse ([0 0 0])), [0 0 0], 1e-3)
1706 ***** assert (lab2xyz (sparse ([100, 0.00, 0.00])), [0.9505, 1.0000, 1.0888], 1e-3)
1707 ***** assert (class (lab2xyz (single([50 50 50]))), 'single')
1708 ***** error lab2xyz ()
1709 ***** error lab2xyz (1,2)
1710 ***** error <invalid data type 'cell'> lab2xyz ({1})
1711 ***** error <Lab must be a colormap or Lab image> lab2xyz (ones (2,2))
1712 ***** test
1713 lab = rand (16, 16, 3, 5);
1714 lab(:,:,1,:) = lab(:,:,1,:) .* 100;
1715 lab(:,:,2,:) = lab(:,:,2,:) .* 254 - 127;
1716 lab(:,:,3,:) = lab(:,:,3,:) .* 254 - 127;
1717 xyz = zeros (size (lab));
1718 for i = 1:5
1719 xyz(:,:,:,i) = lab2xyz (lab(:,:,:,i));
1720 endfor
1721 assert (lab2xyz (lab), xyz)
1722 24 tests, 24 passed, 0 known failure, 0 skipped
1723 [lab2double]
1724 >>>>> /usr/share/octave/packages/image-2.6.1/lab2double.m
1725 ***** test
1726 l_max_f = 100 + (25500 / 65280);
1727 ab_max_f = 127 + (255 / 256);
1728 cm = [
1729 -Inf
1730 Inf
1731 NaN
1732 l_max_f
1733 ab_max_f
1734 -200
1735 -129
1736 -128
1737 -128+(255/65280)*(0.499999)
1738 -128+(255/65280)*(0.500001) # should be 0.5, but float rounding error
1739 -128+(255/65280)*(0.500002)
1740 -127
1741 -1
1742 0
1743 (100/65280)*(0.499999)
1744 (100/65280)*(0.51)
1745 (100/65280)*(0.500001)
1746 1
1747 99
1748 100
1749 101
1750 126
1751 127
1752 128
1753 254
1754 255
1755 256
1756 257];
1757 cm = repmat (cm, [1 3]);
1758 im2d = reshape (cm, [7 4 3]);
1759 imnd = permute (im2d, [1 4 3 2]);
1760
1761 cm_uint8 = uint8 ([
1762 0 0 0
1763 255 255 255
1764 255 255 255
1765 255 228 228
1766 255 255 255
1767 0 0 0
1768 0 0 0
1769 0 0 0
1770 0 0 0
1771 0 0 0
1772 0 0 0
1773 0 1 1
1774 0 127 127
1775 0 128 128
1776 0 128 128
1777 0 128 128
1778 0 128 128
1779 3 129 129
1780 252 227 227
1781 255 228 228
1782 255 229 229
1783 255 254 254
1784 255 255 255
1785 255 255 255
1786 255 255 255
1787 255 255 255
1788 255 255 255
1789 255 255 255]);
1790
1791 assert (lab2uint8 (cm), cm_uint8)
1792 im2d_uint8 = reshape (cm_uint8, [7 4 3]);
1793 assert (lab2uint8 (im2d), im2d_uint8)
1794 assert (lab2uint8 (imnd), permute (im2d_uint8, [1 4 3 2]))
1795
1796 cm_uint16 = uint16 ([
1797 0 0 0
1798 65535 65535 65535
1799 65535 65535 65535
1800 65535 58468 58468
1801 65535 65535 65535
1802 0 0 0
1803 0 0 0
1804 0 0 0
1805 0 0 0
1806 0 1 1
1807 0 1 1
1808 0 256 256
1809 0 32512 32512
1810 0 32768 32768
1811 0 32768 32768
1812 1 32768 32768
1813 1 32768 32768
1814 653 33024 33024
1815 64627 58112 58112
1816 65280 58368 58368
1817 65535 58624 58624
1818 65535 65024 65024
1819 65535 65280 65280
1820 65535 65535 65535
1821 65535 65535 65535
1822 65535 65535 65535
1823 65535 65535 65535
1824 65535 65535 65535]);
1825
1826 assert (lab2uint16 (cm), cm_uint16)
1827 im2d_uint16 = reshape (cm_uint16, [7 4 3]);
1828 assert (lab2uint16 (im2d), im2d_uint16)
1829 assert (lab2uint16 (imnd), permute (im2d_uint16, [1 4 3 2]))
1830
1831 assert (lab2single (cm), single (cm))
1832 assert (lab2single (im2d), single (im2d))
1833 assert (lab2single (imnd), single (imnd))
1834 1 test, 1 passed, 0 known failure, 0 skipped
1835 [rgb2ycbcr]
1836 >>>>> /usr/share/octave/packages/image-2.6.1/rgb2ycbcr.m
1837 ***** test
1838 in(:,:,1) = magic (5);
1839 in(:,:,2) = magic (5);
1840 in(:,:,3) = magic (5);
1841 out(:,:,1) = [31 37 17 23 29
1842 36 20 22 28 30
1843 19 21 27 33 35
1844 25 26 32 34 19
1845 25 31 37 18 24];
1846 out(:,:,2) = 128;
1847 out(:,:,3) = 128;
1848 assert (rgb2ycbcr (uint8 (in)), uint8 (out));
1849 ***** shared cbcr
1850 cbcr = 0.5019607843137255;
1851 out(1:10, 1) = linspace (16/255, 235/255, 10);
1852 out(:, [2 3]) = cbcr;
1853 assert (rgb2ycbcr (gray (10)), out, 0.00001);
1854 ***** assert (rgb2ycbcr ([1 1 1]), [0.92157 cbcr cbcr], 0.0001);
1855 2 tests, 2 passed, 0 known failure, 0 skipped
1856 [stretchlim]
1857 >>>>> /usr/share/octave/packages/image-2.6.1/stretchlim.m
1858 ***** error (stretchlim ());
1859 ***** error (stretchlim ("bad parameter"));
1860 ***** error (stretchlim (zeros (10, 10), "bad parameter"));
1861 ***** error (stretchlim (zeros (10, 10), 0.01, 2));
1862 ***** assert (stretchlim (0.01:.01:1), [0.02; 0.99])
1863 ***** assert (stretchlim (0.01:.01:1), stretchlim (0.01:.01:1, [0.01 0.99]))
1864 ***** assert (stretchlim (0.01:.01:1, 0.15), stretchlim (0.01:.01:1, [0.15 0.85]))
1865 ***** assert (stretchlim (0.01:.01:1, [0.01,0.95]), [0.02; 0.95], eps)
1866 ***** assert (stretchlim (0.01:.01:1, 0), [0.01; 1])
1867 ***** test
1868 im = rand (5);
1869 assert (stretchlim (im, 0), [min(im(:)); max(im(:))])
1870 ***** test
1871 im = rand (5, 5, 3);
1872 assert (stretchlim (im, 0),
1873 [min(im(:,:,1)(:)) min(im(:,:,2)(:)) min(im(:,:,3)(:));
1874 max(im(:,:,1)(:)) max(im(:,:,2)(:)) max(im(:,:,3)(:))])
1875 ***** test
1876 im = rand (5);
1877 assert (stretchlim (im, 0.03), [min(im(:)); max(im(:))])
1878 assert (stretchlim (im, 0.0399), [min(im(:)); max(im(:))])
1879 ***** assert (stretchlim (uint8 (1:100)), im2double (uint8 ([2; 99])))
1880 ***** assert (stretchlim (uint8 (1:100), .25), im2double (uint8 ([26; 75])))
1881 ***** assert (stretchlim (uint16 (1:1000)), im2double (uint16 ([11; 990])))
1882 ***** assert (stretchlim (int16 (-100:100)), im2double (int16 ([-98; 98])))
1883 ***** assert (stretchlim (single (0.01:.01:1)),
1884 double (single (0.01:.01:1)([2; 99])).')
1885 ***** assert (stretchlim (uint8 ([1 repmat(2, [1, 90]) 92:100]), 0.05),
1886 im2double (uint8 ([2; 95])))
1887 ***** assert (stretchlim (uint8 ([1 repmat(2, [1 4]) 6:100]), 0.05),
1888 im2double (uint8 ([6; 95])))
1889 ***** assert (stretchlim (uint8 ([1 repmat(2, [1 5]) 7:100]), 0.05),
1890 im2double (uint8 ([2; 95])))
1891 ***** assert (stretchlim (uint8 ([1 repmat(2, [1 6]) 8:100]), 0.05),
1892 im2double (uint8 ([2; 95])))
1893 ***** assert (stretchlim (uint8 ([1 repmat(2, [1 7]) 9:100]), 0.05),
1894 im2double (uint8 ([2; 95])))
1895 ***** assert (stretchlim (uint8 ([1 repmat(2, [1 8]) 10:100]), 0.05),
1896 im2double (uint8 ([2; 95])))
1897 ***** assert (stretchlim (uint8 ([1 repmat(2, [1 5]) repmat(3, [1 5]) 9:100]), 0.04),
1898 im2double (uint8 ([2; 96])))
1899 ***** assert (stretchlim (uint8 ([1 repmat(2, [1 5]) repmat(3, [1 5]) 9:100]), 0.05),
1900 im2double (uint8 ([2; 95])))
1901 ***** assert (stretchlim (uint8 ([1 repmat(2, [1 5]) repmat(3, [1 5]) 9:100]), 0.06),
1902 im2double (uint8 ([3; 94])))
1903 ***** assert (stretchlim (uint8 ([1 repmat(2, [1 5]) repmat(3, [1 5]) 9:100]), 0.07),
1904 im2double (uint8 ([3; 93])))
1905 ***** assert (stretchlim (uint8 ([1 repmat(2, [1 5]) repmat(3, [1 5]) 9:100]), 0.08),
1906 im2double (uint8 ([3; 92])))
1907 ***** test
1908 RGB = zeros (100, 1, 3, "uint16");
1909 RGB(:,:,1) = [1:1:100];
1910 RGB(:,:,2) = [2:2:200];
1911 RGB(:,:,3) = [4:4:400];
1912 assert (stretchlim (RGB) , im2double (uint16 ([2 4 8; 99 198 396])))
1913 ***** test
1914 im6c = zeros (100, 1, 6, "uint16");
1915 im6c(:,:,1) = [1:1:100];
1916 im6c(:,:,2) = [2:2:200];
1917 im6c(:,:,3) = [4:4:400];
1918 im6c(:,:,4) = [8:8:800];
1919 im6c(:,:,5) = [16:16:1600];
1920 im6c(:,:,6) = [32:32:3200];
1921 assert (stretchlim (im6c) ,
1922 im2double (uint16 ([2 4 8 16 32 64; 99 198 396 792 1584 3168])))
1923 ***** test
1924 im = [0 0 .1 .1 .1 .1 .2 .2 .2 .4 .4 .6 .6 .7 .7 .9 .9 .9 1 1];
1925
1926 assert (stretchlim (im), [0; 1])
1927
1928 ## Consider the returned lower limit in this test. A lower limit
1929 ## of 0.1 will saturate two elements (10%), while 0.2 will saturate
1930 ## 6 elements (30%). Both have the same distance to 20% but returning
1931 ## 0.1 is Matlab compatible.
1932 ## Now looking at the higher limit. A limit of .9 will saturate
1933 ## 2 elements (10%), while a limit of 0.7 will saturate 5 elements (25%).
1934 ## However, for Matlab compatibility we must return .9 even though
1935 ## 25% would be closer to 20%.
1936 ## Basically, it's not just rounded.
1937 assert (stretchlim (im, .2), [0.1; 0.9])
1938
1939 assert (stretchlim (im, .15), [0.1; 0.9])
1940 assert (stretchlim (im, .1), [0.1; 0.9])
1941 assert (stretchlim (im, .25), [0.1; 0.7])
1942
1943 ## Reorder the vector of values (real images don't have the values
1944 ## already sorted), just to be sure it all works.
1945 im([6 3 16 11 7 17 14 8 5 19 15 1 2 4 18 13 9 20 10 12]) = im;
1946 assert (stretchlim (im, .2), [0.1; 0.9])
1947 assert (stretchlim (im, .15), [0.1; 0.9])
1948 assert (stretchlim (im, .1), [0.1; 0.9])
1949 assert (stretchlim (im, .25), [0.1; 0.7])
1950 ***** assert (stretchlim (0.01:.001:1), [0.019; 0.991], eps)
1951 ***** assert (stretchlim (0.01:.001:1, [0.01,0.95]), [0.019; 0.951], eps)
1952 ***** assert (stretchlim (0.01:.001:1, 0), [0.01; 1])
1953 ***** assert (stretchlim (single (0.01:.001:1)),
1954 double (single (0.01:.001:1)([10; 982])).')
1955 ***** test
1956 assert (stretchlim ([(.05:.05:1) (2:4)], 0.2), [0.25; 0.95], eps)
1957 assert (stretchlim ([(.05:.05:1) (2:5)], 0.2), [0.25; 1])
1958 assert (stretchlim ([(.05:.05:1) (2:6)], 0.2), [0.3; 1])
1959 assert (stretchlim ([(.05:.05:1) (2:7)], 0.2), [0.3; 1])
1960 ***** test
1961 assert (stretchlim ([(-6:0) (.05:.05:1)], 0.2), [0; 0.75], eps)
1962 assert (stretchlim ([(-5:0) (.05:.05:1)], 0.2), [0; 0.75], eps)
1963 ***** test
1964 im = rand (4, 4, 2, 3, 2);
1965 rv = zeros (2, 2, 3, 2);
1966 for p = 1:2
1967 for q = 1:3
1968 for r = 1:2
1969 rv(:,p,q,r) = stretchlim (im(:,:,p,q,r), 0.25);
1970 endfor
1971 endfor
1972 endfor
1973 assert (stretchlim (im, 0.25), rv)
1974 ***** test
1975 im = rand (4, 4, 2, 3, 2);
1976 rv = zeros (2, 2, 3, 2);
1977 for p = 1:2
1978 for q = 1:3
1979 for r = 1:2
1980 rv(:,p,q,r) = stretchlim (im(:,:,p,q,r), 0);
1981 endfor
1982 endfor
1983 endfor
1984 assert (stretchlim (im, 0), rv)
1985 ***** assert (stretchlim (zeros (5)), [0; 1])
1986 ***** assert (stretchlim (ones (5)), [0; 1])
1987 ***** assert (stretchlim (.6 * ones (5)), [0; 1])
1988 ***** assert (stretchlim (zeros (3, 3, 3, 3)), repmat ([0; 1], [1 3 3]))
1989 ***** assert (stretchlim ([0 .5 .5 .5 .5 1], .2), [0; 1])
1990 ***** test
1991 im = repmat ((magic (5) -1) / 24, [1 1 3 3]);
1992 im(:,:,1,1) = 0;
1993 im(:,:,2,2) = .5;
1994 im(:,:,3,3) = 1;
1995 lims = stretchlim (im, 0.2);
1996 assert (size (lims), [2 3 3])
1997 assert (lims(:, [2 3 4 6 7 8]),
1998 repmat ([(1/24)*round(24*.2); 1-((1/24)*round(24*.2))], [1 6]), eps)
1999 assert (lims(:, [1 5 9]), repmat ([0; 1], [1 3]))
2000 45 tests, 45 passed, 0 known failure, 0 skipped
2001 [imgetfile]
2002 >>>>> /usr/share/octave/packages/image-2.6.1/imgetfile.m
2003 ***** assert (1)
2004 1 test, 1 passed, 0 known failure, 0 skipped
2005 [montage]
2006 >>>>> /usr/share/octave/packages/image-2.6.1/montage.m
2007 ***** function cdata = montage_cdata (varargin)
2008 h = figure ();
2009 set (h, "visible", "off");
2010 mh = montage (varargin{:});
2011 cdata = get (mh, "cdata");
2012 close (h);
2013 ***** endfunction
2014 ***** test
2015 im = uint8 (ones (2, 2, 1, 5)) .* reshape ([1 2 3 4 5], [1 1 1 5]);
2016 cdata = montage_cdata (im);
2017 expected = uint8 ([
2018 1 1 2 2 3 3
2019 1 1 2 2 3 3
2020 4 4 5 5 0 0
2021 4 4 5 5 0 0
2022 ]);
2023 assert (cdata, expected)
2024 ***** test
2025 im = uint8 (ones (2, 4, 1, 6)) .* reshape ([1 2 3 4 5 6], [1 1 1 6]);
2026 cdata = montage_cdata (im);
2027 expected = uint8 ([
2028 1 1 1 1 2 2 2 2
2029 1 1 1 1 2 2 2 2
2030 3 3 3 3 4 4 4 4
2031 3 3 3 3 4 4 4 4
2032 5 5 5 5 6 6 6 6
2033 5 5 5 5 6 6 6 6
2034 ]);
2035 assert (cdata, expected)
2036 2 tests, 2 passed, 0 known failure, 0 skipped
2037 [blockproc]
2038 >>>>> /usr/share/octave/packages/image-2.6.1/blockproc.m
2039 ***** demo
2040 blockproc(eye(6),[2,2],inline("any(x(:))","x"))
2041 # Returns a 3-by-3 diagonal
2042 ***** assert(blockproc(eye(6),[2,2],"sum"),blockproc(eye(6),[2,2],@sum));
2043 ***** assert(blockproc(eye(6),[2,2],"sum"),blockproc(eye(6),[2,2],inline("sum(x)","x")));
2044 ***** assert(blockproc(eye(6),[1,2],@sum),kron(eye(3),[1;1]));
2045 ***** assert(blockproc(eye(6),[2,2],inline("any(x(:))","x")),eye(3)!=0);
2046 ***** assert(blockproc(eye(6),[1,2],[1,1],inline("sum(x(:))","x")),[2,1,0;3,2,0;2,3,1;1,3,2;0,2,3;0,1,2]);
2047 ***** assert(blockproc(eye(6),'indexed',[1,2],[1,1],inline("sum(x(:))","x")),[8,5,6;6,2,3;5,3,4;4,3,5;3,2,6;6,5,8]);
2048 ***** assert(blockproc(eye(6),[2,3],[4,3],inline("sum(x(:))","x")),ones(3,2)*6);
2049 ***** assert(blockproc(eye(6),[2,2],inline("int8(sum(x(:)))","x")),eye(3,"int8")*2);
2050 ***** assert(blockproc(uint8(eye(6)),[1,2],[1,1],inline("sum(x(:))","x")),[2,1,0;3,2,0;2,3,1;1,3,2;0,2,3;0,1,2]);
2051 ***** assert(blockproc(uint8(eye(6)),'indexed',[1,2],[1,1],inline("sum(x(:))","x")),[2,1,0;3,2,0;2,3,1;1,3,2;0,2,3;0,1,2]);
2052 ***** assert(blockproc(uint16(eye(6)),[1,2],[1,1],inline("sum(x(:))","x")),[2,1,0;3,2,0;2,3,1;1,3,2;0,2,3;0,1,2]);
2053 ***** assert(blockproc(uint16(eye(6)),'indexed',[1,2],[1,1],inline("sum(x(:))","x")),[2,1,0;3,2,0;2,3,1;1,3,2;0,2,3;0,1,2]);
2054 12 tests, 12 passed, 0 known failure, 0 skipped
2055 [xyz2lab]
2056 >>>>> /usr/share/octave/packages/image-2.6.1/xyz2lab.m
2057 ***** assert (xyz2lab ([0, 0, 0]), [0 0 0], 5e-2)
2058 ***** assert (xyz2lab ([0.4125, 0.2127, 0.0193]), [53.24, 80.09, 67.20], 5e-2)
2059 ***** assert (xyz2lab ([0.7700, 0.9278, 0.1385]), [97.14, -21.55, 94.48], 5e-2)
2060 ***** assert (xyz2lab ([0.3576, 0.7152, 0.1192]), [87.74, -86.18, 83.18], 5e-2)
2061 ***** assert (xyz2lab ([0.5380, 0.7873, 1.0694]), [91.11, -48.09, -14.13], 5e-2)
2062 ***** assert (xyz2lab ([0.1804, 0.07217, 0.9502]), [32.30, 79.19, -107.86], 5e-2)
2063 ***** assert (xyz2lab ([0.5929, 0.28484, 0.9696]), [60.32, 98.24, -60.83], 5e-2)
2064 ***** assert (xyz2lab ([0.9505, 1.0000, 1.0888]), [100, 0.00, 0.00], 5e-2)
2065 ***** assert (xyz2lab ([0.2034, 0.2140, 0.2330]), [53.39, 0.00, 0.00], 5e-2)
2066 ***** assert (xyz2lab ([0.2155, 0.1111, 0.0101]), [39.77, 64.51, 54.13], 5e-2)
2067 ***** assert (xyz2lab ([0.0883, 0.0455, 0.0041]), [25.42, 47.91, 37.91], 5e-2)
2068 ***** assert (xyz2lab ([0.02094, 0.0108, 0.00098]), [9.66, 29.68, 15.24], 5e-2)
2069 ***** assert (xyz2lab ([0.5276, 0.3812, 0.2482]), [68.11, 48.39, 22.83], 5e-2)
2070 ***** assert (xyz2lab ([1.5 1 1]), [100, 82.15, 5.60], 5e-2)
2071 xyz_map = rand (64, 3);
2072 assert (lab2xyz (xyz2lab (xyz_map)), xyz_map, 1e-5);
2073 ***** test
2074 xyz_img = rand (64, 64, 3);
2075 assert (lab2xyz (xyz2lab (xyz_img)), xyz_img, 1e-5);
2076 ***** assert (xyz2lab (sparse ([0 0 0])), [0 0 0], 5e-2)
2077 ***** assert (class (xyz2lab (single([0.5 0.5 0.5]))), 'single')
2078 ***** error xyz2lab ()
2079 ***** error xyz2lab (1,2)
2080 ***** error <invalid data type 'cell'> xyz2lab ({1})
2081 ***** error <XYZ must be a colormap or XYZ image> xyz2lab (ones (2,2))
2082 ***** test
2083 xyz = rand (16, 16, 3, 5);
2084 lab = zeros (size (xyz));
2085 for i = 1:5
2086 lab(:,:,:,i) = xyz2lab (xyz(:,:,:,i));
2087 endfor
2088 assert (xyz2lab (xyz), lab)
2089 22 tests, 22 passed, 0 known failure, 0 skipped
2090 [imadd]
2091 >>>>> /usr/share/octave/packages/image-2.6.1/imadd.m
2092 ***** assert (imadd (uint8 ([23 250]), uint8 ([23 250])), uint8 ([46 255])); # default to first class and truncate
2093 ***** assert (imadd (uint8 ([23 250]), 10), uint8 ([33 255])); # works adding a scalar
2094 ***** assert (imadd (uint8 ([23 250]), uint8 ([23 250]), "uint16"), uint16 ([46 500])); # defining output class works
2095 ***** assert (imadd (logical ([ 1 0]), logical ([ 1 1])), double ([ 2 1])); # return double for two logical images
2096 ***** assert (imadd (logical ([ 1 0]), logical ([ 1 1]), "logical"), logical ([ 1 1])); # this is matlab incompatible on purpose
2097 ***** fail ("imadd (uint8 ([23 250]), uint16 ([23 250]))"); # input need to have same class
2098 6 tests, 6 passed, 0 known failure, 0 skipped
2099 [isrgb]
2100 >>>>> /usr/share/octave/packages/image-2.6.1/isrgb.m
2101 ***** assert (isrgb ("this is not a RGB image"), false);
2102 ***** assert (isrgb (rand (5, 5)), false);
2103 ***** assert (isrgb (rand (5, 5, 1, 5)), false);
2104 ***** assert (isrgb (rand (5, 5, 3, 5)), true);
2105 ***** assert (isrgb (rand (5, 5, 3)), true);
2106 ***** assert (isrgb (ones (5, 5, 3)), true);
2107 ***** assert (isrgb (ones (5, 5, 3) + eps), false);
2108 ***** assert (isrgb (zeros (5, 5, 3) - eps), false);
2109 ***** assert (isrgb (rand (5, 5, 3) > 0.5), false);
2110 ***** assert (isrgb (randi ([-100 100], 5, 5, 3, "int16")), true)
2111 10 tests, 10 passed, 0 known failure, 0 skipped
2112 [imbothat]
2113 >>>>> /usr/share/octave/packages/image-2.6.1/imbothat.m
2114 ***** assert (imbothat (ones (3), [1 1; 0 1]), zeros (3));
2115 ***** assert (imbothat (true (3), [1 1; 0 1]), false (3));
2116 ***** shared in, out, se
2117 in = [ 0 0 0 1 1 1 0 0 1 1
2118 0 1 0 1 1 1 0 0 0 1
2119 1 1 1 1 1 0 0 0 0 0
2120 0 1 1 1 1 0 0 0 0 0
2121 0 0 0 1 0 0 0 0 1 0
2122 0 0 0 0 0 0 0 1 1 1
2123 0 0 0 0 1 0 1 0 1 0
2124 0 0 0 1 1 1 1 1 0 0
2125 0 0 0 0 1 1 1 0 0 0
2126 0 0 0 1 1 1 0 0 0 0];
2127
2128 out = [ 1 1 1 0 0 0 1 1 0 0
2129 1 0 1 0 0 0 0 0 0 0
2130 0 0 0 0 0 0 0 0 0 1
2131 1 0 0 0 0 0 0 0 0 1
2132 0 0 0 0 1 0 0 0 0 1
2133 0 0 0 1 1 1 1 0 0 0
2134 0 0 0 1 0 1 0 1 0 1
2135 0 0 0 0 0 0 0 0 0 0
2136 0 0 0 1 0 0 0 0 0 0
2137 0 0 0 0 0 0 1 0 0 0];
2138 ***** assert (imbothat (logical (in), ones (3)), logical (out));
2139
2140 out = [ 7 0 15 8 1 6 0 13 6 24
2141 0 8 9 2 0 0 16 7 0 23
2142 89 7 0 41 39 7 12 7 0 23
2143 8 1 69 40 58 1 6 2 0 43
2144 7 0 63 59 52 0 0 0 14 32
2145 62 55 6 7 0 7 0 23 16 1
2146 56 74 0 2 0 0 16 14 7 0
2147 0 73 69 0 0 19 15 8 1 0
2148 8 6 0 0 6 13 9 2 0 6
2149 7 0 0 19 0 14 7 0 23 0];
2150 ***** assert (imbothat (magic (10), ones (3)), out);
2151 ***** assert (imbothat (uint8 (magic (10)), strel ("square", 3)), uint8 (out));
2152
2153 ## using a se that will be decomposed in 2 pieces
2154 out =[ 7 0 87 66 59 7 0 19 12 30
2155 0 13 81 60 58 1 19 13 6 29
2156 89 12 0 54 52 20 18 7 0 23
2157 8 6 69 53 71 14 12 2 0 43
2158 7 0 63 73 66 14 7 0 23 41
2159 76 69 14 7 0 30 23 46 39 7
2160 70 88 9 2 0 24 42 40 33 6
2161 14 87 80 0 0 43 41 34 27 0
2162 84 82 0 0 19 37 35 28 26 19
2163 89 82 0 20 13 36 29 22 45 13];
2164 ***** assert (imbothat (magic (10), ones(5)), out);
2165
2166 ## using a weird non-symmetric and even-size se
2167 out =[ 0 0 15 8 1 3 0 7 0 18
2168 0 8 53 59 0 0 14 13 0 17
2169 84 0 0 40 38 6 13 6 0 23
2170 2 0 42 47 58 0 6 0 0 41
2171 0 0 62 59 52 0 0 0 16 35
2172 6 58 13 6 0 3 19 19 35 1
2173 0 18 0 0 0 0 15 13 6 0
2174 0 17 69 0 0 17 17 8 0 0
2175 8 67 0 0 0 15 9 2 0 6
2176 7 0 0 17 10 42 7 0 19 0];
2177 ***** assert (imbothat (magic (10), [1 0 0 0; 1 1 1 0; 0 1 0 1]), out);
2178
2179 ## N dimensional and weird se
2180 in = reshape (magic(16), [4 8 4 2]);
2181 se = ones (3, 3, 3);
2182 se(:,:,1) = [1 0 1; 0 1 1; 0 0 0];
2183 se(:,:,3) = [1 0 1; 0 1 1; 0 0 1];
2184 out = zeros (size (in));
2185 out(:,:,1,1) = [
2186 0 17 81 145 237 146 64 0
2187 205 128 64 0 0 37 83 147
2188 175 111 47 0 0 64 117 181
2189 0 64 128 209 173 109 45 0];
2190 out(:,:,2,1) = [
2191 235 142 78 18 0 23 69 133
2192 0 35 103 163 215 128 46 0
2193 0 64 128 195 183 123 48 0
2194 153 93 43 0 14 78 146 215];
2195 out(:,:,3,1) = [
2196 0 25 89 153 229 142 64 0
2197 201 128 64 0 0 41 91 155
2198 167 103 57 0 0 64 125 189
2199 0 64 146 217 165 101 37 0];
2200 out(:,:,4,1) = [
2201 227 142 78 14 0 31 77 141
2202 0 43 107 171 211 128 46 0
2203 0 64 128 203 179 115 48 0
2204 149 99 35 0 18 82 146 223];
2205 out(:,:,1,2) = [
2206 0 33 97 161 221 146 64 0
2207 189 125 61 0 0 53 99 163
2208 159 95 31 0 0 64 128 197
2209 0 64 128 225 157 93 29 0];
2210 out(:,:,2,2) = [
2211 219 142 78 18 0 39 85 149
2212 0 51 119 179 199 128 46 0
2213 0 64 128 211 167 107 43 0
2214 137 77 27 0 14 78 146 231];
2215 out(:,:,3,2) = [
2216 0 41 105 169 213 142 64 0
2217 185 121 64 0 0 57 107 171
2218 151 87 41 0 0 64 128 205
2219 0 64 146 233 149 85 21 0];
2220 out(:,:,4,2) = [
2221 211 142 78 14 0 47 93 157
2222 0 59 123 187 195 128 46 0
2223 0 64 128 219 163 99 35 0
2224 133 83 19 0 18 82 146 239];
2225 ***** assert (imbothat (in, se), out);
2226 8 tests, 8 passed, 0 known failure, 0 skipped
2227 [isind]
2228 >>>>> /usr/share/octave/packages/image-2.6.1/isind.m
2229 ***** assert (isind ([]), false);
2230 ***** assert (isind (1:10), true);
2231 ***** assert (isind (0:10), false);
2232 ***** assert (isind (1), true);
2233 ***** assert (isind (0), false);
2234 ***** assert (isind ([1.3 2.4]), false);
2235 ***** assert (isind ([1 2; 3 4]), true);
2236 ***** assert (isind (randi (100, 10, 10, 1, 4)), true);
2237 ***** assert (isind (randi (100, 10, 10, 3, 4)), false);
2238 ***** assert (isind (randi (100, 10, 10, 1, 4, 2)), false);
2239 10 tests, 10 passed, 0 known failure, 0 skipped
2240 [imtophat]
2241 >>>>> /usr/share/octave/packages/image-2.6.1/imtophat.m
2242 ***** assert (imtophat (ones (3), [1 1; 0 1]), zeros (3));
2243 ***** assert (imtophat (true (3), [1 1; 0 1]), false (3));
2244 ***** shared in, out, se
2245 in = [ 0 0 0 1 1 1 0 0 1 1
2246 0 1 0 1 1 1 0 0 0 1
2247 1 1 1 1 1 0 0 0 0 0
2248 0 1 1 1 1 0 0 0 0 0
2249 0 0 0 1 0 0 0 0 1 0
2250 0 0 0 0 0 0 0 1 1 1
2251 0 0 0 0 1 0 1 0 1 0
2252 0 0 0 1 1 1 1 1 0 0
2253 0 0 0 0 1 1 1 0 0 0
2254 0 0 0 1 1 1 0 0 0 0];
2255
2256 out = [ 0 0 0 0 0 0 0 0 1 1
2257 0 1 0 0 0 0 0 0 0 1
2258 1 1 1 1 1 0 0 0 0 0
2259 0 1 1 1 1 0 0 0 0 0
2260 0 0 0 1 0 0 0 0 1 0
2261 0 0 0 0 0 0 0 1 1 1
2262 0 0 0 0 1 0 1 0 1 0
2263 0 0 0 1 1 1 1 1 0 0
2264 0 0 0 0 1 1 1 0 0 0
2265 0 0 0 1 1 1 0 0 0 0];
2266 ***** assert (imtophat (logical (in), ones (3)), logical (out));
2267
2268 out = [12 19 0 0 0 16 23 0 7 0
2269 18 0 0 6 1 19 0 2 9 1
2270 0 74 81 12 7 0 1 8 15 7
2271 68 70 2 14 0 6 7 14 16 0
2272 69 76 8 0 0 7 14 21 0 1
2273 0 7 59 54 61 13 20 0 0 32
2274 18 0 69 60 62 19 0 0 0 27
2275 73 0 0 66 68 0 1 6 6 33
2276 0 0 17 19 1 0 2 9 7 14
2277 1 6 23 0 7 1 8 15 0 32];
2278 ***** assert (imtophat (magic (10), ones (3)), out);
2279 ***** assert (imtophat (uint8 (magic (10)), strel ("square", 3)), uint8 (out));
2280
2281 ## using a se that will be decomposed in 2 pieces
2282 out =[91 98 0 0 0 27 34 11 18 0
2283 94 76 3 6 1 33 15 17 24 1
2284 0 77 84 12 7 14 16 23 30 7
2285 80 82 14 18 0 32 34 41 43 0
2286 81 88 20 0 0 33 40 47 24 6
2287 12 19 63 57 64 16 23 0 7 39
2288 18 0 69 60 62 19 1 3 12 39
2289 73 0 0 66 68 0 2 9 18 45
2290 4 6 81 67 49 6 8 15 19 26
2291 5 12 87 48 55 7 14 21 0 32];
2292 ***** assert (imtophat (magic (10), ones(5)), out);
2293
2294 ## using a weird non-symmetric and even-size se
2295 out =[85 92 0 0 0 12 23 0 17 0
2296 91 73 0 6 0 18 0 2 13 0
2297 0 72 81 13 6 0 1 9 15 0
2298 60 62 10 12 0 8 8 17 17 0
2299 61 69 0 0 0 28 16 41 0 0
2300 0 0 47 52 61 12 16 0 0 31
2301 6 0 53 58 60 17 0 0 0 33
2302 69 0 0 60 62 0 0 6 0 33
2303 0 0 17 60 42 0 2 13 1 8
2304 0 6 23 0 7 0 7 15 0 14];
2305 ***** assert (imtophat (magic (10), [1 0 0 0; 1 1 1 0; 0 1 0 1]), out);
2306
2307 ## N dimensional and weird se
2308 in = reshape (magic(16), [4 8 4 2]);
2309 se = ones (3, 3, 3);
2310 se(:,:,1) = [1 0 1; 0 1 1; 0 0 0];
2311 se(:,:,3) = [1 0 1; 0 1 1; 0 0 1];
2312 out = zeros (size (in));
2313 out(:,:,1,1) = [
2314 239 146 82 18 0 19 83 133
2315 0 35 99 163 219 128 64 0
2316 0 46 128 195 187 123 59 0
2317 157 93 47 0 14 78 142 211];
2318 out(:,:,2,1) = [
2319 0 21 85 149 233 146 64 0
2320 205 128 64 0 0 41 87 151
2321 171 107 57 0 0 64 121 185
2322 0 64 142 213 169 105 41 0];
2323 out(:,:,3,1) = [
2324 231 146 78 14 0 27 77 137
2325 0 43 107 167 211 128 64 0
2326 0 46 128 199 179 119 51 0
2327 149 85 39 0 18 78 142 219];
2328 out(:,:,4,1) = [
2329 0 29 93 157 225 128 64 0
2330 197 128 64 0 0 31 95 159
2331 163 99 53 0 0 61 125 189
2332 0 64 146 221 161 97 33 0];
2333 out(:,:,1,2) = [
2334 223 146 82 18 0 35 99 149
2335 0 48 115 179 203 128 64 0
2336 0 46 128 211 171 107 43 0
2337 141 77 31 0 14 78 142 227];
2338 out(:,:,2,2) = [
2339 0 37 101 165 217 146 64 0
2340 189 125 64 0 0 57 103 167
2341 155 91 41 0 0 64 128 201
2342 0 64 142 229 153 89 25 0];
2343 out(:,:,3,2) = [
2344 215 146 78 14 0 43 93 153
2345 0 48 123 183 195 128 64 0
2346 0 46 128 215 163 103 35 0
2347 133 69 23 0 18 78 142 235];
2348 out(:,:,4,2) = [
2349 0 45 109 173 209 128 64 0
2350 181 117 64 0 0 47 111 175
2351 147 83 37 0 0 64 128 205
2352 0 64 146 237 145 81 17 0];
2353 ***** assert (imtophat (in, se), out);
2354 8 tests, 8 passed, 0 known failure, 0 skipped
2355 [fspecial]
2356 >>>>> /usr/share/octave/packages/image-2.6.1/fspecial.m
2357 ***** test
2358 for i = 1:9
2359 n = 2^i;
2360 assert (sum (fspecial ("disk", n)(:)), 1, eps*n*n);
2361 endfor
2362 ***** test
2363 for r = [3 5 9 17]
2364 f = fspecial ("disk", r);
2365 [X, Y] = meshgrid (-r:r, -r:r);
2366 rhi = (abs (X) + 0.5).^2 + (abs (Y) + 0.5).^2;
2367 rlo = (abs (X) - 0.5).^2 + (abs (Y) - 0.5).^2;
2368 fhi = (rhi <= (r^2));
2369 flo = (rlo >= (r^2));
2370 for i = 1:(2*r+1)
2371 for j = 1:(2*r+1)
2372 if (fhi(i,j))
2373 assert (f(i,j), 1/(pi*r^2), eps);
2374 endif
2375 if (flo(i,j))
2376 assert (f(i,j), 0);
2377 endif
2378 endfor
2379 endfor
2380 endfor
2381 ***** error <LENGTHS must be greater than 0>
2382 fspecial ("gaussian", 0)
2383 ***** error <LENGTHS must be integer>
2384 fspecial ("gaussian", 3.9)
2385 ***** assert (fspecial ("gaussian"), fspecial ("gaussian", 3, 0.5))
2386 ***** assert (fspecial ("gaussian"), fspecial ("gaussian", [3 3], 0.5))
2387 ***** test
2388 c = ([-1:1].^2) .+ ([-1:1]'.^2);
2389 gauss = exp (- (c ./ (2 * (0.5 .^ 2))));
2390 f = gauss / sum (gauss(:));
2391 assert (fspecial ("gaussian"), f)
2392
2393 expected = [
2394 0.01134373655849507 0.08381950580221061 0.01134373655849507
2395 0.08381950580221061 0.61934703055717721 0.08381950580221061
2396 0.01134373655849507 0.08381950580221061 0.01134373655849507];
2397 assert (f, expected, eps)
2398 ***** function f = f_gaussian_2d (hsize, sigma)
2399 c = ([(-hsize(1)):(hsize(1))]'.^2) .+ ([(-hsize(2)):(hsize(2))].^2);
2400 gauss = exp (- (c ./ (2 * (sigma .^ 2))));
2401 f = gauss ./ sum (gauss(:));
2402 ***** endfunction
2403 ***** test
2404 f = fspecial ("gaussian");
2405 assert (f, f_gaussian_2d ([1 1], .5))
2406 expected = [
2407 0.01134373655849507 0.08381950580221061 0.01134373655849507
2408 0.08381950580221061 0.61934703055717721 0.08381950580221061
2409 0.01134373655849507 0.08381950580221061 0.01134373655849507];
2410 assert (f, expected, eps)
2411 ***** test
2412 f = fspecial ("gaussian", 7, 2);
2413 assert (f, f_gaussian_2d ([3 3], 2))
2414 expected = [
2415 0.00492233115934352
2416 0.00919612528958620
2417 0.01338028334410124
2418 0.01516184737296414
2419 0.01338028334410124
2420 0.00919612528958620
2421 0.00492233115934352
2422 0.00919612528958620
2423 0.01718062389630964
2424 0.02499766026691484
2425 0.02832606006174462
2426 0.02499766026691484
2427 0.01718062389630964
2428 0.00919612528958620
2429 0.01338028334410124
2430 0.02499766026691484
2431 0.03637138107390363
2432 0.04121417419979795
2433 0.03637138107390363
2434 0.02499766026691484
2435 0.01338028334410124
2436 0.01516184737296414
2437 0.02832606006174462
2438 0.04121417419979795
2439 0.04670177773892775];
2440 expected = reshape ([expected; expected((end-1):-1:1)], [7 7]);
2441 assert (f, expected, eps)
2442 ***** test
2443 f = fspecial ("gaussian", [7 5], 2);
2444 assert (f, f_gaussian_2d ([3 2], 2))
2445 expected = [
2446 0.01069713252648568
2447 0.01998487459872362
2448 0.02907782096336423
2449 0.03294948784319031
2450 0.02907782096336423
2451 0.01998487459872362
2452 0.01069713252648568
2453 0.01556423598706978
2454 0.02907782096336423
2455 0.04230797985750011
2456 0.04794122192790870
2457 0.04230797985750011
2458 0.02907782096336423
2459 0.01556423598706978
2460 0.01763658993191515
2461 0.03294948784319031
2462 0.04794122192790870
2463 0.05432452146574315];
2464 expected = reshape ([expected; expected((end-1):-1:1)], [7 5]);
2465 assert (f, expected, eps)
2466 ***** test
2467 f = fspecial ("gaussian", [4 2], 2);
2468 expected = [0.10945587477855045 0.14054412522144952];
2469 expected = expected([1 1; 2 2; 2 2; 1 1]);
2470 assert (f, expected, eps)
2471 ***** test
2472 expected =[0.04792235409415088 0.06153352068439959 0.07901060453704994];
2473 expected = expected([1 2 2 1; 2 3 3 2; 2 3 3 2; 1 2 2 1]);
2474 assert (fspecial ("gaussian", 4, 2), expected)
2475 ***** function f = f_gaussian_3d (lengths, sigma)
2476 [x, y, z] = ndgrid (-lengths(1):lengths(1), -lengths(2):lengths(2),
2477 -lengths(3):lengths(3));
2478 sig_22 = 2 * (sigma.^2);
2479 f = exp (-((x.^2)/sig_22 + (y.^2)/sig_22 + (z.^2)/sig_22));
2480 f = f / sum (f(:));
2481 ***** endfunction
2482 ***** test
2483 obs = fspecial ("gaussian", [5 5 5]);
2484 assert (obs, f_gaussian_3d ([2 2 2], .5))
2485
2486 u_values = [
2487 0.00000000001837155
2488 0.00000000741161178
2489 0.00000005476481523
2490 0.00000299005759843
2491 0.00002209370333384
2492 0.00016325161336690
2493 0.00120627532940896
2494 0.00891323607975882
2495 0.06586040141635063
2496 0.48664620076350640];
2497 expected = zeros (5, 5, 5);
2498 expected([1 5 21 25 101 105 121 125]) = u_values(1);
2499 expected([2 4 6 10 16 20 22 24 26 30 46 50 76 80 96 100 102 104 106 110 116 120 122 124]) = u_values(2);
2500 expected([3 11 15 23 51 55 71 75 103 111 115 123]) = u_values(3);
2501 expected([7 9 17 19 27 29 31 35 41 45 47 49 77 79 81 85 91 95 97 99 107 109 117 119]) = u_values(4);
2502 expected([8 12 14 18 28 36 40 48 52 54 56 60 66 70 72 74 78 86 90 98 108 112 114 118]) = u_values(5);
2503 expected([13 53 61 65 73 113]) = u_values(6);
2504 expected([32 34 42 44 82 84 92 94]) = u_values(7);
2505 expected([33 37 39 43 57 59 67 69 83 87 89 93]) = u_values(8);
2506 expected([38 58 62 64 68 88]) = u_values(9);
2507 expected([63]) = u_values(10);
2508 assert (obs, expected, eps)
2509 ***** test
2510 obs = fspecial ("gaussian", [5 5 5], 1);
2511 assert (obs, f_gaussian_3d ([2 2 2], 1))
2512
2513 u_values = [
2514 0.00016177781678373
2515 0.00072503787330278
2516 0.00119538536377748
2517 0.00324939431236223
2518 0.00535734551968363
2519 0.00883276951279243
2520 0.01456277497493249
2521 0.02400995686159072
2522 0.03958572658629712
2523 0.06526582943894763];
2524 expected = zeros (5, 5, 5);
2525 expected([1 5 21 25 101 105 121 125]) = u_values(1);
2526 expected([2 4 6 10 16 20 22 24 26 30 46 50 76 80 96 100 102 104 106 110 116 120 122 124]) = u_values(2);
2527 expected([3 11 15 23 51 55 71 75 103 111 115 123]) = u_values(3);
2528 expected([7 9 17 19 27 29 31 35 41 45 47 49 77 79 81 85 91 95 97 99 107 109 117 119]) = u_values(4);
2529 expected([8 12 14 18 28 36 40 48 52 54 56 60 66 70 72 74 78 86 90 98 108 112 114 118]) = u_values(5);
2530 expected([13 53 61 65 73 113]) = u_values(6);
2531 expected([32 34 42 44 82 84 92 94]) = u_values(7);
2532 expected([33 37 39 43 57 59 67 69 83 87 89 93]) = u_values(8);
2533 expected([38 58 62 64 68 88]) = u_values(9);
2534 expected([63]) = u_values(10);
2535 assert (obs, expected, eps)
2536 ***** test
2537 obs = fspecial ("gaussian", [3 4 1 5], 3);
2538 assert (find (obs == max (obs(:))), [29; 32])
2539 assert (size (obs), [3 4 1 5])
2540 assert (obs(:)(1:30), obs(:)(end:-1:31))
2541 15 tests, 15 passed, 0 known failure, 0 skipped
2542 [imresize]
2543 >>>>> /usr/share/octave/packages/image-2.6.1/imresize.m
2544 ***** test
2545 in = [116 227 153 69 146 194 59 130 139 106
2546 2 47 137 249 90 75 16 24 158 44
2547 155 68 46 84 166 156 69 204 32 152
2548 71 221 137 230 210 153 192 115 30 118
2549 107 143 108 52 51 73 101 21 175 90
2550 54 158 143 77 26 168 113 229 165 225
2551 9 47 133 135 130 207 236 43 19 73];
2552 assert (imresize (uint8 (in), 1, "nearest"), uint8 (in))
2553 assert (imresize (uint8 (in), 1, "bicubic"), uint8 (in))
2554
2555 out = [116 116 227 227 153 153 69 69 146 146 194 194 59 59 130 130 139 139 106 106
2556 116 116 227 227 153 153 69 69 146 146 194 194 59 59 130 130 139 139 106 106
2557 2 2 47 47 137 137 249 249 90 90 75 75 16 16 24 24 158 158 44 44
2558 2 2 47 47 137 137 249 249 90 90 75 75 16 16 24 24 158 158 44 44
2559 155 155 68 68 46 46 84 84 166 166 156 156 69 69 204 204 32 32 152 152
2560 155 155 68 68 46 46 84 84 166 166 156 156 69 69 204 204 32 32 152 152
2561 71 71 221 221 137 137 230 230 210 210 153 153 192 192 115 115 30 30 118 118
2562 71 71 221 221 137 137 230 230 210 210 153 153 192 192 115 115 30 30 118 118
2563 107 107 143 143 108 108 52 52 51 51 73 73 101 101 21 21 175 175 90 90
2564 107 107 143 143 108 108 52 52 51 51 73 73 101 101 21 21 175 175 90 90
2565 54 54 158 158 143 143 77 77 26 26 168 168 113 113 229 229 165 165 225 225
2566 54 54 158 158 143 143 77 77 26 26 168 168 113 113 229 229 165 165 225 225
2567 9 9 47 47 133 133 135 135 130 130 207 207 236 236 43 43 19 19 73 73
2568 9 9 47 47 133 133 135 135 130 130 207 207 236 236 43 43 19 19 73 73];
2569 assert (imresize (uint8 (in), 2, "nearest"), uint8 (out))
2570 assert (imresize (uint8 (in), 2, "neAreST"), uint8 (out))
2571 assert (imresize (uint8 (in), [14 NaN], "nearest"), uint8 (out))
2572 assert (imresize (uint8 (in), [NaN 20], "nearest"), uint8 (out))
2573
2574 out = [116 116 227 227 153 153 69 69 146 146 194 194 59 59 130 130 139 139 106 106
2575 2 2 47 47 137 137 249 249 90 90 75 75 16 16 24 24 158 158 44 44
2576 155 155 68 68 46 46 84 84 166 166 156 156 69 69 204 204 32 32 152 152
2577 71 71 221 221 137 137 230 230 210 210 153 153 192 192 115 115 30 30 118 118
2578 107 107 143 143 108 108 52 52 51 51 73 73 101 101 21 21 175 175 90 90
2579 54 54 158 158 143 143 77 77 26 26 168 168 113 113 229 229 165 165 225 225
2580 9 9 47 47 133 133 135 135 130 130 207 207 236 236 43 43 19 19 73 73];
2581 assert (imresize (uint8 (in), [7 20], "nearest"), uint8 (out))
2582
2583 assert (imresize (uint8 (in), 1.5, "bicubic"), imresize (uint8 (in), 1.5, "cubic"))
2584 assert (imresize (uint8 (in), [NaN, size(in,2)*1.5], "bicubic"), imresize (uint8 (in), 1.5, "cubic"))
2585 assert (imresize (uint8 (in), [size(in,1)*1.5, NaN], "bicubic"), imresize (uint8 (in), 1.5, "cubic"))
2586 assert (imresize (uint8 (in), 1.5, "linear"), imresize (uint8 (in), 1.5, "LIneAR"))
2587 assert (imresize (uint8 (in), 1.5, "linear"), imresize (uint8 (in), 1.5, "triangle"))
2588
2589 out = [ 47 249 75 24 44
2590 221 230 153 115 118
2591 158 77 168 229 225
2592 47 135 207 43 73];
2593 assert (imresize (uint8 (in), 0.5, "nearest"), uint8 (out))
2594 ***** assert (imresize (repmat (5, [3 3]), 2), repmat (5, [6 6]), eps*100)
2595 ***** assert (imresize (repmat (5, [3 3 2]), 2), repmat (5, [6 6 2]), eps*100)
2596 ***** shared in, out
2597 in = [116 227 153 69 146 194 59 130 139 106
2598 2 47 137 249 90 75 16 24 158 44
2599 155 68 46 84 166 156 69 204 32 152
2600 71 221 137 230 210 153 192 115 30 118
2601 107 143 108 52 51 73 101 21 175 90
2602 54 158 143 77 26 168 113 229 165 225
2603 9 47 133 135 130 207 236 43 19 73];
2604
2605 out = [116 185 235 171 96 64 134 189 186 74 90 141 140 124 108
2606 44 92 143 149 164 163 119 123 118 44 38 80 151 118 63
2607 14 21 47 107 195 228 115 81 70 24 19 56 137 105 49
2608 145 98 49 49 71 107 148 159 132 58 124 176 61 85 145
2609 118 139 144 92 116 168 201 188 159 140 167 158 27 69 152
2610 62 151 218 145 174 219 201 164 146 187 148 84 48 76 115
2611 102 132 151 119 90 72 72 72 83 114 60 31 144 130 81
2612 82 121 154 133 87 41 19 67 116 95 108 140 183 180 164
2613 40 96 152 149 117 74 34 108 179 131 175 215 153 177 219
2614 11 33 73 127 137 125 113 158 212 229 148 55 35 63 96
2615 4 17 53 121 141 138 133 171 220 253 141 16 7 36 67];
2616 ***** xtest assert (imresize (uint8 (in), 1.5, "bicubic"), uint8 (out))
2617
2618 out = [116 172 215 165 111 82 133 170 171 81 95 132 138 123 106
2619 59 98 138 144 152 152 125 127 119 54 58 89 137 112 75
2620 27 39 62 110 172 202 123 96 78 36 40 68 123 100 62
2621 129 97 64 62 87 119 146 148 128 74 117 154 73 94 134
2622 113 129 136 101 125 162 183 172 151 135 146 139 53 83 135
2623 77 143 195 145 166 197 186 162 146 171 138 92 62 84 113
2624 101 129 149 120 98 81 78 82 91 111 77 56 132 123 95
2625 81 116 147 130 96 61 43 80 119 109 116 132 162 164 158
2626 46 93 139 141 114 80 50 109 168 141 166 189 151 171 200
2627 16 41 77 123 130 123 115 157 204 214 145 69 48 71 98
2628 9 28 61 119 134 134 131 169 212 231 140 39 23 46 73];
2629 !!!!! known failure
2630 ASSERT errors for: assert (imresize (uint8 (in), 1.5, "bicubic"),uint8 (out))
2631
2632 Location | Observed | Expected | Reason
2633 (2,1) 26 44 Abs err 18 exceeds tol 0
2634 (3,1) 21 14 Abs err 7 exceeds tol 0
2635 (4,1) 132 145 Abs err 13 exceeds tol 0
2636 (5,1) 140 118 Abs err 22 exceeds tol 0
2637 (6,1) 71 62 Abs err 9 exceeds tol 0
2638 (7,1) 92 102 Abs err 10 exceeds tol 0
2639 (8,1) 102 82 Abs err 20 exceeds tol 0
2640 (9,1) 72 40 Abs err 32 exceeds tol 0
2641 (10,1) 28 11 Abs err 17 exceeds tol 0
2642 (11,1) 9 4 Abs err 5 exceeds tol 0
2643 (1,2) 198 185 Abs err 13 exceeds tol 0
2644 (2,2) 78 92 Abs err 14 exceeds tol 0
2645 (3,2) 9 21 Abs err 12 exceeds tol 0
2646 (4,2) 70 98 Abs err 28 exceeds tol 0
2647 (5,2) 150 139 Abs err 11 exceeds tol 0
2648 (6,2) 180 151 Abs err 29 exceeds tol 0
2649 (7,2) 162 132 Abs err 30 exceeds tol 0
2650 (8,2) 130 121 Abs err 9 exceeds tol 0
2651 (9,2) 137 96 Abs err 41 exceeds tol 0
2652 (10,2) 80 33 Abs err 47 exceeds tol 0
2653 (11,2) 21 17 Abs err 4 exceeds tol 0
2654 (1,3) 227 235 Abs err 8 exceeds tol 0
2655 (2,3) 138 143 Abs err 5 exceeds tol 0
2656 (3,3) 42 47 Abs err 5 exceeds tol 0
2657 (4,3) 26 49 Abs err 23 exceeds tol 0
2658 (5,3) 117 144 Abs err 27 exceeds tol 0
2659 (6,3) 213 218 Abs err 5 exceeds tol 0
2660 (7,3) 182 151 Abs err 31 exceeds tol 0
2661 (8,3) 142 154 Abs err 12 exceeds tol 0
2662 (9,3) 176 152 Abs err 24 exceeds tol 0
2663 (10,3) 139 73 Abs err 66 exceeds tol 0
2664 (11,3) 77 53 Abs err 24 exceeds tol 0
2665 (1,4) 164 171 Abs err 7 exceeds tol 0
2666 (2,4) 151 149 Abs err 2 exceeds tol 0
2667 (3,4) 100 107 Abs err 7 exceeds tol 0
2668 (4,4) 47 49 Abs err 2 exceeds tol 0
2669 (5,4) 73 92 Abs err 19 exceeds tol 0
2670 (6,4) 138 145 Abs err 7 exceeds tol 0
2671 (7,4) 128 119 Abs err 9 exceeds tol 0
2672 (8,4) 119 133 Abs err 14 exceeds tol 0
2673 (9,4) 144 149 Abs err 5 exceeds tol 0
2674 (10,4) 145 127 Abs err 18 exceeds tol 0
2675 (11,4) 127 121 Abs err 6 exceeds tol 0
2676 (1,5) 86 96 Abs err 10 exceeds tol 0
2677 (2,5) 200 164 Abs err 36 exceeds tol 0
2678 (3,5) 211 195 Abs err 16 exceeds tol 0
2679 (4,5) 78 71 Abs err 7 exceeds tol 0
2680 (5,5) 91 116 Abs err 25 exceeds tol 0
2681 (6,5) 184 174 Abs err 10 exceeds tol 0
2682 (7,5) 124 90 Abs err 34 exceeds tol 0
2683 (8,5) 65 87 Abs err 22 exceeds tol 0
2684 (9,5) 95 117 Abs err 22 exceeds tol 0
2685 (10,5) 130 137 Abs err 7 exceeds tol 0
2686 (11,5) 144 141 Abs err 3 exceeds tol 0
2687 (1,6) 73 64 Abs err 9 exceeds tol 0
2688 (2,6) 185 163 Abs err 22 exceeds tol 0
2689 (3,6) 222 228 Abs err 6 exceeds tol 0
2690 (4,6) 120 107 Abs err 13 exceeds tol 0
2691 (5,6) 161 168 Abs err 7 exceeds tol 0
2692 (6,6) 240 219 Abs err 21 exceeds tol 0
2693 (7,6) 134 72 Abs err 62 exceeds tol 0
2694 (8,6) 18 41 Abs err 23 exceeds tol 0
2695 (9,6) 34 74 Abs err 40 exceeds tol 0
2696 (10,6) 85 125 Abs err 40 exceeds tol 0
2697 (11,6) 131 138 Abs err 7 exceeds tol 0
2698 (1,7) 128 134 Abs err 6 exceeds tol 0
2699 (2,7) 115 119 Abs err 4 exceeds tol 0
2700 (3,7) 121 115 Abs err 6 exceeds tol 0
2701 (4,7) 139 148 Abs err 9 exceeds tol 0
2702 (5,7) 204 201 Abs err 3 exceeds tol 0
2703 (6,7) 220 201 Abs err 19 exceeds tol 0
2704 (7,7) 127 72 Abs err 55 exceeds tol 0
2705 (8,7) 16 19 Abs err 3 exceeds tol 0
2706 (9,7) 4 34 Abs err 30 exceeds tol 0
2707 (10,7) 55 113 Abs err 58 exceeds tol 0
2708 (11,7) 123 133 Abs err 10 exceeds tol 0
2709 (1,8) 197 189 Abs err 8 exceeds tol 0
2710 (2,8) 104 123 Abs err 19 exceeds tol 0
2711 (3,8) 76 81 Abs err 5 exceeds tol 0
2712 (4,8) 157 159 Abs err 2 exceeds tol 0
2713 (5,8) 206 188 Abs err 18 exceeds tol 0
2714 (6,8) 174 164 Abs err 10 exceeds tol 0
2715 (7,8) 98 72 Abs err 26 exceeds tol 0
2716 (8,8) 49 67 Abs err 18 exceeds tol 0
2717 (9,8) 77 108 Abs err 31 exceeds tol 0
2718 (10,8) 130 158 Abs err 28 exceeds tol 0
2719 (11,8) 164 171 Abs err 7 exceeds tol 0
2720 (1,9) 179 186 Abs err 7 exceeds tol 0
2721 (2,9) 99 118 Abs err 19 exceeds tol 0
2722 (3,9) 65 70 Abs err 5 exceeds tol 0
2723 (4,9) 120 132 Abs err 12 exceeds tol 0
2724 (5,9) 164 159 Abs err 5 exceeds tol 0
2725 (6,9) 154 146 Abs err 8 exceeds tol 0
2726 (7,9) 98 83 Abs err 15 exceeds tol 0
2727 (8,9) 88 116 Abs err 28 exceeds tol 0
2728 (9,9) 146 179 Abs err 33 exceeds tol 0
2729 (10,9) 206 212 Abs err 6 exceeds tol 0
2730 (11,9) 223 220 Abs err 3 exceeds tol 0
2731 (1,10) 80 74 Abs err 6 exceeds tol 0
2732 (2,10) 42 44 Abs err 2 exceeds tol 0
2733 (3,10) 25 24 Abs err 1 exceeds tol 0
2734 (4,10) 44 58 Abs err 14 exceeds tol 0
2735 (5,10) 133 140 Abs err 7 exceeds tol 0
2736 (6,10) 192 187 Abs err 5 exceeds tol 0
2737 (7,10) 151 114 Abs err 37 exceeds tol 0
2738 (8,10) 92 95 Abs err 3 exceeds tol 0
2739 (9,10) 92 131 Abs err 39 exceeds tol 0
2740 (10,10) 173 229 Abs err 56 exceeds tol 0
2741 (11,10) 255 253 Abs err 2 exceeds tol 0
2742 (1,11) 70 90 Abs err 20 exceeds tol 0
2743 (2,11) 7 38 Abs err 31 exceeds tol 0
2744 (3,11) 14 19 Abs err 5 exceeds tol 0
2745 (4,11) 98 124 Abs err 26 exceeds tol 0
2746 (5,11) 180 167 Abs err 13 exceeds tol 0
2747 (6,11) 173 148 Abs err 25 exceeds tol 0
2748 (7,11) 90 60 Abs err 30 exceeds tol 0
2749 (8,11) 61 108 Abs err 47 exceeds tol 0
2750 (9,11) 137 175 Abs err 38 exceeds tol 0
2751 (10,11) 176 148 Abs err 28 exceeds tol 0
2752 (11,11) 160 141 Abs err 19 exceeds tol 0
2753 (1,12) 135 141 Abs err 6 exceeds tol 0
2754 (2,12) 51 80 Abs err 29 exceeds tol 0
2755 (3,12) 58 56 Abs err 2 exceeds tol 0
2756 (5,12) 192 158 Abs err 34 exceeds tol 0
2757 (6,12) 104 84 Abs err 20 exceeds tol 0
2758 (7,12) 19 31 Abs err 12 exceeds tol 0
2759 (8,12) 65 140 Abs err 75 exceeds tol 0
2760 (9,12) 214 215 Abs err 1 exceeds tol 0
2761 (10,12) 180 55 Abs err 125 exceeds tol 0
2762 (11,12) 29 16 Abs err 13 exceeds tol 0
2763 (1,13) 145 140 Abs err 5 exceeds tol 0
2764 (2,13) 150 151 Abs err 1 exceeds tol 0
2765 (3,13) 124 137 Abs err 13 exceeds tol 0
2766 (4,13) 89 61 Abs err 28 exceeds tol 0
2767 (5,13) 39 27 Abs err 12 exceeds tol 0
2768 (6,13) 37 48 Abs err 11 exceeds tol 0
2769 (7,13) 89 144 Abs err 55 exceeds tol 0
2770 (8,13) 166 183 Abs err 17 exceeds tol 0
2771 (9,13) 198 153 Abs err 45 exceeds tol 0
2772 (10,13) 118 35 Abs err 83 exceeds tol 0
2773 (1,14) 129 124 Abs err 5 exceeds tol 0
2774 (2,14) 146 118 Abs err 28 exceeds tol 0
2775 (3,14) 121 105 Abs err 16 exceeds tol 0
2776 (4,14) 67 85 Abs err 18 exceeds tol 0
2777 (5,14) 25 69 Abs err 44 exceeds tol 0
2778 (6,14) 49 76 Abs err 27 exceeds tol 0
2779 (7,14) 119 130 Abs err 11 exceeds tol 0
2780 (8,14) 189 180 Abs err 9 exceeds tol 0
2781 (9,14) 197 177 Abs err 20 exceeds tol 0
2782 (10,14) 121 63 Abs err 58 exceeds tol 0
2783 (11,14) 35 36 Abs err 1 exceeds tol 0
2784 (1,15) 106 108 Abs err 2 exceeds tol 0
2785 (2,15) 53 63 Abs err 10 exceeds tol 0
2786 (3,15) 59 49 Abs err 10 exceeds tol 0
2787 (4,15) 133 145 Abs err 12 exceeds tol 0
2788 (5,15) 157 152 Abs err 5 exceeds tol 0
2789 (6,15) 118 115 Abs err 3 exceeds tol 0
2790 (7,15) 78 81 Abs err 3 exceeds tol 0
2791 (8,15) 118 164 Abs err 46 exceeds tol 0
2792 (9,15) 217 219 Abs err 2 exceeds tol 0
2793 (10,15) 184 96 Abs err 88 exceeds tol 0
2794 (11,15) 73 67 Abs err 6 exceeds tol 0
2795 ***** xtest assert (imresize (uint8 (in), 1.5, "bilinear"), uint8 (out))
2796
2797 out = [108 136 125 89 107
2798 111 132 143 114 99
2799 106 110 106 127 136
2800 47 121 163 138 68];
2801 !!!!! known failure
2802 ASSERT errors for: assert (imresize (uint8 (in), 1.5, "bilinear"),uint8 (out))
2803
2804 Location | Observed | Expected | Reason
2805 (2,1) 48 44 Abs err 4 exceeds tol 0
2806 (3,1) 33 14 Abs err 19 exceeds tol 0
2807 (4,1) 124 145 Abs err 21 exceeds tol 0
2808 (5,1) 121 118 Abs err 3 exceeds tol 0
2809 (6,1) 71 62 Abs err 9 exceeds tol 0
2810 (7,1) 93 102 Abs err 9 exceeds tol 0
2811 (8,1) 96 82 Abs err 14 exceeds tol 0
2812 (9,1) 65 40 Abs err 25 exceeds tol 0
2813 (10,1) 36 11 Abs err 25 exceeds tol 0
2814 (11,1) 9 4 Abs err 5 exceeds tol 0
2815 (1,2) 187 185 Abs err 2 exceeds tol 0
2816 (2,2) 93 92 Abs err 1 exceeds tol 0
2817 (3,2) 45 21 Abs err 24 exceeds tol 0
2818 (4,2) 85 98 Abs err 13 exceeds tol 0
2819 (5,2) 126 139 Abs err 13 exceeds tol 0
2820 (6,2) 167 151 Abs err 16 exceeds tol 0
2821 (7,2) 145 132 Abs err 13 exceeds tol 0
2822 (8,2) 128 121 Abs err 7 exceeds tol 0
2823 (9,2) 123 96 Abs err 27 exceeds tol 0
2824 (10,2) 86 33 Abs err 53 exceeds tol 0
2825 (11,2) 33 17 Abs err 16 exceeds tol 0
2826 (1,3) 206 235 Abs err 29 exceeds tol 0
2827 (2,3) 126 143 Abs err 17 exceeds tol 0
2828 (3,3) 71 47 Abs err 24 exceeds tol 0
2829 (4,3) 64 49 Abs err 15 exceeds tol 0
2830 (5,3) 116 144 Abs err 28 exceeds tol 0
2831 (6,3) 197 218 Abs err 21 exceeds tol 0
2832 (7,3) 159 151 Abs err 8 exceeds tol 0
2833 (8,3) 137 154 Abs err 17 exceeds tol 0
2834 (9,3) 150 152 Abs err 2 exceeds tol 0
2835 (10,3) 121 73 Abs err 48 exceeds tol 0
2836 (11,3) 72 53 Abs err 19 exceeds tol 0
2837 (1,4) 158 171 Abs err 13 exceeds tol 0
2838 (2,4) 142 149 Abs err 7 exceeds tol 0
2839 (3,4) 114 107 Abs err 7 exceeds tol 0
2840 (4,4) 64 49 Abs err 15 exceeds tol 0
2841 (5,4) 86 92 Abs err 6 exceeds tol 0
2842 (6,4) 143 145 Abs err 2 exceeds tol 0
2843 (7,4) 124 119 Abs err 5 exceeds tol 0
2844 (8,4) 117 133 Abs err 16 exceeds tol 0
2845 (9,4) 137 149 Abs err 12 exceeds tol 0
2846 (10,4) 137 127 Abs err 10 exceeds tol 0
2847 (11,4) 127 121 Abs err 6 exceeds tol 0
2848 (1,5) 105 96 Abs err 9 exceeds tol 0
2849 (2,5) 163 164 Abs err 1 exceeds tol 0
2850 (3,5) 174 195 Abs err 21 exceeds tol 0
2851 (4,5) 94 71 Abs err 23 exceeds tol 0
2852 (5,5) 117 116 Abs err 1 exceeds tol 0
2853 (6,5) 190 174 Abs err 16 exceeds tol 0
2854 (7,5) 122 90 Abs err 32 exceeds tol 0
2855 (8,5) 82 87 Abs err 5 exceeds tol 0
2856 (9,5) 99 117 Abs err 18 exceeds tol 0
2857 (10,5) 117 137 Abs err 20 exceeds tol 0
2858 (11,5) 134 141 Abs err 7 exceeds tol 0
2859 (1,6) 86 64 Abs err 22 exceeds tol 0
2860 (3,6) 192 228 Abs err 36 exceeds tol 0
2861 (4,6) 124 107 Abs err 17 exceeds tol 0
2862 (5,6) 151 168 Abs err 17 exceeds tol 0
2863 (6,6) 226 219 Abs err 7 exceeds tol 0
2864 (7,6) 121 72 Abs err 49 exceeds tol 0
2865 (8,6) 55 41 Abs err 14 exceeds tol 0
2866 (9,6) 63 74 Abs err 11 exceeds tol 0
2867 (10,6) 93 125 Abs err 32 exceeds tol 0
2868 (11,6) 134 138 Abs err 4 exceeds tol 0
2869 (1,7) 135 134 Abs err 1 exceeds tol 0
2870 (2,7) 122 119 Abs err 3 exceeds tol 0
2871 (3,7) 121 115 Abs err 6 exceeds tol 0
2872 (4,7) 146 148 Abs err 2 exceeds tol 0
2873 (5,7) 178 201 Abs err 23 exceeds tol 0
2874 (6,7) 213 201 Abs err 12 exceeds tol 0
2875 (7,7) 116 72 Abs err 44 exceeds tol 0
2876 (8,7) 48 19 Abs err 29 exceeds tol 0
2877 (9,7) 37 34 Abs err 3 exceeds tol 0
2878 (10,7) 72 113 Abs err 41 exceeds tol 0
2879 (11,7) 131 133 Abs err 2 exceeds tol 0
2880 (1,8) 170 189 Abs err 19 exceeds tol 0
2881 (2,8) 117 123 Abs err 6 exceeds tol 0
2882 (3,8) 98 81 Abs err 17 exceeds tol 0
2883 (4,8) 145 159 Abs err 14 exceeds tol 0
2884 (5,8) 169 188 Abs err 19 exceeds tol 0
2885 (6,8) 182 164 Abs err 18 exceeds tol 0
2886 (7,8) 110 72 Abs err 38 exceeds tol 0
2887 (8,8) 69 67 Abs err 2 exceeds tol 0
2888 (9,8) 90 108 Abs err 18 exceeds tol 0
2889 (10,8) 126 158 Abs err 32 exceeds tol 0
2890 (11,8) 169 171 Abs err 2 exceeds tol 0
2891 (1,9) 175 186 Abs err 11 exceeds tol 0
2892 (2,9) 110 118 Abs err 8 exceeds tol 0
2893 (3,9) 82 70 Abs err 12 exceeds tol 0
2894 (4,9) 128 132 Abs err 4 exceeds tol 0
2895 (5,9) 150 159 Abs err 9 exceeds tol 0
2896 (6,9) 159 146 Abs err 13 exceeds tol 0
2897 (7,9) 110 83 Abs err 27 exceeds tol 0
2898 (8,9) 94 116 Abs err 22 exceeds tol 0
2899 (9,9) 144 179 Abs err 35 exceeds tol 0
2900 (10,9) 181 212 Abs err 31 exceeds tol 0
2901 (11,9) 211 220 Abs err 9 exceeds tol 0
2902 (1,10) 88 74 Abs err 14 exceeds tol 0
2903 (2,10) 52 44 Abs err 8 exceeds tol 0
2904 (3,10) 40 24 Abs err 16 exceeds tol 0
2905 (4,10) 76 58 Abs err 18 exceeds tol 0
2906 (5,10) 126 140 Abs err 14 exceeds tol 0
2907 (6,10) 184 187 Abs err 3 exceeds tol 0
2908 (7,10) 130 114 Abs err 16 exceeds tol 0
2909 (8,10) 101 95 Abs err 6 exceeds tol 0
2910 (9,10) 119 131 Abs err 12 exceeds tol 0
2911 (10,10) 167 229 Abs err 62 exceeds tol 0
2912 (11,10) 230 253 Abs err 23 exceeds tol 0
2913 (1,11) 89 90 Abs err 1 exceeds tol 0
2914 (2,11) 47 38 Abs err 9 exceeds tol 0
2915 (3,11) 41 19 Abs err 22 exceeds tol 0
2916 (4,11) 105 124 Abs err 19 exceeds tol 0
2917 (5,11) 140 167 Abs err 27 exceeds tol 0
2918 (6,11) 159 148 Abs err 11 exceeds tol 0
2919 (7,11) 104 60 Abs err 44 exceeds tol 0
2920 (8,11) 86 108 Abs err 22 exceeds tol 0
2921 (9,11) 144 175 Abs err 31 exceeds tol 0
2922 (10,11) 159 148 Abs err 11 exceeds tol 0
2923 (11,11) 153 141 Abs err 12 exceeds tol 0
2924 (1,12) 131 141 Abs err 10 exceeds tol 0
2925 (2,12) 72 80 Abs err 8 exceeds tol 0
2926 (3,12) 65 56 Abs err 9 exceeds tol 0
2927 (4,12) 160 176 Abs err 16 exceeds tol 0
2928 (5,12) 159 158 Abs err 1 exceeds tol 0
2929 (6,12) 109 84 Abs err 25 exceeds tol 0
2930 (7,12) 63 31 Abs err 32 exceeds tol 0
2931 (8,12) 70 140 Abs err 70 exceeds tol 0
2932 (9,12) 186 215 Abs err 29 exceeds tol 0
2933 (10,12) 151 55 Abs err 96 exceeds tol 0
2934 (11,12) 41 16 Abs err 25 exceeds tol 0
2935 (1,13) 136 140 Abs err 4 exceeds tol 0
2936 (2,13) 126 151 Abs err 25 exceeds tol 0
2937 (3,13) 112 137 Abs err 25 exceeds tol 0
2938 (4,13) 89 61 Abs err 28 exceeds tol 0
2939 (5,13) 70 27 Abs err 43 exceeds tol 0
2940 (6,13) 54 48 Abs err 6 exceeds tol 0
2941 (7,13) 100 144 Abs err 44 exceeds tol 0
2942 (8,13) 141 183 Abs err 42 exceeds tol 0
2943 (9,13) 173 153 Abs err 20 exceeds tol 0
2944 (10,13) 120 35 Abs err 85 exceeds tol 0
2945 (11,13) 26 7 Abs err 19 exceeds tol 0
2946 (1,14) 127 124 Abs err 3 exceeds tol 0
2947 (2,14) 121 118 Abs err 3 exceeds tol 0
2948 (3,14) 109 105 Abs err 4 exceeds tol 0
2949 (4,14) 83 85 Abs err 2 exceeds tol 0
2950 (6,14) 61 76 Abs err 15 exceeds tol 0
2951 (7,14) 111 130 Abs err 19 exceeds tol 0
2952 (8,14) 153 180 Abs err 27 exceeds tol 0
2953 (9,14) 178 177 Abs err 1 exceeds tol 0
2954 (10,14) 127 63 Abs err 64 exceeds tol 0
2955 (11,14) 38 36 Abs err 2 exceeds tol 0
2956 (1,15) 106 108 Abs err 2 exceeds tol 0
2957 (2,15) 69 63 Abs err 6 exceeds tol 0
2958 (3,15) 66 49 Abs err 17 exceeds tol 0
2959 (4,15) 130 145 Abs err 15 exceeds tol 0
2960 (5,15) 138 152 Abs err 14 exceeds tol 0
2961 (6,15) 118 115 Abs err 3 exceeds tol 0
2962 (7,15) 101 81 Abs err 20 exceeds tol 0
2963 (8,15) 117 164 Abs err 47 exceeds tol 0
2964 (9,15) 198 219 Abs err 21 exceeds tol 0
2965 (10,15) 164 96 Abs err 68 exceeds tol 0
2966 (11,15) 73 67 Abs err 6 exceeds tol 0
2967 ***** xtest assert (imresize (uint8 (in), 0.5, "bilinear"), uint8 (out))
2968
2969 out = [103 141 124 78 110
2970 111 134 153 114 91
2971 115 108 93 128 146
2972 38 124 175 143 54];
2973 !!!!! known failure
2974 ASSERT errors for: assert (imresize (uint8 (in), 0.5, "bilinear"),uint8 (out))
2975
2976 Location | Observed | Expected | Reason
2977 . O(4x5) E(11x15) Dimensions don't match
2978 ***** xtest assert (imresize (uint8 (in), 0.5, "bicubic"), uint8 (out))
2979 !!!!! known failure
2980 ASSERT errors for: assert (imresize (uint8 (in), 0.5, "bicubic"),uint8 (out))
2981
2982 Location | Observed | Expected | Reason
2983 . O(4x5) E(11x15) Dimensions don't match
2984 7 tests, 3 passed, 4 known failures, 0 skipped
2985 [otf2psf]
2986 >>>>> /usr/share/octave/packages/image-2.6.1/otf2psf.m
2987 ***** function otf = rand_otf (varargin)
2988 otf = complex (rand (varargin{:}), rand (varargin{:}));
2989 ***** endfunction
2990 ***** test
2991 otf = rand_otf (6, 1);
2992 assert (otf2psf (otf), circshift (ifft (otf), 3));
2993 ***** test
2994 otf = rand_otf (6, 6);
2995 assert (otf2psf (otf), circshift (ifft2 (otf), [3 3]));
2996 ***** test
2997 otf = rand_otf (6, 6, 6);
2998 assert (otf2psf (otf), circshift (ifftn (otf), [3 3 3]));
2999 ***** test
3000 otf = rand_otf (7, 1);
3001 assert (otf2psf (otf), circshift (ifft (otf), 3));
3002 ***** test
3003 otf = rand_otf (7, 7);
3004 assert (otf2psf (otf), circshift (ifft2 (otf), [3 3]));
3005 ***** test
3006 otf = rand_otf (6, 7, 8);
3007 assert (otf2psf (otf), circshift (ifftn (otf), [3 3 4]));
3008 ***** test
3009 otf = rand_otf (7, 1);
3010 ppsf = circshift (ifft (otf), 3);
3011 assert (otf2psf (otf, 6), ppsf(1:6));
3012 assert (otf2psf (otf, [6 1]), ppsf(1:6));
3013 ***** test
3014 otf = rand_otf (7, 7);
3015 ppsf = circshift (ifft2 (otf), [3 3]);
3016 assert (otf2psf (otf, [6 1]), ppsf(1:6,4));
3017 ***** test
3018 otf = rand_otf (6, 7);
3019 ppsf = circshift (ifft2 (otf), [3 3]);
3020 assert (otf2psf (otf, [6 6]), ppsf(:,1:6));
3021 ***** error <OTF must be numeric> otf2psf ("not a otf")
3022 ***** error <OUTSIZE must be smaller than> otf2psf (rand_otf (16), 18)
3023 ***** error <OUTSIZE must be smaller than> otf2psf (rand_otf (16), [14 18])
3024 ***** error <OUTSIZE must be smaller than> otf2psf (rand_otf (16), [18 18])
3025 ***** error <OUTSIZE must be smaller than> otf2psf (rand_otf (16, 1), 18)
3026 ***** test
3027 psf = fspecial ("gaussian", 16);
3028 otf = psf2otf (psf);
3029 assert (otf2psf (otf), psf, eps);
3030 ***** test
3031 psf = rand (16);
3032 otf = psf2otf (psf);
3033 assert (otf2psf (otf), psf, 2*eps);
3034 ***** test
3035 psf = rand (8);
3036 otf = psf2otf (psf, [16 16]);
3037 assert (otf2psf (otf, [8 8]), psf, 2*eps);
3038 17 tests, 17 passed, 0 known failure, 0 skipped
3039 [impyramid]
3040 >>>>> /usr/share/octave/packages/image-2.6.1/impyramid.m
3041 ***** test
3042 in = [116 227 153 69 146 194 59 130 139 106
3043 2 47 137 249 90 75 16 24 158 44
3044 155 68 46 84 166 156 69 204 32 152
3045 71 221 137 230 210 153 192 115 30 118
3046 107 143 108 52 51 73 101 21 175 90
3047 54 158 143 77 26 168 113 229 165 225
3048 9 47 133 135 130 207 236 43 19 73];
3049
3050 reduced = [
3051 114 139 131 103 111
3052 97 122 141 110 99
3053 103 123 112 123 121
3054 47 107 134 153 94];
3055
3056 ## this is what we should return if we were Matlab compatible
3057 reduced_matlab = [
3058 114 139 131 103 111
3059 97 122 141 111 100
3060 103 123 112 123 122
3061 47 107 134 153 94];
3062
3063 expanded = [
3064 88 132 160 154 132 108 94 102 120 138 138 100 66 74 96 112 116 104 78
3065 62 98 128 142 146 154 154 140 126 126 122 86 54 58 82 114 132 112 74
3066 36 54 74 100 130 168 184 156 118 104 92 64 40 44 66 100 122 104 66
3067 66 68 64 76 98 130 154 148 132 122 108 80 60 78 104 106 98 98 86
3068 104 106 88 78 78 96 122 144 154 154 140 112 98 124 144 110 74 92 106
3069 102 130 134 120 108 126 154 174 180 172 156 142 138 146 140 96 60 84 106
3070 88 140 170 158 140 156 180 188 180 164 152 154 156 140 112 82 66 84 96
3071 90 136 164 154 134 132 138 136 130 122 120 130 134 108 82 86 100 104 92
3072 92 126 142 136 116 96 80 74 72 82 94 106 106 88 78 108 138 132 102
3073 80 116 140 138 122 96 68 52 52 80 110 114 112 118 128 148 164 164 140
3074 58 98 132 140 130 110 82 62 62 102 142 144 138 154 168 164 156 170 162
3075 36 68 100 120 130 122 106 92 96 134 174 182 172 156 136 116 104 122 124
3076 16 34 58 86 108 114 110 106 112 138 170 184 172 126 74 48 44 60 68];
3077
3078 ## this is what we should return if we were Matlab compatible
3079 expanded_matlab = [
3080 115 154 185 178 150 122 105 116 138 159 158 117 78 86 112 129 133 120 103
3081 69 98 128 141 146 152 152 139 125 127 121 87 55 58 81 113 131 112 84
3082 40 54 74 100 131 167 184 157 119 104 92 64 41 44 66 100 121 103 74
3083 76 69 65 75 97 130 153 148 131 122 108 80 61 79 103 105 98 97 98
3084 120 105 88 77 78 96 121 143 155 154 140 112 98 124 143 109 74 91 123
3085 117 129 134 119 107 125 153 173 180 172 156 143 138 146 140 96 60 83 122
3086 99 139 170 157 139 156 181 188 180 164 151 154 156 140 112 81 65 84 110
3087 101 136 163 153 133 132 138 136 130 122 120 130 133 108 82 86 99 104 104
3088 103 126 143 136 116 97 81 73 73 82 94 105 105 87 78 108 138 133 116
3089 90 116 139 139 122 96 69 52 53 80 109 114 111 116 128 148 163 164 160
3090 66 99 131 140 131 109 83 62 62 102 142 144 138 154 169 164 157 169 184
3091 41 68 99 121 130 122 107 92 95 133 173 182 172 156 135 114 105 121 142
3092 21 38 64 98 124 131 127 123 129 160 194 212 199 144 82 52 48 65 85];
3093
3094 assert (impyramid (uint8 (in), "reduce"), uint8 (reduced))
3095 assert (impyramid (uint8 (in), "expand"), uint8 (expanded))
3096 !!!!! test failed
3097 ASSERT errors for: assert (impyramid (uint8 (in), "expand"),uint8 (expanded))
3098
3099 Location | Observed | Expected | Reason
3100 (1,1) 87 88 Abs err 1 exceeds tol 0
3101 (2,1) 61 62 Abs err 1 exceeds tol 0
3102 (5,1) 105 104 Abs err 1 exceeds tol 0
3103 (6,1) 103 102 Abs err 1 exceeds tol 0
3104 (7,1) 89 88 Abs err 1 exceeds tol 0
3105 (9,1) 91 92 Abs err 1 exceeds tol 0
3106 (10,1) 79 80 Abs err 1 exceeds tol 0
3107 (11,1) 59 58 Abs err 1 exceeds tol 0
3108 (13,1) 17 16 Abs err 1 exceeds tol 0
3109 (5,2) 105 106 Abs err 1 exceeds tol 0
3110 (6,2) 129 130 Abs err 1 exceeds tol 0
3111 (7,2) 139 140 Abs err 1 exceeds tol 0
3112 (9,2) 125 126 Abs err 1 exceeds tol 0
3113 (11,2) 99 98 Abs err 1 exceeds tol 0
3114 (12,2) 67 68 Abs err 1 exceeds tol 0
3115 (1,3) 159 160 Abs err 1 exceeds tol 0
3116 (8,3) 163 164 Abs err 1 exceeds tol 0
3117 (10,3) 139 140 Abs err 1 exceeds tol 0
3118 (11,3) 131 132 Abs err 1 exceeds tol 0
3119 (12,3) 98 100 Abs err 2 exceeds tol 0
3120 (2,4) 141 142 Abs err 1 exceeds tol 0
3121 (4,4) 75 76 Abs err 1 exceeds tol 0
3122 (5,4) 77 78 Abs err 1 exceeds tol 0
3123 (6,4) 118 120 Abs err 2 exceeds tol 0
3124 (7,4) 157 158 Abs err 1 exceeds tol 0
3125 (8,4) 152 154 Abs err 2 exceeds tol 0
3126 (9,4) 135 136 Abs err 1 exceeds tol 0
3127 (1,5) 131 132 Abs err 1 exceeds tol 0
3128 (4,5) 97 98 Abs err 1 exceeds tol 0
3129 (5,5) 77 78 Abs err 1 exceeds tol 0
3130 (6,5) 106 108 Abs err 2 exceeds tol 0
3131 (7,5) 139 140 Abs err 1 exceeds tol 0
3132 (8,5) 132 134 Abs err 2 exceeds tol 0
3133 (10,5) 121 122 Abs err 1 exceeds tol 0
3134 (11,5) 131 130 Abs err 1 exceeds tol 0
3135 (13,5) 109 108 Abs err 1 exceeds tol 0
3136 (1,6) 107 108 Abs err 1 exceeds tol 0
3137 (2,6) 152 154 Abs err 2 exceeds tol 0
3138 (3,6) 167 168 Abs err 1 exceeds tol 0
3139 (4,6) 129 130 Abs err 1 exceeds tol 0
3140 (6,6) 124 126 Abs err 2 exceeds tol 0
3141 (9,6) 97 96 Abs err 1 exceeds tol 0
3142 (10,6) 95 96 Abs err 1 exceeds tol 0
3143 (11,6) 109 110 Abs err 1 exceeds tol 0
3144 (2,7) 152 154 Abs err 2 exceeds tol 0
3145 (4,7) 152 154 Abs err 2 exceeds tol 0
3146 (5,7) 121 122 Abs err 1 exceeds tol 0
3147 (6,7) 153 154 Abs err 1 exceeds tol 0
3148 (8,7) 137 138 Abs err 1 exceeds tol 0
3149 (9,7) 81 80 Abs err 1 exceeds tol 0
3150 (10,7) 69 68 Abs err 1 exceeds tol 0
3151 (11,7) 83 82 Abs err 1 exceeds tol 0
3152 (12,7) 107 106 Abs err 1 exceeds tol 0
3153 (2,8) 139 140 Abs err 1 exceeds tol 0
3154 (4,8) 147 148 Abs err 1 exceeds tol 0
3155 (5,8) 142 144 Abs err 2 exceeds tol 0
3156 (6,8) 173 174 Abs err 1 exceeds tol 0
3157 (7,8) 187 188 Abs err 1 exceeds tol 0
3158 (9,8) 73 74 Abs err 1 exceeds tol 0
3159 (2,9) 125 126 Abs err 1 exceeds tol 0
3160 (4,9) 131 132 Abs err 1 exceeds tol 0
3161 (5,9) 155 154 Abs err 1 exceeds tol 0
3162 (12,9) 95 96 Abs err 1 exceeds tol 0
3163 (13,9) 111 112 Abs err 1 exceeds tol 0
3164 (3,10) 103 104 Abs err 1 exceeds tol 0
3165 (6,10) 171 172 Abs err 1 exceeds tol 0
3166 (9,10) 81 82 Abs err 1 exceeds tol 0
3167 (12,10) 133 134 Abs err 1 exceeds tol 0
3168 (13,10) 139 138 Abs err 1 exceeds tol 0
3169 (1,11) 137 138 Abs err 1 exceeds tol 0
3170 (2,11) 120 122 Abs err 2 exceeds tol 0
3171 (5,11) 139 140 Abs err 1 exceeds tol 0
3172 (7,11) 151 152 Abs err 1 exceeds tol 0
3173 (8,11) 119 120 Abs err 1 exceeds tol 0
3174 (10,11) 109 110 Abs err 1 exceeds tol 0
3175 (12,11) 172 174 Abs err 2 exceeds tol 0
3176 (13,11) 169 170 Abs err 1 exceeds tol 0
3177 (1,12) 101 100 Abs err 1 exceeds tol 0
3178 (4,12) 79 80 Abs err 1 exceeds tol 0
3179 (6,12) 143 142 Abs err 1 exceeds tol 0
3180 (9,12) 104 106 Abs err 2 exceeds tol 0
3181 (12,12) 181 182 Abs err 1 exceeds tol 0
3182 (1,13) 67 66 Abs err 1 exceeds tol 0
3183 (2,13) 55 54 Abs err 1 exceeds tol 0
3184 (3,13) 41 40 Abs err 1 exceeds tol 0
3185 (4,13) 61 60 Abs err 1 exceeds tol 0
3186 (6,13) 137 138 Abs err 1 exceeds tol 0
3187 (8,13) 133 134 Abs err 1 exceeds tol 0
3188 (9,13) 105 106 Abs err 1 exceeds tol 0
3189 (10,13) 111 112 Abs err 1 exceeds tol 0
3190 (12,13) 171 172 Abs err 1 exceeds tol 0
3191 (13,13) 173 172 Abs err 1 exceeds tol 0
3192 (1,14) 73 74 Abs err 1 exceeds tol 0
3193 (2,14) 57 58 Abs err 1 exceeds tol 0
3194 (6,14) 145 146 Abs err 1 exceeds tol 0
3195 (8,14) 107 108 Abs err 1 exceeds tol 0
3196 (9,14) 86 88 Abs err 2 exceeds tol 0
3197 (10,14) 116 118 Abs err 2 exceeds tol 0
3198 (11,14) 153 154 Abs err 1 exceeds tol 0
3199 (12,14) 155 156 Abs err 1 exceeds tol 0
3200 (1,15) 97 96 Abs err 1 exceeds tol 0
3201 (2,15) 81 82 Abs err 1 exceeds tol 0
3202 (4,15) 103 104 Abs err 1 exceeds tol 0
3203 (5,15) 143 144 Abs err 1 exceeds tol 0
3204 (11,15) 169 168 Abs err 1 exceeds tol 0
3205 (12,15) 135 136 Abs err 1 exceeds tol 0
3206 (2,16) 113 114 Abs err 1 exceeds tol 0
3207 (4,16) 105 106 Abs err 1 exceeds tol 0
3208 (5,16) 109 110 Abs err 1 exceeds tol 0
3209 (6,16) 95 96 Abs err 1 exceeds tol 0
3210 (7,16) 81 82 Abs err 1 exceeds tol 0
3211 (8,16) 85 86 Abs err 1 exceeds tol 0
3212 (9,16) 107 108 Abs err 1 exceeds tol 0
3213 (12,16) 114 116 Abs err 2 exceeds tol 0
3214 (2,17) 130 132 Abs err 2 exceeds tol 0
3215 (3,17) 121 122 Abs err 1 exceeds tol 0
3216 (7,17) 65 66 Abs err 1 exceeds tol 0
3217 (8,17) 98 100 Abs err 2 exceeds tol 0
3218 (10,17) 163 164 Abs err 1 exceeds tol 0
3219 (11,17) 157 156 Abs err 1 exceeds tol 0
3220 (12,17) 105 104 Abs err 1 exceeds tol 0
3221 (1,18) 105 104 Abs err 1 exceeds tol 0
3222 (3,18) 103 104 Abs err 1 exceeds tol 0
3223 (4,18) 97 98 Abs err 1 exceeds tol 0
3224 (5,18) 91 92 Abs err 1 exceeds tol 0
3225 (6,18) 83 84 Abs err 1 exceeds tol 0
3226 (8,18) 103 104 Abs err 1 exceeds tol 0
3227 (9,18) 133 132 Abs err 1 exceeds tol 0
3228 (11,18) 169 170 Abs err 1 exceeds tol 0
3229 (12,18) 121 122 Abs err 1 exceeds tol 0
3230 (13,18) 59 60 Abs err 1 exceeds tol 0
3231 (1,19) 79 78 Abs err 1 exceeds tol 0
3232 (2,19) 75 74 Abs err 1 exceeds tol 0
3233 (4,19) 85 86 Abs err 1 exceeds tol 0
3234 (5,19) 107 106 Abs err 1 exceeds tol 0
3235 (6,19) 105 106 Abs err 1 exceeds tol 0
3236 (7,19) 95 96 Abs err 1 exceeds tol 0
3237 (8,19) 91 92 Abs err 1 exceeds tol 0
3238 (10,19) 139 140 Abs err 1 exceeds tol 0
3239 (11,19) 160 162 Abs err 2 exceeds tol 0
3240 (12,19) 123 124 Abs err 1 exceeds tol 0
3241 (13,19) 67 68 Abs err 1 exceeds tol 0
3242 ***** test
3243 in = randi ([0 255], [40 39 3 5], "uint8");
3244 red = impyramid (in, "reduce");
3245 for p = 1:3
3246 for n = 1:5
3247 assert (red(:,:,p,n), impyramid (in(:,:,p,n), "reduce"))
3248 endfor
3249 endfor
3250
3251 exp = impyramid (in, "expand");
3252 for p = 1:3
3253 for n = 1:5
3254 assert (exp(:,:,p,n), impyramid (in(:,:,p,n), "expand"))
3255 endfor
3256 endfor
3257 ***** test
3258 in = repmat (uint8 (255), [10 10]);
3259 assert (impyramid (in, "reduce"), repmat (uint8 (255), [5 5]))
3260 assert (impyramid (in, "expand"), repmat (uint8 (255), [19 19]))
3261 !!!!! test failed
3262 ASSERT errors for: assert (impyramid (in, "expand"),repmat (uint8 (255), [19, 19]))
3263
3264 Location | Observed | Expected | Reason
3265 (1,1) 195 255 Abs err 60 exceeds tol 0
3266 (2,1) 223 255 Abs err 32 exceeds tol 0
3267 (3,1) 223 255 Abs err 32 exceeds tol 0
3268 (4,1) 223 255 Abs err 32 exceeds tol 0
3269 (5,1) 223 255 Abs err 32 exceeds tol 0
3270 (6,1) 223 255 Abs err 32 exceeds tol 0
3271 (7,1) 223 255 Abs err 32 exceeds tol 0
3272 (8,1) 223 255 Abs err 32 exceeds tol 0
3273 (9,1) 223 255 Abs err 32 exceeds tol 0
3274 (10,1) 223 255 Abs err 32 exceeds tol 0
3275 (11,1) 223 255 Abs err 32 exceeds tol 0
3276 (12,1) 223 255 Abs err 32 exceeds tol 0
3277 (13,1) 223 255 Abs err 32 exceeds tol 0
3278 (14,1) 223 255 Abs err 32 exceeds tol 0
3279 (15,1) 223 255 Abs err 32 exceeds tol 0
3280 (16,1) 223 255 Abs err 32 exceeds tol 0
3281 (17,1) 223 255 Abs err 32 exceeds tol 0
3282 (18,1) 223 255 Abs err 32 exceeds tol 0
3283 (19,1) 195 255 Abs err 60 exceeds tol 0
3284 (1,2) 223 255 Abs err 32 exceeds tol 0
3285 (19,2) 223 255 Abs err 32 exceeds tol 0
3286 (1,3) 223 255 Abs err 32 exceeds tol 0
3287 (19,3) 223 255 Abs err 32 exceeds tol 0
3288 (1,4) 223 255 Abs err 32 exceeds tol 0
3289 (19,4) 223 255 Abs err 32 exceeds tol 0
3290 (1,5) 223 255 Abs err 32 exceeds tol 0
3291 (19,5) 223 255 Abs err 32 exceeds tol 0
3292 (1,6) 223 255 Abs err 32 exceeds tol 0
3293 (19,6) 223 255 Abs err 32 exceeds tol 0
3294 (1,7) 223 255 Abs err 32 exceeds tol 0
3295 (19,7) 223 255 Abs err 32 exceeds tol 0
3296 (1,8) 223 255 Abs err 32 exceeds tol 0
3297 (19,8) 223 255 Abs err 32 exceeds tol 0
3298 (1,9) 223 255 Abs err 32 exceeds tol 0
3299 (19,9) 223 255 Abs err 32 exceeds tol 0
3300 (1,10) 223 255 Abs err 32 exceeds tol 0
3301 (19,10) 223 255 Abs err 32 exceeds tol 0
3302 (1,11) 223 255 Abs err 32 exceeds tol 0
3303 (19,11) 223 255 Abs err 32 exceeds tol 0
3304 (1,12) 223 255 Abs err 32 exceeds tol 0
3305 (19,12) 223 255 Abs err 32 exceeds tol 0
3306 (1,13) 223 255 Abs err 32 exceeds tol 0
3307 (19,13) 223 255 Abs err 32 exceeds tol 0
3308 (1,14) 223 255 Abs err 32 exceeds tol 0
3309 (19,14) 223 255 Abs err 32 exceeds tol 0
3310 (1,15) 223 255 Abs err 32 exceeds tol 0
3311 (19,15) 223 255 Abs err 32 exceeds tol 0
3312 (1,16) 223 255 Abs err 32 exceeds tol 0
3313 (19,16) 223 255 Abs err 32 exceeds tol 0
3314 (1,17) 223 255 Abs err 32 exceeds tol 0
3315 (19,17) 223 255 Abs err 32 exceeds tol 0
3316 (1,18) 223 255 Abs err 32 exceeds tol 0
3317 (19,18) 223 255 Abs err 32 exceeds tol 0
3318 (1,19) 195 255 Abs err 60 exceeds tol 0
3319 (2,19) 223 255 Abs err 32 exceeds tol 0
3320 (3,19) 223 255 Abs err 32 exceeds tol 0
3321 (4,19) 223 255 Abs err 32 exceeds tol 0
3322 (5,19) 223 255 Abs err 32 exceeds tol 0
3323 (6,19) 223 255 Abs err 32 exceeds tol 0
3324 (7,19) 223 255 Abs err 32 exceeds tol 0
3325 (8,19) 223 255 Abs err 32 exceeds tol 0
3326 (9,19) 223 255 Abs err 32 exceeds tol 0
3327 (10,19) 223 255 Abs err 32 exceeds tol 0
3328 (11,19) 223 255 Abs err 32 exceeds tol 0
3329 (12,19) 223 255 Abs err 32 exceeds tol 0
3330 (13,19) 223 255 Abs err 32 exceeds tol 0
3331 (14,19) 223 255 Abs err 32 exceeds tol 0
3332 (15,19) 223 255 Abs err 32 exceeds tol 0
3333 (16,19) 223 255 Abs err 32 exceeds tol 0
3334 (17,19) 223 255 Abs err 32 exceeds tol 0
3335 (18,19) 223 255 Abs err 32 exceeds tol 0
3336 (19,19) 195 255 Abs err 60 exceeds tol 0
3337 ***** test
3338 in = logical ([
3339 1 0 1 1 0 0 1 1 0 0
3340 1 1 0 0 0 1 0 0 1 0
3341 0 1 1 0 1 1 1 1 1 1
3342 1 0 1 0 1 0 1 0 1 1
3343 1 1 1 0 0 0 1 1 1 1
3344 0 0 1 1 0 0 1 0 0 0
3345 0 0 1 1 0 1 1 0 1 1
3346 1 1 0 0 1 0 0 0 1 0
3347 1 1 1 1 1 1 0 1 0 0
3348 1 1 0 0 1 0 0 0 1 0]);
3349
3350 reduced = logical ([
3351 1 1 0 1 0
3352 1 1 0 1 1
3353 1 1 0 1 1
3354 0 1 0 0 0
3355 1 1 1 0 0]);
3356
3357 expanded = logical ([
3358 1 1 0 0 1 1 1 0 0 0 0 0 1 1 1 0 0 0 0
3359 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
3360 1 1 1 1 0 0 0 0 0 0 1 1 0 0 0 1 1 0 0
3361 1 1 1 1 0 0 0 0 0 1 1 1 1 0 1 1 1 1 1
3362 0 1 1 1 1 0 0 0 1 1 1 1 1 1 1 1 1 1 1
3363 0 0 1 1 1 0 0 0 1 1 1 1 1 1 1 1 1 1 1
3364 1 1 0 1 1 0 0 0 1 0 0 1 1 1 0 1 1 1 1
3365 1 1 1 1 1 0 0 0 0 0 0 0 1 1 1 1 1 1 1
3366 1 1 1 1 1 1 0 0 0 0 0 0 1 1 1 1 1 1 1
3367 0 0 1 1 1 1 0 0 0 0 0 0 1 1 1 0 0 0 0
3368 0 0 0 1 1 1 1 0 0 0 0 1 1 1 0 0 0 0 0
3369 0 0 0 0 1 1 1 0 0 0 0 1 1 0 0 0 0 0 0
3370 0 0 0 0 1 1 1 0 0 0 1 1 1 0 0 0 1 1 1
3371 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1
3372 1 1 1 1 0 0 0 1 1 1 0 0 0 0 0 0 1 0 0
3373 1 1 1 1 1 0 1 1 1 1 0 0 0 0 0 0 0 0 0
3374 1 1 1 1 1 1 1 1 1 1 1 0 0 0 1 0 0 0 0
3375 1 1 1 1 1 0 1 1 1 1 0 0 0 0 0 0 0 0 0
3376 1 1 1 1 0 0 0 1 1 1 0 0 0 0 0 0 1 0 0]);
3377
3378 assert (impyramid (in, "reduce"), reduced)
3379 assert (impyramid (in, "expand"), expanded)
3380 !!!!! test failed
3381 ASSERT errors for: assert (impyramid (in, "reduce"),reduced)
3382
3383 Location | Observed | Expected | Reason
3384 (4,1) 1 0 Abs err 1 exceeds tol 0
3385 (1,3) 1 0 Abs err 1 exceeds tol 0
3386 (2,3) 1 0 Abs err 1 exceeds tol 0
3387 (3,3) 1 0 Abs err 1 exceeds tol 0
3388 (4,3) 1 0 Abs err 1 exceeds tol 0
3389 (4,4) 1 0 Abs err 1 exceeds tol 0
3390 (5,4) 1 0 Abs err 1 exceeds tol 0
3391 (1,5) 1 0 Abs err 1 exceeds tol 0
3392 (4,5) 1 0 Abs err 1 exceeds tol 0
3393 (5,5) 1 0 Abs err 1 exceeds tol 0
3394 4 tests, 1 passed, 0 known failure, 0 skipped
3395 [histeq]
3396 >>>>> /usr/share/octave/packages/image-2.6.1/histeq.m
3397 ***** assert (histeq ([]), []);
3398 ***** assert (histeq (0), 1);
3399 ***** assert (histeq (1), 1);
3400 ***** assert (histeq (1.5), 1);
3401 ***** assert (histeq (zeros (100, 200)), ones (100, 200)); # matrix
3402 ***** xtest assert (histeq ([0 1]), [0.4920634921 1], 10^-8);
3403 !!!!! known failure
3404 ASSERT errors for: assert (histeq ([0, 1]),[0.4920634921, 1],10 ^ -8)
3405
3406 Location | Observed | Expected | Reason
3407 (1) 0.5 0.49206 Abs err 0.0079365 exceeds tol 1e-08
3408 ***** xtest assert (histeq ([0 1]'), [0.4920634921 1]', 10^-8); # column array
3409 !!!!! known failure
3410 ASSERT errors for: assert (histeq ([0, 1]'),[0.4920634921, 1]',10 ^ -8)
3411
3412 Location | Observed | Expected | Reason
3413 (1) 0.5 0.49206 Abs err 0.0079365 exceeds tol 1e-08
3414 ***** xtest assert (histeq ([0 255]), [0.4920634921 1], 10^-8);
3415 !!!!! known failure
3416 ASSERT errors for: assert (histeq ([0, 255]),[0.4920634921, 1],10 ^ -8)
3417
3418 Location | Observed | Expected | Reason
3419 (1) 0.5 0.49206 Abs err 0.0079365 exceeds tol 1e-08
3420 ***** xtest assert (histeq (uint8 ([0 1])), [ 125 190]); # uint8
3421 !!!!! known failure
3422 ASSERT errors for: assert (histeq (uint8 ([0, 1])),[125, 190])
3423
3424 Location | Observed | Expected | Reason
3425 (1) 0.5 125 Abs err 124.5 exceeds tol 0
3426 (2) 1 190 Abs err 189 exceeds tol 0
3427 ***** xtest assert (histeq (uint8 ([0 255])), [ 125 255]);
3428 !!!!! known failure
3429 ASSERT errors for: assert (histeq (uint8 ([0, 255])),[125, 255])
3430
3431 Location | Observed | Expected | Reason
3432 (1) 0.5 125 Abs err 124.5 exceeds tol 0
3433 (2) 1 255 Abs err 254 exceeds tol 0
3434 ***** xtest assert (histeq (uint16 ([0 1])), [65535 65535]); # uint16
3435 !!!!! known failure
3436 ASSERT errors for: assert (histeq (uint16 ([0, 1])),[65535, 65535])
3437
3438 Location | Observed | Expected | Reason
3439 (1) 0.5 65535 Abs err 65534 exceeds tol 0
3440 (2) 1 65535 Abs err 65534 exceeds tol 0
3441 ***** xtest assert (histeq (uint16 ([0 255])), [32247 48891]);
3442 !!!!! known failure
3443 ASSERT errors for: assert (histeq (uint16 ([0, 255])),[32247, 48891])
3444
3445 Location | Observed | Expected | Reason
3446 (1) 0.5 32247 Abs err 32246 exceeds tol 0
3447 (2) 1 48891 Abs err 48890 exceeds tol 0
3448 ***** xtest assert (histeq (uint16 ([0 256])), [32247 48891]);
3449 !!!!! known failure
3450 ASSERT errors for: assert (histeq (uint16 ([0, 256])),[32247, 48891])
3451
3452 Location | Observed | Expected | Reason
3453 (1) 0.5 32247 Abs err 32246 exceeds tol 0
3454 (2) 1 48891 Abs err 48890 exceeds tol 0
3455 ***** xtest assert (histeq (uint16 ([0 65535])), [32247 65535]);
3456 !!!!! known failure
3457 ASSERT errors for: assert (histeq (uint16 ([0, 65535])),[32247, 65535])
3458
3459 Location | Observed | Expected | Reason
3460 (1) 0.5 32247 Abs err 32246 exceeds tol 0
3461 (2) 1 65535 Abs err 65534 exceeds tol 0
3462 ***** test assert (histeq ([0 1 1] ), [ 1/3 1 1] , 10^-8);
3463 ***** test assert (histeq ([0 0 1]'), [ 2/3 2/3 1]', 10^-8);
3464 ***** xtest assert (histeq ([0 1 2] ), [ 1/3 1 1] , 10^-8);
3465 !!!!! known failure
3466 ASSERT errors for: assert (histeq ([0, 1, 2]),[1 / 3, 1, 1],10 ^ -8)
3467
3468 Location | Observed | Expected | Reason
3469 (2) 0.66667 1 Abs err 0.33333 exceeds tol 1e-08
3470 ***** xtest assert (histeq (uint8 ([0 1 2])), [ 85 125 215]);
3471 !!!!! known failure
3472 ASSERT errors for: assert (histeq (uint8 ([0, 1, 2])),[85, 125, 215])
3473
3474 Location | Observed | Expected | Reason
3475 (1) 0.33333 85 Abs err 84.667 exceeds tol 0
3476 (2) 0.66667 125 Abs err 124.33 exceeds tol 0
3477 (3) 1 215 Abs err 214 exceeds tol 0
3478 ***** xtest assert (histeq (uint16 ([0 1 2])), [65535 65535 65535]);
3479 !!!!! known failure
3480 ASSERT errors for: assert (histeq (uint16 ([0, 1, 2])),[65535, 65535, 65535])
3481
3482 Location | Observed | Expected | Reason
3483 (1) 0.33333 65535 Abs err 65535 exceeds tol 0
3484 (2) 0.66667 65535 Abs err 65534 exceeds tol 0
3485 (3) 1 65535 Abs err 65534 exceeds tol 0
3486 ***** xtest assert (histeq (uint16 ([0 100 200])), [43690 43690 55133]);
3487 !!!!! known failure
3488 ASSERT errors for: assert (histeq (uint16 ([0, 100, 200])),[43690, 43690, 55133])
3489
3490 Location | Observed | Expected | Reason
3491 (1) 0.33333 43690 Abs err 43690 exceeds tol 0
3492 (2) 0.66667 43690 Abs err 43689 exceeds tol 0
3493 (3) 1 55133 Abs err 55132 exceeds tol 0
3494 ***** xtest
3495 J = [20 32 57 81 105 125 150 174 198 223 247];
3496 assert (histeq (uint8 (0:10:100)), J);
3497 !!!!! known failure
3498 ASSERT errors for: assert (histeq (uint8 (0:10:100)),J)
3499
3500 Location | Observed | Expected | Reason
3501 (1) 0.090909 20 Abs err 19.909 exceeds tol 0
3502 (2) 0.18182 32 Abs err 31.818 exceeds tol 0
3503 (3) 0.27273 57 Abs err 56.727 exceeds tol 0
3504 (4) 0.36364 81 Abs err 80.636 exceeds tol 0
3505 (5) 0.45455 105 Abs err 104.55 exceeds tol 0
3506 (6) 0.54545 125 Abs err 124.45 exceeds tol 0
3507 (7) 0.63636 150 Abs err 149.36 exceeds tol 0
3508 (8) 0.72727 174 Abs err 173.27 exceeds tol 0
3509 (9) 0.81818 198 Abs err 197.18 exceeds tol 0
3510 (10) 0.90909 223 Abs err 222.09 exceeds tol 0
3511 (11) 1 247 Abs err 246 exceeds tol 0
3512 ***** xtest
3513 J = [0.0793650794
3514 0.1269841270
3515 0.2222222222
3516 0.3174603175
3517 0.4126984127
3518 0.4920634921
3519 0.5873015873
3520 0.6825396825
3521 0.7777777778
3522 0.8730158730
3523 1.0000000000];
3524 assert (histeq (0:0.1:1), J', 10^-8);
3525 !!!!! known failure
3526 ASSERT errors for: assert (histeq (0:0.1:1),J',10 ^ -8)
3527
3528 Location | Observed | Expected | Reason
3529 (1) 0.090909 0.079365 Abs err 0.011544 exceeds tol 1e-08
3530 (2) 0.18182 0.12698 Abs err 0.054834 exceeds tol 1e-08
3531 (3) 0.27273 0.22222 Abs err 0.050505 exceeds tol 1e-08
3532 (4) 0.36364 0.31746 Abs err 0.046176 exceeds tol 1e-08
3533 (5) 0.45455 0.4127 Abs err 0.041847 exceeds tol 1e-08
3534 (6) 0.54545 0.49206 Abs err 0.053391 exceeds tol 1e-08
3535 (7) 0.63636 0.5873 Abs err 0.049062 exceeds tol 1e-08
3536 (8) 0.72727 0.68254 Abs err 0.044733 exceeds tol 1e-08
3537 (9) 0.81818 0.77778 Abs err 0.040404 exceeds tol 1e-08
3538 (10) 0.90909 0.87302 Abs err 0.036075 exceeds tol 1e-08
3539 22 tests, 7 passed, 15 known failures, 0 skipped
3540 [edge]
3541 >>>>> /usr/share/octave/packages/image-2.6.1/edge.m
3542 ***** test
3543 im = [
3544 249 238 214 157 106 69 60 90 131 181 224 247 252 250 250
3545 250 242 221 165 112 73 62 91 133 183 225 248 252 250 251
3546 252 246 228 173 120 78 63 90 130 181 224 248 253 251 251
3547 253 248 232 185 132 87 62 80 116 170 217 244 253 251 252
3548 253 249 236 198 149 101 66 71 101 155 206 238 252 252 252
3549 254 250 240 210 164 115 73 69 92 143 196 232 252 253 252
3550 70 70 68 61 49 36 24 22 26 38 52 63 70 70 70
3551 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
3552 62 63 62 59 51 42 33 25 22 26 36 45 56 60 62
3553 252 253 252 246 221 190 157 114 90 90 118 157 203 235 248
3554 251 253 254 251 233 209 182 136 103 92 107 139 185 225 245
3555 251 253 254 253 243 227 206 163 128 108 110 133 175 217 242
3556 252 253 254 254 249 241 228 195 164 137 127 139 172 212 239
3557 ] / 255;
3558
3559 methods = {"kirsch", "prewitt", "sobel"};
3560 for m_i = 1:numel (methods)
3561 method = methods{m_i};
3562
3563 bw = edge (im, method, 0.2, "both", "thinning");
3564 assert (edge (im, method, 0.2), bw)
3565
3566 args = perms ({0.2, "both", "thinning"});
3567 for i = 1:rows (args)
3568 assert (edge (im, method, args{i,:}), bw)
3569 endfor
3570
3571 bw = edge (im, method, 0.2, "vertical", "nothinning");
3572 args = perms ({0.2, "vertical", "nothinning"});
3573 for i = 1:rows (args)
3574 assert (edge (im, method, args{i,:}), bw)
3575 endfor
3576
3577 bw = edge (im, method, 0.2, "vertical", "thinning");
3578 args = perms ({0.2, "vertical"});
3579 for i = 1:rows (args)
3580 assert (edge (im, method, args{i,:}), bw)
3581 endfor
3582
3583 bw = edge (im, method, 0.2, "both", "nothinning");
3584 args = perms ({0.2, "nothinning"});
3585 for i = 1:rows (args)
3586 assert (edge (im, method, args{i,:}), bw)
3587 endfor
3588 endfor
3589 ***** error <more than 1 threshold argument>
3590 bw = edge (rand (10), "sobel", 0.2, 0.4)
3591 ***** error <more than 1 thinning argument>
3592 bw = edge (rand (10), "sobel", "thinning", "nothinning")
3593 ***** error <more than 1 direction argument>
3594 bw = edge (rand (10), "sobel", "both", "both")
3595 ***** error <only THRESH, DIRECTION, and THINNING arguments>
3596 bw = edge (rand (10), "sobel", [0.2 0.7], "both", "thinning")
3597 ***** error <more than 1 threshold argument>
3598 bw = edge (rand (10), "kirsch", 0.2, 0.4)
3599 ***** error <more than 1 thinning argument>
3600 bw = edge (rand (10), "kirsch", "thinning", "nothinning")
3601 ***** error <more than 1 direction argument>
3602 bw = edge (rand (10), "kirsch", "both", "both")
3603 ***** error <only THRESH, DIRECTION, and THINNING arguments>
3604 bw = edge (rand (10), "kirsch", [0.2 0.7], "both", "thinning")
3605 ***** error <more than 1 threshold argument>
3606 bw = edge (rand (10), "prewitt", 0.2, 0.4)
3607 ***** error <more than 1 thinning argument>
3608 bw = edge (rand (10), "prewitt", "thinning", "nothinning")
3609 ***** error <more than 1 direction argument>
3610 bw = edge (rand (10), "prewitt", "both", "both")
3611 ***** error <only THRESH, DIRECTION, and THINNING arguments>
3612 bw = edge (rand (10), "prewitt", [0.2 0.7], "both", "thinning")
3613 ***** test
3614 im = [
3615 249 238 214 157 106 69 60 90 131 181 224 247 252 250 250
3616 250 242 221 165 112 73 62 91 133 183 225 248 252 250 251
3617 252 246 228 173 120 78 63 90 130 181 224 248 253 251 251
3618 253 248 232 185 132 87 62 80 116 170 217 244 253 251 252
3619 253 249 236 198 149 101 66 71 101 155 206 238 252 252 252
3620 254 250 240 210 164 115 73 69 92 143 196 232 252 253 252
3621 70 70 68 61 49 36 24 22 26 38 52 63 70 70 70
3622 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
3623 62 63 62 59 51 42 33 25 22 26 36 45 56 60 62
3624 252 253 252 246 221 190 157 114 90 90 118 157 203 235 248
3625 251 253 254 251 233 209 182 136 103 92 107 139 185 225 245
3626 251 253 254 253 243 227 206 163 128 108 110 133 175 217 242
3627 252 253 254 254 249 241 228 195 164 137 127 139 172 212 239
3628 ] / 255;
3629
3630 bw = edge (im, "roberts", .2, "thinning");
3631 assert (edge (im, "roberts", 0.2), bw)
3632 assert (edge (im, "roberts", "thinning", 0.2), bw)
3633
3634 bw = edge (im, "roberts", .2, "nothinning");
3635 assert (edge (im, "roberts", "nothinning", 0.2), bw)
3636 ***** error <more than 1 threshold argument>
3637 bw = edge (rand (10), "roberts", 0.2, 0.4)
3638 ***** error <more than 1 thinning argument>
3639 bw = edge (rand (10), "roberts", "thinning", "nothinning")
3640 ***** error <only THRESH and THINNING arguments>
3641 bw = edge (rand (10), "roberts", "both", "thinning")
3642 ***** test
3643 im = rand (10);
3644 [~, thresh] = edge (im, "canny");
3645 assert (size (thresh), [1 2])
3646 [~, thresh] = edge (im, "canny", [.2 .6]);
3647 assert (thresh, [.2 .6])
3648 [~, thresh] = edge (im, "canny", [.2; .6]);
3649 assert (thresh, [.2 .6])
3650 ***** test
3651 in = zeros (5);
3652 in(3,3) = 1;
3653
3654 E = logical ([
3655 0 0 0 0 0
3656 0 0 1 0 0
3657 0 1 0 1 0
3658 0 0 1 0 0
3659 0 0 0 0 0]);
3660 assert (edge (in), E)
3661 assert (edge (uint8 (in.*100)), E)
3662 assert (edge (in, "sobel"), E)
3663 assert (edge (in, "sobel", 0), E)
3664 assert (edge (in, "sobel", 1), false (5))
3665
3666 [E, auto_thresh] = edge (in);
3667 assert (auto_thresh, 0.2449, 1e-4)
3668
3669 V = logical([
3670 0 0 0 0 0
3671 0 1 0 1 0
3672 0 1 0 1 0
3673 0 1 0 1 0
3674 0 0 0 0 0]);
3675 assert (edge (in, "sobel", 0, "vertical"), V)
3676
3677 H = logical ([
3678 0 0 0 0 0
3679 0 1 1 1 0
3680 0 0 0 0 0
3681 0 1 1 1 0
3682 0 0 0 0 0]);
3683 assert (edge (in, "sobel", 0, "horizontal"), H)
3684
3685 V = false (5);
3686 V(3,2) = true;
3687 V(3,4) = true;
3688 assert (edge (in, "sobel", [], "vertical"), V)
3689
3690 H = false (5);
3691 H(2,3) = true;
3692 H(4,3) = true;
3693 assert (edge (in, "sobel", [], "horizontal"), H)
3694 ***** test
3695 A = ones (5);
3696 A(3, 3) = 0;
3697 expected = logical ([
3698 0 0 0 0 0
3699 0 0 1 0 0
3700 0 1 0 1 0
3701 0 0 1 0 0
3702 0 0 0 0 0]);
3703 assert (edge (A), expected)
3704 ***** test
3705 in = zeros (5);
3706 in(3, 3) = 1;
3707
3708 E = logical ([
3709 0 0 0 0 0
3710 0 1 0 1 0
3711 0 0 0 0 0
3712 0 1 0 1 0
3713 0 0 0 0 0]);
3714
3715 assert (edge (in, "prewitt"), E)
3716
3717 [~, auto_thresh] = edge (in, "prewitt");
3718 assert (auto_thresh, 0.2309, 1e-4)
3719
3720 V = logical([
3721 0 0 0 0 0
3722 0 1 0 1 0
3723 0 1 0 1 0
3724 0 1 0 1 0
3725 0 0 0 0 0]);
3726 assert (edge (in, "prewitt", 0, "vertical"), V)
3727
3728 H = logical ([
3729 0 0 0 0 0
3730 0 1 1 1 0
3731 0 0 0 0 0
3732 0 1 1 1 0
3733 0 0 0 0 0]);
3734 assert (edge (in, "prewitt", 0, "horizontal"), H)
3735 ***** test
3736 in = zeros (5);
3737 in(3,3) = 1;
3738 in(3,4) = 0.9;
3739
3740 E = logical ([
3741 0 0 0 0 0
3742 0 0 1 0 0
3743 0 0 1 0 0
3744 0 0 0 0 0
3745 0 0 0 0 0]);
3746
3747 assert (edge (in, "roberts"), E)
3748
3749 [~, auto_thresh] = edge (in, "roberts");
3750 assert (auto_thresh, 0.6591, 1e-4)
3751
3752 E45 = [0 0 0 0 0
3753 0 -0.5 -0.45 0 0
3754 0 0 0.50 0.45 0
3755 0 0 0 0 0
3756 0 0 0 0 0];
3757 E135 = [0 0 0 0 0
3758 0 0 -0.50 -0.45 0
3759 0 0.5 0.45 0 0
3760 0 0 0 0 0
3761 0 0 0 0 0];
3762
3763 [~, ~, erg45, erg135] = edge (in, "roberts");
3764 assert (erg45, E45)
3765 assert (erg135, E135)
3766 ***** test
3767 in_8 = fspecial ("gaussian", [8 8], 2);
3768 in_8 /= in_8(4,4);
3769 in_8_uint8 = im2uint8 (in_8);
3770
3771 ## this is the result from Matlab's old canny method (before 2011a)
3772 out_8_old = logical ([
3773 0 0 0 0 0 0 0 0
3774 0 0 0 1 1 0 0 0
3775 0 0 1 0 0 1 0 0
3776 0 1 0 0 0 0 1 0
3777 0 1 0 0 0 0 1 0
3778 0 0 1 0 0 1 0 0
3779 0 0 0 1 1 0 0 0
3780 0 0 0 0 0 0 0 0]);
3781 out_8 = logical ([
3782 0 0 0 0 0 0 0 0
3783 0 1 1 1 1 1 0 0
3784 0 1 0 0 0 1 0 0
3785 0 1 0 0 0 1 0 0
3786 0 1 0 0 0 1 0 0
3787 0 1 1 1 1 1 0 0
3788 0 0 0 0 0 0 0 0
3789 0 0 0 0 0 0 0 0]);
3790 out_thresh = [0.34375 0.859375];
3791
3792 [obs_edge, obs_thresh] = edge (in_8, "Canny");
3793 assert (obs_edge, out_8)
3794 assert (obs_thresh, out_thresh)
3795
3796 [obs_edge_givethresh, obs_thresh_givethresh] ...
3797 = edge (in_8, "Canny", out_thresh);
3798 assert (obs_edge_givethresh, out_8)
3799 assert (obs_thresh_givethresh, out_thresh)
3800
3801 [obs_edge_uint8, obs_thresh_uint8] = edge (in_8_uint8, "Canny");
3802 assert (obs_edge_uint8, out_8)
3803 assert (obs_thresh_uint8, out_thresh)
3804 !!!!! test failed
3805 ASSERT errors for: assert (obs_thresh,out_thresh)
3806
3807 Location | Observed | Expected | Reason
3808 (1) 0.27112 0.34375 Abs err 0.072632 exceeds tol 0
3809 (2) 0.67779 0.85938 Abs err 0.18158 exceeds tol 0
3810 ***** test
3811 in_9 = fspecial ("gaussian", [9 9], 2);
3812 in_9 /= in_9(5,5);
3813
3814 ## this is the result from Matlab's old canny method (before 2011a)
3815 out_9_old = logical ([
3816 0 0 0 0 0 0 0 0 0
3817 0 0 0 0 0 0 0 0 0
3818 0 0 0 1 1 1 0 0 0
3819 0 0 1 0 0 0 1 0 0
3820 0 0 1 0 0 0 1 0 0
3821 0 0 1 0 0 0 1 0 0
3822 0 0 0 1 1 1 0 0 0
3823 0 0 0 0 0 0 0 0 0
3824 0 0 0 0 0 0 0 0 0]);
3825 out_9 = logical ([
3826 0 0 0 0 0 0 0 0 0
3827 0 0 1 1 1 1 0 0 0
3828 0 1 1 0 0 1 1 0 0
3829 0 1 0 0 0 0 1 0 0
3830 0 1 0 0 0 0 1 0 0
3831 0 1 1 0 0 1 1 0 0
3832 0 0 1 1 1 1 0 0 0
3833 0 0 0 0 0 0 0 0 0
3834 0 0 0 0 0 0 0 0 0]);
3835 out_thresh = [0.35 0.875];
3836
3837 [obs_edge, obs_thresh] = edge (in_9, "Canny");
3838 assert (obs_edge, out_9)
3839 assert (obs_thresh, out_thresh)
3840
3841 [obs_edge_givethresh, obs_thresh_givethresh] ...
3842 = edge (in_9, "Canny", out_thresh);
3843 assert (obs_edge_givethresh, out_9)
3844 assert (obs_thresh_givethresh, out_thresh)
3845 !!!!! test failed
3846 ASSERT errors for: assert (obs_thresh,out_thresh)
3847
3848 Location | Observed | Expected | Reason
3849 (1) 0.261 0.35 Abs err 0.089001 exceeds tol 0
3850 (2) 0.6525 0.875 Abs err 0.2225 exceeds tol 0
3851 24 tests, 22 passed, 0 known failure, 0 skipped
3852 [isbw]
3853 >>>>> /usr/share/octave/packages/image-2.6.1/isbw.m
3854 ***** shared img
3855 img = round (rand (10));
3856 ***** assert (isbw (img, "non-logical"), true);
3857 ***** assert (isbw (img, "logical"), false);
3858 ***** assert (isbw (logical (img), "logical"), true);
3859 ***** assert (isbw (logical (img), "non-logical"), true);
3860 ***** test
3861 img(1, 1) = 2;
3862 assert (isbw (img, "non-logical"), false);
3863 ***** test
3864 a( 1, 1) = 1;
3865 a(50, 50) = 2;
3866 assert (isbw (a, "non-logical"), false);
3867 ***** assert (isbw (rand (5, 5, 1, 4) > 0.5), true)
3868 ***** assert (isbw (rand (5, 5, 3, 4) > 0.5), false)
3869 ***** assert (isbw (rand (5, 5, 3) > 0.5), false)
3870 ***** assert (isbw (rand (5, 5, 1, 3, 4) > 0.5), false)
3871 ***** assert (isbw (randi ([0 1], 5, 5, 1, 4), "non-logical"), true)
3872 ***** assert (isbw (randi ([0 1], 5, 5, 3, 4), "non-logical"), false)
3873 ***** assert (isbw (randi ([0 1], 5, 5, 3), "non-logical"), false)
3874 ***** assert (isbw (randi ([0 1], 5, 5, 1, 3, 4), "non-logical"), false)
3875 ***** assert (isbw (single ([0 0 1]), "non-logical"), true)
3876 ***** assert (isbw ([0 NaN 1], "non-logical"), false)
3877 16 tests, 16 passed, 0 known failure, 0 skipped
3878 [grayslice]
3879 >>>>> /usr/share/octave/packages/image-2.6.1/grayslice.m
3880 ***** function gs = test_grayslice_vector (I, v)
3881 gs = zeros (size (I));
3882 for idx = 1:numel (v)
3883 gs(I >= v(idx)) = idx;
3884 endfor
3885 ***** endfunction
3886 ***** function gs = test_grayslice_scalar (I, n)
3887 v = (1:(n-1)) / n;
3888 gs = test_grayslice_vector (I, v);
3889 ***** endfunction
3890 ***** shared I2d, I3d, I5d, double_corner
3891 I2d = rand (10, 10);
3892 I3d = rand (10, 10, 3);
3893 I5d = rand (10, 10, 4, 3, 5);
3894
3895 double_corner = I2d;
3896 double_corner(I2d > 0.1 & I2d < 0.3) = -0.2;
3897 double_corner(I2d > 0.6 & I2d < 0.7) = 1.3;
3898 ***** assert (grayslice (I2d), grayslice (I2d, 10))
3899 ***** assert (grayslice (I2d, 10), uint8 (test_grayslice_scalar (I2d, 10)))
3900 ***** assert (grayslice (I2d, [0.3 0.5 0.7]),
3901 uint8 (test_grayslice_vector (I2d, [0.3 0.5 0.7])))
3902 ***** assert (grayslice (I3d, 10), uint8 (test_grayslice_scalar (I3d, 10)))
3903 ***** assert (grayslice (I5d, 300), test_grayslice_scalar (I5d, 300)+1)
3904 ***** assert (grayslice (I3d, [0.3 0.5 0.7]),
3905 uint8 (test_grayslice_vector (I3d, [0.3 0.5 0.7])))
3906 ***** assert (grayslice (im2uint8 (I2d), 3), uint8 (test_grayslice_scalar (I2d, 3)))
3907 !!!!! test failed
3908 ASSERT errors for: assert (grayslice (im2uint8 (I2d), 3),uint8 (test_grayslice_scalar (I2d, 3)))
3909
3910 Location | Observed | Expected | Reason
3911 (6,5) 2 1 Abs err 1 exceeds tol 0
3912 shared variables
3913 scalar structure containing the fields:
3914
3915 I2d =
3916
3917 Columns 1 through 5:
3918
3919 2.2108e-01 7.1460e-01 8.6567e-01 3.5439e-01 8.1303e-01
3920 6.0278e-01 2.3774e-01 5.8131e-01 7.2077e-01 1.1110e-01
3921 7.0996e-01 4.6300e-02 4.8698e-01 2.5724e-01 6.1860e-01
3922 7.1942e-01 8.0688e-02 6.3525e-01 8.3008e-01 8.9633e-01
3923 2.1788e-01 1.8532e-01 3.2400e-01 3.8378e-01 2.0041e-01
3924 5.0852e-02 6.3537e-02 9.5558e-01 4.1360e-01 6.6543e-01
3925 1.0681e-01 5.6779e-01 8.8390e-01 6.2696e-01 5.6603e-01
3926 3.0843e-01 3.7813e-02 5.1968e-01 8.1225e-01 9.5174e-01
3927 8.1486e-01 1.2409e-01 1.8420e-01 8.8242e-01 5.7982e-01
3928 7.3654e-01 1.7672e-01 5.3159e-01 5.9625e-01 4.5111e-01
3929
3930 Columns 6 through 10:
3931
3932 5.1728e-01 1.0107e-01 6.5419e-01 3.3463e-01 1.0942e-01
3933 1.7279e-01 2.7808e-01 6.7876e-02 5.4860e-01 5.3571e-01
3934 7.4577e-01 1.6398e-01 4.4978e-01 9.2166e-01 9.3425e-02
3935 7.9070e-01 7.6630e-01 4.8991e-01 9.7023e-01 8.0686e-01
3936 3.9059e-02 1.9876e-01 2.2937e-01 8.3335e-01 8.4557e-01
3937 5.7511e-01 9.3485e-02 4.2976e-01 1.5719e-01 1.8497e-01
3938 2.2432e-01 4.5868e-01 9.9131e-01 8.7040e-01 7.9128e-01
3939 9.3553e-05 6.6808e-01 9.7603e-01 2.5762e-01 4.1599e-01
3940 7.9825e-01 3.8867e-01 8.7362e-01 1.4623e-01 3.1062e-01
3941 3.0549e-01 9.1384e-01 9.8013e-01 4.8089e-01 9.4983e-01
3942
3943 I3d =
3944
3945 ans(:,:,1) =
3946
3947 Columns 1 through 6:
3948
3949 0.9085150 0.1792320 0.5846304 0.2771707 0.2880155 0.9420309
3950 0.8613022 0.0867448 0.5590647 0.6988739 0.2724803 0.7204822
3951 0.1855647 0.8378079 0.7677413 0.2595728 0.5104854 0.7870274
3952 0.4522364 0.0937747 0.9966227 0.0610727 0.1112158 0.2817193
3953 0.2276822 0.6032556 0.3271703 0.9687399 0.5843361 0.8485225
3954 0.7477551 0.0935541 0.0397918 0.2241526 0.2214395 0.2617302
3955 0.8794472 0.4461342 0.7029060 0.3393716 0.7688555 0.9232492
3956 0.7271264 0.0135106 0.1557253 0.6974208 0.0069772 0.4020502
3957 0.9869050 0.0169541 0.4121321 0.5420072 0.0759689 0.4529774
3958 0.3951611 0.8883234 0.9630852 0.5482397 0.2590686 0.2767235
3959
3960 Columns 7 through 10:
3961
3962 0.4045911 0.2143361 0.6603151 0.4828948
3963 0.4372772 0.1877603 0.3025271 0.0906916
3964 0.1491541 0.4506762 0.6660143 0.5638696
3965 0.8495631 0.4831842 0.8866188 0.1303504
3966 0.6335897 0.9267868 0.3939597 0.3463807
3967 0.5226737 0.5512384 0.3706674 0.2647164
3968 0.2351980 0.7611097 0.5901221 0.5919692
3969 0.2260306 0.7774365 0.9966957 0.4580111
3970 0.2696824 0.2941071 0.6664638 0.1091572
3971 0.0692295 0.9030892 0.8001783 0.3745571
3972
3973 ans(:,:,2) =
3974
3975 Columns 1 through 6:
3976
3977 0.6358116 0.7210104 0.8962380 0.5977748 0.7720084 0.5213305
3978 0.7867312 0.4205214 0.9545294 0.3814059 0.8906520 0.2625041
3979 0.1438551 0.2938348 0.3060704 0.3279878 0.8931884 0.4945498
3980 0.4845353 0.7323126 0.8208957 0.8710910 0.5035026 0.4881228
3981 0.5741805 0.5877735 0.4108953 0.3483542 0.8821193 0.0336696
3982 0.8093164 0.0784516 0.4031445 0.1939100 0.0957019 0.1695865
3983 0.9424732 0.5602791 0.3306339 0.0844267 0.6953766 0.6677692
3984 0.3925726 0.1758199 0.4787147 0.4804591 0.0057583 0.6332367
3985 0.5846225 0.6176720 0.9213075 0.3098178 0.3775534 0.5789479
3986 0.5169500 0.5357480 0.3968004 0.2105890 0.2748831 0.9091415
3987
3988 Columns 7 through 10:
3989
3990 0.5383382 0.1277380 0.7919386 0.9910193
3991 0.1772733 0.3908723 0.2665560 0.3767360
3992 0.8033068 0.6287754 0.8694417 0.3273783
3993 0.1321653 0.5588265 0.7393830 0.8282297
3994 0.7985915 0.6264328 0.3549167 0.0390456
3995 0.6336571 0.8055474 0.8279415 0.4747802
3996 0.9274108 0.7992458 0.4386309 0.1693312
3997 0.0669233 0.4494325 0.0749771 0.8950862
3998 0.3647397 0.7922371 0.7000772 0.2596080
3999 0.0160786 0.5925126 0.9992618 0.2224255
4000
4001 ans(:,:,3) =
4002
4003 Columns 1 through 6:
4004
4005 0.0061426 0.7378355 0.7519356 0.5804171 0.6154007 0.8941715
4006 0.6575978 0.6255490 0.0711355 0.8374924 0.8314746 0.2497667
4007 0.2847423 0.0522545 0.6715752 0.2097869 0.0606501 0.5724891
4008 0.4741217 0.9280973 0.1691334 0.1859933 0.9889718 0.1073489
4009 0.1766171 0.7981516 0.6994000 0.8907176 0.5814034 0.0419371
4010 0.8643178 0.0520671 0.4824610 0.6005893 0.4744997 0.4543153
4011 0.6682848 0.3794387 0.5522350 0.5568276 0.0271924 0.8990382
4012 0.3069721 0.1232460 0.8136584 0.4909493 0.2771549 0.2706576
4013 0.4212646 0.9962158 0.5932430 0.0791940 0.6490885 0.6512897
4014 0.6657112 0.9257975 0.5013654 0.9892049 0.2301217 0.0500173
4015
4016 Columns 7 through 10:
4017
4018 0.2258903 0.9350242 0.3612735 0.4738222
4019 0.8861171 0.1841960 0.5190135 0.5261083
4020 0.4582520 0.4954488 0.3223983 0.4531726
4021 0.8396346 0.9743292 0.4215382 0.0489690
4022 0.4878682 0.0772344 0.2681769 0.7044520
4023 0.4365548 0.4550444 0.2759317 0.3522443
4024 0.7292469 0.4410071 0.7824871 0.2465154
4025 0.4951616 0.4983616 0.1996937 0.0709213
4026 0.0615712 0.4945864 0.8721199 0.4982466
4027 0.7153366 0.1861152 0.3921529 0.5475796
4028
4029 I5d =
4030
4031 ans(:,:,1,1,1) =
4032
4033 Columns 1 through 6:
4034
4035 0.810376 0.098682 0.576878 0.706564 0.819190 0.247543
4036 0.435225 0.625369 0.373603 0.918725 0.433850 0.772251
4037 0.485067 0.449270 0.553216 0.787279 0.949005 0.798967
4038 0.681437 0.416348 0.862801 0.247387 0.499675 0.738336
4039 0.468978 0.926005 0.079781 0.904408 0.878728 0.829696
4040 0.114884 0.324622 0.392534 0.383564 0.067494 0.661371
4041 0.214238 0.833893 0.145222 0.791795 0.193403 0.830096
4042 0.104963 0.332170 0.627773 0.925863 0.555758 0.869307
4043 0.988644 0.797814 0.274507 0.449171 0.477658 0.966367
4044 0.225291 0.813570 0.990809 0.447016 0.959444 0.958199
4045
4046 Columns 7 through 10:
4047
4048 0.916102 0.874058 0.786368 0.419681
4049 0.772763 0.410233 0.981419 0.785152
4050 0.229611 0.076497 0.055096 0.359925
4051 0.735858 0.062802 0.453697 0.578421
4052 0.304172 0.278797 0.794227 0.655945
4053 0.304396 0.742428 0.330066 0.479694
4054 0.689693 0.948255 0.154762 0.839338
4055 0.022627 0.767355 0.302272 0.652870
4056 0.346508 0.455734 0.206857 0.828140
4057 0.266232 0.039935 0.291981 0.412147
4058
4059 ans(:,:,2,1,1) =
4060
4061 Columns 1 through 6:
4062
4063 0.276234 0.846525 0.061176 0.140045 0.445964 0.279462
4064 0.446801 0.428954 0.593714 0.804726 0.162388 0.074579
4065 0.918022 0.201462 0.185542 0.927933 0.977139 0.302611
4066 0.771110 0.553937 0.913288 0.462932 0.450807 0.410957
4067 0.120045 0.567351 0.180486 0.700017 0.993554 0.082247
4068 0.909432 0.879017 0.127984 0.140255 0.852337 0.188740
4069 0.223360 0.684406 0.998605 0.908053 0.205410 0.033317
4070 0.119684 0.721858 0.721251 0.355705 0.368574 0.913923
4071 0.642101 0.577404 0.567234 0.328714 0.556801 0.473230
4072 0.056447 0.219470 0.693944 0.070851 0.142890 0.817358
4073
4074 Columns 7 through 10:
4075
4076 0.013138 0.203642 0.797660 0.475073
4077 0.581832 0.940178 0.323563 0.629182
4078 0.083242 0.203315 0.433784 0.395889
4079 0.766958 0.755854 0.110398 0.285274
4080 0.568647 0.627844 0.458146 0.648398
4081 0.848049 0.047693 0.578580 0.815830
4082 0.839368 0.768969 0.414103 0.382384
4083 0.928432 0.228726 0.090722 0.797694
4084 0.053330 0.801987 0.690028 0.702777
4085 0.609750 0.052841 0.142793 0.591928
4086
4087 ans(:,:,3,1,1) =
4088
4089 Columns 1 through 6:
4090
4091 0.5209732 0.0843203 0.0586275 0.7436350 0.8676406 0.1172197
4092 0.6785965 0.0189280 0.8371924 0.1129088 0.4031566 0.1828344
4093 0.6652239 0.4019332 0.2276184 0.1935138 0.1508922 0.0051881
4094 0.6424947 0.3763872 0.4583254 0.7549096 0.4031105 0.3927504
4095 0.8176588 0.3356968 0.0870428 0.2373985 0.3538991 0.5822181
4096 0.8949977 0.4266026 0.4311177 0.3465940 0.8973854 0.1023099
4097 0.5465893 0.2078232 0.1344535 0.2617167 0.4746617 0.4718182
4098 0.4601952 0.6855701 0.9442340 0.2353406 0.6809454 0.3038767
4099 0.7739653 0.2480496 0.5129697 0.0306575 0.9643645 0.3871131
4100 0.1672978 0.7420738 0.4181704 0.4270389 0.9200445 0.3316468
4101
4102 Columns 7 through 10:
4103
4104 0.9498464 0.3738813 0.4960997 0.0929555
4105 0.0038414 0.6293277 0.1737913 0.6496748
4106 0.1709926 0.1237376 0.8221310 0.0481747
4107 0.7353316 0.8548542 0.0458594 0.3412932
4108 0.8047790 0.7071608 0.7753484 0.5832220
4109 0.3047390 0.0329819 0.5165143 0.4323066
4110 0.2472658 0.4549157 0.1300625 0.0110773
4111 0.3291799 0.3547561 0.9502443 0.9920188
4112 0.1856981 0.3352798 0.1850712 0.4557457
4113 0.4563348 0.9663552 0.0782193 0.9862699
4114
4115 ans(:,:,4,1,1) =
4116
4117 Columns 1 through 6:
4118
4119 0.794770 0.410530 0.148022 0.529149 0.363288 0.207195
4120 0.523706 0.312083 0.486274 0.429240 0.218603 0.574153
4121 0.594559 0.177732 0.473127 0.648865 0.739265 0.130675
4122 0.465082 0.086184 0.781705 0.895195 0.957084 0.866229
4123 0.035303 0.873758 0.014733 0.183677 0.197174 0.766822
4124 0.817687 0.861009 0.087369 0.459576 0.305843 0.187788
4125 0.882185 0.617579 0.664024 0.395632 0.208691 0.902998
4126 0.924960 0.746975 0.476071 0.309065 0.936185 0.506448
4127 0.171990 0.468743 0.988962 0.320124 0.719442 0.992578
4128 0.016150 0.555236 0.883985 0.179951 0.488493 0.437751
4129
4130 Columns 7 through 10:
4131
4132 0.050819 0.210973 0.198584 0.275553
4133 0.367200 0.476461 0.377815 0.259146
4134 0.863100 0.427207 0.734865 0.764315
4135 0.206292 0.650585 0.898049 0.195198
4136 0.488971 0.800481 0.765545 0.246841
4137 0.491128 0.490847 0.043433 0.646516
4138 0.208732 0.806342 0.764484 0.664138
4139 0.805124 0.433424 0.892304 0.506192
4140 0.538170 0.768819 0.200999 0.893079
4141 0.394475 0.967602 0.858515 0.898519
4142
4143 ans(:,:,1,2,1) =
4144
4145 Columns 1 through 6:
4146
4147 0.419125 0.801708 0.873315 0.703715 0.905840 0.121056
4148 0.795143 0.625885 0.103123 0.244379 0.469384 0.133774
4149 0.966169 0.377714 0.748201 0.144974 0.772168 0.099324
4150 0.400529 0.157178 0.264000 0.718496 0.784109 0.011721
4151 0.340166 0.420120 0.745074 0.016972 0.818521 0.188046
4152 0.207608 0.936520 0.218795 0.456085 0.233022 0.341641
4153 0.495520 0.841600 0.512516 0.531824 0.412952 0.835727
4154 0.782307 0.728390 0.725814 0.414064 0.665924 0.900127
4155 0.596717 0.677278 0.569575 0.939400 0.584586 0.121027
4156 0.527338 0.645874 0.527975 0.347440 0.843857 0.847947
4157
4158 Columns 7 through 10:
4159
4160 0.534677 0.950545 0.475113 0.384314
4161 0.518978 0.895848 0.537534 0.389922
4162 0.087276 0.044611 0.888596 0.049048
4163 0.319639 0.111062 0.817746 0.880923
4164 0.555878 0.382061 0.677681 0.871777
4165 0.660479 0.153771 0.335231 0.460487
4166 0.745573 0.902834 0.970273 0.408826
4167 0.296409 0.908731 0.025560 0.330915
4168 0.062144 0.320403 0.564509 0.308299
4169 0.332799 0.099113 0.131875 0.369725
4170
4171 ans(:,:,2,2,1) =
4172
4173 Columns 1 through 6:
4174
4175 0.0667625 0.4434588 0.2322615 0.9109875 0.4377696 0.3253606
4176 0.4527177 0.0651558 0.3315827 0.1019568 0.5685801 0.0418888
4177 0.0473282 0.9841833 0.6112927 0.3025367 0.8748755 0.7882075
4178 0.3745701 0.8856116 0.7069455 0.2653348 0.2967969 0.0525185
4179 0.9502550 0.2417517 0.2597097 0.5590371 0.4182782 0.8557862
4180 0.5102043 0.2738430 0.5187608 0.4156323 0.6944199 0.5934101
4181 0.8436136 0.3080648 0.0238998 0.8096875 0.1854913 0.6159406
4182 0.0593120 0.4135516 0.4021995 0.4960027 0.1143986 0.4066538
4183 0.9197854 0.3165317 0.0551880 0.0417164 0.6550483 0.6269316
4184 0.1471270 0.3555741 0.1573436 0.1258035 0.8118004 0.0563414
4185
4186 Columns 7 through 10:
4187
4188 0.2905911 0.0098594 0.1074483 0.3653092
4189 0.5687944 0.6673565 0.6230593 0.2375169
4190 0.5861968 0.7158670 0.7256135 0.7486863
4191 0.0714501 0.8822895 0.4682427 0.0179792
4192 0.0244591 0.1613813 0.5592001 0.5022894
4193 0.9568736 0.0281312 0.5769619 0.5090060
4194 0.5266264 0.6428395 0.2852004 0.2322997
4195 0.5417045 0.4404826 0.5275789 0.3680267
4196 0.3055292 0.9891196 0.2465138 0.1531026
4197 0.9633465 0.9803822 0.8241016 0.6602472
4198
4199 ans(:,:,3,2,1) =
4200
4201 Columns 1 through 6:
4202
4203 0.8487872 0.8905500 0.9377910 0.8684960 0.5340038 0.6486067
4204 0.4547180 0.4997198 0.7875987 0.0049704 0.8241293 0.2051052
4205 0.2395931 0.2442229 0.3500502 0.2905419 0.3150350 0.1750491
4206 0.5717488 0.2948279 0.2393516 0.8799100 0.0798410 0.9369957
4207 0.4004781 0.5289274 0.6555123 0.9969869 0.9570398 0.7220818
4208 0.4023262 0.5851302 0.6405652 0.2888300 0.2495583 0.9202830
4209 0.0321699 0.4499750 0.7670309 0.2268389 0.8987271 0.8342333
4210 0.7305865 0.6908330 0.5001874 0.9229585 0.0279327 0.6095449
4211 0.6060568 0.2107404 0.7223782 0.3920189 0.4876632 0.9492219
4212 0.7207518 0.9191790 0.8859767 0.2038811 0.6256003 0.7995169
4213
4214 Columns 7 through 10:
4215
4216 0.8347789 0.5678921 0.2805064 0.4012978
4217 0.2143893 0.6999812 0.9810728 0.7272475
4218 0.2882718 0.0767099 0.2701642 0.2046307
4219 0.4738332 0.8241256 0.2820355 0.7263221
4220 0.4344589 0.4198173 0.6620064 0.3204649
4221 0.7692141 0.8951258 0.7787947 0.3255112
4222 0.2389707 0.5246297 0.4012678 0.7708479
4223 0.7492361 0.3582179 0.7673545 0.2743685
4224 0.1725816 0.2454360 0.9306972 0.1717850
4225 0.2595417 0.2517398 0.8371412 0.6843575
4226
4227 ans(:,:,4,2,1) =
4228
4229 Columns 1 through 6:
4230
4231 0.416082 0.629340 0.620300 0.616327 0.190143 0.084491
4232 0.361945 0.281442 0.534239 0.954083 0.825942 0.542995
4233 0.469400 0.986333 0.217749 0.156239 0.085515 0.403804
4234 0.406716 0.409443 0.651367 0.900348 0.257977 0.383350
4235 0.361641 0.312526 0.384863 0.929444 0.081283 0.302890
4236 0.724502 0.883361 0.865074 0.501750 0.471337 0.104909
4237 0.607145 0.043828 0.203374 0.165962 0.079829 0.985759
4238 0.878716 0.906764 0.113423 0.903959 0.538190 0.631155
4239 0.607674 0.026923 0.621105 0.106972 0.121733 0.353629
4240 0.394132 0.952002 0.022303 0.381161 0.193216 0.802417
4241
4242 Columns 7 through 10:
4243
4244 0.971154 0.423696 0.201953 0.543989
4245 0.210027 0.877520 0.068125 0.361213
4246 0.982533 0.633239 0.065602 0.799833
4247 0.319029 0.234161 0.290546 0.445514
4248 0.101110 0.627287 0.305455 0.551176
4249 0.777346 0.101175 0.669952 0.998585
4250 0.068896 0.493767 0.663224 0.999177
4251 0.960577 0.556930 0.809245 0.518827
4252 0.431986 0.177889 0.396948 0.519756
4253 0.604496 0.726126 0.476635 0.963078
4254
4255 ans(:,:,1,3,1) =
4256
4257 Columns 1 through 6:
4258
4259 0.0051192 0.9642115 0.6467914 0.8485369 0.3367795 0.3916511
4260 0.8651498 0.3824299 0.4048343 0.5129000 0.0568461 0.2988005
4261 0.1090879 0.1062871 0.5283745 0.8131848 0.3938530 0.7205317
4262 0.3265968 0.3017192 0.9198270 0.1461151 0.9379613 0.0089870
4263 0.7745099 0.2237715 0.8298687 0.3478060 0.4722986 0.4582103
4264 0.7088194 0.5222636 0.8470160 0.8804550 0.2614177 0.2914650
4265 0.7500881 0.4096922 0.4335698 0.3125150 0.8714446 0.6881506
4266 0.3135739 0.1180787 0.2541961 0.5534419 0.8772480 0.6719254
4267 0.5444778 0.2409311 0.8206862 0.7773879 0.8659744 0.5826321
4268 0.7138808 0.0905213 0.6064382 0.7062720 0.4397820 0.5705855
4269
4270 Columns 7 through 10:
4271
4272 0.0031849 0.6649034 0.9198431 0.1003064
4273 0.6566476 0.6201431 0.3324817 0.8713365
4274 0.8614027 0.2492988 0.8141918 0.0247510
4275 0.2525018 0.9067519 0.3451716 0.9888107
4276 0.7631954 0.7971038 0.9087908 0.2922930
4277 0.7464956 0.9444286 0.1913923 0.8875573
4278 0.1571285 0.5962577 0.4057805 0.8396809
4279 0.5875000 0.9789866 0.4697268 0.7748592
4280 0.0855502 0.2323717 0.1751119 0.1201540
4281 0.1704252 0.4623113 0.3271615 0.4951229
4282
4283 ans(:,:,2,3,1) =
4284
4285 Columns 1 through 6:
4286
4287 0.5973690 0.3982001 0.3266393 0.3945284 0.2504278 0.5428706
4288 0.3066157 0.2019397 0.3275959 0.0376969 0.4933716 0.8048465
4289 0.7521998 0.5348336 0.9231731 0.0946847 0.8848275 0.3241261
4290 0.9951353 0.2644929 0.3555249 0.2598676 0.4748415 0.8246108
4291 0.7011674 0.5083559 0.9568421 0.1274113 0.6305754 0.1325225
4292 0.5496720 0.0601821 0.0244317 0.2980860 0.8028220 0.6334425
4293 0.3767477 0.6368914 0.2611748 0.5216934 0.1587316 0.7043436
4294 0.7932917 0.9790613 0.6493430 0.5759291 0.1399908 0.7593085
4295 0.5106853 0.0069769 0.6701336 0.8579557 0.1587473 0.6009623
4296 0.1267406 0.0806822 0.7929170 0.5037219 0.5099758 0.7923996
4297
4298 Columns 7 through 10:
4299
4300 0.4924078 0.6231774 0.6726756 0.2376709
4301 0.4301648 0.2990099 0.8054499 0.9564681
4302 0.5753813 0.6445857 0.6709282 0.5839838
4303 0.1372179 0.9166328 0.9399930 0.8889427
4304 0.1153677 0.5395731 0.0474958 0.8207998
4305 0.8171029 0.3164227 0.5009089 0.1273747
4306 0.8686284 0.4807118 0.7511339 0.8415075
4307 0.4277779 0.0346180 0.0169095 0.0334487
4308 0.6913851 0.2302356 0.2614804 0.5996883
4309 0.7698865 0.1653180 0.3714277 0.2000901
4310
4311 ans(:,:,3,3,1) =
4312
4313 Columns 1 through 6:
4314
4315 0.3673294 0.9310928 0.6944141 0.0291384 0.3594707 0.9045901
4316 0.5164970 0.8132594 0.8571588 0.4223326 0.7091630 0.8580768
4317 0.0315146 0.2497343 0.6305408 0.5165458 0.8166352 0.3690522
4318 0.0630992 0.7650866 0.3799516 0.2870462 0.6177566 0.5705667
4319 0.3840602 0.0973067 0.8865582 0.5771179 0.1821084 0.5263851
4320 0.8734286 0.0592813 0.1259235 0.0264619 0.2696337 0.6251776
4321 0.3709600 0.2788850 0.6147465 0.0028484 0.7663109 0.0262633
4322 0.0042082 0.9223086 0.5575108 0.6762692 0.8572554 0.5152919
4323 0.0243544 0.8875509 0.8958823 0.7699428 0.7290951 0.4800880
4324 0.9173073 0.6194682 0.2524935 0.5880678 0.2092284 0.2648492
4325
4326 Columns 7 through 10:
4327
4328 0.8826204 0.8906887 0.8173201 0.0147500
4329 0.0181336 0.7829348 0.8365039 0.2589379
4330 0.0569537 0.1441546 0.6442387 0.2406615
4331 0.0248183 0.1929274 0.4882305 0.0932147
4332 0.3552673 0.9493918 0.9013098 0.5313287
4333 0.6024635 0.5908431 0.3854422 0.3208911
4334 0.0265285 0.3793655 0.4137378 0.5301421
4335 0.8536833 0.2393343 0.6563048 0.2772838
4336 0.6340120 0.3848427 0.2024214 0.1717332
4337 0.2746239 0.3505430 0.6102731 0.1650513
4338
4339 ans(:,:,4,3,1) =
4340
4341 Columns 1 through 6:
4342
4343 0.3321409 0.8011251 0.7911651 0.3987848 0.6076832 0.9440724
4344 0.6730656 0.3289007 0.6698372 0.6547989 0.2155528 0.7281286
4345 0.0640711 0.7312586 0.3425904 0.9560479 0.1631463 0.7935855
4346 0.1890226 0.2227653 0.3707193 0.2555907 0.1217344 0.6544673
4347 0.5220939 0.7493412 0.0113001 0.9669227 0.4052524 0.7921704
4348 0.8574233 0.0610000 0.3895241 0.9023984 0.4081744 0.3812959
4349 0.8935133 0.0988709 0.9062059 0.9678378 0.6976464 0.0603345
4350 0.9821240 0.1637312 0.2505369 0.1896658 0.7427257 0.3313305
4351 0.2639491 0.5364443 0.4314255 0.0175309 0.0678695 0.9035357
4352 0.9132878 0.7721031 0.7490714 0.4765888 0.9494456 0.0239354
4353
4354 Columns 7 through 10:
4355
4356 0.4962867 0.8304485 0.2460796 0.3715590
4357 0.2466159 0.0125134 0.0726971 0.5543683
4358 0.7719894 0.4127208 0.1506180 0.8240553
4359 0.5720825 0.0228197 0.3208682 0.4429452
4360 0.8044129 0.5997317 0.1614014 0.1023594
4361 0.9284138 0.0405851 0.3361429 0.0340996
4362 0.7098809 0.8744963 0.6910722 0.0467698
4363 0.2126441 0.6295077 0.4990928 0.2536376
4364 0.5383910 0.1317960 0.0327869 0.6306820
4365 0.0087543 0.4545349 0.8414397 0.3416207
4366
4367 ans(:,:,1,1,2) =
4368
4369 Columns 1 through 6:
4370
4371 0.7110329 0.8780240 0.4496120 0.1588055 0.2367555 0.5472165
4372 0.6683019 0.3975191 0.4919997 0.5095346 0.6838901 0.4340546
4373 0.0400900 0.2310279 0.2057475 0.9327393 0.6047668 0.0035260
4374 0.0963746 0.4375845 0.2923767 0.4233803 0.4786268 0.4987043
4375 0.1204683 0.7904114 0.3308303 0.9683190 0.9610732 0.4658826
4376 0.0834552 0.9198336 0.4276609 0.7487897 0.4638412 0.2557878
4377 0.2383031 0.5166034 0.6468581 0.8770294 0.1036236 0.9069617
4378 0.9445578 0.8164596 0.2027702 0.5771583 0.7926646 0.9999860
4379 0.8728387 0.6927377 0.8145227 0.6149674 0.9575772 0.8242791
4380 0.0903046 0.6864367 0.7184165 0.3253922 0.0278764 0.8276423
4381
4382 Columns 7 through 10:
4383
4384 0.1593379 0.0268149 0.7878098 0.7741040
4385 0.2995835 0.6065372 0.3652583 0.1767655
4386 0.0804260 0.6675662 0.6701949 0.6737756
4387 0.2471273 0.8439163 0.0706660 0.9551154
4388 0.9783697 0.1720289 0.6327307 0.5031399
4389 0.8673323 0.2480370 0.6143645 0.2205467
4390 0.1905734 0.3406908 0.0038097 0.1063645
4391 0.4919964 0.3254222 0.0024640 0.5749885
4392 0.7113865 0.4963860 0.6523721 0.0589407
4393 0.7751916 0.9213611 0.7556305 0.7380588
4394
4395 ans(:,:,2,1,2) =
4396
4397 Columns 1 through 6:
4398
4399 0.0102728 0.7869879 0.4224425 0.1847836 0.9911191 0.7171264
4400 0.6326170 0.4537716 0.6983639 0.8475922 0.7784203 0.6494836
4401 0.9872571 0.6276377 0.8688471 0.0196818 0.2241776 0.3116178
4402 0.2738996 0.1599150 0.8873252 0.2603410 0.4524987 0.2994896
4403 0.3060755 0.4605067 0.0469910 0.4117608 0.1927481 0.8043289
4404 0.7050812 0.1509867 0.1425108 0.5162964 0.3401355 0.6022343
4405 0.4265652 0.3726254 0.7981891 0.2168170 0.9888975 0.6476326
4406 0.6524802 0.5570739 0.8175592 0.2550218 0.9139493 0.0724688
4407 0.9552424 0.6407442 0.6644576 0.3637030 0.0904287 0.2604093
4408 0.2482823 0.4084737 0.2589626 0.7900248 0.8356889 0.0010138
4409
4410 Columns 7 through 10:
4411
4412 0.0523161 0.2954536 0.9946666 0.5971124
4413 0.6388745 0.3498102 0.7762737 0.9119895
4414 0.7772392 0.7447664 0.1293567 0.5012443
4415 0.5567880 0.7529136 0.3506618 0.4091337
4416 0.2697423 0.9638289 0.1427652 0.1921481
4417 0.6502622 0.9979430 0.6982095 0.1404264
4418 0.0828745 0.0766134 0.6750829 0.8625562
4419 0.4822215 0.5403436 0.4884062 0.2870998
4420 0.2537652 0.9961874 0.1483415 0.2586591
4421 0.2443475 0.2356337 0.7033171 0.2047642
4422
4423 ans(:,:,3,1,2) =
4424
4425 Columns 1 through 6:
4426
4427 0.886570 0.387795 0.674710 0.653723 0.149113 0.797752
4428 0.878079 0.278299 0.023144 0.217300 0.864953 0.701004
4429 0.388871 0.903133 0.455367 0.443985 0.501682 0.385823
4430 0.342179 0.985679 0.903545 0.681919 0.802747 0.856096
4431 0.996988 0.200966 0.157184 0.380738 0.742683 0.157015
4432 0.575593 0.142549 0.562835 0.388252 0.422879 0.094094
4433 0.181369 0.925404 0.822692 0.197060 0.723766 0.515104
4434 0.952350 0.444017 0.681560 0.662165 0.942260 0.808604
4435 0.079305 0.566000 0.255629 0.680495 0.903966 0.138276
4436 0.090300 0.783986 0.535740 0.911551 0.539740 0.036267
4437
4438 Columns 7 through 10:
4439
4440 0.222259 0.629112 0.454202 0.748143
4441 0.385930 0.232702 0.369554 0.385771
4442 0.502429 0.061489 0.491785 0.500039
4443 0.985800 0.183869 0.029227 0.807328
4444 0.825766 0.345752 0.225206 0.058568
4445 0.699256 0.311132 0.642183 0.075352
4446 0.644914 0.101891 0.272531 0.217387
4447 0.430396 0.789706 0.546499 0.884225
4448 0.509364 0.080719 0.347810 0.552523
4449 0.789972 0.232638 0.714936 0.608923
4450
4451 ans(:,:,4,1,2) =
4452
4453 Columns 1 through 6:
4454
4455 0.703167 0.895547 0.321455 0.964754 0.636111 0.562098
4456 0.805162 0.904342 0.629949 0.448413 0.432901 0.635484
4457 0.381280 0.029067 0.712167 0.090733 0.932404 0.310156
4458 0.716366 0.476315 0.128624 0.205000 0.741729 0.522251
4459 0.964924 0.191945 0.306641 0.454506 0.918261 0.387312
4460 0.583575 0.667824 0.216957 0.733722 0.268015 0.822478
4461 0.188006 0.859222 0.750902 0.873207 0.890193 0.363098
4462 0.617089 0.768765 0.759699 0.671263 0.836112 0.435831
4463 0.182397 0.503122 0.983581 0.111772 0.978514 0.122360
4464 0.631235 0.641815 0.790211 0.050426 0.211761 0.491106
4465
4466 Columns 7 through 10:
4467
4468 0.805627 0.811498 0.742229 0.848890
4469 0.340196 0.259301 0.222319 0.648404
4470 0.612253 0.136577 0.394925 0.772409
4471 0.071778 0.141588 0.913788 0.679360
4472 0.269393 0.166476 0.263635 0.423187
4473 0.686158 0.437595 0.454158 0.738118
4474 0.844870 0.226333 0.050935 0.286054
4475 0.211835 0.908488 0.451580 0.767429
4476 0.155943 0.310180 0.052210 0.997174
4477 0.590957 0.780875 0.716083 0.641756
4478
4479 ans(:,:,1,2,2) =
4480
4481 Columns 1 through 6:
4482
4483 0.1878352 0.8624286 0.3665079 0.9346284 0.8097372 0.9284779
4484 0.3818379 0.5380551 0.3511858 0.3621515 0.4375099 0.0897530
4485 0.2033886 0.6267727 0.4514046 0.3064438 0.4398464 0.1861123
4486 0.7826517 0.0737229 0.0914460 0.6014377 0.8460290 0.7306190
4487 0.1679334 0.9100354 0.5665778 0.1829216 0.0026763 0.1725150
4488 0.3000967 0.6898867 0.3373977 0.9283066 0.1095613 0.1012451
4489 0.1856724 0.7785792 0.0918462 0.2723747 0.8237254 0.0469334
4490 0.5444948 0.8286812 0.9634168 0.3888340 0.2384108 0.4722390
4491 0.3702035 0.7133309 0.3465711 0.9603066 0.4341037 0.7701312
4492 0.4971123 0.7048958 0.7037008 0.8628597 0.7896578 0.2269976
4493
4494 Columns 7 through 10:
4495
4496 0.0596639 0.8541383 0.1458686 0.4222925
4497 0.5366376 0.6475454 0.6719793 0.6302454
4498 0.2555567 0.6555141 0.5413356 0.4390930
4499 0.7452817 0.1538712 0.5908946 0.3671833
4500 0.2530928 0.2819780 0.1573123 0.6293347
4501 0.3219239 0.6944065 0.9315498 0.2198387
4502 0.8257163 0.1817305 0.7905729 0.5578306
4503 0.2679742 0.9576643 0.9092099 0.4662440
4504 0.2403528 0.8262039 0.4280747 0.5123595
4505 0.0588874 0.8026308 0.5616471 0.6272292
4506
4507 ans(:,:,2,2,2) =
4508
4509 Columns 1 through 6:
4510
4511 0.2817777 0.2426456 0.9800920 0.4485883 0.9420195 0.0210151
4512 0.8026816 0.6968762 0.2329937 0.3864551 0.7469092 0.1397848
4513 0.3604065 0.2609379 0.6908306 0.6449120 0.7933182 0.8722471
4514 0.6243291 0.6924631 0.6703188 0.8824525 0.5496050 0.3582978
4515 0.7949584 0.3667689 0.1713776 0.2579087 0.8550084 0.8316173
4516 0.8861642 0.7375697 0.5709407 0.8717697 0.0297959 0.4739057
4517 0.4029860 0.0708173 0.4531750 0.6988634 0.9725306 0.2537152
4518 0.3037881 0.3817658 0.0044153 0.0517739 0.7865039 0.7815663
4519 0.8142875 0.9779351 0.6364370 0.8089758 0.7452076 0.9534135
4520 0.0772751 0.5860291 0.9943992 0.3222467 0.7701242 0.3263064
4521
4522 Columns 7 through 10:
4523
4524 0.2716679 0.4005586 0.2887278 0.6872264
4525 0.5503250 0.3952428 0.7999758 0.3053899
4526 0.3299734 0.3809559 0.6461417 0.9840608
4527 0.1264273 0.1183382 0.6221502 0.4467041
4528 0.5175271 0.5742084 0.6400923 0.9573118
4529 0.7316170 0.0673990 0.5855794 0.9771024
4530 0.0056992 0.5945818 0.1184796 0.3150174
4531 0.3239212 0.5616612 0.3554259 0.4474511
4532 0.1817791 0.9933149 0.0355487 0.0985332
4533 0.5328323 0.8903889 0.1996794 0.7151594
4534
4535 ans(:,:,3,2,2) =
4536
4537 Columns 1 through 6:
4538
4539 0.4650336 0.1290626 0.5637894 0.6909094 0.8023020 0.9688239
4540 0.7762508 0.4686659 0.5253495 0.2967104 0.9894615 0.6643910
4541 0.4146187 0.3799304 0.6445695 0.9634592 0.3051356 0.7322590
4542 0.0121596 0.8730502 0.6061742 0.8625687 0.1548036 0.8308767
4543 0.6269605 0.6719517 0.1948955 0.8805310 0.2481145 0.8828404
4544 0.5021922 0.0020074 0.3464080 0.5400264 0.5584776 0.6148001
4545 0.6121586 0.8587893 0.2051135 0.3176191 0.6744515 0.1056653
4546 0.3598432 0.9798290 0.7812014 0.9331295 0.1538925 0.2230421
4547 0.5179343 0.1550994 0.4213246 0.1235934 0.2573815 0.5212689
4548 0.9024882 0.7767693 0.2992562 0.6108584 0.4032308 0.0857939
4549
4550 Columns 7 through 10:
4551
4552 0.3190705 0.7415331 0.3020702 0.8814395
4553 0.1383603 0.4121208 0.2586144 0.1448048
4554 0.5587912 0.0810173 0.8992439 0.0914073
4555 0.5050345 0.6957303 0.3293078 0.9099616
4556 0.7795904 0.0128167 0.5730085 0.8210464
4557 0.9051300 0.6443984 0.9420758 0.2929259
4558 0.5486139 0.8428771 0.4933654 0.2884004
4559 0.4987979 0.5632385 0.7008250 0.3480636
4560 0.4074552 0.8943786 0.6851662 0.2615953
4561 0.4132316 0.6639066 0.4219204 0.8470077
4562
4563 ans(:,:,4,2,2) =
4564
4565 Columns 1 through 6:
4566
4567 0.1387701 0.7323272 0.5839849 0.3377349 0.5608527 0.4291921
4568 0.7662255 0.1864237 0.3880898 0.2240633 0.9532640 0.2813417
4569 0.4694665 0.4050114 0.6872974 0.6890945 0.9732192 0.1751725
4570 0.4092232 0.8157509 0.5091082 0.3897147 0.5552357 0.2743486
4571 0.8135658 0.5885752 0.7231130 0.5980365 0.3198819 0.2991516
4572 0.0542688 0.7818956 0.4371062 0.9334046 0.4949795 0.6461746
4573 0.4085862 0.3413757 0.8565464 0.8901276 0.5837812 0.0015213
4574 0.1445362 0.7540329 0.3328202 0.7295881 0.5008343 0.8108689
4575 0.3134238 0.6581873 0.8769458 0.7714833 0.2454879 0.1323422
4576 0.7463726 0.3755997 0.7546217 0.9276641 0.8201612 0.9546037
4577
4578 Columns 7 through 10:
4579
4580 0.8829186 0.5863462 0.8476416 0.5365916
4581 0.2361552 0.0726304 0.8838354 0.1502373
4582 0.8042768 0.2585160 0.5515444 0.4848605
4583 0.8983858 0.4069385 0.8166760 0.8782747
4584 0.0577268 0.9604372 0.7152396 0.9542161
4585 0.5907363 0.0962301 0.9633589 0.7875858
4586 0.4086413 0.8141418 0.5467496 0.4831412
4587 0.3067305 0.2918304 0.3994853 0.0681579
4588 0.9334252 0.6102766 0.6432716 0.1207185
4589 0.7079995 0.8991320 0.7339144 0.6185315
4590
4591 ans(:,:,1,3,2) =
4592
4593 Columns 1 through 6:
4594
4595 0.850794 0.633792 0.022319 0.584993 0.378538 0.876180
4596 0.820550 0.566085 0.076135 0.980739 0.468111 0.756060
4597 0.021893 0.061616 0.244420 0.178111 0.569384 0.242228
4598 0.387538 0.537468 0.407364 0.981958 0.429383 0.919181
4599 0.267927 0.511574 0.897277 0.431496 0.096990 0.969997
4600 0.303660 0.702656 0.993402 0.341931 0.611596 0.807850
4601 0.768928 0.936842 0.527614 0.808162 0.421734 0.535711
4602 0.164418 0.788436 0.497669 0.037615 0.673811 0.083115
4603 0.337013 0.453766 0.176417 0.728280 0.590792 0.333881
4604 0.934198 0.350312 0.397179 0.337865 0.279992 0.401225
4605
4606 Columns 7 through 10:
4607
4608 0.891551 0.203911 0.719829 0.329083
4609 0.700094 0.326396 0.834893 0.551854
4610 0.140019 0.476442 0.684188 0.904101
4611 0.963655 0.113402 0.328759 0.976565
4612 0.587752 0.804928 0.978060 0.718629
4613 0.419945 0.579493 0.698214 0.114274
4614 0.915048 0.438472 0.226911 0.105264
4615 0.612784 0.189952 0.231739 0.633512
4616 0.954178 0.435415 0.196564 0.411623
4617 0.907945 0.639666 0.676578 0.208758
4618
4619 ans(:,:,2,3,2) =
4620
4621 Columns 1 through 6:
4622
4623 0.226755 0.126199 0.703004 0.191332 0.351628 0.785355
4624 0.240716 0.103539 0.233432 0.358979 0.023161 0.264994
4625 0.671350 0.490331 0.995962 0.060878 0.924733 0.307135
4626 0.796921 0.751032 0.786203 0.612042 0.103880 0.430942
4627 0.276815 0.917041 0.680917 0.173359 0.477252 0.543289
4628 0.596638 0.520283 0.322937 0.906080 0.449664 0.282786
4629 0.495594 0.769421 0.055374 0.088746 0.679443 0.293056
4630 0.300856 0.603273 0.837346 0.679741 0.529878 0.830693
4631 0.240044 0.623625 0.185466 0.745815 0.157575 0.145465
4632 0.153187 0.489262 0.447974 0.420381 0.501956 0.713076
4633
4634 Columns 7 through 10:
4635
4636 0.555344 0.813898 0.560332 0.214597
4637 0.672756 0.277195 0.789812 0.080667
4638 0.644100 0.227224 0.971435 0.370642
4639 0.919219 0.165152 0.359257 0.329207
4640 0.667804 0.853995 0.444430 0.490269
4641 0.111295 0.012433 0.130959 0.624635
4642 0.578472 0.941766 0.902522 0.129056
4643 0.277710 0.506310 0.683419 0.792852
4644 0.387422 0.169937 0.732633 0.570809
4645 0.145518 0.548646 0.275199 0.520761
4646
4647 ans(:,:,3,3,2) =
4648
4649 Columns 1 through 6:
4650
4651 0.689191 0.479827 0.229239 0.106677 0.399505 0.611669
4652 0.138483 0.318286 0.647842 0.251831 0.958738 0.688333
4653 0.273278 0.979835 0.250448 0.765089 0.306333 0.747542
4654 0.920489 0.760811 0.233740 0.217678 0.168359 0.527905
4655 0.167515 0.317350 0.606746 0.114158 0.845687 0.532453
4656 0.859382 0.740998 0.243033 0.785245 0.425521 0.417986
4657 0.192789 0.269181 0.063988 0.348172 0.914070 0.542250
4658 0.420217 0.557663 0.159572 0.983462 0.733567 0.877299
4659 0.012020 0.714532 0.760805 0.185285 0.771359 0.392577
4660 0.666482 0.575258 0.864656 0.841221 0.530768 0.323908
4661
4662 Columns 7 through 10:
4663
4664 0.177994 0.070328 0.089431 0.503279
4665 0.773427 0.056813 0.039949 0.367435
4666 0.466352 0.479911 0.815991 0.236570
4667 0.890969 0.711271 0.292221 0.579875
4668 0.913373 0.360598 0.933918 0.492918
4669 0.201973 0.455594 0.623610 0.128726
4670 0.795043 0.272933 0.782612 0.680447
4671 0.736731 0.254735 0.313396 0.186607
4672 0.646843 0.919227 0.864458 0.010671
4673 0.191913 0.545958 0.526232 0.171408
4674
4675 ans(:,:,4,3,2) =
4676
4677 Columns 1 through 6:
4678
4679 0.651044 0.426291 0.132529 0.309644 0.490345 0.847867
4680 0.066316 0.918754 0.781046 0.668628 0.734299 0.331468
4681 0.097357 0.568706 0.445841 0.155303 0.140473 0.931829
4682 0.027515 0.483933 0.202185 0.348720 0.017776 0.086517
4683 0.056745 0.877355 0.508475 0.196365 0.940916 0.989078
4684 0.123305 0.534926 0.324671 0.594712 0.643167 0.694618
4685 0.094629 0.755468 0.920526 0.361791 0.580710 0.562871
4686 0.733656 0.208680 0.948009 0.889321 0.489601 0.538729
4687 0.638333 0.652550 0.473284 0.801093 0.737833 0.517871
4688 0.319182 0.540627 0.265402 0.659331 0.675305 0.662707
4689
4690 Columns 7 through 10:
4691
4692 0.355006 0.039983 0.584125 0.217797
4693 0.378733 0.204801 0.069714 0.954470
4694 0.959785 0.874550 0.753330 0.064999
4695 0.489601 0.945162 0.183287 0.597647
4696 0.789460 0.566294 0.486116 0.594112
4697 0.052787 0.120518 0.040279 0.407727
4698 0.344680 0.211137 0.150753 0.583710
4699 0.727590 0.610068 0.197102 0.413788
4700 0.367515 0.561431 0.116795 0.462783
4701 0.467771 0.385066 0.672628 0.533868
4702
4703 ans(:,:,1,1,3) =
4704
4705 Columns 1 through 5:
4706
4707 7.5862e-01 7.0339e-02 3.6282e-02 5.5131e-01 2.7969e-01
4708 6.2216e-01 7.5748e-01 3.6294e-01 2.9254e-01 7.6816e-01
4709 5.4553e-01 5.7890e-01 5.0648e-01 8.0610e-01 5.6458e-01
4710 1.8127e-01 3.7119e-01 6.7823e-02 8.9845e-02 1.0287e-01
4711 8.4725e-01 2.5148e-01 4.7502e-01 6.9425e-01 4.9971e-01
4712 2.6574e-01 9.3057e-01 4.7543e-02 6.5614e-02 4.3115e-02
4713 8.1758e-01 9.8570e-01 2.5194e-01 9.1936e-01 4.7104e-01
4714 1.0012e-01 6.1040e-01 7.1138e-01 5.9225e-01 7.5650e-01
4715 5.8747e-01 2.2277e-01 7.2763e-01 3.6139e-01 7.3308e-01
4716 2.2427e-01 5.0527e-01 3.3283e-01 7.5260e-01 3.6417e-01
4717
4718 Columns 6 through 10:
4719
4720 9.6009e-01 1.8728e-01 8.3446e-01 3.3526e-01 8.3750e-01
4721 4.2889e-01 5.6616e-01 2.8738e-01 2.1075e-01 4.0626e-01
4722 6.9434e-01 5.1687e-01 4.6799e-01 5.6063e-01 8.1310e-01
4723 3.9723e-02 7.0505e-01 8.9811e-01 9.4357e-01 3.7400e-01
4724 4.6657e-02 6.1032e-01 4.5710e-01 5.6654e-01 2.6755e-02
4725 4.7177e-01 8.2159e-01 1.9348e-01 4.4297e-04 4.4911e-01
4726 6.7479e-01 2.4456e-01 4.0061e-03 4.5427e-01 2.3461e-01
4727 7.2876e-01 2.8433e-01 8.5717e-01 4.5281e-01 4.3909e-01
4728 5.9167e-01 7.6419e-01 1.4003e-01 4.0845e-02 8.0935e-01
4729 2.7468e-01 7.4208e-01 9.3800e-01 6.0103e-01 7.5989e-01
4730
4731 ans(:,:,2,1,3) =
4732
4733 Columns 1 through 6:
4734
4735 0.3144406 0.4492238 0.3210776 0.1497821 0.5833951 0.8490552
4736 0.9824930 0.7265806 0.8706343 0.1787491 0.7706558 0.0922346
4737 0.8343240 0.5000853 0.3288861 0.2756994 0.7640376 0.0449381
4738 0.0239175 0.9118305 0.8540507 0.7791173 0.6180356 0.8900255
4739 0.4609098 0.9856295 0.4481503 0.7467271 0.9205030 0.1736041
4740 0.2522840 0.5853109 0.7773521 0.0357720 0.5318434 0.1224892
4741 0.6811796 0.2201579 0.4454656 0.8754586 0.2301040 0.0428462
4742 0.5919952 0.3561907 0.9231253 0.4670646 0.9991223 0.8102270
4743 0.8929500 0.9734924 0.4432754 0.6462194 0.2691508 0.1679024
4744 0.1108776 0.2207221 0.2445374 0.2562309 0.2825925 0.3206091
4745
4746 Columns 7 through 10:
4747
4748 0.5482065 0.1904423 0.9086377 0.6126567
4749 0.3320397 0.1238842 0.0435185 0.7314706
4750 0.4481993 0.4115661 0.9242669 0.8499299
4751 0.4386039 0.6351336 0.2455769 0.6618803
4752 0.4609222 0.9394539 0.6088242 0.3358313
4753 0.0854179 0.5619829 0.1892635 0.3640896
4754 0.0096226 0.5155902 0.6920935 0.6643849
4755 0.2964721 0.8071447 0.6327603 0.2741741
4756 0.7812418 0.9049199 0.0523360 0.3749038
4757 0.8870934 0.5149981 0.9373216 0.6739404
4758
4759 ans(:,:,3,1,3) =
4760
4761 Columns 1 through 6:
4762
4763 0.346231 0.694847 0.707671 0.085639 0.466567 0.716807
4764 0.023801 0.418648 0.961039 0.786690 0.301366 0.934630
4765 0.833354 0.409944 0.936141 0.448633 0.407969 0.212977
4766 0.445973 0.866308 0.307409 0.150295 0.307950 0.399792
4767 0.530967 0.974366 0.274299 0.287140 0.156292 0.447983
4768 0.501685 0.071529 0.492295 0.192580 0.220192 0.597013
4769 0.738300 0.871712 0.160501 0.870715 0.751114 0.248977
4770 0.748594 0.251224 0.582473 0.748841 0.290333 0.172787
4771 0.315559 0.214128 0.054372 0.933764 0.322828 0.129749
4772 0.554287 0.172606 0.272414 0.193977 0.188578 0.634297
4773
4774 Columns 7 through 10:
4775
4776 0.863770 0.295949 0.467176 0.209818
4777 0.118984 0.427427 0.211036 0.654256
4778 0.834705 0.070273 0.053068 0.358345
4779 0.218966 0.021331 0.420073 0.973724
4780 0.444437 0.158654 0.017893 0.040638
4781 0.893008 0.465510 0.266844 0.478578
4782 0.770323 0.234894 0.740672 0.938118
4783 0.586680 0.074564 0.431630 0.112819
4784 0.161049 0.329851 0.373123 0.101998
4785 0.038160 0.723431 0.848633 0.011059
4786
4787 ans(:,:,4,1,3) =
4788
4789 Columns 1 through 6:
4790
4791 0.4688882 0.2156854 0.6157801 0.3459437 0.7306166 0.1691803
4792 0.6861487 0.9708954 0.7809346 0.7500212 0.0671029 0.6600254
4793 0.1429935 0.1575170 0.4164209 0.5889212 0.2715798 0.4538906
4794 0.0323139 0.1186050 0.3985368 0.0940944 0.9539747 0.0717362
4795 0.2601728 0.6208839 0.7883033 0.7570049 0.5285336 0.5516416
4796 0.3017383 0.1942561 0.9151548 0.0355131 0.2005608 0.9926870
4797 0.1974383 0.5725224 0.1402459 0.9791335 0.0976611 0.2336492
4798 0.2042691 0.7597393 0.7491054 0.7791514 0.5000714 0.2744578
4799 0.0089501 0.1159639 0.6710723 0.4272502 0.1681824 0.3603148
4800 0.4482561 0.0689440 0.1811430 0.8410362 0.4249539 0.8003807
4801
4802 Columns 7 through 10:
4803
4804 0.4576554 0.1674037 0.1254396 0.9212458
4805 0.8617081 0.9788741 0.2704862 0.1131170
4806 0.1053439 0.3182267 0.5032730 0.4386040
4807 0.9719134 0.4515963 0.0308440 0.9703481
4808 0.8575032 0.0638075 0.7834544 0.6449187
4809 0.5494912 0.9324951 0.3172727 0.2735147
4810 0.4864995 0.2238607 0.5380475 0.9242677
4811 0.4528357 0.9043334 0.1666322 0.8277307
4812 0.3197599 0.8014975 0.9498181 0.5855582
4813 0.5361182 0.7659236 0.6675139 0.3575443
4814
4815 ans(:,:,1,2,3) =
4816
4817 Columns 1 through 6:
4818
4819 0.7330856 0.3042450 0.8898046 0.1755047 0.4457987 0.8037152
4820 0.1114979 0.1439123 0.5902880 0.7711424 0.3678137 0.9083077
4821 0.2445166 0.2329721 0.2395515 0.9756815 0.1064098 0.5483993
4822 0.9278149 0.8078374 0.8807261 0.3310950 0.3232468 0.1266189
4823 0.6665967 0.3363437 0.8233265 0.2842847 0.3060392 0.0145264
4824 0.7546649 0.7868362 0.4076428 0.6631526 0.4638260 0.8560493
4825 0.8397705 0.5463782 0.4909727 0.1768447 0.2470691 0.4120335
4826 0.0983401 0.0856996 0.1697998 0.3833083 0.8611075 0.3729273
4827 0.0990290 0.1564875 0.5247001 0.9386423 0.4074036 0.6870344
4828 0.9768055 0.2989777 0.4091708 0.9669247 0.0017685 0.5602568
4829
4830 Columns 7 through 10:
4831
4832 0.6353499 0.9819943 0.5693483 0.0550054
4833 0.0709421 0.6059790 0.4243352 0.2394649
4834 0.9443484 0.9094269 0.3208277 0.3395519
4835 0.6830302 0.9260379 0.5621889 0.8411683
4836 0.1032302 0.8202412 0.1200913 0.1045161
4837 0.2944562 0.9181236 0.5453256 0.5833506
4838 0.1064836 0.1427281 0.5523289 0.4369657
4839 0.7475847 0.7739307 0.2310015 0.4928523
4840 0.0679849 0.2444004 0.5378377 0.8258556
4841 0.0983835 0.9581749 0.6529665 0.4366992
4842
4843 ans(:,:,2,2,3) =
4844
4845 Columns 1 through 6:
4846
4847 0.801800 0.889606 0.473886 0.413931 0.614331 0.976644
4848 0.034406 0.132254 0.733489 0.650993 0.118877 0.606720
4849 0.154382 0.973474 0.248322 0.782100 0.202628 0.340121
4850 0.814748 0.707078 0.418948 0.035337 0.186991 0.799777
4851 0.965618 0.817127 0.264575 0.289095 0.191235 0.874288
4852 0.395955 0.471524 0.456562 0.502931 0.706726 0.986115
4853 0.156622 0.590867 0.678740 0.726686 0.458974 0.709143
4854 0.741038 0.427106 0.542616 0.118991 0.690710 0.861181
4855 0.331060 0.119422 0.836683 0.430782 0.498884 0.654998
4856 0.604842 0.239425 0.222406 0.849891 0.962850 0.609631
4857
4858 Columns 7 through 10:
4859
4860 0.053919 0.300076 0.678275 0.338434
4861 0.322860 0.747788 0.684467 0.099280
4862 0.973850 0.286965 0.616203 0.392100
4863 0.424588 0.503839 0.364567 0.342696
4864 0.241548 0.804625 0.197536 0.723703
4865 0.098138 0.362786 0.867388 0.805281
4866 0.081192 0.378197 0.322923 0.231199
4867 0.685437 0.804673 0.012785 0.679488
4868 0.027788 0.182210 0.179127 0.844619
4869 0.829615 0.239432 0.987732 0.783645
4870
4871 ans(:,:,3,2,3) =
4872
4873 Columns 1 through 6:
4874
4875 0.8638408 0.5383200 0.8390726 0.4922262 0.5377311 0.3070349
4876 0.8304281 0.9130739 0.2563583 0.1109677 0.6205165 0.4549220
4877 0.6011665 0.6834816 0.1600743 0.0084841 0.8246802 0.4075215
4878 0.7767272 0.9947367 0.3790288 0.1316896 0.4813490 0.7754773
4879 0.6669814 0.3389192 0.8098667 0.2365177 0.7714173 0.1639011
4880 0.4799822 0.5177266 0.9094590 0.1518632 0.7817404 0.3329719
4881 0.1490409 0.1085869 0.7535682 0.5204631 0.6424606 0.1484554
4882 0.5315505 0.3440682 0.8821695 0.1502736 0.4481577 0.6495417
4883 0.6115610 0.7743779 0.8746075 0.8461900 0.6164543 0.2885691
4884 0.1790778 0.7667946 0.9706007 0.8380643 0.0561393 0.8824586
4885
4886 Columns 7 through 10:
4887
4888 0.6228087 0.4695518 0.1045802 0.5680434
4889 0.3644617 0.3462045 0.8742075 0.5602357
4890 0.1129321 0.5047795 0.9976517 0.8098700
4891 0.2035998 0.2189152 0.7757646 0.4933722
4892 0.6368288 0.0198674 0.7799486 0.4718916
4893 0.9115136 0.8247864 0.8294839 0.0896633
4894 0.7085746 0.4791783 0.0375108 0.1751525
4895 0.6911451 0.2915172 0.4730333 0.0688938
4896 0.0986350 0.2037087 0.7406669 0.2259780
4897 0.6479128 0.7178085 0.5234308 0.9833795
4898
4899 ans(:,:,4,2,3) =
4900
4901 Columns 1 through 6:
4902
4903 0.1228437 0.7780539 0.3690884 0.9366872 0.9085254 0.4931580
4904 0.9979052 0.3704630 0.8591198 0.9993234 0.0581341 0.7119564
4905 0.8461543 0.9419168 0.1104134 0.2237329 0.0828601 0.9050517
4906 0.1915681 0.9889016 0.8505302 0.7926905 0.9537788 0.4099166
4907 0.2213825 0.0584224 0.4005544 0.1852734 0.4988128 0.6694278
4908 0.7269050 0.7000921 0.7410180 0.0855901 0.3538941 0.1031796
4909 0.9176624 0.7027551 0.1879621 0.4757906 0.1168271 0.9169995
4910 0.2066870 0.0399170 0.4468000 0.6953315 0.2636719 0.8856366
4911 0.4637182 0.7804980 0.8162842 0.5257744 0.6172873 0.5684309
4912 0.1870185 0.7035381 0.1542301 0.3177718 0.9447843 0.2016580
4913
4914 Columns 7 through 10:
4915
4916 0.9081769 0.2783110 0.7588383 0.5132261
4917 0.3070008 0.3337840 0.0524411 0.9493287
4918 0.5895633 0.9659673 0.7425054 0.4342710
4919 0.4884174 0.3443639 0.9945328 0.2486848
4920 0.9233115 0.3928765 0.6471286 0.4124642
4921 0.8274357 0.1576627 0.1288500 0.2563796
4922 0.9335671 0.0399718 0.3905329 0.9743407
4923 0.7740407 0.9232492 0.8428377 0.2792094
4924 0.1646656 0.4630966 0.7754765 0.0027463
4925 0.9803285 0.3537339 0.0275984 0.7204858
4926
4927 ans(:,:,1,3,3) =
4928
4929 Columns 1 through 6:
4930
4931 0.5451512 0.8501206 0.2304755 0.2498105 0.1888376 0.6490907
4932 0.6366809 0.5170853 0.4553925 0.3529467 0.2941880 0.9944569
4933 0.5122925 0.7736511 0.5807332 0.1962239 0.4819563 0.1205416
4934 0.0650341 0.2077574 0.6380603 0.1652163 0.5069141 0.2623774
4935 0.5283906 0.0038776 0.7067157 0.8545034 0.4883227 0.4027647
4936 0.6935661 0.4070631 0.1358483 0.6181418 0.8104914 0.3330237
4937 0.6968040 0.5745810 0.0931668 0.6721785 0.8460913 0.4107106
4938 0.5785152 0.8470552 0.0756227 0.6873187 0.0438698 0.9966676
4939 0.0140942 0.3091861 0.3241048 0.5055772 0.4598760 0.6843525
4940 0.0522626 0.7262363 0.0841506 0.8864243 0.9317813 0.3542598
4941
4942 Columns 7 through 10:
4943
4944 0.3626136 0.3613126 0.0602946 0.7378855
4945 0.7736633 0.1612781 0.4825160 0.7321479
4946 0.2645039 0.3064498 0.5197230 0.6318896
4947 0.8818802 0.9011179 0.1891753 0.1600077
4948 0.8206620 0.8385200 0.7681921 0.3407088
4949 0.2611078 0.6914835 0.3115156 0.8106428
4950 0.3326413 0.3620572 0.1612614 0.7063555
4951 0.2671771 0.3540776 0.2335775 0.9312685
4952 0.3925613 0.5362972 0.7036809 0.6310741
4953 0.5939778 0.1803123 0.1792624 0.0094850
4954
4955 ans(:,:,2,3,3) =
4956
4957 Columns 1 through 6:
4958
4959 0.480055 0.850857 0.123711 0.625405 0.309723 0.263567
4960 0.975250 0.930985 0.843071 0.239367 0.120495 0.935139
4961 0.689730 0.339604 0.210789 0.664570 0.992767 0.555746
4962 0.685839 0.291060 0.192766 0.174706 0.694030 0.864857
4963 0.580082 0.387641 0.827041 0.085306 0.385927 0.570856
4964 0.913498 0.934841 0.496802 0.376514 0.843975 0.351227
4965 0.977695 0.736267 0.376512 0.297048 0.812334 0.067724
4966 0.221346 0.063625 0.447934 0.894158 0.138811 0.979202
4967 0.310575 0.708989 0.405779 0.530170 0.167860 0.440096
4968 0.123417 0.745651 0.695775 0.019632 0.223622 0.477842
4969
4970 Columns 7 through 10:
4971
4972 0.999597 0.070435 0.765801 0.415470
4973 0.020127 0.525837 0.990626 0.225867
4974 0.757077 0.727578 0.319761 0.863790
4975 0.827709 0.753525 0.250040 0.926440
4976 0.659542 0.552003 0.403290 0.920449
4977 0.241768 0.607339 0.551262 0.106164
4978 0.174699 0.132699 0.195405 0.222836
4979 0.877932 0.879486 0.774517 0.732650
4980 0.619510 0.678228 0.948420 0.272670
4981 0.672432 0.650404 0.869748 0.087234
4982
4983 ans(:,:,3,3,3) =
4984
4985 Columns 1 through 6:
4986
4987 0.2846252 0.1710440 0.6094655 0.7268151 0.2510088 0.2754298
4988 0.5488403 0.2882846 0.2726451 0.8317832 0.3331892 0.5142781
4989 0.1441260 0.7816386 0.7129209 0.0129407 0.4231293 0.7974054
4990 0.6792504 0.0040439 0.7509981 0.2168169 0.3480927 0.8175583
4991 0.6077945 0.6052270 0.7635452 0.3597744 0.2559128 0.1531447
4992 0.6014720 0.5198702 0.9114100 0.4822730 0.7441367 0.0151756
4993 0.1474322 0.7942648 0.0701747 0.0911274 0.3684599 0.8922914
4994 0.1539660 0.5633182 0.6048291 0.9356029 0.7782934 0.2643835
4995 0.0653401 0.4600428 0.0834668 0.5067473 0.2612884 0.3010248
4996 0.3276631 0.2028324 0.5865180 0.4980144 0.8092142 0.9596885
4997
4998 Columns 7 through 10:
4999
5000 0.8011920 0.2816751 0.1209784 0.1871667
5001 0.8361668 0.9668568 0.6825827 0.1022839
5002 0.1892759 0.8674382 0.6554186 0.7467678
5003 0.5897867 0.4231385 0.9867465 0.0485279
5004 0.1033270 0.7222864 0.1380636 0.4314299
5005 0.3765269 0.1163341 0.7089589 0.7003331
5006 0.5845179 0.2773794 0.0189292 0.8931890
5007 0.6287488 0.4329276 0.1939273 0.5792620
5008 0.2075719 0.9958989 0.8779850 0.4668706
5009 0.3564005 0.5261375 0.0130078 0.6342188
5010
5011 ans(:,:,4,3,3) =
5012
5013 Columns 1 through 6:
5014
5015 0.103288 0.749715 0.016936 0.572145 0.352822 0.604138
5016 0.874111 0.276434 0.436598 0.687274 0.130699 0.169570
5017 0.467697 0.564932 0.399560 0.109354 0.727055 0.080277
5018 0.399710 0.820655 0.296942 0.898174 0.472342 0.999163
5019 0.360285 0.901911 0.171391 0.138758 0.393811 0.588268
5020 0.014444 0.889683 0.475232 0.092502 0.353702 0.903984
5021 0.379640 0.427433 0.188672 0.435678 0.376546 0.360428
5022 0.968674 0.077473 0.635428 0.103905 0.487530 0.197135
5023 0.154273 0.205481 0.373369 0.273767 0.213899 0.578077
5024 0.195533 0.707775 0.582127 0.039266 0.305968 0.479923
5025
5026 Columns 7 through 10:
5027
5028 0.665827 0.753722 0.885713 0.618882
5029 0.308906 0.421122 0.663639 0.625722
5030 0.589005 0.471625 0.679215 0.299922
5031 0.906937 0.049325 0.442257 0.113711
5032 0.130041 0.820066 0.385054 0.293687
5033 0.586955 0.392636 0.412309 0.534002
5034 0.159771 0.115198 0.133780 0.439231
5035 0.307487 0.362510 0.973057 0.569527
5036 0.131633 0.578125 0.357810 0.415215
5037 0.223604 0.592966 0.445016 0.244886
5038
5039 ans(:,:,1,1,4) =
5040
5041 Columns 1 through 6:
5042
5043 0.3785191 0.0108493 0.9605271 0.0023736 0.4513397 0.7941403
5044 0.4393758 0.1930053 0.9190101 0.2971234 0.6425911 0.6617955
5045 0.4839588 0.0155434 0.8736503 0.5692455 0.4682384 0.6035955
5046 0.0321522 0.8966157 0.7655156 0.4383293 0.4959687 0.1269778
5047 0.1832596 0.8379255 0.3944127 0.3522696 0.7231979 0.5714074
5048 0.8226049 0.9250080 0.0482925 0.0394528 0.0673779 0.7472375
5049 0.9110212 0.8812026 0.4383090 0.6884619 0.4316804 0.6579136
5050 0.9510257 0.6822651 0.8265268 0.1986968 0.5583221 0.2418278
5051 0.0822499 0.2769205 0.7628481 0.7232950 0.7167915 0.8057909
5052 0.4017382 0.7031880 0.3600857 0.1716812 0.2066791 0.3299801
5053
5054 Columns 7 through 10:
5055
5056 0.7811152 0.9041819 0.0696058 0.8690373
5057 0.3228429 0.5467856 0.2348992 0.7928588
5058 0.1885670 0.9033467 0.7118153 0.1220953
5059 0.8772282 0.5113753 0.0714468 0.3197514
5060 0.8149026 0.6432656 0.9754336 0.8634003
5061 0.3584193 0.7960000 0.7767492 0.6795313
5062 0.2045736 0.2964510 0.6861184 0.3886449
5063 0.7996347 0.0800178 0.1172766 0.3637207
5064 0.4150001 0.2880630 0.6289046 0.5933788
5065 0.6226515 0.7524806 0.2858924 0.9487069
5066
5067 ans(:,:,2,1,4) =
5068
5069 Columns 1 through 6:
5070
5071 0.8100104 0.3979261 0.3467350 0.4808002 0.8978606 0.5025340
5072 0.8423734 0.8449910 0.0877013 0.1351406 0.5909174 0.4233560
5073 0.8292347 0.2863203 0.6685257 0.1828632 0.0766521 0.6964954
5074 0.6890046 0.0474064 0.7071524 0.2093959 0.5247008 0.9220472
5075 0.4777844 0.8325253 0.5332144 0.7242996 0.8526023 0.9554140
5076 0.3216604 0.4375894 0.2453835 0.4818066 0.2881497 0.1257933
5077 0.0145445 0.4085173 0.5530977 0.8422774 0.2781154 0.2549177
5078 0.4663474 0.0458723 0.6755106 0.5872221 0.0074437 0.1228561
5079 0.4814045 0.3968975 0.5946606 0.6045436 0.2928195 0.8705251
5080 0.1325210 0.5700379 0.5205358 0.8103258 0.8512867 0.9098072
5081
5082 Columns 7 through 10:
5083
5084 0.1922647 0.3881156 0.7967817 0.5125256
5085 0.0335228 0.3212042 0.9422233 0.2639867
5086 0.9266748 0.6928911 0.1345436 0.9218868
5087 0.2425319 0.6892601 0.7569770 0.0013963
5088 0.8980518 0.4587089 0.1340647 0.1629767
5089 0.6059684 0.4370783 0.1709569 0.4701822
5090 0.1082179 0.9786090 0.0095417 0.9005811
5091 0.9201644 0.0600551 0.2403048 0.6353613
5092 0.9633558 0.0441327 0.2115948 0.1442310
5093 0.6192783 0.2320528 0.7727746 0.6280055
5094
5095 ans(:,:,3,1,4) =
5096
5097 Columns 1 through 6:
5098
5099 0.431920 0.904283 0.490634 0.966862 0.576891 0.751729
5100 0.955016 0.394360 0.759523 0.598377 0.674727 0.549850
5101 0.284063 0.227637 0.718218 0.952498 0.026483 0.399514
5102 0.668879 0.576639 0.804784 0.952752 0.539398 0.820547
5103 0.031079 0.152640 0.069120 0.526655 0.085074 0.287305
5104 0.469471 0.960297 0.077083 0.458250 0.929945 0.439228
5105 0.578581 0.904569 0.482331 0.118060 0.909695 0.909585
5106 0.668272 0.669797 0.774112 0.230339 0.482550 0.673848
5107 0.839362 0.272602 0.317071 0.449671 0.298279 0.745459
5108 0.769755 0.717374 0.889845 0.676432 0.041727 0.224992
5109
5110 Columns 7 through 10:
5111
5112 0.538840 0.495023 0.215640 0.624529
5113 0.103167 0.082754 0.070717 0.470035
5114 0.706418 0.292864 0.482974 0.157382
5115 0.413895 0.527933 0.902264 0.093735
5116 0.962201 0.032496 0.657382 0.299943
5117 0.420276 0.040720 0.598305 0.745401
5118 0.897602 0.681424 0.664921 0.952166
5119 0.687243 0.192571 0.782766 0.931884
5120 0.090040 0.603187 0.928007 0.936038
5121 0.743185 0.499967 0.558059 0.328708
5122
5123 ans(:,:,4,1,4) =
5124
5125 Columns 1 through 6:
5126
5127 0.1329071 0.1336629 0.4882787 0.6386346 0.9141590 0.6183739
5128 0.4862451 0.5417116 0.1914554 0.4709545 0.5149824 0.1880359
5129 0.8742992 0.3923178 0.2275061 0.7457718 0.5333878 0.4723723
5130 0.1478415 0.9754518 0.4300433 0.2446824 0.7490084 0.2412507
5131 0.4994754 0.6481735 0.8274194 0.8259531 0.7721391 0.7264443
5132 0.1786777 0.8583073 0.6016381 0.2230578 0.9594751 0.7236471
5133 0.6662511 0.4089263 0.7545118 0.4192134 0.3741564 0.1917574
5134 0.9145741 0.2216669 0.5118600 0.8873028 0.0814163 0.9492785
5135 0.3555764 0.2013435 0.0232607 0.9370945 0.9973404 0.3444831
5136 0.4940396 0.7258596 0.1706104 0.0016818 0.0928433 0.9611576
5137
5138 Columns 7 through 10:
5139
5140 0.3364611 0.6485233 0.6800868 0.0071692
5141 0.8885098 0.6270486 0.8625918 0.3069994
5142 0.5025243 0.5172204 0.8686165 0.6249793
5143 0.2011078 0.9393565 0.9496010 0.0259430
5144 0.3595349 0.1913845 0.8334979 0.1240816
5145 0.1919674 0.7618145 0.7406813 0.2758892
5146 0.7171427 0.4017847 0.2162053 0.6918610
5147 0.8484749 0.0065517 0.2919607 0.3693019
5148 0.0545048 0.0701195 0.4613084 0.7994261
5149 0.6158300 0.0989261 0.2988987 0.5957631
5150
5151 ans(:,:,1,2,4) =
5152
5153 Columns 1 through 6:
5154
5155 0.9221863 0.3937555 0.9604929 0.8230049 0.1144016 0.7122617
5156 0.3672935 0.1570914 0.0688964 0.5651891 0.2317572 0.0538997
5157 0.7367600 0.8924232 0.6078225 0.7512682 0.0951665 0.6603563
5158 0.1536374 0.8423908 0.9164920 0.2159831 0.7297324 0.2513081
5159 0.2287588 0.3276718 0.9493095 0.5827039 0.9846809 0.9111145
5160 0.6577846 0.8094693 0.5642568 0.5294142 0.2974792 0.9843389
5161 0.0519598 0.0941951 0.0553248 0.8868559 0.9624232 0.1564037
5162 0.6032713 0.9133535 0.7761071 0.6792725 0.8374845 0.2998004
5163 0.5282124 0.6577550 0.5411139 0.3467639 0.7822044 0.4794027
5164 0.5400329 0.7851130 0.7214275 0.8928510 0.7034001 0.4389079
5165
5166 Columns 7 through 10:
5167
5168 0.5256372 0.3891840 0.5531684 0.4302961
5169 0.9937101 0.3912479 0.3058315 0.4970499
5170 0.7892641 0.9058443 0.7333813 0.5971163
5171 0.9381805 0.1272013 0.0956130 0.1929533
5172 0.9172565 0.3368015 0.1307791 0.4649270
5173 0.0083401 0.5142274 0.1292110 0.2124670
5174 0.2137713 0.1134284 0.2100682 0.4409604
5175 0.4575967 0.2236272 0.0331036 0.3328078
5176 0.7761853 0.1085660 0.4492486 0.6909637
5177 0.4633845 0.8153640 0.8215780 0.3755443
5178
5179 ans(:,:,2,2,4) =
5180
5181 Columns 1 through 6:
5182
5183 0.819123 0.120903 0.484382 0.038341 0.161939 0.636981
5184 0.838219 0.283026 0.283573 0.199184 0.263532 0.859071
5185 0.325131 0.873733 0.994821 0.674037 0.128881 0.768851
5186 0.371981 0.125940 0.512698 0.867149 0.944740 0.916469
5187 0.180179 0.930897 0.967205 0.226741 0.475812 0.168968
5188 0.822865 0.450575 0.481773 0.268391 0.037168 0.226606
5189 0.873644 0.507853 0.995267 0.587533 0.339955 0.408680
5190 0.759996 0.549796 0.756510 0.446919 0.413644 0.943504
5191 0.138307 0.175906 0.030845 0.753134 0.662311 0.646046
5192 0.844333 0.794263 0.645958 0.422030 0.448024 0.427176
5193
5194 Columns 7 through 10:
5195
5196 0.445721 0.265980 0.110597 0.107560
5197 0.646451 0.932811 0.691615 0.244065
5198 0.866176 0.181976 0.270733 0.351144
5199 0.121436 0.145280 0.647547 0.693117
5200 0.078989 0.598467 0.106820 0.226173
5201 0.608855 0.955578 0.425256 0.950652
5202 0.697084 0.035168 0.609061 0.723807
5203 0.475361 0.469438 0.513648 0.944952
5204 0.352257 0.189332 0.993169 0.443124
5205 0.765749 0.596841 0.156123 0.294381
5206
5207 ans(:,:,3,2,4) =
5208
5209 Columns 1 through 6:
5210
5211 0.2207312 0.0506856 0.7948222 0.8740116 0.1977410 0.0225726
5212 0.0129601 0.9909827 0.4778199 0.9156120 0.5315436 0.4643840
5213 0.8820794 0.8077184 0.7350488 0.6930436 0.8944724 0.1002417
5214 0.3883300 0.5333843 0.8335439 0.1332570 0.2170623 0.5199104
5215 0.7644182 0.0916670 0.9178284 0.2444251 0.3463661 0.9430180
5216 0.4148302 0.0328810 0.6544471 0.0446654 0.9486696 0.8702543
5217 0.0066148 0.1508441 0.8807896 0.5622397 0.1796325 0.0654344
5218 0.3284826 0.7146644 0.0730952 0.4683785 0.3821778 0.1356288
5219 0.7941329 0.9828135 0.9366276 0.4365991 0.7822187 0.3467706
5220 0.1181847 0.5932183 0.2123378 0.5502300 0.4064237 0.9484115
5221
5222 Columns 7 through 10:
5223
5224 0.2814349 0.3358703 0.1909897 0.5761938
5225 0.1001476 0.4171805 0.0205788 0.8417514
5226 0.1772972 0.8073782 0.1033353 0.9750542
5227 0.7781270 0.0594298 0.4628182 0.4482644
5228 0.6048608 0.1516473 0.0993976 0.4753654
5229 0.9453228 0.8232433 0.2345676 0.3244100
5230 0.4168277 0.2724879 0.7021812 0.9570908
5231 0.4211829 0.1483663 0.5357381 0.2868630
5232 0.9246399 0.5521450 0.4772562 0.3061049
5233 0.4107650 0.9296004 0.5825844 0.4040235
5234
5235 ans(:,:,4,2,4) =
5236
5237 Columns 1 through 6:
5238
5239 0.3998692 0.1816136 0.4014900 0.1878816 0.9687808 0.6807696
5240 0.2743225 0.1820235 0.6939612 0.6013270 0.7215128 0.0301795
5241 0.5660411 0.0896822 0.2080072 0.1818823 0.5363087 0.9853368
5242 0.6517941 0.1926007 0.1567062 0.7534557 0.1176018 0.1333705
5243 0.6836826 0.6915843 0.1046337 0.6909996 0.2060720 0.3076803
5244 0.8169169 0.7722084 0.5142177 0.3070352 0.8379442 0.1788433
5245 0.0962919 0.1945839 0.1783261 0.9584661 0.1483848 0.4020275
5246 0.0024227 0.0592890 0.0585696 0.4118688 0.8106422 0.4602598
5247 0.7181605 0.6297752 0.7005899 0.7858837 0.3575236 0.0856582
5248 0.9327273 0.8518045 0.8813047 0.7356853 0.1917535 0.1573381
5249
5250 Columns 7 through 10:
5251
5252 0.3341257 0.9666190 0.0500985 0.1787116
5253 0.5634728 0.0348642 0.4322336 0.7682960
5254 0.2576974 0.2843808 0.0432594 0.4831940
5255 0.9855501 0.9954829 0.6100633 0.2294395
5256 0.0279284 0.0226153 0.7314434 0.7958407
5257 0.3464461 0.6501314 0.6060481 0.4320377
5258 0.5402023 0.2511329 0.9928612 0.1246288
5259 0.4823693 0.5856430 0.1391674 0.7279321
5260 0.1148116 0.0069934 0.0668799 0.7736395
5261 0.5978489 0.4175776 0.3291589 0.7364442
5262
5263 ans(:,:,1,3,4) =
5264
5265 Columns 1 through 6:
5266
5267 0.4428318 0.2398345 0.8054242 0.5311792 0.0309002 0.2604719
5268 0.8039845 0.9816392 0.0176186 0.7378988 0.7496737 0.1005455
5269 0.2781143 0.5221152 0.7629324 0.9721451 0.0856175 0.8197961
5270 0.0804212 0.1706542 0.8776389 0.3257413 0.8405505 0.8124761
5271 0.7845693 0.8186195 0.7931446 0.6896201 0.1012919 0.8148798
5272 0.4674011 0.2497635 0.8904285 0.5316739 0.9462265 0.5532187
5273 0.9632776 0.4298828 0.7034344 0.8142668 0.8923561 0.8249331
5274 0.3329943 0.0030627 0.1135250 0.4431260 0.5723092 0.7205891
5275 0.6636094 0.5761154 0.0874562 0.4811210 0.7875135 0.8079906
5276 0.9169652 0.2869805 0.6740854 0.3853947 0.5753733 0.6599927
5277
5278 Columns 7 through 10:
5279
5280 0.4581947 0.0190495 0.1994428 0.9169318
5281 0.2565918 0.3324478 0.4357084 0.9218572
5282 0.0704882 0.7451727 0.1049664 0.8319775
5283 0.8347842 0.4330171 0.4950951 0.0253417
5284 0.0282180 0.9718128 0.2084240 0.6230062
5285 0.4971704 0.5908029 0.4444892 0.4561286
5286 0.2362598 0.0493352 0.8117606 0.1696213
5287 0.9855283 0.7919508 0.5259903 0.5212839
5288 0.2747836 0.8284489 0.6706880 0.2339590
5289 0.7480057 0.1340183 0.5515319 0.6119487
5290
5291 ans(:,:,2,3,4) =
5292
5293 Columns 1 through 6:
5294
5295 0.045956 0.453027 0.332471 0.471060 0.769015 0.204756
5296 0.405728 0.084246 0.806740 0.783708 0.793071 0.929316
5297 0.307348 0.032294 0.916778 0.914669 0.180892 0.406862
5298 0.265401 0.027937 0.931253 0.259871 0.975836 0.515867
5299 0.701070 0.105863 0.063624 0.442207 0.072759 0.076980
5300 0.351702 0.390311 0.101864 0.544741 0.584084 0.903041
5301 0.700058 0.368975 0.309714 0.283959 0.059429 0.251071
5302 0.132286 0.215867 0.188597 0.109037 0.450382 0.922532
5303 0.096045 0.490030 0.510885 0.050734 0.234843 0.144785
5304 0.753793 0.663184 0.289764 0.578164 0.376885 0.036052
5305
5306 Columns 7 through 10:
5307
5308 0.194204 0.385404 0.935548 0.659758
5309 0.131649 0.645945 0.600144 0.721072
5310 0.837149 0.484250 0.235129 0.890835
5311 0.430541 0.359981 0.803519 0.627617
5312 0.820869 0.281609 0.058534 0.236352
5313 0.016961 0.512811 0.871534 0.324573
5314 0.464656 0.450423 0.053522 0.200902
5315 0.070603 0.665820 0.133322 0.187405
5316 0.376772 0.956613 0.723076 0.556708
5317 0.247163 0.369644 0.241978 0.660996
5318
5319 ans(:,:,3,3,4) =
5320
5321 Columns 1 through 6:
5322
5323 0.1900844 0.5042037 0.2352399 0.4259761 0.5340870 0.7224739
5324 0.4425407 0.9898682 0.5864365 0.8480903 0.6838866 0.8333596
5325 0.1653547 0.6113855 0.1806442 0.7444247 0.8381104 0.5388216
5326 0.5267754 0.1779311 0.0264266 0.0753469 0.1161482 0.5352721
5327 0.5710416 0.8621054 0.4645747 0.0777636 0.1868425 0.7127999
5328 0.2048246 0.0687362 0.4413036 0.7715360 0.2181228 0.8413727
5329 0.6013444 0.3660024 0.8985174 0.9695797 0.6110059 0.5878016
5330 0.5923611 0.2194472 0.4159441 0.2434017 0.0563829 0.7586861
5331 0.5594199 0.8369203 0.3973945 0.2624748 0.9266826 0.9693698
5332 0.5224290 0.9632543 0.2961119 0.3169275 0.7082023 0.0323499
5333
5334 Columns 7 through 10:
5335
5336 0.5666893 0.6450891 0.0619235 0.8015281
5337 0.5236031 0.4093964 0.3465515 0.9741782
5338 0.4840864 0.1091859 0.9761335 0.9409857
5339 0.7915930 0.1964440 0.0113213 0.6952987
5340 0.1304345 0.9664155 0.9790717 0.8100319
5341 0.5963768 0.2873119 0.7071798 0.1999273
5342 0.1568308 0.0020468 0.5721391 0.1793425
5343 0.6041103 0.6636926 0.2359058 0.3164876
5344 0.1142857 0.0616902 0.6012203 0.1198328
5345 0.2558451 0.7963141 0.1316205 0.3497879
5346
5347 ans(:,:,4,3,4) =
5348
5349 Columns 1 through 6:
5350
5351 0.455483 0.433091 0.546476 0.770915 0.610159 0.127337
5352 0.722177 0.375602 0.299812 0.788992 0.439248 0.800542
5353 0.848727 0.176577 0.971902 0.210796 0.332562 0.095872
5354 0.895288 0.210152 0.212159 0.179440 0.105010 0.542659
5355 0.199930 0.210232 0.188306 0.048453 0.715464 0.627898
5356 0.901017 0.218487 0.234079 0.651553 0.366748 0.254831
5357 0.187307 0.757084 0.380337 0.555499 0.474192 0.645459
5358 0.865772 0.438766 0.936289 0.420820 0.372481 0.823051
5359 0.153491 0.602102 0.630728 0.550746 0.710080 0.513180
5360 0.900283 0.125030 0.806739 0.781810 0.937753 0.333983
5361
5362 Columns 7 through 10:
5363
5364 0.735940 0.956946 0.709751 0.265074
5365 0.821596 0.966594 0.243540 0.490638
5366 0.701439 0.227575 0.010666 0.097196
5367 0.438868 0.945198 0.396448 0.428829
5368 0.805237 0.209144 0.349541 0.807463
5369 0.622573 0.763742 0.785789 0.969664
5370 0.659886 0.363532 0.532697 0.271219
5371 0.306488 0.326145 0.054343 0.429109
5372 0.610497 0.939184 0.865744 0.209673
5373 0.777626 0.094531 0.169519 0.322487
5374
5375 ans(:,:,1,1,5) =
5376
5377 Columns 1 through 6:
5378
5379 0.7525529 0.2526449 0.5518167 0.7476556 0.6590931 0.3645592
5380 0.8284224 0.2015857 0.8144802 0.1514454 0.4946551 0.2118947
5381 0.6471742 0.8672025 0.0799349 0.9695598 0.7143175 0.2051612
5382 0.2201457 0.4645232 0.9393170 0.6166459 0.2899488 0.5894681
5383 0.1720271 0.0387727 0.3689050 0.8327928 0.8281529 0.3017802
5384 0.9226222 0.6954933 0.0025359 0.2225603 0.8473578 0.4420238
5385 0.4429980 0.1232048 0.2873159 0.8691833 0.5007745 0.3834831
5386 0.6207460 0.4464608 0.3105228 0.2897732 0.1774605 0.0395224
5387 0.9198031 0.4652506 0.4177073 0.7615541 0.4366602 0.9013855
5388 0.6761669 0.8181348 0.8552856 0.5985181 0.3988782 0.9557264
5389
5390 Columns 7 through 10:
5391
5392 0.1562362 0.9402438 0.4178779 0.4828962
5393 0.2350522 0.5360951 0.9756493 0.2689078
5394 0.9775066 0.0783453 0.1572501 0.5173312
5395 0.4399105 0.8319434 0.8591298 0.0878774
5396 0.9052349 0.6235324 0.9563297 0.6223853
5397 0.8190105 0.9753877 0.8739221 0.7005340
5398 0.8284015 0.1330207 0.7216829 0.2117149
5399 0.8476556 0.0469990 0.5927292 0.8871432
5400 0.0493367 0.7829278 0.3196544 0.7290857
5401 0.8589844 0.1794937 0.2668246 0.3640466
5402
5403 ans(:,:,2,1,5) =
5404
5405 Columns 1 through 6:
5406
5407 0.949101 0.807530 0.184762 0.063234 0.643219 0.423089
5408 0.802067 0.381490 0.127063 0.174317 0.194559 0.198314
5409 0.162079 0.340070 0.813433 0.461299 0.068899 0.710028
5410 0.529192 0.748057 0.444558 0.222226 0.566966 0.055088
5411 0.165613 0.060685 0.505405 0.380502 0.058439 0.095110
5412 0.039772 0.903359 0.400247 0.972611 0.846175 0.377672
5413 0.165600 0.452785 0.415005 0.123863 0.032456 0.191811
5414 0.087627 0.828465 0.138878 0.117744 0.039669 0.738604
5415 0.176998 0.959255 0.445712 0.950234 0.307830 0.845644
5416 0.479856 0.519376 0.855981 0.877873 0.015214 0.111778
5417
5418 Columns 7 through 10:
5419
5420 0.851341 0.421584 0.126577 0.380539
5421 0.987831 0.522625 0.027647 0.390499
5422 0.622777 0.357686 0.375540 0.693333
5423 0.584734 0.417811 0.734467 0.607747
5424 0.244363 0.033658 0.422938 0.126092
5425 0.235824 0.761113 0.825028 0.182227
5426 0.752699 0.352376 0.268589 0.507060
5427 0.628813 0.032904 0.979176 0.988437
5428 0.048061 0.065858 0.463159 0.266321
5429 0.815382 0.935908 0.805265 0.579584
5430
5431 ans(:,:,3,1,5) =
5432
5433 Columns 1 through 6:
5434
5435 0.737323 0.905360 0.316564 0.368499 0.753532 0.767448
5436 0.385909 0.827211 0.341869 0.372557 0.759581 0.862251
5437 0.410366 0.304743 0.820749 0.990932 0.250699 0.141378
5438 0.561998 0.093783 0.187227 0.332428 0.849277 0.264085
5439 0.508426 0.887574 0.955740 0.267614 0.641164 0.441224
5440 0.606690 0.435946 0.055648 0.662932 0.064705 0.691922
5441 0.054660 0.083549 0.997945 0.497239 0.982208 0.239593
5442 0.488767 0.262034 0.415360 0.162416 0.114267 0.414360
5443 0.041459 0.616860 0.775544 0.097906 0.521429 0.364545
5444 0.283602 0.530584 0.069798 0.834012 0.875984 0.180513
5445
5446 Columns 7 through 10:
5447
5448 0.760188 0.692474 0.572610 0.945949
5449 0.130591 0.774632 0.671396 0.773314
5450 0.672971 0.943170 0.135099 0.818206
5451 0.665143 0.593637 0.234495 0.346348
5452 0.502504 0.023369 0.676187 0.885779
5453 0.678728 0.458255 0.366031 0.251197
5454 0.252500 0.291171 0.290848 0.610278
5455 0.323417 0.583610 0.800318 0.942947
5456 0.078138 0.185280 0.690551 0.238598
5457 0.654039 0.037470 0.901182 0.851475
5458
5459 ans(:,:,4,1,5) =
5460
5461 Columns 1 through 6:
5462
5463 0.0858624 0.5701325 0.6540565 0.0205818 0.5880964 0.3028144
5464 0.3090545 0.0793148 0.3541483 0.3836416 0.3261831 0.2555240
5465 0.7507791 0.6948825 0.1497456 0.9160420 0.9465602 0.0798751
5466 0.8561579 0.3198855 0.9982400 0.6285265 0.7948257 0.5347386
5467 0.7494093 0.9516750 0.5796647 0.3224356 0.1124342 0.5256283
5468 0.7508151 0.3623406 0.6603595 0.0781232 0.5626022 0.5841854
5469 0.6952069 0.8122681 0.8124431 0.0449089 0.8911996 0.0312853
5470 0.3452848 0.8424360 0.3130398 0.8069593 0.7757878 0.7200304
5471 0.1977939 0.4842620 0.5158552 0.2752961 0.5354950 0.3448198
5472 0.6158655 0.4811996 0.5151347 0.8054806 0.3798442 0.5253331
5473
5474 Columns 7 through 10:
5475
5476 0.2368545 0.0097400 0.8510853 0.5857612
5477 0.8785074 0.2719509 0.4371422 0.1039167
5478 0.1352587 0.3962855 0.4349480 0.1541173
5479 0.3523106 0.2463757 0.9304385 0.1048577
5480 0.6833446 0.7245782 0.3270974 0.6919563
5481 0.8497526 0.8966069 0.8169554 0.2215362
5482 0.3286397 0.7553802 0.2781760 0.2009482
5483 0.7997442 0.5672165 0.0512356 0.8973802
5484 0.8345787 0.5228720 0.0446545 0.7480455
5485 0.0964453 0.6580536 0.0723279 0.4209157
5486
5487 ans(:,:,1,2,5) =
5488
5489 Columns 1 through 6:
5490
5491 0.438774 0.314456 0.458459 0.926635 0.010484 0.037389
5492 0.815694 0.879419 0.726062 0.546165 0.135028 0.446645
5493 0.436101 0.892103 0.540482 0.168270 0.353211 0.158197
5494 0.999735 0.034360 0.915122 0.154533 0.139559 0.720740
5495 0.842763 0.273673 0.021058 0.621158 0.794456 0.452874
5496 0.644759 0.404026 0.377913 0.568501 0.833690 0.768432
5497 0.744571 0.148542 0.671533 0.121242 0.926864 0.990331
5498 0.063632 0.491821 0.094314 0.269770 0.656471 0.021625
5499 0.237936 0.626790 0.562920 0.696457 0.584835 0.778039
5500 0.015329 0.931627 0.142827 0.216644 0.551701 0.485132
5501
5502 Columns 7 through 10:
5503
5504 0.273156 0.430352 0.669936 0.708889
5505 0.346589 0.908352 0.998360 0.045358
5506 0.667300 0.114604 0.596104 0.609949
5507 0.194637 0.732624 0.985820 0.889626
5508 0.798545 0.789774 0.265795 0.186119
5509 0.055130 0.554879 0.027643 0.735173
5510 0.778877 0.616582 0.028475 0.642420
5511 0.510587 0.606727 0.211427 0.757764
5512 0.370941 0.839959 0.415943 0.708189
5513 0.634897 0.618190 0.253100 0.750889
5514
5515 ans(:,:,2,2,5) =
5516
5517 Columns 1 through 6:
5518
5519 0.599960 0.366123 0.172038 0.720374 0.793966 0.635938
5520 0.802937 0.883986 0.259999 0.982068 0.776531 0.045899
5521 0.938947 0.967589 0.795366 0.075927 0.485244 0.690240
5522 0.623743 0.674721 0.401160 0.248431 0.595650 0.222967
5523 0.872494 0.884911 0.236057 0.474905 0.315514 0.349974
5524 0.719052 0.421072 0.694964 0.471894 0.820218 0.239910
5525 0.134472 0.601424 0.704536 0.774624 0.790520 0.917434
5526 0.947465 0.655852 0.753532 0.725942 0.982712 0.269186
5527 0.442003 0.749828 0.849785 0.268833 0.120107 0.038457
5528 0.874144 0.773665 0.737600 0.239593 0.923668 0.732074
5529
5530 Columns 7 through 10:
5531
5532 0.411312 0.504910 0.897257 0.871952
5533 0.132512 0.888823 0.573310 0.888081
5534 0.657286 0.076431 0.193392 0.458831
5535 0.024494 0.011068 0.974473 0.661190
5536 0.995294 0.339811 0.017605 0.772314
5537 0.448058 0.461953 0.436285 0.544055
5538 0.556011 0.431284 0.442935 0.767002
5539 0.604538 0.279958 0.218520 0.563034
5540 0.532139 0.575311 0.944990 0.031470
5541 0.655849 0.408060 0.779106 0.218882
5542
5543 ans(:,:,3,2,5) =
5544
5545 Columns 1 through 6:
5546
5547 0.7308850 0.8719699 0.6273512 0.9777553 0.8903067 0.9171131
5548 0.4312186 0.2807537 0.7029967 0.5344480 0.8271091 0.5667781
5549 0.6019108 0.8426071 0.7663381 0.0198564 0.4280430 0.0542346
5550 0.5301294 0.6562546 0.6904015 0.4683159 0.6471575 0.3907886
5551 0.1368987 0.4757006 0.3496592 0.9893074 0.5882830 0.4034688
5552 0.5853650 0.3143311 0.0566842 0.4370902 0.3993760 0.8952610
5553 0.1253357 0.5207573 0.3237674 0.9952988 0.0149685 0.4150831
5554 0.9651695 0.0363191 0.9682654 0.0940314 0.2193166 0.9363568
5555 0.9632905 0.1134134 0.1205081 0.4995357 0.5666459 0.7011007
5556 0.9872827 0.0110440 0.5623660 0.7501842 0.4325043 0.0039972
5557
5558 Columns 7 through 10:
5559
5560 0.5951025 0.9789338 0.0735213 0.7822870
5561 0.8435287 0.2555188 0.5872638 0.1691479
5562 0.5762648 0.0332170 0.5176996 0.1574856
5563 0.8602033 0.1569811 0.4382080 0.5341847
5564 0.1962821 0.5747071 0.3832164 0.9007896
5565 0.5568725 0.0093489 0.9152092 0.4748951
5566 0.6660920 0.4159313 0.9116907 0.8330728
5567 0.2978317 0.0379045 0.9011523 0.0678634
5568 0.1032624 0.8835024 0.8243145 0.0998555
5569 0.9064715 0.1293815 0.9863038 0.8610186
5570
5571 ans(:,:,4,2,5) =
5572
5573 Columns 1 through 6:
5574
5575 0.1871997 0.0025077 0.2008516 0.3753066 0.0370124 0.5915076
5576 0.5867163 0.2677020 0.3666668 0.7767783 0.9844890 0.1567256
5577 0.7515606 0.8857211 0.2844261 0.5678163 0.3037900 0.7288401
5578 0.7702729 0.6540770 0.3495550 0.6939664 0.9317906 0.1689494
5579 0.5243031 0.0191734 0.7021083 0.7801938 0.2983707 0.7862142
5580 0.6942854 0.2520309 0.2093010 0.1319610 0.6044765 0.8937971
5581 0.5852260 0.3986314 0.2678591 0.6260540 0.8181763 0.5242560
5582 0.3679850 0.1002911 0.5795569 0.9290391 0.1943274 0.5763062
5583 0.8582503 0.8595343 0.3338544 0.1704357 0.5986601 0.3238175
5584 0.1384983 0.9793223 0.0210770 0.1780496 0.9293071 0.2411204
5585
5586 Columns 7 through 10:
5587
5588 0.2724874 0.2144238 0.2393040 0.3405780
5589 0.6806879 0.6712833 0.2333862 0.2738428
5590 0.0753792 0.3944164 0.8565890 0.4328555
5591 0.3737041 0.4171043 0.4193427 0.9452840
5592 0.0175592 0.6380302 0.2738426 0.5925482
5593 0.2299823 0.9397760 0.6751462 0.9470003
5594 0.7361179 0.2450149 0.9937926 0.0901551
5595 0.5014340 0.4710196 0.4453339 0.7279992
5596 0.6796307 0.7145715 0.7833796 0.4424184
5597 0.9226588 0.7416265 0.0031776 0.1889637
5598
5599 ans(:,:,1,3,5) =
5600
5601 Columns 1 through 6:
5602
5603 0.162686 0.826070 0.280811 0.460022 0.409782 0.777538
5604 0.179209 0.942803 0.062075 0.068898 0.405612 0.251916
5605 0.194171 0.897989 0.668488 0.222695 0.139410 0.576132
5606 0.181131 0.713345 0.648146 0.879462 0.093753 0.430555
5607 0.508321 0.857280 0.707330 0.944771 0.566885 0.310890
5608 0.319102 0.995842 0.537540 0.232012 0.514900 0.278095
5609 0.612414 0.127316 0.494216 0.305110 0.821853 0.073798
5610 0.951200 0.770335 0.452708 0.212228 0.092842 0.113831
5611 0.492607 0.029941 0.424554 0.451297 0.390969 0.735861
5612 0.293330 0.824030 0.998432 0.058730 0.752901 0.863079
5613
5614 Columns 7 through 10:
5615
5616 0.649692 0.756461 0.548008 0.739541
5617 0.427832 0.874076 0.642703 0.968906
5618 0.668597 0.378141 0.815889 0.437688
5619 0.260223 0.868810 0.747671 0.454604
5620 0.253437 0.514037 0.857072 0.250732
5621 0.281889 0.706310 0.610817 0.619007
5622 0.870881 0.861323 0.281057 0.076955
5623 0.715648 0.522148 0.019085 0.622887
5624 0.443207 0.654787 0.926138 0.674028
5625 0.249230 0.759881 0.204332 0.789773
5626
5627 ans(:,:,2,3,5) =
5628
5629 Columns 1 through 6:
5630
5631 0.476225 0.691057 0.077779 0.580940 0.093755 0.645665
5632 0.229565 0.939150 0.978505 0.204712 0.266081 0.652791
5633 0.421190 0.296825 0.621034 0.659870 0.077071 0.029741
5634 0.913943 0.320447 0.293368 0.371203 0.379352 0.169000
5635 0.627324 0.134723 0.427428 0.531598 0.233032 0.836492
5636 0.124042 0.214849 0.988148 0.869166 0.551678 0.309880
5637 0.039480 0.064019 0.092674 0.922937 0.271340 0.057332
5638 0.654832 0.204751 0.163468 0.245693 0.093997 0.468796
5639 0.509544 0.716194 0.709355 0.285992 0.297988 0.292526
5640 0.975371 0.929956 0.929384 0.628207 0.397132 0.785282
5641
5642 Columns 7 through 10:
5643
5644 0.825423 0.575956 0.149509 0.881312
5645 0.714736 0.817835 0.628735 0.524746
5646 0.403378 0.678828 0.163393 0.491836
5647 0.506554 0.900746 0.190431 0.092977
5648 0.820059 0.354175 0.669619 0.435576
5649 0.206743 0.947699 0.786225 0.204839
5650 0.083138 0.418545 0.576873 0.479118
5651 0.014887 0.678164 0.904250 0.302900
5652 0.841069 0.325409 0.091608 0.283867
5653 0.111765 0.037845 0.839086 0.262185
5654
5655 ans(:,:,3,3,5) =
5656
5657 Columns 1 through 6:
5658
5659 0.672430 0.242542 0.897542 0.181572 0.131074 0.919885
5660 0.308615 0.653643 0.405326 0.746605 0.989897 0.046056
5661 0.609244 0.874862 0.917142 0.399770 0.866016 0.391503
5662 0.163367 0.582461 0.752122 0.083745 0.827340 0.462533
5663 0.685073 0.327312 0.654498 0.855563 0.649997 0.362671
5664 0.458819 0.140757 0.098637 0.323070 0.426681 0.970997
5665 0.867835 0.937834 0.393735 0.941417 0.701411 0.761693
5666 0.877912 0.387325 0.495172 0.600731 0.408191 0.785564
5667 0.356828 0.346626 0.573745 0.083574 0.696833 0.293935
5668 0.481151 0.681907 0.015647 0.128826 0.334606 0.313441
5669
5670 Columns 7 through 10:
5671
5672 0.399627 0.510351 0.249768 0.407851
5673 0.125632 0.914163 0.072396 0.214518
5674 0.574734 0.902247 0.146615 0.782473
5675 0.866140 0.844211 0.242116 0.775236
5676 0.567439 0.742191 0.124226 0.889794
5677 0.568529 0.470481 0.725047 0.925437
5678 0.570398 0.249993 0.257579 0.825237
5679 0.126306 0.911775 0.024731 0.399424
5680 0.383687 0.737874 0.677939 0.996629
5681 0.868467 0.889697 0.392372 0.914340
5682
5683 ans(:,:,4,3,5) =
5684
5685 Columns 1 through 6:
5686
5687 0.661622 0.636417 0.872851 0.465302 0.690350 0.173233
5688 0.547391 0.032970 0.753829 0.990549 0.399422 0.463375
5689 0.200451 0.580093 0.846572 0.348690 0.999825 0.475279
5690 0.692338 0.555580 0.978246 0.118080 0.539186 0.168355
5691 0.089671 0.601060 0.792428 0.746589 0.568380 0.265944
5692 0.811798 0.266757 0.555606 0.872422 0.705870 0.880789
5693 0.277688 0.624231 0.087208 0.351108 0.989752 0.930447
5694 0.086334 0.786207 0.270813 0.422604 0.356176 0.778987
5695 0.596131 0.929575 0.693070 0.588203 0.637101 0.995736
5696 0.345290 0.363953 0.370261 0.961436 0.183752 0.454368
5697
5698 Columns 7 through 10:
5699
5700 0.671345 0.074775 0.013161 0.764867
5701 0.587133 0.393859 0.112282 0.763690
5702 0.165523 0.906492 0.781467 0.503899
5703 0.570264 0.026450 0.666447 0.821832
5704 0.469820 0.063610 0.978358 0.825583
5705 0.115245 0.858375 0.249852 0.474317
5706 0.987010 0.439399 0.454045 0.635855
5707 0.614975 0.501581 0.237833 0.101266
5708 0.065735 0.178675 0.183031 0.307975
5709 0.456399 0.331072 0.606279 0.450220
5710
5711 double_corner =
5712
5713 Columns 1 through 5:
5714
5715 -2.0000e-01 7.1460e-01 8.6567e-01 3.5439e-01 8.1303e-01
5716 1.3000e+00 -2.0000e-01 5.8131e-01 7.2077e-01 -2.0000e-01
5717 7.0996e-01 4.6300e-02 4.8698e-01 -2.0000e-01 1.3000e+00
5718 7.1942e-01 8.0688e-02 1.3000e+00 8.3008e-01 8.9633e-01
5719 -2.0000e-01 -2.0000e-01 3.2400e-01 3.8378e-01 -2.0000e-01
5720 5.0852e-02 6.3537e-02 9.5558e-01 4.1360e-01 1.3000e+00
5721 -2.0000e-01 5.6779e-01 8.8390e-01 1.3000e+00 5.6603e-01
5722 3.0843e-01 3.7813e-02 5.1968e-01 8.1225e-01 9.5174e-01
5723 8.1486e-01 -2.0000e-01 -2.0000e-01 8.8242e-01 5.7982e-01
5724 7.3654e-01 -2.0000e-01 5.3159e-01 5.9625e-01 4.5111e-01
5725
5726 Columns 6 through 10:
5727
5728 5.1728e-01 -2.0000e-01 1.3000e+00 3.3463e-01 -2.0000e-01
5729 -2.0000e-01 -2.0000e-01 6.7876e-02 5.4860e-01 5.3571e-01
5730 7.4577e-01 -2.0000e-01 4.4978e-01 9.2166e-01 9.3425e-02
5731 7.9070e-01 7.6630e-01 4.8991e-01 9.7023e-01 8.0686e-01
5732 3.9059e-02 -2.0000e-01 -2.0000e-01 8.3335e-01 8.4557e-01
5733 5.7511e-01 9.3485e-02 4.2976e-01 -2.0000e-01 -2.0000e-01
5734 -2.0000e-01 4.5868e-01 9.9131e-01 8.7040e-01 7.9128e-01
5735 9.3553e-05 1.3000e+00 9.7603e-01 -2.0000e-01 4.1599e-01
5736 7.9825e-01 3.8867e-01 8.7362e-01 -2.0000e-01 3.1062e-01
5737 3.0549e-01 9.1384e-01 9.8013e-01 4.8089e-01 9.4983e-01
5738
5739 ***** assert (grayslice (im2uint16 (I2d), 3), uint8 (test_grayslice_scalar (I2d, 3)))
5740 8 tests, 7 passed, 0 known failure, 0 skipped
5741 [im2col]
5742 >>>>> /usr/share/octave/packages/image-2.6.1/im2col.m
5743 ***** demo
5744 ## Divide A using distinct blocks and then reverse the operation
5745 A = [ 1:10
5746 11:20
5747 21:30
5748 31:40];
5749 B = im2col (A, [2 5], "distinct")
5750 C = col2im (B, [2 5], [4 10], "distinct")
5751 ***** test
5752 a = rand (10);
5753 assert (im2col (a, [5 5]), im2col (a, [5 5], "sliding"))
5754 ***** test
5755 a = rand (10);
5756 assert (im2col (a, [5 5]), im2col (a, "indexed", [5 5]))
5757 ***** error <BLOCK_TYPE> im2col (rand (20), [2 5], 10)
5758 ***** error <BLOCK_TYPE> im2col (rand (20), [2 5], "wrong_block_type")
5759 ***** error im2col (rand (10), [5 5], "sliding", 5)
5760 ***** error im2col (rand (10), "indexed", [5 5], "sliding", 5)
5761 ***** shared B, A, Bs, As, Ap, Bp0, Bp1, Bp0_3s
5762 v = [1:10]';
5763 r = reshape (v, 2, 5);
5764 B = [v v+20 v+40 v+10 v+30 v+50];
5765 A = [r r+10; r+20 r+30; r+40 r+50];
5766 As = [ 1 2 3 4 5
5767 6 7 8 9 10
5768 11 12 13 14 15];
5769 b1 = As(1:2, 1:4)(:);
5770 b2 = As(2:3, 1:4)(:);
5771 b3 = As(1:2, 2:5)(:);
5772 b4 = As(2:3, 2:5)(:);
5773 Bs = [b1, b2, b3, b4];
5774 Ap = A(:, 1:9);
5775 Bp1 = Bp0 = B;
5776 Bp0(9:10, 4:6) = 0;
5777 Bp1(9:10, 4:6) = 1;
5778 Bp0_3s = Bp0;
5779 Bp0_3s(11:30, :) = 0;
5780 ***** assert (im2col (A, [2 5], "distinct"), B);
5781 ***** assert (im2col (Ap, [2 5], "distinct"), Bp0);
5782 ***** assert (im2col (Ap, [2 5 3], "distinct"), Bp0_3s);
5783 ***** assert (im2col (Ap, "indexed", [2 5], "distinct"), Bp1);
5784 ***** assert (im2col (uint8 (Ap), "indexed", [2 5], "distinct"), uint8 (Bp0));
5785 ***** assert (im2col (uint16 (Ap), "indexed", [2 5], "distinct"), uint16 (Bp0));
5786 ***** assert (im2col (int16 (Ap), "indexed", [2 5], "distinct"), int16 (Bp1));
5787 ***** assert (im2col (uint32 (Ap), "indexed", [2 5], "distinct"), uint32 (Bp1));
5788 ***** assert (im2col (uint8 (A), [2 5], "distinct"), uint8 (B));
5789 ***** assert (im2col (single (A), [2 5], "distinct"), single (B));
5790 ***** assert (im2col (logical (A), [2 5], "distinct"), logical (B));
5791 ***** assert (im2col (uint8 (As), [2 4], "sliding"), uint8 (Bs));
5792 ***** assert (im2col (single (As), [2 4], "sliding"), single (Bs));
5793 ***** assert (im2col (logical (As), [2 4], "sliding"), logical (Bs));
5794 ***** assert (im2col (As, [2 4], "sliding"), Bs);
5795 ***** assert (im2col (As, [3 5], "sliding"), As(:));
5796 ***** test
5797 A = randi (9, 10, 9, 5);
5798 ***** assert (convn (A, ones (3, 3, 3), "valid"),
5799 reshape (sum (im2col (A, [3 3 3])), [8 7 3]));
5800
5801 A = randi (9, 10, 9, 5, 7);
5802 ***** assert (convn (A, ones (3, 3, 3), "valid"),
5803 reshape (sum (im2col (A, [3 3 3])), [8 7 3 7]));
5804 ***** assert (convn (A, ones (3, 4, 3), "valid"),
5805 reshape (sum (im2col (A, [3 4 3])), [8 6 3 7]));
5806 ***** assert (convn (A, ones (3, 5, 3, 2), "valid"),
5807 reshape (sum (im2col (A, [3 5 3 2])), [8 5 3 6]));
5808 ***** assert (im2col (1:8, [2 1]), zeros (2, 0))
5809 28 tests, 28 passed, 0 known failure, 0 skipped
5810 [isgray]
5811 >>>>> /usr/share/octave/packages/image-2.6.1/isgray.m
5812 ***** assert (isgray ([0 0 1; 1 0 1]), true)
5813 ***** assert (isgray (zeros (3)), true)
5814 ***** assert (isgray (ones (3)), true)
5815 ***** test
5816 a = rand (10);
5817 assert (isgray (a), true);
5818 a(5, 5) = 2;
5819 assert (isgray (a), false);
5820 ***** test
5821 a = uint8 (randi (255, 10));
5822 assert (isgray (a), true);
5823 a = int8 (a);
5824 assert (isgray (a), false);
5825 ***** test
5826 a = rand (10);
5827 a(50) = NaN;
5828 assert (isgray (a), true);
5829 ***** assert (isgray (rand (5, 5, 1, 4)), true);
5830 ***** assert (isgray (rand (5, 5, 3, 4)), false);
5831 ***** assert (isgray (rand (5, 5, 3)), false);
5832 ***** assert (isgray (rand (5, 5, 1, 3, 4)), false);
5833 ***** assert (isgray (rand (5, "single")), true)
5834 ***** assert (isgray ([.1 .2 .3; .4 NaN .6; .7 .8 .9]), true)
5835 ***** assert (isgray ([.1 .2 .3; NA NaN .6; .7 .8 .9]), true)
5836 ***** assert (isgray ([.1 .2 .3; NA .5 .6; .7 .8 .9]), true)
5837 ***** assert (isgray (NaN (5)), false)
5838 ***** assert (isgray (NA (5)), false)
5839 16 tests, 16 passed, 0 known failure, 0 skipped
5840 [imadjust]
5841 >>>>> /usr/share/octave/packages/image-2.6.1/imadjust.m
5842 ***** error <must be an image or a colormap> imadjust ("bad argument");
5843 ***** error <numeric floating-point arrays> imadjust ([1:100], "bad argument", [], 1);
5844 ***** error <2 row column per plane> imadjust ([1:100], [0 1 1], [], 1);
5845 ***** error <2 row column per plane> imadjust ([1:100], [], [0 1 1], 1);
5846 ***** error <scalar or 1 row per plane> imadjust ([1:100], [], [], [0; 1]);
5847 ***** error <scalar or 1 row per plane> imadjust (rand (5, 5, 3), [], [], [0 1]);
5848 ***** error <non-negative floating point> imadjust ([1:100], [0; 1], [], -1);
5849 ***** error <be on the range \[0 1]> imadjust ([1:100], [0; 5], []);
5850 ***** error <be on the range \[0 1]> imadjust ([1:100], [-2; 1], []);
5851 ***** error <be on the range \[0 1]> imadjust ([1:100], [], [0; 4]);
5852 ***** error <be on the range \[0 1]> imadjust ([1:100], [], [-2; 1]);
5853 ***** error <must be numeric> imadjust (rand (5) > .5);
5854 ***** test
5855 im = [0.01:0.01:1];
5856 assert (imadjust (im), [0 linspace(0, 1, 98) 1], eps)
5857 assert (imadjust (im), imadjust (im, stretchlim (im, 0.01), [0; 1], 1))
5858 assert (imadjust (im, []), imadjust (im, [0; 1], [0; 1], 1))
5859 assert (imadjust (im, [], []), imadjust (im, [0; 1], [0; 1], 1))
5860 assert (imadjust (im, [], [.25 .75]), imadjust (im, [0; 1], [.25; .75], 1))
5861 assert (imadjust (im, [.25; .75], []), imadjust (im, [.25; .75], [0; 1], 1))
5862 ***** assert (imadjust (linspace (0, 1), [], [.25 .75]), linspace (.25, .75, 100))
5863 ***** assert (imadjust (linspace (0, 1, 100),[1/99; 98/99]),
5864 [0 linspace(0, 1, 98) 1], eps)
5865 ***** shared cm
5866 cm = [[0:8]' [1:9]' [2:10]'] / 10;
5867 ***** assert (imadjust (cm, [0; 1], [0.5; 1]), (cm /2) + .5)
5868 ***** assert (imadjust (cm, [0 1], [0.5 1]), (cm /2) + .5)
5869 ***** assert (imadjust (cm, [0; 1], [.1 .2 .3; .7 .8 .9]),
5870 (cm*.6) .+ [.1 .2 .3], eps)
5871 ***** assert (imadjust (cm, [.2 .4 .6; .7 .8 .9], [0; 1]),
5872 [[0 0 linspace(0, 1, 6) 1]' ...
5873 [0 0 0 linspace(0, 1, 5) 1]' ...
5874 [0 0 0 0 linspace(0, 1, 4) 1]'], eps)
5875 ***** assert (imadjust (cm, [.2 .4 .6; .7 .8 .9], [0 .1 .2; .8 .9 1]),
5876 [[0 0 linspace(0, .8, 6) .8]' ...
5877 [.1 .1 .1 linspace(.1, .9, 5) .9]' ...
5878 [.2 .2 .2 .2 linspace(.2, 1, 4) 1]'], eps)
5879 ***** assert (imadjust (cm, [.2 .4 .6; .7 .8 .9], [0 .1 .2; .8 .9 1], [0.5 1 2]),
5880 [[0 0 0 (((([.3 .4 .5 .6]-.2)/.5).^.5)*.8) .8 .8]' ...
5881 [.1 .1 .1 linspace(.1, .9, 5) .9]' ...
5882 [.2 .2 .2 .2 .2 ((((([.7 .8]-.6)/.3).^2).*.8)+.2) 1 1]'], eps*10)
5883 ***** test
5884 im = [-0.4:.1:0.8
5885 0.0:.1:1.2
5886 0.1:.1:1.3
5887 -0.4:.2:2.0];
5888
5889 ## just clipping
5890 assert (imadjust (im, [0; 1], [0; 1]),
5891 [0 0 0 0 (0:.1:.8)
5892 (0:.1:1) 1 1
5893 (.1:.1:1) 1 1 1
5894 0 0 (0:.2:1) 1 1 1 1 1], eps)
5895
5896 ## clipping and invert
5897 assert (imadjust (im, [0; 1], [1; 0]),
5898 [1 1 1 1 (1:-.1:.2)
5899 (1:-.1:0) 0 0
5900 (.9:-.1:0) 0 0 0
5901 1 1 (1:-.2:0) 0 0 0 0 0], eps)
5902
5903 ## rescale
5904 assert (imadjust (im, [.2; .7], [.1; .9]),
5905 [1 1 1 1 1 1 1 2.6 4.2 5.8 7.4 9 9
5906 1 1 1 2.6 4.2 5.8 7.4 9 9 9 9 9 9
5907 1 1 2.6 4.2 5.8 7.4 9 9 9 9 9 9 9
5908 1 1 1 1 4.2 7.4 9 9 9 9 9 9 9]/10, eps)
5909
5910 ## rescale and invert
5911 assert (imadjust (im, [.2; .7], [.9; .1]),
5912 [9 9 9 9 9 9 9 7.4 5.8 4.2 2.6 1 1
5913 9 9 9 7.4 5.8 4.2 2.6 1 1 1 1 1 1
5914 9 9 7.4 5.8 4.2 2.6 1 1 1 1 1 1 1
5915 9 9 9 9 5.8 2.6 1 1 1 1 1 1 1]/10, eps)
5916 ***** assert (imadjust (linspace (0, 1), [], [], 2), linspace (0, 1) .^ 2)
5917 ***** shared oRGB
5918 oRGB = zeros (10, 1, 3);
5919 oRGB(:,:,1) = [0 linspace(0,1,6) 1 1 1]';
5920 oRGB(:,:,2) = [0 0 linspace(0,1,6) 1 1]';
5921 oRGB(:,:,3) = [0 0 0 linspace(0,1,6) 1]';
5922 ***** assert (imadjust (oRGB, [0; 1], [0; 1]), oRGB)
5923 ***** assert (imadjust (oRGB, [.2; .8], [0; 1]),
5924 reshape ([[0 0 0 1/3 2/3 1 1 1 1 1]'
5925 [0 0 0 0 1/3 2/3 1 1 1 1]'
5926 [0 0 0 0 0 1/3 2/3 1 1 1]'], [10 1 3]), eps)
5927 ***** assert (imadjust (oRGB, [.2; .8], [.1; .9]),
5928 reshape ([[.1 .1 .1 (1/3)+(.1/3) (2/3)-(.1/3) .9 .9 .9 .9 .9]'
5929 [.1 .1 .1 .1 (1/3)+(.1/3) (2/3)-(.1/3) .9 .9 .9 .9]'
5930 [.1 .1 .1 .1 .1 (1/3)+(.1/3) (2/3)-(.1/3) .9 .9 .9]'],
5931 [10 1 3]), eps)
5932 ***** assert (imadjust (oRGB, [.2; .8], [.2; .8]),
5933 reshape ([[2 2 2 4 6 8 8 8 8 8]'
5934 [2 2 2 2 4 6 8 8 8 8]'
5935 [2 2 2 2 2 4 6 8 8 8]']/10, [10 1 3]), eps)
5936 ***** assert (imadjust (oRGB, [0; 1], [.1 .2 .3; .9 .8 .7]),
5937 reshape ([[1 1 2.6 4.2 5.8 7.4 9 9 9 9]'
5938 [2 2 2 3.2 4.4 5.6 6.8 8 8 8]'
5939 [3 3 3 3 3.8 4.6 5.4 6.2 7 7]']/10, [10 1 3]), eps)
5940 ***** assert (imadjust (oRGB, [.1 .2 .3; .9 .8 .7], [0; 1]),
5941 reshape ([[0 0 .125 .375 .625 .875 1 1 1 1]'
5942 [0 0 0 0 1/3 2/3 1 1 1 1]'
5943 [0 0 0 0 0 .25 .75 1 1 1]'], [10 1 3]), eps*10)
5944 ***** assert (imadjust (oRGB, [.1 .2 .3; .9 .8 .7], [.2 0 .4; .5 1 .7 ]),
5945 reshape ([[.2 .2 .2375 .3125 .3875 .4625 .5 .5 .5 .5]'
5946 [0 0 0 0 1/3 2/3 1 1 1 1]'
5947 [.4 .4 .4 .4 .4 .475 .625 .7 .7 .7]'], [10 1 3]), eps)
5948 ***** test
5949 img = rand (4, 4, 2, 3, 4);
5950 adj = zeros (4, 4, 2, 3, 4);
5951 for p = 1:2
5952 for q = 1:3
5953 for r = 1:4
5954 adj(:,:,p,q,r) = imadjust (img(:,:,p,q,r));
5955 endfor
5956 endfor
5957 endfor
5958 assert (imadjust (img), adj)
5959 ***** test
5960 img = rand (4, 4, 2, 3, 2);
5961 adj = zeros (4, 4, 2, 3, 2);
5962 in = reshape ([ 3 5 7 9 11 13 15 17 19 21 23 25;
5963 97 95 93 91 89 87 85 83 81 79 77 75] / 100, [2 2 3 2]);
5964 out = reshape ([ 5 7 9 11 14 15 17 19 21 23 25 27;
5965 95 93 91 89 87 85 83 81 79 77 75 73] / 100, [2 2 3 2]);
5966 gamma = reshape (0.6:.1:1.7, [1 2 3 2]);
5967 for p = 1:2
5968 for q = 1:3
5969 for r = 1:2
5970 adj(:,:,p,q,r) = imadjust (img(:,:,p,q,r), in(:,p,q,r),
5971 out(:,p,q,r), gamma(1,p,q,r));
5972 endfor
5973 endfor
5974 endfor
5975 assert (imadjust (img, in, out, gamma), adj)
5976 ***** test
5977 in = int16 (1:6);
5978 assert (imadjust (in), int16 ([-32768 -19661 -6554 6553 19660 32767]))
5979 assert (imadjust (in, []), in)
5980 ***** test
5981 in = uint8([
5982 35 1 6 26 19 24
5983 3 32 7 21 23 25
5984 31 9 2 22 27 20
5985 8 28 33 17 10 15
5986 30 5 34 12 14 16
5987 4 36 29 13 18 11]);
5988 out = uint8([
5989 12 0 0 1 0 0
5990 0 8 0 0 0 0
5991 7 0 0 0 2 0
5992 0 3 9 0 0 0
5993 6 0 11 0 0 0
5994 0 13 4 0 0 0]);
5995 assert (imadjust (in, [.1 .9], [0 1]), out);
5996 ***** test
5997 in = uint8([
5998 140 4 24 104 76 96
5999 12 128 28 84 92 100
6000 124 36 8 88 108 80
6001 32 112 132 68 40 60
6002 120 20 136 48 56 64
6003 16 144 116 52 72 44]);
6004 out = uint8([
6005 143 0 0 98 63 88
6006 0 128 3 73 83 93
6007 123 13 0 78 103 68
6008 8 108 133 53 18 43
6009 118 0 138 28 38 48
6010 0 148 113 33 58 23]);
6011 assert (imadjust (in, [.1 .9], [0 1]), out);
6012 ***** test
6013 in_u8 = randi ([0 255], 5, 5, 2, 3, "uint8");
6014 in_u16 = randi ([0 65535], 5, 5, 2, 3, "uint16");
6015 in_i16 = randi ([-32768 32767], 5, 5, 2, 3, "int16");
6016 in_u8_d = im2double (in_u8);
6017 in_u16_d = im2double (in_u16);
6018 in_i16_d = im2double (in_i16);
6019
6020 ## default values
6021 assert (imadjust (in_u8), im2uint8 (imadjust (in_u8_d)))
6022 assert (imadjust (in_u16), im2uint16 (imadjust (in_u16_d)))
6023 assert (imadjust (in_i16), im2int16 (imadjust (in_i16_d)))
6024
6025 ## single adjustment for all planes
6026 args = {[.3; .7], [.1; .9], [1.5]};
6027 assert (imadjust (in_u8, args{:}), im2uint8 (imadjust (in_u8_d, args{:})))
6028 assert (imadjust (in_u16, args{:}), im2uint16 (imadjust (in_u16_d, args{:})))
6029 assert (imadjust (in_i16, args{:}), im2int16 (imadjust (in_i16_d, args{:})))
6030
6031 ## single adjustment for all planes (mixed with some complement)
6032 args = {reshape([.2 .3 .25 .1 0 .1; .9 .7 .85 .9 1 .8], [2 2 3]),
6033 reshape([.1 .2 .05 .9 1 .3; .9 .85 .7 .1 0 .9], [2 2 3]),
6034 reshape([1 .75 1 1.2 1.5 2], [1 2 3])};
6035 assert (imadjust (in_u8, args{:}), im2uint8 (imadjust (in_u8_d, args{:})))
6036 assert (imadjust (in_u16, args{:}), im2uint16 (imadjust (in_u16_d, args{:})))
6037 assert (imadjust (in_i16, args{:}), im2int16 (imadjust (in_i16_d, args{:})))
6038
6039 ## test use of [] as limit and negative
6040 args = {[], [.95; 0], 1.25};
6041 assert (imadjust (in_u8, args{:}), im2uint8 (imadjust (in_u8_d, args{:})))
6042 assert (imadjust (in_u16, args{:}), im2uint16 (imadjust (in_u16_d, args{:})))
6043 assert (imadjust (in_i16, args{:}), im2int16 (imadjust (in_i16_d, args{:})))
6044 36 tests, 36 passed, 0 known failure, 0 skipped
6045 [immultiply]
6046 >>>>> /usr/share/octave/packages/image-2.6.1/immultiply.m
6047 ***** assert (immultiply (uint8 ([255 50]), uint16 ([300 50])), uint8 ([255 255])); # default to first class and truncate
6048 ***** assert (immultiply (uint8 ([250 50]), uint16 ([ 3 4]), "uint32"), uint32 ([750 200])); # defining output class works (not in matlab?)
6049 ***** assert (immultiply (uint8 ([255 50]), 4), uint8 ([255 200])); # works multiplying by a scalar
6050 ***** assert (immultiply (logical ([ 1 0]), uint16 ([300 50])), uint16 ([300 0])); # output class defaults to whatever input is not logical
6051 ***** assert (immultiply (logical ([ 1 0]), logical ([ 1 1])), double ([ 1 0])); # tested on matlab for compatibility
6052 5 tests, 5 passed, 0 known failure, 0 skipped
6053 [imdivide]
6054 >>>>> /usr/share/octave/packages/image-2.6.1/imdivide.m
6055 ***** assert (imdivide (uint8 ([23 250]), uint8 ([ 2 50])), uint8 ([ 12 5])); # default to first class
6056 ***** assert (imdivide (uint8 ([56 255]), uint8 ([ 0 0])), uint8 ([255 255])); # dividing by zero works (tested in matlab)
6057 ***** assert (imdivide (uint8 ([23 250]), 2), uint8 ([ 12 125])); # works subtracting a scalar
6058 ***** assert (imdivide (uint8 ([23 250]), uint8 ([ 2 50]), "uint16"), uint16 ([ 12 5])); # defining output class works (not in matlab)
6059 ***** assert (imdivide (logical ([1 1 0 0]), logical ([1 0 1 0])), double ([1 Inf 0 NaN])); # dividing logical matrix (tested in matlab)
6060 ***** fail ("imdivide (uint8 ([23 250]), uint16 ([23 250]))"); # input needs to have same class
6061 6 tests, 6 passed, 0 known failure, 0 skipped
6062 [psf2otf]
6063 >>>>> /usr/share/octave/packages/image-2.6.1/psf2otf.m
6064 ***** test
6065 psf = rand (6, 1);
6066 assert (psf2otf (psf), fft (circshift (psf, [-3])));
6067 ***** test
6068 psf = rand (6, 6);
6069 assert (psf2otf (psf), fft2 (circshift (psf, [-3 -3])));
6070 ***** test
6071 psf = rand (6, 6, 6);
6072 assert (psf2otf (psf), fftn (circshift (psf, [-3 -3 -3])));
6073 ***** test
6074 psf = rand (7, 1);
6075 assert (psf2otf (psf), fft (circshift (psf, [-3])));
6076 ***** test
6077 psf = rand (7, 7);
6078 assert (psf2otf (psf), fft2 (circshift (psf, [-3 -3])));
6079 ***** test
6080 psf = rand (6, 7, 8);
6081 assert (psf2otf (psf), fftn (circshift (psf, [-3 -3 -4])));
6082 ***** test
6083 psf = rand (6, 1);
6084 ppsf = [psf; 0];
6085 assert (psf2otf (psf, 7), fft (circshift (ppsf, [-3])));
6086 ***** test
6087 psf = rand (6, 1);
6088 ppsf = [[psf; 0] zeros(7, 6)];
6089 assert (psf2otf (psf, [7 7]), fft2 (circshift (ppsf, [-3 0])));
6090 ***** test
6091 psf = rand (6, 6);
6092 ppsf = [psf zeros(6, 1)];
6093 assert (psf2otf (psf, [6 7]), fft2 (circshift (ppsf, [-3 -3])));
6094 ***** error <PSF must be numeric and real> psf2otf (complex (rand (16), rand (16)))
6095 ***** error <OUTSIZE must be larger than> psf2otf (rand (16), 14)
6096 ***** error <OUTSIZE must be larger than> psf2otf (rand (16), [14 14])
6097 ***** error <OUTSIZE must be larger than> psf2otf (rand (16), [18])
6098 ***** error <OUTSIZE must be larger than> psf2otf (rand (16), [18 14])
6099 14 tests, 14 passed, 0 known failure, 0 skipped
6100 [imsmooth]
6101 >>>>> /usr/share/octave/packages/image-2.6.1/imsmooth.m
6102 ***** test
6103 ## checking Bilateral Filter
6104
6105 ## constant image remain the same after Bilateral Filter
6106 A = uint8(255*ones(128,128));
6107 B = uint8(imsmooth(A, 'Bilateral', 2, 10));
6108 assert (A,B);
6109
6110 ## Bilateral Filter does not smear outlayers
6111 A = zeros(256,256);
6112 A(128,128) = 256;
6113 ## bilateral filter does not smear outlayers
6114 B = imsmooth(A, 'Bilateral', 2, 10);
6115 assert (A,B,1.e-140);
6116
6117 ## When sigma_r is large the filter behaves almost
6118 ## like the isotropic Gaussian filter
6119
6120 A0 = fspecial ('gaussian',100,100);
6121 A = uint8(A0/max(max(A0))*255);
6122 B1 = imsmooth(A, 'Bilateral', 2, 100);
6123 B2 = imsmooth(A, 'Gaussian', 2);
6124 assert (B1,B2);
6125 1 test, 1 passed, 0 known failure, 0 skipped
6126 [normxcorr2]
6127 >>>>> /usr/share/octave/packages/image-2.6.1/normxcorr2.m
6128 ***** function offsets = get_max_offsets (c)
6129 l = find (c == max (c(:)));
6130 offsets = nthargout (1:ndims (c), @ind2sub, size (c), l);
6131 ***** endfunction
6132 ***** test
6133 row_shift = 18;
6134 col_shift = 20;
6135 a = randi (255, 30, 30);
6136 b = a(row_shift-10:row_shift, col_shift-7:col_shift);
6137 c = normxcorr2 (b, a);
6138 ## should return exact coordinates
6139 assert (get_max_offsets (c), {row_shift col_shift});
6140
6141 ## Even with some small noise, should return exact coordinates
6142 b = imnoise (b, "gaussian");
6143 c = normxcorr2 (b, a);
6144 assert (get_max_offsets (c), {row_shift col_shift});
6145 ***** test
6146 a = rand (10, 10);
6147 c = normxcorr2 (a(5:7, 6:9), a);
6148 assert (c(7, 9), 1, eps*2);
6149 !!!!! test failed
6150 ASSERT errors for: assert (c (7, 9),1,eps * 2)
6151
6152 Location | Observed | Expected | Reason
6153 () 1 1 Abs err 7.7716e-16 exceeds tol 4.4409e-16
6154 ***** test
6155 a = 10 * randn (100, 100);
6156 auto = normxcorr2 (a, a);
6157 add_in = normxcorr2 (a, -a);
6158 assert (auto, -add_in);
6159 ***** test
6160 a = 10 * randn (50, 50);
6161 b = 10 * randn (100, 100);
6162 do
6163 scale = 100 * rand ();
6164 until (scale != 0)
6165
6166 assert (max ((normxcorr2 (scale*a,b) .- normxcorr2 (a,b))(:)), 0, 1e-10);
6167 assert (max ((normxcorr2 (a,scale*b) .- normxcorr2 (a,b))(:)), 0, 1e-10);
6168
6169 a_shift1 = a .+ scale * ones (size (a));
6170 b_shift1 = b .+ scale * ones (size (b));
6171 a_shift2 = a .- scale * ones (size (a));
6172 b_shift2 = b .- scale * ones (size (b));
6173 assert (max ((normxcorr2 (a_shift1,b) .- normxcorr2 (a,b))(:)), 0, 1e-10);
6174 assert (max ((normxcorr2 (a,b_shift1) .- normxcorr2 (a,b))(:)), 0, 1e-10);
6175 assert (max ((normxcorr2 (a_shift2,b) .- normxcorr2 (a,b))(:)), 0, 1e-10);
6176 assert (max ((normxcorr2 (a,b_shift2) .- normxcorr2 (a,b))(:)), 0, 1e-10);
6177 ***** test
6178 a = randi (100, 15, 15, 15);
6179 c = normxcorr2 (a(5:10, 2:6, 3:7), a);
6180 assert (get_max_offsets (c), {10 6 7});
6181
6182 a = randi (100, 15, 15, 15);
6183 c = normxcorr2 (a(5:10, 2:6, 1:1), a);
6184 assert (get_max_offsets (c), {10 6 1});
6185 ***** warning <swapped> normxcorr2 (rand (20), rand (5));
6186 ***** error normxcorr2 (rand (5));
6187 ***** error normxcorr2 (rand (5), rand (20), 2);
6188 ***** test
6189 a = [ 252 168 50 1 59;
6190 114 0 0 0 0] ./ 255;
6191 b = [ 1 171 255 255 255 255 240 71 131 254 255 255 255;
6192 0 109 254 255 255 233 59 0 131 254 255 255 255;
6193 76 13 195 253 194 34 0 19 217 255 255 255 255;
6194 110 0 0 0 0 0 3 181 255 255 255 255 255;
6195 153 0 0 0 0 2 154 254 255 255 255 255 255]./255;
6196 c = normxcorr2 (a, b);
6197 assert (max (imag (c(:))), 0);
6198 9 tests, 8 passed, 0 known failure, 0 skipped
6199 [qtsetblk]
6200 >>>>> /usr/share/octave/packages/image-2.6.1/qtsetblk.m
6201 ***** demo
6202 J=qtsetblk(eye(4),qtdecomp(eye(4)),2,ones(2,2,2))
6203 % Sets upper-right and lower-left blocks of 2*2 zeros to ones
6204 ***** shared A, S
6205 A=[ 1, 4, 2, 5,54,55,61,62;
6206 3, 6, 3, 1,58,53,67,65;
6207 3, 6, 3, 1,58,53,67,65;
6208 3, 6, 3, 1,58,53,67,65;
6209 23,42,42,42,99,99,99,99;
6210 27,42,42,42,99,99,99,99;
6211 23,22,26,25,99,99,99,99;
6212 22,22,24,22,99,99,99,99];
6213 S = qtdecomp (A, 10);
6214 ***** test
6215 R=A;
6216 vals=zeros(4,4,2);
6217 vals(:,:,1)=reshape([1:16],4,4);
6218 vals(:,:,2)=reshape([21:36],4,4);
6219 R(1:4,1:4)=reshape([1:16],4,4);
6220 R(5:8,5:8)=reshape([21:36],4,4);
6221 assert(qtsetblk(A,S,4,vals),R);
6222 ***** test
6223 R=A;
6224 R(1:4,5:8)=1;
6225 R(7:8,1:4)=1;
6226 R(5:6,3:4)=1;
6227 assert(qtsetblk(A,S,2,ones(2,2,7)),R);
6228 ***** test
6229 R=A;
6230 R(5:6,1:2)=10;
6231 assert(qtsetblk(A,S,1,ones(1,1,4)*10),R);
6232 3 tests, 3 passed, 0 known failure, 0 skipped
6233 [impixel]
6234 >>>>> /usr/share/octave/packages/image-2.6.1/impixel.m
6235 ***** shared img2d, img3d
6236 img2d = uint8 (magic (10));
6237 img3d(:,:,1) = img2d;
6238 img3d(:,:,2) = img2d + 1;
6239 img3d(:,:,3) = img2d + 2;
6240 img3d = uint8 (img3d);
6241
6242 ***** assert (impixel (img2d, 2, 2), single ([80 80 80]));
6243 ***** assert (impixel (img2d, -2, 2), single ([NA NA NA]));
6244
6245 ***** assert (impixel (img2d, [1 10], [1 10]), single ([92 92 92; 59 59 59]));
6246 ***** assert (impixel (img3d, [1 10], [1 10]), single ([92 93 94; 59 60 61]));
6247 ***** assert (impixel (double (img2d), [1 10], [1 10]), [92 92 92; 59 59 59]);
6248
6249 ***** assert (impixel ([1 10], [1 10], img2d, [1 10], [1 10]), single ([92 92 92; 59 59 59]));
6250 ***** assert (impixel ([3 12], [-4 12], img2d, [1 10], [1 10]), single ([NA NA NA; 44 44 44]));
6251 ***** assert (impixel ([3 5], [-4 3], img2d, [1 10], [1 10]), single ([NA NA NA; NA NA NA]));
6252
6253 ## the following returns double because it's an indexed image
6254 ***** assert (impixel ([3 12], [-4 12], img2d, gray (100), [1 10], [1 10]), [NA NA NA; 4/9 4/9 4/9]);
6255 9 tests, 9 passed, 0 known failure, 0 skipped
6256 [edgetaper]
6257 >>>>> /usr/share/octave/packages/image-2.6.1/edgetaper.m
6258 ***** assert (class (edgetaper (rand (100), rand (16))), "double")
6259 ***** assert (class (edgetaper (randi (255, 100, "uint8"), rand (16))), "uint8")
6260 2 tests, 2 passed, 0 known failure, 0 skipped
6261 [colfilt]
6262 >>>>> /usr/share/octave/packages/image-2.6.1/colfilt.m
6263 ***** demo
6264 ## Perform moving average filter with a 4x4 window
6265 A = magic (12)
6266 colfilt (A, [4 4], "sliding", @mean)
6267 ***** test
6268 A = reshape (1:36, [6 6]);
6269 assert (colfilt (A, [2 2], [3 3], "sliding", @sum),
6270 conv2 (A, ones (2), "same"));
6271 1 test, 1 passed, 0 known failure, 0 skipped
6272 [ycbcr2rgb]
6273 >>>>> /usr/share/octave/packages/image-2.6.1/ycbcr2rgb.m
6274 ***** assert (ycbcr2rgb (rgb2ycbcr (jet (10))), jet (10), 0.00001);
6275 1 test, 1 passed, 0 known failure, 0 skipped
6276 [fftconv2]
6277 >>>>> /usr/share/octave/packages/image-2.6.1/fftconv2.m
6278 ***** test
6279 a = repmat (1:10, 5);
6280 b = repmat (10:-1:3, 7);
6281 assert (fftconv2 (a, b), conv2 (a, b), 1.3e4*eps)
6282 assert (fftconv2 (b, a), conv2 (b, a), 1.3e4*eps)
6283 assert (fftconv2 (a, b, "full"), conv2 (a, b, "full"), 1.3e4*eps)
6284 assert (fftconv2 (b, a, "full"), conv2 (b, a, "full"), 1.3e4*eps)
6285 assert (fftconv2 (a, b, "same"), conv2 (a, b, "same"), 1e4*eps)
6286 assert (fftconv2 (b, a, "same"), conv2 (b, a, "same"), 1e4*eps)
6287 assert (isempty (fftconv2 (a, b, "valid")));
6288 assert (fftconv2 (b, a, "valid"), conv2 (b, a, "valid"), 1e4*eps)
6289 ***** test
6290 x = 1:4;
6291 y = 4:-1:1;
6292 a = repmat(1:10, 5);
6293 assert (fftconv2 (x, y, a), conv2 (x, y, a), 1e4*eps)
6294 assert (fftconv2 (x, y, a, "full"), conv2 (x, y, a, "full"), 1e4*eps)
6295 assert (fftconv2 (x, y, a, "same"), conv2 (x, y, a, "same"), 1e4*eps)
6296 assert (fftconv2 (x, y, a, "valid"), conv2 (x, y, a, "valid"), 1e4*eps)
6297 ***** demo
6298 ## Draw a cross
6299 z = zeros (101, 101);
6300 z(50, :) = 1;
6301 z(:, 50) = 1;
6302 subplot (1, 3, 1)
6303 imshow (z);
6304 title ("Original thin cross")
6305
6306 ## Draw a sinc blob
6307 b = getheight (strel ("ball", 10, 1));
6308 subplot (1, 3, 2)
6309 imshow (b);
6310 title ("Sync blob")
6311
6312 ## Convolve the cross with the blob
6313 fc = real (fftconv2 (z, b, "same"));
6314 subplot (1, 3, 3)
6315 imshow (fc, [min(fc(:)) max(fc(:))])
6316 title ("Convolution in the frequency domain")
6317 2 tests, 2 passed, 0 known failure, 0 skipped
6318 [imcrop]
6319 >>>>> /usr/share/octave/packages/image-2.6.1/imcrop.m
6320 ***** test
6321 a = randi (255, [100 100]);
6322 rect = [20 30 3 5];
6323 assert (nthargout ([1 2], @imcrop, a, rect), {a(30:35, 20:23) rect});
6324 assert (nthargout (2, @imcrop, a, rect), rect);
6325 assert (nthargout ([3 4], 4, @imcrop, a, rect), {a(30:35, 20:23) rect});
6326 ***** test
6327 rgb = randi (255, [100 100 3]);
6328 rect = [20 30 3 5];
6329 assert (nthargout ([1 2], @imcrop, rgb, rect), {rgb(30:35, 20:23,:) rect});
6330 assert (nthargout (2, @imcrop, rgb, rect), rect);
6331 assert (nthargout ([3 4], 4, @imcrop, rgb, rect), {rgb(30:35, 20:23,:) rect});
6332 ***** test
6333 a = randi (255, [100 100]);
6334 rect = [20 30 3 5];
6335 cmap = jet (255);
6336 assert (nthargout ([1 2], @imcrop, a, cmap, rect), {a(30:35, 20:23) rect});
6337 assert (nthargout (2, @imcrop, a, cmap, rect), rect);
6338 assert (nthargout ([3 4], 4, @imcrop, a, cmap, rect), {a(30:35, 20:23) rect});
6339 ***** test
6340 a = rand (100) > 0.5;
6341 rect = [20 30 3 5];
6342 assert (nthargout ([1 2], @imcrop, a, rect), {a(30:35, 20:23) rect});
6343 assert (nthargout (2, @imcrop, a, rect), rect);
6344 assert (nthargout ([3 4], 4, @imcrop, a, rect), {a(30:35, 20:23) rect});
6345 ***** assert (imcrop (0, [0.5 0.5 0.9 0.9]), 0);
6346 ***** assert (imcrop (zeros (5), [1 1 1 1]), zeros (2));
6347 6 tests, 6 passed, 0 known failure, 0 skipped
6348 [qtdecomp]
6349 >>>>> /usr/share/octave/packages/image-2.6.1/qtdecomp.m
6350 ***** demo
6351 full(qtdecomp(eye(8)))
6352 %It finds 2 big blocks of 0 and it decomposes further where 0 and 1 are mixed.
6353 ***** # Test if odd-sized limits split
6354 ***** assert(full(qtdecomp(eye(5))), reshape([5,zeros(1,24)],5,5));
6355 ***** assert(full(qtdecomp(eye(6))), repmat(reshape([3,zeros(1,8)],3,3),2,2));
6356 ***** # Test 'equal' method
6357 ***** test
6358 a=ones(2,2);
6359 b=[2,0;0,0];
6360 assert(full(qtdecomp(eye(4))), [a,b;b,a]);
6361 ***** shared A, B2, B4, f
6362 A=[ 1, 4, 2, 5,54,55,61,62;
6363 3, 6, 3, 1,58,53,67,65;
6364 3, 6, 3, 1,58,53,67,65;
6365 3, 6, 3, 1,58,53,67,65;
6366 23,42,42,42,99,99,99,99;
6367 27,42,42,42,99,99,99,99;
6368 23,22,26,25,99,99,99,99;
6369 22,22,24,22,99,99,99,99];
6370 B2=[2,0;0,0];
6371 B4=zeros(4); B4(1,1)=4;
6372 ***** test
6373 R=[ones(4,8); [ones(2),B2;ones(2,4)], B4];
6374 assert(full(qtdecomp(A)), R);
6375 assert(full(qtdecomp(A,0)), R);
6376 ***** # Test 'threshold' method
6377 ***** test
6378 R=[ones(4,8); [ones(2),B2;B2,ones(2)],B4];
6379 assert(full(qtdecomp(A,1)), R);
6380 ***** test
6381 R=[[B4,[B2,B2;B2,B2]]; [[ones(2),B2;B2,B2],B4]];
6382 assert(full(qtdecomp(A,10)), R);
6383 ***** test
6384 R=[[B4,[B2,B2;B2,B2]]; [[B2,B2;B2,B2],B4]];
6385 assert(full(qtdecomp(A,10,2)), R);
6386
6387 assert(full(qtdecomp(A,100,[2, 4])), [B4,B4;B4,B4]);
6388 ***** test
6389 f = @(A, c1 = 54, c2 = 0, c3 = 0) y = (A (1, 1, :) != ((c1+c2+c3) * ones (1, 1, size (A, 3))))(:);
6390
6391 assert(full(qtdecomp(A,f)),[ones(4),B4;ones(4,8)]);
6392 assert(full(qtdecomp(A,f,54)),[ones(4),B4;ones(4,8)]);
6393 assert(full(qtdecomp(A,f,4,40,10)),[ones(4),B4;ones(4,8)]);
6394 ***** test
6395 ***** # no params
6396 first_eq=inline("(A(1,1,:)!=(54*ones(1,1,size(A,3))))(:)","A");
6397 assert(full(qtdecomp(A,first_eq)),[ones(4),B4;ones(4,8)]);
6398 ***** test
6399 ***** # 1 param
6400 first_eq=inline("(A(1,1,:)!=(c*ones(1,1,size(A,3))))(:)","A","c");
6401 assert(full(qtdecomp(A,first_eq,54)),[ones(4),B4;ones(4,8)]);
6402 ***** test
6403 ***** # 3 params
6404 first_eq=inline("(A(1,1,:)!=((c1+c2+c3)*ones(1,1,size(A,3))))(:)","A","c1","c2","c3");
6405 assert(full(qtdecomp(A,first_eq,4,40,10)),[ones(4),B4;ones(4,8)]);
6406 11 tests, 11 passed, 0 known failure, 0 skipped
6407 [imquantize]
6408 >>>>> /usr/share/octave/packages/image-2.6.1/imquantize.m
6409 ***** error <LEVELS must be nondecreasing>
6410 imquantize (rand (5), [3 4 2 5])
6411 ***** error <VALUES must be a numeric vector>
6412 imquantize (rand (5), [1 2 3], "foo")
6413 ***** error <VALUES must have 1 element more than LEVELS>
6414 imquantize (rand (5), [1 2 3 4], 1:6)
6415 ***** error <VALUES must have 1 element more than LEVELS>
6416 imquantize (rand (5), [1 2 3 4], 1:2)
6417 ***** test
6418 img = [-inf 0 10000000; -100000 -3 1/1000000; 5 5 10];
6419 [q, q_idx] = imquantize (img, 5);
6420 assert (q, [1 1 2; 1 1 1; 1 1 2])
6421 assert (q_idx, q)
6422 ***** test
6423 img = [1:10; 11:20; 21:30; 31:40; 41:50; 51:60; 61:70];
6424
6425 expected_q = [
6426 0 0 0 0 0 1 1 1 1 1
6427 1 1 1 1 1 5 5 5 5 5
6428 5 5 5 5 5 10 10 10 10 10
6429 20 20 20 20 20 20 20 20 20 20
6430 30 30 30 30 30 30 30 30 30 30
6431 30 30 30 30 30 30 30 30 30 30
6432 15 15 15 15 15 15 15 15 15 15];
6433
6434 expected_q_idx = [
6435 1 1 1 1 1 2 2 2 2 2
6436 2 2 2 2 2 3 3 3 3 3
6437 3 3 3 3 3 4 4 4 4 4
6438 5 5 5 5 5 5 5 5 5 5
6439 6 6 6 6 6 6 6 6 6 6
6440 6 6 6 6 6 6 6 6 6 6
6441 7 7 7 7 7 7 7 7 7 7];
6442
6443 [q, q_idx] = imquantize (img, [5 15 25 30 40 60], [0 1 5 10 20 30 15]);
6444 assert (q, expected_q)
6445 assert (q_idx, expected_q_idx)
6446
6447 [q, q_idx] = imquantize (single (img), [5 15 25 30 40 60],
6448 [0 1 5 10 20 30 15]);
6449 assert (q, expected_q)
6450 assert (q_idx, expected_q_idx)
6451
6452 [q, q_idx] = imquantize (uint8 (img), [5 15 25 30 40 60],
6453 [0 1 5 10 20 30 15]);
6454 assert (q, expected_q)
6455 assert (q_idx, expected_q_idx)
6456
6457 [q, q_idx] = imquantize (uint8 (img), uint8 ([5 15 25 30 40 60]),
6458 [0 1 5 10 20 30 15]);
6459 assert (q, expected_q)
6460 assert (q_idx, expected_q_idx)
6461
6462 [q, q_idx] = imquantize (uint8 (img), uint8 ([5 15 25 30 40 60]),
6463 uint8 ([0 1 5 10 20 30 15]));
6464 assert (q, uint8 (expected_q))
6465 assert (q_idx, expected_q_idx)
6466 ***** test
6467 img = randi ([0 255], 10, "uint8");
6468 [q, q_idx] = imquantize (img, [50 100 150 200]);
6469 assert (class (q), "double")
6470 assert (class (q_idx), "double")
6471
6472 [q, q_idx] = imquantize (img, [50 100 150 200], uint16 ([5 7 8 9 2]));
6473 assert (class (q), "uint16")
6474 assert (class (q_idx), "double")
6475
6476 [q, q_idx] = imquantize (img, [50 100 150 200], uint8 ([5 7 8 9 2]));
6477 assert (class (q), "uint8")
6478 assert (class (q_idx), "double")
6479 ***** test
6480 img = [1:10; 11:20; 21:30; 31:40; 41:50; 51:60; 61:70].';
6481 r_idx = reshape (randperm (numel (img)), size (img));
6482
6483 [quant, quant_idx] = imquantize (img, [5 15 25 30 40 60]);
6484 [quant_r, quant_r_idx] = imquantize (img(r_idx), [5 15 25 30 40 60]);
6485
6486 assert (imquantize (img(r_idx), [5 15 25 30 40 60]), quant(r_idx))
6487 assert (quant_r, quant_r_idx)
6488 8 tests, 8 passed, 0 known failure, 0 skipped
6489 [imsubtract]
6490 >>>>> /usr/share/octave/packages/image-2.6.1/imsubtract.m
6491 ***** assert (imsubtract (uint8 ([23 250]), uint8 ([24 50])), uint8 ([ 0 200])); # default to first class and truncate
6492 ***** assert (imsubtract (uint8 ([23 250]), 10), uint8 ([13 240])); # works subtracting a scalar
6493 ***** assert (imsubtract (uint8 ([23 250]), uint8 ([24 50]), "uint16"), uint16 ([ 0 200])); # defining output class works (not in matlab)
6494 ***** assert (imsubtract (logical ([ 1 0]), logical ([ 1 1])), double ([ 0 -1])); # return double for two logical images
6495 ***** assert (imsubtract (logical ([ 1 0]), logical ([ 1 1]), "logical"), logical ([ 0 0])); # this is matlab incompatible on purpose
6496 ***** error <same class> imsubtract (uint8 ([23 250]), uint16 ([23 250]));
6497 ***** warning <signed integer> imsubtract (uint8 ([23 250]), uint8 ([24 255]), "int8");
6498 ***** test
6499 warning ("off", "all");
6500 assert (imsubtract (uint8 ([23 250]), uint8 ([24 255]), "int8"),
6501 int8 ([-1 0]))
6502 8 tests, 8 passed, 0 known failure, 0 skipped
6503 [imattributes]
6504 >>>>> /usr/share/octave/packages/image-2.6.1/imattributes.m
6505 ***** shared x, map, img, rgb, bw
6506 [x, map] = imread ("default.img");
6507 rgb = ind2rgb (x, map);
6508 img = ind2gray (x, map);
6509 bw = im2bw (img);
6510 ***** test
6511 h = imshow (img);
6512 a = imattributes (h);
6513 assert ([a.("Height (rows)") a.("Width (columns)")], [53 40]);
6514 assert (a.Class, "uint8");
6515 assert (a.("Image type"), "intensity");
6516 assert (a.("Minimum intensity"), uint8 (28));
6517 assert (a.("Maximum intensity"), uint8 (250));
6518 ***** xtest
6519 h = imshow (rgb);
6520 a = imattributes (h);
6521 assert ([a.("Height (rows)") a.("Width (columns)")], [53 40]);
6522 assert (a.Class, "uint8");
6523 assert (a.("Image type"), "truecolor");
6524 assert (isfield (a, "Minimum intensity"), false);
6525 assert (isfield (a, "Maximum intensity"), false);
6526 !!!!! known failure
6527 ASSERT errors for: assert (a.Class,"uint8")
6528
6529 Location | Observed | Expected | Reason
6530 [] double uint8 Strings don't match
6531 ***** test
6532 h = imshow (bw);
6533 a = imattributes (h);
6534 assert ([a.("Height (rows)") a.("Width (columns)")], [53 40]);
6535 assert (a.Class, "logical");
6536 assert (a.("Image type"), "binary");
6537 assert (isfield (a, "Minimum intensity"), false);
6538 assert (isfield (a, "Maximum intensity"), false);
6539 ***** test
6540 h = imshow (x, map);
6541 a = imattributes (h);
6542 assert ([a.("Height (rows)") a.("Width (columns)")], [53 40]);
6543 assert (a.Class, "uint8");
6544 assert (a.("Image type"), "indexed");
6545 assert (a.("Minimum intensity"), uint8 (0));
6546 assert (a.("Maximum intensity"), uint8 (55));
6547 ***** test
6548 h = imshow (img);
6549 a1 = imattributes ();
6550 a2 = imattributes (h);
6551 assert (a1, a2);
6552 5 tests, 4 passed, 1 known failure, 0 skipped
6553 [iptnum2ordinal]
6554 >>>>> /usr/share/octave/packages/image-2.6.1/iptnum2ordinal.m
6555 ***** assert (strcmp (iptnum2ordinal (1), 'first')); # simple works
6556 ***** assert (strcmp (iptnum2ordinal (21), '21st')); # after 20, goes stupid
6557 ***** assert (strcmp (iptnum2ordinal (100), '100th')); # use th correctly
6558 ***** fail ("iptnum2ordinal (inf)"); # must be real
6559 ***** fail ("iptnum2ordinal (0)"); # must be positive
6560 ***** fail ("iptnum2ordinal (-1)"); # must be positive
6561 ***** fail ("iptnum2ordinal (3.4)"); # must be integer
6562 7 tests, 7 passed, 0 known failure, 0 skipped
6563 [radon]
6564 >>>>> /usr/share/octave/packages/image-2.6.1/radon.m
6565 ***** test
6566 A = radon(ones(2,2),30);
6567 assert (A,[0 0 0.608253175473055 2.103325780167649 1.236538105676658 0.051882938682637 0]',1e-10)
6568 1 test, 1 passed, 0 known failure, 0 skipped
6569 [imgradientxy]
6570 >>>>> /usr/share/octave/packages/image-2.6.1/imgradientxy.m
6571 ***** test
6572 A = [0 1 0
6573 1 1 1
6574 0 1 0];
6575
6576 [gxSobel, gySobel] = imgradientxy (A);
6577 [gxSobel2, gySobel2] = imgradientxy (A, "Sobel");
6578 assert (gxSobel,
6579 [ 3 0 -3
6580 4 0 -4
6581 3 0 -3]);
6582 assert (gySobel,
6583 [ 3 4 3
6584 0 0 0
6585 -3 -4 -3]);
6586
6587 ## test default method
6588 assert(gxSobel, gxSobel2);
6589 assert(gySobel, gySobel2);
6590
6591 [gxPrewitt, gyPrewitt] = imgradientxy (A, "Prewitt");
6592 assert (gxPrewitt,
6593 [ 2 0 -2
6594 3 0 -3
6595 2 0 -2]);
6596 assert (gyPrewitt,
6597 [ 2 3 2
6598 0 0 0
6599 -2 -3 -2]);
6600
6601 [gxCd, gyCd] = imgradientxy (A, "CentralDifference");
6602 assert (gxCd,
6603 [ 0.5 0.0 -0.5
6604 0.5 0.0 -0.5
6605 0.5 0.0 -0.5]);
6606 assert (gyCd,
6607 [ 0.5 0.5 0.5
6608 0 0 0
6609 -0.5 -0.5 -0.5]);
6610
6611 [gxId, gyId] = imgradientxy(A, "IntermediateDifference");
6612 assert (gxId,
6613 [ 1 -1 0
6614 0 0 -1
6615 1 -1 0]);
6616 assert (gyId,
6617 [ 1 0 1
6618 -1 0 -1
6619 0 -1 0]);
6620 1 test, 1 passed, 0 known failure, 0 skipped
6621 [imlincomb]
6622 >>>>> /usr/share/octave/packages/image-2.6.1/imlincomb.m
6623 ***** assert (imlincomb (0.5, uint8 ([255 10]), 0.5, uint8 ([50 20])), uint8 ([153 15])); # default to first class and truncate
6624 ***** assert (imlincomb (0.5, uint8 ([255 10]), 0.5, uint8 ([50 20]), "uint16"), uint16 ([153 15])); # defining output class works
6625 2 tests, 2 passed, 0 known failure, 0 skipped
6626 [rgb2gray]
6627 >>>>> /usr/share/octave/packages/image-2.6.1/rgb2gray.m
6628 ***** shared img
6629 img = zeros (2, 2, 3);
6630 img(:,:,1) = [1 0; 0 1];
6631 img(:,:,2) = [0 1; 0 1];
6632 img(:,:,3) = [0 0; 1 1];
6633 img = rgb2gray (img);
6634 ***** assert ([img(1,1) img(1,2) img(2,1) img(2,2)], [0.29894 0.58704 0.11402 1]);
6635 1 test, 1 passed, 0 known failure, 0 skipped
6636 [bwareafilt]
6637 >>>>> /usr/share/octave/packages/image-2.6.1/bwareafilt.m
6638 ***** shared a2d, a3d
6639 a2d = [1 0 0 0 0 0 1 0 0 1
6640 1 0 0 1 0 1 0 1 0 1
6641 1 0 1 0 0 0 0 0 0 0
6642 0 0 0 0 0 0 0 0 0 0
6643 0 1 0 0 0 0 0 0 0 0
6644 1 1 0 1 1 1 0 0 0 0
6645 1 1 0 1 0 0 0 1 0 0
6646 1 1 0 0 0 0 1 0 1 0
6647 1 1 0 0 0 0 0 0 0 0
6648 1 1 0 0 0 1 1 0 0 1];
6649
6650 a3d = a2d;
6651 a3d(:,:,2) = [
6652 0 0 0 0 0 0 0 0 0 0
6653 1 0 0 1 1 0 0 1 0 0
6654 0 0 0 1 0 0 0 0 0 0
6655 0 0 0 0 0 0 0 0 0 0
6656 0 1 0 0 0 0 0 0 0 0
6657 1 1 0 0 1 1 0 0 0 0
6658 1 1 0 1 0 0 0 0 0 0
6659 1 0 0 0 0 0 1 0 0 0
6660 0 1 0 0 0 0 0 0 0 1
6661 1 1 0 0 0 0 1 0 0 0];
6662
6663 a3d(:,:,3) = [
6664 1 0 0 0 0 0 0 0 0 0
6665 0 1 0 1 1 0 0 1 0 0
6666 0 0 0 1 0 0 0 0 0 0
6667 0 0 0 0 0 0 0 0 0 0
6668 0 0 0 0 0 0 0 0 0 0
6669 0 0 0 1 1 1 0 0 0 0
6670 0 0 0 0 0 0 0 0 0 0
6671 1 0 0 0 0 0 0 0 0 0
6672 1 1 0 0 0 0 0 0 0 1
6673 1 1 0 0 0 0 0 0 0 0];
6674 ***** test
6675 f2d = [0 0 0 0 0 0 0 0 0 0
6676 0 0 0 0 0 0 0 0 0 0
6677 0 0 0 0 0 0 0 0 0 0
6678 0 0 0 0 0 0 0 0 0 0
6679 0 1 0 0 0 0 0 0 0 0
6680 1 1 0 1 1 1 0 0 0 0
6681 1 1 0 1 0 0 0 0 0 0
6682 1 1 0 0 0 0 0 0 0 0
6683 1 1 0 0 0 0 0 0 0 0
6684 1 1 0 0 0 0 0 0 0 0];
6685 assert (bwareafilt (a2d, 2), logical (f2d));
6686 assert (bwareafilt (a2d, 2, 8), logical (f2d));
6687 assert (bwareafilt (a2d, 2, 4), logical (f2d));
6688 ***** test
6689 f2d = [1 0 0 0 0 0 1 0 0 0
6690 1 0 0 0 0 1 0 1 0 0
6691 1 0 0 0 0 0 0 0 0 0
6692 0 0 0 0 0 0 0 0 0 0
6693 0 1 0 0 0 0 0 0 0 0
6694 1 1 0 1 1 1 0 0 0 0
6695 1 1 0 1 0 0 0 1 0 0
6696 1 1 0 0 0 0 1 0 1 0
6697 1 1 0 0 0 0 0 0 0 0
6698 1 1 0 0 0 0 0 0 0 0];
6699 assert (bwareafilt (a2d, 5), logical (f2d));
6700 assert (bwareafilt (a2d, 5, 8), logical (f2d));
6701 ***** test
6702 f2d = [0 0 0 0 0 0 1 0 0 1
6703 0 0 0 1 0 1 0 1 0 1
6704 0 0 1 0 0 0 0 0 0 0
6705 0 0 0 0 0 0 0 0 0 0
6706 0 0 0 0 0 0 0 0 0 0
6707 0 0 0 0 0 0 0 0 0 0
6708 0 0 0 0 0 0 0 1 0 0
6709 0 0 0 0 0 0 1 0 1 0
6710 0 0 0 0 0 0 0 0 0 0
6711 0 0 0 0 0 1 1 0 0 1];
6712 assert (bwareafilt (a2d, 11, "smallest", 4), logical (f2d));
6713 ***** test
6714 f2d = [1 0 0 0 0 0 1 0 0 0
6715 1 0 0 0 0 1 0 1 0 0
6716 1 0 0 0 0 0 0 0 0 0
6717 0 0 0 0 0 0 0 0 0 0
6718 0 0 0 0 0 0 0 0 0 0
6719 0 0 0 1 1 1 0 0 0 0
6720 0 0 0 1 0 0 0 1 0 0
6721 0 0 0 0 0 0 1 0 1 0
6722 0 0 0 0 0 0 0 0 0 0
6723 0 0 0 0 0 0 0 0 0 0];
6724 assert (bwareafilt (a2d, [3 5]), logical (f2d));
6725 assert (bwareafilt (a2d, [3 5], 8), logical (f2d));
6726 ***** test
6727 f2d = [1 0 0 0 0 0 0 0 0 0
6728 1 0 0 0 0 0 0 0 0 0
6729 1 0 0 0 0 0 0 0 0 0
6730 0 0 0 0 0 0 0 0 0 0
6731 0 0 0 0 0 0 0 0 0 0
6732 0 0 0 1 1 1 0 0 0 0
6733 0 0 0 1 0 0 0 0 0 0
6734 0 0 0 0 0 0 0 0 0 0
6735 0 0 0 0 0 0 0 0 0 0
6736 0 0 0 0 0 0 0 0 0 0];
6737 assert (bwareafilt (a2d, [3 4], 4), logical (f2d));
6738 assert (bwareafilt (a2d, [3 4], [0 1 0; 1 1 1; 0 1 0]), logical (f2d));
6739 ***** test
6740 f2d = [1 0 0 0 0 0 1 0 0 1
6741 1 0 0 1 0 1 0 1 0 1
6742 1 0 1 0 0 0 0 0 0 0
6743 0 0 0 0 0 0 0 0 0 0
6744 0 0 0 0 0 0 0 0 0 0
6745 0 0 0 1 1 1 0 0 0 0
6746 0 0 0 1 0 0 0 1 0 0
6747 0 0 0 0 0 0 1 0 1 0
6748 0 0 0 0 0 0 0 0 0 0
6749 0 0 0 0 0 1 1 0 0 0];
6750 assert (bwareafilt (a2d, [2 4]), logical (f2d));
6751 assert (bwareafilt (a2d, [2 4], 8), logical (f2d));
6752 assert (bwareafilt (a2d, [2 4], ones (3)), logical (f2d));
6753 ***** test
6754 f3d = [0 0 0 0 0 0 1 0 0 0
6755 0 0 0 1 0 1 0 1 0 0
6756 0 0 1 0 0 0 0 0 0 0
6757 0 0 0 0 0 0 0 0 0 0
6758 0 1 0 0 0 0 0 0 0 0
6759 1 1 0 0 0 0 0 0 0 0
6760 1 1 0 0 0 0 0 0 0 0
6761 1 1 0 0 0 0 0 0 0 0
6762 1 1 0 0 0 0 0 0 0 0
6763 1 1 0 0 0 0 0 0 0 0];
6764
6765 f3d(:,:,2) = [
6766 0 0 0 0 0 0 0 0 0 0
6767 0 0 0 1 1 0 0 1 0 0
6768 0 0 0 1 0 0 0 0 0 0
6769 0 0 0 0 0 0 0 0 0 0
6770 0 1 0 0 0 0 0 0 0 0
6771 1 1 0 0 0 0 0 0 0 0
6772 1 1 0 0 0 0 0 0 0 0
6773 1 0 0 0 0 0 0 0 0 0
6774 0 1 0 0 0 0 0 0 0 0
6775 1 1 0 0 0 0 0 0 0 0];
6776
6777 f3d(:,:,3) = [
6778 0 0 0 0 0 0 0 0 0 0
6779 0 0 0 1 1 0 0 1 0 0
6780 0 0 0 1 0 0 0 0 0 0
6781 0 0 0 0 0 0 0 0 0 0
6782 0 0 0 0 0 0 0 0 0 0
6783 0 0 0 0 0 0 0 0 0 0
6784 0 0 0 0 0 0 0 0 0 0
6785 1 0 0 0 0 0 0 0 0 0
6786 1 1 0 0 0 0 0 0 0 0
6787 1 1 0 0 0 0 0 0 0 0];
6788 assert (bwareafilt (a3d, 2), logical (f3d));
6789 assert (bwareafilt (a3d, 2, 26), logical (f3d));
6790 assert (bwareafilt (a3d, 2, ones (3, 3, 3)), logical (f3d));
6791 ***** test
6792 f3d = [0 0 0 0 0 0 0 0 0 0
6793 0 0 0 0 0 0 0 0 0 0
6794 0 0 0 0 0 0 0 0 0 0
6795 0 0 0 0 0 0 0 0 0 0
6796 0 1 0 0 0 0 0 0 0 0
6797 1 1 0 1 1 1 0 0 0 0
6798 1 1 0 1 0 0 0 0 0 0
6799 1 1 0 0 0 0 0 0 0 0
6800 1 1 0 0 0 0 0 0 0 0
6801 1 1 0 0 0 0 0 0 0 0];
6802
6803 f3d(:,:,2) = [
6804 0 0 0 0 0 0 0 0 0 0
6805 0 0 0 0 0 0 0 0 0 0
6806 0 0 0 0 0 0 0 0 0 0
6807 0 0 0 0 0 0 0 0 0 0
6808 0 1 0 0 0 0 0 0 0 0
6809 1 1 0 0 1 1 0 0 0 0
6810 1 1 0 1 0 0 0 0 0 0
6811 1 0 0 0 0 0 0 0 0 0
6812 0 1 0 0 0 0 0 0 0 0
6813 1 1 0 0 0 0 0 0 0 0];
6814
6815 f3d(:,:,3) = [
6816 0 0 0 0 0 0 0 0 0 0
6817 0 0 0 0 0 0 0 0 0 0
6818 0 0 0 0 0 0 0 0 0 0
6819 0 0 0 0 0 0 0 0 0 0
6820 0 0 0 0 0 0 0 0 0 0
6821 0 0 0 1 1 1 0 0 0 0
6822 0 0 0 0 0 0 0 0 0 0
6823 1 0 0 0 0 0 0 0 0 0
6824 1 1 0 0 0 0 0 0 0 0
6825 1 1 0 0 0 0 0 0 0 0];
6826 assert (bwareafilt (a3d, 2, 6), logical (f3d));
6827 assert (bwareafilt (a3d, 2, conndef (3, "minimal")), logical (f3d));
6828 8 tests, 8 passed, 0 known failure, 0 skipped
6829 [lab2single]
6830 >>>>> /usr/share/octave/packages/image-2.6.1/lab2single.m
6831 ***** test
6832 l_max_f = 100 + (25500 / 65280);
6833 ab_max_f = 127 + (255 / 256);
6834 cm = [
6835 -Inf
6836 Inf
6837 NaN
6838 l_max_f
6839 ab_max_f
6840 -200
6841 -129
6842 -128
6843 -128+(255/65280)*(0.499)
6844 -128+(255/65280)*(0.500)
6845 -128+(255/65280)*(0.501)
6846 -127
6847 -1
6848 0
6849 (100/65280)*(0.499999)
6850 (100/65280)*(0.51)
6851 (100/65280)*(0.500001)
6852 1
6853 99
6854 100
6855 101
6856 126
6857 127
6858 128
6859 254
6860 255
6861 256
6862 257];
6863 cm = repmat (single (cm), [1 3]);
6864 im2d = reshape (cm, [7 4 3]);
6865 imnd = permute (im2d, [1 4 3 2]);
6866
6867 cm_uint8 = uint8 ([
6868 0 0 0
6869 255 255 255
6870 255 255 255
6871 255 228 228
6872 255 255 255
6873 0 0 0
6874 0 0 0
6875 0 0 0
6876 0 0 0
6877 0 0 0
6878 0 0 0
6879 0 1 1
6880 0 127 127
6881 0 128 128
6882 0 128 128
6883 0 128 128
6884 0 128 128
6885 3 129 129
6886 252 227 227
6887 255 228 228
6888 255 229 229
6889 255 254 254
6890 255 255 255
6891 255 255 255
6892 255 255 255
6893 255 255 255
6894 255 255 255
6895 255 255 255]);
6896
6897 assert (lab2uint8 (cm), cm_uint8)
6898 im2d_uint8 = reshape (cm_uint8, [7 4 3]);
6899 assert (lab2uint8 (im2d), im2d_uint8)
6900 assert (lab2uint8 (imnd), permute (im2d_uint8, [1 4 3 2]))
6901
6902 cm_uint16 = uint16 ([
6903 0 0 0
6904 65535 65535 65535
6905 65535 65535 65535
6906 65535 58468 58468
6907 65535 65535 65535
6908 0 0 0
6909 0 0 0
6910 0 0 0
6911 0 0 0
6912 0 1 1
6913 0 1 1
6914 0 256 256
6915 0 32512 32512
6916 0 32768 32768
6917 0 32768 32768
6918 1 32768 32768
6919 1 32768 32768
6920 653 33024 33024
6921 64627 58112 58112
6922 65280 58368 58368
6923 65535 58624 58624
6924 65535 65024 65024
6925 65535 65280 65280
6926 65535 65535 65535
6927 65535 65535 65535
6928 65535 65535 65535
6929 65535 65535 65535
6930 65535 65535 65535]);
6931
6932 assert (lab2uint16 (cm), cm_uint16)
6933 im2d_uint16 = reshape (cm_uint16, [7 4 3]);
6934 assert (lab2uint16 (im2d), im2d_uint16)
6935 assert (lab2uint16 (imnd), permute (im2d_uint16, [1 4 3 2]))
6936
6937 assert (lab2double (cm), double (cm))
6938 assert (lab2double (im2d), double (im2d))
6939 assert (lab2double (imnd), double (imnd))
6940 1 test, 1 passed, 0 known failure, 0 skipped
6941 [imfilter]
6942 >>>>> /usr/share/octave/packages/image-2.6.1/imfilter.m
6943 ***** test
6944 img = [
6945 8 2 6 7 4 3 7 8 4 1
6946 9 9 1 1 4 7 3 3 8 1
6947 2 9 8 3 7 6 5 8 6 5
6948 9 5 9 1 8 2 7 3 5 8
6949 6 8 7 1 2 2 9 9 9 9
6950 1 2 7 8 5 5 9 4 3 2
6951 3 4 7 7 5 9 5 2 7 6
6952 5 9 4 3 6 4 2 3 7 5
6953 9 8 6 9 7 6 2 6 4 1
6954 9 9 2 1 7 3 3 5 6 4];
6955
6956 expected_corr = [
6957 46 53 30 34 44 42 40 51 42 19
6958 48 66 57 42 46 50 59 58 49 34
6959 48 67 55 54 44 58 50 50 64 39
6960 44 77 52 43 28 55 57 75 70 50
6961 29 51 65 51 42 50 60 62 55 42
6962 23 44 58 59 63 59 55 57 50 36
6963 36 50 52 56 56 47 48 45 47 39
6964 51 64 70 62 56 50 40 38 41 31
6965 58 72 50 49 58 45 41 42 49 28
6966 27 37 27 21 19 26 16 23 24 17];
6967 assert (imfilter (img, [0 1 0; 2 1 1; 1 2 2]), expected_corr)
6968
6969 ## test order of options (and matching with defaults)
6970 assert (imfilter (img, [0 1 0; 2 1 1; 1 2 2], 0), expected_corr)
6971 assert (imfilter (img, [0 1 0; 2 1 1; 1 2 2], "corr"), expected_corr)
6972 assert (imfilter (img, [0 1 0; 2 1 1; 1 2 2], "corr", 0), expected_corr)
6973 assert (imfilter (img, [0 1 0; 2 1 1; 1 2 2], 0, "corr"), expected_corr)
6974
6975 expected_conv = [
6976 21 31 23 22 21 28 29 26 22 6
6977 47 55 43 43 51 44 49 64 44 24
6978 56 69 53 34 47 50 57 48 52 37
6979 38 70 60 56 41 57 54 61 66 44
6980 46 67 53 48 32 54 59 65 63 46
6981 28 56 63 50 36 54 58 66 63 47
6982 20 43 55 62 67 57 52 53 44 28
6983 42 51 54 61 57 53 44 46 48 39
6984 53 70 63 50 57 42 38 38 43 33
6985 53 62 50 54 52 44 38 40 40 20];
6986 assert (imfilter (img, [0 1 0; 2 1 1; 1 2 2], "conv"), expected_conv)
6987
6988 ## alternative class
6989 assert (imfilter (single (img), [0 1 0; 2 1 1; 1 2 2]),
6990 single (expected_corr))
6991 assert (imfilter (int8 (img), [0 1 0; 2 1 1; 1 2 2]),
6992 int8 (expected_corr))
6993 assert (imfilter (uint8 (img), [0 1 0; 2 1 1; 1 2 2]),
6994 uint8 (expected_corr))
6995
6996 assert (imfilter (single (img), [0 1 0; 2 1 1; 1 2 2], "conv"),
6997 single (expected_conv))
6998 assert (imfilter (int8 (img), [0 1 0; 2 1 1; 1 2 2], "conv"),
6999 int8 (expected_conv))
7000 assert (imfilter (uint8 (img), [0 1 0; 2 1 1; 1 2 2], "conv"),
7001 uint8 (expected_conv))
7002
7003 ***** test
7004 I = zeros (6);
7005 I(2:3,2:3) = 1;
7006 F = zeros (4);
7007 F(2,2:3) = 1;
7008 result = [0 0 0 0 0 0
7009 1 2 1 0 0 0
7010 1 2 1 0 0 0
7011 0 0 0 0 0 0
7012 0 0 0 0 0 0
7013 0 0 0 0 0 0];
7014 assert (imfilter (I, F), result)
7015 2 tests, 2 passed, 0 known failure, 0 skipped
7016 [lab2uint16]
7017 >>>>> /usr/share/octave/packages/image-2.6.1/lab2uint16.m
7018 ***** test
7019 cm_uint16 = uint16 ([0 127 128 383 384 65151 65152 65279 65280 65281 65534 65535]);
7020 cm_uint16 = repmat (cm_uint16(:), [1 3]);
7021 im2d_uint16 = reshape (cm_uint16, [4 3 3]);
7022 imnd_uint16 = permute (im2d_uint16, [1 4 3 2]);
7023
7024 cm_uint8 = uint8 ([0 0 1 1 2 254 255 255 255 255 255 255]);
7025 cm_uint8 = repmat (cm_uint8(:), [1 3]);
7026 assert (lab2uint8 (cm_uint16), cm_uint8)
7027 im2d_uint8 = reshape (cm_uint8, [4 3 3]);
7028 assert (lab2uint8 (im2d_uint16), im2d_uint8)
7029 assert (lab2uint8 (imnd_uint16), permute (im2d_uint8, [1 4 3 2]))
7030
7031 l1 = 100/65280;
7032 ab1 = 255/65280;
7033 cm = [
7034 0 -128
7035 127*l1 -128+(ab1*127)
7036 128*l1 -128+(ab1*128)
7037 383*l1 -128+(ab1*383)
7038 384*l1 -128+(ab1*384)
7039 65151*l1 -128+(ab1*65151)
7040 65152*l1 -128+(ab1*65152)
7041 65279*l1 -128+(ab1*65279)
7042 100 127
7043 65281*l1 -128+(ab1*65281)
7044 65534*l1 -128+(ab1*65534)
7045 65535*l1 -128+(ab1*65535)];
7046 cm(:,3) = cm(:,2);
7047 im2d = reshape (cm, [4 3 3]);
7048 imnd = permute (im2d, [1 4 3 2]);
7049
7050 assert (lab2double (cm_uint16), cm)
7051 assert (lab2double (im2d_uint16), im2d)
7052 assert (lab2double (imnd_uint16), imnd)
7053
7054 assert (lab2single (cm_uint16), single (cm))
7055 assert (lab2single (im2d_uint16), single (im2d))
7056 assert (lab2single (imnd_uint16), single (imnd))
7057 1 test, 1 passed, 0 known failure, 0 skipped
7058 [roicolor]
7059 >>>>> /usr/share/octave/packages/image-2.6.1/roicolor.m
7060 ***** demo
7061 roicolor([1:10],2,4);
7062 % Returns '1' where input values are between 2 and 4 (both included).
7063 ***** assert(roicolor([1:10],2,4),logical([0,1,1,1,zeros(1,6)]));
7064 ***** assert(roicolor([1,2;3,4],3,3),logical([0,0;1,0]));
7065 ***** assert(roicolor([1,2;3,4],[1,4]),logical([1,0;0,1]));
7066 3 tests, 3 passed, 0 known failure, 0 skipped
7067 [col2im]
7068 >>>>> /usr/share/octave/packages/image-2.6.1/col2im.m
7069 ***** demo
7070 ## Divide A using distinct blocks and then reverse the operation
7071 A = [ 1:10
7072 11:20
7073 21:30
7074 31:40];
7075 B = im2col (A, [2 5], "distinct")
7076 C = col2im (B, [2 5], [4 10], "distinct")
7077 ***** demo
7078 ## Get sliding blocks of size from A into columns, calculate the
7079 ## mean of each block (mean of each column), and reconstruct A
7080 ## after a median filter.
7081 A = reshape (1:24, [4 6])
7082 B = im2col (A, [2 3], "sliding")
7083 C = mean (B);
7084 col2im (C, [1 1], [3 4], "sliding")
7085 ***** error <BLOCK_TYPE> col2im (ones (10), [5 5], [10 10], "wrong_block_type");
7086 ***** error <resize B> col2im (ones (10), [1 1], [ 7 7], "sliding");
7087 ***** error <rows in B> col2im (ones (10), [3 3], [10 10], "distinct")
7088 ***** error <rows in B> col2im (ones (10), [5 5], [10 11], "distinct");
7089 ***** assert (col2im (sum (im2col (magic (10), [3 3], "sliding")), [1 1], [8 8]),
7090 convn (magic (10), ones (3, 3), "valid"));
7091 ***** test
7092 B = ones (1, (10-2+1)*(7-3+1));
7093 A = ones ((10-2+1), (7-3+1));
7094 assert (col2im (B, [2 3], [10 7]), A);
7095
7096 ## same but different classes
7097 assert (col2im (int16 (B), [2 3], [10 7]), int16 (A));
7098 assert (col2im (single (B), [2 3], [10 7]), single (A));
7099 assert (col2im (logical (B), [2 3], [10 7]), logical (A));
7100 ***** test
7101 a = rand (10)(:);
7102 assert (col2im (a, [1 1], [10 10]), col2im (a, [1 1], [10 10], "sliding"))
7103 ***** shared A, B
7104 v = [1:10]';
7105 r = reshape (1:10, [2 5]);
7106 B = [v v+10 v+20 v+30 v+40 v+50];
7107 A = [r r+30
7108 r+10 r+40
7109 r+20 r+50];
7110 assert (col2im (B, [2 5], [6 10], "distinct"), A);
7111 ***** assert (col2im (int16 (B), [2 5], [6 10], "distinct"), int16 (A));
7112 ***** assert (col2im (logical (B), [2 5], [6 10], "distinct"), logical (A));
7113 ***** assert (col2im (single (B), [2 5], [6 10], "distinct"), single (A));
7114 ***** test
7115 a = rand (10, 8);
7116 b = im2col (a, [5 5], "distinct");
7117 assert (col2im (b, [5 5], [10 8], "distinct"), a);
7118
7119 a = rand (8);
7120 b = im2col (a, [5 5], "distinct");
7121 assert (col2im (b, [5 5], [8 8], "distinct"), a);
7122 ***** shared a, b
7123 ## Same number of multiple dimensions
7124 a = rand (10, 10, 10);
7125 b = im2col (a, [5 5 5], "distinct");
7126 ***** assert (col2im (b, [5 5 5], [10 10 10], "distinct"), a);
7127
7128 ## Different number of dimensions
7129 a = rand (10, 10, 10);
7130 b = im2col (a, [5 5], "distinct");
7131 ***** assert (col2im (b, [5 5], [10 10 10], "distinct"), a);
7132
7133 ## Removing padding from multiple dimensions
7134 a = rand (10, 10, 7);
7135 b = im2col (a, [5 5 3], "distinct");
7136 ***** assert (col2im (b, [5 5 3], [10 10 7], "distinct"), a);
7137
7138 a = rand (10, 10, 7);
7139 b = im2col (a, [5 5 5 2], "distinct");
7140 ***** assert (col2im (b, [5 5 5 2], [10 10 7], "distinct"), a);
7141 15 tests, 15 passed, 0 known failure, 0 skipped
7142 [regionprops]
7143 >>>>> /usr/share/octave/packages/image-2.6.1/regionprops.m
7144 ***** shared bw2d, gray2d, bw2d_over_bb, bw2d_insides
7145 bw2d = logical ([
7146 0 1 0 1 1 0
7147 0 1 1 0 1 1
7148 0 1 0 0 0 0
7149 0 0 0 1 1 1
7150 0 0 1 1 0 1]);
7151
7152 gray2d = [
7153 2 4 0 7 5 2
7154 3 0 4 9 3 7
7155 0 5 3 4 8 1
7156 9 2 0 5 8 6
7157 8 9 7 2 2 5];
7158
7159 ## For testing overlapping bounding boxes
7160 bw2d_over_bb = logical ([
7161 0 1 1 1 0 1 1
7162 1 1 0 0 0 0 1
7163 1 0 0 1 1 0 1
7164 1 0 0 1 1 0 0
7165 0 0 0 1 1 1 1]);
7166
7167 ## For testing when there's regions inside regions
7168 bw2d_insides = logical ([
7169 0 0 0 0 0 0 0 0
7170 0 1 1 1 1 1 1 0
7171 0 1 0 0 0 0 1 0
7172 0 1 0 1 1 0 1 0
7173 0 1 0 1 1 0 1 0
7174 0 1 0 0 0 0 1 0
7175 0 1 1 1 1 1 1 0
7176 0 0 0 0 0 0 0 0]);
7177 ***** function c = get_2d_centroid_for (idx)
7178 subs = ind2sub ([5 6], idx);
7179 m = false ([5 6]);
7180 m(idx) = true;
7181 y = sum ((1:5)' .* sum (m, 2) /sum (m(:)));
7182 x = sum ((1:6) .* sum (m, 1) /sum (m(:)));
7183 c = [x y];
7184 ***** endfunction
7185 ***** assert (regionprops (bw2d, "Area"), struct ("Area", {8; 6}))
7186 ***** assert (regionprops (double (bw2d), "Area"), struct ("Area", {14}))
7187 ***** assert (regionprops (bwlabel (bw2d, 4), "Area"), struct ("Area", {4; 6; 4}))
7188 ***** assert (regionprops (bw2d, "PixelIdxList"),
7189 struct ("PixelIdxList", {[6; 7; 12; 8; 16; 21; 22; 27]
7190 [15; 19; 20; 24; 29; 30]}))
7191 ***** assert (regionprops (bwlabel (bw2d, 4), "PixelIdxList"),
7192 struct ("PixelIdxList", {[6; 7; 8; 12]
7193 [15; 19; 20; 24; 29; 30]
7194 [16; 21; 22; 27]}))
7195 ***** assert (regionprops (bw2d, "PixelList"),
7196 struct ("PixelList", {[2 1; 2 2; 3 2; 2 3; 4 1; 5 1; 5 2; 6 2]
7197 [3 5; 4 4; 4 5; 5 4; 6 4; 6 5]}))
7198 ***** assert (regionprops (bwlabel (bw2d, 4), "PixelList"),
7199 struct ("PixelList", {[2 1; 2 2; 2 3; 3 2]
7200 [3 5; 4 4; 4 5; 5 4; 6 4; 6 5]
7201 [4 1; 5 1; 5 2; 6 2]}))
7202 ***** assert (regionprops (bw2d, gray2d, "PixelValues"),
7203 struct ("PixelValues", {[4; 0; 4; 5; 7; 5; 3; 7]
7204 [7; 5; 2; 8; 6; 5]}))
7205 ***** assert (regionprops (bw2d, gray2d, "MaxIntensity"),
7206 struct ("MaxIntensity", {7; 8}))
7207 ***** assert (regionprops (bw2d, gray2d, "MinIntensity"),
7208 struct ("MinIntensity", {0; 2}))
7209 ***** assert (regionprops (bw2d, "BoundingBox"),
7210 struct ("BoundingBox", {[1.5 0.5 5 3]; [2.5 3.5 4 2]}))
7211 ***** assert (regionprops (bw2d, "Centroid"),
7212 struct ("Centroid", {get_2d_centroid_for([6 7 8 12 16 21 22 27])
7213 get_2d_centroid_for([15 19 20 24 29 30])}))
7214 ***** test
7215 props = struct ("Area", {8; 6},
7216 "Centroid", {get_2d_centroid_for([6 7 8 12 16 21 22 27])
7217 get_2d_centroid_for([15 19 20 24 29 30])},
7218 "BoundingBox", {[1.5 0.5 5 3]; [2.5 3.5 4 2]});
7219 assert (regionprops (bw2d, "basic"), props)
7220 assert (regionprops (bwconncomp (bw2d, 8), "basic"), props)
7221 assert (regionprops (bwlabeln (bw2d, 8), "basic"), props)
7222 ***** test
7223 props = struct ("Area", {4; 6; 4},
7224 "Centroid", {get_2d_centroid_for([6 7 8 12])
7225 get_2d_centroid_for([15 19 20 24 29 30])
7226 get_2d_centroid_for([16 21 22 27])},
7227 "BoundingBox", {[1.5 0.5 2 3]; [2.5 3.5 4 2]; [3.5 0.5 3 2]});
7228 assert (regionprops (bwconncomp (bw2d, 4), "basic"), props)
7229 assert (regionprops (bwlabeln (bw2d, 4), "basic"), props)
7230 ***** assert (regionprops (double (bw2d), "basic"),
7231 struct ("Area", 14,
7232 "Centroid", get_2d_centroid_for (find (bw2d)),
7233 "BoundingBox", [1.5 0.5 5 5]), eps*1000)
7234 ***** assert (regionprops ([0 0 1], "Centroid").Centroid, [3 1])
7235 ***** assert (regionprops ([0 0 1; 0 0 0], "Centroid").Centroid, [3 1])
7236 ***** assert (regionprops ([0 1 1], "Centroid").Centroid, [2.5 1])
7237 ***** assert (regionprops ([0 1 1; 0 0 0], "Centroid").Centroid, [2.5 1])
7238 ***** test
7239 a = zeros (2, 3, 3);
7240 a(:, :, 1) = [0 1 0; 0 0 0];
7241 a(:, :, 3) = a(:, :, 1);
7242 c = regionprops (a, "centroid");
7243 assert (c.Centroid, [2 1 2])
7244 ***** test
7245 d1=2; d2=4; d3=6;
7246 a = ones (d1, d2, d3);
7247 c = regionprops (a, "centroid");
7248 assert (c.Centroid, [mean(1:d2), mean(1:d1), mean(1:d3)], eps*1000)
7249 ***** test
7250 a = [0 0 2 2; 3 3 0 0; 0 1 0 1];
7251 c = regionprops (a, "centroid");
7252 assert (c(1).Centroid, [3 3])
7253 assert (c(2).Centroid, [3.5 1])
7254 assert (c(3).Centroid, [1.5 2])
7255 ***** test
7256 ***** assert (regionprops (bw2d, gray2d, "WeightedCentroid"),
7257 struct ("WeightedCentroid",
7258 {sum([2 1; 2 2; 3 2; 2 3; 4 1; 5 1; 5 2; 6 2]
7259 .* ([4; 0; 4; 5; 7; 5; 3; 7] / 35))
7260 sum([3 5; 4 4; 4 5; 5 4; 6 4; 6 5]
7261 .* ([7; 5; 2; 8; 6; 5] / 33))}))
7262 ***** test
7263 img = zeros (3, 9);
7264 img(2, 1:9) = 0:0.1:0.8;
7265 bw = im2bw (img, 0.5);
7266 props = regionprops (bw, img, "WeightedCentroid");
7267 ix = 7:9;
7268 x = sum (img(2,ix) .* (ix)) / sum (img(2,ix));
7269 assert (props(1).WeightedCentroid(1), x, 10*eps)
7270 assert (props(1).WeightedCentroid(2), 2, 10*eps)
7271 ***** assert (regionprops (bw2d, gray2d, "MeanIntensity"),
7272 struct ("MeanIntensity", {mean([4 0 5 4 7 5 3 7])
7273 mean([7 5 2 8 6 5])}))
7274 ***** assert (regionprops (bwlabel (bw2d, 4), gray2d, "MeanIntensity"),
7275 struct ("MeanIntensity", {mean([4 0 5 4])
7276 mean([7 5 2 8 6 5])
7277 mean([7 5 3 7])}))
7278 ***** assert (regionprops (bw2d, "SubarrayIdx"),
7279 struct ("SubarrayIdx", {{[1 2 3], [2 3 4 5 6]}
7280 {[4 5], [3 4 5 6]}}))
7281 ***** assert (regionprops (bwlabel (bw2d, 4), "SubarrayIdx"),
7282 struct ("SubarrayIdx", {{[1 2 3], [2 3]}
7283 {[4 5], [3 4 5 6]}
7284 {[1 2], [4 5 6]}}))
7285 ***** test
7286 out = struct ("Image", {logical([1 0 1 1 0; 1 1 0 1 1; 1 0 0 0 0])
7287 logical([0 1 1 1; 1 1 0 1])});
7288 assert (regionprops (bw2d, "Image"), out)
7289 assert (regionprops (bw2d, gray2d, "Image"), out)
7290 assert (regionprops (bwlabel (bw2d), "Image"), out)
7291 ***** assert (regionprops (bwlabel (bw2d, 4), "Image"),
7292 struct ("Image", {logical([1 0; 1 1; 1 0])
7293 logical([0 1 1 1; 1 1 0 1])
7294 logical([1 1 0; 0 1 1])}))
7295 ***** test
7296 out = struct ("Image", {logical([0 1 1 1; 1 1 0 0; 1 0 0 0; 1 0 0 0])
7297 logical([1 1 0 0; 1 1 0 0; 1 1 1 1])
7298 logical([1 1; 0 1; 0 1])});
7299 assert (regionprops (bw2d_over_bb, "Image"), out)
7300 assert (regionprops (bwlabel (bw2d_over_bb), "Image"), out)
7301 ***** test
7302 out = struct ("Image", {logical([1 1 1 1 1 1
7303 1 0 0 0 0 1
7304 1 0 0 0 0 1
7305 1 0 0 0 0 1
7306 1 0 0 0 0 1
7307 1 1 1 1 1 1])
7308 logical([1 1; 1 1])});
7309 assert (regionprops (bw2d_insides, "Image"), out)
7310 assert (regionprops (bwlabel (bw2d_insides), "Image"), out)
7311 ***** test
7312 l = uint8 ([
7313 0 0 0 0 0 0
7314 0 1 1 1 1 0
7315 0 1 2 2 1 0
7316 0 1 2 2 1 0
7317 0 1 1 1 1 0
7318 0 0 0 0 0 0
7319 ]);
7320 assert (regionprops (l, "EulerNumber"),
7321 struct ("EulerNumber", {0; 1}))
7322
7323 l = uint8 ([
7324 0 0 0 0 0 0 0
7325 0 1 1 1 1 1 0
7326 0 1 2 2 2 1 0
7327 0 1 2 3 2 1 0
7328 0 1 2 2 2 1 0
7329 0 1 1 1 1 1 0
7330 0 0 0 0 0 0 0
7331 ]);
7332 assert (regionprops (l, "EulerNumber"),
7333 struct ("EulerNumber", {0; 0; 1}))
7334 ***** test
7335 l = uint8 ([
7336 0 0 0 0 0 0 0
7337 0 1 1 1 1 1 0
7338 0 1 0 0 0 1 0
7339 0 1 0 1 0 1 0
7340 0 1 0 0 0 1 0
7341 0 1 1 1 1 1 0
7342 0 0 0 0 0 0 0
7343 ]);
7344 assert (regionprops (l, "EulerNumber"),
7345 struct ("EulerNumber", 1))
7346 ***** test
7347 l = uint8 ([
7348 1 1 1 1 1 1 1
7349 1 1 2 1 2 2 1
7350 1 2 1 2 1 2 1
7351 1 1 2 1 2 1 1
7352 1 2 1 2 1 2 1
7353 1 2 2 1 2 1 1
7354 1 1 1 1 1 1 1
7355 ]);
7356 assert (regionprops (l, "EulerNumber"),
7357 struct ("EulerNumber", {-9; -4}))
7358 ***** test
7359 l = uint8 ([
7360 1 1 1 1 1 1 1
7361 1 1 4 1 5 5 1
7362 1 3 1 4 1 5 1
7363 1 1 3 1 4 1 1
7364 1 2 1 3 1 4 1
7365 1 2 2 1 3 1 1
7366 1 1 1 1 1 1 1
7367 ]);
7368 assert (regionprops (l, "EulerNumber"),
7369 struct ("EulerNumber", {-9; 1; 1; 1; 1}))
7370 ***** test
7371 l = uint8 ([
7372 1 1 1 1 1 1 1
7373 0 1 2 1 2 2 1
7374 1 2 1 2 1 2 1
7375 1 1 2 1 2 1 1
7376 1 2 1 2 1 2 1
7377 1 2 2 1 2 1 1
7378 1 1 1 1 1 1 1
7379 ]);
7380 filled = {
7381 logical([
7382 1 1 1 1 1 1 1
7383 0 1 1 1 1 1 1
7384 1 1 1 1 1 1 1
7385 1 1 1 1 1 1 1
7386 1 1 1 1 1 1 1
7387 1 1 1 1 1 1 1
7388 1 1 1 1 1 1 1
7389 ]);
7390 logical([
7391 0 1 0 1 1
7392 1 1 1 1 1
7393 0 1 1 1 0
7394 1 1 1 1 1
7395 1 1 0 1 0
7396 ]);
7397 };
7398 assert (regionprops (l, {"FilledImage", "FilledArea"}),
7399 struct ("FilledImage", filled, "FilledArea", {48; 19}))
7400 ***** test
7401 l = uint8 ([
7402 0 0 0 0 0 0 0
7403 0 1 0 1 0 1 0
7404 0 1 0 1 0 1 0
7405 0 0 0 0 0 0 0
7406 ]);
7407 filled = logical ([
7408 1 0 1 0 1
7409 1 0 1 0 1
7410 ]);
7411 assert (regionprops (l, {"FilledImage", "FilledArea"}),
7412 struct ("FilledImage", filled, "FilledArea", 6))
7413
7414 l = uint8 ([
7415 2 2 2 2 2 2 2
7416 2 1 2 1 2 1 2
7417 2 1 2 1 2 1 2
7418 2 2 2 2 2 2 2
7419 ]);
7420 filled = {
7421 logical([
7422 1 0 1 0 1
7423 1 0 1 0 1
7424 ]);
7425 true(4, 7)
7426 };
7427 assert (regionprops (l, {"FilledImage", "FilledArea"}),
7428 struct ("FilledImage", filled, "FilledArea", {6; 28}))
7429 ***** test
7430 l = uint8 ([
7431 0 0 0 0 0 0 0
7432 0 1 1 1 1 1 0
7433 0 1 2 2 2 1 0
7434 0 1 2 3 2 1 0
7435 0 1 2 2 2 1 0
7436 0 1 1 1 1 1 0
7437 0 0 0 0 0 0 0
7438 ]);
7439 filled = {true(5, 5); true(3, 3); true};
7440 assert (regionprops (l, {"FilledImage", "FilledArea"}),
7441 struct ("FilledImage", filled, "FilledArea", {25; 9; 1}))
7442 ***** test
7443 l = uint8 ([
7444 1 1 1 2 0 0
7445 1 0 2 1 2 0
7446 1 2 0 1 0 2
7447 1 2 1 1 0 2
7448 0 1 2 2 2 2
7449 ]);
7450 filled = {
7451 logical([
7452 1 1 1 0
7453 1 1 1 1
7454 1 1 1 1
7455 1 1 1 1
7456 0 1 0 0
7457 ]);
7458 logical([
7459 0 0 1 0 0
7460 0 1 1 1 0
7461 1 1 1 1 1
7462 1 1 1 1 1
7463 0 1 1 1 1
7464 ])
7465 };
7466 assert (regionprops (l, {"FilledImage", "FilledArea"}),
7467 struct ("FilledImage", filled, "FilledArea", {16; 18}))
7468 ***** test
7469 bw = false (5, 5, 5);
7470 bw(2:4, 2:4, [1 5]) = true;
7471 bw(2:4, [1 5], 2:4) = true;
7472 bw([1 5], 2:4, 2:4) = true;
7473 filled = bw;
7474 filled(2:4, 2:4, 2:4) = true;
7475 assert (regionprops (bw, {"FilledImage", "FilledArea"}),
7476 struct ("FilledImage", filled, "FilledArea", 81))
7477 ***** test
7478 l = uint8 ([
7479 1 1 1 2 0 0
7480 1 0 2 1 2 0
7481 1 2 0 1 0 2
7482 1 2 1 1 0 2
7483 0 1 2 2 2 2
7484 ]);
7485 assert (regionprops (l, {"Extent"}), struct ("Extent", {0.55; 0.44}))
7486 ***** test
7487 bw = logical ([0 0 0; 0 1 0; 0 0 0]);
7488 assert (regionprops (bw, {"MinorAxisLength", "MajorAxisLength", ...
7489 "Eccentricity"}),
7490 struct ("MajorAxisLength", 4 .* sqrt (1/12),
7491 "MinorAxisLength", 4 .* sqrt (1/12),
7492 "Eccentricity", 0))
7493 ***** test
7494 a = eye (4);
7495 t = regionprops (a, "majoraxislength");
7496 assert (t.MajorAxisLength, 6.4291, 1e-3);
7497 t = regionprops (a, "minoraxislength");
7498 assert(t.MinorAxisLength, 1.1547 , 1e-3);
7499 t = regionprops (a, "eccentricity");
7500 assert (t.Eccentricity, 0.98374 , 1e-3);
7501 t = regionprops (a, "orientation");
7502 assert (t.Orientation, -45);
7503 t = regionprops (a, "equivdiameter");
7504 assert (t.EquivDiameter, 2.2568, 1e-3);
7505 ***** test
7506 b = ones (5);
7507 t = regionprops (b, "majoraxislength");
7508 assert (t.MajorAxisLength, 5.7735 , 1e-3);
7509 t = regionprops (b, "minoraxislength");
7510 assert (t.MinorAxisLength, 5.7735 , 1e-3);
7511 t = regionprops (b, "eccentricity");
7512 assert (t.Eccentricity, 0);
7513 t = regionprops (b, "orientation");
7514 assert (t.Orientation, 0);
7515 t = regionprops (b, "equivdiameter");
7516 assert (t.EquivDiameter, 5.6419, 1e-3);
7517 ***** test
7518 c = [0 0 1; 0 1 1; 1 1 0];
7519 t = regionprops (c, "minoraxislength");
7520 assert (t.MinorAxisLength, 1.8037 , 1e-3);
7521 t = regionprops (c, "majoraxislength");
7522 assert (t.MajorAxisLength, 4.1633 , 1e-3);
7523 t = regionprops (c, "eccentricity");
7524 assert (t.Eccentricity, 0.90128 , 1e-3);
7525 t = regionprops (c, "orientation");
7526 assert (t.Orientation, 45);
7527 t = regionprops (c, "equivdiameter");
7528 assert (t.EquivDiameter, 2.5231, 1e-3);
7529 ***** test
7530 f = [0 0 0 0; 1 1 1 1; 0 1 1 1; 0 0 0 0];
7531 t = regionprops (f, "Extrema");
7532 shouldbe = [0.5 1.5; 4.5 1.5; 4.5 1.5; 4.5 3.5; 4.5 3.5; 1.5 3.5; 0.5 2.5; 0.5 1.5];
7533 assert (t.Extrema, shouldbe, eps);
7534 ***** test
7535 bw = false (5);
7536 bw([8 12 13 14 18]) = true;
7537 extrema = [2 1; 3 1; 4 2; 4 3; 3 4; 2 4; 1 3; 1 2] + 0.5;
7538 assert (regionprops (bw, "extrema"), struct ("Extrema", extrema))
7539 ***** test
7540 ext1 = [1 0; 5 0; 6 1; 6 2; 2 3; 1 3; 1 3; 1 0] + 0.5;
7541 ext2 = [3 3; 6 3; 6 3; 6 5; 6 5; 2 5; 2 5; 2 4] + 0.5;
7542 assert (regionprops (bw2d, "extrema"), struct ("Extrema", {ext1; ext2}))
7543 ***** assert (regionprops (bw2d, "equivDiameter"),
7544 struct ("EquivDiameter", {sqrt(4*8/pi); sqrt(4*6/pi)}))
7545 ***** assert (regionprops (bw2d_over_bb, "equivDiameter"),
7546 struct ("EquivDiameter", {sqrt(4*7/pi); sqrt(4*8/pi); sqrt(4*4/pi)}))
7547 ***** assert (regionprops (bw2d_insides, "equivDiameter"),
7548 struct ("EquivDiameter", {sqrt(4*20/pi); sqrt(4*4/pi)}))
7549 ***** test
7550 I = zeros (40);
7551 disk = fspecial ("disk",10);
7552 disk = disk ./ max (disk(:));
7553 I(10:30, 10:30) = disk;
7554 bw = im2bw (I, 0.5);
7555 props = regionprops (bw, "Perimeter");
7556 assert (props.Perimeter, 10*4 + (sqrt (2) * 4)*4, eps*100)
7557
7558 props = regionprops (bwconncomp (bw), "Perimeter");
7559 assert (props.Perimeter, 10*4 + (sqrt (2) * 4)*4, eps*100)
7560 ***** assert (regionprops (bw2d, "Perimeter"),
7561 struct ("Perimeter", {(sqrt (2)*6 + 4); (sqrt (2)*3 + 4)}), eps*10)
7562 ***** assert (regionprops (bw2d_insides, "Perimeter"),
7563 struct ("Perimeter", {20; 4}))
7564 ***** assert (regionprops (bwconncomp (bw2d_insides), "Perimeter"),
7565 struct ("Perimeter", {20; 4}))
7566 ***** assert (regionprops ([1 0 1; 1 0 1], "Area"), struct ("Area", 4))
7567 ***** assert (regionprops ([1 0 2; 1 1 2], "Area"), struct ("Area", {3; 2}))
7568 ***** assert (regionprops ([1 0 3; 1 1 3], "Area"), struct ("Area", {3; 0; 2}))
7569 ***** assert (size (regionprops ([1 0 0; 0 0 2], "Area")), [2, 1])
7570 ***** error <L must be non-negative integers> regionprops ([1 -2 0 3])
7571 ***** error <L must be non-negative integers> regionprops ([1 1.5 0 3])
7572 ***** test
7573 im = rand (5);
7574
7575 ## First do this so we get a list of all supported properties and don't
7576 ## have to update the list each time.
7577 bw = false (5);
7578 bw(13) = true;
7579 props = regionprops (bw, im, "all");
7580 all_props = fieldnames (props);
7581
7582 bw = false (5);
7583 props = regionprops (bw, im, "all");
7584 assert (size (props), [0 1])
7585 assert (sort (all_props), sort (fieldnames (props)))
7586 ***** test
7587 im = rand (5);
7588
7589 ## First do this so we get a list of all supported properties and don't
7590 ## have to update the list each time.
7591 labeled = zeros (5);
7592 labeled(13) = 1;
7593 props = regionprops (labeled, im, "all");
7594 all_props = fieldnames (props);
7595
7596 labeled = zeros (5);
7597 props = regionprops (labeled, im, "all");
7598 assert (size (props), [0 1])
7599 assert (sort (all_props), sort (fieldnames (props)))
7600 ***** test
7601 im = rand (5);
7602
7603 ## First do this so we get a list of all supported properties and don't
7604 ## have to update the list each time.
7605 bw = false (5);
7606 bw(13) = true;
7607 props = regionprops (bwconncomp (bw), im, "all");
7608 all_props = fieldnames (props);
7609
7610 bw = false (5);
7611 props = regionprops (bwconncomp (bw), im, "all");
7612 assert (size (props), [0 1])
7613 assert (sort (all_props), sort (fieldnames (props)))
7614 ***** warning <ignoring perimeter, extrema properties for non 2 dimensional image>
7615 regionprops (rand (5, 5, 5) > 0.5, {"perimeter", "extrema"});
7616 ***** warning <ignoring minintensity, weightedcentroid properties due to missing grayscale image>
7617 regionprops (rand (5, 5) > 0.5, {"minintensity", "weightedcentroid"});
7618 ***** error <L must be non-negative integers only>
7619 regionprops ([0 -1 3 4; 0 -1 3 4])
7620 ***** error <L must be non-negative integers only>
7621 regionprops ([0 1.5 3 4; 0 1.5 3 4])
7622 ***** error <L must be non-negative integers only>
7623 regionprops (int8 ([0 -1 3 4; 0 -1 3 4]))
7624 ***** error <not yet implemented> regionprops (rand (5, 5) > 0.5, "ConvexArea")
7625 ***** error <not yet implemented> regionprops (rand (5, 5) > 0.5, "ConvexHull")
7626 ***** error <not yet implemented> regionprops (rand (5, 5) > 0.5, "ConvexImage")
7627 ***** error <not yet implemented> regionprops (rand (5, 5) > 0.5, "Solidity")
7628 75 tests, 75 passed, 0 known failure, 0 skipped
7629 [im2int16]
7630 >>>>> /usr/share/octave/packages/image-2.6.1/im2int16.m
7631 ***** assert (im2int16 (int16 ([-2 2 3])), int16 ([-2 2 3]));
7632 ***** assert (im2int16 (uint16 ([0 65535])), int16 ([-32768 32767]));
7633 ***** assert (im2int16 ([false true]), int16 ([-32768 32767]));
7634 ***** assert (im2int16 ([true false]), int16 ([32767 -32768]));
7635 ***** assert (im2int16 (uint8 ([0 127 128 255])), int16 ([-32768 -129 128 32767]));
7636 ***** assert (im2int16 ([0 1.4/65535 1.5/65535 2/65535 1]), int16 ([-32768 -32767 -32766 -32766 32767]));
7637 ***** assert (im2int16 ([0 0.5 1]), int16 ([-32768 0 32767]));
7638 ***** assert (im2int16 ([-1 0 1 2]), int16 ([-32768 -32768 32767 32767]));
7639 ***** error im2int16 ([1 2], "indexed");
7640 9 tests, 9 passed, 0 known failure, 0 skipped
7641 [im2single]
7642 >>>>> /usr/share/octave/packages/image-2.6.1/im2single.m
7643 ***** assert (im2single (single ([1 2 3])), single ([1 2 3]));
7644 ***** assert (im2single ([1 2 3]), single ([1 2 3]));
7645 ***** assert (im2single (uint8 ([0 127 128 255])), single ([0 127/255 128/255 1]));
7646 ***** assert (im2single (uint16 ([0 127 128 65535])), single ([0 127/65535 128/65535 1]));
7647 ***** assert (im2single (int16 ([-32768 -32767 -32766 32767])), single ([0 1/65535 2/65535 1]));
7648 ***** assert (im2single (uint8 ([0 1 255]), "indexed"), single ([1 2 256]));
7649 ***** assert (im2single (uint16 ([0 1 2557]), "indexed"), single ([1 2 2558]));
7650 ***** assert (im2single ([3 25], "indexed"), single ([3 25]));
7651 ***** error <indexed> im2single ([0 1 2], "indexed");
7652 ***** error <indexed> im2single (int16 ([17 8]), "indexed");
7653 ***** error <indexed> im2single (int16 ([-7 8]), "indexed");
7654 ***** error <indexed> im2single ([false true], "indexed");
7655 12 tests, 12 passed, 0 known failure, 0 skipped
7656 [findbounds]
7657 >>>>> /usr/share/octave/packages/image-2.6.1/findbounds.m
7658 ***** test
7659 im = checkerboard ();
7660 theta = pi/6;
7661 T = maketform ('affine', [cos(theta) -sin(theta); ...
7662 sin(theta) cos(theta); 0 0]);
7663 inbnd = [0 0; 1 1];
7664 outbnd = findbounds (T, inbnd);
7665 diag = 2^.5;
7666 ang = pi/4;
7667 assert (diff (outbnd(:,1)), diag * abs (cos (theta - ang)), eps)
7668 assert (diff (outbnd(:,2)), diag * abs (cos (theta - ang)), eps)
7669 1 test, 1 passed, 0 known failure, 0 skipped
7670 [imclearborder]
7671 >>>>> /usr/share/octave/packages/image-2.6.1/imclearborder.m
7672 ***** test
7673 a = logical ([
7674 0 1 0 0 1 0 0 0 0 1
7675 1 0 0 0 0 1 0 0 0 0
7676 0 1 0 0 0 0 0 0 0 0
7677 1 0 1 0 1 0 1 0 0 1
7678 0 0 0 0 0 0 0 1 1 0
7679 0 0 1 0 0 1 0 1 0 0
7680 0 1 0 1 0 1 1 0 0 0
7681 0 0 0 1 0 0 0 0 0 0
7682 0 0 0 1 0 1 1 0 0 0
7683 0 0 0 1 1 0 0 0 1 0]);
7684
7685 a4 = logical ([
7686 0 0 0 0 0 0 0 0 0 0
7687 0 0 0 0 0 1 0 0 0 0
7688 0 1 0 0 0 0 0 0 0 0
7689 0 0 1 0 1 0 1 0 0 0
7690 0 0 0 0 0 0 0 1 1 0
7691 0 0 1 0 0 1 0 1 0 0
7692 0 1 0 0 0 1 1 0 0 0
7693 0 0 0 0 0 0 0 0 0 0
7694 0 0 0 0 0 1 1 0 0 0
7695 0 0 0 0 0 0 0 0 0 0]);
7696
7697 a8 = logical ([
7698 0 0 0 0 0 0 0 0 0 0
7699 0 0 0 0 0 0 0 0 0 0
7700 0 0 0 0 0 0 0 0 0 0
7701 0 0 0 0 1 0 0 0 0 0
7702 0 0 0 0 0 0 0 0 0 0
7703 0 0 0 0 0 0 0 0 0 0
7704 0 0 0 0 0 0 0 0 0 0
7705 0 0 0 0 0 0 0 0 0 0
7706 0 0 0 0 0 0 0 0 0 0
7707 0 0 0 0 0 0 0 0 0 0]);
7708
7709 assert (imclearborder (a, 4), a4)
7710 assert (imclearborder (a, [0 1 0; 1 1 1; 0 1 0]), a4)
7711 assert (imclearborder (a), a8)
7712 assert (imclearborder (a, 8), a8)
7713 assert (imclearborder (a, ones (3)), a8)
7714 ***** test
7715 a = false (5, 5, 3);
7716 a(2:4,2:4,:) = true;
7717 assert (imclearborder (a, 4), a)
7718
7719 a(1,2) = true;
7720 a4 = a;
7721 a4(:,:,1) = false;
7722 assert (imclearborder (a, 4), a4)
7723 2 tests, 2 passed, 0 known failure, 0 skipped
7724 [@strel/strel]
7725 >>>>> /usr/share/octave/packages/image-2.6.1/@strel/strel.m
7726 ***** test
7727 shape = logical ([0 0 0 1]);
7728 assert (getnhood (strel (shape)), shape);
7729 assert (getnhood (strel ("arbitrary", shape)), shape);
7730
7731 height = [0 0 0 3];
7732 assert (getnhood (strel ("arbitrary", shape, height)), shape);
7733 assert (getheight (strel ("arbitrary", shape, height)), height);
7734 ***** test
7735 shape = logical ([0 0 1]);
7736 height = [-2 1 3]; ## this works for matlab compatibility
7737 assert (getnhood (strel ("arbitrary", shape, height)), shape);
7738 assert (getheight (strel ("arbitrary", shape, height)), height);
7739 ***** test
7740 shape = logical ([0 0 0 1 0 0 0
7741 0 1 1 1 1 1 0
7742 0 1 1 1 1 1 0
7743 1 1 1 1 1 1 1
7744 0 1 1 1 1 1 0
7745 0 1 1 1 1 1 0
7746 0 0 0 1 0 0 0]);
7747 height = [ 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000
7748 0.00000 0.33333 0.66667 0.74536 0.66667 0.33333 0.00000
7749 0.00000 0.66667 0.88192 0.94281 0.88192 0.66667 0.00000
7750 0.00000 0.74536 0.94281 1.00000 0.94281 0.74536 0.00000
7751 0.00000 0.66667 0.88192 0.94281 0.88192 0.66667 0.00000
7752 0.00000 0.33333 0.66667 0.74536 0.66667 0.33333 0.00000
7753 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000];
7754 assert (getnhood (strel ("ball", 3, 1)), shape);
7755 assert (getheight (strel ("ball", 3, 1)), height, 0.0001);
7756 ***** test
7757 shape = logical ([0 0 0 1 0 0 0
7758 0 0 1 1 1 0 0
7759 0 1 1 1 1 1 0
7760 1 1 1 1 1 1 1
7761 0 1 1 1 1 1 0
7762 0 0 1 1 1 0 0
7763 0 0 0 1 0 0 0]);
7764 assert (getnhood (strel ("diamond", 3)), shape);
7765 ***** test
7766 shape = logical ([0 0 0 1 0 0 0
7767 0 1 1 1 1 1 0
7768 0 1 1 1 1 1 0
7769 1 1 1 1 1 1 1
7770 0 1 1 1 1 1 0
7771 0 1 1 1 1 1 0
7772 0 0 0 1 0 0 0]);
7773 assert (getnhood (strel ("disk", 3, 0)), shape);
7774 ***** test
7775 shape = logical ([1 1 1]);
7776 assert (getnhood (strel ("line", 3.9, 20.17)), shape);
7777 shape = logical ([0 0 1
7778 0 1 0
7779 1 0 0]);
7780 assert (getnhood (strel ("line", 3.9, 20.18)), shape);
7781 shape = logical ([1 0 0 0 0 0 0 0 0
7782 0 1 0 0 0 0 0 0 0
7783 0 0 1 0 0 0 0 0 0
7784 0 0 1 0 0 0 0 0 0
7785 0 0 0 1 0 0 0 0 0
7786 0 0 0 0 1 0 0 0 0
7787 0 0 0 0 0 1 0 0 0
7788 0 0 0 0 0 0 1 0 0
7789 0 0 0 0 0 0 1 0 0
7790 0 0 0 0 0 0 0 1 0
7791 0 0 0 0 0 0 0 0 1]);
7792 assert (getnhood (strel ("line", 14, 130)), shape);
7793 ***** test
7794 se = strel ("octagon", 0);
7795 seq = getsequence (se);
7796 assert (getnhood (se), true (1));
7797 assert (getnhood (seq(1)), true (1));
7798
7799 se = strel ("octagon", 3);
7800 seq = getsequence (se);
7801 shape = logical ([0 0 1 1 1 0 0
7802 0 1 1 1 1 1 0
7803 1 1 1 1 1 1 1
7804 1 1 1 1 1 1 1
7805 1 1 1 1 1 1 1
7806 0 1 1 1 1 1 0
7807 0 0 1 1 1 0 0]);
7808 assert (getnhood (se), shape);
7809 assert (size (seq), [4 1]);
7810
7811 templ1 = logical ([0 0 0; 1 1 1; 0 0 0]);
7812 templ2 = logical ([0 1 0; 0 1 0; 0 1 0]);
7813 templ3 = logical ([1 0 0; 0 1 0; 0 0 1]);
7814 templ4 = logical ([0 0 1; 0 1 0; 1 0 0]);
7815 assert ({getnhood(seq(1)) getnhood(seq(2)) getnhood(seq(3)) getnhood(seq(4))},
7816 {templ1 templ2 templ3 templ4});
7817
7818 seq = getsequence (strel ("octagon", 21));
7819 assert (size (seq), [28 1]);
7820 assert (arrayfun (@(x) getnhood (seq(x)), 1:4:25, "UniformOutput", false),
7821 repmat ({templ1}, 1, 7));
7822 assert (arrayfun (@(x) getnhood (seq(x)), 2:4:26, "UniformOutput", false),
7823 repmat ({templ2}, 1, 7));
7824 assert (arrayfun (@(x) getnhood (seq(x)), 3:4:27, "UniformOutput", false),
7825 repmat ({templ3}, 1, 7));
7826 assert (arrayfun (@(x) getnhood (seq(x)), 4:4:28, "UniformOutput", false),
7827 repmat ({templ4}, 1, 7));
7828 ***** test
7829 shape = logical ([1 1 0]');
7830 assert (getnhood (strel ("pair", [-1 0])), shape);
7831 shape = logical ([1 0 0 0 0 0 0
7832 0 0 0 1 0 0 0
7833 0 0 0 0 0 0 0]);
7834 assert (getnhood (strel ("pair", [-1 -3])), shape);
7835 shape = logical ([0 0 0 0 0 0 0
7836 0 0 0 0 0 0 0
7837 0 0 0 1 0 0 0
7838 0 0 0 0 0 0 0
7839 0 0 0 0 0 0 1]);
7840 assert (getnhood (strel ("pair", [2 3])), shape);
7841 ***** test
7842 assert (getnhood (strel ("rectangle", [10 5])), true (10, 5));
7843 assert (getnhood (strel ("square", 5)), true (5));
7844 ***** shared se, seq
7845 se = strel ("square", 5);
7846 seq = getsequence (se);
7847 assert (class (se(1)), "strel")
7848 assert (class (se(1,1)),"strel")
7849 assert (class (seq), "strel")
7850 assert (class (seq(1)), "strel")
7851 assert (class (seq(2)), "strel")
7852 assert (numel (se), 1)
7853 assert (numel (seq), 2)
7854 assert (getnhood (seq(1)), true (5, 1))
7855 assert (getnhood (seq(2)), true (1, 5))
7856 assert (size (se), [1 1])
7857 assert (size (seq), [2 1])
7858 assert (isscalar (se), true)
7859 assert (isscalar (seq), false)
7860 ***** error <index out of bounds> se(2);
7861 ***** error <index out of bounds> seq(3);
7862 !!!!! error failed.
7863 Expected <index out of bounds>, but got <se(3): out of bound 2>
7864
7865 ***** test
7866 se = strel ("arbitrary", [1 0 0; 1 1 0; 0 1 0], [2 0 0; 3 1 0; 0 3 0]);
7867 ref = reflect (se);
7868 assert (getnhood (ref), logical([0 1 0; 0 1 1; 0 0 1]));
7869 assert (getheight (ref), [0 3 0; 0 1 3; 0 0 2]);
7870 ***** error strel()
7871 ***** error strel("nonmethodthing", 2)
7872 ***** error strel("arbitrary", "stuff")
7873 ***** error strel("arbitrary", [0 0 1], [2 0 1; 4 5 1])
7874 ***** error strel("arbitrary", [0 0 1], "stuff")
7875 ***** error strel("ball", -3, 1)
7876 ***** error strel("diamond", -3)
7877 ***** error strel("disk", -3)
7878 ***** error strel("line", 0, 45)
7879 ***** error <positive integer multiple of 3> strel("octagon", 3.5)
7880 ***** error <positive integer multiple of 3> strel("octagon", 4)
7881 ***** error <positive integer multiple of 3> strel("octagon", -1)
7882 ***** error strel("pair", [45 67 90])
7883 ***** error strel("rectangle", 2)
7884 ***** error strel("rectangle", [2 -5])
7885 ***** error strel("square", [34 1-2])
7886 28 tests, 27 passed, 0 known failure, 0 skipped
7887 [imopen]
7888 >>>>> /usr/share/octave/packages/image-2.6.1/imopen.m
7889 ***** shared in, out
7890 in = [ 0 0 0 1 1 1 0 0 1 1
7891 0 1 0 1 1 1 0 0 0 1
7892 1 1 1 1 1 0 0 0 0 0
7893 0 1 1 1 1 0 0 0 0 0
7894 0 0 0 1 0 0 0 0 1 0
7895 0 0 0 0 0 0 0 1 1 1
7896 0 0 0 0 1 0 1 0 1 0
7897 0 0 0 1 1 1 1 1 0 0
7898 0 0 0 0 1 1 1 0 0 0
7899 0 0 0 1 1 1 0 0 0 0];
7900
7901 out = [ 0 0 0 1 1 1 0 0 0 0
7902 0 0 0 1 1 1 0 0 0 0
7903 0 0 0 0 0 0 0 0 0 0
7904 0 0 0 0 0 0 0 0 0 0
7905 0 0 0 0 0 0 0 0 0 0
7906 0 0 0 0 0 0 0 0 0 0
7907 0 0 0 0 0 0 0 0 0 0
7908 0 0 0 0 0 0 0 0 0 0
7909 0 0 0 0 0 0 0 0 0 0
7910 0 0 0 0 0 0 0 0 0 0];
7911 ***** assert (imopen (logical (in), ones (3)), logical (out));
7912
7913 out = [80 80 1 8 15 51 51 51 51 40
7914 80 80 7 8 15 54 55 55 55 40
7915 4 7 7 8 15 54 55 55 55 40
7916 17 17 17 7 3 54 55 55 55 28
7917 17 17 17 2 9 54 54 54 52 33
7918 17 17 17 29 29 29 29 26 33 33
7919 5 5 13 29 29 29 30 32 39 39
7920 6 6 13 29 29 29 30 32 39 39
7921 10 12 77 77 77 35 35 35 39 39
7922 10 12 77 77 77 35 35 35 27 27];
7923 ***** assert (imopen (magic (10), ones (3)), out);
7924 ***** assert (imopen (uint8 (magic (10)), strel ("square", 3)), uint8 (out));
7925
7926 ## using a se that will be decomposed in 2 pieces
7927 out =[ 1 1 1 8 15 40 40 40 40 40
7928 4 4 4 8 15 40 40 40 40 40
7929 4 4 4 8 15 40 40 40 40 40
7930 5 5 5 3 3 28 28 28 28 28
7931 5 5 5 2 9 28 28 28 28 28
7932 5 5 13 26 26 26 26 26 26 26
7933 5 5 13 29 29 29 29 29 27 27
7934 6 6 13 29 29 29 29 29 27 27
7935 6 6 13 29 29 29 29 29 27 27
7936 6 6 13 29 29 29 29 29 27 27];
7937 ***** assert (imopen (magic (10), ones(5)), out);
7938
7939 ## using a weird non-symmetric and even-size se
7940 out =[ 7 7 1 8 15 55 51 51 41 40
7941 7 7 7 8 16 55 55 55 51 41
7942 4 9 7 7 16 54 55 54 55 47
7943 25 25 9 9 3 52 54 52 54 28
7944 25 24 25 2 9 33 52 34 52 34
7945 17 24 29 31 29 30 33 26 33 34
7946 17 5 29 31 31 31 30 32 39 33
7947 10 6 13 35 35 29 31 32 45 39
7948 10 12 77 36 36 35 35 31 45 45
7949 11 12 77 77 77 36 36 35 27 45];
7950 ***** assert (imopen (magic (10), [1 0 0 0; 1 1 1 0; 0 1 0 1]), out);
7951 5 tests, 5 passed, 0 known failure, 0 skipped
7952 [bweuler]
7953 >>>>> /usr/share/octave/packages/image-2.6.1/bweuler.m
7954 ***** demo
7955 A=zeros(9,10);
7956 A([2,5,8],2:9)=1;
7957 A(2:8,[2,9])=1
7958 bweuler(A)
7959 # Euler number (objects minus holes) is 1-2=-1 in an 8-like object
7960 ***** test
7961 A=zeros(10,10);
7962 A(2:9,3:8)=1;
7963 A(4,4)=0;
7964 A(8,8)=0; # not a hole
7965 A(6,6)=0;
7966 assert(bweuler(A),-1);
7967 ***** test
7968 A=zeros(10,10);
7969 A(2:4,2:4)=1;
7970 A(5:8,5:8)=1;
7971 assert(bweuler(A,4),2);
7972 assert(bweuler(A,8),1);
7973 assert(bweuler(A),1);
7974 ***** error <2 dimensions> bweuler (true (5, 5, 1, 5))
7975 3 tests, 3 passed, 0 known failure, 0 skipped
7976 [im2uint16]
7977 >>>>> /usr/share/octave/packages/image-2.6.1/im2uint16.m
7978 ***** assert (im2uint16 (uint16 ([1 2 3])), uint16 ([1 2 3]));
7979 ***** assert (im2uint16 (uint8 ([0 127 128 255])), uint16 ([0 32639 32896 65535]));
7980 ***** assert (im2uint16 ([0 0.5 1]), uint16 ([0 32768 65535]));
7981 ***** assert (im2uint16 ([0 1/65535 1.4/65535 1.5/65535 1]), uint16 ([0 1 1 2 65535]));
7982 ***** assert (im2uint16 ([1 2]), uint16 ([65535 65535]));
7983 ***** assert (im2uint16 ([-1 0 0.5 1]), uint16 ([0 0 32768 65535]));
7984 ***** assert (im2uint16 (int16 ([-32768 -1 0 32768])), uint16 ([0 32767 32768 65535]));
7985 ***** assert (im2uint16 ([false true]), uint16 ([0 65535]));
7986 ***** assert (im2uint16 ([true false]), uint16 ([65535 0]));
7987 ***** assert (im2uint16 (uint8 ([3 25]), "indexed"), uint16 ([3 25]));
7988 ***** assert (im2uint16 ([1 3 25], "indexed"), uint16 ([0 2 24]));
7989 ***** error <indexed> im2uint16 ([0 1 2], "indexed");
7990 ***** error <indexed> im2uint16 (int16 ([17 8]), "indexed");
7991 ***** error <indexed> im2uint16 (int16 ([-7 8]), "indexed");
7992 ***** error <indexed> im2uint16 ([false true], "indexed");
7993 ***** error <range of values> im2uint16 (65537, "indexed");
7994 16 tests, 16 passed, 0 known failure, 0 skipped
7995 [imrotate]
7996 >>>>> /usr/share/octave/packages/image-2.6.1/imrotate.m
7997 ***** test
7998 a = reshape (1:18, [2 3 3]);
7999
8000 a90(:,:,1) = [5 6; 3 4; 1 2];
8001 a90(:,:,2) = a90(:,:,1) + 6;
8002 a90(:,:,3) = a90(:,:,2) + 6;
8003
8004 a180(:,:,1) = [6 4 2; 5 3 1];
8005 a180(:,:,2) = a180(:,:,1) + 6;
8006 a180(:,:,3) = a180(:,:,2) + 6;
8007
8008 am90(:,:,1) = [2 1; 4 3; 6 5];
8009 am90(:,:,2) = am90(:,:,1) + 6;
8010 am90(:,:,3) = am90(:,:,2) + 6;
8011
8012 assert (imrotate (a, 0), a);
8013 assert (imrotate (a, 90), a90);
8014 assert (imrotate (a, -90), am90);
8015 assert (imrotate (a, 180), a180);
8016 assert (imrotate (a, -180), a180);
8017 assert (imrotate (a, 270), am90);
8018 assert (imrotate (a, -270), a90);
8019 assert (imrotate (a, 360), a);
8020 1 test, 1 passed, 0 known failure, 0 skipped
8021 [imcomplement]
8022 >>>>> /usr/share/octave/packages/image-2.6.1/imcomplement.m
8023 ***** assert (imcomplement (10), -9);
8024 ***** assert (imcomplement (single (10)), single (-9));
8025 ***** assert (imcomplement (0.2), 0.8);
8026 ***** assert (imcomplement (uint8 (0)), uint8 (255));
8027 ***** assert (imcomplement (uint8 (1)), uint8 (254));
8028 ***** assert (imcomplement (uint16 (0)), uint16 (65535));
8029 ***** assert (imcomplement (uint16 (1)), uint16 (65534));
8030 ***** assert (imcomplement (int8 (-128)), int8 ( 127));
8031 ***** assert (imcomplement (int8 ( 127)), int8 (-128));
8032 ***** assert (imcomplement (int16 (-1)), int16 ( 0));
8033 ***** assert (imcomplement (int16 ( 0)), int16 (-1));
8034 ***** assert (imcomplement (int16 ( 1)), int16 (-2));
8035 ***** assert (imcomplement ([true false true]), [false true false])
8036 ***** error <must be an image> imcomplement ("not an image")
8037 14 tests, 14 passed, 0 known failure, 0 skipped
8038 [immse]
8039 >>>>> /usr/share/octave/packages/image-2.6.1/immse.m
8040 ***** error <same size> immse (rand (10), rand (12))
8041 ***** error <same class> immse (uint8 ([0 1 2 3]), uint16 ([0 1 2 3]))
8042 ***** error <same class> immse (double ([0 1 2 3]), single ([0 1 2 3]))
8043 ***** assert (immse (magic (5), magic (5)), 0)
8044 ***** assert (immse (single (magic (5)), single (magic (5))), single (0))
8045 ***** assert (immse (uint8 (magic (5)), uint8 (magic (5))), 0)
8046 6 tests, 6 passed, 0 known failure, 0 skipped
8047 [im2uint8]
8048 >>>>> /usr/share/octave/packages/image-2.6.1/im2uint8.m
8049 ***** assert (im2uint8 (uint8 ([1 2 3])), uint8 ([1 2 3]));
8050 ***** assert (im2uint8 (uint16 ([0 65535])), uint8 ([0 255]));
8051 ***** assert (im2uint8 ([0 0.5 1]), uint8 ([0 128 255]));
8052 ***** assert (im2uint8 ([1 2]), uint8 ([255 255]));
8053 ***** assert (im2uint8 ([-1 0 0.5 1 2]), uint8 ([0 0 128 255 255]));
8054 ***** assert (im2uint8 (int16 ([-32768 0 32768])), uint8 ([0 128 255]));
8055 ***** assert (im2uint8 ([false true]), uint8 ([0 255]));
8056 ***** assert (im2uint8 ([true false]), uint8 ([255 0]));
8057 ***** assert (im2uint8 ([1 256], "indexed"), uint8 ([0 255]));
8058 ***** assert (im2uint8 ([3 25], "indexed"), uint8 ([2 24]));
8059 ***** assert (im2uint8 (uint16 ([3 25]), "indexed"), uint8 ([3 25]));
8060 ***** error <indexed> im2uint8 ([0 1 2], "indexed");
8061 ***** error <indexed> im2uint8 (int16 ([17 8]), "indexed");
8062 ***** error <indexed> im2uint8 (int16 ([-7 8]), "indexed");
8063 ***** error <indexed> im2uint8 ([false true], "indexed");
8064 ***** error <range of values> im2uint8 (uint16 (256), "indexed");
8065 ***** error <range of values> im2uint8 (257, "indexed");
8066 17 tests, 17 passed, 0 known failure, 0 skipped
8067 [rgb2xyz]
8068 >>>>> /usr/share/octave/packages/image-2.6.1/rgb2xyz.m
8069 ***** assert (rgb2xyz ([0 0 0]), [0, 0, 0], 1e-3)
8070 ***** assert (rgb2xyz ([1 0 0]), [0.4125, 0.2127, 0.0193], 1e-3)
8071 ***** assert (rgb2xyz ([1 1 0]), [0.7700, 0.9278, 0.1385], 1e-3)
8072 ***** assert (rgb2xyz ([0 1 0]), [0.3576, 0.7152, 0.1192], 1e-3)
8073 ***** assert (rgb2xyz ([0 1 1]), [0.5380, 0.7873, 1.0694], 1e-3)
8074 ***** assert (rgb2xyz ([0 0 1]), [0.1804, 0.0722, 0.9502], 1e-3)
8075 ***** assert (rgb2xyz ([1 0 1]), [0.5929, 0.2848, 0.9696], 1e-3)
8076 ***** assert (rgb2xyz ([1 1 1]), [0.9505, 1.0000, 1.0888], 1e-3)
8077 ***** assert (rgb2xyz ([0.5 0.5 0.5]), [0.2034, 0.2140, 0.2330], 1e-3)
8078 ***** assert (rgb2xyz ([0.75 0 0]), [0.2155, 0.1111, 0.0101], 1e-3)
8079 ***** assert (rgb2xyz ([0.5 0 0]), [0.0883, 0.0455, 0.0041], 1e-3)
8080 ***** assert (rgb2xyz ([0.25 0 0]), [0.0210, 0.0108, 0.0010], 1e-3)
8081 ***** assert (rgb2xyz ([1 0.5 0.5]), [0.5276, 0.3812, 0.2482], 1e-3)
8082 ***** assert (rgb2xyz ([1.5 1 1]), [1.5845, 1.3269, 1.1185], 1e-3)
8083 ***** test
8084 rgb_map = rand (64, 3);
8085 assert (xyz2rgb (rgb2xyz (rgb_map)), rgb_map, 2e-5);
8086 ***** test
8087 rgb_img = rand (64, 64, 3);
8088 assert (xyz2rgb (rgb2xyz (rgb_img)), rgb_img, 2e-5);
8089 ***** assert (rgb2xyz (sparse ([0 0 0])), [0 0 0], 1e-3)
8090 ***** assert (rgb2xyz (sparse ([0 0 1])), [0.1804, 0.0722, 0.9502], 1e-3)
8091 ***** assert (rgb2xyz (uint8([255 255 255])), [0.9505, 1.0000, 1.0888], 1e-3)
8092 ***** assert (class (rgb2xyz (single([1 1 1]))), 'single')
8093 ***** error rgb2xyz ()
8094 ***** error rgb2xyz (1,2)
8095 ***** error <invalid data type 'cell'> rgb2xyz ({1})
8096 ***** error <RGB must be a colormap or RGB image> rgb2xyz (ones (2,2))
8097 ***** test
8098 rgb = rand (16, 16, 3, 5);
8099 xyz = zeros (size (rgb));
8100 for i = 1:5
8101 xyz(:,:,:,i) = rgb2xyz (rgb(:,:,:,i));
8102 endfor
8103 assert (rgb2xyz (rgb), xyz)
8104 25 tests, 25 passed, 0 known failure, 0 skipped
8105 [bestblk]
8106 >>>>> /usr/share/octave/packages/image-2.6.1/bestblk.m
8107 ***** demo
8108 siz = bestblk ([200; 10], 50);
8109 disp (siz)
8110 ***** error <numeric vector> bestblk ("string")
8111 ***** error <positive scalar> bestblk ([100 200], "string")
8112 ***** error <2 elements> bestblk ([100], 5)
8113 ***** assert (bestblk ([ 10 12], 2), [ 2 2]);
8114 ***** assert (bestblk ([ 10 12], 3), [ 2 3]);
8115 ***** assert (bestblk ([300 100], 150), [150 100]);
8116 ***** assert (bestblk ([256 128], 17), [ 16 16]);
8117 ***** assert (bestblk ([ 17 17], 3), [ 3 3]);
8118 ***** assert (bestblk ([230 470]), bestblk ([230 470], 100))
8119 ***** assert (bestblk ([10 12 10], 3), [2 3 2]);
8120 ***** assert (bestblk ([ 9 12 9], 3), [3 3 3]);
8121 ***** assert (bestblk ([10 12 10 11], 5), [5 4 5 4]);
8122 12 tests, 12 passed, 0 known failure, 0 skipped
8123 [bwmorph]
8124 >>>>> /usr/share/octave/packages/image-2.6.1/bwmorph.m
8125 ***** demo
8126 bwmorph (true (11), "shrink", Inf)
8127 # Should return 0 matrix with 1 pixel set to 1 at (6,6)
8128 ***** test
8129 slBW = logical ([ 0 0 0 0 0 0 0
8130 0 1 0 0 0 0 0
8131 0 0 1 1 0 0 0
8132 0 0 1 1 0 0 0
8133 0 0 1 1 1 0 0
8134 0 0 1 1 1 0 0
8135 0 1 1 1 1 1 0
8136 0 1 1 1 1 1 0
8137 0 1 1 1 1 1 0
8138 0 1 1 1 1 1 0
8139 0 1 1 1 1 1 0
8140 0 0 0 0 0 0 0]);
8141
8142 rslBW = logical ([ 0 0 0 0 0 0 0
8143 0 1 0 0 0 0 0
8144 0 0 1 1 0 0 0
8145 0 0 1 1 0 0 0
8146 0 0 0 0 0 0 0
8147 0 0 0 1 0 0 0
8148 0 0 0 1 0 0 0
8149 0 0 0 0 0 0 0
8150 0 0 0 1 0 0 0
8151 0 0 0 0 0 0 0
8152 0 0 0 0 0 0 0
8153 0 0 0 0 0 0 0]);
8154 assert (bwmorph (slBW, "skel-lantuejoul", 1), [rslBW(1:5,:); false(7, 7)]);
8155 assert (bwmorph (slBW, "skel-lantuejoul", 2), [rslBW(1:8,:); false(4, 7)]);
8156 assert (bwmorph (slBW, "skel-lantuejoul", 3), rslBW);
8157 assert (bwmorph (slBW, "skel-lantuejoul", Inf), rslBW);
8158 ***** test
8159 bw = [
8160 0 1 1 1 1 1
8161 0 1 1 1 1 1
8162 0 1 1 1 1 1
8163 1 1 1 1 1 1
8164 1 1 1 1 1 1
8165 1 1 1 1 1 1
8166 1 1 1 1 1 0
8167 1 1 1 1 1 0
8168 1 1 1 1 1 0];
8169
8170 final = logical ([
8171 0 1 0 0 0 1
8172 0 0 1 0 1 0
8173 0 0 0 1 0 0
8174 0 0 0 1 0 0
8175 0 0 1 1 0 0
8176 0 0 1 0 0 0
8177 0 0 1 0 0 0
8178 0 1 0 1 0 0
8179 1 0 0 0 1 0]);
8180 assert (bwmorph (bw, "skel", Inf), final)
8181 assert (bwmorph (bw, "skel", 3), final)
8182 ***** error bwmorph ("not a matrix", "dilate")
8183 ***** assert (bwmorph (magic (10), "dilate"), imdilate (logical (magic (10)), ones (3)));
8184 ***** test
8185 in = logical ([1 1 0 0 1 0 1 0 0 0 1 1 1 0 1 1 0 1 0 0
8186 1 1 1 0 1 0 1 1 1 1 0 1 0 1 0 0 0 0 0 0
8187 0 1 1 1 0 1 1 0 0 0 1 1 0 0 1 1 0 0 1 0
8188 0 0 0 0 0 1 1 1 1 0 0 1 1 1 1 1 1 0 0 1
8189 0 1 0 0 1 1 0 1 1 0 0 0 0 0 1 1 0 0 1 0
8190 0 0 1 1 1 1 1 0 0 1 0 1 1 1 0 0 1 0 0 1
8191 0 1 1 1 1 1 1 0 1 1 1 0 0 0 1 0 0 1 0 0
8192 1 0 1 1 1 0 1 1 0 1 0 0 1 1 1 0 0 1 0 0
8193 1 0 1 1 1 0 1 0 0 1 0 0 1 1 0 0 1 1 1 0
8194 1 0 1 1 1 1 0 0 0 1 0 0 0 0 0 0 1 1 0 0
8195 1 1 1 1 1 1 0 1 0 1 0 0 0 0 0 0 1 0 1 1
8196 0 1 0 1 1 0 0 1 1 1 0 0 0 0 0 0 0 1 0 0
8197 0 0 1 1 0 1 1 1 1 0 0 1 0 0 0 0 1 0 1 1
8198 0 0 1 1 0 0 1 1 1 0 0 0 1 1 1 1 0 0 0 0
8199 0 0 1 0 0 0 0 0 0 1 0 0 1 1 1 1 0 0 0 0
8200 0 0 0 0 0 0 1 1 1 0 0 0 1 1 1 1 1 0 0 0
8201 0 1 0 0 0 1 1 0 1 1 0 0 1 1 1 0 1 1 1 1
8202 1 0 0 1 0 1 1 0 1 0 0 0 0 0 0 1 0 1 1 1
8203 0 0 1 1 0 1 1 1 1 0 0 0 0 1 1 0 1 1 1 1
8204 0 1 1 0 0 1 0 0 1 1 0 0 1 0 0 1 0 0 0 1]);
8205 se = strel ("arbitrary", ones (3));
8206
8207 assert (bwmorph (in, "dilate"), imdilate (in, se));
8208 assert (bwmorph (in, "dilate", 3), imdilate (imdilate (imdilate (in, se), se), se));
8209 assert (bwmorph (in, "bothat"), imbothat (in, se));
8210 assert (bwmorph (in, "tophat"), imtophat (in, se));
8211 assert (bwmorph (in, "open"), imopen (in, se));
8212 assert (bwmorph (in, "close"), imclose (in, se));
8213 ***** assert (bwmorph ([1 0 0; 1 0 1; 0 0 1], "bridge"), logical ([1 1 0; 1 1 1; 0 1 1]));
8214 ***** assert (bwmorph ([0 0 0; 1 0 1; 0 0 1], "clean"), logical ([0 0 0; 0 0 1; 0 0 1]));
8215 ***** assert (bwmorph ([0 0 0; 0 1 0; 0 0 0], "clean"), false (3));
8216 ***** assert (bwmorph ([0 1 0; 1 0 0; 0 0 0], "diag"), logical ([1 1 0; 1 1 0; 0 0 0]));
8217 ***** test
8218 in = logical ([0 1 0 1 0
8219 1 1 1 0 1
8220 1 0 0 1 0
8221 1 1 1 0 1
8222 1 1 1 1 1]);
8223 out = logical ([0 1 0 1 0
8224 1 1 1 1 1
8225 1 0 0 1 0
8226 1 1 1 1 1
8227 1 1 1 1 1]);
8228 assert (bwmorph (in, "fill"), out);
8229 ***** assert (bwmorph ([1 1 1; 0 1 0; 1 1 1], "hbreak"), logical ([1 1 1; 0 0 0; 1 1 1]));
8230 ***** test
8231 in = logical ([0 1 0 0 0
8232 1 0 0 1 0
8233 1 0 1 0 0
8234 1 1 1 1 1
8235 1 1 1 1 1]);
8236
8237 out = logical ([0 1 0 0 0
8238 1 0 0 1 0
8239 1 0 1 0 0
8240 1 1 0 1 1
8241 1 1 1 1 1]);
8242 assert (bwmorph (in, "remove"), out);
8243
8244 out = logical ([0 1 0 0 0
8245 1 0 0 1 0
8246 1 0 1 0 0
8247 1 1 0 1 1
8248 1 1 1 1 1]);
8249 assert (bwmorph (in, "remove", Inf), out);
8250
8251 ## tests for spur are failing (matlab incompatible)
8252 out = logical ([0 1 0 0 0
8253 1 0 0 0 0
8254 1 0 1 0 0
8255 1 1 1 1 1
8256 1 1 1 1 1]);
8257 assert (bwmorph (in, "spur"), out);
8258
8259 out = logical ([0 1 0 0 0
8260 1 0 0 0 0
8261 1 0 0 0 0
8262 1 1 1 1 1
8263 1 1 1 1 1]);
8264 assert (bwmorph (in, "spur", Inf), out);
8265 !!!!! test failed
8266 ASSERT errors for: assert (bwmorph (in, "spur"),out)
8267
8268 Location | Observed | Expected | Reason
8269 (1,2) 0 1 Abs err 1 exceeds tol 0
8270 ***** test
8271 in = [
8272 0 0 0 1 0
8273 1 1 1 1 0
8274 0 0 1 1 0
8275 0 0 1 1 0
8276 0 0 0 1 0];
8277 out = [
8278 0 0 0 0 0
8279 0 1 1 0 0
8280 0 0 0 1 0
8281 0 0 0 0 0
8282 0 0 0 0 0];
8283 assert (bwmorph (in, "shrink"), logical (out));
8284 !!!!! test failed
8285 ASSERT errors for: assert (bwmorph (in, "shrink"),logical (out))
8286
8287 Location | Observed | Expected | Reason
8288 (2,4) 1 0 Abs err 1 exceeds tol 0
8289 (3,4) 0 1 Abs err 1 exceeds tol 0
8290 (4,4) 1 0 Abs err 1 exceeds tol 0
8291 (5,4) 1 0 Abs err 1 exceeds tol 0
8292 13 tests, 11 passed, 0 known failure, 0 skipped
8293 [mat2gray]
8294 >>>>> /usr/share/octave/packages/image-2.6.1/mat2gray.m
8295 ***** assert(mat2gray([1 2 3]), [0 0.5 1]); # standard use
8296 ***** assert(mat2gray(repmat ([1 2; 3 3], [1 1 3])), repmat ([0 0.5; 1 1], [1 1 3])); # setting min and max
8297 ***** assert(mat2gray([1 2 3], [2 2]), [1 1 1]); # equal min and max
8298 ***** assert(mat2gray([-1 0 0.5 3], [2 2]), [0 0 0.5 1]); # equal min and max
8299 ***** assert(mat2gray(ones(3*0.5)), ones(3*0.5)); # equal min and max from the image (not set)
8300 ***** assert(mat2gray([1 2 3], [3 1]), [1 0.5 0]); # max and min inverted
8301 ***** assert (mat2gray ([-3 -2 -1]), [0 0.5 1])
8302 7 tests, 7 passed, 0 known failure, 0 skipped
8303 [fftconvn]
8304 >>>>> /usr/share/octave/packages/image-2.6.1/fftconvn.m
8305 ***** function test_shapes (a, b, precision)
8306 shapes = {"valid", "same", "full"};
8307 for i = 1:3
8308 shape = shapes{i};
8309 assert (fftconvn (a, b, shape), convn (a, b, shape), precision);
8310 endfor
8311 assert (fftconvn (a, b), fftconvn (a, b, "full"));
8312 ***** endfunction
8313 ***** test test_shapes (randi (255, 100), randi (255, 10), 0.1)
8314 ***** test test_shapes (randi (255, 100, 100), randi (255, 10, 10), 0.1)
8315 ***** test test_shapes (randi (255, 100, 100, 100), randi (255, 10, 10, 10), 0.1)
8316 ***** test test_shapes (randi (255, 100, 50, 20), randi (255, 10, 7), 0.1)
8317 ***** test test_shapes (randi (255, 100, 50, 20), randi (255, 10), 0.1)
8318 ***** test
8319 for s = [55 56 57 58]
8320 test_shapes (randi (255, 200, 200), randi (255, s, s), 0.1)
8321 endfor
8322 ***** test
8323 for s = [203 204 205 206]
8324 test_shapes (randi (255, s, s), randi (255, 52, 52), 0.1)
8325 endfor
8326 ***** test test_shapes (randi (255, 100, 100, "uint8"), randi (255, 10, 10, "uint8"), 0.1)
8327 ***** test test_shapes (randi (255, 100, 100, "uint8"), randi (255, 10, 10), 0.1)
8328 ***** test test_shapes (randi (255, 100, 100, "single"), randi (255, 10, 10, "single"), 0.9)
8329 ***** test test_shapes (randi (255, 100, 100, "single"), randi (255, 10, 10), 0.9)
8330 11 tests, 11 passed, 0 known failure, 0 skipped
8331 [imgradient]
8332 >>>>> /usr/share/octave/packages/image-2.6.1/imgradient.m
8333 ***** test
8334 A = [0 1 0
8335 1 1 1
8336 0 1 0];
8337
8338 [gMag, gDir] = imgradient (A);
8339 assert (gMag,[sqrt(18) 4 sqrt(18); 4 0 4; sqrt(18),4,sqrt(18)]);
8340 assert (gDir,[-45 -90 -135; -0 -0 -180; 45 90 135]);
8341
8342 ## the following just test if passing gx and gy separately gets
8343 ## us the same as the image and method though imgradient
8344 [gxSobel, gySobel] = imgradientxy (A, "Sobel");
8345 [gxPrewitt, gyPrewitt] = imgradientxy (A, "Prewitt");
8346 [gxCd, gyCd] = imgradientxy (A, "CentralDifference");
8347 [gxId, gyId] = imgradientxy (A, "IntermediateDifference");
8348
8349 assert (imgradient (A),
8350 imgradient (gxSobel, gySobel));
8351 assert (imgradient (A, "Sobel"),
8352 imgradient (gxSobel, gySobel));
8353 assert (imgradient (A, "Prewitt"),
8354 imgradient(gxPrewitt, gyPrewitt));
8355 assert (imgradient (A, "CentralDifference"),
8356 imgradient (gxCd, gyCd));
8357 assert (imgradient (A, "IntermediateDifference"),
8358 imgradient (gxId, gyId));
8359 1 test, 1 passed, 0 known failure, 0 skipped
8360 [poly2mask]
8361 >>>>> /usr/share/octave/packages/image-2.6.1/poly2mask.m
8362 ***** demo
8363 s = [0:pi/4:2*pi];
8364 x = cos (s) * 90 + 101;
8365 y = sin (s) * 90 + 101;
8366 bw = poly2mask(x, y, 200, 200);
8367 imshow (bw);
8368 ***** demo
8369 s = [0:2*pi/5:pi*4];
8370 s = s ([1, 3, 5, 2, 4, 6]);
8371 x = cos (s) * 90 + 101;
8372 y = sin (s) * 90 + 101;
8373 bw = poly2mask (x, y, 200, 200);
8374 imshow (bw);
8375 ***** # Convex polygons
8376 ***** shared xs, ys, Rs, xt, yt, Rt
8377 xs=[3,3,10,10];
8378 ys=[4,12,12,4];
8379 Rs=zeros(16,14);
8380 Rs(5:12,4:10)=1;
8381 Rs=logical(Rs);
8382 xt=[1,4,7];
8383 yt=[1,4,1];
8384 Rt=[0,0,0,0,0,0,0;
8385 0,0,1,1,1,1,0;
8386 0,0,0,1,1,0,0;
8387 0,0,0,1,0,0,0;
8388 0,0,0,0,0,0,0];
8389 Rt=logical(Rt);
8390 ***** assert(poly2mask(xs,ys,16,14),Rs); # rectangle
8391 ***** assert(poly2mask(xs,ys,8,7),Rs(1:8,1:7)); # clipped
8392 ***** assert(poly2mask(xs-7,ys-8,8,7),Rs(9:16,8:14)); # more clipping
8393 ***** assert(poly2mask(xt,yt,5,7),Rt); # triangle
8394 ***** assert(poly2mask(xt,yt,3,3),Rt(1:3,1:3)); # clipped
8395 ***** # Concave polygons
8396 ***** test
8397 x=[3,3,5,5,8,8,10,10];
8398 y=[4,12,12,8,8,11,11,4];
8399 R=zeros(16,14);
8400 R(5:12,4:5)=1;
8401 R(5:8,6:8)=1;
8402 R(5:11,9:10)=1;
8403 R=logical(R);
8404 assert(poly2mask(x,y,16,14), R);
8405 ***** # Complex polygons
8406 ***** test
8407 x=[1,5,1,5];
8408 y=[1,1,4,4];
8409 R=[0,0,0,0,0,0;
8410 0,0,1,1,0,0;
8411 0,0,1,1,0,0;
8412 0,1,1,1,1,0;
8413 0,0,0,0,0,0];
8414 R=logical(R);
8415 assert(poly2mask(x,y,5,6), R);
8416 7 tests, 7 passed, 0 known failure, 0 skipped
8417 [medfilt2]
8418 >>>>> /usr/share/octave/packages/image-2.6.1/medfilt2.m
8419 ***** shared b, f
8420 b = [ 0 1 2 3
8421 1 8 12 12
8422 4 20 24 21
8423 7 22 25 18];
8424 f = [ 0 1 2 0
8425 1 4 12 3
8426 4 12 20 12
8427 0 7 20 0];
8428 ***** assert (medfilt2 (b), f);
8429
8430 f = [ 0 1 2 3
8431 1 8 12 12
8432 4 20 24 18
8433 4 20 24 18];
8434 ***** assert (medfilt2 (b, true (3, 1)), f);
8435 ***** assert (medfilt2 (b, [3 1]), f);
8436
8437 f = [ 1 8 10 10
8438 1 8 12 12
8439 4 20 24 18
8440 7 20 24 18];
8441 ***** assert (medfilt2 (b, [3 1], 10), f);
8442 ***** assert (medfilt2 (b, 10, [3 1]), f);
8443
8444 f = [ 0.5 4.5 7.0 7.5
8445 2.5 14.0 18.0 15.0
8446 2.5 14.0 18.0 15.0
8447 2.0 10.0 12.0 9.0];
8448 ***** assert (medfilt2 (b, true (4, 1)), f);
8449 ***** assert (medfilt2 (b, [4 1]), f);
8450 7 tests, 7 passed, 0 known failure, 0 skipped
8451 echo Checking CC files ...
8452 warning: function /var/tmp/autopkgtest.ccVgDx/build.jQf/real-tree/inst/private/iscolormap.m shadows a core library function
8453 warning: called from
8454 /var/tmp/file8moa2S at line 833 column 1
8455 [watershed]
8456 >>>>> /var/tmp/autopkgtest.ccVgDx/build.jQf/real-tree/src/watershed.cc
8457 ***** test
8458 ex = tril (ones (50), -1) + triu (repmat (2, [50 50]), 2);
8459 ex(1, 1) = 1;
8460 ex(end, end) = 1;
8461
8462 in = ones (50);
8463 in(end,1) = 0;
8464 in(1,end) = 0;
8465 assert (watershed (in), ex)
8466 ***** test
8467 ex = tril (ones (49), -1) + triu (repmat (2, [49 49]), 2);
8468 ex(1, 1) = 1;
8469 ex(end, end) = 1;
8470
8471 in = ones (49);
8472 in(end,1) = 0;
8473 in(1,end) = 0;
8474 assert (watershed (in), ex)
8475
8476 c = (fspecial ('disk', 5) > 0) + 1;
8477 in(20:30,20:30) = c;
8478 c = (fspecial ('disk', 4) > 0) + 2;
8479 in(21:29,21:29) = c;
8480 assert (watershed (in), ex)
8481 ***** test
8482 ex = tril (ones (49), -1) + triu (repmat (2, [49 49]), 2);
8483 ex(1:28,1:28) = (tril (ones (28) ,7) + triu (repmat (2, [28 28]), 10));
8484 ex(1,9) = 1;
8485 ex(end,end) = 1;
8486 ex(20:29, 29) = 0;
8487
8488 in = ones (49);
8489 in(end,1) = 0;
8490 in(1,end) = 0;
8491 c = (fspecial ("disk", 5) > 0) + 1;
8492 in(1:11,38:48) = c;
8493
8494 assert (watershed (in), ex)
8495 ***** test
8496 im = [
8497 3 4 5 6 0
8498 2 3 4 5 6
8499 1 2 3 4 5
8500 0 1 2 3 4
8501 1 0 1 2 3];
8502
8503 labeled8 = [
8504 1 1 1 0 2
8505 1 1 1 0 0
8506 1 1 1 1 1
8507 1 1 1 1 1
8508 1 1 1 1 1];
8509 labeled4 = [
8510 1 1 1 0 3
8511 1 1 1 0 0
8512 1 1 0 2 2
8513 1 0 2 2 2
8514 0 2 2 2 2];
8515 labeled_weird = [
8516 1 1 1 0 2
8517 1 1 1 1 0
8518 1 1 1 1 1
8519 1 1 1 1 1
8520 1 1 1 1 1];
8521
8522 assert (watershed (im), labeled8);
8523 assert (watershed (im, 8), labeled8);
8524 assert (watershed (im, 4), labeled4);
8525 assert (watershed (im, [1 1 0; 1 1 1; 0 1 1]), labeled_weird);
8526 ***** test
8527 im = [
8528 2 3 30 2
8529 3 30 3 30
8530 255 31 30 4
8531 2 255 31 30
8532 1 2 255 5];
8533
8534 labeled4 = [
8535 1 1 0 4
8536 1 0 3 0
8537 0 2 0 5
8538 2 2 2 0
8539 2 2 0 6];
8540 labeled_weird = [
8541 1 1 0 3
8542 1 1 1 0
8543 0 1 1 1
8544 2 0 0 0
8545 2 2 0 4];
8546
8547 assert (watershed (im, 4), labeled4);
8548 assert (watershed (im, [1 1 0; 1 1 1; 0 1 1]), labeled_weird);
8549 ***** test
8550 im = [
8551 2 3 30 2
8552 3 30 3 30
8553 255 31 30 4
8554 2 255 31 30
8555 1 2 255 5];
8556
8557 labeled8 = [
8558 1 1 0 3
8559 1 1 0 3
8560 0 0 0 0
8561 2 2 0 4
8562 2 2 0 4];
8563 assert (watershed (im), labeled8);
8564 assert (watershed (im, 8), labeled8);
8565 !!!!! test failed
8566 ASSERT errors for: assert (watershed (im),labeled8)
8567
8568 Location | Observed | Expected | Reason
8569 (3,4) 3 0 Abs err 3 exceeds tol 0
8570 (4,4) 0 4 Abs err 4 exceeds tol 0
8571 ***** test
8572 im = [
8573 2 2 2 2 2 2 2
8574 2 2 30 30 30 2 2
8575 2 30 20 20 20 30 2
8576 40 40 20 20 20 40 40
8577 1 40 20 20 20 40 0
8578 1 1 40 20 40 0 0
8579 1 1 1 20 0 0 0];
8580
8581 labeled8 = [
8582 1 1 1 1 1 1 1
8583 1 1 1 1 1 1 1
8584 1 1 1 1 1 1 1
8585 0 0 0 0 0 0 0
8586 2 2 2 0 3 3 3
8587 2 2 2 0 3 3 3
8588 2 2 2 0 3 3 3];
8589 labeled4 = [
8590 1 1 1 1 1 1 1
8591 1 1 1 1 1 1 1
8592 1 1 1 1 1 1 1
8593 0 1 1 1 1 1 0
8594 2 0 1 1 1 0 3
8595 2 2 0 1 0 3 3
8596 2 2 2 0 3 3 3];
8597 labeled_weird = [
8598 1 1 1 1 1 1 1
8599 1 1 1 1 1 1 1
8600 1 1 1 1 1 1 1
8601 0 1 1 0 0 0 0
8602 2 0 0 0 3 3 3
8603 2 2 0 3 3 3 3
8604 2 2 2 0 3 3 3];
8605
8606 assert (watershed (im), labeled8);
8607 assert (watershed (im, 8), labeled8);
8608 assert (watershed (im, 4), labeled4);
8609 assert (watershed (im, [1 1 0; 1 1 1; 0 1 1]), labeled_weird);
8610 ***** test
8611 im = [
8612 40 40 40 40 40 40 40 40 40 40 40 40 40
8613 40 3 3 5 5 5 10 10 10 10 15 20 40
8614 40 3 3 5 5 30 30 30 10 15 15 20 40
8615 40 3 3 5 30 20 20 20 30 15 15 20 40
8616 40 40 40 40 40 20 20 20 40 40 40 40 40
8617 40 10 10 10 40 20 20 20 40 10 10 10 40
8618 40 5 5 5 10 40 20 40 10 10 5 5 40
8619 40 1 3 5 10 15 20 15 10 5 1 0 40
8620 40 1 3 5 10 15 20 15 10 5 1 0 40
8621 40 40 40 40 40 40 40 40 40 40 40 40 40];
8622
8623 labeled8 = [
8624 1 1 1 1 1 1 1 1 1 1 1 1 1
8625 1 1 1 1 1 1 1 1 1 1 1 1 1
8626 1 1 1 1 1 1 1 1 1 1 1 1 1
8627 1 1 1 1 1 1 1 1 1 1 1 1 1
8628 0 0 0 0 0 0 0 0 0 0 0 0 0
8629 2 2 2 2 2 2 0 3 3 3 3 3 3
8630 2 2 2 2 2 2 0 3 3 3 3 3 3
8631 2 2 2 2 2 2 0 3 3 3 3 3 3
8632 2 2 2 2 2 2 0 3 3 3 3 3 3
8633 2 2 2 2 2 2 0 3 3 3 3 3 3];
8634 labeled4 = [
8635 1 1 1 1 1 1 1 1 1 1 1 1 1
8636 1 1 1 1 1 1 1 1 1 1 1 1 1
8637 1 1 1 1 1 1 1 1 1 1 1 1 1
8638 1 1 1 1 1 1 1 1 1 1 1 1 1
8639 0 0 0 0 1 1 1 1 1 0 0 0 0
8640 2 2 2 2 0 1 1 1 0 3 3 3 3
8641 2 2 2 2 2 0 1 0 3 3 3 3 3
8642 2 2 2 2 2 2 0 3 3 3 3 3 3
8643 2 2 2 2 2 2 0 3 3 3 3 3 3
8644 2 2 2 2 2 2 0 3 3 3 3 3 3];
8645 labeled_weird = [
8646 1 1 1 1 1 1 1 1 1 1 1 1 1
8647 1 1 1 1 1 1 1 1 1 1 1 1 1
8648 1 1 1 1 1 1 1 1 1 1 1 1 1
8649 1 1 1 1 1 1 1 1 1 1 1 1 1
8650 0 0 0 0 1 1 0 0 0 0 0 0 0
8651 2 2 2 2 0 0 0 3 3 3 3 3 3
8652 2 2 2 2 2 0 3 3 3 3 3 3 3
8653 2 2 2 2 2 2 0 3 3 3 3 3 3
8654 2 2 2 2 2 2 0 3 3 3 3 3 3
8655 2 2 2 2 2 2 0 3 3 3 3 3 3];
8656
8657 assert (watershed (im), labeled8);
8658 assert (watershed (im, 8), labeled8);
8659 assert (watershed (im, 4), labeled4);
8660 assert (watershed (im, [1 1 0; 1 1 1; 0 1 1]), labeled_weird);
8661 ***** test
8662 im_full = [
8663 1 2 10 3 8 7 5
8664 3 2 5 10 8 1 4
8665 1 8 2 3 8 3 6];
8666
8667 matlab_result_full = [
8668 1 1 0 3 0 4 4
8669 0 0 0 0 0 4 4
8670 2 2 2 0 4 4 4];
8671
8672 assert (watershed (im_crop), matlab_result_crop);
8673
8674 im_crop = [
8675 2 10 3 8 7 5
8676 2 5 10 8 1 4
8677 8 2 3 8 3 6];
8678
8679 matlab_result_crop = [
8680 1 0 2 0 3 3
8681 1 0 0 0 3 3
8682 1 1 1 0 3 3];
8683
8684 assert (watershed (im_crop), matlab_result_crop);
8685 !!!!! test failed
8686 'im_crop' undefined near line 13 column 21
8687 9 tests, 7 passed, 0 known failure, 0 skipped
8688 [graycomatrix]
8689 >>>>> /var/tmp/autopkgtest.ccVgDx/build.jQf/real-tree/src/graycomatrix.cc
8690 ***** shared a
8691 ***** test
8692 a = [0 0 0 1 2;
8693 1 1 0 1 1;
8694 2 2 1 0 0;
8695 1 1 0 2 0;
8696 0 0 1 0 1];
8697 squeeze(graycomatrix(a, 3, 1, -pi/4)) == [4 2 0;
8698 2 3 2;
8699 1 2 0];
8700
8701 ***** assert(size(graycomatrix(a, 3, 1:5, [0:3]*-pi/4)), [3, 3, 5, 4])
8702 ***** demo
8703
8704 # Pattern Recognition Engineering (Nadler & Smith)
8705 # Digital Image Processing (Gonzales & Woods), p. 668
8706
8707 a = [0 0 0 1 2;
8708 1 1 0 1 1;
8709 2 2 1 0 0;
8710 1 1 0 2 0;
8711 0 0 1 0 1];
8712
8713 graycomatrix(a, 3, 1, [0 1]*-pi/4)
8714
8715 2 tests, 2 passed, 0 known failure, 0 skipped
8716 [imreconstruct]
8717 >>>>> /var/tmp/autopkgtest.ccVgDx/build.jQf/real-tree/src/imreconstruct.cc
8718 ***** function recon = parallel_reconstruction (marker, mask,
8719 conn = conndef (ndims (marker), "maximal"))
8720 do
8721 previous = marker;
8722 marker = imdilate (marker, conn);
8723 ## FIXME https://savannah.gnu.org/bugs/index.php?43712
8724 if (strcmp (class (marker), "logical"))
8725 marker = marker & mask;
8726 else
8727 marker = min (marker, mask);
8728 endif
8729 until (all ((marker == previous)(:)))
8730 recon = marker;
8731 ***** endfunction
8732 ***** test
8733 for cl = {"int8", "uint8", "int16", "uint16", "int32", "uint32"}
8734 cl = cl{1};
8735 a = randi ([intmin(cl) intmax(cl)-30], 100, 100, cl);
8736 b = a + randi (20, 100, 100, cl);
8737 assert (imreconstruct (a, b), parallel_reconstruction (a, b))
8738 endfor
8739 for cl = {"double", "single"}
8740 cl = cl{1};
8741 a = (rand (100, 100, cl) - 0.5) .* 1000;
8742 b = a + rand (100, 100, cl) * 100;
8743 assert (imreconstruct (a, b), parallel_reconstruction (a, b))
8744 endfor
8745 ***** test
8746 for cl = {"int8", "uint8", "int16", "uint16", "int32", "uint32"}
8747 cl = cl{1};
8748 a = randi ([intmin(cl) intmax(cl)-30], 100, 100, cl);
8749 b = a + randi (20, 100, 100, cl);
8750 c = [0 1 0; 1 1 1; 0 1 0];
8751 assert (imreconstruct (a, b, c), parallel_reconstruction (a, b, c))
8752 endfor
8753 ***** test
8754 a = randi (210, 100, 100);
8755 b = a + randi (20, 100, 100);
8756 c = ones (3, 1);
8757 assert (imreconstruct (a, b, c), parallel_reconstruction (a, b, c))
8758 ***** test
8759 a = randi (210, 500, 500, 10, 4);
8760 b = a + randi (20, 500, 500, 10, 4);
8761 c = ones (3, 3, 3);
8762 assert (imreconstruct (a, b, c), parallel_reconstruction (a, b, c))
8763 ***** test
8764 a = randi (210, 500, 500, 10, 4);
8765 b = a + randi (20, 500, 500, 10, 4);
8766 c = conndef (4, "minimal");
8767 assert (imreconstruct (a, b, c), parallel_reconstruction (a, b, c))
8768 ***** test
8769 a = [ 0 0 0 0 0 0 0 1 0 0
8770 0 0 0 0 0 0 0 1 0 0
8771 1 0 0 0 0 0 0 0 0 0
8772 0 0 0 0 0 0 0 0 0 0
8773 0 0 0 0 0 0 0 1 0 0
8774 0 0 0 0 0 0 1 0 0 0
8775 0 0 0 0 0 0 0 0 0 0
8776 0 0 0 0 0 0 0 0 0 0
8777 0 0 0 0 1 0 0 0 0 0
8778 0 0 0 0 0 0 0 1 0 0];
8779
8780 b = [ 0 1 0 0 0 0 0 1 1 0
8781 1 1 0 0 0 1 0 1 1 0
8782 1 1 0 0 1 0 0 0 0 0
8783 1 1 0 0 0 1 1 0 0 0
8784 1 0 0 0 0 0 1 1 0 0
8785 0 1 0 0 0 0 1 1 0 0
8786 0 0 0 1 0 0 0 0 0 0
8787 0 0 0 0 1 1 0 0 0 0
8788 0 0 0 1 1 0 0 0 0 0
8789 1 0 0 0 1 0 0 1 0 1];
8790
8791 c = [ 0 1 0 0 0 0 0 1 1 0
8792 1 1 0 0 0 1 0 1 1 0
8793 1 1 0 0 1 0 0 0 0 0
8794 1 1 0 0 0 1 1 0 0 0
8795 1 0 0 0 0 0 1 1 0 0
8796 0 1 0 0 0 0 1 1 0 0
8797 0 0 0 1 0 0 0 0 0 0
8798 0 0 0 0 1 1 0 0 0 0
8799 0 0 0 1 1 0 0 0 0 0
8800 0 0 0 0 1 0 0 1 0 0];
8801 assert (imreconstruct (logical (a), logical (b)), logical (c));
8802
8803 c = [ 0 1 0 0 0 0 0 1 1 0
8804 1 1 0 0 0 0 0 1 1 0
8805 1 1 0 0 0 0 0 0 0 0
8806 1 1 0 0 0 1 1 0 0 0
8807 1 0 0 0 0 0 1 1 0 0
8808 0 0 0 0 0 0 1 1 0 0
8809 0 0 0 0 0 0 0 0 0 0
8810 0 0 0 0 1 1 0 0 0 0
8811 0 0 0 1 1 0 0 0 0 0
8812 0 0 0 0 1 0 0 1 0 0];
8813 assert (imreconstruct (logical (a), logical (b), [0 1 0; 1 1 1; 0 1 0]),
8814 logical (c));
8815 ***** test
8816 do
8817 b = rand (100, 100, 100) > 0.98;
8818 until (nnz (b) > 4)
8819 b = imdilate (b, ones (5, 5, 5));
8820 a = false (size (b));
8821 f = find (b);
8822 a(f(randi (numel (f), 6, 1))) = true;
8823 assert (imreconstruct (a, b), parallel_reconstruction (a, b))
8824 ***** test
8825 a = randi (200, 100,100, 10, 10);
8826 b = a + randi (20, 100,100, 10, 10);
8827 c1 = ones (3, 3, 3);
8828 c2 = zeros (3, 3, 3, 3);
8829 c2(:,:,:,2) = c1;
8830 assert (imreconstruct (a, b, c1), imreconstruct (a, b, c2))
8831 ***** error <MARKER must be less or equal than MASK> imreconstruct (randi([5 10], [10 10]), randi([1 5], [10 10]))
8832 9 tests, 9 passed, 0 known failure, 0 skipped
8833 [imerode]
8834 >>>>> /var/tmp/autopkgtest.ccVgDx/build.jQf/real-tree/src/imerode.cc
8835 ***** assert (imerode (eye (3), [1]), eye (3));
8836 ***** assert (imerode (eye (3), []), Inf (3, 3));
8837 ***** test
8838 im = [0 1 0
8839 1 1 1
8840 0 1 0];
8841 se = [1 0 0
8842 0 1 0
8843 0 1 1];
8844 assert (imerode (im, se), [0 1 0; 0 0 0; 0 1 0]);
8845 assert (imerode (logical(im), se), logical ([0 1 0; 0 0 0; 0 1 0]));
8846 assert (imerode (im, se, "full"),
8847 [ 0 0 0 0 Inf
8848 1 0 1 0 Inf
8849 0 0 0 0 0
8850 Inf 0 1 0 1
8851 Inf Inf 0 1 0]);
8852 assert (imerode (logical(im), se, "full"),
8853 logical([0 0 0 0 1
8854 1 0 1 0 1
8855 0 0 0 0 0
8856 1 0 1 0 1
8857 1 1 0 1 0]));
8858 ***** test
8859 a = rand ([10 40 15 6 8 5]) > 0.2;
8860 se = ones ([5 3 7]);
8861
8862 ## the image is not really indexed but this way it is padded with 1s
8863 assert (imerode (a, se), colfilt (a, "indexed", size (se), "sliding", @all))
8864
8865 assert (imerode (a, se, "valid"), convn (a, se, "valid") == nnz (se))
8866 ## again, we need to pad it ourselves because convn pads with zeros
8867 b = true (size (a) + [4 2 6 0 0 0]);
8868 b(3:12, 2:41, 4:18,:,:,:) = a;
8869 assert (imdilate (b, se, "same"), convn (b, se, "same") > 0)
8870 b = true (size (a) + [8 4 12 0 0 0]);
8871 b(5:14, 3:42, 7:21,:,:,:) = a;
8872 assert (imdilate (b, se, "full"), convn (b, se, "full") > 0)
8873 ***** test
8874 im = [0 0 0 0 0 0 0
8875 0 0 1 0 1 0 0
8876 0 0 1 1 0 1 0
8877 0 0 1 1 1 0 0
8878 0 0 0 0 0 0 0];
8879 se = [0 0 0
8880 0 1 0
8881 0 1 1];
8882 out = [0 0 0 0 0 0 0
8883 0 0 1 0 0 0 0
8884 0 0 1 1 0 0 0
8885 0 0 0 0 0 0 0
8886 0 0 0 0 0 0 0];
8887 assert (imerode (im, se), out);
8888 assert (imerode (logical (im), se), logical (out));
8889 assert (imerode (im, logical (se)), out);
8890 assert (imerode (logical (im), logical (se)), logical (out));
8891
8892 # with an even-size SE
8893 se = [0 0 0 1
8894 0 1 0 0
8895 0 1 1 1];
8896 out = [0 0 0 0 0 0 0
8897 0 0 0 0 0 0 0
8898 0 0 1 0 0 0 0
8899 0 0 0 0 0 0 0
8900 0 0 0 0 0 0 0];
8901 assert (imerode (im, se), out);
8902 out = [ 0 0 0 0 1 0 1
8903 0 0 1 0 1 1 0
8904 0 0 1 1 1 1 1
8905 0 0 1 1 1 1 1
8906 0 0 1 1 1 1 1];
8907 assert (imdilate (im, se), out);
8908 ***** test
8909 a = [ 82 2 97 43 79 43 41 65 51 11
8910 60 65 21 56 94 77 36 38 75 39
8911 32 68 78 1 16 75 76 90 81 56
8912 43 90 82 41 36 1 87 19 18 63
8913 63 64 2 48 18 43 38 25 22 99
8914 12 46 90 79 3 92 39 79 10 22
8915 38 98 11 10 40 90 88 38 4 76
8916 54 37 9 4 33 98 36 47 53 57
8917 38 76 82 50 14 74 64 99 7 33
8918 88 96 41 62 84 89 97 23 41 3];
8919
8920 domain = ones (3);
8921 out = [ 2 1 1 1 16 36 36 11
8922 21 1 1 1 1 1 18 18
8923 2 1 1 1 1 1 18 18
8924 2 2 2 1 1 1 10 10
8925 2 2 2 3 3 25 4 4
8926 9 4 3 3 3 36 4 4
8927 9 4 4 4 14 36 4 4
8928 9 4 4 4 14 23 7 3];
8929 assert (imerode (a, domain, "valid"), out);
8930 assert (imerode (uint8 (a), domain, "valid"), uint8 (out));
8931 assert (imerode (uint8 (a), strel ("arbitrary", domain), "valid"), uint8 (out));
8932 assert (imerode (uint8 (a), strel ("square", 3), "valid"), uint8 (out));
8933
8934 ***** ## Test for non-flat strel
8935 assert (imerode (a, strel ("arbitrary", domain, ones (3)), "valid"), out -1);
8936
8937 out = [ 97 97 97 94 94 90 90 90
8938 90 90 94 94 94 90 90 90
8939 90 90 82 75 87 90 90 99
8940 90 90 90 92 92 92 87 99
8941 98 98 90 92 92 92 88 99
8942 98 98 90 98 98 98 88 79
8943 98 98 82 98 98 99 99 99
8944 96 96 84 98 98 99 99 99];
8945 assert (imdilate (a, domain, "valid"), out);
8946 assert (imdilate (uint8 (a), domain, "valid"), uint8 (out));
8947
8948 ***** ## Test for non-flat strel
8949 assert (imdilate (a, strel ("arbitrary", domain, ones (3)), "valid"), out +1);
8950
8951 ## test while using SE that can be decomposed and an actual sequence
8952 domain = ones (5);
8953 out = [ 2 1 1 1 1 1 16 11 11 11
8954 2 1 1 1 1 1 1 1 11 11
8955 2 1 1 1 1 1 1 1 11 11
8956 2 1 1 1 1 1 1 1 10 10
8957 2 1 1 1 1 1 1 1 4 4
8958 2 2 2 1 1 1 1 1 4 4
8959 2 2 2 2 2 3 3 4 4 4
8960 9 4 3 3 3 3 3 3 3 3
8961 9 4 4 4 4 4 4 3 3 3
8962 9 4 4 4 4 4 7 3 3 3];
8963 assert (imerode (a, domain), out);
8964 assert (imerode (a, strel ("square", 5)), out);
8965 assert (imerode (a, getsequence (strel ("square", 5))), out);
8966
8967 ## using a non-symmetric SE
8968 domain = [ 1 1 0
8969 0 1 1
8970 0 1 0];
8971
8972 out = [ 2 2 1 16 36 36 38 39
8973 60 1 1 16 1 36 19 18
8974 32 2 1 1 1 19 18 18
8975 2 2 18 3 1 1 19 10
8976 46 2 2 3 18 38 10 4
8977 11 9 4 3 3 36 4 4
8978 9 4 4 10 36 36 38 4
8979 37 9 4 4 33 36 7 7];
8980 assert (imerode (a, domain, "valid"), out);
8981 assert (imerode (a, strel ("arbitrary", domain, ones (3)), "valid"), out -1);
8982
8983 out = [ 78 97 56 94 94 90 90 81
8984 90 82 78 94 87 87 90 90
8985 90 90 82 43 75 87 90 99
8986 90 90 79 92 92 87 79 25
8987 98 90 90 90 92 92 79 79
8988 98 98 79 98 98 90 88 57
8989 98 82 50 74 98 99 99 53
8990 96 82 84 89 98 97 99 99];
8991 assert (imdilate (a, domain, "valid"), out);
8992 assert (imdilate (a, strel ("arbitrary", domain, ones (3)), "valid"), out +1);
8993 ***** test
8994 im = reshape (magic(16), [4 8 4 2]);
8995 se = true (3, 3, 3);
8996 out = zeros (4, 8, 4, 2);
8997 out(:,:,1,1) = [
8998 3 3 46 2 2 2 47 47
8999 3 3 30 2 2 2 31 31
9000 17 17 16 16 16 20 13 13
9001 33 33 16 16 16 36 13 13];
9002 out(:,:,2,1) = [
9003 3 3 46 2 2 2 43 43
9004 3 3 30 2 2 2 27 27
9005 17 17 12 12 12 20 13 13
9006 33 33 12 12 12 36 13 13];
9007 out(:,:,3,1) = [
9008 3 3 42 6 6 6 43 43
9009 3 3 26 6 6 6 27 27
9010 21 21 12 12 12 20 9 9
9011 37 37 12 12 12 36 9 9];
9012 out(:,:,4,1) = [
9013 7 7 42 6 6 6 43 43
9014 7 7 26 6 6 6 27 27
9015 21 21 12 12 12 24 9 9
9016 37 37 12 12 12 40 9 9];
9017 out(:,:,1,2) = [
9018 11 11 38 10 10 10 39 39
9019 11 11 22 10 10 10 23 23
9020 25 25 8 8 8 28 5 5
9021 41 41 8 8 8 44 5 5];
9022 out(:,:,2,2) = [
9023 11 11 38 10 10 10 35 35
9024 11 11 22 10 10 10 19 19
9025 25 25 4 4 4 28 5 5
9026 41 41 4 4 4 44 5 5];
9027 out(:,:,3,2) = [
9028 11 11 34 14 14 14 35 35
9029 11 11 18 14 14 14 19 19
9030 29 29 4 4 4 28 1 1
9031 45 45 4 4 4 44 1 1];
9032 out(:,:,4,2) = [
9033 15 15 34 14 14 14 35 35
9034 15 15 18 14 14 14 19 19
9035 29 29 4 4 4 32 1 1
9036 45 45 4 4 4 48 1 1];
9037 assert (imerode (im, se), out);
9038 assert (imerode (uint16 (im), se), uint16 (out));
9039
9040 ## trying a more weird SE
9041 se(:,:,1) = [1 0 1; 0 1 1; 0 0 0];
9042 se(:,:,3) = [1 0 1; 0 1 1; 0 0 1];
9043 out(:,:,1,1) = [
9044 3 17 46 2 2 2 47 47
9045 17 3 30 2 2 2 31 31
9046 17 17 16 16 16 20 13 31
9047 33 33 16 16 16 36 13 13];
9048 out(:,:,2,1) = [
9049 3 3 46 2 2 20 43 61
9050 3 3 30 2 20 2 27 43
9051 33 17 12 20 20 20 13 13
9052 51 33 12 12 30 36 13 13];
9053 out(:,:,3,1) = [
9054 3 21 42 6 6 6 43 43
9055 21 3 26 6 6 6 27 27
9056 21 21 12 12 12 20 9 27
9057 37 37 12 12 12 36 9 9];
9058 out(:,:,4,1) = [
9059 7 7 42 6 6 24 57 57
9060 7 7 26 6 24 6 43 43
9061 37 21 26 24 24 24 9 9
9062 55 37 12 12 26 40 9 9];
9063 out(:,:,1,2) = [
9064 11 25 38 10 10 10 39 39
9065 25 11 22 10 10 10 23 23
9066 25 25 8 8 8 28 5 23
9067 41 41 8 8 8 44 5 5];
9068 out(:,:,2,2) = [
9069 11 11 38 10 10 28 35 53
9070 11 11 22 10 22 10 19 35
9071 41 25 4 22 22 28 5 5
9072 59 41 4 4 22 44 5 5];
9073 out(:,:,3,2) = [
9074 11 29 34 14 14 14 35 35
9075 29 11 18 14 14 14 19 19
9076 29 29 4 4 4 28 1 19
9077 45 45 4 4 4 44 1 1];
9078 out(:,:,4,2) = [
9079 15 15 34 14 14 32 49 49
9080 15 15 18 14 18 14 35 35
9081 45 29 18 18 18 32 1 1
9082 63 45 4 4 18 48 1 1];
9083 assert (imerode (im, se), out);
9084 assert (imerode (uint16 (im), se), uint16 (out));
9085 ***** error imerode (ones (10), 45)
9086 ***** error imerode (ones (10), "some text")
9087 ***** error imerode (ones (10), {23, 45})
9088 ***** error imerode (rand (10) > 10 , strel ("arbitrary", true (3), ones (3)))
9089 ***** test
9090 a = rand ([10 40 15 6 8 5]) > 0.8;
9091 se = ones ([5 3 7]);
9092 assert (imdilate (a, se), convn (a, se, "same") > 0)
9093 assert (imdilate (a, se, "full"), convn (a, se, "full") > 0)
9094 assert (imdilate (a, se, "valid"), convn (a, se, "valid") > 0)
9095 assert (imdilate (a, se), colfilt (a, size (se), "sliding", @any))
9096 ***** test
9097 im = reshape (magic(16), [4 8 4 2]);
9098 se = true (3, 3, 3);
9099 out = zeros (4, 8, 4, 2);
9100
9101 out(:,:,1,1) = [
9102 256 256 209 253 253 253 212 212
9103 256 256 225 253 253 253 228 228
9104 238 238 243 243 243 239 242 242
9105 222 222 243 243 243 223 242 242];
9106 out(:,:,2,1) = [
9107 256 256 213 253 253 253 212 212
9108 256 256 229 253 253 253 228 228
9109 238 238 243 243 243 239 246 246
9110 222 222 243 243 243 223 246 246];
9111 out(:,:,3,1) = [
9112 252 252 213 253 253 253 216 216
9113 252 252 229 253 253 253 232 232
9114 238 238 247 247 247 235 246 246
9115 222 222 247 247 247 219 246 246];
9116 out(:,:,4,1) = [
9117 252 252 213 249 249 249 216 216
9118 252 252 229 249 249 249 232 232
9119 234 234 247 247 247 235 246 246
9120 218 218 247 247 247 219 246 246];
9121 out(:,:,1,2) = [
9122 248 248 217 245 245 245 220 220
9123 248 248 233 245 245 245 236 236
9124 230 230 251 251 251 231 250 250
9125 214 214 251 251 251 215 250 250];
9126 out(:,:,2,2) = [
9127 248 248 221 245 245 245 220 220
9128 248 248 237 245 245 245 236 236
9129 230 230 251 251 251 231 254 254
9130 214 214 251 251 251 215 254 254];
9131 out(:,:,3,2) = [
9132 244 244 221 245 245 245 224 224
9133 244 244 237 245 245 245 240 240
9134 230 230 255 255 255 227 254 254
9135 214 214 255 255 255 211 254 254];
9136 out(:,:,4,2) = [
9137 244 244 221 241 241 241 224 224
9138 244 244 237 241 241 241 240 240
9139 226 226 255 255 255 227 254 254
9140 210 210 255 255 255 211 254 254];
9141 assert (imdilate (im, se), out);
9142 assert (imdilate (uint16 (im), se), uint16 (out));
9143
9144 ## trying a more weird SE
9145 se(:,:,1) = [1 0 1; 0 1 1; 0 0 0];
9146 se(:,:,3) = [1 0 1; 0 1 1; 0 0 1];
9147 out(:,:,1,1) = [
9148 256 256 209 239 253 253 212 194
9149 256 256 225 239 239 239 228 212
9150 222 222 243 239 243 239 242 242
9151 208 208 225 243 243 223 242 242];
9152 out(:,:,2,1) = [
9153 256 256 213 253 253 253 212 212
9154 238 256 229 253 253 253 228 228
9155 238 238 243 243 243 239 246 228
9156 222 222 243 243 243 223 228 246];
9157 out(:,:,3,1) = [
9158 252 252 213 235 253 253 216 198
9159 252 252 229 235 235 253 232 216
9160 222 238 247 235 247 235 246 246
9161 204 222 229 247 247 219 246 246];
9162 out(:,:,4,1) = [
9163 252 252 213 249 249 249 216 216
9164 234 252 229 249 249 249 232 232
9165 234 234 247 247 247 235 246 232
9166 218 218 247 247 247 219 232 246];
9167 out(:,:,1,2) = [
9168 248 248 217 231 245 245 220 202
9169 248 248 233 233 233 231 236 220
9170 214 214 251 233 251 231 250 250
9171 200 200 233 251 251 215 250 250];
9172 out(:,:,2,2) = [
9173 248 248 221 245 245 245 220 220
9174 230 248 237 245 245 245 236 236
9175 230 230 251 251 251 231 254 236
9176 214 214 251 251 251 215 236 254];
9177 out(:,:,3,2) = [
9178 244 244 221 227 245 245 224 206
9179 244 244 237 237 237 245 240 224
9180 214 230 255 237 255 227 254 254
9181 196 214 237 255 255 211 254 254];
9182 out(:,:,4,2) = [
9183 244 244 221 241 241 241 224 224
9184 226 244 237 241 241 241 240 240
9185 226 226 255 255 255 227 254 240
9186 210 210 255 255 255 211 240 254];
9187 assert (imdilate (im, se), out);
9188 assert (imdilate (uint16 (im), se), uint16 (out));
9189 ***** test # scalar blank SE
9190 se = 0;
9191 assert (imerode (5, se), Inf)
9192 assert (imerode (true, se), true)
9193 assert (imerode (false, se), true)
9194 assert (imerode (uint8 (3), se), uint8 (255))
9195
9196 assert (imdilate (5, se), -Inf)
9197 assert (imdilate (true, se), false)
9198 assert (imdilate (false, se), false)
9199 assert (imdilate (uint8 (3), se), uint8 (0))
9200 ***** test # empty SE
9201 se = [];
9202 assert (imerode (5, se), Inf)
9203 assert (imerode (true, se), true)
9204 assert (imerode (false, se), true)
9205 assert (imerode (uint8 (3), se), uint8 (255))
9206
9207 assert (imdilate (5, se), -Inf)
9208 assert (imdilate (true, se), false)
9209 assert (imdilate (false, se), false)
9210 assert (imdilate (uint8 (3), se), uint8 (0))
9211 ***** test # non-scalar blank SE
9212 se = zeros (3, 3);
9213 assert (imerode (5, se), Inf)
9214 assert (imerode (true, se), true)
9215 assert (imerode (false, se), true)
9216 assert (imerode (uint8 (3), se), uint8 (255))
9217
9218 assert (imdilate (5, se), -Inf)
9219 assert (imdilate(true, se), false)
9220 assert (imdilate (false, se), false)
9221 assert (imdilate (uint8 (3), se), uint8 (0))
9222 ***** test # erode only with out-of-border elements
9223 se = [1 1 1; 1 0 1; 1 1 1];
9224 assert (imerode (5, se), Inf)
9225 assert (imerode (true, se), true)
9226
9227 assert (imdilate (5, se), -Inf)
9228 assert (imdilate (true, se), false)
9229 ***** test # only true elements of SE are out-of-border
9230 se = [0 0 0; 1 0 0; 1 1 0];
9231 assert (imerode (zeros (3), se), [0 0 0; 0 0 0; Inf 0 0])
9232 assert (imerode (false (3), se), logical ([0 0 0; 0 0 0; 1 0 0]))
9233 assert (imdilate (zeros (3), se), [0 0 -Inf; 0 0 0; 0 0 0])
9234 assert (imdilate (false (3), se), false (3, 3))
9235
9236 se = [0 0 0; 0 0 0; 1 1 1];
9237 assert (imerode (zeros (3, 3), se), [0 0 0; 0 0 0; Inf Inf Inf])
9238 assert (imerode (false (3, 3), se), logical ([0 0 0; 0 0 0; 1 1 1]))
9239 assert (imdilate (zeros (3, 3), se), [-Inf -Inf -Inf; 0 0 0; 0 0 0])
9240 assert (imdilate (false (3, 3), se), false (3, 3))
9241 ***** test # only true elements of even-sized SE are out-of-border
9242 se = logical ([0 1; 1 1]);
9243 assert (imerode (false (3, 3), se), logical ([0 0 0; 0 0 0; 0 0 1]))
9244 assert (imerode (zeros (3, 3), se), [0 0 0; 0 0 0; 0 0 Inf])
9245
9246 assert (imdilate (false (3, 3), se), false (3, 3))
9247 assert (imdilate (zeros (3, 3), se), [-Inf 0 0; 0 0 0; 0 0 0])
9248 19 tests, 19 passed, 0 known failure, 0 skipped
9249 [intlut]
9250 >>>>> /var/tmp/autopkgtest.ccVgDx/build.jQf/real-tree/src/intlut.cc
9251 ***** assert (intlut (uint8 (1:4), uint8 ( 255:-1:0)), uint8 (254:-1:251));
9252 ***** assert (intlut (uint16 (1:4), uint16 (65535:-1:0)), uint16 (65534:-1:65531));
9253 ***** assert (intlut (int16 (1:4), int16 (32767:-1:-32768)), int16 (-2:-1:-5));
9254 ***** assert (intlut (uint8 (255), uint8 (0:255)), uint8 (255));
9255 ***** assert (intlut (uint16 (65535), uint16 (0:65535)), uint16 (65535));
9256 ***** assert (intlut (int16 (32767), int16 (-32768:32767)), int16 (32767));
9257 ***** error intlut ()
9258 ***** error intlut ("text")
9259 ***** error <must be of same class> intlut (1:20, uint8 (0:255));
9260 ***** error <must be of same class> intlut (uint16 (1:20), uint8 (0:255));
9261 ***** error <must have 256 elements> intlut (uint8 (1:20), uint8 (0:200));
9262 ***** error <must have 65536 elements> intlut (uint16 (1:20), uint16 (0:500));
9263 error <LUST must be a vector> intlut (uint8 (56), uint8 (magic (16) -1))
9264 12 tests, 12 passed, 0 known failure, 0 skipped
9265 [bwconncomp]
9266 >>>>> /var/tmp/autopkgtest.ccVgDx/build.jQf/real-tree/src/bwconncomp.cc
9267 ***** test
9268 a = rand (10) > 0.5;
9269 cc = bwconncomp (a, 4);
9270 assert (cc.Connectivity, 4)
9271 assert (cc.ImageSize, [10 10])
9272
9273 b = false (10);
9274 for i = 1:numel (cc.PixelIdxList)
9275 b(cc.PixelIdxList{i}) = true;
9276 endfor
9277 assert (a, b)
9278 ***** test
9279 a = rand (10, 13) > 0.5;
9280 cc = bwconncomp (a, 4);
9281 assert (cc.ImageSize, [10 13])
9282
9283 b = false (10, 13);
9284 for i = 1:numel (cc.PixelIdxList)
9285 b(cc.PixelIdxList{i}) = true;
9286 endfor
9287 assert (a, b)
9288 ***** test
9289 a = rand (15) > 0.5;
9290 conn_8 = bwconncomp (a, 8);
9291 assert (conn_8, bwconncomp (a))
9292 assert (conn_8, bwconncomp (a, ones (3)))
9293 assert (conn_8.Connectivity, 8)
9294 assert (bwconncomp (a, ones (3)).Connectivity, 8)
9295 assert (bwconncomp (a, [0 1 0; 1 1 1; 0 1 0]).Connectivity, 4)
9296 ***** test
9297 a = rand (40, 40) > 0.2;
9298 cc = bwconncomp (a, 4);
9299 assert (rows (cc.PixelIdxList), 1)
9300 assert (columns (cc.PixelIdxList) > 1)
9301 ***** assert (bwconncomp (false (5)), struct ("ImageSize", [5 5], "NumObjects", 0,
9302 "PixelIdxList", {cell(1, 0)},
9303 "Connectivity", 8))
9304 ***** test
9305 in = [ 0 0 1 0 0 1 0 1 0 0
9306 0 0 1 0 0 0 0 0 1 1
9307 1 0 0 0 0 1 1 0 0 0
9308 1 0 0 0 1 0 0 0 0 0
9309 1 1 1 1 0 0 0 0 0 1
9310 0 1 0 1 1 0 0 1 0 0
9311 1 0 0 0 1 0 0 0 0 0
9312 0 0 0 1 1 0 0 1 0 0
9313 0 1 0 1 1 0 0 1 1 0
9314 0 1 0 1 1 1 0 0 1 0];
9315 assert (bwareaopen (in, 1, 4), logical (in))
9316
9317 out = [0 0 0 0 0 0 0 0 0 0
9318 0 0 0 0 0 0 0 0 0 0
9319 1 0 0 0 0 0 0 0 0 0
9320 1 0 0 0 0 0 0 0 0 0
9321 1 1 1 1 0 0 0 0 0 0
9322 0 1 0 1 1 0 0 0 0 0
9323 0 0 0 0 1 0 0 0 0 0
9324 0 0 0 1 1 0 0 0 0 0
9325 0 0 0 1 1 0 0 0 0 0
9326 0 0 0 1 1 1 0 0 0 0];
9327 assert (bwareaopen (logical (in), 10, 4), logical (out))
9328 assert (bwareaopen (in, 10, 4), logical (out))
9329 assert (bwareaopen (in, 10, [0 1 0; 1 1 1; 0 1 0]), logical (out))
9330
9331 out = [0 0 0 0 0 0 0 0 0 0
9332 0 0 0 0 0 0 0 0 0 0
9333 1 0 0 0 0 1 1 0 0 0
9334 1 0 0 0 1 0 0 0 0 0
9335 1 1 1 1 0 0 0 0 0 0
9336 0 1 0 1 1 0 0 0 0 0
9337 1 0 0 0 1 0 0 0 0 0
9338 0 0 0 1 1 0 0 0 0 0
9339 0 0 0 1 1 0 0 0 0 0
9340 0 0 0 1 1 1 0 0 0 0];
9341 assert (bwareaopen (in, 10, 8), logical (out))
9342 assert (bwareaopen (in, 10, ones (3)), logical (out))
9343 assert (bwareaopen (in, 10), logical (out))
9344
9345 out = [0 0 0 0 0 0 0 0 0 0
9346 0 0 0 0 0 0 0 0 0 0
9347 1 0 0 0 0 0 0 0 0 0
9348 1 0 0 0 0 0 0 0 0 0
9349 1 1 1 1 0 0 0 0 0 0
9350 0 1 0 1 1 0 0 0 0 0
9351 0 0 0 0 1 0 0 0 0 0
9352 0 0 0 1 1 0 0 1 0 0
9353 0 0 0 1 1 0 0 1 1 0
9354 0 0 0 1 1 1 0 0 1 0];
9355 assert (bwareaopen (in, 4, [1 1 0; 1 1 1; 0 1 1]), logical (out))
9356 ***** error bwareaopen ("not an image", 78, 8)
9357 ***** error bwareaopen (rand (10) > 0.5, 10, 100)
9358 ***** error bwareaopen (rand (10) > 0.5, 10, "maximal")
9359 ***** error bwareaopen (rand (10) > 0.5, 10, [1 1 1; 0 1 1; 0 1 0])
9360 10 tests, 10 passed, 0 known failure, 0 skipped
9361 [hough_line]
9362 >>>>> /var/tmp/autopkgtest.ccVgDx/build.jQf/real-tree/src/hough_line.cc
9363 ***** test
9364 I = zeros(100, 100);
9365 I(1,1) = 1; I(100,100) = 1; I(1,100) = 1; I(100, 1) = 1; I(50,50) = 1;
9366 [J, R] = houghtf(I); J = J / max(J(:));
9367 assert(size(J) == [length(R) 181]);
9368
9369 ***** demo
9370 I = zeros(100, 150);
9371 I(30,:) = 1; I(:, 65) = 1; I(35:45, 35:50) = 1;
9372 for i = 1:90, I(i,i) = 1;endfor
9373 I = imnoise(I, 'salt & pepper');
9374 imshow(I);
9375 J = houghtf(I); J = J / max(J(:));
9376 imshow(J, bone(128), 'truesize');
9377 1 test, 1 passed, 0 known failure, 0 skipped
9378 [__spatial_filtering__]
9379 >>>>> /var/tmp/autopkgtest.ccVgDx/build.jQf/real-tree/src/__spatial_filtering__.cc
9380 ***** shared a, domain, s, out
9381 a = [ 82 2 97 43 79 43 41 65 51 11
9382 60 65 21 56 94 77 36 38 75 39
9383 32 68 78 1 16 75 76 90 81 56
9384 43 90 82 41 36 1 87 19 18 63
9385 63 64 2 48 18 43 38 25 22 99
9386 12 46 90 79 3 92 39 79 10 22
9387 38 98 11 10 40 90 88 38 4 76
9388 54 37 9 4 33 98 36 47 53 57
9389 38 76 82 50 14 74 64 99 7 33
9390 88 96 41 62 84 89 97 23 41 3];
9391
9392 domain = ones (3);
9393 s = zeros (3);
9394
9395 out = [ 2 1 1 1 16 36 36 11
9396 21 1 1 1 1 1 18 18
9397 2 1 1 1 1 1 18 18
9398 2 2 2 1 1 1 10 10
9399 2 2 2 3 3 25 4 4
9400 9 4 3 3 3 36 4 4
9401 9 4 4 4 14 36 4 4
9402 9 4 4 4 14 23 7 3];
9403 ***** assert (__spatial_filtering__ (a, domain, "min", s), out);
9404 ***** assert (__spatial_filtering__ (a, domain, "ordered", s, 1), out);
9405
9406 out = [ 97 97 97 94 94 90 90 90
9407 90 90 94 94 94 90 90 90
9408 90 90 82 75 87 90 90 99
9409 90 90 90 92 92 92 87 99
9410 98 98 90 92 92 92 88 99
9411 98 98 90 98 98 98 88 79
9412 98 98 82 98 98 99 99 99
9413 96 96 84 98 98 99 99 99];
9414 ***** assert (__spatial_filtering__ (a, domain, "max", s), out);
9415 ***** assert (__spatial_filtering__ (a, domain, "ordered", s, nnz (domain)), out);
9416
9417 out = [ 60 43 43 43 43 43 51 51
9418 60 56 36 36 36 38 38 39
9419 63 48 18 18 36 38 25 25
9420 46 48 36 36 36 38 22 22
9421 38 46 11 40 39 39 25 22
9422 37 11 10 33 39 47 38 38
9423 38 11 11 33 40 64 38 38
9424 41 41 33 50 64 64 41 33];
9425 ***** assert (__spatial_filtering__ (a, domain, "ordered", s, 4), out);
9426
9427 out = [ 31.223 33.788 35.561 31.011 26.096 20.630 20.403 24.712
9428 23.428 29.613 32.376 34.002 33.593 32.470 29.605 26.333
9429 27.834 32.890 29.903 24.207 30.083 32.497 31.898 32.600
9430 32.027 28.995 33.530 31.002 32.241 32.004 27.501 32.070
9431 34.682 36.030 33.046 33.745 32.509 27.352 28.607 34.180
9432 32.709 37.690 32.992 40.036 34.456 26.656 27.685 26.863
9433 30.971 36.227 25.775 34.873 29.917 25.269 32.292 30.410
9434 29.135 31.626 30.056 33.594 30.814 28.853 30.917 29.120];
9435 ***** assert (__spatial_filtering__ (a, domain, "std", s), out, 0.001);
9436
9437 out = [ 95 96 96 93 78 54 54 79
9438 69 89 93 93 93 89 72 72
9439 88 89 81 74 86 89 72 81
9440 88 88 88 91 91 91 77 89
9441 96 96 88 89 89 67 84 95
9442 89 94 87 95 95 62 84 75
9443 89 94 78 94 84 63 95 95
9444 87 92 80 94 84 76 92 96];
9445 ***** assert (__spatial_filtering__ (a, domain, "range", s), out);
9446
9447 domain = [ 1 1 0
9448 0 1 1
9449 0 1 0];
9450
9451 out = [ 2 2 1 16 36 36 38 39
9452 60 1 1 16 1 36 19 18
9453 32 2 1 1 1 19 18 18
9454 2 2 18 3 1 1 19 10
9455 46 2 2 3 18 38 10 4
9456 11 9 4 3 3 36 4 4
9457 9 4 4 10 36 36 38 4
9458 37 9 4 4 33 36 7 7];
9459 ***** assert (__spatial_filtering__ (a, domain, "min", s), out);
9460 ***** assert (__spatial_filtering__ (a, domain, "ordered", s, 1), out);
9461
9462 out = [ 82 97 97 94 79 76 90 81
9463 90 82 56 94 94 90 90 81
9464 90 82 78 36 87 87 90 90
9465 90 90 82 43 92 87 87 99
9466 98 90 79 92 92 88 79 25
9467 98 90 90 90 98 92 79 79
9468 98 98 50 98 98 90 99 57
9469 96 82 62 84 98 99 99 53];
9470 ***** assert (__spatial_filtering__ (a, domain, "max", s), out);
9471 ***** assert (__spatial_filtering__ (a, domain, "ordered", s, nnz (domain)), out);
9472
9473 out = [ 68 78 94 79 77 43 75 75
9474 78 78 41 75 77 87 81 75
9475 82 78 48 18 75 76 76 81
9476 64 90 79 41 43 39 79 22
9477 90 79 48 48 90 79 38 22
9478 46 46 79 79 92 88 47 76
9479 76 82 33 40 90 88 88 53
9480 82 50 50 74 89 98 47 47];
9481 ***** assert (__spatial_filtering__ (a, domain, "ordered", s, 4), out);
9482
9483 out = [ 34.2389 39.2772 39.6699 31.6812 20.7364 16.5439 22.2419 17.2395
9484 11.9248 36.3084 21.6217 30.8350 36.4047 21.6726 30.9144 26.1017
9485 22.2980 33.2746 27.5808 14.5017 36.8890 29.0259 34.6020 33.2521
9486 32.2490 37.9579 26.9685 17.1959 32.5346 31.3847 33.5976 36.8280
9487 21.3354 40.1833 34.0044 33.9882 32.9894 24.1102 25.6613 9.0995
9488 35.4641 35.3794 39.0871 35.4753 39.9775 28.7193 26.7451 35.6553
9489 35.2179 45.3398 19.3210 35.2987 28.4042 24.0832 26.8421 25.0539
9490 23.4307 26.2812 26.3287 35.6959 25.2646 28.1016 34.9829 17.9221];
9491 ***** assert (__spatial_filtering__ (a, domain, "std", s), out, 0.001);
9492
9493 out = [ 80 95 96 78 43 40 52 42
9494 30 81 55 78 93 54 71 63
9495 58 80 77 35 86 68 72 72
9496 88 88 64 40 91 86 68 89
9497 52 88 77 89 74 50 69 21
9498 87 81 86 87 95 56 75 75
9499 89 94 46 88 62 54 61 53
9500 59 73 58 80 65 63 92 46];
9501 ***** assert (__spatial_filtering__ (a, domain, "range", s), out);
9502
9503 s = [ 1 -3 4
9504 6 -7 2
9505 -1 3 -5];
9506
9507 out = [ -1 3 4 19 38 29 31 41
9508 61 3 -6 9 4 33 22 21
9509 33 5 -2 2 -6 21 12 11
9510 4 -5 20 6 -2 2 16 13
9511 39 -1 3 -4 19 32 12 3
9512 13 4 3 0 4 36 6 -3
9513 11 2 -3 11 38 29 35 1
9514 34 6 1 5 34 33 9 0];
9515 ***** assert (__spatial_filtering__ (a, domain, "min", s), out);
9516 ***** assert (__spatial_filtering__ (a, domain, "ordered", s, 1), out);
9517
9518 out = [ 83 94 98 87 80 79 93 84
9519 93 85 53 91 95 92 83 74
9520 84 75 79 29 89 80 87 91
9521 87 93 83 45 95 84 88 101
9522 101 83 72 94 93 91 72 26
9523 91 87 91 92 101 93 76 80
9524 95 99 53 100 91 91 102 59
9525 99 75 65 87 95 101 92 50];
9526 ***** assert (__spatial_filtering__ (a, domain, "max", s), out);
9527 ***** assert (__spatial_filtering__ (a, domain, "ordered", s, nnz (domain)), out);
9528
9529 out = [ 71 81 96 79 78 44 77 68
9530 80 71 44 77 78 90 83 72
9531 83 75 51 21 72 76 77 78
9532 57 91 82 42 40 42 82 20
9533 92 81 45 49 85 81 41 24
9534 43 47 76 80 90 81 50 78
9535 79 85 35 37 87 85 89 46
9536 84 52 43 76 92 100 44 48];
9537 ***** assert (__spatial_filtering__ (a, domain, "ordered", s, 4), out);
9538
9539 out = [ 34.903 40.206 39.885 28.627 20.620 19.248 25.209 17.111
9540 14.536 35.865 23.221 32.230 34.903 23.923 28.879 22.621
9541 20.635 30.113 29.351 11.610 38.863 25.936 34.608 34.482
9542 29.811 40.998 28.279 17.897 34.666 29.978 36.150 38.213
9543 25.066 39.240 30.013 37.300 31.856 27.428 22.884 10.281
9544 31.890 34.761 39.645 37.526 39.336 27.031 25.648 39.285
9545 35.017 47.776 22.764 35.912 25.460 25.636 29.861 24.566
9546 25.213 25.000 26.391 38.451 24.631 31.305 31.118 20.611];
9547 ***** assert (__spatial_filtering__ (a, domain, "std", s), out, 0.001);
9548
9549 out = [ 84 91 94 68 42 50 62 43
9550 32 82 59 82 91 59 61 53
9551 51 70 81 27 95 59 75 80
9552 83 98 63 39 97 82 72 88
9553 62 84 69 98 74 59 60 23
9554 78 83 88 92 97 57 70 83
9555 84 97 56 89 53 62 67 58
9556 65 69 64 82 61 68 83 50];
9557 ***** assert (__spatial_filtering__ (a, domain, "range", s), out);
9558 21 tests, 21 passed, 0 known failure, 0 skipped
9559 [bwdist]
9560 >>>>> /var/tmp/autopkgtest.ccVgDx/build.jQf/real-tree/src/bwdist.cc
9561 ***** shared bw
9562
9563 bw = [0 1 0 1 0 1 1 0
9564 0 0 0 1 1 0 0 0
9565 0 0 0 1 1 0 0 0
9566 0 0 0 1 1 0 0 0
9567 0 0 1 1 1 1 1 1
9568 1 1 1 1 0 0 0 1
9569 1 1 1 0 0 0 1 0
9570 0 0 1 0 0 0 1 1];
9571 ***** test
9572 out = [ 1.00000 0.00000 1.00000 0.00000 1.00000 0.00000 0.00000 1.00000
9573 1.41421 1.00000 1.00000 0.00000 0.00000 1.00000 1.00000 1.41421
9574 2.23607 2.00000 1.00000 0.00000 0.00000 1.00000 2.00000 2.00000
9575 2.00000 1.41421 1.00000 0.00000 0.00000 1.00000 1.00000 1.00000
9576 1.00000 1.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000
9577 0.00000 0.00000 0.00000 0.00000 1.00000 1.00000 1.00000 0.00000
9578 0.00000 0.00000 0.00000 1.00000 1.41421 1.00000 0.00000 1.00000
9579 1.00000 1.00000 0.00000 1.00000 2.00000 1.00000 0.00000 0.00000];
9580 out = single (out);
9581
9582 assert (bwdist (bw), out, 0.0001); # default is euclidean
9583 assert (bwdist (bw, "euclidean"), out, 0.0001);
9584 assert (bwdist (logical (bw), "euclidean"), out, 0.0001);
9585 ***** test
9586 out = [ 1 0 1 0 1 0 0 1
9587 1 1 1 0 0 1 1 1
9588 2 2 1 0 0 1 2 2
9589 2 1 1 0 0 1 1 1
9590 1 1 0 0 0 0 0 0
9591 0 0 0 0 1 1 1 0
9592 0 0 0 1 1 1 0 1
9593 1 1 0 1 2 1 0 0];
9594 out = single (out);
9595
9596 assert (bwdist (bw, "chessboard"), out);
9597 ***** test
9598 out = [ 1 0 1 0 1 0 0 1
9599 2 1 1 0 0 1 1 2
9600 3 2 1 0 0 1 2 2
9601 2 2 1 0 0 1 1 1
9602 1 1 0 0 0 0 0 0
9603 0 0 0 0 1 1 1 0
9604 0 0 0 1 2 1 0 1
9605 1 1 0 1 2 1 0 0];
9606 out = single (out);
9607
9608 assert (bwdist (bw, "cityblock"), out);
9609 ***** test
9610 out = [ 1.00000 0.00000 1.00000 0.00000 1.00000 0.00000 0.00000 1.00000
9611 1.41421 1.00000 1.00000 0.00000 0.00000 1.00000 1.00000 1.41421
9612 2.41421 2.00000 1.00000 0.00000 0.00000 1.00000 2.00000 2.00000
9613 2.00000 1.41421 1.00000 0.00000 0.00000 1.00000 1.00000 1.00000
9614 1.00000 1.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000
9615 0.00000 0.00000 0.00000 0.00000 1.00000 1.00000 1.00000 0.00000
9616 0.00000 0.00000 0.00000 1.00000 1.41421 1.00000 0.00000 1.00000
9617 1.00000 1.00000 0.00000 1.00000 2.00000 1.00000 0.00000 0.00000];
9618 out = single (out);
9619
9620 assert (bwdist (bw, "quasi-euclidean"), out, 0.0001);
9621
9622 bw(logical (bw)) = 3; # there is no actual check if matrix is binary or 0 and 1
9623 assert (bwdist (bw, "quasi-euclidean"), out, 0.0001);
9624
9625 bw(logical (bw)) = -2; # anything non-zero is considered object
9626 assert (bwdist (bw, "quasi-euclidean"), out, 0.0001);
9627 ***** test
9628 bw = [ 1 1 1 1 0 1 1 1 1
9629 1 1 1 1 0 1 1 1 1
9630 1 1 0 1 1 1 1 1 1
9631 0 1 1 1 1 1 1 1 1];
9632
9633 dist = [ 0 0 0 0 1 0 0 0 0
9634 0 0 0 0 1 0 0 0 0
9635 0 0 1 0 0 0 0 0 0
9636 1 0 0 0 0 0 0 0 0];
9637 dist = single (dist);
9638
9639 c = [ 1 5 9 13 13 21 25 29 33
9640 2 6 10 14 14 22 26 30 34
9641 3 7 10 15 19 23 27 31 35
9642 8 8 12 16 20 24 28 32 36];
9643 c = uint32 (c);
9644
9645 [dout, cout] = bwdist (bw, "euclidean");
9646 assert (dout, dist)
9647 assert (cout, c)
9648 ***** test
9649 bw = [ 0 1 1 0 0 0 1 0
9650 0 0 0 0 0 0 0 0
9651 1 1 0 0 0 0 0 0
9652 0 0 0 0 0 0 1 0
9653 0 0 0 0 1 0 0 1
9654 0 0 0 0 0 0 0 0
9655 1 0 0 0 0 0 0 0
9656 0 0 1 0 0 1 1 0];
9657 out = single ([
9658 1.00000 0.00000 0.00000 1.00000 2.00000 1.00000 0.00000 1.00000
9659 1.00000 1.00000 1.00000 sqrt(2) sqrt(2)+1 sqrt(2) 1.00000 sqrt(2)
9660 0.00000 0.00000 1.00000 2.00000 2.00000 sqrt(2) 1.00000 sqrt(2)
9661 1.00000 1.00000 sqrt(2) sqrt(2) 1.00000 1.00000 0.00000 1.00000
9662 2.00000 2.00000 2.00000 1.00000 0.00000 1.00000 1.00000 0.00000
9663 1.00000 sqrt(2) 2.00000 sqrt(2) 1.00000 sqrt(2) sqrt(2) 1.00000
9664 0.00000 1.00000 1.00000 sqrt(2) sqrt(2) 1.00000 1.00000 sqrt(2)
9665 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 0.00000 1.00000
9666 ]);
9667 assert (bwdist (bw, "quasi-euclidean"), out);
9668 ***** error <unknown METHOD> bwdist (bw, "not a valid method");
9669 7 tests, 7 passed, 0 known failure, 0 skipped
9670 [bwlabeln]
9671 >>>>> /var/tmp/autopkgtest.ccVgDx/build.jQf/real-tree/src/bwlabeln.cc
9672 ***** shared a2d, a3d
9673 a2d = [1 0 0 0 0 0 1 0 0 1
9674 1 0 0 1 0 1 0 1 0 1
9675 1 0 1 0 0 0 0 0 0 0
9676 0 0 0 0 0 0 0 0 0 0
9677 0 1 0 0 0 0 0 0 0 0
9678 1 1 0 1 1 1 0 0 0 0
9679 1 1 0 1 0 0 0 1 0 0
9680 1 1 0 0 0 0 1 0 1 0
9681 1 1 0 0 0 0 0 0 0 0
9682 1 1 0 0 0 1 1 0 0 1];
9683
9684 a3d = a2d;
9685 a3d(:,:,2) = [
9686 0 0 0 0 0 0 0 0 0 0
9687 1 0 0 1 1 0 0 1 0 0
9688 0 0 0 1 0 0 0 0 0 0
9689 0 0 0 0 0 0 0 0 0 0
9690 0 1 0 0 0 0 0 0 0 0
9691 1 1 0 0 1 1 0 0 0 0
9692 1 1 0 1 0 0 0 0 0 0
9693 1 0 0 0 0 0 1 0 0 0
9694 0 1 0 0 0 0 0 0 0 1
9695 1 1 0 0 0 0 1 0 0 0];
9696
9697 a3d(:,:,3) = [
9698 1 0 0 0 0 0 0 0 0 0
9699 0 1 0 1 1 0 0 1 0 0
9700 0 0 0 1 0 0 0 0 0 0
9701 0 0 0 0 0 0 0 0 0 0
9702 0 0 0 0 0 0 0 0 0 0
9703 0 0 0 1 1 1 0 0 0 0
9704 0 0 0 0 0 0 0 0 0 0
9705 1 0 0 0 0 0 0 0 0 0
9706 1 1 0 0 0 0 0 0 0 1
9707 1 1 0 0 0 0 0 0 0 0];
9708 ***** test
9709 label2dc4 = [
9710 1 0 0 0 0 0 8 0 0 13
9711 1 0 0 4 0 6 0 10 0 13
9712 1 0 3 0 0 0 0 0 0 0
9713 0 0 0 0 0 0 0 0 0 0
9714 0 2 0 0 0 0 0 0 0 0
9715 2 2 0 5 5 5 0 0 0 0
9716 2 2 0 5 0 0 0 11 0 0
9717 2 2 0 0 0 0 9 0 12 0
9718 2 2 0 0 0 0 0 0 0 0
9719 2 2 0 0 0 7 7 0 0 14];
9720 assert (bwlabeln (a2d, 4), label2dc4)
9721 assert (bwlabeln (a2d, [0 1 0; 1 1 1; 0 1 0]), label2dc4)
9722 assert (bwlabeln (a2d, conndef (2, "minimal")), label2dc4)
9723 assert (bwlabeln (a2d, conndef (3, "minimal")), label2dc4)
9724 ***** test
9725 label2dc8 = [
9726 1 0 0 0 0 0 5 0 0 8
9727 1 0 0 3 0 5 0 5 0 8
9728 1 0 3 0 0 0 0 0 0 0
9729 0 0 0 0 0 0 0 0 0 0
9730 0 2 0 0 0 0 0 0 0 0
9731 2 2 0 4 4 4 0 0 0 0
9732 2 2 0 4 0 0 0 7 0 0
9733 2 2 0 0 0 0 7 0 7 0
9734 2 2 0 0 0 0 0 0 0 0
9735 2 2 0 0 0 6 6 0 0 9];
9736 assert (bwlabeln (a2d, 8), label2dc8)
9737 assert (bwlabeln (a2d, ones (3)), label2dc8)
9738 assert (bwlabeln (a2d, conndef (2, "maximal")), label2dc8)
9739 assert (bwlabeln (a2d, conndef (3, "maximal")), label2dc8)
9740 ***** test
9741 label3dc8 = [
9742 1 0 0 0 0 0 5 0 0 8
9743 1 0 0 3 0 5 0 5 0 8
9744 1 0 3 0 0 0 0 0 0 0
9745 0 0 0 0 0 0 0 0 0 0
9746 0 2 0 0 0 0 0 0 0 0
9747 2 2 0 4 4 4 0 0 0 0
9748 2 2 0 4 0 0 0 7 0 0
9749 2 2 0 0 0 0 7 0 7 0
9750 2 2 0 0 0 0 0 0 0 0
9751 2 2 0 0 0 6 6 0 0 9];
9752 label3dc8(:,:,2) = [
9753 0 0 0 0 0 0 0 0 0 0
9754 10 0 0 12 12 0 0 16 0 0
9755 0 0 0 12 0 0 0 0 0 0
9756 0 0 0 0 0 0 0 0 0 0
9757 0 11 0 0 0 0 0 0 0 0
9758 11 11 0 0 13 13 0 0 0 0
9759 11 11 0 13 0 0 0 0 0 0
9760 11 0 0 0 0 0 14 0 0 0
9761 0 11 0 0 0 0 0 0 0 17
9762 11 11 0 0 0 0 15 0 0 0];
9763 label3dc8(:,:,3) = [
9764 18 0 0 0 0 0 0 0 0 0
9765 0 18 0 20 20 0 0 22 0 0
9766 0 0 0 20 0 0 0 0 0 0
9767 0 0 0 0 0 0 0 0 0 0
9768 0 0 0 0 0 0 0 0 0 0
9769 0 0 0 21 21 21 0 0 0 0
9770 0 0 0 0 0 0 0 0 0 0
9771 19 0 0 0 0 0 0 0 0 0
9772 19 19 0 0 0 0 0 0 0 23
9773 19 19 0 0 0 0 0 0 0 0];
9774 assert (bwlabeln (a3d, 8), label3dc8)
9775 assert (bwlabeln (a3d, ones (3, 3)), label3dc8)
9776 assert (bwlabeln (a3d, conndef (2, "maximal")), label3dc8)
9777 ***** test
9778 label3dc26 = [
9779 1 0 0 0 0 0 3 0 0 7
9780 1 0 0 3 0 3 0 3 0 7
9781 1 0 3 0 0 0 0 0 0 0
9782 0 0 0 0 0 0 0 0 0 0
9783 0 2 0 0 0 0 0 0 0 0
9784 2 2 0 4 4 4 0 0 0 0
9785 2 2 0 4 0 0 0 6 0 0
9786 2 2 0 0 0 0 6 0 6 0
9787 2 2 0 0 0 0 0 0 0 0
9788 2 2 0 0 0 5 5 0 0 6];
9789 label3dc26(:,:,2) = [
9790 0 0 0 0 0 0 0 0 0 0
9791 1 0 0 3 3 0 0 3 0 0
9792 0 0 0 3 0 0 0 0 0 0
9793 0 0 0 0 0 0 0 0 0 0
9794 0 2 0 0 0 0 0 0 0 0
9795 2 2 0 0 4 4 0 0 0 0
9796 2 2 0 4 0 0 0 0 0 0
9797 2 0 0 0 0 0 6 0 0 0
9798 0 2 0 0 0 0 0 0 0 6
9799 2 2 0 0 0 0 5 0 0 0];
9800 label3dc26(:,:,3) = [
9801 1 0 0 0 0 0 0 0 0 0
9802 0 1 0 3 3 0 0 3 0 0
9803 0 0 0 3 0 0 0 0 0 0
9804 0 0 0 0 0 0 0 0 0 0
9805 0 0 0 0 0 0 0 0 0 0
9806 0 0 0 4 4 4 0 0 0 0
9807 0 0 0 0 0 0 0 0 0 0
9808 2 0 0 0 0 0 0 0 0 0
9809 2 2 0 0 0 0 0 0 0 6
9810 2 2 0 0 0 0 0 0 0 0];
9811 assert (bwlabeln (a3d, 26), label3dc26)
9812 assert (bwlabeln (a3d, ones (3, 3, 3)), label3dc26)
9813 assert (bwlabeln (a3d, conndef (3, "maximal")), label3dc26)
9814 ***** test
9815 label3dc18 = [
9816 1 0 0 0 0 0 3 0 0 7
9817 1 0 0 3 0 3 0 3 0 7
9818 1 0 3 0 0 0 0 0 0 0
9819 0 0 0 0 0 0 0 0 0 0
9820 0 2 0 0 0 0 0 0 0 0
9821 2 2 0 4 4 4 0 0 0 0
9822 2 2 0 4 0 0 0 6 0 0
9823 2 2 0 0 0 0 6 0 6 0
9824 2 2 0 0 0 0 0 0 0 0
9825 2 2 0 0 0 5 5 0 0 8];
9826 label3dc18(:,:,2) = [
9827 0 0 0 0 0 0 0 0 0 0
9828 1 0 0 3 3 0 0 3 0 0
9829 0 0 0 3 0 0 0 0 0 0
9830 0 0 0 0 0 0 0 0 0 0
9831 0 2 0 0 0 0 0 0 0 0
9832 2 2 0 0 4 4 0 0 0 0
9833 2 2 0 4 0 0 0 0 0 0
9834 2 0 0 0 0 0 6 0 0 0
9835 0 2 0 0 0 0 0 0 0 8
9836 2 2 0 0 0 0 5 0 0 0];
9837 label3dc18(:,:,3) = [
9838 1 0 0 0 0 0 0 0 0 0
9839 0 1 0 3 3 0 0 3 0 0
9840 0 0 0 3 0 0 0 0 0 0
9841 0 0 0 0 0 0 0 0 0 0
9842 0 0 0 0 0 0 0 0 0 0
9843 0 0 0 4 4 4 0 0 0 0
9844 0 0 0 0 0 0 0 0 0 0
9845 2 0 0 0 0 0 0 0 0 0
9846 2 2 0 0 0 0 0 0 0 8
9847 2 2 0 0 0 0 0 0 0 0];
9848 assert (bwlabeln (a3d, 18), label3dc18)
9849 ***** test
9850 label2dc3 = [
9851 1 0 0 0 0 0 11 0 0 17
9852 1 0 0 5 0 8 0 14 0 17
9853 1 0 4 0 0 0 0 0 0 0
9854 0 0 0 0 0 0 0 0 0 0
9855 0 3 0 0 0 0 0 0 0 0
9856 2 3 0 6 7 9 0 0 0 0
9857 2 3 0 6 0 0 0 15 0 0
9858 2 3 0 0 0 0 12 0 16 0
9859 2 3 0 0 0 0 0 0 0 0
9860 2 3 0 0 0 10 13 0 0 18];
9861 assert (bwlabeln (a2d, [1 1 1]'), label2dc3)
9862
9863 label3dc3 = label2dc3;
9864 label3dc3(:,:,2) = [
9865 0 0 0 0 0 0 0 0 0 0
9866 19 0 0 24 26 0 0 31 0 0
9867 0 0 0 24 0 0 0 0 0 0
9868 0 0 0 0 0 0 0 0 0 0
9869 0 22 0 0 0 0 0 0 0 0
9870 20 22 0 0 27 28 0 0 0 0
9871 20 22 0 25 0 0 0 0 0 0
9872 20 0 0 0 0 0 29 0 0 0
9873 0 23 0 0 0 0 0 0 0 32
9874 21 23 0 0 0 0 30 0 0 0];
9875 label3dc3(:,:,3) = [
9876 33 0 0 0 0 0 0 0 0 0
9877 0 35 0 37 39 0 0 42 0 0
9878 0 0 0 37 0 0 0 0 0 0
9879 0 0 0 0 0 0 0 0 0 0
9880 0 0 0 0 0 0 0 0 0 0
9881 0 0 0 38 40 41 0 0 0 0
9882 0 0 0 0 0 0 0 0 0 0
9883 34 0 0 0 0 0 0 0 0 0
9884 34 36 0 0 0 0 0 0 0 43
9885 34 36 0 0 0 0 0 0 0 0];
9886 assert (bwlabeln (a3d, [1 1 1]'), label3dc3)
9887 ***** test
9888 label2dc1 = zeros (size (a2d));
9889 label2dc1(a2d != 0) = 1:nnz (a2d);
9890 assert (bwlabeln (a2d, [1]), label2dc1);
9891 assert (bwlabeln (a2d, [0 1 0]'), label2dc1);
9892
9893 label3dc1 = zeros (size (a3d));
9894 label3dc1(a3d != 0) = 1:nnz (a3d);
9895 assert (bwlabeln (a3d, [1]), label3dc1);
9896 assert (bwlabeln (a3d, [0 1 0]'), label3dc1);
9897 ***** shared in
9898 in = rand (10) > 0.8;
9899 ***** assert (bwlabel (in, 4), bwlabeln (in, 4));
9900 ***** assert (bwlabel (in, 4), bwlabeln (in, [0 1 0; 1 1 1; 0 1 0]));
9901 ***** assert (bwlabel (in, 8), bwlabeln (in, 8));
9902 ***** assert (bwlabel (in, 8), bwlabeln (in, [1 1 1; 1 1 1; 1 1 1]));
9903 ***** assert (bwlabel (logical ([0 1 0; 0 0 0; 1 0 1])), [0 2 0; 0 0 0; 1 0 3]);
9904 ***** assert (bwlabel ([0 1 0; 0 0 0; 1 0 1]), [0 2 0; 0 0 0; 1 0 3]);
9905 ***** assert (bwlabel ([0 -1 0; 0 0 0; 5 0 0.2]), [0 2 0; 0 0 0; 1 0 3]);
9906 ***** shared in, out
9907
9908 in = [ 0 1 1 0 0 1 0 0 0 0
9909 0 0 0 1 0 0 0 0 0 1
9910 0 1 1 0 0 0 0 0 1 1
9911 1 0 0 0 0 0 0 1 0 0
9912 0 0 0 0 0 1 1 0 0 0
9913 0 0 0 0 0 0 0 0 0 0
9914 0 0 0 1 0 0 0 0 0 0
9915 0 0 0 0 1 1 0 1 0 0
9916 0 0 0 1 0 1 0 1 0 1
9917 1 1 0 0 0 0 0 1 1 0];
9918
9919 out = [ 0 3 3 0 0 9 0 0 0 0
9920 0 0 0 5 0 0 0 0 0 13
9921 0 4 4 0 0 0 0 0 13 13
9922 1 0 0 0 0 0 0 11 0 0
9923 0 0 0 0 0 10 10 0 0 0
9924 0 0 0 0 0 0 0 0 0 0
9925 0 0 0 6 0 0 0 0 0 0
9926 0 0 0 0 8 8 0 12 0 0
9927 0 0 0 7 0 8 0 12 0 14
9928 2 2 0 0 0 0 0 12 12 0];
9929 ***** assert (nthargout ([1 2], @bwlabel, in, 4), {out, 14});
9930 ***** assert (nthargout ([1 2], @bwlabel, logical (in), 4), {out, 14});
9931
9932 out = [ 0 3 3 0 0 7 0 0 0 0
9933 0 0 0 3 0 0 0 0 0 11
9934 0 4 4 0 0 0 0 0 11 11
9935 1 0 0 0 0 0 0 9 0 0
9936 0 0 0 0 0 8 8 0 0 0
9937 0 0 0 0 0 0 0 0 0 0
9938 0 0 0 5 0 0 0 0 0 0
9939 0 0 0 0 5 5 0 10 0 0
9940 0 0 0 6 0 5 0 10 0 12
9941 2 2 0 0 0 0 0 10 10 0];
9942 ***** assert (nthargout ([1 2], @bwlabel, in, 6), {out, 12});
9943 ***** assert (nthargout ([1 2], @bwlabel, logical (in), 6), {out, 12});
9944
9945 ## The labeled image is not the same as Matlab, but they are
9946 ## labeled correctly. Do we really need to get them properly
9947 ## ordered? (the algorithm in bwlabeln does it)
9948 mout = [0 1 1 0 0 4 0 0 0 0
9949 0 0 0 1 0 0 0 0 0 5
9950 0 1 1 0 0 0 0 0 5 5
9951 1 0 0 0 0 0 0 5 0 0
9952 0 0 0 0 0 5 5 0 0 0
9953 0 0 0 0 0 0 0 0 0 0
9954 0 0 0 3 0 0 0 0 0 0
9955 0 0 0 0 3 3 0 6 0 0
9956 0 0 0 3 0 3 0 6 0 6
9957 2 2 0 0 0 0 0 6 6 0];
9958
9959 out = [ 0 2 2 0 0 4 0 0 0 0
9960 0 0 0 2 0 0 0 0 0 5
9961 0 2 2 0 0 0 0 0 5 5
9962 2 0 0 0 0 0 0 5 0 0
9963 0 0 0 0 0 5 5 0 0 0
9964 0 0 0 0 0 0 0 0 0 0
9965 0 0 0 3 0 0 0 0 0 0
9966 0 0 0 0 3 3 0 6 0 0
9967 0 0 0 3 0 3 0 6 0 6
9968 1 1 0 0 0 0 0 6 6 0];
9969 ***** assert (nthargout ([1 2], @bwlabel, in, 8), {out, 6});
9970 ***** assert (nthargout ([1 2], @bwlabel, logical (in), 8), {out, 6});
9971
9972 ***** error bwlabel (rand (10, 10, 10) > 0.8, 4)
9973 ***** error bwlabel (rand (10) > 0.8, "text")
9974 ***** error bwlabel ("text", 6)
9975 23 tests, 23 passed, 0 known failure, 0 skipped
9976 [conndef]
9977 >>>>> /var/tmp/autopkgtest.ccVgDx/build.jQf/real-tree/src/conndef.cc
9978 ***** assert (conndef (1, "minimal"), [1; 1; 1]);
9979 ***** assert (conndef (2, "minimal"), [0 1 0; 1 1 1; 0 1 0]);
9980 ***** test
9981 C = zeros (3, 3, 3);
9982 C(:,2,2) = 1;
9983 C(2,:,2) = 1;
9984 C(2,2,:) = 1;
9985 assert (conndef (3, "minimal"), C);
9986 ***** test
9987 C = zeros (3, 3, 3, 3);
9988 C(:,:,2,1) = [0 0 0
9989 0 1 0
9990 0 0 0];
9991 C(:,:,1,2) = [0 0 0
9992 0 1 0
9993 0 0 0];
9994 C(:,:,2,2) = [0 1 0
9995 1 1 1
9996 0 1 0];
9997 C(:,:,3,2) = [0 0 0
9998 0 1 0
9999 0 0 0];
10000 C(:,:,2,3) = [0 0 0
10001 0 1 0
10002 0 0 0];
10003 assert (conndef (4, "minimal"), C);
10004 ***** assert (conndef (1, "maximal"), ones (3, 1));
10005 ***** assert (conndef (2, "maximal"), ones (3, 3));
10006 ***** assert (conndef (3, "maximal"), ones (3, 3, 3));
10007 ***** assert (conndef (4, "maximal"), ones (3, 3, 3, 3));
10008 ***** assert (nnz (conndef (3, "minimal")), 7)
10009 ***** assert (nnz (conndef (4, "minimal")), 9)
10010 ***** assert (nnz (conndef (5, "minimal")), 11)
10011 ***** assert (nnz (conndef (6, "minimal")), 13)
10012 ***** assert (find (conndef (3, "minimal")), [5 11 13 14 15 17 23](:))
10013 ***** assert (find (conndef (4, "minimal")), [14 32 38 40 41 42 44 50 68](:))
10014 ***** assert (find (conndef (5, "minimal")),
10015 [ 41 95 113 119 121 122 123 125 131 149 203](:))
10016 ***** assert (find (conndef (6, "minimal")),
10017 [ 122 284 338 356 362 364 365 366 368 374 392 446 608](:))
10018 ***** error conndef ()
10019 ***** error <must be a positive integer> conndef (-2, "minimal")
10020 ***** error conndef (char (2), "minimal")
10021 ***** error conndef ("minimal", 3)
10022 ***** error <TYPE must be "maximal" or "minimal"> conndef (3, "invalid")
10023 ***** error <CONN must be logical or in the set> conndef (10)
10024 ***** assert (conndef (2, "minimal"), conndef (4))
10025 ***** assert (conndef (2, "maximal"), conndef (8))
10026 ***** assert (conndef (3, "minimal"), conndef (6))
10027 ***** assert (conndef (3, "maximal"), conndef (26))
10028 ***** assert (conndef (18), reshape ([0 1 0 1 1 1 0 1 0
10029 1 1 1 1 1 1 1 1 1
10030 0 1 0 1 1 1 0 1 0], [3 3 3]))
10031 ***** error <expected error> fail ("iptcheckconn ( 4, 'func', 'var')");
10032 ***** error <expected error> fail ("iptcheckconn ( 6, 'func', 'var')");
10033 ***** error <expected error> fail ("iptcheckconn ( 8, 'func', 'var')");
10034 ***** error <expected error> fail ("iptcheckconn (18, 'func', 'var')");
10035 ***** error <expected error> fail ("iptcheckconn (26, 'func', 'var')");
10036 ***** error <expected error> fail ("iptcheckconn (1, 'func', 'var')");
10037 ***** error <expected error> fail ("iptcheckconn (ones (3, 1), 'func', 'var')");
10038 ***** error <expected error> fail ("iptcheckconn (ones (3, 3), 'func', 'var')");
10039 ***** error <expected error> fail ("iptcheckconn (ones (3, 3, 3), 'func', 'var')");
10040 ***** error <expected error> fail ("iptcheckconn (ones (3, 3, 3, 3), 'func', 'var')");
10041 ***** error <VAR must be logical or in> iptcheckconn (3, "func", "VAR");
10042 ***** error <VAR center is not true> iptcheckconn ([1 1 1; 1 0 1; 1 1 1], "func", "VAR");
10043 ***** error <VAR must be logical or in> iptcheckconn ([1 2 1; 1 1 1; 1 1 1], "func", "VAR");
10044 ***** error <VAR is not symmetric relative to its center> iptcheckconn ([0 1 1; 1 1 1; 1 1 1], "func", "VAR");
10045 ***** error <VAR is not 1x1, 3x1, 3x3, or 3x3x...x3> iptcheckconn (ones (3, 3, 3, 4), "func", "VAR");
10046 42 tests, 42 passed, 0 known failure, 0 skipped
10047 Summary: 1169 tests, 1134 passed, 21 known failures, 0 skipped
10048 /usr/share/cdbs/1/class/octave-pkg.mk:108: recipe for target 'check-pkg' failed
10049 make: *** [check-pkg] Error 1
10050 autopkgtest [11:06:09]: test unit-tests: -----------------------]
10051 autopkgtest [11:06:09]: test unit-tests: - - - - - - - - - - results - - - - - - - - - -
10052 unit-tests FAIL non-zero exit status 2
10053 autopkgtest [11:06:09]: @@@@@@@@@@@@@@@@@@@@ summary
10054 unit-tests FAIL non-zero exit status 2
Attached Files
To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.You are not allowed to attach a file to this page.
