[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [Pkg-octave-devel] First try on autopkgtest for OF packages



* Oliver Heimlich <oheim@posteo.de> [2017-08-30 09:09]:

On 29.08.2017 10:45, Rafael Laboissière wrote:
* Sébastien Villemot <sebastien@debian.org> [2017-08-29 10:28]:

I am also wondering if we should not make test failures fatal at build time. This would probably cause a few FTBFS in the short term, but in the longer run this would improve the quality of the packages.

Yes, absolutely. If a unit test fails, then either the functionality or the test are wrong and must be fixed.

I totally agree on that one. The interval package (where it is of particular importance that it produces correct results) has an extensive test suite and the build fails if one of the tests fails.

Ok, with my last commits on the octave-pkg-dev repository, check-pkg has now the ability to collect the results of the tests and to exit with an error code when any of the tests fails (after running all of them, of course).

With this version of octave-pkg-dev installed in the system, the following command run from the autopktest branch in the octave-image package:

autopkgtest -B . -- null

produces the log attached below.

Notice that at the end of the log file, there is the following text, showing that the autopkgtest fails:

Summary: 1169 tests, 1134 passed, 21 known failures, 0 skipped
/usr/share/cdbs/1/class/octave-pkg.mk:108: recipe for target
'check-pkg' failed
make: *** [check-pkg] Error 1
autopkgtest [11:06:09]: test unit-tests: -----------------------]
autopkgtest [11:06:09]: test unit-tests:  - - - - - - - - - - results
- - - - - - - - - -
unit-tests           FAIL non-zero exit status 2
autopkgtest [11:06:09]: @@@@@@@@@@@@@@@@@@@@ summary
unit-tests           FAIL non-zero exit status 2

The code in check-pkg is kind of convoluted. Take this a proof of concept.

Comments are welcome.

Rafael
autopkgtest [11:04:11]: version 4.4
autopkgtest [11:04:11]: host dev; command line: /usr/bin/autopkgtest -B . -- null
autopkgtest [11:04:11]: testbed dpkg architecture: amd64
autopkgtest [11:04:11]: testbed running kernel: Linux 4.9.0-3-amd64 #1 SMP Debian 4.9.30-2 (2017-06-12)
autopkgtest [11:04:11]: @@@@@@@@@@@@@@@@@@@@ unbuilt-tree .
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
autopkgtest [11:04:11]: testing package octave-image version 2.6.1-2
autopkgtest [11:04:11]: build not needed
autopkgtest [11:04:11]: test unit-tests: preparing testbed
Starting pkgProblemResolver with broken count: 0
Starting 2 pkgProblemResolver with broken count: 0
Done
autopkgtest [11:04:12]: test unit-tests: [-----------------------
/usr/share/octave-pkg-dev/check-pkg
Checking package...
echo Checking m files ...
warning: function /usr/share/octave/packages/image-2.6.1/im2double.m shadows a core library function
warning: called from
    load_packages_and_dependencies at line 48 column 5
    load_packages at line 47 column 3
    pkg at line 411 column 7
    /var/tmp/file8moa2S at line 6 column 5
[stdfilt]
>>>>> /usr/share/octave/packages/image-2.6.1/stdfilt.m
***** test
 im = stdfilt (ones (5));
 assert (im, zeros (5));
1 test, 1 passed, 0 known failure, 0 skipped
[rangefilt]
>>>>> /usr/share/octave/packages/image-2.6.1/rangefilt.m
***** test
 im = rangefilt (ones (5));
 assert (im, zeros (5));
1 test, 1 passed, 0 known failure, 0 skipped
[imtransform]
>>>>> /usr/share/octave/packages/image-2.6.1/imtransform.m
***** demo
 ## Various linear transforms
 figure (); 
 im = [checkerboard(20, 2, 4); checkerboard(40, 1, 2)];
 %input space corners
 incp = [1 1; 160 1; 160 160; 1 160];
 udata = [min(incp(:,1)) max(incp(:,1))];
 vdata = [min(incp(:,2)) max(incp(:,2))];
 subplot (2,3,1); 
 imshow (im)
 hold on
 plot (incp(:,1), incp(:,2), 'ob')
 axis on
 xlabel ('Original')
 
 % Translation and scaling
 outcp = incp * 2;
 outcp(:,1) += 200; 
 outcp(:,2) += 500;
 T = maketform ('affine', incp(1:3,:), outcp(1:3,:));
 subplot (2,3,2); 
 [im2 xdata ydata] = imtransform (im, T, 'udata', udata,
                                  'vdata', vdata, 'fillvalues', 1);
 imh = imshow (im2); set (imh, 'xdata', xdata, 'ydata', ydata) 
 set (gca, 'xlim', xdata, 'ylim', ydata)
 axis on, hold on, xlabel ('Translation / Scaling');
 plot (outcp(:,1), outcp(:,2), 'or')
 
 % Shear
 outcp = [1 1; 160 1; 140 160; -19 160]; % affine only needs 3 control points
 T = maketform ('affine', incp(1:3,:), outcp(1:3,:));
 subplot (2,3,3); 
 [im2 xdata ydata] = imtransform (im, T, 'udata', udata,
                                  'vdata', vdata, 'fillvalues', 1);
 imh = imshow (im2); set (imh, 'xdata', xdata, 'ydata', ydata) 
 set (gca, 'xlim', xdata, 'ylim', ydata)
 axis on, hold on, xlabel ('Shear');
 plot (outcp(:,1), outcp(:,2), 'or')
 
 % Rotation 
 theta = pi/4;
 T = maketform ('affine', [cos(theta) -sin(theta); ...
                           sin(theta) cos(theta); 0 0]);
 outcp = tformfwd (T, incp);
 subplot (2,3,4); 
 [im2 xdata ydata] = imtransform (im, T, 'udata', udata,
                                  'vdata', vdata, 'fillvalues', 1 );
 imh = imshow (im2); set (imh, 'xdata', xdata, 'ydata', ydata) 
 set (gca, 'xlim', xdata, 'ylim', ydata)
 axis on, hold on, xlabel ('Rotation');
 plot (outcp(:,1), outcp(:,2), 'or')

 % Reflection around x axis
 outcp = incp;
 outcp(:,2) *= -1;
 T = cp2tform (incp, outcp, 'similarity');
 subplot (2,3,5); 
 [im2 xdata ydata] = imtransform (im, T, 'udata', udata,
                                  'vdata', vdata, 'fillvalues', 1 );
 imh = imshow (im2); set (imh, 'xdata', xdata, 'ydata', ydata) 
 set (gca, 'xlim', xdata, 'ylim', ydata)
 axis on, hold on, xlabel ('Reflection');
 plot (outcp(:,1), outcp(:,2), 'or')

 % Projection
 outcp = [1 1; 160 -40; 220 220; 12 140];
 T = maketform ('projective', incp, outcp);
 subplot (2,3,6); 
 [im2 xdata ydata] = imtransform (im, T, 'udata', udata,
                                  'vdata', vdata, 'fillvalues', 1 );
 imh = imshow (im2); set (imh, 'xdata', xdata, 'ydata', ydata) 
 set (gca, 'xlim', xdata, 'ylim', ydata)
 axis on, hold on, xlabel ('Projection');
 plot (outcp(:,1), outcp(:,2), 'or')
***** demo
 ## Streched image
 rad = 2; % minimum value: 4/pi
 [uu vv] = meshgrid ((-2:2)/rad, (-2:2)/rad);
 rescfactor = sin ((uu.^2 + vv.^2).^.5);
 inpts = [(reshape (uu, numel (uu), 1)), (reshape (vv, numel (uu), 1))]; 
 xx = rescfactor .* sign(uu);
 yy = rescfactor .* sign(vv);
 outpts = [reshape(xx, numel (xx), 1) reshape(yy, numel (yy), 1)];
 
 T = cp2tform (inpts, outpts, "polynomial", 4);
 figure;
 subplot (1,2,1)
 im = zeros (800, 800, 3);
 im(:,:,1) = checkerboard (100) > 0.2;
 im(:,:,3) = checkerboard (100) < 0.2;
 [im2 xdata ydata] = imtransform (im, T, 'udata', [-2 2],
                                  'vdata', [-2 2], 'fillvalues',
                                  [0 1 0]);
 imh = imshow (im2);
 set (imh, 'xdata', xdata, 'ydata', ydata)
 set (gca, 'xlim', xdata, 'ylim', ydata)
 [im cmap] = imread ('default.img');
 subplot (1,2,2)
 [im2 xdata ydata] = imtransform (im, T, 'udata', [-1 1],
                                  'vdata', [-1 1], 'fillvalues',
                                  round (length (cmap) / 2));
 imh = imshow (im2, cmap);
***** test
 im = checkerboard ();
 incp = [0 0; 0 1; 1 1];
 scl = 10;
 outcp = scl * incp;
 T = maketform ('affine', incp, outcp);
 [im2 xdata ydata] = imtransform (im, T, 'udata', [0 1],
                                  'vdata', [0 1], 'size', [500 500]);
 assert (xdata, scl * ([0 1]))
 assert (ydata, scl * ([0 1]))
 assert (size (im2), [500 500])
***** test
 im = checkerboard ();
 incp = [0 0; 0 1; 1 1];
 scl = 10;
 outcp = scl * incp;
 xyscale = scl;
 T = maketform ('affine', incp, outcp);
 [im2 xdata ydata] = imtransform (im, T, 'xyscale', xyscale);
 assert (size (im2), size (im), 1)
***** test
 im = checkerboard (100, 10, 4);
 theta = 2 * pi;
 T = maketform ("affine", [cos(theta) -sin(theta); ...
                           sin(theta) cos(theta); 0 0]);
 im2 = imtransform (im, T, "nearest", "xdata", [1 800], "ydata", [1 2000]);
 im = im(2:end-1, 2:end-1); %avoid boundaries 
 im2 = im2(2:end-1, 2:end-1);
 assert (im, im2)
***** test
 im = checkerboard (20, 10, 4);
 theta = pi/6;
 T = maketform ('affine', [cos(theta) -sin(theta); ...
                           sin(theta) cos(theta); 0 0]);
 [im2, xdata] = imtransform (im, T);
 nu = columns(im);
 nv = rows(im);
 nx = xdata(2);
 diag = sqrt (nu^2 + nv^2);
 ang = atan (nv / nu);
 assert (nx, diag * abs (cos (theta - ang)),
         diag * 1 / size (im2, 2))
***** test
 im = rand (2);
 tmat = [eye(2); 0 0];
 T = maketform ("affine", tmat);
 im2 = imtransform (im, T, "xdata", [1 3]);
 assert (im2(:,3), zeros (2,1))
***** test
 im = rand (2);
 tmat = [eye(2); 0 0];
 T = maketform ('affine', tmat);
 im2 = imtransform (im, T, "xdata", [1 3]);
 assert (size (im2), [2 3])
***** test
 im = rand (2);
 tmat = [eye(2); 0 0];
 T = maketform ('affine', tmat);
 im2 = imtransform (im, T, "xyscale", [0.5 0.5]);
 assert (size (im2), [3 3])
7 tests, 7 passed, 0 known failure, 0 skipped
[iptcheckmap]
>>>>> /usr/share/octave/packages/image-2.6.1/iptcheckmap.m
***** test ("iptcheckmap (jet(64), 'func', 'var', 2)");                 # simple must work
***** fail ("iptcheckmap (3, 'func', 'var', 2)");                       # not a colormap
2 tests, 2 passed, 0 known failure, 0 skipped
[bwhitmiss]
>>>>> /usr/share/octave/packages/image-2.6.1/bwhitmiss.m
***** test
 bw1 = repmat ([0 1 0 1 1], [3 1]);
 bw2 = repmat ([0 1 0 0 0], [3 1]);
 assert (bwhitmiss (bw1, [1; 0; 1], [1 0 1]), logical (bw2))
 assert (bwhitmiss (bw1, [0 1 0; -1 0 -1; 0 1 0]), logical (bw2))
1 test, 1 passed, 0 known failure, 0 skipped
[padarray]
>>>>> /usr/share/octave/packages/image-2.6.1/padarray.m
***** demo
 padarray([1,2,3;4,5,6],[2,1])
 % pads [1,2,3;4,5,6] with a whole border of 2 rows and 1 columns of 0
***** demo
 padarray([1,2,3;4,5,6],[2,1],5)
 % pads [1,2,3;4,5,6] with a whole border of 2 rows and 1 columns of 5
***** demo
 padarray([1,2,3;4,5,6],[2,1],0,'pre')
 % pads [1,2,3;4,5,6] with a left and top border of 2 rows and 1 columns of 0
***** demo
 padarray([1,2,3;4,5,6],[2,1],'circular')
 % pads [1,2,3;4,5,6] with a whole 'circular' border of 2 rows and 1 columns
 % border 'repeats' data as if we tiled blocks of data
***** demo
 padarray([1,2,3;4,5,6],[2,1],'replicate')
 % pads [1,2,3;4,5,6] with a whole border of 2 rows and 1 columns which
 % 'replicates' edge data
***** demo
 padarray([1,2,3;4,5,6],[2,1],'symmetric')
 % pads [1,2,3;4,5,6] with a whole border of 2 rows and 1 columns which
 % is symmetric to the data on the edge 
***** assert (padarray ([1;2], [1]), [0;1;2;0]);
***** assert (padarray ([3 4], [0 2]), [0 0 3 4 0 0]);
***** assert (padarray ([1 2 3; 4 5 6], [1 2]),
      [zeros(1, 7); 0 0 1 2 3 0 0; 0 0 4 5 6 0 0; zeros(1, 7)]);
***** test
 assert (padarray ([1 2 3; 4 5 6], [3 2 1]),
         cat(3, zeros(8, 7),
                [ [             zeros(3, 7)               ]
                  [zeros(2, 2) [1 2 3; 4 5 6] zeros(2, 2) ]
                  [             zeros(3,7)]               ],
                zeros (8, 7)));
***** assert (padarray ([1 2], [4 5]), padarray ([1 2], [4 5], 0));
***** assert (padarray ([1 2], [4 5]), padarray ([1 2], [4 5], "both"));
***** assert (padarray ([1;2], [1], i), [i; 1; 2; i]);
***** assert (padarray ([1;2], [1], i, "pre"),  [i; 1; 2]);
***** assert (padarray ([1;2], [1], i, "post"), [1; 2; i]);
***** assert (padarray ([1;2], [1], i, "both"), [i; 1; 2; i]);
***** assert (padarray ([1 2], [0 1], i, "pre"),  [i 1 2]);
***** assert (padarray ([1 2], [0 1], i, "post"), [1 2 i]);
***** assert (padarray ([1 2], [0 1], i, "both"), [i 1 2 i]);
***** assert (padarray ([1 2], [0;1], i, "both"), [i 1 2 i]);
***** test
 A = [1 2 3; 4 5 6];
 B = repmat (A, 7, 9);
 assert (padarray (A, [1 2], "circular", "pre"),  B(2:4,2:6));
 assert (padarray (A, [1 2], "circular", "post"), B(3:5,4:8));
 assert (padarray (A, [1 2], "circular", "both"), B(2:5,2:8));
 ## This tests when padding is bigger than data
 assert (padarray (A, [5 10], "circular", "both"), B(2:13,3:25));
***** test
 A = int8 ([1 2 3; 4 5 6]);
 B = repmat (A, 7, 9);
 assert (padarray (A, [1 2], "circular", "pre"),  B(2:4,2:6));
 assert (padarray (A, [1 2], "circular", "post"), B(3:5,4:8));
 assert (padarray (A, [1 2], "circular", "both"), B(2:5,2:8));
 ## This tests when padding is bigger than data
 assert (padarray (A, [5 10], "circular", "both"), B(2:13,3:25));
***** test
 A = [1 2; 3 4];
 B = kron (A, ones (10, 5));
 assert (padarray (A, [9 4], "replicate", "pre"),  B(1:11,1:6));
 assert (padarray (A, [9 4], "replicate", "post"), B(10:20,5:10));
 assert (padarray (A, [9 4], "replicate", "both"), B);
 ## same with uint class
 assert (padarray (uint8 (A), [9 4], "replicate", "pre"),  uint8 (B(1:11,1:6)));
 assert (padarray (uint8 (A), [9 4], "replicate", "post"), uint8 (B(10:20,5:10)));
 assert (padarray (uint8 (A), [9 4], "replicate", "both"), uint8 (B));
***** test
 A    = [1:3
         4:6];
 HA   = [3:-1:1
         6:-1:4];
 VA   = [4:6
         1:3];
 VHA  = [6:-1:4
         3:-1:1];
 B    = [VHA VA VHA
         HA  A  HA
         VHA VA VHA];
 assert (padarray (A, [1 2], "symmetric", "pre"),  B(2:4,2:6));
 assert (padarray (A, [1 2], "symmetric", "post"), B(3:5,4:8));
 assert (padarray (A, [1 2], "symmetric", "both"), B(2:5,2:8));
 ## same with int class
 assert (padarray (int16 (A), [1 2], "symmetric", "pre"),  int16 (B(2:4,2:6)));
 assert (padarray (int16 (A), [1 2], "symmetric", "post"), int16 (B(3:5,4:8)));
 assert (padarray (int16 (A), [1 2], "symmetric", "both"), int16 (B(2:5,2:8)));
***** assert (padarray (int8   ([1; 2]), [1]),            int8   ([0; 1; 2; 0]));
***** assert (padarray (uint8  ([3  4]), [0 2]),          uint8  ([0 0 3 4 0 0]));
***** assert (padarray (int16  ([1; 2]), [1], 4),         int16  ([4; 1; 2; 4]));
***** assert (padarray (uint16 ([1; 2]), [1], 0),         uint16 ([0; 1; 2; 0]));
***** assert (padarray (uint32 ([1; 2]), [1], 6, "post"), uint32 ([1; 2; 6]));
***** assert (padarray (int32  ([1; 2]), [1], int32 (4), "pre"), int32 ([4; 1; 2]));
***** test
 in = [ 7  5  1  3
        5  3  3  4
        7  5  2  3
        6  1  3  8];
 padded = [
  3  5  5  3  3  4  4  3  3  5  5  3  3  4  4  3  3  5  5  3  3  4  4  3
  5  7  7  5  1  3  3  1  5  7  7  5  1  3  3  1  5  7  7  5  1  3  3  1
  5  7  7  5  1  3  3  1  5  7  7  5  1  3  3  1  5  7  7  5  1  3  3  1
  3  5  5  3  3  4  4  3  3  5  5  3  3  4  4  3  3  5  5  3  3  4  4  3
  5  7  7  5  2  3  3  2  5  7  7  5  2  3  3  2  5  7  7  5  2  3  3  2
  1  6  6  1  3  8  8  3  1  6  6  1  3  8  8  3  1  6  6  1  3  8  8  3
  1  6  6  1  3  8  8  3  1  6  6  1  3  8  8  3  1  6  6  1  3  8  8  3
  5  7  7  5  2  3  3  2  5  7  7  5  2  3  3  2  5  7  7  5  2  3  3  2
  3  5  5  3  3  4  4  3  3  5  5  3  3  4  4  3  3  5  5  3  3  4  4  3
  5  7  7  5  1  3  3  1  5  7  7  5  1  3  3  1  5  7  7  5  1  3  3  1
  5  7  7  5  1  3  3  1  5  7  7  5  1  3  3  1  5  7  7  5  1  3  3  1
  3  5  5  3  3  4  4  3  3  5  5  3  3  4  4  3  3  5  5  3  3  4  4  3
  5  7  7  5  2  3  3  2  5  7  7  5  2  3  3  2  5  7  7  5  2  3  3  2
  1  6  6  1  3  8  8  3  1  6  6  1  3  8  8  3  1  6  6  1  3  8  8  3
  1  6  6  1  3  8  8  3  1  6  6  1  3  8  8  3  1  6  6  1  3  8  8  3
  5  7  7  5  2  3  3  2  5  7  7  5  2  3  3  2  5  7  7  5  2  3  3  2
  3  5  5  3  3  4  4  3  3  5  5  3  3  4  4  3  3  5  5  3  3  4  4  3
  5  7  7  5  1  3  3  1  5  7  7  5  1  3  3  1  5  7  7  5  1  3  3  1
  5  7  7  5  1  3  3  1  5  7  7  5  1  3  3  1  5  7  7  5  1  3  3  1
  3  5  5  3  3  4  4  3  3  5  5  3  3  4  4  3  3  5  5  3  3  4  4  3
  5  7  7  5  2  3  3  2  5  7  7  5  2  3  3  2  5  7  7  5  2  3  3  2
  1  6  6  1  3  8  8  3  1  6  6  1  3  8  8  3  1  6  6  1  3  8  8  3
  1  6  6  1  3  8  8  3  1  6  6  1  3  8  8  3  1  6  6  1  3  8  8  3
  5  7  7  5  2  3  3  2  5  7  7  5  2  3  3  2  5  7  7  5  2  3  3  2];
 for ite = 1:10
  assert (padarray (in, [ite ite], "symmetric"), padded((11-ite):(14+ite),(11-ite):(14+ite)));
  assert (padarray (in, [ite ite], "symmetric", "pre"),  padded((11-ite):14,(11-ite):14));
  assert (padarray (in, [ite ite], "symmetric", "post"), padded(11:(14+ite),11:(14+ite)));
 endfor
***** test
 in = [ 7  5  4  9
        6  4  5  1
        5  3  3  3
        2  6  7  3];
 padded = [
  3  3  3  3  5  3  3  3  3  3  5  3  3  3  3  3  5  3  3  3  3  3  5  3
  7  3  7  6  2  6  7  3  7  6  2  6  7  3  7  6  2  6  7  3  7  6  2  6
  3  3  3  3  5  3  3  3  3  3  5  3  3  3  3  3  5  3  3  3  3  3  5  3
  5  1  5  4  6  4  5  1  5  4  6  4  5  1  5  4  6  4  5  1  5  4  6  4
  4  9  4  5  7  5  4  9  4  5  7  5  4  9  4  5  7  5  4  9  4  5  7  5
  5  1  5  4  6  4  5  1  5  4  6  4  5  1  5  4  6  4  5  1  5  4  6  4
  3  3  3  3  5  3  3  3  3  3  5  3  3  3  3  3  5  3  3  3  3  3  5  3
  7  3  7  6  2  6  7  3  7  6  2  6  7  3  7  6  2  6  7  3  7  6  2  6
  3  3  3  3  5  3  3  3  3  3  5  3  3  3  3  3  5  3  3  3  3  3  5  3
  5  1  5  4  6  4  5  1  5  4  6  4  5  1  5  4  6  4  5  1  5  4  6  4
  4  9  4  5  7  5  4  9  4  5  7  5  4  9  4  5  7  5  4  9  4  5  7  5
  5  1  5  4  6  4  5  1  5  4  6  4  5  1  5  4  6  4  5  1  5  4  6  4
  3  3  3  3  5  3  3  3  3  3  5  3  3  3  3  3  5  3  3  3  3  3  5  3
  7  3  7  6  2  6  7  3  7  6  2  6  7  3  7  6  2  6  7  3  7  6  2  6
  3  3  3  3  5  3  3  3  3  3  5  3  3  3  3  3  5  3  3  3  3  3  5  3
  5  1  5  4  6  4  5  1  5  4  6  4  5  1  5  4  6  4  5  1  5  4  6  4
  4  9  4  5  7  5  4  9  4  5  7  5  4  9  4  5  7  5  4  9  4  5  7  5
  5  1  5  4  6  4  5  1  5  4  6  4  5  1  5  4  6  4  5  1  5  4  6  4
  3  3  3  3  5  3  3  3  3  3  5  3  3  3  3  3  5  3  3  3  3  3  5  3
  7  3  7  6  2  6  7  3  7  6  2  6  7  3  7  6  2  6  7  3  7  6  2  6
  3  3  3  3  5  3  3  3  3  3  5  3  3  3  3  3  5  3  3  3  3  3  5  3
  5  1  5  4  6  4  5  1  5  4  6  4  5  1  5  4  6  4  5  1  5  4  6  4
  4  9  4  5  7  5  4  9  4  5  7  5  4  9  4  5  7  5  4  9  4  5  7  5
  5  1  5  4  6  4  5  1  5  4  6  4  5  1  5  4  6  4  5  1  5  4  6  4];
 for ite = 1:10
  assert (padarray (in, [ite ite], "reflect"), padded((11-ite):(14+ite),(11-ite):(14+ite)));
  assert (padarray (in, [ite ite], "reflect", "pre"),  padded((11-ite):14,(11-ite):14));
  assert (padarray (in, [ite ite], "reflect", "post"), padded(11:(14+ite),11:(14+ite)));
 endfor
26 tests, 26 passed, 0 known failure, 0 skipped
[lab2uint8]
>>>>> /usr/share/octave/packages/image-2.6.1/lab2uint8.m
***** test
 cm_uint8 = uint8 ([0 1 2 3 4 127 128 200 254 255]);
 cm_uint8 = repmat (cm_uint8(:), [1 3]);
 im2d_uint8 = reshape (cm_uint8, [5 2 3]);
 imnd_uint8 = permute (im2d_uint8, [1 4 3 2]);

 cm_uint16 = uint16 ([0  256  512  768  1024  32512  32768 51200  65024  65280]);
 cm_uint16 = repmat (cm_uint16(:), [1 3]);
 assert (lab2uint16 (cm_uint8), cm_uint16)
 im2d_uint16 = reshape (cm_uint16, [5 2 3]);
 assert (lab2uint16 (im2d_uint8), im2d_uint16)
 assert (lab2uint16 (imnd_uint8), permute (im2d_uint16, [1 4 3 2]))

 l1 = 100/255;
 cm = [
       0  -128  -128
      l1  -127  -127
    2*l1  -126  -126
    3*l1  -125  -125
    4*l1  -124  -124
  127*l1    -1    -1
  128*l1     0     0
  200*l1    72    72
  254*l1   126   126
     100   127   127];
 im2d = reshape (cm, [5 2 3]);
 imnd = permute (im2d, [1 4 3 2]);

 assert (lab2double (cm_uint8), cm)
 assert (lab2double (im2d_uint8), im2d)
 assert (lab2double (imnd_uint8), imnd)

 assert (lab2single (cm_uint8), single (cm))
 assert (lab2single (im2d_uint8), single (im2d))
 assert (lab2single (imnd_uint8), single (imnd))
1 test, 1 passed, 0 known failure, 0 skipped
[imabsdiff]
>>>>> /usr/share/octave/packages/image-2.6.1/imabsdiff.m
***** assert (imabsdiff (uint8   ([23 250]), uint8   ([26  50])),            uint8   ([ 3 200])); # default to first class and abs works
***** assert (imabsdiff (uint8   ([23 250]), uint8   ([24  50]), "uint16"),  uint16  ([ 1 200])); # defining output class works (not in matlab)
***** assert (imabsdiff (uint8   ([23 250]), uint8   ([24 255]), "int8"),    int8    ([ 1   5])); # signed integers kinda work (not in matlab)
***** assert (imabsdiff (logical ([ 1   0]), logical ([ 1   1])),            double  ([ 0   1])); # return double for two logical images
***** fail  ("imabsdiff (uint8   ([23 250]), 30");                                                # fails subtracting a scalar
***** fail  ("imabsdiff (uint8   ([23 250]), uint16  ([23 250]))");                               # input need to have same class
6 tests, 6 passed, 0 known failure, 0 skipped
[imcast]
>>>>> /usr/share/octave/packages/image-2.6.1/imcast.m
***** test
 im = randi ([0 255], 40, "uint8");
 assert (imcast (im, "uint8"), im2uint8 (im))
 assert (imcast (im, "uint16"), im2uint16 (im))
 assert (imcast (im, "single"), im2single (im))
 assert (imcast (im, "uint8", "indexed"), im2uint8 (im, "indexed"))
 assert (imcast (im, "uint16", "indexed"), im2uint16 (im, "indexed"))
 assert (imcast (im, "single", "indexed"), im2single (im, "indexed"))
***** test
 im = randi ([1 256], 40, "double");
 assert (imcast (im, "uint8"), im2uint8 (im))
 assert (imcast (im, "uint8", "indexed"), im2uint8 (im, "indexed"))
 assert (imcast (im, "single", "indexed"), im2single (im, "indexed"))
***** test
 im = randi ([0 65535], 40, "uint16");
 assert (imcast (im, "uint8"), im2uint8 (im))
 assert (imcast (im, "single"), im2single (im))
 assert (imcast (im, "single", "indexed"), im2single (im, "indexed"))
***** test
 im = randi ([1 255], 40, "double");
 assert (imcast (im, "uint8", "indexed"), im2uint8 (im, "indexed"))
 assert (imcast (im, "single", "indexed"), im2single (im, "indexed"))
***** test
 im = rand (40);
 assert (imcast (im, "uint8"), im2uint8 (im))
***** error <unknown image of class> imcast (randi (127, 40, "int8"), "uint8")
***** error <unsupported TYPE> imcast (randi (255, 40, "uint8"), "uint32")
***** error <unsupported TYPE> imcast (randi (255, 40, "uint8"), "not a class")
***** error <range of values> imcast (randi ([0 65535], 40, "uint16"), "uint8", "indexed")
9 tests, 9 passed, 0 known failure, 0 skipped
[label2rgb]
>>>>> /usr/share/octave/packages/image-2.6.1/label2rgb.m
***** function map = test_colormap ()
  map = [0 0 0; 0.5 0.5 0.5; 0.125 0.125 0.125];
***** endfunction
***** shared in, out, cmap
 in  = [  0    1    1    0    2    2    0    3    3
          0    1    1    0    2    2    0    3    3];

 out = [255    0    0  255  128  128  255   32   32
        255    0    0  255  128  128  255   32   32];
 out(:,:,2) = out(:,:,3) = out(:,:,1);
 out = uint8(out);

 cmap = [0 0 0; 0.5 0.5 0.5; 0.125 0.125 0.125];
***** assert (label2rgb (in, cmap),            out);
***** assert (label2rgb (uint8 (in), cmap),    out);
***** assert (label2rgb (in, "test_colormap"), out);
***** assert (label2rgb (in, @test_colormap),  out);

 out(find (in == 0)) = 0;
***** assert (label2rgb (in, cmap, "cyan"),    out);
***** assert (label2rgb (in, cmap, [0 1 1]),   out);

 in(1) = 10;
***** error label2rgb (in, cmap);
***** error label2rgb (in, cmap, 89);
***** error label2rgb (in, cmap, "g", "wrong");
9 tests, 9 passed, 0 known failure, 0 skipped
[lab2rgb]
>>>>> /usr/share/octave/packages/image-2.6.1/lab2rgb.m
***** assert (lab2rgb ([0 0 0]), [0, 0, 0], 1e-3)
***** assert (lab2rgb ([53.24, 80.09, 67.20]), [1 0 0], 1e-3)
***** assert (lab2rgb ([97.14, -21.55, 94.48]), [1 1 0], 1e-3)
***** assert (lab2rgb ([87.74, -86.18, 83.18]), [0 1 0], 1e-3)
***** assert (lab2rgb ([91.11, -48.09, -14.13]), [0 1 1], 1e-3)
***** assert (lab2rgb ([32.30, 79.19, -107.86]), [0 0 1], 1e-3)
***** assert (lab2rgb ([60.32, 98.24, -60.83]), [1 0 1], 1e-3)
***** assert (lab2rgb ([100, 0.00, 0.00]), [1 1 1], 1e-3)
***** assert (lab2rgb ([53.39, 0.00, 0.00]), [0.5 0.5 0.5], 1e-3)
***** assert (lab2rgb ([39.77, 64.51, 54.13]), [0.75 0 0], 1e-3)
***** assert (lab2rgb ([25.42, 47.91, 37.91]), [0.5 0 0], 1e-3)
***** assert (lab2rgb ([9.66, 29.68, 15.24]), [0.25 0 0], 1e-3)
***** assert (lab2rgb ([68.11, 48.39, 22.83]), [1 0.5 0.5], 1e-3)
***** assert (lab2rgb ([150 130 130]), [2.714, 1.028, 0.492], 1e-3)
***** test
 lab_map = rand (64, 3);
 lab_map(:,1) = lab_map(:,1) .* 100;
 lab_map(:,2) = lab_map(:,2) .* 254 - 127;
 lab_map(:,3) = lab_map(:,3) .* 254 - 127;
 assert (rgb2lab (lab2rgb (lab_map)), lab_map, 5e-3);
***** test
 lab_img = rand (64, 64, 3);
 lab_img(:,:,1) = lab_img(:,:,1) .* 100;
 lab_img(:,:,2) = lab_img(:,:,2) .* 254 - 127;
 lab_img(:,:,3) = lab_img(:,:,3) .* 254 - 127;
 assert (rgb2lab (lab2rgb (lab_img)), lab_img, 5e-3);
***** assert (lab2rgb (sparse ([0 0 0])), [0 0 0], 1e-3)
***** assert (lab2rgb (sparse ([100, 0.00, 0.00])), [1 1 1], 1e-3)
***** assert (class (lab2rgb (single([50 50 50]))), 'single')
***** error lab2rgb ()
***** error lab2rgb (1,2)
***** error <invalid data type 'cell'> lab2rgb ({1})
***** error <Lab must be a colormap or Lab image> lab2rgb (ones (2,2))
***** test
 lab = rand (16, 16, 3, 5);
 lab(:,:,1,:) = lab(:,:,1,:) .* 100;
 lab(:,:,2,:) = lab(:,:,2,:) .* 254 - 127;
 lab(:,:,3,:) = lab(:,:,3,:) .* 254 - 127;
 rgb = zeros (size (lab));
 for i = 1:5
   rgb(:,:,:,i) = lab2rgb (lab(:,:,:,i));
 endfor
 assert (lab2rgb (lab), rgb)
24 tests, 24 passed, 0 known failure, 0 skipped
[imnoise]
>>>>> /usr/share/octave/packages/image-2.6.1/imnoise.m
***** assert(var(imnoise(ones(10)/2,'gaussian')(:)),0.01,0.005) # probabilistic
***** assert(length(find(imnoise(ones(10)/2,'salt & pepper')~=0.5)),5,10) # probabilistic
***** assert(var(imnoise(ones(10)/2,'speckle')(:)),0.01,0.005) # probabilistic
***** test
 A = imnoise (.5 * ones (100), 'poisson');
 assert (class (A), 'double')
***** test
 A = imnoise (.5 * ones (100, 'single'), 'poisson');
 assert (class (A), 'single')
***** test
 A = imnoise (128 * ones (100, 'uint8'), 'poisson');
 assert (class (A), 'uint8')
***** test
 A = imnoise (256 * ones (100, 'uint16'), 'poisson');
 assert (class (A), 'uint16')
***** demo
  A = imnoise (2^7 * ones (100, 'uint8'), 'poisson');
  subplot (2, 2, 1)
  imshow (A)
  title ('uint8 image with poisson noise')
  A = imnoise (2^15 * ones (100, 'uint16'), 'poisson');
  subplot (2, 2, 2)
  imshow (A)
  title ('uint16 image with poisson noise')
  A = imnoise (.5 * ones (100), 'poisson');
  subplot (2, 2, 3)
  imshow (A)
  title ('double image with poisson noise')
  A = imnoise (.5 * ones (100, 'single'), 'poisson');
  subplot (2, 2, 4)
  imshow (A)
  title ('single image with poisson noise')
7 tests, 7 passed, 0 known failure, 0 skipped
[imtranslate]
>>>>> /usr/share/octave/packages/image-2.6.1/imtranslate.m
***** test
 obs = imtranslate (ones (5, 5), 2, 1, "crop");
 exp = zeros (5, 5);
 exp(1:4, 3:5) = 1;
 assert (obs, exp, eps * 10)

 obs = imtranslate (ones (5, 5), -2, -1, "crop");
 exp = zeros (5, 5);
 exp(2:5, 1:3) = 1;
 assert (obs, exp, eps * 10)
1 test, 1 passed, 0 known failure, 0 skipped
[rgb2lab]
>>>>> /usr/share/octave/packages/image-2.6.1/rgb2lab.m
***** assert (rgb2lab ([0 0 0]), [0, 0, 0], 1e-2)
***** assert (rgb2lab ([1 0 0]), [53.24, 80.09, 67.20], 1e-2)
***** assert (rgb2lab ([1 1 0]), [97.14, -21.55, 94.48], 1e-2)
***** assert (rgb2lab ([0 1 0]), [87.74, -86.18, 83.18], 1e-2)
***** assert (rgb2lab ([0 1 1]), [91.11, -48.09, -14.13], 1e-2)
***** assert (rgb2lab ([0 0 1]), [32.30, 79.19, -107.86], 1e-2)
***** assert (rgb2lab ([1 0 1]), [60.32, 98.24, -60.83], 1e-2)
***** assert (rgb2lab ([1 1 1]), [100, 0.00, 0.00], 1e-2)
***** assert (rgb2lab ([0.5 0.5 0.5]), [53.39, 0.00, 0.00], 1e-2)
***** assert (rgb2lab ([0.75 0 0]), [39.77, 64.51, 54.13], 1e-2)
***** assert (rgb2lab ([0.5 0 0]), [25.42, 47.91, 37.91], 1e-2)
***** assert (rgb2lab ([0.25 0 0]), [9.66, 29.68, 15.24], 1e-2)
***** assert (rgb2lab ([1 0.5 0.5]), [68.11, 48.39, 22.83], 1e-2)
***** assert (rgb2lab ([1.5 1 1]), [111.47, 43.42, 17.98], 1e-2)
***** test
 rgb_map = rand (64, 3);
 assert (lab2rgb (rgb2lab (rgb_map)), rgb_map, 2e-5);
***** test
 rgb_img = rand (64, 64, 3);
 assert (lab2rgb (rgb2lab (rgb_img)), rgb_img, 2e-5);
***** assert (rgb2lab (sparse ([0 0 1])), sparse ([32.30, 79.19, -107.86]), 1e-2)
***** assert (rgb2lab (sparse ([0 1 1])), sparse ([91.11, -48.09, -14.13]), 1e-2)
***** assert (rgb2lab (sparse ([1 1 1])), sparse ([100, 0.00, 0.00]), 1e-2)
***** assert (rgb2lab (uint8([255 255 255])), [100, 0.00, 0.00], 1e-2)
***** assert (class (rgb2lab (single([1 1 1]))), 'single')
***** error rgb2lab ()
***** error rgb2lab (1,2)
***** error <invalid data type 'cell'> rgb2lab ({1})
***** error <RGB must be a colormap or RGB image> rgb2lab (ones (2,2))
***** test
 rgb = rand (16, 16, 3, 5);
 lab = zeros (size (rgb));
 for i = 1:5
   lab(:,:,:,i) = rgb2lab (rgb(:,:,:,i));
 endfor
 assert (rgb2lab (rgb), lab)
26 tests, 26 passed, 0 known failure, 0 skipped
[imregionalmin]
>>>>> /usr/share/octave/packages/image-2.6.1/imregionalmin.m
***** test
 a = [
    7    3    9    3   10    3
    4    2    3   10    1    3
    1    4    6    9    4   10
    8    7    9    3    4    8
    5    9    3    3    8    9
    3    6    9    4    1   10];

 a4 = logical ([
    0    0    0    1    0    0
    0    1    0    0    1    0
    1    0    0    0    0    0
    0    0    0    1    0    0
    0    0    1    1    0    0
    1    0    0    0    1    0]);
 assert (imregionalmin (a, 4), a4)
 assert (imregionalmin (uint8 (a), 4), a4)
 assert (imregionalmin (int8 (a), 4), a4)

 a8 = logical ([
    0    0    0    0    0    0
    0    0    0    0    1    0
    1    0    0    0    0    0
    0    0    0    0    0    0
    0    0    0    0    0    0
    1    0    0    0    1    0]);
 assert (imregionalmin (a), a8)
 assert (imregionalmin (a, 8), a8)
 assert (imregionalmin (uint8 (a), 8), a8)
 assert (imregionalmin (int8 (a), 8), a8)
***** test
 a = [
   4   8   5  -1   8   7
  -1   4   0   7   1   1
   6   1   2   6   7   0
   6   1   5  -2   5   9
   1   4  -1   0   0   2
   4   6   1   0   7   1];

 a4 = logical ([
   0   0   0   1   0   0
   1   0   1   0   0   0
   0   1   0   0   0   1
   0   1   0   1   0   0
   1   0   1   0   0   0
   0   0   0   0   0   1]);
 assert (imregionalmin (a, 4), a4)
 assert (imregionalmin (int8 (a), 4), a4)

 a8 = logical ([
   0   0   0   1   0   0
   1   0   0   0   0   0
   0   0   0   0   0   1
   0   0   0   1   0   0
   0   0   0   0   0   0
   0   0   0   0   0   0]);
 assert (imregionalmin (a), a8)
 assert (imregionalmin (a, 8), a8)
 assert (imregionalmin (int8 (a), 8), a8)
2 tests, 2 passed, 0 known failure, 0 skipped
[xyz2rgb]
>>>>> /usr/share/octave/packages/image-2.6.1/xyz2rgb.m
***** assert (xyz2rgb ([0, 0, 0]), [0 0 0], 1e-3)
***** assert (xyz2rgb ([0.4125, 0.2127, 0.0193]), [1 0 0], 1e-3)
***** assert (xyz2rgb ([0.7700, 0.9278, 0.1385]), [1 1 0], 1e-3)
***** assert (xyz2rgb ([0.3576, 0.7152, 0.1192]), [0 1 0], 1e-3)
***** assert (xyz2rgb ([0.5380, 0.7873, 1.0694]), [0 1 1], 1e-3)
***** assert (xyz2rgb ([0.1804, 0.07217, 0.9502]), [0 0 1], 1e-3)
***** assert (xyz2rgb ([0.5929, 0.28484, 0.9696]), [1 0 1], 1e-3)
***** assert (xyz2rgb ([0.9505, 1.0000, 1.0888]), [1 1 1], 1e-3)
***** assert (xyz2rgb ([0.2034, 0.2140, 0.2330]), [0.5 0.5 0.5], 1e-3)
***** assert (xyz2rgb ([0.2155, 0.1111, 0.0101]), [0.75 0 0], 1e-3)
***** assert (xyz2rgb ([0.0883, 0.0455, 0.0041]), [0.5 0 0], 1e-3)
***** assert (xyz2rgb ([0.0210, 0.0108, 0.0010]), [0.25 0 0], 1e-3)
***** assert (xyz2rgb ([0.5276, 0.3812, 0.2482]), [1 0.5 0.5], 1e-3)
***** assert (xyz2rgb ([1.5 1 1]), [1.5712, 0.7109   0.9717], 1e-3)
***** test
 xyz_map = rand (64, 3);
 assert (rgb2xyz (xyz2rgb (xyz_map)), xyz_map, 3e-4);
***** test
 xyz_img = rand (64, 64, 3);
 assert (rgb2xyz (xyz2rgb (xyz_img)), xyz_img, 3e-4);
***** assert (xyz2rgb (sparse ([0 0 0])), [0 0 0], 1e-3)
***** assert (class (xyz2rgb (single([0.5 0.5 0.5]))), 'single')
***** error xyz2rgb ()
***** error xyz2rgb (1,2)
***** error <invalid data type 'cell'> xyz2rgb ({1})
***** error <XYZ must be a colormap or XYZ image> xyz2rgb (ones (2,2))
***** test
 xyz = rand (16, 16, 3, 5);
 rgb = zeros (size (xyz));
 for i = 1:5
   rgb(:,:,:,i) = xyz2rgb (xyz(:,:,:,i));
 endfor
 assert (xyz2rgb (xyz), rgb)
23 tests, 23 passed, 0 known failure, 0 skipped
[graythresh]
>>>>> /usr/share/octave/packages/image-2.6.1/graythresh.m
***** shared img, histo
 ## this is the old default.img that came with GNU Octave. While the current
 ## is very very similar, is off just enough for us to get precision errors
 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]));
***** assert (graythresh (img, "percentile"),      142/255);
***** assert (graythresh (img, "percentile", 0.5), 142/255);
***** assert (graythresh (img, "moments"),         142/255);
***** assert (graythresh (img, "minimum"),          93/255);
***** assert (graythresh (img, "maxentropy"),      150/255);
***** assert (graythresh (img, "intermodes"),       99/255);
***** assert (graythresh (img, "otsu"),            115/255);
 histo = hist (img(:), 0:255);
***** assert (graythresh (histo, "otsu"),          115/255);
***** assert (graythresh (img, "mean"), 0.51445615982, 0.000000001);  # here our results differ from ImageJ
9 tests, 9 passed, 0 known failure, 0 skipped
[im2bw]
>>>>> /usr/share/octave/packages/image-2.6.1/im2bw.m
***** assert(im2bw ([0 0.4 0.5 0.6 1], 0.5), logical([0 0 0 1 1])); # basic usage
***** assert(im2bw (uint8 ([0 100 255]), 0.5), logical([0 0 1]));   # with a uint8 input
***** warning <is already binary so nothing is done> bw = im2bw (logical ([0 1 0]));
***** warning <is already binary so nothing is done> bw = im2bw (logical ([0 1 0]), 1);
***** test
 warning ("off", "all", "local");
 assert (im2bw (logical ([0 1 0])),    logical ([0 1 0]))
 assert (im2bw (logical ([0 1 0]), 0), logical ([0 1 0]))
 assert (im2bw (logical ([0 1 0]), 1), logical ([0 1 0]))
***** assert (nnz (im2bw (uint8 ([0:255]), 0.9)), 26)
***** test
 img = uint8 ([0:255]);
 s = 0;
 for i=0:.1:1
   s += nnz (im2bw (img, i));
 endfor
 assert (s, 1405)
***** assert (nnz (im2bw (int16 ([-128:127]), 0.499)), 194)
***** assert (nnz (im2bw (int16 ([-128:127]), 0.500)), 128)
***** assert (nnz (im2bw (int16 ([-128:127]), 0.501)), 62)
***** test
 img = uint16 ([0:intmax("uint16")]);
 s = 0;
 for i=0:.1:1
   s += nnz (im2bw (img, i));
 endfor
 assert (s, 360445)
***** test
 img = int16 ([intmin("int16"):intmax("int16")]);
 s = 0;
 for i=0:.1:1
   s += nnz (im2bw (img, i));
 endfor
 assert (s, 360445)
***** test
 im = [((randn(10)/10)+.3) ((randn(10)/10)+.7)];
 assert (im2bw (im, "Otsu"), im2bw (im, graythresh (im(:), "Otsu")))
 assert (im2bw (im, "moments"), im2bw (im, graythresh (im(:), "moments")))
!!!!! test failed
horizontal dimensions mismatch (1x1 vs 199x1)
***** test
 im = [((randn(10)/10)+.3) ((randn(10)/10)+.7)];
 im = reshape (im, [10 10 1 2]);
 assert (im2bw (im, "Otsu"), im2bw (im, graythresh (im(:), "Otsu")))
 assert (im2bw (im, "moments"), im2bw (im, graythresh (im(:), "moments")))
!!!!! test failed
graythresh: input must be an image or an histogram.
14 tests, 12 passed, 0 known failure, 0 skipped
[cp2tform]
>>>>> /usr/share/octave/packages/image-2.6.1/cp2tform.m
***** function [crw, cap] = coords (npt = 1000, scale = 2, dtheta = pi/3, dx = 2, dy = -6, sig2noise = 1e32)
  theta = (rand(npt, 1)*2-1)*2*pi;
  R = rand(npt,1);
  y = R.*sin(theta);
  x = R.*cos(theta);
  crw = [y x];

  thetap = theta + dtheta; 
  Rap = R * scale;

  yap = Rap.*sin(thetap);
  yap = yap + dy;
  yap = yap + rand (size (yap)) * norm (yap) / sig2noise;

  xap = Rap.*cos(thetap);
  xap = xap + dx;
  xap = xap + rand (size (xap)) * norm (xap) / sig2noise;
  cap = [yap xap];
***** endfunction
***** test
 npt = 100000;
 [crw, cap] = coords (npt);
 ttype = 'projective';
 T = cp2tform (crw, cap, ttype);
 crw2 = tforminv (T, cap);
 finalerr = norm (crw - crw2)/npt;
 assert (finalerr < eps, "norm = %3.2e ( > eps)", finalerr)
***** test
 npt = 100000;
 [crw, cap] = coords (npt);
 ttype = 'affine';
 T = cp2tform (crw, cap, ttype);
 crw2 = tforminv (T, cap);
 finalerr = norm (crw - crw2)/npt;
 assert (finalerr < eps, "norm = %3.2e ( > eps)", finalerr)
***** test
 npt = 100000;
 [crw, cap] = coords (npt);
 ttype = 'nonreflective similarity';
 T = cp2tform (crw, cap, ttype);
 crw2 = tforminv (T, cap);
 finalerr = norm (crw - crw2)/npt;
 assert (finalerr < eps, "norm = %3.2e ( > eps)", finalerr)
***** test
 npt = 100000;
 [crw, cap] = coords (npt);
 cap(:,2) *= -1; 	% reflection around y axis
 ttype = 'similarity';
 T = cp2tform (crw, cap, ttype);
 crw2 = tforminv (T, cap);
 finalerr = norm (crw - crw2)/npt;
 assert (finalerr < eps, "norm = %3.2e ( > eps)", finalerr)
***** xtest
 npt = 100000;
 [crw, cap] = coords (npt);
 ttype = 'polynomial';
 ord = 2;
 T = cp2tform (crw, cap, ttype, ord);
 crw2 = tforminv (T, cap);
 finalerr = norm (crw - crw2)/npt;
 assert (finalerr < eps, "norm = %3.2e ( > eps)", finalerr)
***** xtest
 npt = 100000;
 [crw, cap] = coords (npt);
 ttype = 'polynomial';
 ord = 3;
 T = cp2tform (crw, cap, ttype, ord);
 crw2 = tforminv (T, cap);
 finalerr = norm (crw - crw2)/npt;
 assert (finalerr < eps, "norm = %3.2e ( > eps)", finalerr)
***** xtest
 npt = 100000;
 [crw, cap] = coords (npt);
 ttype = 'polynomial';
 ord = 4;
 T = cp2tform (crw, cap, ttype, ord);
 crw2 = tforminv (T, cap);
 finalerr = norm (crw - crw2)/npt;
 assert (finalerr < eps, "norm = %3.2e ( > eps)", finalerr)
!!!!! known failure
norm = 7.52e-16 ( > eps)
7 tests, 6 passed, 1 known failure, 0 skipped
[getrangefromclass]
>>>>> /usr/share/octave/packages/image-2.6.1/getrangefromclass.m
***** shared img
 img = ones (5);
***** assert (getrangefromclass (double (img)), [0 1]);      # double returns [0 1]
***** assert (getrangefromclass (single (img)), [0 1]);      # single returns [0 1]
***** assert (getrangefromclass (logical (img)), [0 1]);     # logical returns [0 1]
***** assert (getrangefromclass (int8 (img)), [-128 127]);   # checks int
***** assert (getrangefromclass (uint8 (img)), [0 255]);     # checks unit
***** fail ("getrangefromclass ('string')");                 # fails with strings
***** fail ("getrangefromclass ({3, 4})");                   # fails with cells
7 tests, 7 passed, 0 known failure, 0 skipped
[qtgetblk]
>>>>> /usr/share/octave/packages/image-2.6.1/qtgetblk.m
***** demo
 [vals,r,c]=qtgetblk(eye(4),qtdecomp(eye(4)),2)
 % Returns 2 blocks, at [1,3] and [3,1] (2*2 zeros blocks)
***** shared A,S
 A=[ 1, 4, 2, 5,54,55,61,62;
     3, 6, 3, 1,58,53,67,65;
     3, 6, 3, 1,58,53,67,65;
     3, 6, 3, 1,58,53,67,65;
    23,42,42,42,99,99,99,99;
    27,42,42,42,99,99,99,99;
    23,22,26,25,99,99,99,99;
    22,22,24,22,99,99,99,99];
 S=qtdecomp(A,10);
***** test
 [va]=qtgetblk(A,S,8);
 [vb,r,c]=qtgetblk(A,S,8);
 [vc,i]=qtgetblk(A,S,8);
 assert(va, vb);
 assert(va, vc);
 assert(i,[]);
 assert(r,[]);
 assert(c,[]);
 R=[];
 assert(va,R);
***** test
 [va]=qtgetblk(A,S,4);
 [vb,r,c]=qtgetblk(A,S,4);
 [vc,i]=qtgetblk(A,S,4);
 assert(va, vb);
 assert(va, vc);
 assert(i, find(full(S)==4));
 assert(r,[1;5]);
 assert(c,[1;5]);
 R=zeros(4,4,2);
 R(:,:,1)=A(1:4,1:4);
 R(:,:,2)=A(5:8,5:8);
 assert(va,R);
***** test
 [va]=qtgetblk(A,S,2);
 [vb,r,c]=qtgetblk(A,S,2);
 [vc,i]=qtgetblk(A,S,2);
 assert(va, vb);
 assert(va, vc);
 assert(i, find(full(S)==2));
 assert(r,[7;5;7;1;3;1;3]);
 assert(c,[1;3;3;5;5;7;7]);
 R=zeros(2,2,7);
 R(:,:,1)=A(7:8,1:2);
 R(:,:,2)=A(5:6,3:4);
 R(:,:,3)=A(7:8,3:4);
 R(:,:,4)=A(1:2,5:6);
 R(:,:,5)=A(3:4,5:6);
 R(:,:,6)=A(1:2,7:8);
 R(:,:,7)=A(3:4,7:8);
 assert(va,R);
3 tests, 3 passed, 0 known failure, 0 skipped
[bwperim]
>>>>> /usr/share/octave/packages/image-2.6.1/bwperim.m
***** test
 in = [ 1   1   1   1   0   1   1   0   1   1
        1   1   0   1   1   1   1   1   1   0
        1   1   1   0   1   1   1   1   1   1
        1   1   1   1   0   1   1   1   0   1
        1   1   1   0   1   1   1   1   1   0
        1   1   1   1   1   1   0   1   0   1
        1   1   1   1   1   1   1   1   1   0
        1   1   1   1   1   1   1   1   1   1
        1   1   1   1   1   1   0   0   1   1
        1   1   1   1   0   1   0   1   1   0];

 out = [1   1   1   1   0   1   1   0   1   1
        1   1   0   1   1   0   0   1   1   0
        1   0   1   0   1   0   0   0   1   1
        1   0   0   1   0   1   0   1   0   1
        1   0   1   0   1   0   1   0   1   0
        1   0   0   1   0   1   0   1   0   1
        1   0   0   0   0   0   1   0   1   0
        1   0   0   0   0   0   1   1   0   1
        1   0   0   0   1   1   0   0   1   1
        1   1   1   1   0   1   0   1   1   0];
 assert (bwperim (in), logical (out))
 assert (bwperim (in, 4), logical (out))

 out = [1   1   1   1   0   1   1   0   1   1
        1   1   0   1   1   1   1   1   1   0
        1   1   1   0   1   1   0   1   1   1
        1   0   1   1   0   1   0   1   0   1
        1   0   1   0   1   1   1   1   1   0
        1   0   1   1   1   1   0   1   0   1
        1   0   0   0   0   1   1   1   1   0
        1   0   0   0   0   1   1   1   1   1
        1   0   0   1   1   1   0   0   1   1
        1   1   1   1   0   1   0   1   1   0];
 assert (bwperim (in, 8), logical (out))

 out = [1   1   1   1   0   1   1   0   1   1
        1   0   0   0   0   1   0   0   1   0
        1   0   0   0   0   0   0   1   0   1
        1   0   1   0   0   0   0   0   0   1
        1   0   0   0   0   1   0   1   0   0
        1   0   0   0   1   0   0   0   0   1
        1   0   0   0   0   0   0   1   0   0
        1   0   0   0   0   1   1   0   0   1
        1   0   0   1   0   1   0   0   1   1
        1   1   1   1   0   1   0   1   1   0];
 assert (bwperim (in, [1 0 0; 0 1 0; 0 0 1]), logical (out))
***** test
 in = [ 0   0   0   0   0   0   0
        0   0   5   0   0   1   9
        0 Inf   9   7   0   0   0
        0 1.5   5   7   1   0   0
        0 0.5  -1  89   i   0   0
        0   4  10  15   1   0   0
        0   0   0   0   0   0   0];
 out = [0   0   0   0   0   0   0
        0   0   1   0   0   1   1
        0   1   0   1   0   0   0
        0   1   0   0   1   0   0
        0   1   0   0   1   0   0
        0   1   1   1   1   0   0
        0   0   0   0   0   0   0];
 assert (bwperim (in), logical (out))
***** test
 in = reshape (magic(16), [8 8 4]) > 50;
 out(:,:,1) = [
    1   1   0   1   0   1   1   1
    0   1   1   1   1   1   0   1
    0   1   1   1   1   1   0   1
    1   1   0   1   1   1   1   1
    1   1   1   1   1   1   1   1
    1   1   1   0   1   0   1   1
    1   1   1   0   1   0   1   1
    1   0   1   1   1   1   1   0];
 out(:,:,2) = [
    1   1   0   1   0   1   1   1
    0   1   1   0   1   1   0   1
    0   1   0   0   0   1   0   1
    1   0   1   0   0   0   1   1
    1   0   0   1   0   1   0   1
    1   0   1   0   1   0   1   1
    1   1   1   0   1   0   1   1
    1   0   1   1   1   1   1   0];
 out(:,:,3) = [
    1   1   0   1   0   1   1   1
    0   1   1   0   1   1   0   1
    0   1   0   0   0   1   0   1
    1   0   0   0   0   0   1   1
    1   0   0   1   0   1   0   1
    1   0   1   0   1   0   1   1
    1   1   1   0   1   0   1   1
    1   0   1   1   1   1   1   0];
 out(:,:,4) = [
    1   1   0   1   0   1   1   1
    0   1   1   1   1   1   0   1
    0   1   1   1   1   1   0   1
    1   1   1   1   1   1   1   1
    1   1   1   1   1   1   1   0
    1   1   1   0   1   0   1   1
    1   1   1   0   1   0   1   1
    1   0   1   1   1   1   1   0];
 assert (bwperim (in), logical (out))

 out(:,:,1) = [
    1   1   0   1   0   1   1   1
    0   1   1   1   1   1   0   1
    0   1   1   1   1   1   0   1
    1   1   0   1   1   1   1   1
    1   1   1   1   1   1   1   1
    1   1   1   0   1   0   1   1
    1   1   1   0   1   0   1   1
    1   0   1   1   1   1   1   0];
 out(:,:,2) = [
    1   1   0   1   0   1   1   1
    0   1   1   1   1   1   0   1
    0   1   1   0   0   1   0   1
    1   1   1   1   0   1   1   1
    1   0   1   1   1   1   1   1
    1   0   1   0   1   0   1   1
    1   1   1   0   1   0   1   1
    1   0   1   1   1   1   1   0];
 out(:,:,3) = [
    1   1   0   1   0   1   1   1
    0   1   1   1   1   1   0   1
    0   1   0   0   0   1   0   1
    1   1   0   0   0   1   1   1
    1   0   1   1   1   1   1   1
    1   0   1   0   1   0   1   1
    1   1   1   0   1   0   1   1
    1   0   1   1   1   1   1   0];
 out(:,:,4) = [
    1   1   0   1   0   1   1   1
    0   1   1   1   1   1   0   1
    0   1   1   1   1   1   0   1
    1   1   1   1   1   1   1   1
    1   1   1   1   1   1   1   0
    1   1   1   0   1   0   1   1
    1   1   1   0   1   0   1   1
    1   0   1   1   1   1   1   0];
 assert (bwperim (in, 18), logical (out))
***** error bwperim ("text")
***** error bwperim (rand (10), 5)
***** error bwperim (rand (10), "text")
***** test
 a = false (5);
 a(1:4,2:4) = true;

 p = false (5);
 p(1:4,[2 4]) = true;
 assert (bwperim (a, [0 0 0; 1 1 1; 0 0 0]), p)
***** test
 a = false (8, 8, 5);
 a(4:5,4:5,2:4) = true;
 a(2:7,2:7,3) = true;
 assert (bwperim (a, 26), a)

 ## It is easy to forget that is correct
 b = a;
 b(4:5, 4:5, 3) = false;
 assert (bwperim (a), b)

 c = a;
 c(3:6,3:6,3) = false;
 assert (bwperim (a, 4), c)
8 tests, 8 passed, 0 known failure, 0 skipped
[nlfilter]
>>>>> /usr/share/octave/packages/image-2.6.1/nlfilter.m
***** demo
 ## creates a "wide" diagonal (although it can be performed more
 ## efficiently with "imdilate (A, true (3))")
 nlfilter (eye (10), [3 3], @(x) any (x(:) > 0))
***** assert (nlfilter (eye (4), [2 3], @(x) sum (x(:))),
        [2 2 1 0
         1 2 2 1
         0 1 2 2
         0 0 1 1]);
***** assert (nlfilter (eye (4), "indexed", [2 3], @(x) sum (x(:))),
        [4 2 1 2
         3 2 2 3
         2 1 2 4
         4 3 4 5]);
***** assert (nlfilter (eye (4), "indexed", [2 3], @(x, y) sum (x(:)) == y, 2),
        logical ([0 1 0 1
                  0 1 1 0
                  1 0 1 0
                  0 0 0 0]));
***** assert (nlfilter (uint8 (eye (4)), "indexed", [2 3], @(x) sum (x(:))),
        [2 2 1 0
         1 2 2 1
         0 1 2 2
         0 0 1 1]);
***** assert (nlfilter (int16 (eye (4)), "indexed", [2 3], @(x) sum (x(:))),
        [4 2 1 2
         3 2 2 3
         2 1 2 4
         4 3 4 5]);
***** assert (nlfilter (uint8 (eye (4)), "indexed", [2 3], @(x) int8 (sum (x(:)))),
        int8 ([2 2 1 0
               1 2 2 1
               0 1 2 2
               0 0 1 1]));
***** test
 a = randi (10, 20, 20, 20);
 ## extra dimensions on matrix only
 assert (nlfilter (a, [5 5], @(x) max(x(:))), imdilate (a, ones (5)))
 ## extra dimensions on both matrix and block
 assert (nlfilter (a, [5 5 5], @(x) max(x(:))), imdilate (a, ones ([5 5 5])))
 ## extra dimensions and padding
 assert (nlfilter (a, [3 7], @(x) max(x(:))), imdilate (a, ones ([3 7])))
 assert (nlfilter (a, [3 7 3], @(x) max(x(:))), imdilate (a, ones ([3 7 3])))
***** test
 a = randi (10, 15, 15, 4, 8, 3);
 assert (nlfilter (a, [3 4 7 5], @(x) max(x(:))),
         imdilate (a, ones ([3 4 7 5])))
***** test
 a = randi (10, 15, 15, 4, 3, 8);
 ord = ordfiltn (a, 3, ones ([3 7 3 1 5]));
 assert (nlfilter (a, [3 7 3 1 5], @(x) sort (x(:))(3)), ord)
 assert (nlfilter (a, [3 7 3 1 5], @(x, y) sort (x(:))(y), 3), ord)
9 tests, 9 passed, 0 known failure, 0 skipped
[imclose]
>>>>> /usr/share/octave/packages/image-2.6.1/imclose.m
***** shared in, out
 in =  [ 0   0   0   1   1   1   0   0   1   1
       0   1   0   1   1   1   0   0   0   1
       1   1   1   1   1   0   0   0   0   0
       0   1   1   1   1   0   0   0   0   0
       0   0   0   1   0   0   0   0   1   0
       0   0   0   0   0   0   0   1   1   1
       0   0   0   0   1   0   1   0   1   0
       0   0   0   1   1   1   1   1   0   0
       0   0   0   0   1   1   1   0   0   0
       0   0   0   1   1   1   0   0   0   0];

 out = [ 1   1   1   1   1   1   1   1   1   1
       1   1   1   1   1   1   0   0   0   1
       1   1   1   1   1   0   0   0   0   1
       1   1   1   1   1   0   0   0   0   1
       0   0   0   1   1   0   0   0   1   1
       0   0   0   1   1   1   1   1   1   1
       0   0   0   1   1   1   1   1   1   1
       0   0   0   1   1   1   1   1   0   0
       0   0   0   1   1   1   1   0   0   0
       0   0   0   1   1   1   1   0   0   0];
***** assert (imclose (logical (in), ones (3)), logical (out));

 out = [99   99   16   16   16   73   74   64   64   64
      98   88   16   16   16   73   71   64   64   64
      93   88   88   61   61   61   68   70   70   70
      93   88   88   61   61   61   68   71   71   71
      93   93   88   61   61   61   68   75   66   66
      79   79   82   90   90   49   49   49   49   66
      79   79   82   91   91   48   46   46   46   66
      79   79   82   95   97   48   46   46   46   72
      18   18   94   96   84   48   46   46   46   59
      18   18  100   96   84   50   50   50   50   59];
***** assert (imclose (magic (10), ones (3)), out);
***** assert (imclose (uint8 (magic (10)), strel ("square", 3)), uint8 (out));

 ## using a se that will be decomposed in 2 pieces
 out =[ 99   99   88   74   74   74   74   70   70   70
        98   93   88   74   74   74   74   70   70   70
        93   93   88   74   74   74   74   70   70   70
        93   93   88   74   74   74   74   71   71   71
        93   93   88   75   75   75   75   75   75   75
        93   93   90   90   90   72   72   72   72   72
        93   93   91   91   91   72   72   72   72   72
        93   93   93   95   97   72   72   72   72   72
        94   94   94   96   97   72   72   72   72   72
       100  100  100   97   97   72   72   72   72   72];
***** assert (imclose (magic (10), ones(5)), out);

 ## using a weird non-symmetric and even-size se
 out =[ 92   99   16   16   16   70   74   58   58   58
        98   88   60   73   16   73   69   70   64   58
        88   81   88   60   60   60   69   69   70   70
        87   87   61   68   61   60   68   69   71   69
        86   93   87   61   61   61   68   75   68   69
        23   82   89   89   90   45   68   45   68   66
        23   23   82   89   91   48   45   45   45   66
        79   23   82   95   97   46   48   46   45   72
        18   79   94   96   78   50   46   46   46   59
        18   18  100   94   94   78   50   50   46   59];
***** assert (imclose (magic (10), [1 0 0 0; 1 1 1 0; 0 1 0 1]), out);
5 tests, 5 passed, 0 known failure, 0 skipped
[imfill]
>>>>> /usr/share/octave/packages/image-2.6.1/imfill.m
***** test
 I = uint8 (5.*[1 1 1; 1 0 1; 1 1 1]);
 bw = logical ([1 1 1; 1 0 1; 1 1 1]);
 I2 = uint8 (5.*ones (3));
 bw2 = logical (ones (3));

 assert (imfill (int8 (I)), int8 (I2))
 assert (imfill (int16 (I)), int16 (I2))
 assert (imfill (int32 (I)), int32 (I2))
 assert (imfill (int64 (I)), int64 (I2))
 assert (imfill (uint8 (I)), uint8 (I2))
 assert (imfill (uint16 (I)), uint16 (I2))
 assert (imfill (uint32 (I)), uint32 (I2))
 assert (imfill (uint64 (I)), uint64 (I2))
 assert (imfill (single (I)), single (I2))
 assert (imfill (double (I)), double (I2))
 assert (imfill (bw, "holes"), bw2)
 assert (imfill (uint8 (bw)), uint8 (bw2))
***** error <must be a binary or grayscale image>
  imfill (i + ones (3, 3));                 # complex input
***** error <must be a binary or grayscale image>
  imfill (sparse (double (I)));   # sparse input
***** error
  imfill ();
***** error
 imfill (true (3), 4, "holes", 5)
***** error <LOCATIONS must be a n-by-1 or n-by-d sized index array>
 imfill (false (3), ones (2, 3))
***** error <LOCATIONS must be a n-by-1 or n-by-d sized index array>
 imfill (false (3), ones (2, 3), 4)
***** error <interactive usage is not yet supported>
 imfill (false (3))
***** error <interactive usage is not yet supported>
 imfill (false (3), 0, 4)
***** warning <ignored LOCATIONS outside of image borders>
 bw = logical ([1 1 1; 1 0 1; 1 1 1]);
 assert (imfill (bw, [5 5]), bw)
 assert (imfill (bw, 15), bw)

 bw = repmat (bw, [1 1 3]);
 assert (imfill (bw, 30), bw)
 assert (imfill (bw, [2 2 5]), bw)
***** test
 bw = logical ([1 0 0 0 0 0 0 0
                1 1 1 1 1 0 0 0
                1 0 0 0 1 0 1 0
                1 0 0 0 1 1 1 0
                1 1 1 1 0 1 1 1
                1 0 0 1 1 0 1 0
                1 0 0 0 1 0 1 0
                1 0 0 0 1 1 1 0]);
 bw2 = logical ([1 0 0 0 0 0 0 0
                 1 1 1 1 1 0 0 0
                 1 1 1 1 1 0 1 0
                 1 1 1 1 1 1 1 0
                 1 1 1 1 1 1 1 1
                 1 0 0 1 1 1 1 0
                 1 0 0 0 1 1 1 0
                 1 0 0 0 1 1 1 0]);
 bw3 = logical ([1 0 0 0 0 0 0 0
                 1 1 1 1 1 0 0 0
                 1 1 1 1 1 0 1 0
                 1 1 1 1 1 1 1 0
                 1 1 1 1 0 1 1 1
                 1 0 0 1 1 0 1 0
                 1 0 0 0 1 0 1 0
                 1 0 0 0 1 1 1 0]);
 assert (imfill (bw, "holes"), bw2)
 assert (imfill (bw, 8, "holes"), bw2)
 assert (imfill (bw, 4, "holes"), bw2)
 assert (imfill (bw, [3 3]), bw3)
 assert (imfill (bw, 19), bw3)
 assert (imfill (bw, [3 3], 4), bw3)
 assert (imfill (bw, 19, 4), bw3)
 assert (imfill (bw, [3 3], 8), bw2)
 assert (imfill (bw, 19, 8), bw2)
 assert (imfill (bw, [19; 20]), bw3)
 assert (imfill (bw, [19; 20], 4), bw3)
 assert (imfill (bw, [19; 20], 8), bw2)
***** warning <ignored LOCATIONS outside of image borders>
 bw = logical ([1 1 1 1 1 1 1
                1 0 0 0 0 0 1
                1 0 1 1 1 0 1
                1 0 1 0 1 0 1
                1 0 1 1 1 0 1
                1 0 0 0 0 0 1
                1 1 1 1 1 1 1]);
 bw44 = logical ([1 1 1 1 1 1 1
                  1 0 0 0 0 0 1
                  1 0 1 1 1 0 1
                  1 0 1 1 1 0 1
                  1 0 1 1 1 0 1
                  1 0 0 0 0 0 1
                  1 1 1 1 1 1 1]);
 bw9 = logical ([1 1 1 1 1 1 1
                 1 1 1 1 1 1 1
                 1 1 1 1 1 1 1
                 1 1 1 0 1 1 1
                 1 1 1 1 1 1 1
                 1 1 1 1 1 1 1
                 1 1 1 1 1 1 1]);
 assert (imfill (bw, "holes"), logical (ones (7)))
 assert (imfill (bw, [4 4]), bw44)
 assert (imfill (bw, 9), bw9)
 assert (imfill (bw, [4 4; 10 10]), bw44)
***** test
 bw = logical ([1 1 0 1 1]);
 assert (imfill (bw, "holes"), bw)
 bw = logical([1 1 0 1 1; 1 1 1 1 1]);
 assert (imfill (bw, "holes"), bw)
***** test
 I = zeros (5);
 I(:, [2 4]) = 1;
 I2_expected = [0   1   1   1   0
                0   1   1   1   0
                0   1   1   1   0
                0   1   1   1   0
                0   1   1   1   0];
 I2 = imfill (I, [0 0 0; 1 1 1; 0 0 0], "holes");
 assert (I2, I2_expected)
***** test
 I = zeros (5);
 I(:, [2 4]) = 1;
 I2_expected = I;
 I2 = imfill (I, [0 1 0; 0 1 0; 0 1 0], "holes");
 assert (I2, I2_expected)
***** test  # this test is Matlab compatible
 I = zeros (5);
 I(:, [2 4]) = 1;
 I2_expected = inf .* ones (5);
 I2 =  imfill (I, [0 0 0; 0 1 0; 0 0 0], "holes");
 assert (I2, I2_expected)
***** test
 I = false (5);
 I(:, [2 4]) = true;
 I2_expected = true (5);
 I2 = imfill (I, [0 0 0; 0 1 0; 0 0 0], "holes");
 assert (I2, I2_expected)
***** test
 I  = uint8 ([10 20 80 85 20
              15 90 03 25 88
              05 85 02 50 83
              90 04 03 80 80
             10 81 83 85 30]);
 I2 = uint8 ([10 20 80 85 20
              15 90 80 80 88
              05 85 80 80 83
              90 80 80 80 80
             10 81 83 85 30]);
 I3  = uint8 ([10 20 80 85 20
               15 90 05 25 88
               05 85 05 50 83
               90 05 05 80 80
               10 81 83 85 30]);
 assert (imfill (I), I2)
 assert (imfill (I, 4), I2)
 assert (imfill (I, 4, "holes"), I2)
 assert (imfill (I, 8), I3)
 assert (imfill (I, "holes"), I2)
***** test
 v_line = [0 1 0; 0 1 0; 0 1 0];
 h_line = [0 0 0; 1 1 1; 0 0 0];
 im = [0 1 0 0 1 0];

 assert (imfill (im, h_line, "holes"), [0 1 1 1 1 0])
 assert (imfill (im, v_line, "holes"), [0 1 0 0 1 0])
 assert (imfill (im', h_line, "holes"), [0 1 0 0 1 0]')
 assert (imfill (im', v_line, "holes"), [0 1 1 1 1 0]')

 im = repmat (im, [1 1 5]);
 assert (imfill (im, h_line, "holes"), repmat ([0 1 1 1 1 0], [1 1 5]))
 assert (imfill (im, v_line, "holes"), im)

 im = permute (im, [2 1 3]);
 assert (imfill (im, h_line, "holes"), im)
 assert (imfill (im, v_line, "holes"), repmat ([0 1 1 1 1 0]', [1 1 5]))
***** test
 im = logical ([0 0 0 0 0 0
                0 1 1 1 1 0
                0 1 0 0 1 0
                0 1 1 1 1 0
                0 0 0 0 0 0]);
 fi = logical ([0 0 0 0 0 0
                0 1 1 1 1 0
                0 1 1 1 1 0
                0 1 1 1 1 0
                0 0 0 0 0 0]);

 assert (imfill (cat (3, im, im, im), 8, 'holes'), cat (3, fi, fi, fi))
 assert (imfill (cat (3, im, im, im), 'holes'), cat (3, im, im, im))
 assert (imfill (cat (3, fi, im, fi), 'holes'), cat (3, fi, fi, fi))
***** test
 emp = false (5, 6);
  im = logical ([0 0 0 0 0 0
                 0 1 1 1 1 0
                 0 1 0 1 0 1
                 0 1 1 1 1 0
                 0 0 0 0 0 0]);
  fi = logical ([0 0 0 0 0 0
                 0 1 1 1 1 0
                 0 1 1 1 1 1
                 0 1 1 1 1 0
                 0 0 0 0 0 0]);
  fi1 = logical ([0 0 0 0 0 0
                  0 1 1 1 1 0
                  0 1 1 1 0 1
                  0 1 1 1 1 0
                  0 0 0 0 0 0]);
  fi2 = logical ([0 0 0 0 0 0
                  0 1 1 1 1 0
                  0 1 0 1 1 1
                  0 1 1 1 1 0
                  0 0 0 0 0 0]);

 assert (imfill (cat (3, im, im, im), [3 3 2]), cat (3, fi1, fi1, fi1))
 assert (imfill (cat (3, im, im, im), [3 5 2]), cat (3, fi2, fi2, fi2))
 assert (imfill (cat (3, im, im, im), [3 3 2; 3 5 2]), cat (3, fi, fi, fi))
 assert (imfill (cat (3, emp, im, emp), [3 3 2]), true (5, 6, 3))
21 tests, 21 passed, 0 known failure, 0 skipped
[makelut]
>>>>> /usr/share/octave/packages/image-2.6.1/makelut.m
***** demo
 makelut(inline('sum(x(:))>=3','x'), 2)
 % Returns '1' if one or more values
 % in the input matrix are 1
***** 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
***** assert(prod(makelut(inline('x(1,1)==1','x'),2)==[zeros(2^3,1);ones(2^3,1)])==1); # test 2-by-2
***** assert(prod(makelut(inline('x(1,1)==1','x'),3)==[zeros(2^8,1);ones(2^8,1)])==1); # test 3-by-3
***** assert(prod(makelut(inline('x(1,1)==1','x'),4)==[zeros(2^15,1);ones(2^15,1)])==1); # test 4-by-4
***** 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
5 tests, 5 passed, 0 known failure, 0 skipped
[checkerboard]
>>>>> /usr/share/octave/packages/image-2.6.1/checkerboard.m
***** demo
 ## Simplest case, default checkerboard size:
 ##     8 by 8 checkerboard, with squares 10 pixel wide
 board = checkerboard ();
 imshow (board)
***** demo
 ## Simplest case, default checkerboard size:
 ##     8 by 16 checkerboard, with squares 5 pixel wide
 board = checkerboard (5, 4, 8);
 imshow (board)
***** assert (checkerboard (0), zeros (0, 0))
***** assert (checkerboard (0, 3), zeros (0, 0))
***** assert (checkerboard (0, 2, 4), zeros (0, 0))
***** assert (checkerboard (0, 2, 4, 3), zeros (0, 0, 0))
***** assert (checkerboard (0, 2, 4, 3, 2), zeros (0, 0, 0, 0))
***** assert (checkerboard (1, 4, 2, 3, 0), zeros (8, 4, 6, 0))
***** assert (checkerboard (1, 4, 0, 3, 2), zeros (8, 0, 6, 4))
***** assert (checkerboard (2, 4, 0, 3, 2), zeros (16, 0, 12, 8))
***** test
 out = zeros (80);
 i1 = ((1:20:80) .+ (0:9)')(:);
 i2 = ((11:20:80) .+ (0:9)')(:);
 out(i1, i2) = 1;
 out(i2, i1) = 1;
 i1r = ((41:20:80) .+ (0:9)')(:);
 i2r = ((51:20:80) .+ (0:9)')(:);
 out(i2, i1r) = 0.7;
 out(i1, i2r) = 0.7;
 assert (checkerboard (), out)
 assert (checkerboard (10, 4, 4), out)
 assert (checkerboard (10, [4 4]), out)
 assert (checkerboard (10, [4; 4]), out)
***** test
 out = zeros (8);
 out(2:2:8, 1:2:8) = 1;
 out(1:2:8, 2:2:8) = 1;
 out(1:2:8, 6:2:8) = 0.7;
 out(2:2:8, 5:2:8) = 0.7;
 assert (checkerboard (1), out)
 assert (checkerboard (1, 4), out)
 assert (checkerboard (1, 4, 4), out)
 assert (checkerboard (1, [4 4]), out)
***** test
 out = zeros (10);
 out(2:2:10, 1:2:10) = 1;
 out(1:2:10, 2:2:10) = 1;
 out(1:2:10, 6:2:10) = 0.7;
 out(2:2:10, 7:2:10) = 0.7;
 assert (checkerboard (1, 5), out)
 assert (checkerboard (1, 5, 5), out)
 assert (checkerboard (1, [5 5]), out)
***** test
 out = zeros (20);
 out([1:4:20 2:4:20], [3:4:20 4:4:20]) = 1;
 out([3:4:20 4:4:20], [1:4:20 2:4:20]) = 1;
 out([1:4:20 2:4:20], [11:4:20 12:4:20]) = 0.7;
 out([3:4:20 4:4:20], [13:4:20 14:4:20]) = 0.7;
 assert (checkerboard (2, 5), out)
 assert (checkerboard (2, 5, 5), out)
 assert (checkerboard (2, [5 5]), out)
***** test
 out = zeros (4, 4, 4);
 out([1 3], 1, [1 3]) = 1;
 out([2 4], 2, [1 3]) = 1;
 out([1 3], 2, [2 4]) = 1;
 out([2 4], 1, [2 4]) = 1;
 out([1 3], 3, [1 3]) = 0.7;
 out([2 4], 4, [1 3]) = 0.7;
 out([1 3], 4, [2 4]) = 0.7;
 out([2 4], 3, [2 4]) = 0.7;
 assert (checkerboard (1, [2 2 2]), out)
 assert (checkerboard (1, 2, 2, 2), out)
***** test
 out = zeros (8, 8, 8);
 out([1 2 5 6], [1 2], [1 2 5 6]) = 1;
 out([3 4 7 8], [3 4], [1 2 5 6]) = 1;
 out([1 2 5 6], [3 4], [3 4 7 8]) = 1;
 out([3 4 7 8], [1 2], [3 4 7 8]) = 1;
 out([1 2 5 6], [5 6], [1 2 5 6]) = 0.7;
 out([3 4 7 8], [7 8], [1 2 5 6]) = 0.7;
 out([1 2 5 6], [7 8], [3 4 7 8]) = 0.7;
 out([3 4 7 8], [5 6], [3 4 7 8]) = 0.7;
 assert (checkerboard (2, [2 2 2]), out)
 assert (checkerboard (2, 2, 2, 2), out)
14 tests, 14 passed, 0 known failure, 0 skipped
[ordfiltn]
>>>>> /usr/share/octave/packages/image-2.6.1/ordfiltn.m
***** shared b, f, s
 b = [ 0  1  2  3
       1  8 12 12
       4 20 24 21
       7 22 25 18];

 f = [ 8 12 12 12
      20 24 24 24
      22 25 25 25
      22 25 25 25];
***** assert (ordfiltn (b, 9, true (3)), f);

 f = [ 1  8 12 12
       8 20 21 21
      20 24 24 24
      20 24 24 24];
***** assert (ordfiltn (b, 8, true (3)), f);

 f = [ 1  2  8 12
       4 12 20 21
       8 22 22 21
      20 24 24 24];
***** assert (ordfiltn (b, 7, true (3), "symmetric"), f);

 f = [ 1  8 12 12
       4 20 24 21
       7 22 25 21
       7 22 25 21];
***** assert (ordfiltn (b, 3, true (3, 1)), f);

 f = [ 1  8 12 12
       4 20 24 18
       4 20 24 18
       4 20 24 18];
***** assert (ordfiltn (b, 3, true (4, 1)), f);

 f = [ 4 20 24 21
       7 22 25 21
       7 22 25 21
       7 22 25 21];
***** assert (ordfiltn (b, 4, true (4, 1)), f);

 s = [0 0 1
      0 0 1
      0 0 1];
 f = [ 2  8 12 12
       9 20 22 21
      21 25 24 24
      21 25 24 24];
***** assert (ordfiltn (b, 8, true (3), s), f);

 b(:,:,2) = b(:,:,1) - 1;
 b(:,:,3) = b(:,:,2) - 1;
 f(:,:,1) = [ 1  8 11 11
              8 20 21 21
              20 24 24 24
              20 24 24 24];
 f(:,:,2) = [ 6 10 11 11
             18 22 22 22
             20 24 24 24
             20 24 24 24];
 f(:,:,3) = [ 0  7 10 10
              7 19 20 20
             19 23 23 23
             19 23 23 23];
***** assert (ordfiltn (b, 25, true (3, 3, 3)), f);
8 tests, 8 passed, 0 known failure, 0 skipped
[imregionalmax]
>>>>> /usr/share/octave/packages/image-2.6.1/imregionalmax.m
***** test
 a = [
    7    3    9    3   10    3
    4    2    3   10    1    3
    1    4    6    9    4   10
    8    7    9    3    4    8
    5    9    3    3    8    9
    3    6    9    4    1   10];

 a4 = [
    1    0    1    0    1    0
    0    0    0    1    0    0
    0    0    0    0    0    1
    1    0    1    0    0    0
    0    1    0    0    0    0
    0    0    1    0    0    1];
 assert (imregionalmax (a, 4), logical (a4))
 a8 = [
    1    0    0    0    1    0
    0    0    0    1    0    0
    0    0    0    0    0    1
    0    0    0    0    0    0
    0    0    0    0    0    0
    0    0    0    0    0    1];
 assert (imregionalmax (a, 8), logical (a8))
 assert (imregionalmax (a), logical (a8))
1 test, 1 passed, 0 known failure, 0 skipped
[imhist]
>>>>> /usr/share/octave/packages/image-2.6.1/imhist.m
***** shared nn, bb, enn, ebb
 [nn, bb] = imhist(logical([0 1 0 0 1]));
***** assert({nn, bb}, {[3 2]', [0 1]'})
 [nn, bb] = imhist([0 0.2 0.4 0.9 1], 5);
***** assert({nn, bb}, {[1 1 1 0 2]', [0 0.25 0.5 0.75 1]'})
 [nn, bb] = imhist([-2 0 0.2 0.4 0.9 1 5], 5);
***** assert({nn, bb}, {[2 1 1 0 3]', [0 0.25 0.5 0.75 1]'})
 [nn, bb] = imhist(uint8([0 32 255]), 256);
 enn = zeros(256, 1); enn([1, 33, 256]) = 1;
 ebb = 0:255;
***** assert({nn, bb}, {enn, ebb'})
 [nn, bb] = imhist(int8([-50 0 100]), 31);
 enn = zeros(31, 1); enn([10, 16, 28]) = 1;
 ebb = -128:8.5:127;
***** assert({nn, bb}, {enn, ebb'})
5 tests, 5 passed, 0 known failure, 0 skipped
[applylut]
>>>>> /usr/share/octave/packages/image-2.6.1/applylut.m
***** demo
 lut = makelut (inline ('sum (x (:)) >= 3', 'x'), 3);
 S = applylut (eye (5), lut);
 disp (S)
 ## Everything should be 0 despite a diagonal which doesn't reach borders.
***** assert (prod (applylut (eye (3), makelut (@(x) x(1) == 1, 2)) == eye (3)), [1 1 1]);
***** assert (prod (applylut (eye (3), makelut (@(x) x(2,2) == 1, 3)) == eye (3)), [1 1 1]);
***** assert (prod (applylut (eye (3), makelut (@(x) x(3,3) == 1, 3)) ==
              applylut (eye (3), makelut (@(x) x(2,2) == 1, 2))),
        [1 1 1]);
3 tests, 3 passed, 0 known failure, 0 skipped
[lab2xyz]
>>>>> /usr/share/octave/packages/image-2.6.1/lab2xyz.m
***** assert (lab2xyz ([0, 0, 0]), [0 0 0], 1e-3)
***** assert (lab2xyz ([53.24, 80.09, 67.20]), [0.4125, 0.2127, 0.0193], 1e-3)
***** assert (lab2xyz ([97.14, -21.55, 94.48]), [0.7700, 0.9278, 0.1385], 1e-3)
***** assert (lab2xyz ([87.74, -86.18, 83.18]), [0.3576, 0.7152, 0.1192], 1e-3)
***** assert (lab2xyz ([91.11, -48.09, -14.13]), [0.5380, 0.7873, 1.0694], 1e-3)
***** assert (lab2xyz ([32.30, 79.19, -107.86]), [0.1804, 0.07217, 0.9502], 1e-3)
***** assert (lab2xyz ([60.32, 98.24, -60.83]), [0.5929, 0.28484, 0.9696], 1e-3)
***** assert (lab2xyz ([100, 0.00, 0.00]), [0.9505, 1.0000, 1.0888], 1e-3)
***** assert (lab2xyz ([53.39, 0.00, 0.00]), [0.2034, 0.2140, 0.2330], 1e-3)
***** assert (lab2xyz ([39.77, 64.51, 54.13]), [0.2155, 0.1111, 0.0101], 1e-3)
***** assert (lab2xyz ([25.42, 47.91, 37.91]), [0.0883, 0.0455, 0.0041], 1e-3)
***** assert (lab2xyz ([9.66, 29.68, 15.24]), [0.02094, 0.0108, 0.00098], 1e-3)
***** assert (lab2xyz ([68.11, 48.39, 22.83]), [0.5276, 0.3812, 0.2482], 1e-3)
***** assert (lab2xyz ([150 130 130]), [4.596, 2.931, 0.519], 1e-3)
***** test
 lab_map = rand (64, 3);
 lab_map(:,1) = lab_map(:,1) .* 100;
 lab_map(:,2) = lab_map(:,2) .* 254 - 127;
 lab_map(:,3) = lab_map(:,3) .* 254 - 127;
 assert (xyz2lab (lab2xyz (lab_map)), lab_map, 1e-5);
***** test
 lab_img = rand (64, 64, 3);
 lab_img(:,:,1) = lab_img(:,:,1) .* 100;
 lab_img(:,:,2) = lab_img(:,:,2) .* 254 - 127;
 lab_img(:,:,3) = lab_img(:,:,3) .* 254 - 127;
 assert (xyz2lab (lab2xyz (lab_img)), lab_img, 1e-5);
***** assert (lab2xyz (sparse ([0 0 0])), [0 0 0], 1e-3)
***** assert (lab2xyz (sparse ([100, 0.00, 0.00])), [0.9505, 1.0000, 1.0888], 1e-3)
***** assert (class (lab2xyz (single([50 50 50]))), 'single')
***** error lab2xyz ()
***** error lab2xyz (1,2)
***** error <invalid data type 'cell'> lab2xyz ({1})
***** error <Lab must be a colormap or Lab image> lab2xyz (ones (2,2))
***** test
 lab = rand (16, 16, 3, 5);
 lab(:,:,1,:) = lab(:,:,1,:) .* 100;
 lab(:,:,2,:) = lab(:,:,2,:) .* 254 - 127;
 lab(:,:,3,:) = lab(:,:,3,:) .* 254 - 127;
 xyz = zeros (size (lab));
 for i = 1:5
   xyz(:,:,:,i) = lab2xyz (lab(:,:,:,i));
 endfor
 assert (lab2xyz (lab), xyz)
24 tests, 24 passed, 0 known failure, 0 skipped
[lab2double]
>>>>> /usr/share/octave/packages/image-2.6.1/lab2double.m
***** test
 l_max_f = 100 + (25500 / 65280);
 ab_max_f = 127 + (255 / 256);
 cm = [
   -Inf
   Inf
   NaN
   l_max_f
   ab_max_f
   -200
   -129
   -128
   -128+(255/65280)*(0.499999)
   -128+(255/65280)*(0.500001) # should be 0.5, but float rounding error
   -128+(255/65280)*(0.500002)
   -127
   -1
   0
   (100/65280)*(0.499999)
   (100/65280)*(0.51)
   (100/65280)*(0.500001)
   1
   99
   100
   101
   126
   127
   128
   254
   255
   256
   257];
 cm = repmat (cm, [1 3]);
 im2d = reshape (cm, [7 4 3]);
 imnd = permute (im2d, [1 4 3 2]);

 cm_uint8 = uint8 ([
     0    0    0
   255  255  255
   255  255  255
   255  228  228
   255  255  255
     0    0    0
     0    0    0
     0    0    0
     0    0    0
     0    0    0
     0    0    0
     0    1    1
     0  127  127
     0  128  128
     0  128  128
     0  128  128
     0  128  128
     3  129  129
   252  227  227
   255  228  228
   255  229  229
   255  254  254
   255  255  255
   255  255  255
   255  255  255
   255  255  255
   255  255  255
   255  255  255]);

 assert (lab2uint8 (cm), cm_uint8)
 im2d_uint8 = reshape (cm_uint8, [7 4 3]);
 assert (lab2uint8 (im2d), im2d_uint8)
 assert (lab2uint8 (imnd), permute (im2d_uint8, [1 4 3 2]))

 cm_uint16 = uint16 ([
       0      0      0
   65535  65535  65535
   65535  65535  65535
   65535  58468  58468
   65535  65535  65535
       0      0      0
       0      0      0
       0      0      0
       0      0      0
       0      1      1
       0      1      1
       0    256    256
       0  32512  32512
       0  32768  32768
       0  32768  32768
       1  32768  32768
       1  32768  32768
     653  33024  33024
   64627  58112  58112
   65280  58368  58368
   65535  58624  58624
   65535  65024  65024
   65535  65280  65280
   65535  65535  65535
   65535  65535  65535
   65535  65535  65535
   65535  65535  65535
   65535  65535  65535]);

 assert (lab2uint16 (cm), cm_uint16)
 im2d_uint16 = reshape (cm_uint16, [7 4 3]);
 assert (lab2uint16 (im2d), im2d_uint16)
 assert (lab2uint16 (imnd), permute (im2d_uint16, [1 4 3 2]))

 assert (lab2single (cm), single (cm))
 assert (lab2single (im2d), single (im2d))
 assert (lab2single (imnd), single (imnd))
1 test, 1 passed, 0 known failure, 0 skipped
[rgb2ycbcr]
>>>>> /usr/share/octave/packages/image-2.6.1/rgb2ycbcr.m
***** test
 in(:,:,1) = magic (5);
 in(:,:,2) = magic (5);
 in(:,:,3) = magic (5);
 out(:,:,1) = [31  37  17  23  29
               36  20  22  28  30
               19  21  27  33  35
               25  26  32  34  19
               25  31  37  18  24];
 out(:,:,2) = 128;
 out(:,:,3) = 128;
 assert (rgb2ycbcr (uint8 (in)), uint8 (out));
***** shared cbcr
 cbcr = 0.5019607843137255;
 out(1:10, 1)  = linspace (16/255, 235/255, 10);
 out(:, [2 3]) = cbcr;
 assert (rgb2ycbcr (gray (10)), out, 0.00001);
***** assert (rgb2ycbcr ([1 1 1]), [0.92157 cbcr cbcr], 0.0001);
2 tests, 2 passed, 0 known failure, 0 skipped
[stretchlim]
>>>>> /usr/share/octave/packages/image-2.6.1/stretchlim.m
***** error (stretchlim ());
***** error (stretchlim ("bad parameter"));
***** error (stretchlim (zeros (10, 10), "bad parameter"));
***** error (stretchlim (zeros (10, 10), 0.01, 2));
***** assert (stretchlim (0.01:.01:1), [0.02; 0.99])
***** assert (stretchlim (0.01:.01:1), stretchlim (0.01:.01:1, [0.01 0.99]))
***** assert (stretchlim (0.01:.01:1, 0.15), stretchlim (0.01:.01:1, [0.15 0.85]))
***** assert (stretchlim (0.01:.01:1, [0.01,0.95]), [0.02; 0.95], eps)
***** assert (stretchlim (0.01:.01:1, 0), [0.01; 1])
***** test
 im = rand (5);
 assert (stretchlim (im, 0), [min(im(:)); max(im(:))])
***** test
 im = rand (5, 5, 3);
 assert (stretchlim (im, 0),
         [min(im(:,:,1)(:)) min(im(:,:,2)(:)) min(im(:,:,3)(:));
          max(im(:,:,1)(:)) max(im(:,:,2)(:)) max(im(:,:,3)(:))])
***** test
 im = rand (5);
 assert (stretchlim (im, 0.03), [min(im(:)); max(im(:))])
 assert (stretchlim (im, 0.0399), [min(im(:)); max(im(:))])
***** assert (stretchlim (uint8 (1:100)), im2double (uint8 ([2; 99])))
***** assert (stretchlim (uint8 (1:100), .25), im2double (uint8 ([26; 75])))
***** assert (stretchlim (uint16  (1:1000)), im2double (uint16 ([11; 990])))
***** assert (stretchlim (int16 (-100:100)), im2double (int16 ([-98; 98])))
***** assert (stretchlim (single (0.01:.01:1)),
         double (single (0.01:.01:1)([2; 99])).')
***** assert (stretchlim (uint8 ([1 repmat(2, [1, 90]) 92:100]), 0.05),
        im2double (uint8 ([2; 95])))
***** assert (stretchlim (uint8 ([1 repmat(2, [1 4]) 6:100]), 0.05),
        im2double (uint8 ([6; 95])))
***** assert (stretchlim (uint8 ([1 repmat(2, [1 5]) 7:100]), 0.05),
        im2double (uint8 ([2; 95])))
***** assert (stretchlim (uint8 ([1 repmat(2, [1 6]) 8:100]), 0.05),
        im2double (uint8 ([2; 95])))
***** assert (stretchlim (uint8 ([1 repmat(2, [1 7]) 9:100]), 0.05),
        im2double (uint8 ([2; 95])))
***** assert (stretchlim (uint8 ([1 repmat(2, [1 8]) 10:100]), 0.05),
        im2double (uint8 ([2; 95])))
***** assert (stretchlim (uint8 ([1 repmat(2, [1 5]) repmat(3, [1 5]) 9:100]), 0.04),
        im2double (uint8 ([2; 96])))
***** assert (stretchlim (uint8 ([1 repmat(2, [1 5]) repmat(3, [1 5]) 9:100]), 0.05),
        im2double (uint8 ([2; 95])))
***** assert (stretchlim (uint8 ([1 repmat(2, [1 5]) repmat(3, [1 5]) 9:100]), 0.06),
        im2double (uint8 ([3; 94])))
***** assert (stretchlim (uint8 ([1 repmat(2, [1 5]) repmat(3, [1 5]) 9:100]), 0.07),
        im2double (uint8 ([3; 93])))
***** assert (stretchlim (uint8 ([1 repmat(2, [1 5]) repmat(3, [1 5]) 9:100]), 0.08),
        im2double (uint8 ([3; 92])))
***** test
 RGB = zeros (100, 1, 3, "uint16");
 RGB(:,:,1) = [1:1:100];
 RGB(:,:,2) = [2:2:200];
 RGB(:,:,3) = [4:4:400];
 assert (stretchlim (RGB) , im2double (uint16 ([2 4 8; 99 198 396])))
***** test
 im6c = zeros (100, 1, 6, "uint16");
 im6c(:,:,1) = [1:1:100];
 im6c(:,:,2) = [2:2:200];
 im6c(:,:,3) = [4:4:400];
 im6c(:,:,4) = [8:8:800];
 im6c(:,:,5) = [16:16:1600];
 im6c(:,:,6) = [32:32:3200];
 assert (stretchlim (im6c) ,
         im2double (uint16 ([2 4 8 16 32 64; 99 198 396 792 1584 3168])))
***** test
 im = [0 0 .1 .1 .1 .1 .2 .2 .2 .4 .4 .6 .6 .7 .7 .9 .9 .9 1 1];

 assert (stretchlim (im), [0; 1])

 ## Consider the returned lower limit in this test.  A lower limit
 ## of 0.1 will saturate two elements (10%), while 0.2 will saturate
 ## 6 elements (30%).  Both have the same distance to 20% but returning
 ## 0.1 is Matlab compatible.
 ## Now looking at the higher limit.  A limit of .9 will saturate
 ## 2 elements (10%), while a limit of 0.7 will saturate 5 elements (25%).
 ## However, for Matlab compatibility we must return .9 even though
 ## 25% would be closer to 20%.
 ## Basically, it's not just rounded.
 assert (stretchlim (im, .2),  [0.1; 0.9])

 assert (stretchlim (im, .15), [0.1; 0.9])
 assert (stretchlim (im, .1),  [0.1; 0.9])
 assert (stretchlim (im, .25), [0.1; 0.7])

 ## Reorder the vector of values (real images don't have the values
 ## already sorted), just to be sure it all works.
 im([6 3 16 11 7 17 14 8 5 19 15 1 2 4 18 13 9 20 10 12]) = im;
 assert (stretchlim (im, .2),  [0.1; 0.9])
 assert (stretchlim (im, .15), [0.1; 0.9])
 assert (stretchlim (im, .1),  [0.1; 0.9])
 assert (stretchlim (im, .25), [0.1; 0.7])
***** assert (stretchlim (0.01:.001:1), [0.019; 0.991], eps)
***** assert (stretchlim (0.01:.001:1, [0.01,0.95]), [0.019; 0.951], eps)
***** assert (stretchlim (0.01:.001:1, 0), [0.01; 1])
***** assert (stretchlim (single (0.01:.001:1)),
         double (single (0.01:.001:1)([10; 982])).')
***** test
 assert (stretchlim ([(.05:.05:1) (2:4)], 0.2), [0.25; 0.95], eps)
 assert (stretchlim ([(.05:.05:1) (2:5)], 0.2), [0.25; 1])
 assert (stretchlim ([(.05:.05:1) (2:6)], 0.2), [0.3; 1])
 assert (stretchlim ([(.05:.05:1) (2:7)], 0.2), [0.3; 1])
***** test
 assert (stretchlim ([(-6:0) (.05:.05:1)], 0.2), [0; 0.75], eps)
 assert (stretchlim ([(-5:0) (.05:.05:1)], 0.2), [0; 0.75], eps)
***** test
 im = rand (4, 4, 2, 3, 2);
 rv = zeros (2, 2, 3, 2);
 for p = 1:2
   for q = 1:3
     for r = 1:2
       rv(:,p,q,r) = stretchlim (im(:,:,p,q,r), 0.25);
     endfor
   endfor
 endfor
 assert (stretchlim (im, 0.25), rv)
***** test
 im = rand (4, 4, 2, 3, 2);
 rv = zeros (2, 2, 3, 2);
 for p = 1:2
   for q = 1:3
     for r = 1:2
       rv(:,p,q,r) = stretchlim (im(:,:,p,q,r), 0);
     endfor
   endfor
 endfor
 assert (stretchlim (im, 0), rv)
***** assert (stretchlim (zeros (5)), [0; 1])
***** assert (stretchlim (ones (5)), [0; 1])
***** assert (stretchlim (.6 * ones (5)), [0; 1])
***** assert (stretchlim (zeros (3, 3, 3, 3)), repmat ([0; 1], [1 3 3]))
***** assert (stretchlim ([0 .5 .5 .5 .5 1], .2), [0; 1])
***** test
 im = repmat ((magic (5) -1) / 24, [1 1 3 3]);
 im(:,:,1,1) = 0;
 im(:,:,2,2) = .5;
 im(:,:,3,3) = 1;
 lims = stretchlim (im, 0.2);
 assert (size (lims), [2 3 3])
 assert (lims(:, [2 3 4 6 7 8]),
         repmat ([(1/24)*round(24*.2); 1-((1/24)*round(24*.2))], [1 6]), eps)
 assert (lims(:, [1 5 9]), repmat ([0; 1], [1 3]))
45 tests, 45 passed, 0 known failure, 0 skipped
[imgetfile]
>>>>> /usr/share/octave/packages/image-2.6.1/imgetfile.m
***** assert (1)
1 test, 1 passed, 0 known failure, 0 skipped
[montage]
>>>>> /usr/share/octave/packages/image-2.6.1/montage.m
***** function cdata = montage_cdata (varargin)
  h = figure ();
  set (h, "visible", "off");
  mh = montage (varargin{:});
  cdata = get (mh, "cdata");
  close (h);
***** endfunction
***** test
 im = uint8 (ones (2, 2, 1, 5)) .* reshape ([1 2 3 4 5], [1 1 1 5]);
 cdata = montage_cdata (im);
 expected = uint8 ([
   1 1 2 2 3 3
   1 1 2 2 3 3
   4 4 5 5 0 0
   4 4 5 5 0 0
 ]);
 assert (cdata, expected)
***** test
 im = uint8 (ones (2, 4, 1, 6)) .* reshape ([1 2 3 4 5 6], [1 1 1 6]);
 cdata = montage_cdata (im);
 expected = uint8 ([
   1 1 1 1 2 2 2 2
   1 1 1 1 2 2 2 2
   3 3 3 3 4 4 4 4
   3 3 3 3 4 4 4 4
   5 5 5 5 6 6 6 6
   5 5 5 5 6 6 6 6
 ]);
 assert (cdata, expected)
2 tests, 2 passed, 0 known failure, 0 skipped
[blockproc]
>>>>> /usr/share/octave/packages/image-2.6.1/blockproc.m
***** demo
 blockproc(eye(6),[2,2],inline("any(x(:))","x"))
 # Returns a 3-by-3 diagonal
***** assert(blockproc(eye(6),[2,2],"sum"),blockproc(eye(6),[2,2],@sum));
***** assert(blockproc(eye(6),[2,2],"sum"),blockproc(eye(6),[2,2],inline("sum(x)","x")));
***** assert(blockproc(eye(6),[1,2],@sum),kron(eye(3),[1;1]));
***** assert(blockproc(eye(6),[2,2],inline("any(x(:))","x")),eye(3)!=0);
***** 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]);
***** 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]);
***** assert(blockproc(eye(6),[2,3],[4,3],inline("sum(x(:))","x")),ones(3,2)*6);
***** assert(blockproc(eye(6),[2,2],inline("int8(sum(x(:)))","x")),eye(3,"int8")*2);
***** 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]);
***** 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]);
***** 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]);
***** 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]);
12 tests, 12 passed, 0 known failure, 0 skipped
[xyz2lab]
>>>>> /usr/share/octave/packages/image-2.6.1/xyz2lab.m
***** assert (xyz2lab ([0, 0, 0]), [0 0 0], 5e-2)
***** assert (xyz2lab ([0.4125, 0.2127, 0.0193]), [53.24, 80.09, 67.20], 5e-2)
***** assert (xyz2lab ([0.7700, 0.9278, 0.1385]), [97.14, -21.55, 94.48], 5e-2)
***** assert (xyz2lab ([0.3576, 0.7152, 0.1192]), [87.74, -86.18, 83.18], 5e-2)
***** assert (xyz2lab ([0.5380, 0.7873, 1.0694]), [91.11, -48.09, -14.13], 5e-2)
***** assert (xyz2lab ([0.1804, 0.07217, 0.9502]), [32.30, 79.19, -107.86], 5e-2)
***** assert (xyz2lab ([0.5929, 0.28484, 0.9696]), [60.32, 98.24, -60.83], 5e-2)
***** assert (xyz2lab ([0.9505, 1.0000, 1.0888]), [100, 0.00, 0.00], 5e-2)
***** assert (xyz2lab ([0.2034, 0.2140, 0.2330]), [53.39, 0.00, 0.00], 5e-2)
***** assert (xyz2lab ([0.2155, 0.1111, 0.0101]), [39.77, 64.51, 54.13], 5e-2)
***** assert (xyz2lab ([0.0883, 0.0455, 0.0041]), [25.42, 47.91, 37.91], 5e-2)
***** assert (xyz2lab ([0.02094, 0.0108, 0.00098]), [9.66, 29.68, 15.24], 5e-2)
***** assert (xyz2lab ([0.5276, 0.3812, 0.2482]), [68.11, 48.39, 22.83], 5e-2)
***** assert (xyz2lab ([1.5 1 1]), [100, 82.15, 5.60], 5e-2)
 xyz_map = rand (64, 3);
 assert (lab2xyz (xyz2lab (xyz_map)), xyz_map, 1e-5);
***** test
 xyz_img = rand (64, 64, 3);
 assert (lab2xyz (xyz2lab (xyz_img)), xyz_img, 1e-5);
***** assert (xyz2lab (sparse ([0 0 0])), [0 0 0], 5e-2)
***** assert (class (xyz2lab (single([0.5 0.5 0.5]))), 'single')
***** error xyz2lab ()
***** error xyz2lab (1,2)
***** error <invalid data type 'cell'> xyz2lab ({1})
***** error <XYZ must be a colormap or XYZ image> xyz2lab (ones (2,2))
***** test
 xyz = rand (16, 16, 3, 5);
 lab = zeros (size (xyz));
 for i = 1:5
   lab(:,:,:,i) = xyz2lab (xyz(:,:,:,i));
 endfor
 assert (xyz2lab (xyz), lab)
22 tests, 22 passed, 0 known failure, 0 skipped
[imadd]
>>>>> /usr/share/octave/packages/image-2.6.1/imadd.m
***** assert (imadd (uint8   ([23 250]), uint8   ([23 250])),            uint8   ([46 255])); # default to first class and truncate
***** assert (imadd (uint8   ([23 250]), 10),                            uint8   ([33 255])); # works adding a scalar
***** assert (imadd (uint8   ([23 250]), uint8   ([23 250]), "uint16"),  uint16  ([46 500])); # defining output class works
***** assert (imadd (logical ([ 1   0]), logical ([ 1   1])),            double  ([ 2   1])); # return double for two logical images
***** assert (imadd (logical ([ 1   0]), logical ([ 1   1]), "logical"), logical ([ 1   1])); # this is matlab incompatible on purpose
***** fail  ("imadd (uint8   ([23 250]), uint16  ([23 250]))");                               # input need to have same class
6 tests, 6 passed, 0 known failure, 0 skipped
[isrgb]
>>>>> /usr/share/octave/packages/image-2.6.1/isrgb.m
***** assert (isrgb ("this is not a RGB image"), false);
***** assert (isrgb (rand (5, 5)), false);
***** assert (isrgb (rand (5, 5, 1, 5)), false);
***** assert (isrgb (rand (5, 5, 3, 5)), true);
***** assert (isrgb (rand (5, 5, 3)), true);
***** assert (isrgb (ones (5, 5, 3)), true);
***** assert (isrgb (ones (5, 5, 3) + eps), false);
***** assert (isrgb (zeros (5, 5, 3) - eps), false);
***** assert (isrgb (rand (5, 5, 3) > 0.5), false);
***** assert (isrgb (randi ([-100 100], 5, 5, 3, "int16")), true)
10 tests, 10 passed, 0 known failure, 0 skipped
[imbothat]
>>>>> /usr/share/octave/packages/image-2.6.1/imbothat.m
***** assert (imbothat (ones (3), [1 1; 0 1]), zeros (3));
***** assert (imbothat (true (3), [1 1; 0 1]), false (3));
***** shared in, out, se
 in =  [ 0   0   0   1   1   1   0   0   1   1
         0   1   0   1   1   1   0   0   0   1
         1   1   1   1   1   0   0   0   0   0
         0   1   1   1   1   0   0   0   0   0
         0   0   0   1   0   0   0   0   1   0
         0   0   0   0   0   0   0   1   1   1
         0   0   0   0   1   0   1   0   1   0
         0   0   0   1   1   1   1   1   0   0
         0   0   0   0   1   1   1   0   0   0
         0   0   0   1   1   1   0   0   0   0];

 out = [ 1   1   1   0   0   0   1   1   0   0
         1   0   1   0   0   0   0   0   0   0
         0   0   0   0   0   0   0   0   0   1
         1   0   0   0   0   0   0   0   0   1
         0   0   0   0   1   0   0   0   0   1
         0   0   0   1   1   1   1   0   0   0
         0   0   0   1   0   1   0   1   0   1
         0   0   0   0   0   0   0   0   0   0
         0   0   0   1   0   0   0   0   0   0
         0   0   0   0   0   0   1   0   0   0];
***** assert (imbothat (logical (in), ones (3)), logical (out));

 out = [ 7    0   15    8    1    6    0   13    6   24
         0    8    9    2    0    0   16    7    0   23
        89    7    0   41   39    7   12    7    0   23
         8    1   69   40   58    1    6    2    0   43
         7    0   63   59   52    0    0    0   14   32
        62   55    6    7    0    7    0   23   16    1
        56   74    0    2    0    0   16   14    7    0
         0   73   69    0    0   19   15    8    1    0
         8    6    0    0    6   13    9    2    0    6
         7    0    0   19    0   14    7    0   23    0];
***** assert (imbothat (magic (10), ones (3)), out);
***** assert (imbothat (uint8 (magic (10)), strel ("square", 3)), uint8 (out));

 ## using a se that will be decomposed in 2 pieces
 out =[ 7    0   87   66   59    7    0   19   12   30
        0   13   81   60   58    1   19   13    6   29
       89   12    0   54   52   20   18    7    0   23
        8    6   69   53   71   14   12    2    0   43
        7    0   63   73   66   14    7    0   23   41
       76   69   14    7    0   30   23   46   39    7
       70   88    9    2    0   24   42   40   33    6
       14   87   80    0    0   43   41   34   27    0
       84   82    0    0   19   37   35   28   26   19
       89   82    0   20   13   36   29   22   45   13];
***** assert (imbothat (magic (10), ones(5)), out);

 ## using a weird non-symmetric and even-size se
 out =[ 0    0   15    8    1    3    0    7    0   18
        0    8   53   59    0    0   14   13    0   17
       84    0    0   40   38    6   13    6    0   23
        2    0   42   47   58    0    6    0    0   41
        0    0   62   59   52    0    0    0   16   35
        6   58   13    6    0    3   19   19   35    1
        0   18    0    0    0    0   15   13    6    0
        0   17   69    0    0   17   17    8    0    0
        8   67    0    0    0   15    9    2    0    6
        7    0    0   17   10   42    7    0   19    0];
***** assert (imbothat (magic (10), [1 0 0 0; 1 1 1 0; 0 1 0 1]), out);

 ## N dimensional and weird se
 in = reshape (magic(16), [4 8 4 2]);
 se = ones (3, 3, 3);
 se(:,:,1) = [1 0 1; 0 1 1; 0 0 0];
 se(:,:,3) = [1 0 1; 0 1 1; 0 0 1];
 out = zeros (size (in));
 out(:,:,1,1) = [
     0   17   81  145  237  146   64    0
   205  128   64    0    0   37   83  147
   175  111   47    0    0   64  117  181
     0   64  128  209  173  109   45    0];
 out(:,:,2,1) = [
   235  142   78   18    0   23   69  133
     0   35  103  163  215  128   46    0
     0   64  128  195  183  123   48    0
   153   93   43    0   14   78  146  215];
 out(:,:,3,1) = [
     0   25   89  153  229  142   64    0
   201  128   64    0    0   41   91  155
   167  103   57    0    0   64  125  189
     0   64  146  217  165  101   37    0];
 out(:,:,4,1) = [
   227  142   78   14    0   31   77  141
     0   43  107  171  211  128   46    0
     0   64  128  203  179  115   48    0
   149   99   35    0   18   82  146  223];
 out(:,:,1,2) = [
     0   33   97  161  221  146   64    0
   189  125   61    0    0   53   99  163
   159   95   31    0    0   64  128  197
     0   64  128  225  157   93   29    0];
 out(:,:,2,2) = [
   219  142   78   18    0   39   85  149
     0   51  119  179  199  128   46    0
     0   64  128  211  167  107   43    0
   137   77   27    0   14   78  146  231];
 out(:,:,3,2) = [
     0   41  105  169  213  142   64    0
   185  121   64    0    0   57  107  171
   151   87   41    0    0   64  128  205
     0   64  146  233  149   85   21    0];
 out(:,:,4,2) = [
   211  142   78   14    0   47   93  157
     0   59  123  187  195  128   46    0
     0   64  128  219  163   99   35    0
   133   83   19    0   18   82  146  239];
***** assert (imbothat (in, se), out);
8 tests, 8 passed, 0 known failure, 0 skipped
[isind]
>>>>> /usr/share/octave/packages/image-2.6.1/isind.m
***** assert (isind ([]), false);
***** assert (isind (1:10), true);
***** assert (isind (0:10), false);
***** assert (isind (1), true);
***** assert (isind (0), false);
***** assert (isind ([1.3 2.4]), false);
***** assert (isind ([1 2; 3 4]), true);
***** assert (isind (randi (100, 10, 10, 1, 4)), true);
***** assert (isind (randi (100, 10, 10, 3, 4)), false);
***** assert (isind (randi (100, 10, 10, 1, 4, 2)), false);
10 tests, 10 passed, 0 known failure, 0 skipped
[imtophat]
>>>>> /usr/share/octave/packages/image-2.6.1/imtophat.m
***** assert (imtophat (ones (3), [1 1; 0 1]), zeros (3));
***** assert (imtophat (true (3), [1 1; 0 1]), false (3));
***** shared in, out, se
 in =  [ 0   0   0   1   1   1   0   0   1   1
     0   1   0   1   1   1   0   0   0   1
     1   1   1   1   1   0   0   0   0   0
     0   1   1   1   1   0   0   0   0   0
     0   0   0   1   0   0   0   0   1   0
     0   0   0   0   0   0   0   1   1   1
     0   0   0   0   1   0   1   0   1   0
     0   0   0   1   1   1   1   1   0   0
     0   0   0   0   1   1   1   0   0   0
     0   0   0   1   1   1   0   0   0   0];

 out = [ 0   0   0   0   0   0   0   0   1   1
         0   1   0   0   0   0   0   0   0   1
         1   1   1   1   1   0   0   0   0   0
         0   1   1   1   1   0   0   0   0   0
         0   0   0   1   0   0   0   0   1   0
         0   0   0   0   0   0   0   1   1   1
         0   0   0   0   1   0   1   0   1   0
         0   0   0   1   1   1   1   1   0   0
         0   0   0   0   1   1   1   0   0   0
         0   0   0   1   1   1   0   0   0   0];
***** assert (imtophat (logical (in), ones (3)), logical (out));

 out = [12  19   0   0   0  16  23   0   7   0
        18   0   0   6   1  19   0   2   9   1
         0  74  81  12   7   0   1   8  15   7
        68  70   2  14   0   6   7  14  16   0
        69  76   8   0   0   7  14  21   0   1
         0   7  59  54  61  13  20   0   0  32
        18   0  69  60  62  19   0   0   0  27
        73   0   0  66  68   0   1   6   6  33
         0   0  17  19   1   0   2   9   7  14
         1   6  23   0   7   1   8  15   0  32];
***** assert (imtophat (magic (10), ones (3)), out);
***** assert (imtophat (uint8 (magic (10)), strel ("square", 3)), uint8 (out));

 ## using a se that will be decomposed in 2 pieces
 out =[91  98   0   0   0  27  34  11  18   0
       94  76   3   6   1  33  15  17  24   1
        0  77  84  12   7  14  16  23  30   7
       80  82  14  18   0  32  34  41  43   0
       81  88  20   0   0  33  40  47  24   6
       12  19  63  57  64  16  23   0   7  39
       18   0  69  60  62  19   1   3  12  39
       73   0   0  66  68   0   2   9  18  45
        4   6  81  67  49   6   8  15  19  26
        5  12  87  48  55   7  14  21   0  32];
***** assert (imtophat (magic (10), ones(5)), out);

 ## using a weird non-symmetric and even-size se
 out =[85  92   0   0   0  12  23   0  17   0
       91  73   0   6   0  18   0   2  13   0
        0  72  81  13   6   0   1   9  15   0
       60  62  10  12   0   8   8  17  17   0
       61  69   0   0   0  28  16  41   0   0
        0   0  47  52  61  12  16   0   0  31
        6   0  53  58  60  17   0   0   0  33
       69   0   0  60  62   0   0   6   0  33
        0   0  17  60  42   0   2  13   1   8
        0   6  23   0   7   0   7  15   0  14];
***** assert (imtophat (magic (10), [1 0 0 0; 1 1 1 0; 0 1 0 1]), out);

 ## N dimensional and weird se
 in = reshape (magic(16), [4 8 4 2]);
 se = ones (3, 3, 3);
 se(:,:,1) = [1 0 1; 0 1 1; 0 0 0];
 se(:,:,3) = [1 0 1; 0 1 1; 0 0 1];
 out = zeros (size (in));
 out(:,:,1,1) = [
   239  146   82   18    0   19   83  133
     0   35   99  163  219  128   64    0
     0   46  128  195  187  123   59    0
   157   93   47    0   14   78  142  211];
 out(:,:,2,1) = [
     0   21   85  149  233  146   64    0
   205  128   64    0    0   41   87  151
   171  107   57    0    0   64  121  185
     0   64  142  213  169  105   41    0];
 out(:,:,3,1) = [
   231  146   78   14    0   27   77  137
     0   43  107  167  211  128   64    0
     0   46  128  199  179  119   51    0
   149   85   39    0   18   78  142  219];
 out(:,:,4,1) = [
     0   29   93  157  225  128   64    0
   197  128   64    0    0   31   95  159
   163   99   53    0    0   61  125  189
     0   64  146  221  161   97   33    0];
 out(:,:,1,2) = [
   223  146   82   18    0   35   99  149
     0   48  115  179  203  128   64    0
     0   46  128  211  171  107   43    0
   141   77   31    0   14   78  142  227];
 out(:,:,2,2) = [
     0   37  101  165  217  146   64    0
   189  125   64    0    0   57  103  167
   155   91   41    0    0   64  128  201
     0   64  142  229  153   89   25    0];
 out(:,:,3,2) = [
   215  146   78   14    0   43   93  153
     0   48  123  183  195  128   64    0
     0   46  128  215  163  103   35    0
   133   69   23    0   18   78  142  235];
 out(:,:,4,2) = [
     0   45  109  173  209  128   64    0
   181  117   64    0    0   47  111  175
   147   83   37    0    0   64  128  205
     0   64  146  237  145   81   17    0];
***** assert (imtophat (in, se), out);
8 tests, 8 passed, 0 known failure, 0 skipped
[fspecial]
>>>>> /usr/share/octave/packages/image-2.6.1/fspecial.m
***** test
 for i = 1:9
   n = 2^i;
   assert (sum (fspecial ("disk", n)(:)), 1, eps*n*n);
 endfor
***** test
 for r = [3 5 9 17]
   f = fspecial ("disk", r);
   [X, Y] = meshgrid (-r:r, -r:r);
   rhi = (abs (X) + 0.5).^2 + (abs (Y) + 0.5).^2;
   rlo = (abs (X) - 0.5).^2 + (abs (Y) - 0.5).^2;
   fhi = (rhi <= (r^2));
   flo = (rlo >= (r^2));
   for i = 1:(2*r+1)
     for j = 1:(2*r+1)
       if (fhi(i,j))
         assert (f(i,j), 1/(pi*r^2), eps);
       endif
       if (flo(i,j))
         assert (f(i,j), 0);
       endif
     endfor
   endfor
 endfor
***** error <LENGTHS must be greater than 0>
  fspecial ("gaussian", 0)
***** error <LENGTHS must be integer>
  fspecial ("gaussian", 3.9)
***** assert (fspecial ("gaussian"), fspecial ("gaussian", 3, 0.5))
***** assert (fspecial ("gaussian"), fspecial ("gaussian", [3 3], 0.5))
***** test
 c = ([-1:1].^2) .+ ([-1:1]'.^2);
 gauss = exp (- (c ./ (2 * (0.5 .^ 2))));
 f = gauss / sum (gauss(:));
 assert (fspecial ("gaussian"), f)

 expected = [
   0.01134373655849507   0.08381950580221061   0.01134373655849507
   0.08381950580221061   0.61934703055717721   0.08381950580221061
   0.01134373655849507   0.08381950580221061   0.01134373655849507];
 assert (f, expected, eps)
***** function f = f_gaussian_2d (hsize, sigma)
  c = ([(-hsize(1)):(hsize(1))]'.^2) .+ ([(-hsize(2)):(hsize(2))].^2);
  gauss = exp (- (c ./ (2 * (sigma .^ 2))));
  f = gauss ./ sum (gauss(:));
***** endfunction
***** test
 f = fspecial ("gaussian");
 assert (f, f_gaussian_2d ([1 1], .5))
 expected = [
   0.01134373655849507   0.08381950580221061   0.01134373655849507
   0.08381950580221061   0.61934703055717721   0.08381950580221061
   0.01134373655849507   0.08381950580221061   0.01134373655849507];
 assert (f, expected, eps)
***** test
 f = fspecial ("gaussian", 7, 2);
 assert (f, f_gaussian_2d ([3 3], 2))
 expected = [
    0.00492233115934352
    0.00919612528958620
    0.01338028334410124
    0.01516184737296414
    0.01338028334410124
    0.00919612528958620
    0.00492233115934352
    0.00919612528958620
    0.01718062389630964
    0.02499766026691484
    0.02832606006174462
    0.02499766026691484
    0.01718062389630964
    0.00919612528958620
    0.01338028334410124
    0.02499766026691484
    0.03637138107390363
    0.04121417419979795
    0.03637138107390363
    0.02499766026691484
    0.01338028334410124
    0.01516184737296414
    0.02832606006174462
    0.04121417419979795
    0.04670177773892775];
 expected = reshape ([expected; expected((end-1):-1:1)], [7 7]);
 assert (f, expected, eps)
***** test
 f = fspecial ("gaussian", [7 5], 2);
 assert (f, f_gaussian_2d ([3 2], 2))
 expected = [
    0.01069713252648568
    0.01998487459872362
    0.02907782096336423
    0.03294948784319031
    0.02907782096336423
    0.01998487459872362
    0.01069713252648568
    0.01556423598706978
    0.02907782096336423
    0.04230797985750011
    0.04794122192790870
    0.04230797985750011
    0.02907782096336423
    0.01556423598706978
    0.01763658993191515
    0.03294948784319031
    0.04794122192790870
    0.05432452146574315];
 expected = reshape ([expected; expected((end-1):-1:1)], [7 5]);
 assert (f, expected, eps)
***** test
 f = fspecial ("gaussian", [4 2], 2);
 expected = [0.10945587477855045 0.14054412522144952];
 expected = expected([1 1; 2 2; 2 2; 1 1]);
 assert (f, expected, eps)
***** test
 expected =[0.04792235409415088 0.06153352068439959 0.07901060453704994];
 expected = expected([1 2 2 1; 2 3 3 2; 2 3 3 2; 1 2 2 1]);
 assert (fspecial ("gaussian", 4, 2), expected)
***** function f = f_gaussian_3d (lengths, sigma)
  [x, y, z] = ndgrid (-lengths(1):lengths(1), -lengths(2):lengths(2),
                      -lengths(3):lengths(3));
  sig_22 = 2 * (sigma.^2);
  f = exp (-((x.^2)/sig_22 + (y.^2)/sig_22 + (z.^2)/sig_22));
  f = f / sum (f(:));
***** endfunction
***** test
 obs = fspecial ("gaussian", [5 5 5]);
 assert (obs, f_gaussian_3d ([2 2 2], .5))

 u_values = [
    0.00000000001837155
    0.00000000741161178
    0.00000005476481523
    0.00000299005759843
    0.00002209370333384
    0.00016325161336690
    0.00120627532940896
    0.00891323607975882
    0.06586040141635063
    0.48664620076350640];
 expected = zeros (5, 5, 5);
 expected([1 5 21 25 101 105 121 125]) = u_values(1);
 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);
 expected([3 11 15 23 51 55 71 75 103 111 115 123]) = u_values(3);
 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);
 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);
 expected([13 53 61 65 73 113]) = u_values(6);
 expected([32 34 42 44 82 84 92 94]) = u_values(7);
 expected([33 37 39 43 57 59 67 69 83 87 89 93]) = u_values(8);
 expected([38 58 62 64 68 88]) = u_values(9);
 expected([63]) = u_values(10);
 assert (obs, expected, eps)
***** test
 obs = fspecial ("gaussian", [5 5 5], 1);
 assert (obs, f_gaussian_3d ([2 2 2], 1))

 u_values = [
    0.00016177781678373
    0.00072503787330278
    0.00119538536377748
    0.00324939431236223
    0.00535734551968363
    0.00883276951279243
    0.01456277497493249
    0.02400995686159072
    0.03958572658629712
    0.06526582943894763];
 expected = zeros (5, 5, 5);
 expected([1 5 21 25 101 105 121 125]) = u_values(1);
 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);
 expected([3 11 15 23 51 55 71 75 103 111 115 123]) = u_values(3);
 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);
 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);
 expected([13 53 61 65 73 113]) = u_values(6);
 expected([32 34 42 44 82 84 92 94]) = u_values(7);
 expected([33 37 39 43 57 59 67 69 83 87 89 93]) = u_values(8);
 expected([38 58 62 64 68 88]) = u_values(9);
 expected([63]) = u_values(10);
 assert (obs, expected, eps)
***** test
 obs = fspecial ("gaussian", [3 4 1 5], 3);
 assert (find (obs == max (obs(:))), [29; 32])
 assert (size (obs), [3 4 1 5])
 assert (obs(:)(1:30), obs(:)(end:-1:31))
15 tests, 15 passed, 0 known failure, 0 skipped
[imresize]
>>>>> /usr/share/octave/packages/image-2.6.1/imresize.m
***** test
 in = [116  227  153   69  146  194   59  130  139  106
         2   47  137  249   90   75   16   24  158   44
       155   68   46   84  166  156   69  204   32  152
        71  221  137  230  210  153  192  115   30  118
       107  143  108   52   51   73  101   21  175   90
        54  158  143   77   26  168  113  229  165  225
         9   47  133  135  130  207  236   43   19   73];
 assert (imresize (uint8 (in), 1, "nearest"), uint8 (in))
 assert (imresize (uint8 (in), 1, "bicubic"), uint8 (in))

 out = [116  116  227  227  153  153   69   69  146  146  194  194   59   59  130  130  139  139  106  106
        116  116  227  227  153  153   69   69  146  146  194  194   59   59  130  130  139  139  106  106
          2    2   47   47  137  137  249  249   90   90   75   75   16   16   24   24  158  158   44   44
          2    2   47   47  137  137  249  249   90   90   75   75   16   16   24   24  158  158   44   44
        155  155   68   68   46   46   84   84  166  166  156  156   69   69  204  204   32   32  152  152
        155  155   68   68   46   46   84   84  166  166  156  156   69   69  204  204   32   32  152  152
         71   71  221  221  137  137  230  230  210  210  153  153  192  192  115  115   30   30  118  118
         71   71  221  221  137  137  230  230  210  210  153  153  192  192  115  115   30   30  118  118
        107  107  143  143  108  108   52   52   51   51   73   73  101  101   21   21  175  175   90   90
        107  107  143  143  108  108   52   52   51   51   73   73  101  101   21   21  175  175   90   90
         54   54  158  158  143  143   77   77   26   26  168  168  113  113  229  229  165  165  225  225
         54   54  158  158  143  143   77   77   26   26  168  168  113  113  229  229  165  165  225  225
          9    9   47   47  133  133  135  135  130  130  207  207  236  236   43   43   19   19   73   73
          9    9   47   47  133  133  135  135  130  130  207  207  236  236   43   43   19   19   73   73];
 assert (imresize (uint8 (in), 2, "nearest"), uint8 (out))
 assert (imresize (uint8 (in), 2, "neAreST"), uint8 (out))
 assert (imresize (uint8 (in), [14 NaN], "nearest"), uint8 (out))
 assert (imresize (uint8 (in), [NaN 20], "nearest"), uint8 (out))

 out = [116  116  227  227  153  153   69   69  146  146  194  194   59   59  130  130  139  139  106  106
          2    2   47   47  137  137  249  249   90   90   75   75   16   16   24   24  158  158   44   44
        155  155   68   68   46   46   84   84  166  166  156  156   69   69  204  204   32   32  152  152
         71   71  221  221  137  137  230  230  210  210  153  153  192  192  115  115   30   30  118  118
        107  107  143  143  108  108   52   52   51   51   73   73  101  101   21   21  175  175   90   90
         54   54  158  158  143  143   77   77   26   26  168  168  113  113  229  229  165  165  225  225
          9    9   47   47  133  133  135  135  130  130  207  207  236  236   43   43   19   19   73   73];
 assert (imresize (uint8 (in), [7 20], "nearest"), uint8 (out))

 assert (imresize (uint8 (in), 1.5, "bicubic"), imresize (uint8 (in), 1.5, "cubic"))
 assert (imresize (uint8 (in), [NaN, size(in,2)*1.5], "bicubic"), imresize (uint8 (in), 1.5, "cubic"))
 assert (imresize (uint8 (in), [size(in,1)*1.5, NaN], "bicubic"), imresize (uint8 (in), 1.5, "cubic"))
 assert (imresize (uint8 (in), 1.5, "linear"), imresize (uint8 (in), 1.5, "LIneAR"))
 assert (imresize (uint8 (in), 1.5, "linear"), imresize (uint8 (in), 1.5, "triangle"))

 out = [ 47  249   75   24   44
        221  230  153  115  118
        158   77  168  229  225
        47   135  207   43   73];
 assert (imresize (uint8 (in), 0.5, "nearest"), uint8 (out))
***** assert (imresize (repmat (5, [3 3]), 2), repmat (5, [6 6]), eps*100)
***** assert (imresize (repmat (5, [3 3 2]), 2), repmat (5, [6 6 2]), eps*100)
***** shared in, out
 in = [116  227  153   69  146  194   59  130  139  106
         2   47  137  249   90   75   16   24  158   44
       155   68   46   84  166  156   69  204   32  152
        71  221  137  230  210  153  192  115   30  118
       107  143  108   52   51   73  101   21  175   90
        54  158  143   77   26  168  113  229  165  225
         9   47  133  135  130  207  236   43   19   73];

 out = [116  185  235  171   96   64  134  189  186   74   90   141  140  124  108
         44   92  143  149  164  163  119  123  118   44   38    80  151  118   63
         14   21   47  107  195  228  115   81   70   24   19    56  137  105   49
        145   98   49   49   71  107  148  159  132   58  124   176   61   85  145
        118  139  144   92  116  168  201  188  159  140  167   158   27   69  152
         62  151  218  145  174  219  201  164  146  187  148    84   48   76  115
        102  132  151  119   90   72   72   72   83  114   60    31  144  130   81
         82  121  154  133   87   41   19   67  116   95  108   140  183  180  164
         40   96  152  149  117   74   34  108  179  131  175   215  153  177  219
         11   33   73  127  137  125  113  158  212  229  148    55   35   63   96
          4   17   53  121  141  138  133  171  220  253  141    16    7   36   67];
***** xtest assert (imresize (uint8 (in), 1.5, "bicubic"), uint8 (out))

 out = [116  172  215  165  111   82  133  170  171   81   95   132  138  123  106
         59   98  138  144  152  152  125  127  119   54   58    89  137  112   75
         27   39   62  110  172  202  123   96   78   36   40    68  123  100   62
        129   97   64   62   87  119  146  148  128   74  117   154   73   94  134
        113  129  136  101  125  162  183  172  151  135  146   139   53   83  135
         77  143  195  145  166  197  186  162  146  171  138    92   62   84  113
        101  129  149  120   98   81   78   82   91  111   77    56  132  123   95
         81  116  147  130   96   61   43   80  119  109  116   132  162  164  158
         46   93  139  141  114   80   50  109  168  141  166   189  151  171  200
         16   41   77  123  130  123  115  157  204  214  145    69   48   71   98
          9   28   61  119  134  134  131  169  212  231  140    39   23   46   73];
!!!!! known failure
ASSERT errors for:  assert (imresize (uint8 (in), 1.5, "bicubic"),uint8 (out))

  Location  |  Observed  |  Expected  |  Reason
   (2,1)          26           44        Abs err 18 exceeds tol 0
   (3,1)          21           14        Abs err 7 exceeds tol 0
   (4,1)         132          145        Abs err 13 exceeds tol 0
   (5,1)         140          118        Abs err 22 exceeds tol 0
   (6,1)          71           62        Abs err 9 exceeds tol 0
   (7,1)          92          102        Abs err 10 exceeds tol 0
   (8,1)         102           82        Abs err 20 exceeds tol 0
   (9,1)          72           40        Abs err 32 exceeds tol 0
   (10,1)         28           11        Abs err 17 exceeds tol 0
   (11,1)         9            4         Abs err 5 exceeds tol 0
   (1,2)         198          185        Abs err 13 exceeds tol 0
   (2,2)          78           92        Abs err 14 exceeds tol 0
   (3,2)          9            21        Abs err 12 exceeds tol 0
   (4,2)          70           98        Abs err 28 exceeds tol 0
   (5,2)         150          139        Abs err 11 exceeds tol 0
   (6,2)         180          151        Abs err 29 exceeds tol 0
   (7,2)         162          132        Abs err 30 exceeds tol 0
   (8,2)         130          121        Abs err 9 exceeds tol 0
   (9,2)         137           96        Abs err 41 exceeds tol 0
   (10,2)         80           33        Abs err 47 exceeds tol 0
   (11,2)         21           17        Abs err 4 exceeds tol 0
   (1,3)         227          235        Abs err 8 exceeds tol 0
   (2,3)         138          143        Abs err 5 exceeds tol 0
   (3,3)          42           47        Abs err 5 exceeds tol 0
   (4,3)          26           49        Abs err 23 exceeds tol 0
   (5,3)         117          144        Abs err 27 exceeds tol 0
   (6,3)         213          218        Abs err 5 exceeds tol 0
   (7,3)         182          151        Abs err 31 exceeds tol 0
   (8,3)         142          154        Abs err 12 exceeds tol 0
   (9,3)         176          152        Abs err 24 exceeds tol 0
   (10,3)        139           73        Abs err 66 exceeds tol 0
   (11,3)         77           53        Abs err 24 exceeds tol 0
   (1,4)         164          171        Abs err 7 exceeds tol 0
   (2,4)         151          149        Abs err 2 exceeds tol 0
   (3,4)         100          107        Abs err 7 exceeds tol 0
   (4,4)          47           49        Abs err 2 exceeds tol 0
   (5,4)          73           92        Abs err 19 exceeds tol 0
   (6,4)         138          145        Abs err 7 exceeds tol 0
   (7,4)         128          119        Abs err 9 exceeds tol 0
   (8,4)         119          133        Abs err 14 exceeds tol 0
   (9,4)         144          149        Abs err 5 exceeds tol 0
   (10,4)        145          127        Abs err 18 exceeds tol 0
   (11,4)        127          121        Abs err 6 exceeds tol 0
   (1,5)          86           96        Abs err 10 exceeds tol 0
   (2,5)         200          164        Abs err 36 exceeds tol 0
   (3,5)         211          195        Abs err 16 exceeds tol 0
   (4,5)          78           71        Abs err 7 exceeds tol 0
   (5,5)          91          116        Abs err 25 exceeds tol 0
   (6,5)         184          174        Abs err 10 exceeds tol 0
   (7,5)         124           90        Abs err 34 exceeds tol 0
   (8,5)          65           87        Abs err 22 exceeds tol 0
   (9,5)          95          117        Abs err 22 exceeds tol 0
   (10,5)        130          137        Abs err 7 exceeds tol 0
   (11,5)        144          141        Abs err 3 exceeds tol 0
   (1,6)          73           64        Abs err 9 exceeds tol 0
   (2,6)         185          163        Abs err 22 exceeds tol 0
   (3,6)         222          228        Abs err 6 exceeds tol 0
   (4,6)         120          107        Abs err 13 exceeds tol 0
   (5,6)         161          168        Abs err 7 exceeds tol 0
   (6,6)         240          219        Abs err 21 exceeds tol 0
   (7,6)         134           72        Abs err 62 exceeds tol 0
   (8,6)          18           41        Abs err 23 exceeds tol 0
   (9,6)          34           74        Abs err 40 exceeds tol 0
   (10,6)         85          125        Abs err 40 exceeds tol 0
   (11,6)        131          138        Abs err 7 exceeds tol 0
   (1,7)         128          134        Abs err 6 exceeds tol 0
   (2,7)         115          119        Abs err 4 exceeds tol 0
   (3,7)         121          115        Abs err 6 exceeds tol 0
   (4,7)         139          148        Abs err 9 exceeds tol 0
   (5,7)         204          201        Abs err 3 exceeds tol 0
   (6,7)         220          201        Abs err 19 exceeds tol 0
   (7,7)         127           72        Abs err 55 exceeds tol 0
   (8,7)          16           19        Abs err 3 exceeds tol 0
   (9,7)          4            34        Abs err 30 exceeds tol 0
   (10,7)         55          113        Abs err 58 exceeds tol 0
   (11,7)        123          133        Abs err 10 exceeds tol 0
   (1,8)         197          189        Abs err 8 exceeds tol 0
   (2,8)         104          123        Abs err 19 exceeds tol 0
   (3,8)          76           81        Abs err 5 exceeds tol 0
   (4,8)         157          159        Abs err 2 exceeds tol 0
   (5,8)         206          188        Abs err 18 exceeds tol 0
   (6,8)         174          164        Abs err 10 exceeds tol 0
   (7,8)          98           72        Abs err 26 exceeds tol 0
   (8,8)          49           67        Abs err 18 exceeds tol 0
   (9,8)          77          108        Abs err 31 exceeds tol 0
   (10,8)        130          158        Abs err 28 exceeds tol 0
   (11,8)        164          171        Abs err 7 exceeds tol 0
   (1,9)         179          186        Abs err 7 exceeds tol 0
   (2,9)          99          118        Abs err 19 exceeds tol 0
   (3,9)          65           70        Abs err 5 exceeds tol 0
   (4,9)         120          132        Abs err 12 exceeds tol 0
   (5,9)         164          159        Abs err 5 exceeds tol 0
   (6,9)         154          146        Abs err 8 exceeds tol 0
   (7,9)          98           83        Abs err 15 exceeds tol 0
   (8,9)          88          116        Abs err 28 exceeds tol 0
   (9,9)         146          179        Abs err 33 exceeds tol 0
   (10,9)        206          212        Abs err 6 exceeds tol 0
   (11,9)        223          220        Abs err 3 exceeds tol 0
   (1,10)         80           74        Abs err 6 exceeds tol 0
   (2,10)         42           44        Abs err 2 exceeds tol 0
   (3,10)         25           24        Abs err 1 exceeds tol 0
   (4,10)         44           58        Abs err 14 exceeds tol 0
   (5,10)        133          140        Abs err 7 exceeds tol 0
   (6,10)        192          187        Abs err 5 exceeds tol 0
   (7,10)        151          114        Abs err 37 exceeds tol 0
   (8,10)         92           95        Abs err 3 exceeds tol 0
   (9,10)         92          131        Abs err 39 exceeds tol 0
  (10,10)        173          229        Abs err 56 exceeds tol 0
  (11,10)        255          253        Abs err 2 exceeds tol 0
   (1,11)         70           90        Abs err 20 exceeds tol 0
   (2,11)         7            38        Abs err 31 exceeds tol 0
   (3,11)         14           19        Abs err 5 exceeds tol 0
   (4,11)         98          124        Abs err 26 exceeds tol 0
   (5,11)        180          167        Abs err 13 exceeds tol 0
   (6,11)        173          148        Abs err 25 exceeds tol 0
   (7,11)         90           60        Abs err 30 exceeds tol 0
   (8,11)         61          108        Abs err 47 exceeds tol 0
   (9,11)        137          175        Abs err 38 exceeds tol 0
  (10,11)        176          148        Abs err 28 exceeds tol 0
  (11,11)        160          141        Abs err 19 exceeds tol 0
   (1,12)        135          141        Abs err 6 exceeds tol 0
   (2,12)         51           80        Abs err 29 exceeds tol 0
   (3,12)         58           56        Abs err 2 exceeds tol 0
   (5,12)        192          158        Abs err 34 exceeds tol 0
   (6,12)        104           84        Abs err 20 exceeds tol 0
   (7,12)         19           31        Abs err 12 exceeds tol 0
   (8,12)         65          140        Abs err 75 exceeds tol 0
   (9,12)        214          215        Abs err 1 exceeds tol 0
  (10,12)        180           55        Abs err 125 exceeds tol 0
  (11,12)         29           16        Abs err 13 exceeds tol 0
   (1,13)        145          140        Abs err 5 exceeds tol 0
   (2,13)        150          151        Abs err 1 exceeds tol 0
   (3,13)        124          137        Abs err 13 exceeds tol 0
   (4,13)         89           61        Abs err 28 exceeds tol 0
   (5,13)         39           27        Abs err 12 exceeds tol 0
   (6,13)         37           48        Abs err 11 exceeds tol 0
   (7,13)         89          144        Abs err 55 exceeds tol 0
   (8,13)        166          183        Abs err 17 exceeds tol 0
   (9,13)        198          153        Abs err 45 exceeds tol 0
  (10,13)        118           35        Abs err 83 exceeds tol 0
   (1,14)        129          124        Abs err 5 exceeds tol 0
   (2,14)        146          118        Abs err 28 exceeds tol 0
   (3,14)        121          105        Abs err 16 exceeds tol 0
   (4,14)         67           85        Abs err 18 exceeds tol 0
   (5,14)         25           69        Abs err 44 exceeds tol 0
   (6,14)         49           76        Abs err 27 exceeds tol 0
   (7,14)        119          130        Abs err 11 exceeds tol 0
   (8,14)        189          180        Abs err 9 exceeds tol 0
   (9,14)        197          177        Abs err 20 exceeds tol 0
  (10,14)        121           63        Abs err 58 exceeds tol 0
  (11,14)         35           36        Abs err 1 exceeds tol 0
   (1,15)        106          108        Abs err 2 exceeds tol 0
   (2,15)         53           63        Abs err 10 exceeds tol 0
   (3,15)         59           49        Abs err 10 exceeds tol 0
   (4,15)        133          145        Abs err 12 exceeds tol 0
   (5,15)        157          152        Abs err 5 exceeds tol 0
   (6,15)        118          115        Abs err 3 exceeds tol 0
   (7,15)         78           81        Abs err 3 exceeds tol 0
   (8,15)        118          164        Abs err 46 exceeds tol 0
   (9,15)        217          219        Abs err 2 exceeds tol 0
  (10,15)        184           96        Abs err 88 exceeds tol 0
  (11,15)         73           67        Abs err 6 exceeds tol 0
***** xtest assert (imresize (uint8 (in), 1.5, "bilinear"), uint8 (out))

 out = [108  136  125   89  107
        111  132  143  114   99
        106  110  106  127  136
         47  121  163  138   68];
!!!!! known failure
ASSERT errors for:  assert (imresize (uint8 (in), 1.5, "bilinear"),uint8 (out))

  Location  |  Observed  |  Expected  |  Reason
   (2,1)          48           44        Abs err 4 exceeds tol 0
   (3,1)          33           14        Abs err 19 exceeds tol 0
   (4,1)         124          145        Abs err 21 exceeds tol 0
   (5,1)         121          118        Abs err 3 exceeds tol 0
   (6,1)          71           62        Abs err 9 exceeds tol 0
   (7,1)          93          102        Abs err 9 exceeds tol 0
   (8,1)          96           82        Abs err 14 exceeds tol 0
   (9,1)          65           40        Abs err 25 exceeds tol 0
   (10,1)         36           11        Abs err 25 exceeds tol 0
   (11,1)         9            4         Abs err 5 exceeds tol 0
   (1,2)         187          185        Abs err 2 exceeds tol 0
   (2,2)          93           92        Abs err 1 exceeds tol 0
   (3,2)          45           21        Abs err 24 exceeds tol 0
   (4,2)          85           98        Abs err 13 exceeds tol 0
   (5,2)         126          139        Abs err 13 exceeds tol 0
   (6,2)         167          151        Abs err 16 exceeds tol 0
   (7,2)         145          132        Abs err 13 exceeds tol 0
   (8,2)         128          121        Abs err 7 exceeds tol 0
   (9,2)         123           96        Abs err 27 exceeds tol 0
   (10,2)         86           33        Abs err 53 exceeds tol 0
   (11,2)         33           17        Abs err 16 exceeds tol 0
   (1,3)         206          235        Abs err 29 exceeds tol 0
   (2,3)         126          143        Abs err 17 exceeds tol 0
   (3,3)          71           47        Abs err 24 exceeds tol 0
   (4,3)          64           49        Abs err 15 exceeds tol 0
   (5,3)         116          144        Abs err 28 exceeds tol 0
   (6,3)         197          218        Abs err 21 exceeds tol 0
   (7,3)         159          151        Abs err 8 exceeds tol 0
   (8,3)         137          154        Abs err 17 exceeds tol 0
   (9,3)         150          152        Abs err 2 exceeds tol 0
   (10,3)        121           73        Abs err 48 exceeds tol 0
   (11,3)         72           53        Abs err 19 exceeds tol 0
   (1,4)         158          171        Abs err 13 exceeds tol 0
   (2,4)         142          149        Abs err 7 exceeds tol 0
   (3,4)         114          107        Abs err 7 exceeds tol 0
   (4,4)          64           49        Abs err 15 exceeds tol 0
   (5,4)          86           92        Abs err 6 exceeds tol 0
   (6,4)         143          145        Abs err 2 exceeds tol 0
   (7,4)         124          119        Abs err 5 exceeds tol 0
   (8,4)         117          133        Abs err 16 exceeds tol 0
   (9,4)         137          149        Abs err 12 exceeds tol 0
   (10,4)        137          127        Abs err 10 exceeds tol 0
   (11,4)        127          121        Abs err 6 exceeds tol 0
   (1,5)         105           96        Abs err 9 exceeds tol 0
   (2,5)         163          164        Abs err 1 exceeds tol 0
   (3,5)         174          195        Abs err 21 exceeds tol 0
   (4,5)          94           71        Abs err 23 exceeds tol 0
   (5,5)         117          116        Abs err 1 exceeds tol 0
   (6,5)         190          174        Abs err 16 exceeds tol 0
   (7,5)         122           90        Abs err 32 exceeds tol 0
   (8,5)          82           87        Abs err 5 exceeds tol 0
   (9,5)          99          117        Abs err 18 exceeds tol 0
   (10,5)        117          137        Abs err 20 exceeds tol 0
   (11,5)        134          141        Abs err 7 exceeds tol 0
   (1,6)          86           64        Abs err 22 exceeds tol 0
   (3,6)         192          228        Abs err 36 exceeds tol 0
   (4,6)         124          107        Abs err 17 exceeds tol 0
   (5,6)         151          168        Abs err 17 exceeds tol 0
   (6,6)         226          219        Abs err 7 exceeds tol 0
   (7,6)         121           72        Abs err 49 exceeds tol 0
   (8,6)          55           41        Abs err 14 exceeds tol 0
   (9,6)          63           74        Abs err 11 exceeds tol 0
   (10,6)         93          125        Abs err 32 exceeds tol 0
   (11,6)        134          138        Abs err 4 exceeds tol 0
   (1,7)         135          134        Abs err 1 exceeds tol 0
   (2,7)         122          119        Abs err 3 exceeds tol 0
   (3,7)         121          115        Abs err 6 exceeds tol 0
   (4,7)         146          148        Abs err 2 exceeds tol 0
   (5,7)         178          201        Abs err 23 exceeds tol 0
   (6,7)         213          201        Abs err 12 exceeds tol 0
   (7,7)         116           72        Abs err 44 exceeds tol 0
   (8,7)          48           19        Abs err 29 exceeds tol 0
   (9,7)          37           34        Abs err 3 exceeds tol 0
   (10,7)         72          113        Abs err 41 exceeds tol 0
   (11,7)        131          133        Abs err 2 exceeds tol 0
   (1,8)         170          189        Abs err 19 exceeds tol 0
   (2,8)         117          123        Abs err 6 exceeds tol 0
   (3,8)          98           81        Abs err 17 exceeds tol 0
   (4,8)         145          159        Abs err 14 exceeds tol 0
   (5,8)         169          188        Abs err 19 exceeds tol 0
   (6,8)         182          164        Abs err 18 exceeds tol 0
   (7,8)         110           72        Abs err 38 exceeds tol 0
   (8,8)          69           67        Abs err 2 exceeds tol 0
   (9,8)          90          108        Abs err 18 exceeds tol 0
   (10,8)        126          158        Abs err 32 exceeds tol 0
   (11,8)        169          171        Abs err 2 exceeds tol 0
   (1,9)         175          186        Abs err 11 exceeds tol 0
   (2,9)         110          118        Abs err 8 exceeds tol 0
   (3,9)          82           70        Abs err 12 exceeds tol 0
   (4,9)         128          132        Abs err 4 exceeds tol 0
   (5,9)         150          159        Abs err 9 exceeds tol 0
   (6,9)         159          146        Abs err 13 exceeds tol 0
   (7,9)         110           83        Abs err 27 exceeds tol 0
   (8,9)          94          116        Abs err 22 exceeds tol 0
   (9,9)         144          179        Abs err 35 exceeds tol 0
   (10,9)        181          212        Abs err 31 exceeds tol 0
   (11,9)        211          220        Abs err 9 exceeds tol 0
   (1,10)         88           74        Abs err 14 exceeds tol 0
   (2,10)         52           44        Abs err 8 exceeds tol 0
   (3,10)         40           24        Abs err 16 exceeds tol 0
   (4,10)         76           58        Abs err 18 exceeds tol 0
   (5,10)        126          140        Abs err 14 exceeds tol 0
   (6,10)        184          187        Abs err 3 exceeds tol 0
   (7,10)        130          114        Abs err 16 exceeds tol 0
   (8,10)        101           95        Abs err 6 exceeds tol 0
   (9,10)        119          131        Abs err 12 exceeds tol 0
  (10,10)        167          229        Abs err 62 exceeds tol 0
  (11,10)        230          253        Abs err 23 exceeds tol 0
   (1,11)         89           90        Abs err 1 exceeds tol 0
   (2,11)         47           38        Abs err 9 exceeds tol 0
   (3,11)         41           19        Abs err 22 exceeds tol 0
   (4,11)        105          124        Abs err 19 exceeds tol 0
   (5,11)        140          167        Abs err 27 exceeds tol 0
   (6,11)        159          148        Abs err 11 exceeds tol 0
   (7,11)        104           60        Abs err 44 exceeds tol 0
   (8,11)         86          108        Abs err 22 exceeds tol 0
   (9,11)        144          175        Abs err 31 exceeds tol 0
  (10,11)        159          148        Abs err 11 exceeds tol 0
  (11,11)        153          141        Abs err 12 exceeds tol 0
   (1,12)        131          141        Abs err 10 exceeds tol 0
   (2,12)         72           80        Abs err 8 exceeds tol 0
   (3,12)         65           56        Abs err 9 exceeds tol 0
   (4,12)        160          176        Abs err 16 exceeds tol 0
   (5,12)        159          158        Abs err 1 exceeds tol 0
   (6,12)        109           84        Abs err 25 exceeds tol 0
   (7,12)         63           31        Abs err 32 exceeds tol 0
   (8,12)         70          140        Abs err 70 exceeds tol 0
   (9,12)        186          215        Abs err 29 exceeds tol 0
  (10,12)        151           55        Abs err 96 exceeds tol 0
  (11,12)         41           16        Abs err 25 exceeds tol 0
   (1,13)        136          140        Abs err 4 exceeds tol 0
   (2,13)        126          151        Abs err 25 exceeds tol 0
   (3,13)        112          137        Abs err 25 exceeds tol 0
   (4,13)         89           61        Abs err 28 exceeds tol 0
   (5,13)         70           27        Abs err 43 exceeds tol 0
   (6,13)         54           48        Abs err 6 exceeds tol 0
   (7,13)        100          144        Abs err 44 exceeds tol 0
   (8,13)        141          183        Abs err 42 exceeds tol 0
   (9,13)        173          153        Abs err 20 exceeds tol 0
  (10,13)        120           35        Abs err 85 exceeds tol 0
  (11,13)         26           7         Abs err 19 exceeds tol 0
   (1,14)        127          124        Abs err 3 exceeds tol 0
   (2,14)        121          118        Abs err 3 exceeds tol 0
   (3,14)        109          105        Abs err 4 exceeds tol 0
   (4,14)         83           85        Abs err 2 exceeds tol 0
   (6,14)         61           76        Abs err 15 exceeds tol 0
   (7,14)        111          130        Abs err 19 exceeds tol 0
   (8,14)        153          180        Abs err 27 exceeds tol 0
   (9,14)        178          177        Abs err 1 exceeds tol 0
  (10,14)        127           63        Abs err 64 exceeds tol 0
  (11,14)         38           36        Abs err 2 exceeds tol 0
   (1,15)        106          108        Abs err 2 exceeds tol 0
   (2,15)         69           63        Abs err 6 exceeds tol 0
   (3,15)         66           49        Abs err 17 exceeds tol 0
   (4,15)        130          145        Abs err 15 exceeds tol 0
   (5,15)        138          152        Abs err 14 exceeds tol 0
   (6,15)        118          115        Abs err 3 exceeds tol 0
   (7,15)        101           81        Abs err 20 exceeds tol 0
   (8,15)        117          164        Abs err 47 exceeds tol 0
   (9,15)        198          219        Abs err 21 exceeds tol 0
  (10,15)        164           96        Abs err 68 exceeds tol 0
  (11,15)         73           67        Abs err 6 exceeds tol 0
***** xtest assert (imresize (uint8 (in), 0.5, "bilinear"), uint8 (out))

 out = [103  141  124   78  110
        111  134  153  114   91
        115  108   93  128  146
         38  124  175  143   54];
!!!!! known failure
ASSERT errors for:  assert (imresize (uint8 (in), 0.5, "bilinear"),uint8 (out))

  Location  |  Observed  |  Expected  |  Reason
     .          O(4x5)      E(11x15)     Dimensions don't match
***** xtest assert (imresize (uint8 (in), 0.5, "bicubic"), uint8 (out))
!!!!! known failure
ASSERT errors for:  assert (imresize (uint8 (in), 0.5, "bicubic"),uint8 (out))

  Location  |  Observed  |  Expected  |  Reason
     .          O(4x5)      E(11x15)     Dimensions don't match
7 tests, 3 passed, 4 known failures, 0 skipped
[otf2psf]
>>>>> /usr/share/octave/packages/image-2.6.1/otf2psf.m
***** function otf = rand_otf (varargin)
  otf = complex (rand (varargin{:}), rand (varargin{:}));
***** endfunction
***** test
 otf = rand_otf (6, 1);
 assert (otf2psf (otf), circshift (ifft (otf), 3));
***** test
 otf = rand_otf (6, 6);
 assert (otf2psf (otf), circshift (ifft2 (otf), [3 3]));
***** test
 otf = rand_otf (6, 6, 6);
 assert (otf2psf (otf), circshift (ifftn (otf), [3 3 3]));
***** test
 otf = rand_otf (7, 1);
 assert (otf2psf (otf), circshift (ifft (otf), 3));
***** test
 otf = rand_otf (7, 7);
 assert (otf2psf (otf), circshift (ifft2 (otf), [3 3]));
***** test
 otf = rand_otf (6, 7, 8);
 assert (otf2psf (otf), circshift (ifftn (otf), [3 3 4]));
***** test
 otf  = rand_otf (7, 1);
 ppsf = circshift (ifft (otf), 3);
 assert (otf2psf (otf, 6), ppsf(1:6));
 assert (otf2psf (otf, [6 1]), ppsf(1:6));
***** test
 otf = rand_otf (7, 7);
 ppsf = circshift (ifft2 (otf), [3 3]);
 assert (otf2psf (otf, [6 1]), ppsf(1:6,4));
***** test
 otf = rand_otf (6, 7);
 ppsf = circshift (ifft2 (otf), [3 3]);
 assert (otf2psf (otf, [6 6]), ppsf(:,1:6));
***** error <OTF must be numeric> otf2psf ("not a otf")
***** error <OUTSIZE must be smaller than> otf2psf (rand_otf (16), 18)
***** error <OUTSIZE must be smaller than> otf2psf (rand_otf (16), [14 18])
***** error <OUTSIZE must be smaller than> otf2psf (rand_otf (16), [18 18])
***** error <OUTSIZE must be smaller than> otf2psf (rand_otf (16, 1), 18)
***** test
 psf = fspecial ("gaussian", 16);
 otf = psf2otf (psf);
 assert (otf2psf (otf), psf, eps);
***** test
 psf = rand (16);
 otf = psf2otf (psf);
 assert (otf2psf (otf), psf, 2*eps);
***** test
 psf = rand (8);
 otf = psf2otf (psf, [16 16]);
 assert (otf2psf (otf, [8 8]), psf, 2*eps);
17 tests, 17 passed, 0 known failure, 0 skipped
[impyramid]
>>>>> /usr/share/octave/packages/image-2.6.1/impyramid.m
***** test
 in = [116  227  153   69  146  194   59  130  139  106
         2   47  137  249   90   75   16   24  158   44
       155   68   46   84  166  156   69  204   32  152
        71  221  137  230  210  153  192  115   30  118
       107  143  108   52   51   73  101   21  175   90
        54  158  143   77   26  168  113  229  165  225
         9   47  133  135  130  207  236   43   19   73];

 reduced = [
     114  139  131  103  111
      97  122  141  110   99
     103  123  112  123  121
      47  107  134  153   94];

 ## this is what we should return if we were Matlab compatible
 reduced_matlab = [
     114  139  131  103  111
      97  122  141  111  100
     103  123  112  123  122
      47  107  134  153   94];

 expanded = [
    88  132  160  154  132  108   94  102  120  138  138  100   66   74   96  112  116  104   78
    62   98  128  142  146  154  154  140  126  126  122   86   54   58   82  114  132  112   74
    36   54   74  100  130  168  184  156  118  104   92   64   40   44   66  100  122  104   66
    66   68   64   76   98  130  154  148  132  122  108   80   60   78  104  106   98   98   86
   104  106   88   78   78   96  122  144  154  154  140  112   98  124  144  110   74   92  106
   102  130  134  120  108  126  154  174  180  172  156  142  138  146  140   96   60   84  106
    88  140  170  158  140  156  180  188  180  164  152  154  156  140  112   82   66   84   96
    90  136  164  154  134  132  138  136  130  122  120  130  134  108   82   86  100  104   92
    92  126  142  136  116   96   80   74   72   82   94  106  106   88   78  108  138  132  102
    80  116  140  138  122   96   68   52   52   80  110  114  112  118  128  148  164  164  140
    58   98  132  140  130  110   82   62   62  102  142  144  138  154  168  164  156  170  162
    36   68  100  120  130  122  106   92   96  134  174  182  172  156  136  116  104  122  124
    16   34   58   86  108  114  110  106  112  138  170  184  172  126   74   48   44   60   68];

 ## this is what we should return if we were Matlab compatible
 expanded_matlab = [
   115  154  185  178  150  122  105  116  138  159  158  117   78   86  112  129  133  120  103
    69   98  128  141  146  152  152  139  125  127  121   87   55   58   81  113  131  112   84
    40   54   74  100  131  167  184  157  119  104   92   64   41   44   66  100  121  103   74
    76   69   65   75   97  130  153  148  131  122  108   80   61   79  103  105   98   97   98
   120  105   88   77   78   96  121  143  155  154  140  112   98  124  143  109   74   91  123
   117  129  134  119  107  125  153  173  180  172  156  143  138  146  140   96   60   83  122
    99  139  170  157  139  156  181  188  180  164  151  154  156  140  112   81   65   84  110
   101  136  163  153  133  132  138  136  130  122  120  130  133  108   82   86   99  104  104
   103  126  143  136  116   97   81   73   73   82   94  105  105   87   78  108  138  133  116
    90  116  139  139  122   96   69   52   53   80  109  114  111  116  128  148  163  164  160
    66   99  131  140  131  109   83   62   62  102  142  144  138  154  169  164  157  169  184
    41   68   99  121  130  122  107   92   95  133  173  182  172  156  135  114  105  121  142
    21   38   64   98  124  131  127  123  129  160  194  212  199  144   82   52   48   65   85];

 assert (impyramid (uint8 (in), "reduce"), uint8 (reduced))
 assert (impyramid (uint8 (in), "expand"), uint8 (expanded))
!!!!! test failed
ASSERT errors for:  assert (impyramid (uint8 (in), "expand"),uint8 (expanded))

  Location  |  Observed  |  Expected  |  Reason
   (1,1)          87           88        Abs err 1 exceeds tol 0
   (2,1)          61           62        Abs err 1 exceeds tol 0
   (5,1)         105          104        Abs err 1 exceeds tol 0
   (6,1)         103          102        Abs err 1 exceeds tol 0
   (7,1)          89           88        Abs err 1 exceeds tol 0
   (9,1)          91           92        Abs err 1 exceeds tol 0
   (10,1)         79           80        Abs err 1 exceeds tol 0
   (11,1)         59           58        Abs err 1 exceeds tol 0
   (13,1)         17           16        Abs err 1 exceeds tol 0
   (5,2)         105          106        Abs err 1 exceeds tol 0
   (6,2)         129          130        Abs err 1 exceeds tol 0
   (7,2)         139          140        Abs err 1 exceeds tol 0
   (9,2)         125          126        Abs err 1 exceeds tol 0
   (11,2)         99           98        Abs err 1 exceeds tol 0
   (12,2)         67           68        Abs err 1 exceeds tol 0
   (1,3)         159          160        Abs err 1 exceeds tol 0
   (8,3)         163          164        Abs err 1 exceeds tol 0
   (10,3)        139          140        Abs err 1 exceeds tol 0
   (11,3)        131          132        Abs err 1 exceeds tol 0
   (12,3)         98          100        Abs err 2 exceeds tol 0
   (2,4)         141          142        Abs err 1 exceeds tol 0
   (4,4)          75           76        Abs err 1 exceeds tol 0
   (5,4)          77           78        Abs err 1 exceeds tol 0
   (6,4)         118          120        Abs err 2 exceeds tol 0
   (7,4)         157          158        Abs err 1 exceeds tol 0
   (8,4)         152          154        Abs err 2 exceeds tol 0
   (9,4)         135          136        Abs err 1 exceeds tol 0
   (1,5)         131          132        Abs err 1 exceeds tol 0
   (4,5)          97           98        Abs err 1 exceeds tol 0
   (5,5)          77           78        Abs err 1 exceeds tol 0
   (6,5)         106          108        Abs err 2 exceeds tol 0
   (7,5)         139          140        Abs err 1 exceeds tol 0
   (8,5)         132          134        Abs err 2 exceeds tol 0
   (10,5)        121          122        Abs err 1 exceeds tol 0
   (11,5)        131          130        Abs err 1 exceeds tol 0
   (13,5)        109          108        Abs err 1 exceeds tol 0
   (1,6)         107          108        Abs err 1 exceeds tol 0
   (2,6)         152          154        Abs err 2 exceeds tol 0
   (3,6)         167          168        Abs err 1 exceeds tol 0
   (4,6)         129          130        Abs err 1 exceeds tol 0
   (6,6)         124          126        Abs err 2 exceeds tol 0
   (9,6)          97           96        Abs err 1 exceeds tol 0
   (10,6)         95           96        Abs err 1 exceeds tol 0
   (11,6)        109          110        Abs err 1 exceeds tol 0
   (2,7)         152          154        Abs err 2 exceeds tol 0
   (4,7)         152          154        Abs err 2 exceeds tol 0
   (5,7)         121          122        Abs err 1 exceeds tol 0
   (6,7)         153          154        Abs err 1 exceeds tol 0
   (8,7)         137          138        Abs err 1 exceeds tol 0
   (9,7)          81           80        Abs err 1 exceeds tol 0
   (10,7)         69           68        Abs err 1 exceeds tol 0
   (11,7)         83           82        Abs err 1 exceeds tol 0
   (12,7)        107          106        Abs err 1 exceeds tol 0
   (2,8)         139          140        Abs err 1 exceeds tol 0
   (4,8)         147          148        Abs err 1 exceeds tol 0
   (5,8)         142          144        Abs err 2 exceeds tol 0
   (6,8)         173          174        Abs err 1 exceeds tol 0
   (7,8)         187          188        Abs err 1 exceeds tol 0
   (9,8)          73           74        Abs err 1 exceeds tol 0
   (2,9)         125          126        Abs err 1 exceeds tol 0
   (4,9)         131          132        Abs err 1 exceeds tol 0
   (5,9)         155          154        Abs err 1 exceeds tol 0
   (12,9)         95           96        Abs err 1 exceeds tol 0
   (13,9)        111          112        Abs err 1 exceeds tol 0
   (3,10)        103          104        Abs err 1 exceeds tol 0
   (6,10)        171          172        Abs err 1 exceeds tol 0
   (9,10)         81           82        Abs err 1 exceeds tol 0
  (12,10)        133          134        Abs err 1 exceeds tol 0
  (13,10)        139          138        Abs err 1 exceeds tol 0
   (1,11)        137          138        Abs err 1 exceeds tol 0
   (2,11)        120          122        Abs err 2 exceeds tol 0
   (5,11)        139          140        Abs err 1 exceeds tol 0
   (7,11)        151          152        Abs err 1 exceeds tol 0
   (8,11)        119          120        Abs err 1 exceeds tol 0
  (10,11)        109          110        Abs err 1 exceeds tol 0
  (12,11)        172          174        Abs err 2 exceeds tol 0
  (13,11)        169          170        Abs err 1 exceeds tol 0
   (1,12)        101          100        Abs err 1 exceeds tol 0
   (4,12)         79           80        Abs err 1 exceeds tol 0
   (6,12)        143          142        Abs err 1 exceeds tol 0
   (9,12)        104          106        Abs err 2 exceeds tol 0
  (12,12)        181          182        Abs err 1 exceeds tol 0
   (1,13)         67           66        Abs err 1 exceeds tol 0
   (2,13)         55           54        Abs err 1 exceeds tol 0
   (3,13)         41           40        Abs err 1 exceeds tol 0
   (4,13)         61           60        Abs err 1 exceeds tol 0
   (6,13)        137          138        Abs err 1 exceeds tol 0
   (8,13)        133          134        Abs err 1 exceeds tol 0
   (9,13)        105          106        Abs err 1 exceeds tol 0
  (10,13)        111          112        Abs err 1 exceeds tol 0
  (12,13)        171          172        Abs err 1 exceeds tol 0
  (13,13)        173          172        Abs err 1 exceeds tol 0
   (1,14)         73           74        Abs err 1 exceeds tol 0
   (2,14)         57           58        Abs err 1 exceeds tol 0
   (6,14)        145          146        Abs err 1 exceeds tol 0
   (8,14)        107          108        Abs err 1 exceeds tol 0
   (9,14)         86           88        Abs err 2 exceeds tol 0
  (10,14)        116          118        Abs err 2 exceeds tol 0
  (11,14)        153          154        Abs err 1 exceeds tol 0
  (12,14)        155          156        Abs err 1 exceeds tol 0
   (1,15)         97           96        Abs err 1 exceeds tol 0
   (2,15)         81           82        Abs err 1 exceeds tol 0
   (4,15)        103          104        Abs err 1 exceeds tol 0
   (5,15)        143          144        Abs err 1 exceeds tol 0
  (11,15)        169          168        Abs err 1 exceeds tol 0
  (12,15)        135          136        Abs err 1 exceeds tol 0
   (2,16)        113          114        Abs err 1 exceeds tol 0
   (4,16)        105          106        Abs err 1 exceeds tol 0
   (5,16)        109          110        Abs err 1 exceeds tol 0
   (6,16)         95           96        Abs err 1 exceeds tol 0
   (7,16)         81           82        Abs err 1 exceeds tol 0
   (8,16)         85           86        Abs err 1 exceeds tol 0
   (9,16)        107          108        Abs err 1 exceeds tol 0
  (12,16)        114          116        Abs err 2 exceeds tol 0
   (2,17)        130          132        Abs err 2 exceeds tol 0
   (3,17)        121          122        Abs err 1 exceeds tol 0
   (7,17)         65           66        Abs err 1 exceeds tol 0
   (8,17)         98          100        Abs err 2 exceeds tol 0
  (10,17)        163          164        Abs err 1 exceeds tol 0
  (11,17)        157          156        Abs err 1 exceeds tol 0
  (12,17)        105          104        Abs err 1 exceeds tol 0
   (1,18)        105          104        Abs err 1 exceeds tol 0
   (3,18)        103          104        Abs err 1 exceeds tol 0
   (4,18)         97           98        Abs err 1 exceeds tol 0
   (5,18)         91           92        Abs err 1 exceeds tol 0
   (6,18)         83           84        Abs err 1 exceeds tol 0
   (8,18)        103          104        Abs err 1 exceeds tol 0
   (9,18)        133          132        Abs err 1 exceeds tol 0
  (11,18)        169          170        Abs err 1 exceeds tol 0
  (12,18)        121          122        Abs err 1 exceeds tol 0
  (13,18)         59           60        Abs err 1 exceeds tol 0
   (1,19)         79           78        Abs err 1 exceeds tol 0
   (2,19)         75           74        Abs err 1 exceeds tol 0
   (4,19)         85           86        Abs err 1 exceeds tol 0
   (5,19)        107          106        Abs err 1 exceeds tol 0
   (6,19)        105          106        Abs err 1 exceeds tol 0
   (7,19)         95           96        Abs err 1 exceeds tol 0
   (8,19)         91           92        Abs err 1 exceeds tol 0
  (10,19)        139          140        Abs err 1 exceeds tol 0
  (11,19)        160          162        Abs err 2 exceeds tol 0
  (12,19)        123          124        Abs err 1 exceeds tol 0
  (13,19)         67           68        Abs err 1 exceeds tol 0
***** test
 in = randi ([0 255], [40 39 3 5], "uint8");
 red = impyramid (in, "reduce");
 for p = 1:3
   for n = 1:5
     assert (red(:,:,p,n), impyramid (in(:,:,p,n), "reduce"))
   endfor
 endfor

 exp = impyramid (in, "expand");
 for p = 1:3
   for n = 1:5
     assert (exp(:,:,p,n), impyramid (in(:,:,p,n), "expand"))
   endfor
 endfor
***** test
 in = repmat (uint8 (255), [10 10]);
 assert (impyramid (in, "reduce"), repmat (uint8 (255), [5 5]))
 assert (impyramid (in, "expand"), repmat (uint8 (255), [19 19]))
!!!!! test failed
ASSERT errors for:  assert (impyramid (in, "expand"),repmat (uint8 (255), [19, 19]))

  Location  |  Observed  |  Expected  |  Reason
   (1,1)         195          255        Abs err 60 exceeds tol 0
   (2,1)         223          255        Abs err 32 exceeds tol 0
   (3,1)         223          255        Abs err 32 exceeds tol 0
   (4,1)         223          255        Abs err 32 exceeds tol 0
   (5,1)         223          255        Abs err 32 exceeds tol 0
   (6,1)         223          255        Abs err 32 exceeds tol 0
   (7,1)         223          255        Abs err 32 exceeds tol 0
   (8,1)         223          255        Abs err 32 exceeds tol 0
   (9,1)         223          255        Abs err 32 exceeds tol 0
   (10,1)        223          255        Abs err 32 exceeds tol 0
   (11,1)        223          255        Abs err 32 exceeds tol 0
   (12,1)        223          255        Abs err 32 exceeds tol 0
   (13,1)        223          255        Abs err 32 exceeds tol 0
   (14,1)        223          255        Abs err 32 exceeds tol 0
   (15,1)        223          255        Abs err 32 exceeds tol 0
   (16,1)        223          255        Abs err 32 exceeds tol 0
   (17,1)        223          255        Abs err 32 exceeds tol 0
   (18,1)        223          255        Abs err 32 exceeds tol 0
   (19,1)        195          255        Abs err 60 exceeds tol 0
   (1,2)         223          255        Abs err 32 exceeds tol 0
   (19,2)        223          255        Abs err 32 exceeds tol 0
   (1,3)         223          255        Abs err 32 exceeds tol 0
   (19,3)        223          255        Abs err 32 exceeds tol 0
   (1,4)         223          255        Abs err 32 exceeds tol 0
   (19,4)        223          255        Abs err 32 exceeds tol 0
   (1,5)         223          255        Abs err 32 exceeds tol 0
   (19,5)        223          255        Abs err 32 exceeds tol 0
   (1,6)         223          255        Abs err 32 exceeds tol 0
   (19,6)        223          255        Abs err 32 exceeds tol 0
   (1,7)         223          255        Abs err 32 exceeds tol 0
   (19,7)        223          255        Abs err 32 exceeds tol 0
   (1,8)         223          255        Abs err 32 exceeds tol 0
   (19,8)        223          255        Abs err 32 exceeds tol 0
   (1,9)         223          255        Abs err 32 exceeds tol 0
   (19,9)        223          255        Abs err 32 exceeds tol 0
   (1,10)        223          255        Abs err 32 exceeds tol 0
  (19,10)        223          255        Abs err 32 exceeds tol 0
   (1,11)        223          255        Abs err 32 exceeds tol 0
  (19,11)        223          255        Abs err 32 exceeds tol 0
   (1,12)        223          255        Abs err 32 exceeds tol 0
  (19,12)        223          255        Abs err 32 exceeds tol 0
   (1,13)        223          255        Abs err 32 exceeds tol 0
  (19,13)        223          255        Abs err 32 exceeds tol 0
   (1,14)        223          255        Abs err 32 exceeds tol 0
  (19,14)        223          255        Abs err 32 exceeds tol 0
   (1,15)        223          255        Abs err 32 exceeds tol 0
  (19,15)        223          255        Abs err 32 exceeds tol 0
   (1,16)        223          255        Abs err 32 exceeds tol 0
  (19,16)        223          255        Abs err 32 exceeds tol 0
   (1,17)        223          255        Abs err 32 exceeds tol 0
  (19,17)        223          255        Abs err 32 exceeds tol 0
   (1,18)        223          255        Abs err 32 exceeds tol 0
  (19,18)        223          255        Abs err 32 exceeds tol 0
   (1,19)        195          255        Abs err 60 exceeds tol 0
   (2,19)        223          255        Abs err 32 exceeds tol 0
   (3,19)        223          255        Abs err 32 exceeds tol 0
   (4,19)        223          255        Abs err 32 exceeds tol 0
   (5,19)        223          255        Abs err 32 exceeds tol 0
   (6,19)        223          255        Abs err 32 exceeds tol 0
   (7,19)        223          255        Abs err 32 exceeds tol 0
   (8,19)        223          255        Abs err 32 exceeds tol 0
   (9,19)        223          255        Abs err 32 exceeds tol 0
  (10,19)        223          255        Abs err 32 exceeds tol 0
  (11,19)        223          255        Abs err 32 exceeds tol 0
  (12,19)        223          255        Abs err 32 exceeds tol 0
  (13,19)        223          255        Abs err 32 exceeds tol 0
  (14,19)        223          255        Abs err 32 exceeds tol 0
  (15,19)        223          255        Abs err 32 exceeds tol 0
  (16,19)        223          255        Abs err 32 exceeds tol 0
  (17,19)        223          255        Abs err 32 exceeds tol 0
  (18,19)        223          255        Abs err 32 exceeds tol 0
  (19,19)        195          255        Abs err 60 exceeds tol 0
***** test
 in = logical ([
   1  0  1  1  0  0  1  1  0  0
   1  1  0  0  0  1  0  0  1  0
   0  1  1  0  1  1  1  1  1  1
   1  0  1  0  1  0  1  0  1  1
   1  1  1  0  0  0  1  1  1  1
   0  0  1  1  0  0  1  0  0  0
   0  0  1  1  0  1  1  0  1  1
   1  1  0  0  1  0  0  0  1  0
   1  1  1  1  1  1  0  1  0  0
   1  1  0  0  1  0  0  0  1  0]);

 reduced = logical ([
   1  1  0  1  0
   1  1  0  1  1
   1  1  0  1  1
   0  1  0  0  0
   1  1  1  0  0]);

 expanded = logical ([
   1  1  0  0  1  1  1  0  0  0  0  0  1  1  1  0  0  0  0
   1  1  1  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
   1  1  1  1  0  0  0  0  0  0  1  1  0  0  0  1  1  0  0
   1  1  1  1  0  0  0  0  0  1  1  1  1  0  1  1  1  1  1
   0  1  1  1  1  0  0  0  1  1  1  1  1  1  1  1  1  1  1
   0  0  1  1  1  0  0  0  1  1  1  1  1  1  1  1  1  1  1
   1  1  0  1  1  0  0  0  1  0  0  1  1  1  0  1  1  1  1
   1  1  1  1  1  0  0  0  0  0  0  0  1  1  1  1  1  1  1
   1  1  1  1  1  1  0  0  0  0  0  0  1  1  1  1  1  1  1
   0  0  1  1  1  1  0  0  0  0  0  0  1  1  1  0  0  0  0
   0  0  0  1  1  1  1  0  0  0  0  1  1  1  0  0  0  0  0
   0  0  0  0  1  1  1  0  0  0  0  1  1  0  0  0  0  0  0
   0  0  0  0  1  1  1  0  0  0  1  1  1  0  0  0  1  1  1
   0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  1  1  1
   1  1  1  1  0  0  0  1  1  1  0  0  0  0  0  0  1  0  0
   1  1  1  1  1  0  1  1  1  1  0  0  0  0  0  0  0  0  0
   1  1  1  1  1  1  1  1  1  1  1  0  0  0  1  0  0  0  0
   1  1  1  1  1  0  1  1  1  1  0  0  0  0  0  0  0  0  0
   1  1  1  1  0  0  0  1  1  1  0  0  0  0  0  0  1  0  0]);

 assert (impyramid (in, "reduce"), reduced)
 assert (impyramid (in, "expand"), expanded)
!!!!! test failed
ASSERT errors for:  assert (impyramid (in, "reduce"),reduced)

  Location  |  Observed  |  Expected  |  Reason
   (4,1)          1            0         Abs err 1 exceeds tol 0
   (1,3)          1            0         Abs err 1 exceeds tol 0
   (2,3)          1            0         Abs err 1 exceeds tol 0
   (3,3)          1            0         Abs err 1 exceeds tol 0
   (4,3)          1            0         Abs err 1 exceeds tol 0
   (4,4)          1            0         Abs err 1 exceeds tol 0
   (5,4)          1            0         Abs err 1 exceeds tol 0
   (1,5)          1            0         Abs err 1 exceeds tol 0
   (4,5)          1            0         Abs err 1 exceeds tol 0
   (5,5)          1            0         Abs err 1 exceeds tol 0
4 tests, 1 passed, 0 known failure, 0 skipped
[histeq]
>>>>> /usr/share/octave/packages/image-2.6.1/histeq.m
***** assert (histeq ([]), []);
***** assert (histeq (0), 1);
***** assert (histeq (1), 1);
***** assert (histeq (1.5), 1);
***** assert (histeq (zeros (100, 200)), ones (100, 200));            # matrix
***** xtest assert (histeq ([0    1]),  [0.4920634921  1],  10^-8);
!!!!! known failure
ASSERT errors for:  assert (histeq ([0, 1]),[0.4920634921, 1],10 ^ -8)

  Location  |  Observed  |  Expected  |  Reason
    (1)          0.5        0.49206      Abs err 0.0079365 exceeds tol 1e-08
***** xtest assert (histeq ([0    1]'), [0.4920634921  1]', 10^-8);   # column array
!!!!! known failure
ASSERT errors for:  assert (histeq ([0, 1]'),[0.4920634921, 1]',10 ^ -8)

  Location  |  Observed  |  Expected  |  Reason
    (1)          0.5        0.49206      Abs err 0.0079365 exceeds tol 1e-08
***** xtest assert (histeq ([0  255]),  [0.4920634921  1],  10^-8);
!!!!! known failure
ASSERT errors for:  assert (histeq ([0, 255]),[0.4920634921, 1],10 ^ -8)

  Location  |  Observed  |  Expected  |  Reason
    (1)          0.5        0.49206      Abs err 0.0079365 exceeds tol 1e-08
***** xtest assert (histeq (uint8  ([0      1])), [  125    190]);    # uint8
!!!!! known failure
ASSERT errors for:  assert (histeq (uint8 ([0, 1])),[125, 190])

  Location  |  Observed  |  Expected  |  Reason
    (1)          0.5          125        Abs err 124.5 exceeds tol 0
    (2)           1           190        Abs err 189 exceeds tol 0
***** xtest assert (histeq (uint8  ([0    255])), [  125    255]);
!!!!! known failure
ASSERT errors for:  assert (histeq (uint8 ([0, 255])),[125, 255])

  Location  |  Observed  |  Expected  |  Reason
    (1)          0.5          125        Abs err 124.5 exceeds tol 0
    (2)           1           255        Abs err 254 exceeds tol 0
***** xtest assert (histeq (uint16 ([0      1])), [65535  65535]);    # uint16
!!!!! known failure
ASSERT errors for:  assert (histeq (uint16 ([0, 1])),[65535, 65535])

  Location  |  Observed  |  Expected  |  Reason
    (1)          0.5         65535       Abs err 65534 exceeds tol 0
    (2)           1          65535       Abs err 65534 exceeds tol 0
***** xtest assert (histeq (uint16 ([0    255])), [32247  48891]);
!!!!! known failure
ASSERT errors for:  assert (histeq (uint16 ([0, 255])),[32247, 48891])

  Location  |  Observed  |  Expected  |  Reason
    (1)          0.5         32247       Abs err 32246 exceeds tol 0
    (2)           1          48891       Abs err 48890 exceeds tol 0
***** xtest assert (histeq (uint16 ([0    256])), [32247  48891]);
!!!!! known failure
ASSERT errors for:  assert (histeq (uint16 ([0, 256])),[32247, 48891])

  Location  |  Observed  |  Expected  |  Reason
    (1)          0.5         32247       Abs err 32246 exceeds tol 0
    (2)           1          48891       Abs err 48890 exceeds tol 0
***** xtest assert (histeq (uint16 ([0  65535])), [32247  65535]);
!!!!! known failure
ASSERT errors for:  assert (histeq (uint16 ([0, 65535])),[32247, 65535])

  Location  |  Observed  |  Expected  |  Reason
    (1)          0.5         32247       Abs err 32246 exceeds tol 0
    (2)           1          65535       Abs err 65534 exceeds tol 0
***** test assert (histeq  ([0 1 1] ),             [  1/3     1     1] ,  10^-8);
***** test assert (histeq  ([0 0 1]'),             [  2/3   2/3     1]',  10^-8);
***** xtest assert (histeq ([0 1 2] ),             [  1/3     1     1] ,  10^-8);
!!!!! known failure
ASSERT errors for:  assert (histeq ([0, 1, 2]),[1 / 3, 1, 1],10 ^ -8)

  Location  |  Observed  |  Expected  |  Reason
    (2)        0.66667         1         Abs err 0.33333 exceeds tol 1e-08
***** xtest assert (histeq (uint8  ([0   1   2])), [   85   125   215]);
!!!!! known failure
ASSERT errors for:  assert (histeq (uint8 ([0, 1, 2])),[85, 125, 215])

  Location  |  Observed  |  Expected  |  Reason
    (1)        0.33333         85        Abs err 84.667 exceeds tol 0
    (2)        0.66667        125        Abs err 124.33 exceeds tol 0
    (3)           1           215        Abs err 214 exceeds tol 0
***** xtest assert (histeq (uint16 ([0   1   2])), [65535 65535 65535]);
!!!!! known failure
ASSERT errors for:  assert (histeq (uint16 ([0, 1, 2])),[65535, 65535, 65535])

  Location  |  Observed  |  Expected  |  Reason
    (1)        0.33333       65535       Abs err 65535 exceeds tol 0
    (2)        0.66667       65535       Abs err 65534 exceeds tol 0
    (3)           1          65535       Abs err 65534 exceeds tol 0
***** xtest assert (histeq (uint16 ([0 100 200])), [43690 43690 55133]);
!!!!! known failure
ASSERT errors for:  assert (histeq (uint16 ([0, 100, 200])),[43690, 43690, 55133])

  Location  |  Observed  |  Expected  |  Reason
    (1)        0.33333       43690       Abs err 43690 exceeds tol 0
    (2)        0.66667       43690       Abs err 43689 exceeds tol 0
    (3)           1          55133       Abs err 55132 exceeds tol 0
***** xtest
 J = [20    32    57    81   105   125   150   174   198   223   247];
 assert (histeq (uint8 (0:10:100)), J);
!!!!! known failure
ASSERT errors for:  assert (histeq (uint8 (0:10:100)),J)

  Location  |  Observed  |  Expected  |  Reason
    (1)        0.090909        20        Abs err 19.909 exceeds tol 0
    (2)        0.18182         32        Abs err 31.818 exceeds tol 0
    (3)        0.27273         57        Abs err 56.727 exceeds tol 0
    (4)        0.36364         81        Abs err 80.636 exceeds tol 0
    (5)        0.45455        105        Abs err 104.55 exceeds tol 0
    (6)        0.54545        125        Abs err 124.45 exceeds tol 0
    (7)        0.63636        150        Abs err 149.36 exceeds tol 0
    (8)        0.72727        174        Abs err 173.27 exceeds tol 0
    (9)        0.81818        198        Abs err 197.18 exceeds tol 0
    (10)       0.90909        223        Abs err 222.09 exceeds tol 0
    (11)          1           247        Abs err 246 exceeds tol 0
***** xtest
 J = [0.0793650794
      0.1269841270
      0.2222222222
      0.3174603175
      0.4126984127
      0.4920634921
      0.5873015873
      0.6825396825
      0.7777777778
      0.8730158730
      1.0000000000];
 assert (histeq (0:0.1:1), J', 10^-8);
!!!!! known failure
ASSERT errors for:  assert (histeq (0:0.1:1),J',10 ^ -8)

  Location  |  Observed  |  Expected  |  Reason
    (1)        0.090909     0.079365     Abs err 0.011544 exceeds tol 1e-08
    (2)        0.18182      0.12698      Abs err 0.054834 exceeds tol 1e-08
    (3)        0.27273      0.22222      Abs err 0.050505 exceeds tol 1e-08
    (4)        0.36364      0.31746      Abs err 0.046176 exceeds tol 1e-08
    (5)        0.45455       0.4127      Abs err 0.041847 exceeds tol 1e-08
    (6)        0.54545      0.49206      Abs err 0.053391 exceeds tol 1e-08
    (7)        0.63636       0.5873      Abs err 0.049062 exceeds tol 1e-08
    (8)        0.72727      0.68254      Abs err 0.044733 exceeds tol 1e-08
    (9)        0.81818      0.77778      Abs err 0.040404 exceeds tol 1e-08
    (10)       0.90909      0.87302      Abs err 0.036075 exceeds tol 1e-08
22 tests, 7 passed, 15 known failures, 0 skipped
[edge]
>>>>> /usr/share/octave/packages/image-2.6.1/edge.m
***** test
 im = [
   249   238   214   157   106    69    60    90   131   181   224   247   252   250   250
   250   242   221   165   112    73    62    91   133   183   225   248   252   250   251
   252   246   228   173   120    78    63    90   130   181   224   248   253   251   251
   253   248   232   185   132    87    62    80   116   170   217   244   253   251   252
   253   249   236   198   149   101    66    71   101   155   206   238   252   252   252
   254   250   240   210   164   115    73    69    92   143   196   232   252   253   252
    70    70    68    61    49    36    24    22    26    38    52    63    70    70    70
     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0
    62    63    62    59    51    42    33    25    22    26    36    45    56    60    62
   252   253   252   246   221   190   157   114    90    90   118   157   203   235   248
   251   253   254   251   233   209   182   136   103    92   107   139   185   225   245
   251   253   254   253   243   227   206   163   128   108   110   133   175   217   242
   252   253   254   254   249   241   228   195   164   137   127   139   172   212   239
 ] / 255;

 methods = {"kirsch", "prewitt", "sobel"};
 for m_i = 1:numel (methods)
   method = methods{m_i};

   bw = edge (im, method, 0.2, "both", "thinning");
   assert (edge (im, method, 0.2), bw)

   args = perms ({0.2, "both", "thinning"});
   for i = 1:rows (args)
     assert (edge (im, method, args{i,:}), bw)
   endfor

   bw = edge (im, method, 0.2, "vertical", "nothinning");
   args = perms ({0.2, "vertical", "nothinning"});
   for i = 1:rows (args)
     assert (edge (im, method, args{i,:}), bw)
   endfor

   bw = edge (im, method, 0.2, "vertical", "thinning");
   args = perms ({0.2, "vertical"});
   for i = 1:rows (args)
     assert (edge (im, method, args{i,:}), bw)
   endfor

   bw = edge (im, method, 0.2, "both", "nothinning");
   args = perms ({0.2, "nothinning"});
   for i = 1:rows (args)
     assert (edge (im, method, args{i,:}), bw)
   endfor
 endfor
***** error <more than 1 threshold argument>
  bw = edge (rand (10), "sobel", 0.2, 0.4)
***** error <more than 1 thinning argument>
  bw = edge (rand (10), "sobel", "thinning", "nothinning")
***** error <more than 1 direction argument>
  bw = edge (rand (10), "sobel", "both", "both")
***** error <only THRESH, DIRECTION, and THINNING arguments>
  bw = edge (rand (10), "sobel", [0.2 0.7], "both", "thinning")
***** error <more than 1 threshold argument>
  bw = edge (rand (10), "kirsch", 0.2, 0.4)
***** error <more than 1 thinning argument>
  bw = edge (rand (10), "kirsch", "thinning", "nothinning")
***** error <more than 1 direction argument>
  bw = edge (rand (10), "kirsch", "both", "both")
***** error <only THRESH, DIRECTION, and THINNING arguments>
  bw = edge (rand (10), "kirsch", [0.2 0.7], "both", "thinning")
***** error <more than 1 threshold argument>
  bw = edge (rand (10), "prewitt", 0.2, 0.4)
***** error <more than 1 thinning argument>
  bw = edge (rand (10), "prewitt", "thinning", "nothinning")
***** error <more than 1 direction argument>
  bw = edge (rand (10), "prewitt", "both", "both")
***** error <only THRESH, DIRECTION, and THINNING arguments>
  bw = edge (rand (10), "prewitt", [0.2 0.7], "both", "thinning")
***** test
 im = [
   249   238   214   157   106    69    60    90   131   181   224   247   252   250   250
   250   242   221   165   112    73    62    91   133   183   225   248   252   250   251
   252   246   228   173   120    78    63    90   130   181   224   248   253   251   251
   253   248   232   185   132    87    62    80   116   170   217   244   253   251   252
   253   249   236   198   149   101    66    71   101   155   206   238   252   252   252
   254   250   240   210   164   115    73    69    92   143   196   232   252   253   252
    70    70    68    61    49    36    24    22    26    38    52    63    70    70    70
     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0
    62    63    62    59    51    42    33    25    22    26    36    45    56    60    62
   252   253   252   246   221   190   157   114    90    90   118   157   203   235   248
   251   253   254   251   233   209   182   136   103    92   107   139   185   225   245
   251   253   254   253   243   227   206   163   128   108   110   133   175   217   242
   252   253   254   254   249   241   228   195   164   137   127   139   172   212   239
 ] / 255;

 bw = edge (im, "roberts", .2, "thinning");
 assert (edge (im, "roberts", 0.2), bw)
 assert (edge (im, "roberts", "thinning", 0.2), bw)

 bw = edge (im, "roberts", .2, "nothinning");
 assert (edge (im, "roberts", "nothinning", 0.2), bw)
***** error <more than 1 threshold argument>
  bw = edge (rand (10), "roberts", 0.2, 0.4)
***** error <more than 1 thinning argument>
  bw = edge (rand (10), "roberts", "thinning", "nothinning")
***** error <only THRESH and THINNING arguments>
  bw = edge (rand (10), "roberts", "both", "thinning")
***** test
 im = rand (10);
 [~, thresh] = edge (im, "canny");
 assert (size (thresh), [1 2])
 [~, thresh] = edge (im, "canny", [.2 .6]);
 assert (thresh, [.2 .6])
 [~, thresh] = edge (im, "canny", [.2; .6]);
 assert (thresh, [.2 .6])
***** test
 in = zeros (5);
 in(3,3) = 1;

 E = logical ([
    0 0 0 0 0
    0 0 1 0 0
    0 1 0 1 0
    0 0 1 0 0
    0 0 0 0 0]);
 assert (edge (in), E)
 assert (edge (uint8 (in.*100)), E)
 assert (edge (in, "sobel"), E)
 assert (edge (in, "sobel", 0), E)
 assert (edge (in, "sobel", 1), false (5))

 [E, auto_thresh] = edge (in);
 assert (auto_thresh, 0.2449, 1e-4)

 V = logical([
    0 0 0 0 0
    0 1 0 1 0
    0 1 0 1 0
    0 1 0 1 0
    0 0 0 0 0]);
 assert (edge (in, "sobel", 0, "vertical"), V)

 H = logical ([
    0 0 0 0 0
    0 1 1 1 0
    0 0 0 0 0
    0 1 1 1 0
    0 0 0 0 0]);
 assert (edge (in, "sobel", 0, "horizontal"), H)

 V = false (5);
 V(3,2) = true;
 V(3,4) = true;
 assert (edge (in, "sobel", [], "vertical"), V)

 H = false (5);
 H(2,3) = true;
 H(4,3) = true;
 assert (edge (in, "sobel", [], "horizontal"), H)
***** test
 A = ones (5);
 A(3, 3) = 0;
 expected = logical ([
    0  0  0  0  0
    0  0  1  0  0
    0  1  0  1  0
    0  0  1  0  0
    0  0  0  0  0]);
 assert (edge (A), expected)
***** test
 in = zeros (5);
 in(3, 3) = 1;

 E = logical ([
    0 0 0 0 0
    0 1 0 1 0
    0 0 0 0 0
    0 1 0 1 0
    0 0 0 0 0]);

 assert (edge (in, "prewitt"), E)

 [~, auto_thresh] = edge (in, "prewitt");
 assert (auto_thresh, 0.2309, 1e-4)

 V = logical([
    0 0 0 0 0
    0 1 0 1 0
    0 1 0 1 0
    0 1 0 1 0
    0 0 0 0 0]);
 assert (edge (in, "prewitt", 0, "vertical"), V)

 H = logical ([
    0 0 0 0 0
    0 1 1 1 0
    0 0 0 0 0
    0 1 1 1 0
    0 0 0 0 0]);
 assert (edge (in, "prewitt", 0, "horizontal"), H)
***** test
 in = zeros (5);
 in(3,3) = 1;
 in(3,4) = 0.9;

 E = logical ([
    0 0 0 0 0
    0 0 1 0 0
    0 0 1 0 0
    0 0 0 0 0
    0 0 0 0 0]);

 assert (edge (in, "roberts"), E)

 [~, auto_thresh] = edge (in, "roberts");
 assert (auto_thresh, 0.6591, 1e-4)

 E45 = [0     0      0     0  0
        0  -0.5  -0.45     0  0
        0     0   0.50  0.45  0
        0     0      0     0  0
        0     0      0     0  0];
 E135 = [0    0      0      0  0
         0    0  -0.50  -0.45  0
         0  0.5   0.45      0  0
         0    0      0      0  0
         0    0      0      0  0];

 [~, ~, erg45, erg135] = edge (in, "roberts");
 assert (erg45, E45)
 assert (erg135, E135)
***** test
 in_8 = fspecial ("gaussian", [8 8], 2);
 in_8 /= in_8(4,4);
 in_8_uint8 = im2uint8 (in_8);

 ## this is the result from Matlab's old canny method (before 2011a)
 out_8_old = logical ([
  0   0   0   0   0   0   0   0
  0   0   0   1   1   0   0   0
  0   0   1   0   0   1   0   0
  0   1   0   0   0   0   1   0
  0   1   0   0   0   0   1   0
  0   0   1   0   0   1   0   0
  0   0   0   1   1   0   0   0
  0   0   0   0   0   0   0   0]);
 out_8 = logical ([
  0   0   0   0   0   0   0   0
  0   1   1   1   1   1   0   0
  0   1   0   0   0   1   0   0
  0   1   0   0   0   1   0   0
  0   1   0   0   0   1   0   0
  0   1   1   1   1   1   0   0
  0   0   0   0   0   0   0   0
  0   0   0   0   0   0   0   0]);
 out_thresh = [0.34375 0.859375];

 [obs_edge, obs_thresh] = edge (in_8, "Canny");
 assert (obs_edge, out_8)
 assert (obs_thresh, out_thresh)

 [obs_edge_givethresh, obs_thresh_givethresh] ...
    = edge (in_8, "Canny", out_thresh);
 assert (obs_edge_givethresh, out_8)
 assert (obs_thresh_givethresh, out_thresh)

 [obs_edge_uint8, obs_thresh_uint8] = edge (in_8_uint8, "Canny");
 assert (obs_edge_uint8, out_8)
 assert (obs_thresh_uint8, out_thresh)
!!!!! test failed
ASSERT errors for:  assert (obs_thresh,out_thresh)

  Location  |  Observed  |  Expected  |  Reason
    (1)        0.27112      0.34375      Abs err 0.072632 exceeds tol 0
    (2)        0.67779      0.85938      Abs err 0.18158 exceeds tol 0
***** test
 in_9 = fspecial ("gaussian", [9 9], 2);
 in_9 /= in_9(5,5);

 ## this is the result from Matlab's old canny method (before 2011a)
 out_9_old = logical ([
  0   0   0   0   0   0   0   0   0
  0   0   0   0   0   0   0   0   0
  0   0   0   1   1   1   0   0   0
  0   0   1   0   0   0   1   0   0
  0   0   1   0   0   0   1   0   0
  0   0   1   0   0   0   1   0   0
  0   0   0   1   1   1   0   0   0
  0   0   0   0   0   0   0   0   0
  0   0   0   0   0   0   0   0   0]);
 out_9 = logical ([
  0   0   0   0   0   0   0   0   0
  0   0   1   1   1   1   0   0   0
  0   1   1   0   0   1   1   0   0
  0   1   0   0   0   0   1   0   0
  0   1   0   0   0   0   1   0   0
  0   1   1   0   0   1   1   0   0
  0   0   1   1   1   1   0   0   0
  0   0   0   0   0   0   0   0   0
  0   0   0   0   0   0   0   0   0]);
 out_thresh = [0.35 0.875];

 [obs_edge, obs_thresh] = edge (in_9, "Canny");
 assert (obs_edge, out_9)
 assert (obs_thresh, out_thresh)

 [obs_edge_givethresh, obs_thresh_givethresh] ...
    = edge (in_9, "Canny", out_thresh);
 assert (obs_edge_givethresh, out_9)
 assert (obs_thresh_givethresh, out_thresh)
!!!!! test failed
ASSERT errors for:  assert (obs_thresh,out_thresh)

  Location  |  Observed  |  Expected  |  Reason
    (1)         0.261         0.35       Abs err 0.089001 exceeds tol 0
    (2)         0.6525       0.875       Abs err 0.2225 exceeds tol 0
24 tests, 22 passed, 0 known failure, 0 skipped
[isbw]
>>>>> /usr/share/octave/packages/image-2.6.1/isbw.m
***** shared img
 img = round (rand (10));
***** assert (isbw (img, "non-logical"), true);
***** assert (isbw (img, "logical"), false);
***** assert (isbw (logical (img), "logical"), true);
***** assert (isbw (logical (img), "non-logical"), true);
***** test
 img(1, 1) = 2;
 assert (isbw (img, "non-logical"), false);
***** test
 a( 1,  1) = 1;
 a(50, 50) = 2;
 assert (isbw (a, "non-logical"), false);
***** assert (isbw (rand (5, 5, 1, 4) > 0.5), true)
***** assert (isbw (rand (5, 5, 3, 4) > 0.5), false)
***** assert (isbw (rand (5, 5, 3) > 0.5), false)
***** assert (isbw (rand (5, 5, 1, 3, 4) > 0.5), false)
***** assert (isbw (randi ([0 1], 5, 5, 1, 4), "non-logical"), true)
***** assert (isbw (randi ([0 1], 5, 5, 3, 4), "non-logical"), false)
***** assert (isbw (randi ([0 1], 5, 5, 3), "non-logical"), false)
***** assert (isbw (randi ([0 1], 5, 5, 1, 3, 4), "non-logical"), false)
***** assert (isbw (single ([0 0 1]), "non-logical"), true)
***** assert (isbw ([0 NaN 1], "non-logical"), false)
16 tests, 16 passed, 0 known failure, 0 skipped
[grayslice]
>>>>> /usr/share/octave/packages/image-2.6.1/grayslice.m
***** function gs = test_grayslice_vector (I, v)
  gs = zeros (size (I));
  for idx = 1:numel (v)
    gs(I >= v(idx)) = idx;
  endfor
***** endfunction
***** function gs = test_grayslice_scalar (I, n)
  v = (1:(n-1)) / n;
  gs = test_grayslice_vector (I, v);
***** endfunction
***** shared I2d, I3d, I5d, double_corner
 I2d = rand (10, 10);
 I3d = rand (10, 10, 3);
 I5d = rand (10, 10, 4, 3, 5);

 double_corner = I2d;
 double_corner(I2d > 0.1 & I2d < 0.3) = -0.2;
 double_corner(I2d > 0.6 & I2d < 0.7) = 1.3;
***** assert (grayslice (I2d), grayslice (I2d, 10))
***** assert (grayslice (I2d, 10), uint8 (test_grayslice_scalar (I2d, 10)))
***** assert (grayslice (I2d, [0.3 0.5 0.7]),
        uint8 (test_grayslice_vector (I2d, [0.3 0.5 0.7])))
***** assert (grayslice (I3d, 10), uint8 (test_grayslice_scalar (I3d, 10)))
***** assert (grayslice (I5d, 300), test_grayslice_scalar (I5d, 300)+1)
***** assert (grayslice (I3d, [0.3 0.5 0.7]),
        uint8 (test_grayslice_vector (I3d, [0.3 0.5 0.7])))
***** assert (grayslice (im2uint8 (I2d), 3), uint8 (test_grayslice_scalar (I2d, 3)))
!!!!! test failed
ASSERT errors for:  assert (grayslice (im2uint8 (I2d), 3),uint8 (test_grayslice_scalar (I2d, 3)))

  Location  |  Observed  |  Expected  |  Reason
   (6,5)          2            1         Abs err 1 exceeds tol 0
shared variables 
  scalar structure containing the fields:

    I2d =

     Columns 1 through 5:

       2.2108e-01   7.1460e-01   8.6567e-01   3.5439e-01   8.1303e-01
       6.0278e-01   2.3774e-01   5.8131e-01   7.2077e-01   1.1110e-01
       7.0996e-01   4.6300e-02   4.8698e-01   2.5724e-01   6.1860e-01
       7.1942e-01   8.0688e-02   6.3525e-01   8.3008e-01   8.9633e-01
       2.1788e-01   1.8532e-01   3.2400e-01   3.8378e-01   2.0041e-01
       5.0852e-02   6.3537e-02   9.5558e-01   4.1360e-01   6.6543e-01
       1.0681e-01   5.6779e-01   8.8390e-01   6.2696e-01   5.6603e-01
       3.0843e-01   3.7813e-02   5.1968e-01   8.1225e-01   9.5174e-01
       8.1486e-01   1.2409e-01   1.8420e-01   8.8242e-01   5.7982e-01
       7.3654e-01   1.7672e-01   5.3159e-01   5.9625e-01   4.5111e-01

     Columns 6 through 10:

       5.1728e-01   1.0107e-01   6.5419e-01   3.3463e-01   1.0942e-01
       1.7279e-01   2.7808e-01   6.7876e-02   5.4860e-01   5.3571e-01
       7.4577e-01   1.6398e-01   4.4978e-01   9.2166e-01   9.3425e-02
       7.9070e-01   7.6630e-01   4.8991e-01   9.7023e-01   8.0686e-01
       3.9059e-02   1.9876e-01   2.2937e-01   8.3335e-01   8.4557e-01
       5.7511e-01   9.3485e-02   4.2976e-01   1.5719e-01   1.8497e-01
       2.2432e-01   4.5868e-01   9.9131e-01   8.7040e-01   7.9128e-01
       9.3553e-05   6.6808e-01   9.7603e-01   2.5762e-01   4.1599e-01
       7.9825e-01   3.8867e-01   8.7362e-01   1.4623e-01   3.1062e-01
       3.0549e-01   9.1384e-01   9.8013e-01   4.8089e-01   9.4983e-01

    I3d =

    ans(:,:,1) =

     Columns 1 through 6:

       0.9085150   0.1792320   0.5846304   0.2771707   0.2880155   0.9420309
       0.8613022   0.0867448   0.5590647   0.6988739   0.2724803   0.7204822
       0.1855647   0.8378079   0.7677413   0.2595728   0.5104854   0.7870274
       0.4522364   0.0937747   0.9966227   0.0610727   0.1112158   0.2817193
       0.2276822   0.6032556   0.3271703   0.9687399   0.5843361   0.8485225
       0.7477551   0.0935541   0.0397918   0.2241526   0.2214395   0.2617302
       0.8794472   0.4461342   0.7029060   0.3393716   0.7688555   0.9232492
       0.7271264   0.0135106   0.1557253   0.6974208   0.0069772   0.4020502
       0.9869050   0.0169541   0.4121321   0.5420072   0.0759689   0.4529774
       0.3951611   0.8883234   0.9630852   0.5482397   0.2590686   0.2767235

     Columns 7 through 10:

       0.4045911   0.2143361   0.6603151   0.4828948
       0.4372772   0.1877603   0.3025271   0.0906916
       0.1491541   0.4506762   0.6660143   0.5638696
       0.8495631   0.4831842   0.8866188   0.1303504
       0.6335897   0.9267868   0.3939597   0.3463807
       0.5226737   0.5512384   0.3706674   0.2647164
       0.2351980   0.7611097   0.5901221   0.5919692
       0.2260306   0.7774365   0.9966957   0.4580111
       0.2696824   0.2941071   0.6664638   0.1091572
       0.0692295   0.9030892   0.8001783   0.3745571

    ans(:,:,2) =

     Columns 1 through 6:

       0.6358116   0.7210104   0.8962380   0.5977748   0.7720084   0.5213305
       0.7867312   0.4205214   0.9545294   0.3814059   0.8906520   0.2625041
       0.1438551   0.2938348   0.3060704   0.3279878   0.8931884   0.4945498
       0.4845353   0.7323126   0.8208957   0.8710910   0.5035026   0.4881228
       0.5741805   0.5877735   0.4108953   0.3483542   0.8821193   0.0336696
       0.8093164   0.0784516   0.4031445   0.1939100   0.0957019   0.1695865
       0.9424732   0.5602791   0.3306339   0.0844267   0.6953766   0.6677692
       0.3925726   0.1758199   0.4787147   0.4804591   0.0057583   0.6332367
       0.5846225   0.6176720   0.9213075   0.3098178   0.3775534   0.5789479
       0.5169500   0.5357480   0.3968004   0.2105890   0.2748831   0.9091415

     Columns 7 through 10:

       0.5383382   0.1277380   0.7919386   0.9910193
       0.1772733   0.3908723   0.2665560   0.3767360
       0.8033068   0.6287754   0.8694417   0.3273783
       0.1321653   0.5588265   0.7393830   0.8282297
       0.7985915   0.6264328   0.3549167   0.0390456
       0.6336571   0.8055474   0.8279415   0.4747802
       0.9274108   0.7992458   0.4386309   0.1693312
       0.0669233   0.4494325   0.0749771   0.8950862
       0.3647397   0.7922371   0.7000772   0.2596080
       0.0160786   0.5925126   0.9992618   0.2224255

    ans(:,:,3) =

     Columns 1 through 6:

       0.0061426   0.7378355   0.7519356   0.5804171   0.6154007   0.8941715
       0.6575978   0.6255490   0.0711355   0.8374924   0.8314746   0.2497667
       0.2847423   0.0522545   0.6715752   0.2097869   0.0606501   0.5724891
       0.4741217   0.9280973   0.1691334   0.1859933   0.9889718   0.1073489
       0.1766171   0.7981516   0.6994000   0.8907176   0.5814034   0.0419371
       0.8643178   0.0520671   0.4824610   0.6005893   0.4744997   0.4543153
       0.6682848   0.3794387   0.5522350   0.5568276   0.0271924   0.8990382
       0.3069721   0.1232460   0.8136584   0.4909493   0.2771549   0.2706576
       0.4212646   0.9962158   0.5932430   0.0791940   0.6490885   0.6512897
       0.6657112   0.9257975   0.5013654   0.9892049   0.2301217   0.0500173

     Columns 7 through 10:

       0.2258903   0.9350242   0.3612735   0.4738222
       0.8861171   0.1841960   0.5190135   0.5261083
       0.4582520   0.4954488   0.3223983   0.4531726
       0.8396346   0.9743292   0.4215382   0.0489690
       0.4878682   0.0772344   0.2681769   0.7044520
       0.4365548   0.4550444   0.2759317   0.3522443
       0.7292469   0.4410071   0.7824871   0.2465154
       0.4951616   0.4983616   0.1996937   0.0709213
       0.0615712   0.4945864   0.8721199   0.4982466
       0.7153366   0.1861152   0.3921529   0.5475796

    I5d =

    ans(:,:,1,1,1) =

     Columns 1 through 6:

       0.810376   0.098682   0.576878   0.706564   0.819190   0.247543
       0.435225   0.625369   0.373603   0.918725   0.433850   0.772251
       0.485067   0.449270   0.553216   0.787279   0.949005   0.798967
       0.681437   0.416348   0.862801   0.247387   0.499675   0.738336
       0.468978   0.926005   0.079781   0.904408   0.878728   0.829696
       0.114884   0.324622   0.392534   0.383564   0.067494   0.661371
       0.214238   0.833893   0.145222   0.791795   0.193403   0.830096
       0.104963   0.332170   0.627773   0.925863   0.555758   0.869307
       0.988644   0.797814   0.274507   0.449171   0.477658   0.966367
       0.225291   0.813570   0.990809   0.447016   0.959444   0.958199

     Columns 7 through 10:

       0.916102   0.874058   0.786368   0.419681
       0.772763   0.410233   0.981419   0.785152
       0.229611   0.076497   0.055096   0.359925
       0.735858   0.062802   0.453697   0.578421
       0.304172   0.278797   0.794227   0.655945
       0.304396   0.742428   0.330066   0.479694
       0.689693   0.948255   0.154762   0.839338
       0.022627   0.767355   0.302272   0.652870
       0.346508   0.455734   0.206857   0.828140
       0.266232   0.039935   0.291981   0.412147

    ans(:,:,2,1,1) =

     Columns 1 through 6:

       0.276234   0.846525   0.061176   0.140045   0.445964   0.279462
       0.446801   0.428954   0.593714   0.804726   0.162388   0.074579
       0.918022   0.201462   0.185542   0.927933   0.977139   0.302611
       0.771110   0.553937   0.913288   0.462932   0.450807   0.410957
       0.120045   0.567351   0.180486   0.700017   0.993554   0.082247
       0.909432   0.879017   0.127984   0.140255   0.852337   0.188740
       0.223360   0.684406   0.998605   0.908053   0.205410   0.033317
       0.119684   0.721858   0.721251   0.355705   0.368574   0.913923
       0.642101   0.577404   0.567234   0.328714   0.556801   0.473230
       0.056447   0.219470   0.693944   0.070851   0.142890   0.817358

     Columns 7 through 10:

       0.013138   0.203642   0.797660   0.475073
       0.581832   0.940178   0.323563   0.629182
       0.083242   0.203315   0.433784   0.395889
       0.766958   0.755854   0.110398   0.285274
       0.568647   0.627844   0.458146   0.648398
       0.848049   0.047693   0.578580   0.815830
       0.839368   0.768969   0.414103   0.382384
       0.928432   0.228726   0.090722   0.797694
       0.053330   0.801987   0.690028   0.702777
       0.609750   0.052841   0.142793   0.591928

    ans(:,:,3,1,1) =

     Columns 1 through 6:

       0.5209732   0.0843203   0.0586275   0.7436350   0.8676406   0.1172197
       0.6785965   0.0189280   0.8371924   0.1129088   0.4031566   0.1828344
       0.6652239   0.4019332   0.2276184   0.1935138   0.1508922   0.0051881
       0.6424947   0.3763872   0.4583254   0.7549096   0.4031105   0.3927504
       0.8176588   0.3356968   0.0870428   0.2373985   0.3538991   0.5822181
       0.8949977   0.4266026   0.4311177   0.3465940   0.8973854   0.1023099
       0.5465893   0.2078232   0.1344535   0.2617167   0.4746617   0.4718182
       0.4601952   0.6855701   0.9442340   0.2353406   0.6809454   0.3038767
       0.7739653   0.2480496   0.5129697   0.0306575   0.9643645   0.3871131
       0.1672978   0.7420738   0.4181704   0.4270389   0.9200445   0.3316468

     Columns 7 through 10:

       0.9498464   0.3738813   0.4960997   0.0929555
       0.0038414   0.6293277   0.1737913   0.6496748
       0.1709926   0.1237376   0.8221310   0.0481747
       0.7353316   0.8548542   0.0458594   0.3412932
       0.8047790   0.7071608   0.7753484   0.5832220
       0.3047390   0.0329819   0.5165143   0.4323066
       0.2472658   0.4549157   0.1300625   0.0110773
       0.3291799   0.3547561   0.9502443   0.9920188
       0.1856981   0.3352798   0.1850712   0.4557457
       0.4563348   0.9663552   0.0782193   0.9862699

    ans(:,:,4,1,1) =

     Columns 1 through 6:

       0.794770   0.410530   0.148022   0.529149   0.363288   0.207195
       0.523706   0.312083   0.486274   0.429240   0.218603   0.574153
       0.594559   0.177732   0.473127   0.648865   0.739265   0.130675
       0.465082   0.086184   0.781705   0.895195   0.957084   0.866229
       0.035303   0.873758   0.014733   0.183677   0.197174   0.766822
       0.817687   0.861009   0.087369   0.459576   0.305843   0.187788
       0.882185   0.617579   0.664024   0.395632   0.208691   0.902998
       0.924960   0.746975   0.476071   0.309065   0.936185   0.506448
       0.171990   0.468743   0.988962   0.320124   0.719442   0.992578
       0.016150   0.555236   0.883985   0.179951   0.488493   0.437751

     Columns 7 through 10:

       0.050819   0.210973   0.198584   0.275553
       0.367200   0.476461   0.377815   0.259146
       0.863100   0.427207   0.734865   0.764315
       0.206292   0.650585   0.898049   0.195198
       0.488971   0.800481   0.765545   0.246841
       0.491128   0.490847   0.043433   0.646516
       0.208732   0.806342   0.764484   0.664138
       0.805124   0.433424   0.892304   0.506192
       0.538170   0.768819   0.200999   0.893079
       0.394475   0.967602   0.858515   0.898519

    ans(:,:,1,2,1) =

     Columns 1 through 6:

       0.419125   0.801708   0.873315   0.703715   0.905840   0.121056
       0.795143   0.625885   0.103123   0.244379   0.469384   0.133774
       0.966169   0.377714   0.748201   0.144974   0.772168   0.099324
       0.400529   0.157178   0.264000   0.718496   0.784109   0.011721
       0.340166   0.420120   0.745074   0.016972   0.818521   0.188046
       0.207608   0.936520   0.218795   0.456085   0.233022   0.341641
       0.495520   0.841600   0.512516   0.531824   0.412952   0.835727
       0.782307   0.728390   0.725814   0.414064   0.665924   0.900127
       0.596717   0.677278   0.569575   0.939400   0.584586   0.121027
       0.527338   0.645874   0.527975   0.347440   0.843857   0.847947

     Columns 7 through 10:

       0.534677   0.950545   0.475113   0.384314
       0.518978   0.895848   0.537534   0.389922
       0.087276   0.044611   0.888596   0.049048
       0.319639   0.111062   0.817746   0.880923
       0.555878   0.382061   0.677681   0.871777
       0.660479   0.153771   0.335231   0.460487
       0.745573   0.902834   0.970273   0.408826
       0.296409   0.908731   0.025560   0.330915
       0.062144   0.320403   0.564509   0.308299
       0.332799   0.099113   0.131875   0.369725

    ans(:,:,2,2,1) =

     Columns 1 through 6:

       0.0667625   0.4434588   0.2322615   0.9109875   0.4377696   0.3253606
       0.4527177   0.0651558   0.3315827   0.1019568   0.5685801   0.0418888
       0.0473282   0.9841833   0.6112927   0.3025367   0.8748755   0.7882075
       0.3745701   0.8856116   0.7069455   0.2653348   0.2967969   0.0525185
       0.9502550   0.2417517   0.2597097   0.5590371   0.4182782   0.8557862
       0.5102043   0.2738430   0.5187608   0.4156323   0.6944199   0.5934101
       0.8436136   0.3080648   0.0238998   0.8096875   0.1854913   0.6159406
       0.0593120   0.4135516   0.4021995   0.4960027   0.1143986   0.4066538
       0.9197854   0.3165317   0.0551880   0.0417164   0.6550483   0.6269316
       0.1471270   0.3555741   0.1573436   0.1258035   0.8118004   0.0563414

     Columns 7 through 10:

       0.2905911   0.0098594   0.1074483   0.3653092
       0.5687944   0.6673565   0.6230593   0.2375169
       0.5861968   0.7158670   0.7256135   0.7486863
       0.0714501   0.8822895   0.4682427   0.0179792
       0.0244591   0.1613813   0.5592001   0.5022894
       0.9568736   0.0281312   0.5769619   0.5090060
       0.5266264   0.6428395   0.2852004   0.2322997
       0.5417045   0.4404826   0.5275789   0.3680267
       0.3055292   0.9891196   0.2465138   0.1531026
       0.9633465   0.9803822   0.8241016   0.6602472

    ans(:,:,3,2,1) =

     Columns 1 through 6:

       0.8487872   0.8905500   0.9377910   0.8684960   0.5340038   0.6486067
       0.4547180   0.4997198   0.7875987   0.0049704   0.8241293   0.2051052
       0.2395931   0.2442229   0.3500502   0.2905419   0.3150350   0.1750491
       0.5717488   0.2948279   0.2393516   0.8799100   0.0798410   0.9369957
       0.4004781   0.5289274   0.6555123   0.9969869   0.9570398   0.7220818
       0.4023262   0.5851302   0.6405652   0.2888300   0.2495583   0.9202830
       0.0321699   0.4499750   0.7670309   0.2268389   0.8987271   0.8342333
       0.7305865   0.6908330   0.5001874   0.9229585   0.0279327   0.6095449
       0.6060568   0.2107404   0.7223782   0.3920189   0.4876632   0.9492219
       0.7207518   0.9191790   0.8859767   0.2038811   0.6256003   0.7995169

     Columns 7 through 10:

       0.8347789   0.5678921   0.2805064   0.4012978
       0.2143893   0.6999812   0.9810728   0.7272475
       0.2882718   0.0767099   0.2701642   0.2046307
       0.4738332   0.8241256   0.2820355   0.7263221
       0.4344589   0.4198173   0.6620064   0.3204649
       0.7692141   0.8951258   0.7787947   0.3255112
       0.2389707   0.5246297   0.4012678   0.7708479
       0.7492361   0.3582179   0.7673545   0.2743685
       0.1725816   0.2454360   0.9306972   0.1717850
       0.2595417   0.2517398   0.8371412   0.6843575

    ans(:,:,4,2,1) =

     Columns 1 through 6:

       0.416082   0.629340   0.620300   0.616327   0.190143   0.084491
       0.361945   0.281442   0.534239   0.954083   0.825942   0.542995
       0.469400   0.986333   0.217749   0.156239   0.085515   0.403804
       0.406716   0.409443   0.651367   0.900348   0.257977   0.383350
       0.361641   0.312526   0.384863   0.929444   0.081283   0.302890
       0.724502   0.883361   0.865074   0.501750   0.471337   0.104909
       0.607145   0.043828   0.203374   0.165962   0.079829   0.985759
       0.878716   0.906764   0.113423   0.903959   0.538190   0.631155
       0.607674   0.026923   0.621105   0.106972   0.121733   0.353629
       0.394132   0.952002   0.022303   0.381161   0.193216   0.802417

     Columns 7 through 10:

       0.971154   0.423696   0.201953   0.543989
       0.210027   0.877520   0.068125   0.361213
       0.982533   0.633239   0.065602   0.799833
       0.319029   0.234161   0.290546   0.445514
       0.101110   0.627287   0.305455   0.551176
       0.777346   0.101175   0.669952   0.998585
       0.068896   0.493767   0.663224   0.999177
       0.960577   0.556930   0.809245   0.518827
       0.431986   0.177889   0.396948   0.519756
       0.604496   0.726126   0.476635   0.963078

    ans(:,:,1,3,1) =

     Columns 1 through 6:

       0.0051192   0.9642115   0.6467914   0.8485369   0.3367795   0.3916511
       0.8651498   0.3824299   0.4048343   0.5129000   0.0568461   0.2988005
       0.1090879   0.1062871   0.5283745   0.8131848   0.3938530   0.7205317
       0.3265968   0.3017192   0.9198270   0.1461151   0.9379613   0.0089870
       0.7745099   0.2237715   0.8298687   0.3478060   0.4722986   0.4582103
       0.7088194   0.5222636   0.8470160   0.8804550   0.2614177   0.2914650
       0.7500881   0.4096922   0.4335698   0.3125150   0.8714446   0.6881506
       0.3135739   0.1180787   0.2541961   0.5534419   0.8772480   0.6719254
       0.5444778   0.2409311   0.8206862   0.7773879   0.8659744   0.5826321
       0.7138808   0.0905213   0.6064382   0.7062720   0.4397820   0.5705855

     Columns 7 through 10:

       0.0031849   0.6649034   0.9198431   0.1003064
       0.6566476   0.6201431   0.3324817   0.8713365
       0.8614027   0.2492988   0.8141918   0.0247510
       0.2525018   0.9067519   0.3451716   0.9888107
       0.7631954   0.7971038   0.9087908   0.2922930
       0.7464956   0.9444286   0.1913923   0.8875573
       0.1571285   0.5962577   0.4057805   0.8396809
       0.5875000   0.9789866   0.4697268   0.7748592
       0.0855502   0.2323717   0.1751119   0.1201540
       0.1704252   0.4623113   0.3271615   0.4951229

    ans(:,:,2,3,1) =

     Columns 1 through 6:

       0.5973690   0.3982001   0.3266393   0.3945284   0.2504278   0.5428706
       0.3066157   0.2019397   0.3275959   0.0376969   0.4933716   0.8048465
       0.7521998   0.5348336   0.9231731   0.0946847   0.8848275   0.3241261
       0.9951353   0.2644929   0.3555249   0.2598676   0.4748415   0.8246108
       0.7011674   0.5083559   0.9568421   0.1274113   0.6305754   0.1325225
       0.5496720   0.0601821   0.0244317   0.2980860   0.8028220   0.6334425
       0.3767477   0.6368914   0.2611748   0.5216934   0.1587316   0.7043436
       0.7932917   0.9790613   0.6493430   0.5759291   0.1399908   0.7593085
       0.5106853   0.0069769   0.6701336   0.8579557   0.1587473   0.6009623
       0.1267406   0.0806822   0.7929170   0.5037219   0.5099758   0.7923996

     Columns 7 through 10:

       0.4924078   0.6231774   0.6726756   0.2376709
       0.4301648   0.2990099   0.8054499   0.9564681
       0.5753813   0.6445857   0.6709282   0.5839838
       0.1372179   0.9166328   0.9399930   0.8889427
       0.1153677   0.5395731   0.0474958   0.8207998
       0.8171029   0.3164227   0.5009089   0.1273747
       0.8686284   0.4807118   0.7511339   0.8415075
       0.4277779   0.0346180   0.0169095   0.0334487
       0.6913851   0.2302356   0.2614804   0.5996883
       0.7698865   0.1653180   0.3714277   0.2000901

    ans(:,:,3,3,1) =

     Columns 1 through 6:

       0.3673294   0.9310928   0.6944141   0.0291384   0.3594707   0.9045901
       0.5164970   0.8132594   0.8571588   0.4223326   0.7091630   0.8580768
       0.0315146   0.2497343   0.6305408   0.5165458   0.8166352   0.3690522
       0.0630992   0.7650866   0.3799516   0.2870462   0.6177566   0.5705667
       0.3840602   0.0973067   0.8865582   0.5771179   0.1821084   0.5263851
       0.8734286   0.0592813   0.1259235   0.0264619   0.2696337   0.6251776
       0.3709600   0.2788850   0.6147465   0.0028484   0.7663109   0.0262633
       0.0042082   0.9223086   0.5575108   0.6762692   0.8572554   0.5152919
       0.0243544   0.8875509   0.8958823   0.7699428   0.7290951   0.4800880
       0.9173073   0.6194682   0.2524935   0.5880678   0.2092284   0.2648492

     Columns 7 through 10:

       0.8826204   0.8906887   0.8173201   0.0147500
       0.0181336   0.7829348   0.8365039   0.2589379
       0.0569537   0.1441546   0.6442387   0.2406615
       0.0248183   0.1929274   0.4882305   0.0932147
       0.3552673   0.9493918   0.9013098   0.5313287
       0.6024635   0.5908431   0.3854422   0.3208911
       0.0265285   0.3793655   0.4137378   0.5301421
       0.8536833   0.2393343   0.6563048   0.2772838
       0.6340120   0.3848427   0.2024214   0.1717332
       0.2746239   0.3505430   0.6102731   0.1650513

    ans(:,:,4,3,1) =

     Columns 1 through 6:

       0.3321409   0.8011251   0.7911651   0.3987848   0.6076832   0.9440724
       0.6730656   0.3289007   0.6698372   0.6547989   0.2155528   0.7281286
       0.0640711   0.7312586   0.3425904   0.9560479   0.1631463   0.7935855
       0.1890226   0.2227653   0.3707193   0.2555907   0.1217344   0.6544673
       0.5220939   0.7493412   0.0113001   0.9669227   0.4052524   0.7921704
       0.8574233   0.0610000   0.3895241   0.9023984   0.4081744   0.3812959
       0.8935133   0.0988709   0.9062059   0.9678378   0.6976464   0.0603345
       0.9821240   0.1637312   0.2505369   0.1896658   0.7427257   0.3313305
       0.2639491   0.5364443   0.4314255   0.0175309   0.0678695   0.9035357
       0.9132878   0.7721031   0.7490714   0.4765888   0.9494456   0.0239354

     Columns 7 through 10:

       0.4962867   0.8304485   0.2460796   0.3715590
       0.2466159   0.0125134   0.0726971   0.5543683
       0.7719894   0.4127208   0.1506180   0.8240553
       0.5720825   0.0228197   0.3208682   0.4429452
       0.8044129   0.5997317   0.1614014   0.1023594
       0.9284138   0.0405851   0.3361429   0.0340996
       0.7098809   0.8744963   0.6910722   0.0467698
       0.2126441   0.6295077   0.4990928   0.2536376
       0.5383910   0.1317960   0.0327869   0.6306820
       0.0087543   0.4545349   0.8414397   0.3416207

    ans(:,:,1,1,2) =

     Columns 1 through 6:

       0.7110329   0.8780240   0.4496120   0.1588055   0.2367555   0.5472165
       0.6683019   0.3975191   0.4919997   0.5095346   0.6838901   0.4340546
       0.0400900   0.2310279   0.2057475   0.9327393   0.6047668   0.0035260
       0.0963746   0.4375845   0.2923767   0.4233803   0.4786268   0.4987043
       0.1204683   0.7904114   0.3308303   0.9683190   0.9610732   0.4658826
       0.0834552   0.9198336   0.4276609   0.7487897   0.4638412   0.2557878
       0.2383031   0.5166034   0.6468581   0.8770294   0.1036236   0.9069617
       0.9445578   0.8164596   0.2027702   0.5771583   0.7926646   0.9999860
       0.8728387   0.6927377   0.8145227   0.6149674   0.9575772   0.8242791
       0.0903046   0.6864367   0.7184165   0.3253922   0.0278764   0.8276423

     Columns 7 through 10:

       0.1593379   0.0268149   0.7878098   0.7741040
       0.2995835   0.6065372   0.3652583   0.1767655
       0.0804260   0.6675662   0.6701949   0.6737756
       0.2471273   0.8439163   0.0706660   0.9551154
       0.9783697   0.1720289   0.6327307   0.5031399
       0.8673323   0.2480370   0.6143645   0.2205467
       0.1905734   0.3406908   0.0038097   0.1063645
       0.4919964   0.3254222   0.0024640   0.5749885
       0.7113865   0.4963860   0.6523721   0.0589407
       0.7751916   0.9213611   0.7556305   0.7380588

    ans(:,:,2,1,2) =

     Columns 1 through 6:

       0.0102728   0.7869879   0.4224425   0.1847836   0.9911191   0.7171264
       0.6326170   0.4537716   0.6983639   0.8475922   0.7784203   0.6494836
       0.9872571   0.6276377   0.8688471   0.0196818   0.2241776   0.3116178
       0.2738996   0.1599150   0.8873252   0.2603410   0.4524987   0.2994896
       0.3060755   0.4605067   0.0469910   0.4117608   0.1927481   0.8043289
       0.7050812   0.1509867   0.1425108   0.5162964   0.3401355   0.6022343
       0.4265652   0.3726254   0.7981891   0.2168170   0.9888975   0.6476326
       0.6524802   0.5570739   0.8175592   0.2550218   0.9139493   0.0724688
       0.9552424   0.6407442   0.6644576   0.3637030   0.0904287   0.2604093
       0.2482823   0.4084737   0.2589626   0.7900248   0.8356889   0.0010138

     Columns 7 through 10:

       0.0523161   0.2954536   0.9946666   0.5971124
       0.6388745   0.3498102   0.7762737   0.9119895
       0.7772392   0.7447664   0.1293567   0.5012443
       0.5567880   0.7529136   0.3506618   0.4091337
       0.2697423   0.9638289   0.1427652   0.1921481
       0.6502622   0.9979430   0.6982095   0.1404264
       0.0828745   0.0766134   0.6750829   0.8625562
       0.4822215   0.5403436   0.4884062   0.2870998
       0.2537652   0.9961874   0.1483415   0.2586591
       0.2443475   0.2356337   0.7033171   0.2047642

    ans(:,:,3,1,2) =

     Columns 1 through 6:

       0.886570   0.387795   0.674710   0.653723   0.149113   0.797752
       0.878079   0.278299   0.023144   0.217300   0.864953   0.701004
       0.388871   0.903133   0.455367   0.443985   0.501682   0.385823
       0.342179   0.985679   0.903545   0.681919   0.802747   0.856096
       0.996988   0.200966   0.157184   0.380738   0.742683   0.157015
       0.575593   0.142549   0.562835   0.388252   0.422879   0.094094
       0.181369   0.925404   0.822692   0.197060   0.723766   0.515104
       0.952350   0.444017   0.681560   0.662165   0.942260   0.808604
       0.079305   0.566000   0.255629   0.680495   0.903966   0.138276
       0.090300   0.783986   0.535740   0.911551   0.539740   0.036267

     Columns 7 through 10:

       0.222259   0.629112   0.454202   0.748143
       0.385930   0.232702   0.369554   0.385771
       0.502429   0.061489   0.491785   0.500039
       0.985800   0.183869   0.029227   0.807328
       0.825766   0.345752   0.225206   0.058568
       0.699256   0.311132   0.642183   0.075352
       0.644914   0.101891   0.272531   0.217387
       0.430396   0.789706   0.546499   0.884225
       0.509364   0.080719   0.347810   0.552523
       0.789972   0.232638   0.714936   0.608923

    ans(:,:,4,1,2) =

     Columns 1 through 6:

       0.703167   0.895547   0.321455   0.964754   0.636111   0.562098
       0.805162   0.904342   0.629949   0.448413   0.432901   0.635484
       0.381280   0.029067   0.712167   0.090733   0.932404   0.310156
       0.716366   0.476315   0.128624   0.205000   0.741729   0.522251
       0.964924   0.191945   0.306641   0.454506   0.918261   0.387312
       0.583575   0.667824   0.216957   0.733722   0.268015   0.822478
       0.188006   0.859222   0.750902   0.873207   0.890193   0.363098
       0.617089   0.768765   0.759699   0.671263   0.836112   0.435831
       0.182397   0.503122   0.983581   0.111772   0.978514   0.122360
       0.631235   0.641815   0.790211   0.050426   0.211761   0.491106

     Columns 7 through 10:

       0.805627   0.811498   0.742229   0.848890
       0.340196   0.259301   0.222319   0.648404
       0.612253   0.136577   0.394925   0.772409
       0.071778   0.141588   0.913788   0.679360
       0.269393   0.166476   0.263635   0.423187
       0.686158   0.437595   0.454158   0.738118
       0.844870   0.226333   0.050935   0.286054
       0.211835   0.908488   0.451580   0.767429
       0.155943   0.310180   0.052210   0.997174
       0.590957   0.780875   0.716083   0.641756

    ans(:,:,1,2,2) =

     Columns 1 through 6:

       0.1878352   0.8624286   0.3665079   0.9346284   0.8097372   0.9284779
       0.3818379   0.5380551   0.3511858   0.3621515   0.4375099   0.0897530
       0.2033886   0.6267727   0.4514046   0.3064438   0.4398464   0.1861123
       0.7826517   0.0737229   0.0914460   0.6014377   0.8460290   0.7306190
       0.1679334   0.9100354   0.5665778   0.1829216   0.0026763   0.1725150
       0.3000967   0.6898867   0.3373977   0.9283066   0.1095613   0.1012451
       0.1856724   0.7785792   0.0918462   0.2723747   0.8237254   0.0469334
       0.5444948   0.8286812   0.9634168   0.3888340   0.2384108   0.4722390
       0.3702035   0.7133309   0.3465711   0.9603066   0.4341037   0.7701312
       0.4971123   0.7048958   0.7037008   0.8628597   0.7896578   0.2269976

     Columns 7 through 10:

       0.0596639   0.8541383   0.1458686   0.4222925
       0.5366376   0.6475454   0.6719793   0.6302454
       0.2555567   0.6555141   0.5413356   0.4390930
       0.7452817   0.1538712   0.5908946   0.3671833
       0.2530928   0.2819780   0.1573123   0.6293347
       0.3219239   0.6944065   0.9315498   0.2198387
       0.8257163   0.1817305   0.7905729   0.5578306
       0.2679742   0.9576643   0.9092099   0.4662440
       0.2403528   0.8262039   0.4280747   0.5123595
       0.0588874   0.8026308   0.5616471   0.6272292

    ans(:,:,2,2,2) =

     Columns 1 through 6:

       0.2817777   0.2426456   0.9800920   0.4485883   0.9420195   0.0210151
       0.8026816   0.6968762   0.2329937   0.3864551   0.7469092   0.1397848
       0.3604065   0.2609379   0.6908306   0.6449120   0.7933182   0.8722471
       0.6243291   0.6924631   0.6703188   0.8824525   0.5496050   0.3582978
       0.7949584   0.3667689   0.1713776   0.2579087   0.8550084   0.8316173
       0.8861642   0.7375697   0.5709407   0.8717697   0.0297959   0.4739057
       0.4029860   0.0708173   0.4531750   0.6988634   0.9725306   0.2537152
       0.3037881   0.3817658   0.0044153   0.0517739   0.7865039   0.7815663
       0.8142875   0.9779351   0.6364370   0.8089758   0.7452076   0.9534135
       0.0772751   0.5860291   0.9943992   0.3222467   0.7701242   0.3263064

     Columns 7 through 10:

       0.2716679   0.4005586   0.2887278   0.6872264
       0.5503250   0.3952428   0.7999758   0.3053899
       0.3299734   0.3809559   0.6461417   0.9840608
       0.1264273   0.1183382   0.6221502   0.4467041
       0.5175271   0.5742084   0.6400923   0.9573118
       0.7316170   0.0673990   0.5855794   0.9771024
       0.0056992   0.5945818   0.1184796   0.3150174
       0.3239212   0.5616612   0.3554259   0.4474511
       0.1817791   0.9933149   0.0355487   0.0985332
       0.5328323   0.8903889   0.1996794   0.7151594

    ans(:,:,3,2,2) =

     Columns 1 through 6:

       0.4650336   0.1290626   0.5637894   0.6909094   0.8023020   0.9688239
       0.7762508   0.4686659   0.5253495   0.2967104   0.9894615   0.6643910
       0.4146187   0.3799304   0.6445695   0.9634592   0.3051356   0.7322590
       0.0121596   0.8730502   0.6061742   0.8625687   0.1548036   0.8308767
       0.6269605   0.6719517   0.1948955   0.8805310   0.2481145   0.8828404
       0.5021922   0.0020074   0.3464080   0.5400264   0.5584776   0.6148001
       0.6121586   0.8587893   0.2051135   0.3176191   0.6744515   0.1056653
       0.3598432   0.9798290   0.7812014   0.9331295   0.1538925   0.2230421
       0.5179343   0.1550994   0.4213246   0.1235934   0.2573815   0.5212689
       0.9024882   0.7767693   0.2992562   0.6108584   0.4032308   0.0857939

     Columns 7 through 10:

       0.3190705   0.7415331   0.3020702   0.8814395
       0.1383603   0.4121208   0.2586144   0.1448048
       0.5587912   0.0810173   0.8992439   0.0914073
       0.5050345   0.6957303   0.3293078   0.9099616
       0.7795904   0.0128167   0.5730085   0.8210464
       0.9051300   0.6443984   0.9420758   0.2929259
       0.5486139   0.8428771   0.4933654   0.2884004
       0.4987979   0.5632385   0.7008250   0.3480636
       0.4074552   0.8943786   0.6851662   0.2615953
       0.4132316   0.6639066   0.4219204   0.8470077

    ans(:,:,4,2,2) =

     Columns 1 through 6:

       0.1387701   0.7323272   0.5839849   0.3377349   0.5608527   0.4291921
       0.7662255   0.1864237   0.3880898   0.2240633   0.9532640   0.2813417
       0.4694665   0.4050114   0.6872974   0.6890945   0.9732192   0.1751725
       0.4092232   0.8157509   0.5091082   0.3897147   0.5552357   0.2743486
       0.8135658   0.5885752   0.7231130   0.5980365   0.3198819   0.2991516
       0.0542688   0.7818956   0.4371062   0.9334046   0.4949795   0.6461746
       0.4085862   0.3413757   0.8565464   0.8901276   0.5837812   0.0015213
       0.1445362   0.7540329   0.3328202   0.7295881   0.5008343   0.8108689
       0.3134238   0.6581873   0.8769458   0.7714833   0.2454879   0.1323422
       0.7463726   0.3755997   0.7546217   0.9276641   0.8201612   0.9546037

     Columns 7 through 10:

       0.8829186   0.5863462   0.8476416   0.5365916
       0.2361552   0.0726304   0.8838354   0.1502373
       0.8042768   0.2585160   0.5515444   0.4848605
       0.8983858   0.4069385   0.8166760   0.8782747
       0.0577268   0.9604372   0.7152396   0.9542161
       0.5907363   0.0962301   0.9633589   0.7875858
       0.4086413   0.8141418   0.5467496   0.4831412
       0.3067305   0.2918304   0.3994853   0.0681579
       0.9334252   0.6102766   0.6432716   0.1207185
       0.7079995   0.8991320   0.7339144   0.6185315

    ans(:,:,1,3,2) =

     Columns 1 through 6:

       0.850794   0.633792   0.022319   0.584993   0.378538   0.876180
       0.820550   0.566085   0.076135   0.980739   0.468111   0.756060
       0.021893   0.061616   0.244420   0.178111   0.569384   0.242228
       0.387538   0.537468   0.407364   0.981958   0.429383   0.919181
       0.267927   0.511574   0.897277   0.431496   0.096990   0.969997
       0.303660   0.702656   0.993402   0.341931   0.611596   0.807850
       0.768928   0.936842   0.527614   0.808162   0.421734   0.535711
       0.164418   0.788436   0.497669   0.037615   0.673811   0.083115
       0.337013   0.453766   0.176417   0.728280   0.590792   0.333881
       0.934198   0.350312   0.397179   0.337865   0.279992   0.401225

     Columns 7 through 10:

       0.891551   0.203911   0.719829   0.329083
       0.700094   0.326396   0.834893   0.551854
       0.140019   0.476442   0.684188   0.904101
       0.963655   0.113402   0.328759   0.976565
       0.587752   0.804928   0.978060   0.718629
       0.419945   0.579493   0.698214   0.114274
       0.915048   0.438472   0.226911   0.105264
       0.612784   0.189952   0.231739   0.633512
       0.954178   0.435415   0.196564   0.411623
       0.907945   0.639666   0.676578   0.208758

    ans(:,:,2,3,2) =

     Columns 1 through 6:

       0.226755   0.126199   0.703004   0.191332   0.351628   0.785355
       0.240716   0.103539   0.233432   0.358979   0.023161   0.264994
       0.671350   0.490331   0.995962   0.060878   0.924733   0.307135
       0.796921   0.751032   0.786203   0.612042   0.103880   0.430942
       0.276815   0.917041   0.680917   0.173359   0.477252   0.543289
       0.596638   0.520283   0.322937   0.906080   0.449664   0.282786
       0.495594   0.769421   0.055374   0.088746   0.679443   0.293056
       0.300856   0.603273   0.837346   0.679741   0.529878   0.830693
       0.240044   0.623625   0.185466   0.745815   0.157575   0.145465
       0.153187   0.489262   0.447974   0.420381   0.501956   0.713076

     Columns 7 through 10:

       0.555344   0.813898   0.560332   0.214597
       0.672756   0.277195   0.789812   0.080667
       0.644100   0.227224   0.971435   0.370642
       0.919219   0.165152   0.359257   0.329207
       0.667804   0.853995   0.444430   0.490269
       0.111295   0.012433   0.130959   0.624635
       0.578472   0.941766   0.902522   0.129056
       0.277710   0.506310   0.683419   0.792852
       0.387422   0.169937   0.732633   0.570809
       0.145518   0.548646   0.275199   0.520761

    ans(:,:,3,3,2) =

     Columns 1 through 6:

       0.689191   0.479827   0.229239   0.106677   0.399505   0.611669
       0.138483   0.318286   0.647842   0.251831   0.958738   0.688333
       0.273278   0.979835   0.250448   0.765089   0.306333   0.747542
       0.920489   0.760811   0.233740   0.217678   0.168359   0.527905
       0.167515   0.317350   0.606746   0.114158   0.845687   0.532453
       0.859382   0.740998   0.243033   0.785245   0.425521   0.417986
       0.192789   0.269181   0.063988   0.348172   0.914070   0.542250
       0.420217   0.557663   0.159572   0.983462   0.733567   0.877299
       0.012020   0.714532   0.760805   0.185285   0.771359   0.392577
       0.666482   0.575258   0.864656   0.841221   0.530768   0.323908

     Columns 7 through 10:

       0.177994   0.070328   0.089431   0.503279
       0.773427   0.056813   0.039949   0.367435
       0.466352   0.479911   0.815991   0.236570
       0.890969   0.711271   0.292221   0.579875
       0.913373   0.360598   0.933918   0.492918
       0.201973   0.455594   0.623610   0.128726
       0.795043   0.272933   0.782612   0.680447
       0.736731   0.254735   0.313396   0.186607
       0.646843   0.919227   0.864458   0.010671
       0.191913   0.545958   0.526232   0.171408

    ans(:,:,4,3,2) =

     Columns 1 through 6:

       0.651044   0.426291   0.132529   0.309644   0.490345   0.847867
       0.066316   0.918754   0.781046   0.668628   0.734299   0.331468
       0.097357   0.568706   0.445841   0.155303   0.140473   0.931829
       0.027515   0.483933   0.202185   0.348720   0.017776   0.086517
       0.056745   0.877355   0.508475   0.196365   0.940916   0.989078
       0.123305   0.534926   0.324671   0.594712   0.643167   0.694618
       0.094629   0.755468   0.920526   0.361791   0.580710   0.562871
       0.733656   0.208680   0.948009   0.889321   0.489601   0.538729
       0.638333   0.652550   0.473284   0.801093   0.737833   0.517871
       0.319182   0.540627   0.265402   0.659331   0.675305   0.662707

     Columns 7 through 10:

       0.355006   0.039983   0.584125   0.217797
       0.378733   0.204801   0.069714   0.954470
       0.959785   0.874550   0.753330   0.064999
       0.489601   0.945162   0.183287   0.597647
       0.789460   0.566294   0.486116   0.594112
       0.052787   0.120518   0.040279   0.407727
       0.344680   0.211137   0.150753   0.583710
       0.727590   0.610068   0.197102   0.413788
       0.367515   0.561431   0.116795   0.462783
       0.467771   0.385066   0.672628   0.533868

    ans(:,:,1,1,3) =

     Columns 1 through 5:

       7.5862e-01   7.0339e-02   3.6282e-02   5.5131e-01   2.7969e-01
       6.2216e-01   7.5748e-01   3.6294e-01   2.9254e-01   7.6816e-01
       5.4553e-01   5.7890e-01   5.0648e-01   8.0610e-01   5.6458e-01
       1.8127e-01   3.7119e-01   6.7823e-02   8.9845e-02   1.0287e-01
       8.4725e-01   2.5148e-01   4.7502e-01   6.9425e-01   4.9971e-01
       2.6574e-01   9.3057e-01   4.7543e-02   6.5614e-02   4.3115e-02
       8.1758e-01   9.8570e-01   2.5194e-01   9.1936e-01   4.7104e-01
       1.0012e-01   6.1040e-01   7.1138e-01   5.9225e-01   7.5650e-01
       5.8747e-01   2.2277e-01   7.2763e-01   3.6139e-01   7.3308e-01
       2.2427e-01   5.0527e-01   3.3283e-01   7.5260e-01   3.6417e-01

     Columns 6 through 10:

       9.6009e-01   1.8728e-01   8.3446e-01   3.3526e-01   8.3750e-01
       4.2889e-01   5.6616e-01   2.8738e-01   2.1075e-01   4.0626e-01
       6.9434e-01   5.1687e-01   4.6799e-01   5.6063e-01   8.1310e-01
       3.9723e-02   7.0505e-01   8.9811e-01   9.4357e-01   3.7400e-01
       4.6657e-02   6.1032e-01   4.5710e-01   5.6654e-01   2.6755e-02
       4.7177e-01   8.2159e-01   1.9348e-01   4.4297e-04   4.4911e-01
       6.7479e-01   2.4456e-01   4.0061e-03   4.5427e-01   2.3461e-01
       7.2876e-01   2.8433e-01   8.5717e-01   4.5281e-01   4.3909e-01
       5.9167e-01   7.6419e-01   1.4003e-01   4.0845e-02   8.0935e-01
       2.7468e-01   7.4208e-01   9.3800e-01   6.0103e-01   7.5989e-01

    ans(:,:,2,1,3) =

     Columns 1 through 6:

       0.3144406   0.4492238   0.3210776   0.1497821   0.5833951   0.8490552
       0.9824930   0.7265806   0.8706343   0.1787491   0.7706558   0.0922346
       0.8343240   0.5000853   0.3288861   0.2756994   0.7640376   0.0449381
       0.0239175   0.9118305   0.8540507   0.7791173   0.6180356   0.8900255
       0.4609098   0.9856295   0.4481503   0.7467271   0.9205030   0.1736041
       0.2522840   0.5853109   0.7773521   0.0357720   0.5318434   0.1224892
       0.6811796   0.2201579   0.4454656   0.8754586   0.2301040   0.0428462
       0.5919952   0.3561907   0.9231253   0.4670646   0.9991223   0.8102270
       0.8929500   0.9734924   0.4432754   0.6462194   0.2691508   0.1679024
       0.1108776   0.2207221   0.2445374   0.2562309   0.2825925   0.3206091

     Columns 7 through 10:

       0.5482065   0.1904423   0.9086377   0.6126567
       0.3320397   0.1238842   0.0435185   0.7314706
       0.4481993   0.4115661   0.9242669   0.8499299
       0.4386039   0.6351336   0.2455769   0.6618803
       0.4609222   0.9394539   0.6088242   0.3358313
       0.0854179   0.5619829   0.1892635   0.3640896
       0.0096226   0.5155902   0.6920935   0.6643849
       0.2964721   0.8071447   0.6327603   0.2741741
       0.7812418   0.9049199   0.0523360   0.3749038
       0.8870934   0.5149981   0.9373216   0.6739404

    ans(:,:,3,1,3) =

     Columns 1 through 6:

       0.346231   0.694847   0.707671   0.085639   0.466567   0.716807
       0.023801   0.418648   0.961039   0.786690   0.301366   0.934630
       0.833354   0.409944   0.936141   0.448633   0.407969   0.212977
       0.445973   0.866308   0.307409   0.150295   0.307950   0.399792
       0.530967   0.974366   0.274299   0.287140   0.156292   0.447983
       0.501685   0.071529   0.492295   0.192580   0.220192   0.597013
       0.738300   0.871712   0.160501   0.870715   0.751114   0.248977
       0.748594   0.251224   0.582473   0.748841   0.290333   0.172787
       0.315559   0.214128   0.054372   0.933764   0.322828   0.129749
       0.554287   0.172606   0.272414   0.193977   0.188578   0.634297

     Columns 7 through 10:

       0.863770   0.295949   0.467176   0.209818
       0.118984   0.427427   0.211036   0.654256
       0.834705   0.070273   0.053068   0.358345
       0.218966   0.021331   0.420073   0.973724
       0.444437   0.158654   0.017893   0.040638
       0.893008   0.465510   0.266844   0.478578
       0.770323   0.234894   0.740672   0.938118
       0.586680   0.074564   0.431630   0.112819
       0.161049   0.329851   0.373123   0.101998
       0.038160   0.723431   0.848633   0.011059

    ans(:,:,4,1,3) =

     Columns 1 through 6:

       0.4688882   0.2156854   0.6157801   0.3459437   0.7306166   0.1691803
       0.6861487   0.9708954   0.7809346   0.7500212   0.0671029   0.6600254
       0.1429935   0.1575170   0.4164209   0.5889212   0.2715798   0.4538906
       0.0323139   0.1186050   0.3985368   0.0940944   0.9539747   0.0717362
       0.2601728   0.6208839   0.7883033   0.7570049   0.5285336   0.5516416
       0.3017383   0.1942561   0.9151548   0.0355131   0.2005608   0.9926870
       0.1974383   0.5725224   0.1402459   0.9791335   0.0976611   0.2336492
       0.2042691   0.7597393   0.7491054   0.7791514   0.5000714   0.2744578
       0.0089501   0.1159639   0.6710723   0.4272502   0.1681824   0.3603148
       0.4482561   0.0689440   0.1811430   0.8410362   0.4249539   0.8003807

     Columns 7 through 10:

       0.4576554   0.1674037   0.1254396   0.9212458
       0.8617081   0.9788741   0.2704862   0.1131170
       0.1053439   0.3182267   0.5032730   0.4386040
       0.9719134   0.4515963   0.0308440   0.9703481
       0.8575032   0.0638075   0.7834544   0.6449187
       0.5494912   0.9324951   0.3172727   0.2735147
       0.4864995   0.2238607   0.5380475   0.9242677
       0.4528357   0.9043334   0.1666322   0.8277307
       0.3197599   0.8014975   0.9498181   0.5855582
       0.5361182   0.7659236   0.6675139   0.3575443

    ans(:,:,1,2,3) =

     Columns 1 through 6:

       0.7330856   0.3042450   0.8898046   0.1755047   0.4457987   0.8037152
       0.1114979   0.1439123   0.5902880   0.7711424   0.3678137   0.9083077
       0.2445166   0.2329721   0.2395515   0.9756815   0.1064098   0.5483993
       0.9278149   0.8078374   0.8807261   0.3310950   0.3232468   0.1266189
       0.6665967   0.3363437   0.8233265   0.2842847   0.3060392   0.0145264
       0.7546649   0.7868362   0.4076428   0.6631526   0.4638260   0.8560493
       0.8397705   0.5463782   0.4909727   0.1768447   0.2470691   0.4120335
       0.0983401   0.0856996   0.1697998   0.3833083   0.8611075   0.3729273
       0.0990290   0.1564875   0.5247001   0.9386423   0.4074036   0.6870344
       0.9768055   0.2989777   0.4091708   0.9669247   0.0017685   0.5602568

     Columns 7 through 10:

       0.6353499   0.9819943   0.5693483   0.0550054
       0.0709421   0.6059790   0.4243352   0.2394649
       0.9443484   0.9094269   0.3208277   0.3395519
       0.6830302   0.9260379   0.5621889   0.8411683
       0.1032302   0.8202412   0.1200913   0.1045161
       0.2944562   0.9181236   0.5453256   0.5833506
       0.1064836   0.1427281   0.5523289   0.4369657
       0.7475847   0.7739307   0.2310015   0.4928523
       0.0679849   0.2444004   0.5378377   0.8258556
       0.0983835   0.9581749   0.6529665   0.4366992

    ans(:,:,2,2,3) =

     Columns 1 through 6:

       0.801800   0.889606   0.473886   0.413931   0.614331   0.976644
       0.034406   0.132254   0.733489   0.650993   0.118877   0.606720
       0.154382   0.973474   0.248322   0.782100   0.202628   0.340121
       0.814748   0.707078   0.418948   0.035337   0.186991   0.799777
       0.965618   0.817127   0.264575   0.289095   0.191235   0.874288
       0.395955   0.471524   0.456562   0.502931   0.706726   0.986115
       0.156622   0.590867   0.678740   0.726686   0.458974   0.709143
       0.741038   0.427106   0.542616   0.118991   0.690710   0.861181
       0.331060   0.119422   0.836683   0.430782   0.498884   0.654998
       0.604842   0.239425   0.222406   0.849891   0.962850   0.609631

     Columns 7 through 10:

       0.053919   0.300076   0.678275   0.338434
       0.322860   0.747788   0.684467   0.099280
       0.973850   0.286965   0.616203   0.392100
       0.424588   0.503839   0.364567   0.342696
       0.241548   0.804625   0.197536   0.723703
       0.098138   0.362786   0.867388   0.805281
       0.081192   0.378197   0.322923   0.231199
       0.685437   0.804673   0.012785   0.679488
       0.027788   0.182210   0.179127   0.844619
       0.829615   0.239432   0.987732   0.783645

    ans(:,:,3,2,3) =

     Columns 1 through 6:

       0.8638408   0.5383200   0.8390726   0.4922262   0.5377311   0.3070349
       0.8304281   0.9130739   0.2563583   0.1109677   0.6205165   0.4549220
       0.6011665   0.6834816   0.1600743   0.0084841   0.8246802   0.4075215
       0.7767272   0.9947367   0.3790288   0.1316896   0.4813490   0.7754773
       0.6669814   0.3389192   0.8098667   0.2365177   0.7714173   0.1639011
       0.4799822   0.5177266   0.9094590   0.1518632   0.7817404   0.3329719
       0.1490409   0.1085869   0.7535682   0.5204631   0.6424606   0.1484554
       0.5315505   0.3440682   0.8821695   0.1502736   0.4481577   0.6495417
       0.6115610   0.7743779   0.8746075   0.8461900   0.6164543   0.2885691
       0.1790778   0.7667946   0.9706007   0.8380643   0.0561393   0.8824586

     Columns 7 through 10:

       0.6228087   0.4695518   0.1045802   0.5680434
       0.3644617   0.3462045   0.8742075   0.5602357
       0.1129321   0.5047795   0.9976517   0.8098700
       0.2035998   0.2189152   0.7757646   0.4933722
       0.6368288   0.0198674   0.7799486   0.4718916
       0.9115136   0.8247864   0.8294839   0.0896633
       0.7085746   0.4791783   0.0375108   0.1751525
       0.6911451   0.2915172   0.4730333   0.0688938
       0.0986350   0.2037087   0.7406669   0.2259780
       0.6479128   0.7178085   0.5234308   0.9833795

    ans(:,:,4,2,3) =

     Columns 1 through 6:

       0.1228437   0.7780539   0.3690884   0.9366872   0.9085254   0.4931580
       0.9979052   0.3704630   0.8591198   0.9993234   0.0581341   0.7119564
       0.8461543   0.9419168   0.1104134   0.2237329   0.0828601   0.9050517
       0.1915681   0.9889016   0.8505302   0.7926905   0.9537788   0.4099166
       0.2213825   0.0584224   0.4005544   0.1852734   0.4988128   0.6694278
       0.7269050   0.7000921   0.7410180   0.0855901   0.3538941   0.1031796
       0.9176624   0.7027551   0.1879621   0.4757906   0.1168271   0.9169995
       0.2066870   0.0399170   0.4468000   0.6953315   0.2636719   0.8856366
       0.4637182   0.7804980   0.8162842   0.5257744   0.6172873   0.5684309
       0.1870185   0.7035381   0.1542301   0.3177718   0.9447843   0.2016580

     Columns 7 through 10:

       0.9081769   0.2783110   0.7588383   0.5132261
       0.3070008   0.3337840   0.0524411   0.9493287
       0.5895633   0.9659673   0.7425054   0.4342710
       0.4884174   0.3443639   0.9945328   0.2486848
       0.9233115   0.3928765   0.6471286   0.4124642
       0.8274357   0.1576627   0.1288500   0.2563796
       0.9335671   0.0399718   0.3905329   0.9743407
       0.7740407   0.9232492   0.8428377   0.2792094
       0.1646656   0.4630966   0.7754765   0.0027463
       0.9803285   0.3537339   0.0275984   0.7204858

    ans(:,:,1,3,3) =

     Columns 1 through 6:

       0.5451512   0.8501206   0.2304755   0.2498105   0.1888376   0.6490907
       0.6366809   0.5170853   0.4553925   0.3529467   0.2941880   0.9944569
       0.5122925   0.7736511   0.5807332   0.1962239   0.4819563   0.1205416
       0.0650341   0.2077574   0.6380603   0.1652163   0.5069141   0.2623774
       0.5283906   0.0038776   0.7067157   0.8545034   0.4883227   0.4027647
       0.6935661   0.4070631   0.1358483   0.6181418   0.8104914   0.3330237
       0.6968040   0.5745810   0.0931668   0.6721785   0.8460913   0.4107106
       0.5785152   0.8470552   0.0756227   0.6873187   0.0438698   0.9966676
       0.0140942   0.3091861   0.3241048   0.5055772   0.4598760   0.6843525
       0.0522626   0.7262363   0.0841506   0.8864243   0.9317813   0.3542598

     Columns 7 through 10:

       0.3626136   0.3613126   0.0602946   0.7378855
       0.7736633   0.1612781   0.4825160   0.7321479
       0.2645039   0.3064498   0.5197230   0.6318896
       0.8818802   0.9011179   0.1891753   0.1600077
       0.8206620   0.8385200   0.7681921   0.3407088
       0.2611078   0.6914835   0.3115156   0.8106428
       0.3326413   0.3620572   0.1612614   0.7063555
       0.2671771   0.3540776   0.2335775   0.9312685
       0.3925613   0.5362972   0.7036809   0.6310741
       0.5939778   0.1803123   0.1792624   0.0094850

    ans(:,:,2,3,3) =

     Columns 1 through 6:

       0.480055   0.850857   0.123711   0.625405   0.309723   0.263567
       0.975250   0.930985   0.843071   0.239367   0.120495   0.935139
       0.689730   0.339604   0.210789   0.664570   0.992767   0.555746
       0.685839   0.291060   0.192766   0.174706   0.694030   0.864857
       0.580082   0.387641   0.827041   0.085306   0.385927   0.570856
       0.913498   0.934841   0.496802   0.376514   0.843975   0.351227
       0.977695   0.736267   0.376512   0.297048   0.812334   0.067724
       0.221346   0.063625   0.447934   0.894158   0.138811   0.979202
       0.310575   0.708989   0.405779   0.530170   0.167860   0.440096
       0.123417   0.745651   0.695775   0.019632   0.223622   0.477842

     Columns 7 through 10:

       0.999597   0.070435   0.765801   0.415470
       0.020127   0.525837   0.990626   0.225867
       0.757077   0.727578   0.319761   0.863790
       0.827709   0.753525   0.250040   0.926440
       0.659542   0.552003   0.403290   0.920449
       0.241768   0.607339   0.551262   0.106164
       0.174699   0.132699   0.195405   0.222836
       0.877932   0.879486   0.774517   0.732650
       0.619510   0.678228   0.948420   0.272670
       0.672432   0.650404   0.869748   0.087234

    ans(:,:,3,3,3) =

     Columns 1 through 6:

       0.2846252   0.1710440   0.6094655   0.7268151   0.2510088   0.2754298
       0.5488403   0.2882846   0.2726451   0.8317832   0.3331892   0.5142781
       0.1441260   0.7816386   0.7129209   0.0129407   0.4231293   0.7974054
       0.6792504   0.0040439   0.7509981   0.2168169   0.3480927   0.8175583
       0.6077945   0.6052270   0.7635452   0.3597744   0.2559128   0.1531447
       0.6014720   0.5198702   0.9114100   0.4822730   0.7441367   0.0151756
       0.1474322   0.7942648   0.0701747   0.0911274   0.3684599   0.8922914
       0.1539660   0.5633182   0.6048291   0.9356029   0.7782934   0.2643835
       0.0653401   0.4600428   0.0834668   0.5067473   0.2612884   0.3010248
       0.3276631   0.2028324   0.5865180   0.4980144   0.8092142   0.9596885

     Columns 7 through 10:

       0.8011920   0.2816751   0.1209784   0.1871667
       0.8361668   0.9668568   0.6825827   0.1022839
       0.1892759   0.8674382   0.6554186   0.7467678
       0.5897867   0.4231385   0.9867465   0.0485279
       0.1033270   0.7222864   0.1380636   0.4314299
       0.3765269   0.1163341   0.7089589   0.7003331
       0.5845179   0.2773794   0.0189292   0.8931890
       0.6287488   0.4329276   0.1939273   0.5792620
       0.2075719   0.9958989   0.8779850   0.4668706
       0.3564005   0.5261375   0.0130078   0.6342188

    ans(:,:,4,3,3) =

     Columns 1 through 6:

       0.103288   0.749715   0.016936   0.572145   0.352822   0.604138
       0.874111   0.276434   0.436598   0.687274   0.130699   0.169570
       0.467697   0.564932   0.399560   0.109354   0.727055   0.080277
       0.399710   0.820655   0.296942   0.898174   0.472342   0.999163
       0.360285   0.901911   0.171391   0.138758   0.393811   0.588268
       0.014444   0.889683   0.475232   0.092502   0.353702   0.903984
       0.379640   0.427433   0.188672   0.435678   0.376546   0.360428
       0.968674   0.077473   0.635428   0.103905   0.487530   0.197135
       0.154273   0.205481   0.373369   0.273767   0.213899   0.578077
       0.195533   0.707775   0.582127   0.039266   0.305968   0.479923

     Columns 7 through 10:

       0.665827   0.753722   0.885713   0.618882
       0.308906   0.421122   0.663639   0.625722
       0.589005   0.471625   0.679215   0.299922
       0.906937   0.049325   0.442257   0.113711
       0.130041   0.820066   0.385054   0.293687
       0.586955   0.392636   0.412309   0.534002
       0.159771   0.115198   0.133780   0.439231
       0.307487   0.362510   0.973057   0.569527
       0.131633   0.578125   0.357810   0.415215
       0.223604   0.592966   0.445016   0.244886

    ans(:,:,1,1,4) =

     Columns 1 through 6:

       0.3785191   0.0108493   0.9605271   0.0023736   0.4513397   0.7941403
       0.4393758   0.1930053   0.9190101   0.2971234   0.6425911   0.6617955
       0.4839588   0.0155434   0.8736503   0.5692455   0.4682384   0.6035955
       0.0321522   0.8966157   0.7655156   0.4383293   0.4959687   0.1269778
       0.1832596   0.8379255   0.3944127   0.3522696   0.7231979   0.5714074
       0.8226049   0.9250080   0.0482925   0.0394528   0.0673779   0.7472375
       0.9110212   0.8812026   0.4383090   0.6884619   0.4316804   0.6579136
       0.9510257   0.6822651   0.8265268   0.1986968   0.5583221   0.2418278
       0.0822499   0.2769205   0.7628481   0.7232950   0.7167915   0.8057909
       0.4017382   0.7031880   0.3600857   0.1716812   0.2066791   0.3299801

     Columns 7 through 10:

       0.7811152   0.9041819   0.0696058   0.8690373
       0.3228429   0.5467856   0.2348992   0.7928588
       0.1885670   0.9033467   0.7118153   0.1220953
       0.8772282   0.5113753   0.0714468   0.3197514
       0.8149026   0.6432656   0.9754336   0.8634003
       0.3584193   0.7960000   0.7767492   0.6795313
       0.2045736   0.2964510   0.6861184   0.3886449
       0.7996347   0.0800178   0.1172766   0.3637207
       0.4150001   0.2880630   0.6289046   0.5933788
       0.6226515   0.7524806   0.2858924   0.9487069

    ans(:,:,2,1,4) =

     Columns 1 through 6:

       0.8100104   0.3979261   0.3467350   0.4808002   0.8978606   0.5025340
       0.8423734   0.8449910   0.0877013   0.1351406   0.5909174   0.4233560
       0.8292347   0.2863203   0.6685257   0.1828632   0.0766521   0.6964954
       0.6890046   0.0474064   0.7071524   0.2093959   0.5247008   0.9220472
       0.4777844   0.8325253   0.5332144   0.7242996   0.8526023   0.9554140
       0.3216604   0.4375894   0.2453835   0.4818066   0.2881497   0.1257933
       0.0145445   0.4085173   0.5530977   0.8422774   0.2781154   0.2549177
       0.4663474   0.0458723   0.6755106   0.5872221   0.0074437   0.1228561
       0.4814045   0.3968975   0.5946606   0.6045436   0.2928195   0.8705251
       0.1325210   0.5700379   0.5205358   0.8103258   0.8512867   0.9098072

     Columns 7 through 10:

       0.1922647   0.3881156   0.7967817   0.5125256
       0.0335228   0.3212042   0.9422233   0.2639867
       0.9266748   0.6928911   0.1345436   0.9218868
       0.2425319   0.6892601   0.7569770   0.0013963
       0.8980518   0.4587089   0.1340647   0.1629767
       0.6059684   0.4370783   0.1709569   0.4701822
       0.1082179   0.9786090   0.0095417   0.9005811
       0.9201644   0.0600551   0.2403048   0.6353613
       0.9633558   0.0441327   0.2115948   0.1442310
       0.6192783   0.2320528   0.7727746   0.6280055

    ans(:,:,3,1,4) =

     Columns 1 through 6:

       0.431920   0.904283   0.490634   0.966862   0.576891   0.751729
       0.955016   0.394360   0.759523   0.598377   0.674727   0.549850
       0.284063   0.227637   0.718218   0.952498   0.026483   0.399514
       0.668879   0.576639   0.804784   0.952752   0.539398   0.820547
       0.031079   0.152640   0.069120   0.526655   0.085074   0.287305
       0.469471   0.960297   0.077083   0.458250   0.929945   0.439228
       0.578581   0.904569   0.482331   0.118060   0.909695   0.909585
       0.668272   0.669797   0.774112   0.230339   0.482550   0.673848
       0.839362   0.272602   0.317071   0.449671   0.298279   0.745459
       0.769755   0.717374   0.889845   0.676432   0.041727   0.224992

     Columns 7 through 10:

       0.538840   0.495023   0.215640   0.624529
       0.103167   0.082754   0.070717   0.470035
       0.706418   0.292864   0.482974   0.157382
       0.413895   0.527933   0.902264   0.093735
       0.962201   0.032496   0.657382   0.299943
       0.420276   0.040720   0.598305   0.745401
       0.897602   0.681424   0.664921   0.952166
       0.687243   0.192571   0.782766   0.931884
       0.090040   0.603187   0.928007   0.936038
       0.743185   0.499967   0.558059   0.328708

    ans(:,:,4,1,4) =

     Columns 1 through 6:

       0.1329071   0.1336629   0.4882787   0.6386346   0.9141590   0.6183739
       0.4862451   0.5417116   0.1914554   0.4709545   0.5149824   0.1880359
       0.8742992   0.3923178   0.2275061   0.7457718   0.5333878   0.4723723
       0.1478415   0.9754518   0.4300433   0.2446824   0.7490084   0.2412507
       0.4994754   0.6481735   0.8274194   0.8259531   0.7721391   0.7264443
       0.1786777   0.8583073   0.6016381   0.2230578   0.9594751   0.7236471
       0.6662511   0.4089263   0.7545118   0.4192134   0.3741564   0.1917574
       0.9145741   0.2216669   0.5118600   0.8873028   0.0814163   0.9492785
       0.3555764   0.2013435   0.0232607   0.9370945   0.9973404   0.3444831
       0.4940396   0.7258596   0.1706104   0.0016818   0.0928433   0.9611576

     Columns 7 through 10:

       0.3364611   0.6485233   0.6800868   0.0071692
       0.8885098   0.6270486   0.8625918   0.3069994
       0.5025243   0.5172204   0.8686165   0.6249793
       0.2011078   0.9393565   0.9496010   0.0259430
       0.3595349   0.1913845   0.8334979   0.1240816
       0.1919674   0.7618145   0.7406813   0.2758892
       0.7171427   0.4017847   0.2162053   0.6918610
       0.8484749   0.0065517   0.2919607   0.3693019
       0.0545048   0.0701195   0.4613084   0.7994261
       0.6158300   0.0989261   0.2988987   0.5957631

    ans(:,:,1,2,4) =

     Columns 1 through 6:

       0.9221863   0.3937555   0.9604929   0.8230049   0.1144016   0.7122617
       0.3672935   0.1570914   0.0688964   0.5651891   0.2317572   0.0538997
       0.7367600   0.8924232   0.6078225   0.7512682   0.0951665   0.6603563
       0.1536374   0.8423908   0.9164920   0.2159831   0.7297324   0.2513081
       0.2287588   0.3276718   0.9493095   0.5827039   0.9846809   0.9111145
       0.6577846   0.8094693   0.5642568   0.5294142   0.2974792   0.9843389
       0.0519598   0.0941951   0.0553248   0.8868559   0.9624232   0.1564037
       0.6032713   0.9133535   0.7761071   0.6792725   0.8374845   0.2998004
       0.5282124   0.6577550   0.5411139   0.3467639   0.7822044   0.4794027
       0.5400329   0.7851130   0.7214275   0.8928510   0.7034001   0.4389079

     Columns 7 through 10:

       0.5256372   0.3891840   0.5531684   0.4302961
       0.9937101   0.3912479   0.3058315   0.4970499
       0.7892641   0.9058443   0.7333813   0.5971163
       0.9381805   0.1272013   0.0956130   0.1929533
       0.9172565   0.3368015   0.1307791   0.4649270
       0.0083401   0.5142274   0.1292110   0.2124670
       0.2137713   0.1134284   0.2100682   0.4409604
       0.4575967   0.2236272   0.0331036   0.3328078
       0.7761853   0.1085660   0.4492486   0.6909637
       0.4633845   0.8153640   0.8215780   0.3755443

    ans(:,:,2,2,4) =

     Columns 1 through 6:

       0.819123   0.120903   0.484382   0.038341   0.161939   0.636981
       0.838219   0.283026   0.283573   0.199184   0.263532   0.859071
       0.325131   0.873733   0.994821   0.674037   0.128881   0.768851
       0.371981   0.125940   0.512698   0.867149   0.944740   0.916469
       0.180179   0.930897   0.967205   0.226741   0.475812   0.168968
       0.822865   0.450575   0.481773   0.268391   0.037168   0.226606
       0.873644   0.507853   0.995267   0.587533   0.339955   0.408680
       0.759996   0.549796   0.756510   0.446919   0.413644   0.943504
       0.138307   0.175906   0.030845   0.753134   0.662311   0.646046
       0.844333   0.794263   0.645958   0.422030   0.448024   0.427176

     Columns 7 through 10:

       0.445721   0.265980   0.110597   0.107560
       0.646451   0.932811   0.691615   0.244065
       0.866176   0.181976   0.270733   0.351144
       0.121436   0.145280   0.647547   0.693117
       0.078989   0.598467   0.106820   0.226173
       0.608855   0.955578   0.425256   0.950652
       0.697084   0.035168   0.609061   0.723807
       0.475361   0.469438   0.513648   0.944952
       0.352257   0.189332   0.993169   0.443124
       0.765749   0.596841   0.156123   0.294381

    ans(:,:,3,2,4) =

     Columns 1 through 6:

       0.2207312   0.0506856   0.7948222   0.8740116   0.1977410   0.0225726
       0.0129601   0.9909827   0.4778199   0.9156120   0.5315436   0.4643840
       0.8820794   0.8077184   0.7350488   0.6930436   0.8944724   0.1002417
       0.3883300   0.5333843   0.8335439   0.1332570   0.2170623   0.5199104
       0.7644182   0.0916670   0.9178284   0.2444251   0.3463661   0.9430180
       0.4148302   0.0328810   0.6544471   0.0446654   0.9486696   0.8702543
       0.0066148   0.1508441   0.8807896   0.5622397   0.1796325   0.0654344
       0.3284826   0.7146644   0.0730952   0.4683785   0.3821778   0.1356288
       0.7941329   0.9828135   0.9366276   0.4365991   0.7822187   0.3467706
       0.1181847   0.5932183   0.2123378   0.5502300   0.4064237   0.9484115

     Columns 7 through 10:

       0.2814349   0.3358703   0.1909897   0.5761938
       0.1001476   0.4171805   0.0205788   0.8417514
       0.1772972   0.8073782   0.1033353   0.9750542
       0.7781270   0.0594298   0.4628182   0.4482644
       0.6048608   0.1516473   0.0993976   0.4753654
       0.9453228   0.8232433   0.2345676   0.3244100
       0.4168277   0.2724879   0.7021812   0.9570908
       0.4211829   0.1483663   0.5357381   0.2868630
       0.9246399   0.5521450   0.4772562   0.3061049
       0.4107650   0.9296004   0.5825844   0.4040235

    ans(:,:,4,2,4) =

     Columns 1 through 6:

       0.3998692   0.1816136   0.4014900   0.1878816   0.9687808   0.6807696
       0.2743225   0.1820235   0.6939612   0.6013270   0.7215128   0.0301795
       0.5660411   0.0896822   0.2080072   0.1818823   0.5363087   0.9853368
       0.6517941   0.1926007   0.1567062   0.7534557   0.1176018   0.1333705
       0.6836826   0.6915843   0.1046337   0.6909996   0.2060720   0.3076803
       0.8169169   0.7722084   0.5142177   0.3070352   0.8379442   0.1788433
       0.0962919   0.1945839   0.1783261   0.9584661   0.1483848   0.4020275
       0.0024227   0.0592890   0.0585696   0.4118688   0.8106422   0.4602598
       0.7181605   0.6297752   0.7005899   0.7858837   0.3575236   0.0856582
       0.9327273   0.8518045   0.8813047   0.7356853   0.1917535   0.1573381

     Columns 7 through 10:

       0.3341257   0.9666190   0.0500985   0.1787116
       0.5634728   0.0348642   0.4322336   0.7682960
       0.2576974   0.2843808   0.0432594   0.4831940
       0.9855501   0.9954829   0.6100633   0.2294395
       0.0279284   0.0226153   0.7314434   0.7958407
       0.3464461   0.6501314   0.6060481   0.4320377
       0.5402023   0.2511329   0.9928612   0.1246288
       0.4823693   0.5856430   0.1391674   0.7279321
       0.1148116   0.0069934   0.0668799   0.7736395
       0.5978489   0.4175776   0.3291589   0.7364442

    ans(:,:,1,3,4) =

     Columns 1 through 6:

       0.4428318   0.2398345   0.8054242   0.5311792   0.0309002   0.2604719
       0.8039845   0.9816392   0.0176186   0.7378988   0.7496737   0.1005455
       0.2781143   0.5221152   0.7629324   0.9721451   0.0856175   0.8197961
       0.0804212   0.1706542   0.8776389   0.3257413   0.8405505   0.8124761
       0.7845693   0.8186195   0.7931446   0.6896201   0.1012919   0.8148798
       0.4674011   0.2497635   0.8904285   0.5316739   0.9462265   0.5532187
       0.9632776   0.4298828   0.7034344   0.8142668   0.8923561   0.8249331
       0.3329943   0.0030627   0.1135250   0.4431260   0.5723092   0.7205891
       0.6636094   0.5761154   0.0874562   0.4811210   0.7875135   0.8079906
       0.9169652   0.2869805   0.6740854   0.3853947   0.5753733   0.6599927

     Columns 7 through 10:

       0.4581947   0.0190495   0.1994428   0.9169318
       0.2565918   0.3324478   0.4357084   0.9218572
       0.0704882   0.7451727   0.1049664   0.8319775
       0.8347842   0.4330171   0.4950951   0.0253417
       0.0282180   0.9718128   0.2084240   0.6230062
       0.4971704   0.5908029   0.4444892   0.4561286
       0.2362598   0.0493352   0.8117606   0.1696213
       0.9855283   0.7919508   0.5259903   0.5212839
       0.2747836   0.8284489   0.6706880   0.2339590
       0.7480057   0.1340183   0.5515319   0.6119487

    ans(:,:,2,3,4) =

     Columns 1 through 6:

       0.045956   0.453027   0.332471   0.471060   0.769015   0.204756
       0.405728   0.084246   0.806740   0.783708   0.793071   0.929316
       0.307348   0.032294   0.916778   0.914669   0.180892   0.406862
       0.265401   0.027937   0.931253   0.259871   0.975836   0.515867
       0.701070   0.105863   0.063624   0.442207   0.072759   0.076980
       0.351702   0.390311   0.101864   0.544741   0.584084   0.903041
       0.700058   0.368975   0.309714   0.283959   0.059429   0.251071
       0.132286   0.215867   0.188597   0.109037   0.450382   0.922532
       0.096045   0.490030   0.510885   0.050734   0.234843   0.144785
       0.753793   0.663184   0.289764   0.578164   0.376885   0.036052

     Columns 7 through 10:

       0.194204   0.385404   0.935548   0.659758
       0.131649   0.645945   0.600144   0.721072
       0.837149   0.484250   0.235129   0.890835
       0.430541   0.359981   0.803519   0.627617
       0.820869   0.281609   0.058534   0.236352
       0.016961   0.512811   0.871534   0.324573
       0.464656   0.450423   0.053522   0.200902
       0.070603   0.665820   0.133322   0.187405
       0.376772   0.956613   0.723076   0.556708
       0.247163   0.369644   0.241978   0.660996

    ans(:,:,3,3,4) =

     Columns 1 through 6:

       0.1900844   0.5042037   0.2352399   0.4259761   0.5340870   0.7224739
       0.4425407   0.9898682   0.5864365   0.8480903   0.6838866   0.8333596
       0.1653547   0.6113855   0.1806442   0.7444247   0.8381104   0.5388216
       0.5267754   0.1779311   0.0264266   0.0753469   0.1161482   0.5352721
       0.5710416   0.8621054   0.4645747   0.0777636   0.1868425   0.7127999
       0.2048246   0.0687362   0.4413036   0.7715360   0.2181228   0.8413727
       0.6013444   0.3660024   0.8985174   0.9695797   0.6110059   0.5878016
       0.5923611   0.2194472   0.4159441   0.2434017   0.0563829   0.7586861
       0.5594199   0.8369203   0.3973945   0.2624748   0.9266826   0.9693698
       0.5224290   0.9632543   0.2961119   0.3169275   0.7082023   0.0323499

     Columns 7 through 10:

       0.5666893   0.6450891   0.0619235   0.8015281
       0.5236031   0.4093964   0.3465515   0.9741782
       0.4840864   0.1091859   0.9761335   0.9409857
       0.7915930   0.1964440   0.0113213   0.6952987
       0.1304345   0.9664155   0.9790717   0.8100319
       0.5963768   0.2873119   0.7071798   0.1999273
       0.1568308   0.0020468   0.5721391   0.1793425
       0.6041103   0.6636926   0.2359058   0.3164876
       0.1142857   0.0616902   0.6012203   0.1198328
       0.2558451   0.7963141   0.1316205   0.3497879

    ans(:,:,4,3,4) =

     Columns 1 through 6:

       0.455483   0.433091   0.546476   0.770915   0.610159   0.127337
       0.722177   0.375602   0.299812   0.788992   0.439248   0.800542
       0.848727   0.176577   0.971902   0.210796   0.332562   0.095872
       0.895288   0.210152   0.212159   0.179440   0.105010   0.542659
       0.199930   0.210232   0.188306   0.048453   0.715464   0.627898
       0.901017   0.218487   0.234079   0.651553   0.366748   0.254831
       0.187307   0.757084   0.380337   0.555499   0.474192   0.645459
       0.865772   0.438766   0.936289   0.420820   0.372481   0.823051
       0.153491   0.602102   0.630728   0.550746   0.710080   0.513180
       0.900283   0.125030   0.806739   0.781810   0.937753   0.333983

     Columns 7 through 10:

       0.735940   0.956946   0.709751   0.265074
       0.821596   0.966594   0.243540   0.490638
       0.701439   0.227575   0.010666   0.097196
       0.438868   0.945198   0.396448   0.428829
       0.805237   0.209144   0.349541   0.807463
       0.622573   0.763742   0.785789   0.969664
       0.659886   0.363532   0.532697   0.271219
       0.306488   0.326145   0.054343   0.429109
       0.610497   0.939184   0.865744   0.209673
       0.777626   0.094531   0.169519   0.322487

    ans(:,:,1,1,5) =

     Columns 1 through 6:

       0.7525529   0.2526449   0.5518167   0.7476556   0.6590931   0.3645592
       0.8284224   0.2015857   0.8144802   0.1514454   0.4946551   0.2118947
       0.6471742   0.8672025   0.0799349   0.9695598   0.7143175   0.2051612
       0.2201457   0.4645232   0.9393170   0.6166459   0.2899488   0.5894681
       0.1720271   0.0387727   0.3689050   0.8327928   0.8281529   0.3017802
       0.9226222   0.6954933   0.0025359   0.2225603   0.8473578   0.4420238
       0.4429980   0.1232048   0.2873159   0.8691833   0.5007745   0.3834831
       0.6207460   0.4464608   0.3105228   0.2897732   0.1774605   0.0395224
       0.9198031   0.4652506   0.4177073   0.7615541   0.4366602   0.9013855
       0.6761669   0.8181348   0.8552856   0.5985181   0.3988782   0.9557264

     Columns 7 through 10:

       0.1562362   0.9402438   0.4178779   0.4828962
       0.2350522   0.5360951   0.9756493   0.2689078
       0.9775066   0.0783453   0.1572501   0.5173312
       0.4399105   0.8319434   0.8591298   0.0878774
       0.9052349   0.6235324   0.9563297   0.6223853
       0.8190105   0.9753877   0.8739221   0.7005340
       0.8284015   0.1330207   0.7216829   0.2117149
       0.8476556   0.0469990   0.5927292   0.8871432
       0.0493367   0.7829278   0.3196544   0.7290857
       0.8589844   0.1794937   0.2668246   0.3640466

    ans(:,:,2,1,5) =

     Columns 1 through 6:

       0.949101   0.807530   0.184762   0.063234   0.643219   0.423089
       0.802067   0.381490   0.127063   0.174317   0.194559   0.198314
       0.162079   0.340070   0.813433   0.461299   0.068899   0.710028
       0.529192   0.748057   0.444558   0.222226   0.566966   0.055088
       0.165613   0.060685   0.505405   0.380502   0.058439   0.095110
       0.039772   0.903359   0.400247   0.972611   0.846175   0.377672
       0.165600   0.452785   0.415005   0.123863   0.032456   0.191811
       0.087627   0.828465   0.138878   0.117744   0.039669   0.738604
       0.176998   0.959255   0.445712   0.950234   0.307830   0.845644
       0.479856   0.519376   0.855981   0.877873   0.015214   0.111778

     Columns 7 through 10:

       0.851341   0.421584   0.126577   0.380539
       0.987831   0.522625   0.027647   0.390499
       0.622777   0.357686   0.375540   0.693333
       0.584734   0.417811   0.734467   0.607747
       0.244363   0.033658   0.422938   0.126092
       0.235824   0.761113   0.825028   0.182227
       0.752699   0.352376   0.268589   0.507060
       0.628813   0.032904   0.979176   0.988437
       0.048061   0.065858   0.463159   0.266321
       0.815382   0.935908   0.805265   0.579584

    ans(:,:,3,1,5) =

     Columns 1 through 6:

       0.737323   0.905360   0.316564   0.368499   0.753532   0.767448
       0.385909   0.827211   0.341869   0.372557   0.759581   0.862251
       0.410366   0.304743   0.820749   0.990932   0.250699   0.141378
       0.561998   0.093783   0.187227   0.332428   0.849277   0.264085
       0.508426   0.887574   0.955740   0.267614   0.641164   0.441224
       0.606690   0.435946   0.055648   0.662932   0.064705   0.691922
       0.054660   0.083549   0.997945   0.497239   0.982208   0.239593
       0.488767   0.262034   0.415360   0.162416   0.114267   0.414360
       0.041459   0.616860   0.775544   0.097906   0.521429   0.364545
       0.283602   0.530584   0.069798   0.834012   0.875984   0.180513

     Columns 7 through 10:

       0.760188   0.692474   0.572610   0.945949
       0.130591   0.774632   0.671396   0.773314
       0.672971   0.943170   0.135099   0.818206
       0.665143   0.593637   0.234495   0.346348
       0.502504   0.023369   0.676187   0.885779
       0.678728   0.458255   0.366031   0.251197
       0.252500   0.291171   0.290848   0.610278
       0.323417   0.583610   0.800318   0.942947
       0.078138   0.185280   0.690551   0.238598
       0.654039   0.037470   0.901182   0.851475

    ans(:,:,4,1,5) =

     Columns 1 through 6:

       0.0858624   0.5701325   0.6540565   0.0205818   0.5880964   0.3028144
       0.3090545   0.0793148   0.3541483   0.3836416   0.3261831   0.2555240
       0.7507791   0.6948825   0.1497456   0.9160420   0.9465602   0.0798751
       0.8561579   0.3198855   0.9982400   0.6285265   0.7948257   0.5347386
       0.7494093   0.9516750   0.5796647   0.3224356   0.1124342   0.5256283
       0.7508151   0.3623406   0.6603595   0.0781232   0.5626022   0.5841854
       0.6952069   0.8122681   0.8124431   0.0449089   0.8911996   0.0312853
       0.3452848   0.8424360   0.3130398   0.8069593   0.7757878   0.7200304
       0.1977939   0.4842620   0.5158552   0.2752961   0.5354950   0.3448198
       0.6158655   0.4811996   0.5151347   0.8054806   0.3798442   0.5253331

     Columns 7 through 10:

       0.2368545   0.0097400   0.8510853   0.5857612
       0.8785074   0.2719509   0.4371422   0.1039167
       0.1352587   0.3962855   0.4349480   0.1541173
       0.3523106   0.2463757   0.9304385   0.1048577
       0.6833446   0.7245782   0.3270974   0.6919563
       0.8497526   0.8966069   0.8169554   0.2215362
       0.3286397   0.7553802   0.2781760   0.2009482
       0.7997442   0.5672165   0.0512356   0.8973802
       0.8345787   0.5228720   0.0446545   0.7480455
       0.0964453   0.6580536   0.0723279   0.4209157

    ans(:,:,1,2,5) =

     Columns 1 through 6:

       0.438774   0.314456   0.458459   0.926635   0.010484   0.037389
       0.815694   0.879419   0.726062   0.546165   0.135028   0.446645
       0.436101   0.892103   0.540482   0.168270   0.353211   0.158197
       0.999735   0.034360   0.915122   0.154533   0.139559   0.720740
       0.842763   0.273673   0.021058   0.621158   0.794456   0.452874
       0.644759   0.404026   0.377913   0.568501   0.833690   0.768432
       0.744571   0.148542   0.671533   0.121242   0.926864   0.990331
       0.063632   0.491821   0.094314   0.269770   0.656471   0.021625
       0.237936   0.626790   0.562920   0.696457   0.584835   0.778039
       0.015329   0.931627   0.142827   0.216644   0.551701   0.485132

     Columns 7 through 10:

       0.273156   0.430352   0.669936   0.708889
       0.346589   0.908352   0.998360   0.045358
       0.667300   0.114604   0.596104   0.609949
       0.194637   0.732624   0.985820   0.889626
       0.798545   0.789774   0.265795   0.186119
       0.055130   0.554879   0.027643   0.735173
       0.778877   0.616582   0.028475   0.642420
       0.510587   0.606727   0.211427   0.757764
       0.370941   0.839959   0.415943   0.708189
       0.634897   0.618190   0.253100   0.750889

    ans(:,:,2,2,5) =

     Columns 1 through 6:

       0.599960   0.366123   0.172038   0.720374   0.793966   0.635938
       0.802937   0.883986   0.259999   0.982068   0.776531   0.045899
       0.938947   0.967589   0.795366   0.075927   0.485244   0.690240
       0.623743   0.674721   0.401160   0.248431   0.595650   0.222967
       0.872494   0.884911   0.236057   0.474905   0.315514   0.349974
       0.719052   0.421072   0.694964   0.471894   0.820218   0.239910
       0.134472   0.601424   0.704536   0.774624   0.790520   0.917434
       0.947465   0.655852   0.753532   0.725942   0.982712   0.269186
       0.442003   0.749828   0.849785   0.268833   0.120107   0.038457
       0.874144   0.773665   0.737600   0.239593   0.923668   0.732074

     Columns 7 through 10:

       0.411312   0.504910   0.897257   0.871952
       0.132512   0.888823   0.573310   0.888081
       0.657286   0.076431   0.193392   0.458831
       0.024494   0.011068   0.974473   0.661190
       0.995294   0.339811   0.017605   0.772314
       0.448058   0.461953   0.436285   0.544055
       0.556011   0.431284   0.442935   0.767002
       0.604538   0.279958   0.218520   0.563034
       0.532139   0.575311   0.944990   0.031470
       0.655849   0.408060   0.779106   0.218882

    ans(:,:,3,2,5) =

     Columns 1 through 6:

       0.7308850   0.8719699   0.6273512   0.9777553   0.8903067   0.9171131
       0.4312186   0.2807537   0.7029967   0.5344480   0.8271091   0.5667781
       0.6019108   0.8426071   0.7663381   0.0198564   0.4280430   0.0542346
       0.5301294   0.6562546   0.6904015   0.4683159   0.6471575   0.3907886
       0.1368987   0.4757006   0.3496592   0.9893074   0.5882830   0.4034688
       0.5853650   0.3143311   0.0566842   0.4370902   0.3993760   0.8952610
       0.1253357   0.5207573   0.3237674   0.9952988   0.0149685   0.4150831
       0.9651695   0.0363191   0.9682654   0.0940314   0.2193166   0.9363568
       0.9632905   0.1134134   0.1205081   0.4995357   0.5666459   0.7011007
       0.9872827   0.0110440   0.5623660   0.7501842   0.4325043   0.0039972

     Columns 7 through 10:

       0.5951025   0.9789338   0.0735213   0.7822870
       0.8435287   0.2555188   0.5872638   0.1691479
       0.5762648   0.0332170   0.5176996   0.1574856
       0.8602033   0.1569811   0.4382080   0.5341847
       0.1962821   0.5747071   0.3832164   0.9007896
       0.5568725   0.0093489   0.9152092   0.4748951
       0.6660920   0.4159313   0.9116907   0.8330728
       0.2978317   0.0379045   0.9011523   0.0678634
       0.1032624   0.8835024   0.8243145   0.0998555
       0.9064715   0.1293815   0.9863038   0.8610186

    ans(:,:,4,2,5) =

     Columns 1 through 6:

       0.1871997   0.0025077   0.2008516   0.3753066   0.0370124   0.5915076
       0.5867163   0.2677020   0.3666668   0.7767783   0.9844890   0.1567256
       0.7515606   0.8857211   0.2844261   0.5678163   0.3037900   0.7288401
       0.7702729   0.6540770   0.3495550   0.6939664   0.9317906   0.1689494
       0.5243031   0.0191734   0.7021083   0.7801938   0.2983707   0.7862142
       0.6942854   0.2520309   0.2093010   0.1319610   0.6044765   0.8937971
       0.5852260   0.3986314   0.2678591   0.6260540   0.8181763   0.5242560
       0.3679850   0.1002911   0.5795569   0.9290391   0.1943274   0.5763062
       0.8582503   0.8595343   0.3338544   0.1704357   0.5986601   0.3238175
       0.1384983   0.9793223   0.0210770   0.1780496   0.9293071   0.2411204

     Columns 7 through 10:

       0.2724874   0.2144238   0.2393040   0.3405780
       0.6806879   0.6712833   0.2333862   0.2738428
       0.0753792   0.3944164   0.8565890   0.4328555
       0.3737041   0.4171043   0.4193427   0.9452840
       0.0175592   0.6380302   0.2738426   0.5925482
       0.2299823   0.9397760   0.6751462   0.9470003
       0.7361179   0.2450149   0.9937926   0.0901551
       0.5014340   0.4710196   0.4453339   0.7279992
       0.6796307   0.7145715   0.7833796   0.4424184
       0.9226588   0.7416265   0.0031776   0.1889637

    ans(:,:,1,3,5) =

     Columns 1 through 6:

       0.162686   0.826070   0.280811   0.460022   0.409782   0.777538
       0.179209   0.942803   0.062075   0.068898   0.405612   0.251916
       0.194171   0.897989   0.668488   0.222695   0.139410   0.576132
       0.181131   0.713345   0.648146   0.879462   0.093753   0.430555
       0.508321   0.857280   0.707330   0.944771   0.566885   0.310890
       0.319102   0.995842   0.537540   0.232012   0.514900   0.278095
       0.612414   0.127316   0.494216   0.305110   0.821853   0.073798
       0.951200   0.770335   0.452708   0.212228   0.092842   0.113831
       0.492607   0.029941   0.424554   0.451297   0.390969   0.735861
       0.293330   0.824030   0.998432   0.058730   0.752901   0.863079

     Columns 7 through 10:

       0.649692   0.756461   0.548008   0.739541
       0.427832   0.874076   0.642703   0.968906
       0.668597   0.378141   0.815889   0.437688
       0.260223   0.868810   0.747671   0.454604
       0.253437   0.514037   0.857072   0.250732
       0.281889   0.706310   0.610817   0.619007
       0.870881   0.861323   0.281057   0.076955
       0.715648   0.522148   0.019085   0.622887
       0.443207   0.654787   0.926138   0.674028
       0.249230   0.759881   0.204332   0.789773

    ans(:,:,2,3,5) =

     Columns 1 through 6:

       0.476225   0.691057   0.077779   0.580940   0.093755   0.645665
       0.229565   0.939150   0.978505   0.204712   0.266081   0.652791
       0.421190   0.296825   0.621034   0.659870   0.077071   0.029741
       0.913943   0.320447   0.293368   0.371203   0.379352   0.169000
       0.627324   0.134723   0.427428   0.531598   0.233032   0.836492
       0.124042   0.214849   0.988148   0.869166   0.551678   0.309880
       0.039480   0.064019   0.092674   0.922937   0.271340   0.057332
       0.654832   0.204751   0.163468   0.245693   0.093997   0.468796
       0.509544   0.716194   0.709355   0.285992   0.297988   0.292526
       0.975371   0.929956   0.929384   0.628207   0.397132   0.785282

     Columns 7 through 10:

       0.825423   0.575956   0.149509   0.881312
       0.714736   0.817835   0.628735   0.524746
       0.403378   0.678828   0.163393   0.491836
       0.506554   0.900746   0.190431   0.092977
       0.820059   0.354175   0.669619   0.435576
       0.206743   0.947699   0.786225   0.204839
       0.083138   0.418545   0.576873   0.479118
       0.014887   0.678164   0.904250   0.302900
       0.841069   0.325409   0.091608   0.283867
       0.111765   0.037845   0.839086   0.262185

    ans(:,:,3,3,5) =

     Columns 1 through 6:

       0.672430   0.242542   0.897542   0.181572   0.131074   0.919885
       0.308615   0.653643   0.405326   0.746605   0.989897   0.046056
       0.609244   0.874862   0.917142   0.399770   0.866016   0.391503
       0.163367   0.582461   0.752122   0.083745   0.827340   0.462533
       0.685073   0.327312   0.654498   0.855563   0.649997   0.362671
       0.458819   0.140757   0.098637   0.323070   0.426681   0.970997
       0.867835   0.937834   0.393735   0.941417   0.701411   0.761693
       0.877912   0.387325   0.495172   0.600731   0.408191   0.785564
       0.356828   0.346626   0.573745   0.083574   0.696833   0.293935
       0.481151   0.681907   0.015647   0.128826   0.334606   0.313441

     Columns 7 through 10:

       0.399627   0.510351   0.249768   0.407851
       0.125632   0.914163   0.072396   0.214518
       0.574734   0.902247   0.146615   0.782473
       0.866140   0.844211   0.242116   0.775236
       0.567439   0.742191   0.124226   0.889794
       0.568529   0.470481   0.725047   0.925437
       0.570398   0.249993   0.257579   0.825237
       0.126306   0.911775   0.024731   0.399424
       0.383687   0.737874   0.677939   0.996629
       0.868467   0.889697   0.392372   0.914340

    ans(:,:,4,3,5) =

     Columns 1 through 6:

       0.661622   0.636417   0.872851   0.465302   0.690350   0.173233
       0.547391   0.032970   0.753829   0.990549   0.399422   0.463375
       0.200451   0.580093   0.846572   0.348690   0.999825   0.475279
       0.692338   0.555580   0.978246   0.118080   0.539186   0.168355
       0.089671   0.601060   0.792428   0.746589   0.568380   0.265944
       0.811798   0.266757   0.555606   0.872422   0.705870   0.880789
       0.277688   0.624231   0.087208   0.351108   0.989752   0.930447
       0.086334   0.786207   0.270813   0.422604   0.356176   0.778987
       0.596131   0.929575   0.693070   0.588203   0.637101   0.995736
       0.345290   0.363953   0.370261   0.961436   0.183752   0.454368

     Columns 7 through 10:

       0.671345   0.074775   0.013161   0.764867
       0.587133   0.393859   0.112282   0.763690
       0.165523   0.906492   0.781467   0.503899
       0.570264   0.026450   0.666447   0.821832
       0.469820   0.063610   0.978358   0.825583
       0.115245   0.858375   0.249852   0.474317
       0.987010   0.439399   0.454045   0.635855
       0.614975   0.501581   0.237833   0.101266
       0.065735   0.178675   0.183031   0.307975
       0.456399   0.331072   0.606279   0.450220

    double_corner =

     Columns 1 through 5:

      -2.0000e-01   7.1460e-01   8.6567e-01   3.5439e-01   8.1303e-01
       1.3000e+00  -2.0000e-01   5.8131e-01   7.2077e-01  -2.0000e-01
       7.0996e-01   4.6300e-02   4.8698e-01  -2.0000e-01   1.3000e+00
       7.1942e-01   8.0688e-02   1.3000e+00   8.3008e-01   8.9633e-01
      -2.0000e-01  -2.0000e-01   3.2400e-01   3.8378e-01  -2.0000e-01
       5.0852e-02   6.3537e-02   9.5558e-01   4.1360e-01   1.3000e+00
      -2.0000e-01   5.6779e-01   8.8390e-01   1.3000e+00   5.6603e-01
       3.0843e-01   3.7813e-02   5.1968e-01   8.1225e-01   9.5174e-01
       8.1486e-01  -2.0000e-01  -2.0000e-01   8.8242e-01   5.7982e-01
       7.3654e-01  -2.0000e-01   5.3159e-01   5.9625e-01   4.5111e-01

     Columns 6 through 10:

       5.1728e-01  -2.0000e-01   1.3000e+00   3.3463e-01  -2.0000e-01
      -2.0000e-01  -2.0000e-01   6.7876e-02   5.4860e-01   5.3571e-01
       7.4577e-01  -2.0000e-01   4.4978e-01   9.2166e-01   9.3425e-02
       7.9070e-01   7.6630e-01   4.8991e-01   9.7023e-01   8.0686e-01
       3.9059e-02  -2.0000e-01  -2.0000e-01   8.3335e-01   8.4557e-01
       5.7511e-01   9.3485e-02   4.2976e-01  -2.0000e-01  -2.0000e-01
      -2.0000e-01   4.5868e-01   9.9131e-01   8.7040e-01   7.9128e-01
       9.3553e-05   1.3000e+00   9.7603e-01  -2.0000e-01   4.1599e-01
       7.9825e-01   3.8867e-01   8.7362e-01  -2.0000e-01   3.1062e-01
       3.0549e-01   9.1384e-01   9.8013e-01   4.8089e-01   9.4983e-01

***** assert (grayslice (im2uint16 (I2d), 3), uint8 (test_grayslice_scalar (I2d, 3)))
8 tests, 7 passed, 0 known failure, 0 skipped
[im2col]
>>>>> /usr/share/octave/packages/image-2.6.1/im2col.m
***** demo
 ## Divide A using distinct blocks and then reverse the operation
 A = [ 1:10
      11:20
      21:30
      31:40];
 B = im2col (A, [2 5], "distinct")
 C = col2im (B, [2 5], [4 10], "distinct")
***** test
 a = rand (10);
 assert (im2col (a, [5 5]), im2col (a, [5 5], "sliding"))
***** test
 a = rand (10);
 assert (im2col (a, [5 5]), im2col (a, "indexed", [5 5]))
***** error <BLOCK_TYPE> im2col (rand (20), [2 5], 10)
***** error <BLOCK_TYPE> im2col (rand (20), [2 5], "wrong_block_type")
***** error im2col (rand (10), [5 5], "sliding", 5)
***** error im2col (rand (10), "indexed", [5 5], "sliding", 5)
***** shared B, A, Bs, As, Ap, Bp0, Bp1, Bp0_3s
 v   = [1:10]';
 r   = reshape (v, 2, 5);
 B   = [v v+20  v+40 v+10  v+30 v+50];
 A   = [r r+10; r+20 r+30; r+40 r+50];
 As  = [ 1  2  3  4  5
         6  7  8  9 10
        11 12 13 14 15];
 b1  = As(1:2, 1:4)(:);
 b2  = As(2:3, 1:4)(:);
 b3  = As(1:2, 2:5)(:);
 b4  = As(2:3, 2:5)(:);
 Bs  = [b1, b2, b3, b4];
 Ap  = A(:, 1:9);
 Bp1 = Bp0 = B;
 Bp0(9:10, 4:6) = 0;
 Bp1(9:10, 4:6) = 1;
 Bp0_3s = Bp0;
 Bp0_3s(11:30, :) = 0;
***** assert (im2col (A, [2 5], "distinct"), B);
***** assert (im2col (Ap, [2 5], "distinct"), Bp0);
***** assert (im2col (Ap, [2 5 3], "distinct"), Bp0_3s);
***** assert (im2col (Ap, "indexed", [2 5], "distinct"), Bp1);
***** assert (im2col (uint8  (Ap), "indexed", [2 5], "distinct"), uint8  (Bp0));
***** assert (im2col (uint16 (Ap), "indexed", [2 5], "distinct"), uint16 (Bp0));
***** assert (im2col (int16  (Ap), "indexed", [2 5], "distinct"), int16  (Bp1));
***** assert (im2col (uint32 (Ap), "indexed", [2 5], "distinct"), uint32 (Bp1));
***** assert (im2col (uint8   (A),  [2 5], "distinct"), uint8   (B));
***** assert (im2col (single  (A),  [2 5], "distinct"), single  (B));
***** assert (im2col (logical (A),  [2 5], "distinct"), logical (B));
***** assert (im2col (uint8   (As), [2 4], "sliding"),  uint8   (Bs));
***** assert (im2col (single  (As), [2 4], "sliding"),  single  (Bs));
***** assert (im2col (logical (As), [2 4], "sliding"),  logical (Bs));
***** assert (im2col (As, [2 4], "sliding"), Bs);
***** assert (im2col (As, [3 5], "sliding"), As(:));
***** test
 A = randi (9, 10, 9, 5);
***** assert (convn (A, ones (3, 3, 3), "valid"),
        reshape (sum (im2col (A, [3 3 3])), [8 7 3]));

 A = randi (9, 10, 9, 5, 7);
***** assert (convn (A, ones (3, 3, 3), "valid"),
        reshape (sum (im2col (A, [3 3 3])), [8 7 3 7]));
***** assert (convn (A, ones (3, 4, 3), "valid"),
        reshape (sum (im2col (A, [3 4 3])), [8 6 3 7]));
***** assert (convn (A, ones (3, 5, 3, 2), "valid"),
        reshape (sum (im2col (A, [3 5 3 2])), [8 5 3 6]));
***** assert (im2col (1:8, [2 1]), zeros (2, 0))
28 tests, 28 passed, 0 known failure, 0 skipped
[isgray]
>>>>> /usr/share/octave/packages/image-2.6.1/isgray.m
***** assert (isgray ([0 0 1; 1 0 1]), true)
***** assert (isgray (zeros (3)), true)
***** assert (isgray (ones (3)), true)
***** test
 a = rand (10);
 assert (isgray (a), true);
 a(5, 5) = 2;
 assert (isgray (a), false);
***** test
 a = uint8 (randi (255, 10));
 assert (isgray (a), true);
 a = int8 (a);
 assert (isgray (a), false);
***** test
 a = rand (10);
 a(50) = NaN;
 assert (isgray (a), true);
***** assert (isgray (rand (5, 5, 1, 4)), true);
***** assert (isgray (rand (5, 5, 3, 4)), false);
***** assert (isgray (rand (5, 5, 3)), false);
***** assert (isgray (rand (5, 5, 1, 3, 4)), false);
***** assert (isgray (rand (5, "single")), true)
***** assert (isgray ([.1 .2 .3; .4 NaN .6; .7 .8 .9]), true)
***** assert (isgray ([.1 .2 .3; NA NaN .6; .7 .8 .9]), true)
***** assert (isgray ([.1 .2 .3; NA  .5 .6; .7 .8 .9]), true)
***** assert (isgray (NaN (5)), false)
***** assert (isgray (NA (5)), false)
16 tests, 16 passed, 0 known failure, 0 skipped
[imadjust]
>>>>> /usr/share/octave/packages/image-2.6.1/imadjust.m
***** error <must be an image or a colormap> imadjust ("bad argument");
***** error <numeric floating-point arrays> imadjust ([1:100], "bad argument", [], 1);
***** error <2 row column per plane> imadjust ([1:100], [0 1 1], [], 1);
***** error <2 row column per plane> imadjust ([1:100], [], [0 1 1], 1);
***** error <scalar or 1 row per plane> imadjust ([1:100], [], [], [0; 1]);
***** error <scalar or 1 row per plane> imadjust (rand (5, 5, 3), [], [], [0 1]);
***** error <non-negative floating point> imadjust ([1:100], [0; 1], [], -1);
***** error <be on the range \[0 1]> imadjust ([1:100], [0; 5], []);
***** error <be on the range \[0 1]> imadjust ([1:100], [-2; 1], []);
***** error <be on the range \[0 1]> imadjust ([1:100], [], [0; 4]);
***** error <be on the range \[0 1]> imadjust ([1:100], [], [-2; 1]);
***** error <must be numeric> imadjust (rand (5) > .5);
***** test
 im = [0.01:0.01:1];
 assert (imadjust (im), [0 linspace(0, 1, 98) 1], eps)
 assert (imadjust (im), imadjust (im, stretchlim (im, 0.01), [0; 1], 1))
 assert (imadjust (im, []), imadjust (im, [0; 1], [0; 1], 1))
 assert (imadjust (im, [], []), imadjust (im, [0; 1], [0; 1], 1))
 assert (imadjust (im, [], [.25 .75]), imadjust (im, [0; 1], [.25; .75], 1))
 assert (imadjust (im, [.25; .75], []), imadjust (im, [.25; .75], [0; 1], 1))
***** assert (imadjust (linspace (0, 1), [], [.25 .75]), linspace (.25, .75, 100))
***** assert (imadjust (linspace (0, 1, 100),[1/99; 98/99]),
        [0 linspace(0, 1, 98) 1], eps)
***** shared cm
 cm = [[0:8]' [1:9]' [2:10]'] / 10;
***** assert (imadjust (cm, [0; 1], [0.5; 1]), (cm /2) + .5)
***** assert (imadjust (cm, [0 1], [0.5 1]), (cm /2) + .5)
***** assert (imadjust (cm, [0; 1], [.1 .2 .3; .7 .8 .9]),
        (cm*.6) .+ [.1 .2 .3], eps)
***** assert (imadjust (cm, [.2 .4 .6; .7 .8 .9], [0; 1]),
       [[0 0 linspace(0, 1, 6) 1]' ...
        [0 0 0 linspace(0, 1, 5) 1]' ...
        [0 0 0 0 linspace(0, 1, 4) 1]'], eps)
***** assert (imadjust (cm, [.2 .4 .6; .7 .8 .9], [0 .1 .2; .8 .9 1]),
        [[0 0 linspace(0, .8, 6) .8]' ...
         [.1 .1 .1 linspace(.1, .9, 5) .9]' ...
         [.2 .2 .2 .2 linspace(.2, 1, 4) 1]'], eps)
***** assert (imadjust (cm, [.2 .4 .6; .7 .8 .9], [0 .1 .2; .8 .9 1], [0.5 1 2]),
        [[0 0 0 (((([.3 .4 .5 .6]-.2)/.5).^.5)*.8) .8 .8]' ...
         [.1 .1 .1 linspace(.1, .9, 5) .9]' ...
         [.2 .2 .2 .2 .2  ((((([.7 .8]-.6)/.3).^2).*.8)+.2) 1 1]'], eps*10)
***** test
 im = [-0.4:.1:0.8
        0.0:.1:1.2
        0.1:.1:1.3
       -0.4:.2:2.0];

 ## just clipping
 assert (imadjust (im, [0; 1], [0; 1]),
         [0 0 0 0 (0:.1:.8)
          (0:.1:1) 1 1
          (.1:.1:1) 1 1 1
          0 0 (0:.2:1) 1 1 1 1 1], eps)

 ## clipping and invert
 assert (imadjust (im, [0; 1], [1; 0]),
         [1 1 1 1 (1:-.1:.2)
          (1:-.1:0) 0 0
          (.9:-.1:0) 0 0 0
          1 1 (1:-.2:0) 0 0 0 0 0], eps)

 ## rescale
 assert (imadjust (im, [.2; .7], [.1; .9]),
         [1 1 1 1 1 1 1 2.6 4.2 5.8 7.4 9 9
          1 1 1 2.6 4.2 5.8 7.4 9 9 9 9 9 9
          1 1 2.6 4.2 5.8 7.4 9 9 9 9 9 9 9
          1 1 1 1 4.2 7.4 9 9 9 9 9 9 9]/10, eps)

 ## rescale and invert
 assert (imadjust (im, [.2; .7], [.9; .1]),
         [9 9 9 9 9 9 9 7.4 5.8 4.2 2.6 1 1
          9 9 9 7.4 5.8 4.2 2.6 1 1 1 1 1 1
          9 9 7.4 5.8 4.2 2.6 1 1 1 1 1 1 1
          9 9 9 9 5.8 2.6 1 1 1 1 1 1 1]/10, eps)
***** assert (imadjust (linspace (0, 1), [], [], 2), linspace (0, 1) .^ 2)
***** shared oRGB
 oRGB = zeros (10, 1, 3);
 oRGB(:,:,1) = [0 linspace(0,1,6) 1 1 1]';
 oRGB(:,:,2) = [0 0 linspace(0,1,6) 1 1]';
 oRGB(:,:,3) = [0 0 0 linspace(0,1,6) 1]';
***** assert (imadjust (oRGB, [0; 1], [0; 1]), oRGB)
***** assert (imadjust (oRGB, [.2; .8], [0; 1]),
        reshape ([[0 0 0 1/3 2/3 1 1 1 1 1]'
                  [0 0 0 0 1/3 2/3 1 1 1 1]'
                  [0 0 0 0 0 1/3 2/3 1 1 1]'], [10 1 3]), eps)
***** assert (imadjust (oRGB, [.2; .8], [.1; .9]),
        reshape ([[.1 .1 .1 (1/3)+(.1/3) (2/3)-(.1/3) .9 .9 .9 .9 .9]'
                  [.1 .1 .1 .1 (1/3)+(.1/3) (2/3)-(.1/3) .9 .9 .9 .9]'
                  [.1 .1 .1 .1 .1 (1/3)+(.1/3) (2/3)-(.1/3) .9 .9 .9]'],
                 [10 1 3]), eps)
***** assert (imadjust (oRGB, [.2; .8], [.2; .8]),
        reshape ([[2 2 2 4 6 8 8 8 8 8]'
                  [2 2 2 2 4 6 8 8 8 8]'
                  [2 2 2 2 2 4 6 8 8 8]']/10, [10 1 3]), eps)
***** assert (imadjust (oRGB, [0; 1], [.1 .2 .3; .9 .8 .7]),
        reshape ([[1 1 2.6 4.2 5.8 7.4 9 9 9 9]'
                  [2 2 2 3.2 4.4 5.6 6.8 8 8 8]'
                  [3 3 3 3 3.8 4.6 5.4 6.2 7 7]']/10, [10 1 3]), eps)
***** assert (imadjust (oRGB, [.1 .2 .3; .9 .8 .7], [0; 1]),
        reshape ([[0 0 .125 .375 .625 .875 1 1 1 1]'
                  [0 0 0 0 1/3 2/3 1 1 1 1]'
                  [0 0 0 0 0 .25 .75 1 1 1]'], [10 1 3]), eps*10)
***** assert (imadjust (oRGB, [.1 .2 .3; .9 .8 .7], [.2 0 .4; .5 1 .7 ]),
        reshape ([[.2 .2 .2375 .3125 .3875 .4625 .5 .5 .5 .5]'
                  [0 0 0 0 1/3 2/3 1 1 1 1]'
                  [.4 .4 .4 .4 .4 .475 .625 .7 .7 .7]'], [10 1 3]), eps)
***** test
 img = rand (4, 4, 2, 3, 4);
 adj = zeros (4, 4, 2, 3, 4);
 for p = 1:2
   for q = 1:3
     for r = 1:4
       adj(:,:,p,q,r) = imadjust (img(:,:,p,q,r));
     endfor
   endfor
 endfor
 assert (imadjust (img), adj)
***** test
 img = rand (4, 4, 2, 3, 2);
 adj = zeros (4, 4, 2, 3, 2);
 in  = reshape ([ 3  5  7  9 11 13 15 17 19 21 23 25;
                 97 95 93 91 89 87 85 83 81 79 77 75] / 100, [2 2 3 2]);
 out = reshape ([ 5  7  9 11 14 15 17 19 21 23 25 27;
                 95 93 91 89 87 85 83 81 79 77 75 73] / 100, [2 2 3 2]);
 gamma = reshape (0.6:.1:1.7, [1 2 3 2]);
 for p = 1:2
   for q = 1:3
     for r = 1:2
       adj(:,:,p,q,r) = imadjust (img(:,:,p,q,r), in(:,p,q,r),
                                  out(:,p,q,r), gamma(1,p,q,r));
     endfor
   endfor
 endfor
 assert (imadjust (img, in, out, gamma), adj)
***** test
 in = int16 (1:6);
 assert (imadjust (in), int16 ([-32768 -19661  -6554   6553  19660  32767]))
 assert (imadjust (in, []), in)
***** test
 in = uint8([
  35   1   6  26  19  24
   3  32   7  21  23  25
  31   9   2  22  27  20
   8  28  33  17  10  15
  30   5  34  12  14  16
   4  36  29  13  18  11]);
 out = uint8([
  12   0   0   1   0   0
   0   8   0   0   0   0
   7   0   0   0   2   0
   0   3   9   0   0   0
   6   0  11   0   0   0
   0  13   4   0   0   0]);
 assert (imadjust (in, [.1 .9], [0 1]), out);
***** test
 in = uint8([
  140    4   24  104   76   96
   12  128   28   84   92  100
  124   36    8   88  108   80
   32  112  132   68   40   60
  120   20  136   48   56   64
   16  144  116   52   72   44]);
 out = uint8([
  143    0    0   98   63   88
    0  128    3   73   83   93
  123   13    0   78  103   68
    8  108  133   53   18   43
  118    0  138   28   38   48
    0  148  113   33   58   23]);
 assert (imadjust (in, [.1 .9], [0 1]), out);
***** test
 in_u8 = randi ([0 255], 5, 5, 2, 3, "uint8");
 in_u16 = randi ([0 65535], 5, 5, 2, 3, "uint16");
 in_i16 = randi ([-32768 32767], 5, 5, 2, 3, "int16");
 in_u8_d = im2double (in_u8);
 in_u16_d = im2double (in_u16);
 in_i16_d = im2double (in_i16);

 ## default values
 assert (imadjust (in_u8), im2uint8 (imadjust (in_u8_d)))
 assert (imadjust (in_u16), im2uint16 (imadjust (in_u16_d)))
 assert (imadjust (in_i16), im2int16 (imadjust (in_i16_d)))

 ## single adjustment for all planes
 args = {[.3; .7], [.1; .9], [1.5]};
 assert (imadjust (in_u8, args{:}), im2uint8 (imadjust (in_u8_d, args{:})))
 assert (imadjust (in_u16, args{:}), im2uint16 (imadjust (in_u16_d, args{:})))
 assert (imadjust (in_i16, args{:}), im2int16 (imadjust (in_i16_d, args{:})))

 ## single adjustment for all planes (mixed with some complement)
 args = {reshape([.2 .3 .25 .1 0 .1; .9 .7 .85 .9 1 .8], [2 2 3]),
         reshape([.1 .2 .05 .9 1 .3; .9 .85 .7 .1 0 .9], [2 2 3]),
         reshape([1 .75 1 1.2 1.5 2], [1 2 3])};
 assert (imadjust (in_u8, args{:}), im2uint8 (imadjust (in_u8_d, args{:})))
 assert (imadjust (in_u16, args{:}), im2uint16 (imadjust (in_u16_d, args{:})))
 assert (imadjust (in_i16, args{:}), im2int16 (imadjust (in_i16_d, args{:})))

 ## test use of [] as limit and negative
 args = {[], [.95; 0], 1.25};
 assert (imadjust (in_u8, args{:}), im2uint8 (imadjust (in_u8_d, args{:})))
 assert (imadjust (in_u16, args{:}), im2uint16 (imadjust (in_u16_d, args{:})))
 assert (imadjust (in_i16, args{:}), im2int16 (imadjust (in_i16_d, args{:})))
36 tests, 36 passed, 0 known failure, 0 skipped
[immultiply]
>>>>> /usr/share/octave/packages/image-2.6.1/immultiply.m
***** assert (immultiply (uint8   ([255 50]), uint16  ([300 50])),           uint8  ([255 255]));  # default to first class and truncate
***** assert (immultiply (uint8   ([250 50]), uint16  ([  3  4]), "uint32"), uint32 ([750 200]));  # defining output class works (not in matlab?)
***** assert (immultiply (uint8   ([255 50]),                  4),           uint8  ([255 200]));  # works multiplying by a scalar
***** assert (immultiply (logical ([  1  0]), uint16  ([300 50])),           uint16 ([300   0]));  # output class defaults to whatever input is not logical
***** assert (immultiply (logical ([  1  0]), logical ([  1  1])),           double ([  1   0]));  # tested on matlab for compatibility
5 tests, 5 passed, 0 known failure, 0 skipped
[imdivide]
>>>>> /usr/share/octave/packages/image-2.6.1/imdivide.m
***** assert (imdivide (uint8   ([23 250]), uint8   ([ 2  50])),            uint8   ([ 12   5])); # default to first class
***** assert (imdivide (uint8   ([56 255]), uint8   ([ 0   0])),            uint8   ([255 255])); # dividing by zero works (tested in matlab)
***** assert (imdivide (uint8   ([23 250]), 2),                             uint8   ([ 12 125])); # works subtracting a scalar
***** assert (imdivide (uint8   ([23 250]), uint8   ([ 2  50]), "uint16"),  uint16  ([ 12   5])); # defining output class works (not in matlab)
***** assert (imdivide (logical ([1 1 0 0]), logical ([1 0 1 0])),          double  ([1 Inf 0 NaN])); # dividing logical matrix  (tested in matlab)
***** fail  ("imdivide (uint8   ([23 250]), uint16  ([23 250]))");                                # input needs to have same class
6 tests, 6 passed, 0 known failure, 0 skipped
[psf2otf]
>>>>> /usr/share/octave/packages/image-2.6.1/psf2otf.m
***** test
 psf = rand (6, 1);
 assert (psf2otf (psf), fft (circshift (psf, [-3])));
***** test
 psf = rand (6, 6);
 assert (psf2otf (psf), fft2 (circshift (psf, [-3 -3])));
***** test
 psf = rand (6, 6, 6);
 assert (psf2otf (psf), fftn (circshift (psf, [-3 -3 -3])));
***** test
 psf = rand (7, 1);
 assert (psf2otf (psf), fft (circshift (psf, [-3])));
***** test
 psf = rand (7, 7);
 assert (psf2otf (psf), fft2 (circshift (psf, [-3 -3])));
***** test
 psf = rand (6, 7, 8);
 assert (psf2otf (psf), fftn (circshift (psf, [-3 -3 -4])));
***** test
 psf = rand (6, 1);
 ppsf = [psf; 0];
 assert (psf2otf (psf, 7), fft (circshift (ppsf, [-3])));
***** test
 psf = rand (6, 1);
 ppsf = [[psf; 0] zeros(7, 6)];
 assert (psf2otf (psf, [7 7]), fft2 (circshift (ppsf, [-3 0])));
***** test
 psf = rand (6, 6);
 ppsf = [psf zeros(6, 1)];
 assert (psf2otf (psf, [6 7]), fft2 (circshift (ppsf, [-3 -3])));
***** error <PSF must be numeric and real> psf2otf (complex (rand (16), rand (16)))
***** error <OUTSIZE must be larger than> psf2otf (rand (16), 14)
***** error <OUTSIZE must be larger than> psf2otf (rand (16), [14 14])
***** error <OUTSIZE must be larger than> psf2otf (rand (16), [18])
***** error <OUTSIZE must be larger than> psf2otf (rand (16), [18 14])
14 tests, 14 passed, 0 known failure, 0 skipped
[imsmooth]
>>>>> /usr/share/octave/packages/image-2.6.1/imsmooth.m
***** test
 ## checking Bilateral Filter

 ##  constant image remain the same after Bilateral Filter
 A = uint8(255*ones(128,128));
 B = uint8(imsmooth(A, 'Bilateral', 2, 10));
 assert (A,B);

 ## Bilateral Filter does not smear outlayers
 A = zeros(256,256);
 A(128,128) = 256;
 ## bilateral filter does not smear outlayers
 B = imsmooth(A, 'Bilateral', 2, 10);
 assert (A,B,1.e-140);

 ## When sigma_r is large the filter behaves almost
 ## like the isotropic Gaussian filter

 A0 = fspecial ('gaussian',100,100);
 A = uint8(A0/max(max(A0))*255);
 B1 = imsmooth(A, 'Bilateral', 2, 100);
 B2 = imsmooth(A, 'Gaussian', 2);
 assert (B1,B2);
1 test, 1 passed, 0 known failure, 0 skipped
[normxcorr2]
>>>>> /usr/share/octave/packages/image-2.6.1/normxcorr2.m
***** function offsets = get_max_offsets (c)
  l = find (c == max (c(:)));
  offsets = nthargout (1:ndims (c), @ind2sub, size (c), l);
***** endfunction
***** test
 row_shift = 18;
 col_shift = 20;
 a = randi (255, 30, 30);
 b = a(row_shift-10:row_shift, col_shift-7:col_shift);
 c = normxcorr2 (b, a);
 ## should return exact coordinates
 assert (get_max_offsets (c), {row_shift col_shift});

 ## Even with some small noise, should return exact coordinates
 b = imnoise (b, "gaussian");
 c = normxcorr2 (b, a);
 assert (get_max_offsets (c), {row_shift col_shift});
***** test
 a = rand (10, 10);
 c = normxcorr2 (a(5:7, 6:9), a);
 assert (c(7, 9), 1, eps*2);
!!!!! test failed
ASSERT errors for:  assert (c (7, 9),1,eps * 2)

  Location  |  Observed  |  Expected  |  Reason
     ()           1            1         Abs err 7.7716e-16 exceeds tol 4.4409e-16
***** test
 a = 10 * randn (100, 100);
 auto = normxcorr2 (a, a);
 add_in = normxcorr2 (a, -a);
 assert (auto, -add_in);
***** test
 a = 10 * randn (50, 50);
 b = 10 * randn (100, 100);
 do
   scale = 100 * rand ();
 until (scale != 0)

 assert (max ((normxcorr2 (scale*a,b) .- normxcorr2 (a,b))(:)), 0, 1e-10);
 assert (max ((normxcorr2 (a,scale*b) .- normxcorr2 (a,b))(:)), 0, 1e-10);

 a_shift1 = a .+ scale * ones (size (a));
 b_shift1 = b .+ scale * ones (size (b));
 a_shift2 = a .- scale * ones (size (a));
 b_shift2 = b .- scale * ones (size (b));
 assert (max ((normxcorr2 (a_shift1,b) .- normxcorr2 (a,b))(:)), 0, 1e-10);
 assert (max ((normxcorr2 (a,b_shift1) .- normxcorr2 (a,b))(:)), 0, 1e-10);
 assert (max ((normxcorr2 (a_shift2,b) .- normxcorr2 (a,b))(:)), 0, 1e-10);
 assert (max ((normxcorr2 (a,b_shift2) .- normxcorr2 (a,b))(:)), 0, 1e-10);
***** test
 a = randi (100, 15, 15, 15);
 c = normxcorr2 (a(5:10, 2:6, 3:7), a);
 assert (get_max_offsets (c), {10 6 7});

 a = randi (100, 15, 15, 15);
 c = normxcorr2 (a(5:10, 2:6, 1:1), a);
 assert (get_max_offsets (c), {10 6 1});
***** warning <swapped> normxcorr2 (rand (20), rand (5));
***** error normxcorr2 (rand (5));
***** error normxcorr2 (rand (5), rand (20), 2);
***** test
 a =  [ 252  168   50    1   59;
        114    0    0    0    0] ./ 255;
 b = [    1  171  255  255  255  255  240   71  131  254  255  255  255;
          0  109  254  255  255  233   59    0  131  254  255  255  255;
         76   13  195  253  194   34    0   19  217  255  255  255  255;
        110    0    0    0    0    0    3  181  255  255  255  255  255;
        153    0    0    0    0    2  154  254  255  255  255  255  255]./255;
  c = normxcorr2 (a, b);
 assert (max (imag (c(:))), 0);
9 tests, 8 passed, 0 known failure, 0 skipped
[qtsetblk]
>>>>> /usr/share/octave/packages/image-2.6.1/qtsetblk.m
***** demo
 J=qtsetblk(eye(4),qtdecomp(eye(4)),2,ones(2,2,2))
 % Sets upper-right and lower-left blocks of 2*2 zeros to ones
***** shared A, S
 A=[ 1, 4, 2, 5,54,55,61,62;
     3, 6, 3, 1,58,53,67,65;
     3, 6, 3, 1,58,53,67,65;
     3, 6, 3, 1,58,53,67,65;
    23,42,42,42,99,99,99,99;
    27,42,42,42,99,99,99,99;
    23,22,26,25,99,99,99,99;
    22,22,24,22,99,99,99,99];
 S = qtdecomp (A, 10);
***** test
 R=A;
 vals=zeros(4,4,2);
 vals(:,:,1)=reshape([1:16],4,4);
 vals(:,:,2)=reshape([21:36],4,4);
 R(1:4,1:4)=reshape([1:16],4,4);
 R(5:8,5:8)=reshape([21:36],4,4);
 assert(qtsetblk(A,S,4,vals),R);
***** test
 R=A;
 R(1:4,5:8)=1;
 R(7:8,1:4)=1;
 R(5:6,3:4)=1;
 assert(qtsetblk(A,S,2,ones(2,2,7)),R);
***** test
 R=A;
 R(5:6,1:2)=10;
 assert(qtsetblk(A,S,1,ones(1,1,4)*10),R);
3 tests, 3 passed, 0 known failure, 0 skipped
[impixel]
>>>>> /usr/share/octave/packages/image-2.6.1/impixel.m
***** shared img2d, img3d
 img2d = uint8 (magic (10));
 img3d(:,:,1) = img2d;
 img3d(:,:,2) = img2d + 1;
 img3d(:,:,3) = img2d + 2;
 img3d = uint8 (img3d);

***** assert (impixel (img2d, 2, 2), single ([80 80 80]));
***** assert (impixel (img2d, -2, 2), single ([NA NA NA]));

***** assert (impixel (img2d, [1 10], [1 10]), single ([92 92 92; 59 59 59]));
***** assert (impixel (img3d, [1 10], [1 10]), single ([92 93 94; 59 60 61]));
***** assert (impixel (double (img2d), [1 10], [1 10]), [92 92 92; 59 59 59]);

***** assert (impixel ([1 10], [1 10], img2d, [1 10], [1 10]), single ([92 92 92; 59 59 59]));
***** assert (impixel ([3 12], [-4 12], img2d, [1 10], [1 10]), single ([NA NA NA; 44 44 44]));
***** assert (impixel ([3 5], [-4 3], img2d, [1 10], [1 10]), single ([NA NA NA; NA NA NA]));

 ## the following returns double because it's an indexed image
***** assert (impixel ([3 12], [-4 12], img2d, gray (100), [1 10], [1 10]), [NA NA NA; 4/9 4/9 4/9]);
9 tests, 9 passed, 0 known failure, 0 skipped
[edgetaper]
>>>>> /usr/share/octave/packages/image-2.6.1/edgetaper.m
***** assert (class (edgetaper (rand (100), rand (16))), "double")
***** assert (class (edgetaper (randi (255, 100, "uint8"), rand (16))), "uint8")
2 tests, 2 passed, 0 known failure, 0 skipped
[colfilt]
>>>>> /usr/share/octave/packages/image-2.6.1/colfilt.m
***** demo
 ## Perform moving average filter with a 4x4 window
 A = magic (12)
 colfilt (A, [4 4], "sliding", @mean)
***** test
 A = reshape (1:36, [6 6]);
 assert (colfilt (A, [2 2], [3 3], "sliding", @sum),
         conv2 (A, ones (2), "same"));
1 test, 1 passed, 0 known failure, 0 skipped
[ycbcr2rgb]
>>>>> /usr/share/octave/packages/image-2.6.1/ycbcr2rgb.m
***** assert (ycbcr2rgb (rgb2ycbcr (jet (10))), jet (10), 0.00001);
1 test, 1 passed, 0 known failure, 0 skipped
[fftconv2]
>>>>> /usr/share/octave/packages/image-2.6.1/fftconv2.m
***** test
 a = repmat (1:10, 5);
 b = repmat (10:-1:3, 7);
 assert (fftconv2 (a, b), conv2 (a, b), 1.3e4*eps)
 assert (fftconv2 (b, a), conv2 (b, a), 1.3e4*eps)
 assert (fftconv2 (a, b, "full"), conv2 (a, b, "full"), 1.3e4*eps)
 assert (fftconv2 (b, a, "full"), conv2 (b, a, "full"), 1.3e4*eps)
 assert (fftconv2 (a, b, "same"), conv2 (a, b, "same"), 1e4*eps)
 assert (fftconv2 (b, a, "same"), conv2 (b, a, "same"), 1e4*eps)
 assert (isempty (fftconv2 (a, b, "valid")));
 assert (fftconv2 (b, a, "valid"),  conv2 (b, a, "valid"), 1e4*eps)
***** test
 x = 1:4;
 y = 4:-1:1;
 a = repmat(1:10, 5);
 assert (fftconv2 (x, y, a),          conv2 (x, y, a),          1e4*eps)
 assert (fftconv2 (x, y, a, "full"),  conv2 (x, y, a, "full"),  1e4*eps)
 assert (fftconv2 (x, y, a, "same"),  conv2 (x, y, a, "same"),  1e4*eps)
 assert (fftconv2 (x, y, a, "valid"), conv2 (x, y, a, "valid"), 1e4*eps)
***** demo
 ## Draw a cross
 z = zeros (101, 101);
 z(50, :) = 1;
 z(:, 50) = 1;
 subplot (1, 3, 1)
 imshow (z);
 title ("Original thin cross")

 ## Draw a sinc blob
 b = getheight (strel ("ball", 10, 1));
 subplot (1, 3, 2)
 imshow (b);
 title ("Sync blob")

 ## Convolve the cross with the blob
 fc = real (fftconv2 (z, b, "same"));
 subplot (1, 3, 3)
 imshow (fc, [min(fc(:)) max(fc(:))])
 title ("Convolution in the frequency domain")
2 tests, 2 passed, 0 known failure, 0 skipped
[imcrop]
>>>>> /usr/share/octave/packages/image-2.6.1/imcrop.m
***** test
 a = randi (255, [100 100]);
 rect = [20 30 3 5];
 assert (nthargout ([1 2], @imcrop, a, rect), {a(30:35, 20:23) rect});
 assert (nthargout (2, @imcrop, a, rect), rect);
 assert (nthargout ([3 4], 4, @imcrop, a, rect), {a(30:35, 20:23) rect});
***** test
 rgb = randi (255, [100 100 3]);
 rect = [20 30 3 5];
 assert (nthargout ([1 2], @imcrop, rgb, rect), {rgb(30:35, 20:23,:) rect});
 assert (nthargout (2, @imcrop, rgb, rect), rect);
 assert (nthargout ([3 4], 4, @imcrop, rgb, rect), {rgb(30:35, 20:23,:) rect});
***** test
 a = randi (255, [100 100]);
 rect = [20 30 3 5];
 cmap = jet (255);
 assert (nthargout ([1 2], @imcrop, a, cmap, rect), {a(30:35, 20:23) rect});
 assert (nthargout (2, @imcrop, a, cmap, rect), rect);
 assert (nthargout ([3 4], 4, @imcrop, a, cmap, rect), {a(30:35, 20:23) rect});
***** test
 a = rand (100) > 0.5;
 rect = [20 30 3 5];
 assert (nthargout ([1 2], @imcrop, a, rect), {a(30:35, 20:23) rect});
 assert (nthargout (2, @imcrop, a, rect), rect);
 assert (nthargout ([3 4], 4, @imcrop, a, rect), {a(30:35, 20:23) rect});
***** assert (imcrop (0, [0.5 0.5 0.9 0.9]), 0);
***** assert (imcrop (zeros (5), [1 1 1 1]), zeros (2));
6 tests, 6 passed, 0 known failure, 0 skipped
[qtdecomp]
>>>>> /usr/share/octave/packages/image-2.6.1/qtdecomp.m
***** demo
 full(qtdecomp(eye(8)))
 %It finds 2 big blocks of 0 and it decomposes further where 0 and 1 are mixed.
***** # Test if odd-sized limits split
***** assert(full(qtdecomp(eye(5))), reshape([5,zeros(1,24)],5,5));
***** assert(full(qtdecomp(eye(6))), repmat(reshape([3,zeros(1,8)],3,3),2,2));
***** # Test 'equal' method
***** test
 a=ones(2,2);
 b=[2,0;0,0];
 assert(full(qtdecomp(eye(4))), [a,b;b,a]);
***** shared A, B2, B4, f
 A=[ 1, 4, 2, 5,54,55,61,62;
     3, 6, 3, 1,58,53,67,65;
     3, 6, 3, 1,58,53,67,65;
     3, 6, 3, 1,58,53,67,65;
    23,42,42,42,99,99,99,99;
    27,42,42,42,99,99,99,99;
    23,22,26,25,99,99,99,99;
    22,22,24,22,99,99,99,99];
 B2=[2,0;0,0];
 B4=zeros(4); B4(1,1)=4;
***** test
 R=[ones(4,8); [ones(2),B2;ones(2,4)], B4];
 assert(full(qtdecomp(A)), R);
 assert(full(qtdecomp(A,0)), R);
***** # Test 'threshold' method
***** test
 R=[ones(4,8); [ones(2),B2;B2,ones(2)],B4];
 assert(full(qtdecomp(A,1)), R);
***** test
 R=[[B4,[B2,B2;B2,B2]]; [[ones(2),B2;B2,B2],B4]];
 assert(full(qtdecomp(A,10)), R);
***** test
 R=[[B4,[B2,B2;B2,B2]]; [[B2,B2;B2,B2],B4]];
 assert(full(qtdecomp(A,10,2)), R);

 assert(full(qtdecomp(A,100,[2, 4])), [B4,B4;B4,B4]);
***** test
 f = @(A, c1 = 54, c2 = 0, c3 = 0) y = (A (1, 1, :) != ((c1+c2+c3) * ones (1, 1, size (A, 3))))(:);

 assert(full(qtdecomp(A,f)),[ones(4),B4;ones(4,8)]); 
 assert(full(qtdecomp(A,f,54)),[ones(4),B4;ones(4,8)]);
 assert(full(qtdecomp(A,f,4,40,10)),[ones(4),B4;ones(4,8)]);
***** test
***** # no params
 first_eq=inline("(A(1,1,:)!=(54*ones(1,1,size(A,3))))(:)","A");
 assert(full(qtdecomp(A,first_eq)),[ones(4),B4;ones(4,8)]);
***** test
***** # 1 param
 first_eq=inline("(A(1,1,:)!=(c*ones(1,1,size(A,3))))(:)","A","c");
 assert(full(qtdecomp(A,first_eq,54)),[ones(4),B4;ones(4,8)]);
***** test
***** # 3 params
 first_eq=inline("(A(1,1,:)!=((c1+c2+c3)*ones(1,1,size(A,3))))(:)","A","c1","c2","c3");
 assert(full(qtdecomp(A,first_eq,4,40,10)),[ones(4),B4;ones(4,8)]);
11 tests, 11 passed, 0 known failure, 0 skipped
[imquantize]
>>>>> /usr/share/octave/packages/image-2.6.1/imquantize.m
***** error <LEVELS must be nondecreasing>
  imquantize (rand (5), [3 4 2 5])
***** error <VALUES must be a numeric vector>
  imquantize (rand (5), [1 2 3], "foo")
***** error <VALUES must have 1 element more than LEVELS>
  imquantize (rand (5), [1 2 3 4], 1:6)
***** error <VALUES must have 1 element more than LEVELS>
  imquantize (rand (5), [1 2 3 4], 1:2)
***** test
 img = [-inf 0 10000000; -100000 -3 1/1000000; 5 5 10];
 [q, q_idx] = imquantize (img, 5);
 assert (q, [1 1 2; 1 1 1; 1 1 2])
 assert (q_idx, q)
***** test
 img = [1:10; 11:20; 21:30; 31:40; 41:50; 51:60; 61:70];

 expected_q = [
     0    0    0    0    0    1    1    1    1    1
     1    1    1    1    1    5    5    5    5    5
     5    5    5    5    5   10   10   10   10   10
    20   20   20   20   20   20   20   20   20   20
    30   30   30   30   30   30   30   30   30   30
    30   30   30   30   30   30   30   30   30   30
    15   15   15   15   15   15   15   15   15   15];

 expected_q_idx = [
    1   1   1   1   1   2   2   2   2   2
    2   2   2   2   2   3   3   3   3   3
    3   3   3   3   3   4   4   4   4   4
    5   5   5   5   5   5   5   5   5   5
    6   6   6   6   6   6   6   6   6   6
    6   6   6   6   6   6   6   6   6   6
    7   7   7   7   7   7   7   7   7   7];

 [q, q_idx] = imquantize (img, [5 15 25 30 40 60], [0 1 5 10 20 30 15]);
 assert (q, expected_q)
 assert (q_idx, expected_q_idx)

 [q, q_idx] = imquantize (single (img), [5 15 25 30 40 60],
                          [0 1 5 10 20 30 15]);
 assert (q, expected_q)
 assert (q_idx, expected_q_idx)

 [q, q_idx] = imquantize (uint8 (img), [5 15 25 30 40 60],
                          [0 1 5 10 20 30 15]);
 assert (q, expected_q)
 assert (q_idx, expected_q_idx)

 [q, q_idx] = imquantize (uint8 (img), uint8 ([5 15 25 30 40 60]),
                          [0 1 5 10 20 30 15]);
 assert (q, expected_q)
 assert (q_idx, expected_q_idx)

 [q, q_idx] = imquantize (uint8 (img), uint8 ([5 15 25 30 40 60]),
                          uint8 ([0 1 5 10 20 30 15]));
 assert (q, uint8 (expected_q))
 assert (q_idx, expected_q_idx)
***** test
 img = randi ([0 255], 10, "uint8");
 [q, q_idx] = imquantize (img, [50 100 150 200]);
 assert (class (q), "double")
 assert (class (q_idx), "double")

 [q, q_idx] = imquantize (img, [50 100 150 200], uint16 ([5 7 8 9 2]));
 assert (class (q), "uint16")
 assert (class (q_idx), "double")

 [q, q_idx] = imquantize (img, [50 100 150 200], uint8 ([5 7 8 9 2]));
 assert (class (q), "uint8")
 assert (class (q_idx), "double")
***** test
 img = [1:10; 11:20; 21:30; 31:40; 41:50; 51:60; 61:70].';
 r_idx = reshape (randperm (numel (img)), size (img));

 [quant, quant_idx] = imquantize (img, [5 15 25 30 40 60]);
 [quant_r, quant_r_idx] = imquantize (img(r_idx), [5 15 25 30 40 60]);

 assert (imquantize (img(r_idx), [5 15 25 30 40 60]), quant(r_idx))
 assert (quant_r, quant_r_idx)
8 tests, 8 passed, 0 known failure, 0 skipped
[imsubtract]
>>>>> /usr/share/octave/packages/image-2.6.1/imsubtract.m
***** assert (imsubtract (uint8   ([23 250]), uint8   ([24  50])),            uint8   ([ 0 200])); # default to first class and truncate
***** assert (imsubtract (uint8   ([23 250]), 10),                            uint8   ([13 240])); # works subtracting a scalar
***** assert (imsubtract (uint8   ([23 250]), uint8   ([24  50]), "uint16"),  uint16  ([ 0 200])); # defining output class works (not in matlab)
***** assert (imsubtract (logical ([ 1   0]), logical ([ 1   1])),            double  ([ 0  -1])); # return double for two logical images
***** assert (imsubtract (logical ([ 1   0]), logical ([ 1   1]), "logical"), logical ([ 0   0])); # this is matlab incompatible on purpose
***** error <same class> imsubtract (uint8 ([23 250]), uint16 ([23 250]));
***** warning <signed integer> imsubtract (uint8 ([23 250]), uint8 ([24 255]), "int8");
***** test
 warning ("off", "all");
 assert (imsubtract (uint8 ([23 250]), uint8 ([24 255]), "int8"),
         int8 ([-1 0]))
8 tests, 8 passed, 0 known failure, 0 skipped
[imattributes]
>>>>> /usr/share/octave/packages/image-2.6.1/imattributes.m
***** shared x, map, img, rgb, bw
 [x, map] = imread ("default.img");
 rgb = ind2rgb (x, map);
 img = ind2gray (x, map);
 bw = im2bw (img);
***** test
 h = imshow (img);
 a = imattributes (h);
 assert ([a.("Height (rows)") a.("Width (columns)")], [53 40]);
 assert (a.Class, "uint8");
 assert (a.("Image type"), "intensity");
 assert (a.("Minimum intensity"), uint8 (28));
 assert (a.("Maximum intensity"), uint8 (250));
***** xtest
 h = imshow (rgb);
 a = imattributes (h);
 assert ([a.("Height (rows)") a.("Width (columns)")], [53 40]);
 assert (a.Class, "uint8");
 assert (a.("Image type"), "truecolor");
 assert (isfield (a, "Minimum intensity"), false);
 assert (isfield (a, "Maximum intensity"), false);
!!!!! known failure
ASSERT errors for:  assert (a.Class,"uint8")

  Location  |  Observed  |  Expected  |  Reason
     []         double       uint8       Strings don't match
***** test
 h = imshow (bw);
 a = imattributes (h);
 assert ([a.("Height (rows)") a.("Width (columns)")], [53 40]);
 assert (a.Class, "logical");
 assert (a.("Image type"), "binary");
 assert (isfield (a, "Minimum intensity"), false);
 assert (isfield (a, "Maximum intensity"), false);
***** test
 h = imshow (x, map);
 a = imattributes (h);
 assert ([a.("Height (rows)") a.("Width (columns)")], [53 40]);
 assert (a.Class, "uint8");
 assert (a.("Image type"), "indexed");
 assert (a.("Minimum intensity"), uint8 (0));
 assert (a.("Maximum intensity"), uint8 (55));
***** test
 h = imshow (img);
 a1 = imattributes ();
 a2 = imattributes (h);
 assert (a1, a2);
5 tests, 4 passed, 1 known failure, 0 skipped
[iptnum2ordinal]
>>>>> /usr/share/octave/packages/image-2.6.1/iptnum2ordinal.m
***** assert (strcmp (iptnum2ordinal (1), 'first'));    # simple works
***** assert (strcmp (iptnum2ordinal (21), '21st'));    # after 20, goes stupid
***** assert (strcmp (iptnum2ordinal (100), '100th'));  # use th correctly
***** fail ("iptnum2ordinal (inf)");                    # must be real
***** fail ("iptnum2ordinal (0)");                      # must be positive
***** fail ("iptnum2ordinal (-1)");                     # must be positive
***** fail ("iptnum2ordinal (3.4)");                    # must be integer
7 tests, 7 passed, 0 known failure, 0 skipped
[radon]
>>>>> /usr/share/octave/packages/image-2.6.1/radon.m
***** test
 A = radon(ones(2,2),30);
 assert (A,[0 0 0.608253175473055 2.103325780167649 1.236538105676658 0.051882938682637 0]',1e-10)
1 test, 1 passed, 0 known failure, 0 skipped
[imgradientxy]
>>>>> /usr/share/octave/packages/image-2.6.1/imgradientxy.m
***** test
 A = [0 1 0
      1 1 1
      0 1 0];

 [gxSobel,  gySobel]  = imgradientxy (A);
 [gxSobel2, gySobel2] = imgradientxy (A, "Sobel");
 assert (gxSobel,
         [ 3   0  -3
           4   0  -4
           3   0  -3]);
 assert (gySobel,
         [ 3   4   3
           0   0   0
          -3  -4  -3]);

 ## test default method
 assert(gxSobel, gxSobel2);
 assert(gySobel, gySobel2);

 [gxPrewitt, gyPrewitt] = imgradientxy (A, "Prewitt");
 assert (gxPrewitt,
         [ 2   0  -2
           3   0  -3
           2   0  -2]);
 assert (gyPrewitt,
         [ 2   3   2
           0   0   0
          -2  -3  -2]);

 [gxCd, gyCd] = imgradientxy (A, "CentralDifference");
 assert (gxCd,
         [ 0.5   0.0  -0.5
           0.5   0.0  -0.5
           0.5   0.0  -0.5]);
 assert (gyCd,
         [ 0.5   0.5   0.5
           0     0     0
          -0.5  -0.5  -0.5]);

 [gxId, gyId] = imgradientxy(A, "IntermediateDifference");
 assert (gxId,
         [ 1  -1   0
           0   0  -1
           1  -1   0]);
 assert (gyId,
         [ 1   0   1
          -1   0  -1
           0  -1   0]);
1 test, 1 passed, 0 known failure, 0 skipped
[imlincomb]
>>>>> /usr/share/octave/packages/image-2.6.1/imlincomb.m
***** assert (imlincomb (0.5, uint8 ([255 10]), 0.5, uint8 ([50 20])),           uint8  ([153 15])); # default to first class and truncate
***** assert (imlincomb (0.5, uint8 ([255 10]), 0.5, uint8 ([50 20]), "uint16"), uint16 ([153 15])); # defining output class works
2 tests, 2 passed, 0 known failure, 0 skipped
[rgb2gray]
>>>>> /usr/share/octave/packages/image-2.6.1/rgb2gray.m
***** shared img
 img = zeros (2, 2, 3);
 img(:,:,1) = [1 0; 0 1];
 img(:,:,2) = [0 1; 0 1];
 img(:,:,3) = [0 0; 1 1];
 img = rgb2gray (img);
***** assert ([img(1,1) img(1,2) img(2,1) img(2,2)], [0.29894 0.58704 0.11402 1]);
1 test, 1 passed, 0 known failure, 0 skipped
[bwareafilt]
>>>>> /usr/share/octave/packages/image-2.6.1/bwareafilt.m
***** shared a2d, a3d
 a2d = [1   0   0   0   0   0   1   0   0   1
        1   0   0   1   0   1   0   1   0   1
        1   0   1   0   0   0   0   0   0   0
        0   0   0   0   0   0   0   0   0   0
        0   1   0   0   0   0   0   0   0   0
        1   1   0   1   1   1   0   0   0   0
        1   1   0   1   0   0   0   1   0   0
        1   1   0   0   0   0   1   0   1   0
        1   1   0   0   0   0   0   0   0   0
        1   1   0   0   0   1   1   0   0   1];

 a3d = a2d;
 a3d(:,:,2) = [
        0   0   0   0   0   0   0   0   0   0
        1   0   0   1   1   0   0   1   0   0
        0   0   0   1   0   0   0   0   0   0
        0   0   0   0   0   0   0   0   0   0
        0   1   0   0   0   0   0   0   0   0
        1   1   0   0   1   1   0   0   0   0
        1   1   0   1   0   0   0   0   0   0
        1   0   0   0   0   0   1   0   0   0
        0   1   0   0   0   0   0   0   0   1
        1   1   0   0   0   0   1   0   0   0];

 a3d(:,:,3) = [
        1   0   0   0   0   0   0   0   0   0
        0   1   0   1   1   0   0   1   0   0
        0   0   0   1   0   0   0   0   0   0
        0   0   0   0   0   0   0   0   0   0
        0   0   0   0   0   0   0   0   0   0
        0   0   0   1   1   1   0   0   0   0
        0   0   0   0   0   0   0   0   0   0
        1   0   0   0   0   0   0   0   0   0
        1   1   0   0   0   0   0   0   0   1
        1   1   0   0   0   0   0   0   0   0];
***** test
 f2d = [0   0   0   0   0   0   0   0   0   0
        0   0   0   0   0   0   0   0   0   0
        0   0   0   0   0   0   0   0   0   0
        0   0   0   0   0   0   0   0   0   0
        0   1   0   0   0   0   0   0   0   0
        1   1   0   1   1   1   0   0   0   0
        1   1   0   1   0   0   0   0   0   0
        1   1   0   0   0   0   0   0   0   0
        1   1   0   0   0   0   0   0   0   0
        1   1   0   0   0   0   0   0   0   0];
 assert (bwareafilt (a2d, 2), logical (f2d));
 assert (bwareafilt (a2d, 2, 8), logical (f2d));
 assert (bwareafilt (a2d, 2, 4), logical (f2d));
***** test
 f2d = [1   0   0   0   0   0   1   0   0   0
        1   0   0   0   0   1   0   1   0   0
        1   0   0   0   0   0   0   0   0   0
        0   0   0   0   0   0   0   0   0   0
        0   1   0   0   0   0   0   0   0   0
        1   1   0   1   1   1   0   0   0   0
        1   1   0   1   0   0   0   1   0   0
        1   1   0   0   0   0   1   0   1   0
        1   1   0   0   0   0   0   0   0   0
        1   1   0   0   0   0   0   0   0   0];
 assert (bwareafilt (a2d, 5), logical (f2d));
 assert (bwareafilt (a2d, 5, 8), logical (f2d));
***** test
 f2d = [0   0   0   0   0   0   1   0   0   1
        0   0   0   1   0   1   0   1   0   1
        0   0   1   0   0   0   0   0   0   0
        0   0   0   0   0   0   0   0   0   0
        0   0   0   0   0   0   0   0   0   0
        0   0   0   0   0   0   0   0   0   0
        0   0   0   0   0   0   0   1   0   0
        0   0   0   0   0   0   1   0   1   0
        0   0   0   0   0   0   0   0   0   0
        0   0   0   0   0   1   1   0   0   1];
 assert (bwareafilt (a2d, 11, "smallest", 4), logical (f2d));
***** test
 f2d = [1   0   0   0   0   0   1   0   0   0
        1   0   0   0   0   1   0   1   0   0
        1   0   0   0   0   0   0   0   0   0
        0   0   0   0   0   0   0   0   0   0
        0   0   0   0   0   0   0   0   0   0
        0   0   0   1   1   1   0   0   0   0
        0   0   0   1   0   0   0   1   0   0
        0   0   0   0   0   0   1   0   1   0
        0   0   0   0   0   0   0   0   0   0
        0   0   0   0   0   0   0   0   0   0];
 assert (bwareafilt (a2d, [3 5]), logical (f2d));
 assert (bwareafilt (a2d, [3 5], 8), logical (f2d));
***** test
 f2d = [1   0   0   0   0   0   0   0   0   0
        1   0   0   0   0   0   0   0   0   0
        1   0   0   0   0   0   0   0   0   0
        0   0   0   0   0   0   0   0   0   0
        0   0   0   0   0   0   0   0   0   0
        0   0   0   1   1   1   0   0   0   0
        0   0   0   1   0   0   0   0   0   0
        0   0   0   0   0   0   0   0   0   0
        0   0   0   0   0   0   0   0   0   0
        0   0   0   0   0   0   0   0   0   0];
 assert (bwareafilt (a2d, [3 4], 4), logical (f2d));
 assert (bwareafilt (a2d, [3 4], [0 1 0; 1 1 1; 0 1 0]), logical (f2d));
***** test
 f2d = [1   0   0   0   0   0   1   0   0   1
        1   0   0   1   0   1   0   1   0   1
        1   0   1   0   0   0   0   0   0   0
        0   0   0   0   0   0   0   0   0   0
        0   0   0   0   0   0   0   0   0   0
        0   0   0   1   1   1   0   0   0   0
        0   0   0   1   0   0   0   1   0   0
        0   0   0   0   0   0   1   0   1   0
        0   0   0   0   0   0   0   0   0   0
        0   0   0   0   0   1   1   0   0   0];
 assert (bwareafilt (a2d, [2 4]), logical (f2d));
 assert (bwareafilt (a2d, [2 4], 8), logical (f2d));
 assert (bwareafilt (a2d, [2 4], ones (3)), logical (f2d));
***** test
 f3d = [0   0   0   0   0   0   1   0   0   0
        0   0   0   1   0   1   0   1   0   0
        0   0   1   0   0   0   0   0   0   0
        0   0   0   0   0   0   0   0   0   0
        0   1   0   0   0   0   0   0   0   0
        1   1   0   0   0   0   0   0   0   0
        1   1   0   0   0   0   0   0   0   0
        1   1   0   0   0   0   0   0   0   0
        1   1   0   0   0   0   0   0   0   0
        1   1   0   0   0   0   0   0   0   0];

 f3d(:,:,2) = [
        0   0   0   0   0   0   0   0   0   0
        0   0   0   1   1   0   0   1   0   0
        0   0   0   1   0   0   0   0   0   0
        0   0   0   0   0   0   0   0   0   0
        0   1   0   0   0   0   0   0   0   0
        1   1   0   0   0   0   0   0   0   0
        1   1   0   0   0   0   0   0   0   0
        1   0   0   0   0   0   0   0   0   0
        0   1   0   0   0   0   0   0   0   0
        1   1   0   0   0   0   0   0   0   0];

 f3d(:,:,3) = [
        0   0   0   0   0   0   0   0   0   0
        0   0   0   1   1   0   0   1   0   0
        0   0   0   1   0   0   0   0   0   0
        0   0   0   0   0   0   0   0   0   0
        0   0   0   0   0   0   0   0   0   0
        0   0   0   0   0   0   0   0   0   0
        0   0   0   0   0   0   0   0   0   0
        1   0   0   0   0   0   0   0   0   0
        1   1   0   0   0   0   0   0   0   0
        1   1   0   0   0   0   0   0   0   0];
 assert (bwareafilt (a3d, 2), logical (f3d));
 assert (bwareafilt (a3d, 2, 26), logical (f3d));
 assert (bwareafilt (a3d, 2, ones (3, 3, 3)), logical (f3d));
***** test
 f3d = [0   0   0   0   0   0   0   0   0   0
        0   0   0   0   0   0   0   0   0   0
        0   0   0   0   0   0   0   0   0   0
        0   0   0   0   0   0   0   0   0   0
        0   1   0   0   0   0   0   0   0   0
        1   1   0   1   1   1   0   0   0   0
        1   1   0   1   0   0   0   0   0   0
        1   1   0   0   0   0   0   0   0   0
        1   1   0   0   0   0   0   0   0   0
        1   1   0   0   0   0   0   0   0   0];

 f3d(:,:,2) = [
        0   0   0   0   0   0   0   0   0   0
        0   0   0   0   0   0   0   0   0   0
        0   0   0   0   0   0   0   0   0   0
        0   0   0   0   0   0   0   0   0   0
        0   1   0   0   0   0   0   0   0   0
        1   1   0   0   1   1   0   0   0   0
        1   1   0   1   0   0   0   0   0   0
        1   0   0   0   0   0   0   0   0   0
        0   1   0   0   0   0   0   0   0   0
        1   1   0   0   0   0   0   0   0   0];

 f3d(:,:,3) = [
        0   0   0   0   0   0   0   0   0   0
        0   0   0   0   0   0   0   0   0   0
        0   0   0   0   0   0   0   0   0   0
        0   0   0   0   0   0   0   0   0   0
        0   0   0   0   0   0   0   0   0   0
        0   0   0   1   1   1   0   0   0   0
        0   0   0   0   0   0   0   0   0   0
        1   0   0   0   0   0   0   0   0   0
        1   1   0   0   0   0   0   0   0   0
        1   1   0   0   0   0   0   0   0   0];
 assert (bwareafilt (a3d, 2, 6), logical (f3d));
 assert (bwareafilt (a3d, 2, conndef (3, "minimal")), logical (f3d));
8 tests, 8 passed, 0 known failure, 0 skipped
[lab2single]
>>>>> /usr/share/octave/packages/image-2.6.1/lab2single.m
***** test
 l_max_f = 100 + (25500 / 65280);
 ab_max_f = 127 + (255 / 256);
 cm = [
   -Inf
   Inf
   NaN
   l_max_f
   ab_max_f
   -200
   -129
   -128
   -128+(255/65280)*(0.499)
   -128+(255/65280)*(0.500)
   -128+(255/65280)*(0.501)
   -127
   -1
   0
   (100/65280)*(0.499999)
   (100/65280)*(0.51)
   (100/65280)*(0.500001)
   1
   99
   100
   101
   126
   127
   128
   254
   255
   256
   257];
 cm = repmat (single (cm), [1 3]);
 im2d = reshape (cm, [7 4 3]);
 imnd = permute (im2d, [1 4 3 2]);

 cm_uint8 = uint8 ([
     0    0    0
   255  255  255
   255  255  255
   255  228  228
   255  255  255
     0    0    0
     0    0    0
     0    0    0
     0    0    0
     0    0    0
     0    0    0
     0    1    1
     0  127  127
     0  128  128
     0  128  128
     0  128  128
     0  128  128
     3  129  129
   252  227  227
   255  228  228
   255  229  229
   255  254  254
   255  255  255
   255  255  255
   255  255  255
   255  255  255
   255  255  255
   255  255  255]);

 assert (lab2uint8 (cm), cm_uint8)
 im2d_uint8 = reshape (cm_uint8, [7 4 3]);
 assert (lab2uint8 (im2d), im2d_uint8)
 assert (lab2uint8 (imnd), permute (im2d_uint8, [1 4 3 2]))

 cm_uint16 = uint16 ([
       0      0      0
   65535  65535  65535
   65535  65535  65535
   65535  58468  58468
   65535  65535  65535
       0      0      0
       0      0      0
       0      0      0
       0      0      0
       0      1      1
       0      1      1
       0    256    256
       0  32512  32512
       0  32768  32768
       0  32768  32768
       1  32768  32768
       1  32768  32768
     653  33024  33024
   64627  58112  58112
   65280  58368  58368
   65535  58624  58624
   65535  65024  65024
   65535  65280  65280
   65535  65535  65535
   65535  65535  65535
   65535  65535  65535
   65535  65535  65535
   65535  65535  65535]);

 assert (lab2uint16 (cm), cm_uint16)
 im2d_uint16 = reshape (cm_uint16, [7 4 3]);
 assert (lab2uint16 (im2d), im2d_uint16)
 assert (lab2uint16 (imnd), permute (im2d_uint16, [1 4 3 2]))

 assert (lab2double (cm), double (cm))
 assert (lab2double (im2d), double (im2d))
 assert (lab2double (imnd), double (imnd))
1 test, 1 passed, 0 known failure, 0 skipped
[imfilter]
>>>>> /usr/share/octave/packages/image-2.6.1/imfilter.m
***** test
  img = [
   8   2   6   7   4   3   7   8   4   1
   9   9   1   1   4   7   3   3   8   1
   2   9   8   3   7   6   5   8   6   5
   9   5   9   1   8   2   7   3   5   8
   6   8   7   1   2   2   9   9   9   9
   1   2   7   8   5   5   9   4   3   2
   3   4   7   7   5   9   5   2   7   6
   5   9   4   3   6   4   2   3   7   5
   9   8   6   9   7   6   2   6   4   1
   9   9   2   1   7   3   3   5   6   4];

 expected_corr = [
  46  53  30  34  44  42  40  51  42  19
  48  66  57  42  46  50  59  58  49  34
  48  67  55  54  44  58  50  50  64  39
  44  77  52  43  28  55  57  75  70  50
  29  51  65  51  42  50  60  62  55  42
  23  44  58  59  63  59  55  57  50  36
  36  50  52  56  56  47  48  45  47  39
  51  64  70  62  56  50  40  38  41  31
  58  72  50  49  58  45  41  42  49  28
  27  37  27  21  19  26  16  23  24  17];
 assert (imfilter (img, [0 1 0; 2 1 1; 1 2 2]), expected_corr)

 ## test order of options (and matching with defaults)
 assert (imfilter (img, [0 1 0; 2 1 1; 1 2 2], 0), expected_corr)
 assert (imfilter (img, [0 1 0; 2 1 1; 1 2 2], "corr"), expected_corr)
 assert (imfilter (img, [0 1 0; 2 1 1; 1 2 2], "corr", 0), expected_corr)
 assert (imfilter (img, [0 1 0; 2 1 1; 1 2 2], 0, "corr"), expected_corr)

 expected_conv = [
  21  31  23  22  21  28  29  26  22   6
  47  55  43  43  51  44  49  64  44  24
  56  69  53  34  47  50  57  48  52  37
  38  70  60  56  41  57  54  61  66  44
  46  67  53  48  32  54  59  65  63  46
  28  56  63  50  36  54  58  66  63  47
  20  43  55  62  67  57  52  53  44  28
  42  51  54  61  57  53  44  46  48  39
  53  70  63  50  57  42  38  38  43  33
  53  62  50  54  52  44  38  40  40  20];
 assert (imfilter (img, [0 1 0; 2 1 1; 1 2 2], "conv"), expected_conv)

 ## alternative class
 assert (imfilter (single (img), [0 1 0; 2 1 1; 1 2 2]),
         single (expected_corr))
 assert (imfilter (int8 (img), [0 1 0; 2 1 1; 1 2 2]),
         int8 (expected_corr))
 assert (imfilter (uint8 (img), [0 1 0; 2 1 1; 1 2 2]),
         uint8 (expected_corr))

 assert (imfilter (single (img), [0 1 0; 2 1 1; 1 2 2], "conv"),
         single (expected_conv))
 assert (imfilter (int8 (img), [0 1 0; 2 1 1; 1 2 2], "conv"),
         int8 (expected_conv))
 assert (imfilter (uint8 (img), [0 1 0; 2 1 1; 1 2 2], "conv"),
         uint8 (expected_conv))

***** test
 I = zeros (6);
 I(2:3,2:3) = 1;
 F = zeros (4);
 F(2,2:3) = 1;
 result = [0 0 0 0 0 0
           1 2 1 0 0 0
           1 2 1 0 0 0
           0 0 0 0 0 0
           0 0 0 0 0 0
           0 0 0 0 0 0];
 assert (imfilter (I, F), result)
2 tests, 2 passed, 0 known failure, 0 skipped
[lab2uint16]
>>>>> /usr/share/octave/packages/image-2.6.1/lab2uint16.m
***** test
 cm_uint16 = uint16 ([0 127 128 383 384 65151 65152 65279 65280 65281 65534 65535]);
 cm_uint16 = repmat (cm_uint16(:), [1 3]);
 im2d_uint16 = reshape (cm_uint16, [4 3 3]);
 imnd_uint16 = permute (im2d_uint16, [1 4 3 2]);

 cm_uint8 = uint8 ([0 0 1 1 2 254 255 255 255 255 255 255]);
 cm_uint8 = repmat (cm_uint8(:), [1 3]);
 assert (lab2uint8 (cm_uint16), cm_uint8)
 im2d_uint8 = reshape (cm_uint8, [4 3 3]);
 assert (lab2uint8 (im2d_uint16), im2d_uint8)
 assert (lab2uint8 (imnd_uint16), permute (im2d_uint8, [1 4 3 2]))

 l1 = 100/65280;
 ab1 = 255/65280;
 cm = [
         0  -128
    127*l1  -128+(ab1*127)
    128*l1  -128+(ab1*128)
    383*l1  -128+(ab1*383)
    384*l1  -128+(ab1*384)
  65151*l1  -128+(ab1*65151)
  65152*l1  -128+(ab1*65152)
  65279*l1  -128+(ab1*65279)
       100   127
  65281*l1  -128+(ab1*65281)
  65534*l1  -128+(ab1*65534)
  65535*l1  -128+(ab1*65535)];
 cm(:,3) = cm(:,2);
 im2d = reshape (cm, [4 3 3]);
 imnd = permute (im2d, [1 4 3 2]);

 assert (lab2double (cm_uint16), cm)
 assert (lab2double (im2d_uint16), im2d)
 assert (lab2double (imnd_uint16), imnd)

 assert (lab2single (cm_uint16), single (cm))
 assert (lab2single (im2d_uint16), single (im2d))
 assert (lab2single (imnd_uint16), single (imnd))
1 test, 1 passed, 0 known failure, 0 skipped
[roicolor]
>>>>> /usr/share/octave/packages/image-2.6.1/roicolor.m
***** demo
 roicolor([1:10],2,4);
 % Returns '1' where input values are between 2 and 4 (both included).
***** assert(roicolor([1:10],2,4),logical([0,1,1,1,zeros(1,6)]));
***** assert(roicolor([1,2;3,4],3,3),logical([0,0;1,0]));
***** assert(roicolor([1,2;3,4],[1,4]),logical([1,0;0,1]));
3 tests, 3 passed, 0 known failure, 0 skipped
[col2im]
>>>>> /usr/share/octave/packages/image-2.6.1/col2im.m
***** demo
 ## Divide A using distinct blocks and then reverse the operation
 A = [ 1:10
      11:20
      21:30
      31:40];
 B = im2col (A, [2 5], "distinct")
 C = col2im (B, [2 5], [4 10], "distinct")
***** demo
 ## Get sliding blocks of size from A into columns, calculate the
 ## mean of each block (mean of each column), and reconstruct A
 ## after a median filter.
 A = reshape (1:24, [4 6])
 B = im2col (A, [2 3], "sliding")
 C = mean (B);
 col2im (C, [1 1], [3 4], "sliding")
***** error <BLOCK_TYPE> col2im (ones (10), [5 5], [10 10], "wrong_block_type");
***** error <resize B>   col2im (ones (10), [1 1], [ 7  7], "sliding");
***** error <rows in B>  col2im (ones (10), [3 3], [10 10], "distinct")
***** error <rows in B>  col2im (ones (10), [5 5], [10 11], "distinct");
***** assert (col2im (sum (im2col (magic (10), [3 3], "sliding")), [1 1], [8 8]),
        convn (magic (10), ones (3, 3), "valid"));
***** test
 B = ones (1, (10-2+1)*(7-3+1));
 A = ones ((10-2+1), (7-3+1));
 assert (col2im (B, [2 3], [10 7]), A);

 ## same but different classes
 assert (col2im (int16   (B), [2 3], [10 7]), int16   (A));
 assert (col2im (single  (B), [2 3], [10 7]), single  (A));
 assert (col2im (logical (B), [2 3], [10 7]), logical (A));
***** test
 a = rand (10)(:);
 assert (col2im (a, [1 1], [10 10]), col2im (a, [1 1], [10 10], "sliding"))
***** shared A, B
 v  = [1:10]';
 r  = reshape (1:10, [2 5]);
 B  = [v  v+10  v+20  v+30  v+40  v+50];
 A  = [r    r+30
       r+10 r+40
       r+20 r+50];
 assert (col2im (B, [2 5], [6 10], "distinct"), A);
***** assert (col2im (int16   (B), [2 5], [6 10], "distinct"), int16   (A));
***** assert (col2im (logical (B), [2 5], [6 10], "distinct"), logical (A));
***** assert (col2im (single  (B), [2 5], [6 10], "distinct"), single  (A));
***** test
 a = rand (10, 8);
 b = im2col (a, [5 5], "distinct");
 assert (col2im (b, [5 5], [10 8], "distinct"), a);

 a = rand (8);
 b = im2col (a, [5 5], "distinct");
 assert (col2im (b, [5 5], [8 8], "distinct"), a);
***** shared a, b
 ## Same number of multiple dimensions
 a = rand (10, 10, 10);
 b = im2col (a, [5 5 5], "distinct");
***** assert (col2im (b, [5 5 5], [10 10 10], "distinct"), a);

 ## Different number of dimensions
 a = rand (10, 10, 10);
 b = im2col (a, [5 5], "distinct");
***** assert (col2im (b, [5 5], [10 10 10], "distinct"), a);

 ## Removing padding from multiple dimensions
 a = rand (10, 10, 7);
 b = im2col (a, [5 5 3], "distinct");
***** assert (col2im (b, [5 5 3], [10 10 7], "distinct"), a);

 a = rand (10, 10, 7);
 b = im2col (a, [5 5 5 2], "distinct");
***** assert (col2im (b, [5 5 5 2], [10 10 7], "distinct"), a);
15 tests, 15 passed, 0 known failure, 0 skipped
[regionprops]
>>>>> /usr/share/octave/packages/image-2.6.1/regionprops.m
***** shared bw2d, gray2d, bw2d_over_bb, bw2d_insides
 bw2d = logical ([
  0 1 0 1 1 0
  0 1 1 0 1 1
  0 1 0 0 0 0
  0 0 0 1 1 1
  0 0 1 1 0 1]);

 gray2d = [
  2 4 0 7 5 2
  3 0 4 9 3 7
  0 5 3 4 8 1
  9 2 0 5 8 6
  8 9 7 2 2 5];

 ## For testing overlapping bounding boxes
 bw2d_over_bb = logical ([
  0 1 1 1 0 1 1
  1 1 0 0 0 0 1
  1 0 0 1 1 0 1
  1 0 0 1 1 0 0
  0 0 0 1 1 1 1]);

 ## For testing when there's regions inside regions
 bw2d_insides = logical ([
  0 0 0 0 0 0 0 0
  0 1 1 1 1 1 1 0
  0 1 0 0 0 0 1 0
  0 1 0 1 1 0 1 0
  0 1 0 1 1 0 1 0
  0 1 0 0 0 0 1 0
  0 1 1 1 1 1 1 0
  0 0 0 0 0 0 0 0]);
***** function c = get_2d_centroid_for (idx)
  subs = ind2sub ([5 6], idx);
  m = false ([5 6]);
  m(idx) = true;
  y = sum ((1:5)' .* sum (m, 2) /sum (m(:)));
  x = sum ((1:6)  .* sum (m, 1) /sum (m(:)));
  c = [x y];
***** endfunction
***** assert (regionprops (bw2d, "Area"), struct ("Area", {8; 6}))
***** assert (regionprops (double (bw2d), "Area"), struct ("Area", {14}))
***** assert (regionprops (bwlabel (bw2d, 4), "Area"), struct ("Area", {4; 6; 4}))
***** assert (regionprops (bw2d, "PixelIdxList"),
        struct ("PixelIdxList", {[6; 7; 12; 8; 16; 21; 22; 27]
                                 [15; 19; 20; 24; 29; 30]}))
***** assert (regionprops (bwlabel (bw2d, 4), "PixelIdxList"),
        struct ("PixelIdxList", {[6; 7; 8; 12]
                                 [15; 19; 20; 24; 29; 30]
                                 [16; 21; 22; 27]}))
***** assert (regionprops (bw2d, "PixelList"),
        struct ("PixelList", {[2 1; 2 2; 3 2; 2 3; 4 1; 5 1; 5 2; 6 2]
                              [3 5; 4 4; 4 5; 5 4; 6 4; 6 5]}))
***** assert (regionprops (bwlabel (bw2d, 4), "PixelList"),
        struct ("PixelList", {[2 1; 2 2; 2 3; 3 2]
                              [3 5; 4 4; 4 5; 5 4; 6 4; 6 5]
                              [4 1; 5 1; 5 2; 6 2]}))
***** assert (regionprops (bw2d, gray2d, "PixelValues"),
        struct ("PixelValues", {[4; 0; 4; 5; 7; 5; 3; 7]
                                [7; 5; 2; 8; 6; 5]}))
***** assert (regionprops (bw2d, gray2d, "MaxIntensity"),
        struct ("MaxIntensity", {7; 8}))
***** assert (regionprops (bw2d, gray2d, "MinIntensity"),
        struct ("MinIntensity", {0; 2}))
***** assert (regionprops (bw2d, "BoundingBox"),
        struct ("BoundingBox", {[1.5 0.5 5 3]; [2.5 3.5 4 2]}))
***** assert (regionprops (bw2d, "Centroid"),
        struct ("Centroid", {get_2d_centroid_for([6 7 8 12 16 21 22 27])
                             get_2d_centroid_for([15 19 20 24 29 30])}))
***** test
 props = struct ("Area", {8; 6},
                 "Centroid", {get_2d_centroid_for([6 7 8 12 16 21 22 27])
                              get_2d_centroid_for([15 19 20 24 29 30])},
                 "BoundingBox", {[1.5 0.5 5 3]; [2.5 3.5 4 2]});
 assert (regionprops (bw2d, "basic"), props)
 assert (regionprops (bwconncomp (bw2d, 8), "basic"), props)
 assert (regionprops (bwlabeln (bw2d, 8), "basic"), props)
***** test
 props = struct ("Area", {4; 6; 4},
                 "Centroid", {get_2d_centroid_for([6 7 8 12])
                              get_2d_centroid_for([15 19 20 24 29 30])
                              get_2d_centroid_for([16 21 22 27])},
                 "BoundingBox", {[1.5 0.5 2 3]; [2.5 3.5 4 2]; [3.5 0.5 3 2]});
 assert (regionprops (bwconncomp (bw2d, 4), "basic"), props)
 assert (regionprops (bwlabeln (bw2d, 4), "basic"), props)
***** assert (regionprops (double (bw2d), "basic"),
        struct ("Area", 14,
                "Centroid", get_2d_centroid_for (find (bw2d)),
                "BoundingBox", [1.5 0.5 5 5]), eps*1000)
***** assert (regionprops ([0 0 1], "Centroid").Centroid, [3 1])
***** assert (regionprops ([0 0 1; 0 0 0], "Centroid").Centroid, [3 1])
***** assert (regionprops ([0 1 1], "Centroid").Centroid, [2.5 1])
***** assert (regionprops ([0 1 1; 0 0 0], "Centroid").Centroid, [2.5 1])
***** test
 a = zeros (2, 3, 3);
 a(:, :, 1) = [0 1 0; 0 0 0];
 a(:, :, 3) = a(:, :, 1);
 c = regionprops (a, "centroid");
 assert (c.Centroid, [2 1 2])
***** test
 d1=2; d2=4; d3=6;
 a = ones (d1, d2, d3);
 c = regionprops (a, "centroid");
 assert (c.Centroid, [mean(1:d2), mean(1:d1), mean(1:d3)], eps*1000)
***** test
 a = [0 0 2 2; 3 3 0 0; 0 1 0 1];
 c = regionprops (a, "centroid");
 assert (c(1).Centroid, [3 3])
 assert (c(2).Centroid, [3.5 1])
 assert (c(3).Centroid, [1.5 2])
***** test
***** assert (regionprops (bw2d, gray2d, "WeightedCentroid"),
                     struct ("WeightedCentroid",
                             {sum([2 1; 2 2; 3 2; 2 3; 4 1; 5 1; 5 2; 6 2]
                              .* ([4; 0; 4; 5; 7; 5; 3; 7] / 35))
                              sum([3 5; 4 4; 4 5; 5 4; 6 4; 6 5]
                                  .* ([7; 5; 2; 8; 6; 5] / 33))}))
***** test
 img = zeros (3, 9);
 img(2, 1:9) = 0:0.1:0.8;
 bw = im2bw (img, 0.5);
 props = regionprops (bw, img, "WeightedCentroid");
 ix = 7:9;
 x = sum (img(2,ix) .* (ix)) / sum (img(2,ix));
 assert (props(1).WeightedCentroid(1), x, 10*eps)
 assert (props(1).WeightedCentroid(2), 2, 10*eps)
***** assert (regionprops (bw2d, gray2d, "MeanIntensity"),
        struct ("MeanIntensity", {mean([4 0 5 4 7 5 3 7])
                                  mean([7 5 2 8 6 5])}))
***** assert (regionprops (bwlabel (bw2d, 4), gray2d, "MeanIntensity"),
        struct ("MeanIntensity", {mean([4 0 5 4])
                                  mean([7 5 2 8 6 5])
                                  mean([7 5 3 7])}))
***** assert (regionprops (bw2d, "SubarrayIdx"),
        struct ("SubarrayIdx", {{[1 2 3], [2 3 4 5 6]}
                                {[4 5], [3 4 5 6]}}))
***** assert (regionprops (bwlabel (bw2d, 4), "SubarrayIdx"),
        struct ("SubarrayIdx", {{[1 2 3], [2 3]}
                                {[4 5], [3 4 5 6]}
                                {[1 2], [4 5 6]}}))
***** test
 out = struct ("Image", {logical([1 0 1 1 0; 1 1 0 1 1; 1 0 0 0 0])
                         logical([0 1 1 1; 1 1 0 1])});
 assert (regionprops (bw2d, "Image"), out)
 assert (regionprops (bw2d, gray2d, "Image"), out)
 assert (regionprops (bwlabel (bw2d), "Image"), out)
***** assert (regionprops (bwlabel (bw2d, 4), "Image"),
        struct ("Image", {logical([1 0; 1 1; 1 0])
                          logical([0 1 1 1; 1 1 0 1])
                          logical([1 1 0; 0 1 1])}))
***** test
 out = struct ("Image", {logical([0 1 1 1; 1 1 0 0; 1 0 0 0; 1 0 0 0])
                         logical([1 1 0 0; 1 1 0 0; 1 1 1 1])
                         logical([1 1; 0 1; 0 1])});
 assert (regionprops (bw2d_over_bb, "Image"), out)
 assert (regionprops (bwlabel (bw2d_over_bb), "Image"), out)
***** test
 out = struct ("Image", {logical([1 1 1 1 1 1
                                  1 0 0 0 0 1
                                  1 0 0 0 0 1
                                  1 0 0 0 0 1
                                  1 0 0 0 0 1
                                  1 1 1 1 1 1])
                         logical([1 1; 1 1])});
 assert (regionprops (bw2d_insides, "Image"), out)
 assert (regionprops (bwlabel (bw2d_insides), "Image"), out)
***** test
 l = uint8 ([
   0  0  0  0  0  0
   0  1  1  1  1  0
   0  1  2  2  1  0
   0  1  2  2  1  0
   0  1  1  1  1  0
   0  0  0  0  0  0
 ]);
 assert (regionprops (l, "EulerNumber"),
         struct ("EulerNumber", {0; 1}))

 l = uint8 ([
   0  0  0  0  0  0  0
   0  1  1  1  1  1  0
   0  1  2  2  2  1  0
   0  1  2  3  2  1  0
   0  1  2  2  2  1  0
   0  1  1  1  1  1  0
   0  0  0  0  0  0  0
 ]);
 assert (regionprops (l, "EulerNumber"),
         struct ("EulerNumber", {0; 0; 1}))
***** test
 l = uint8 ([
   0  0  0  0  0  0  0
   0  1  1  1  1  1  0
   0  1  0  0  0  1  0
   0  1  0  1  0  1  0
   0  1  0  0  0  1  0
   0  1  1  1  1  1  0
   0  0  0  0  0  0  0
 ]);
 assert (regionprops (l, "EulerNumber"),
         struct ("EulerNumber", 1))
***** test
 l = uint8 ([
   1  1  1  1  1  1  1
   1  1  2  1  2  2  1
   1  2  1  2  1  2  1
   1  1  2  1  2  1  1
   1  2  1  2  1  2  1
   1  2  2  1  2  1  1
   1  1  1  1  1  1  1
 ]);
 assert (regionprops (l, "EulerNumber"),
         struct ("EulerNumber", {-9; -4}))
***** test
 l = uint8 ([
   1  1  1  1  1  1  1
   1  1  4  1  5  5  1
   1  3  1  4  1  5  1
   1  1  3  1  4  1  1
   1  2  1  3  1  4  1
   1  2  2  1  3  1  1
   1  1  1  1  1  1  1
 ]);
 assert (regionprops (l, "EulerNumber"),
         struct ("EulerNumber", {-9; 1; 1; 1; 1}))
***** test
 l = uint8 ([
   1  1  1  1  1  1  1
   0  1  2  1  2  2  1
   1  2  1  2  1  2  1
   1  1  2  1  2  1  1
   1  2  1  2  1  2  1
   1  2  2  1  2  1  1
   1  1  1  1  1  1  1
 ]);
 filled = {
   logical([
     1  1  1  1  1  1  1
     0  1  1  1  1  1  1
     1  1  1  1  1  1  1
     1  1  1  1  1  1  1
     1  1  1  1  1  1  1
     1  1  1  1  1  1  1
     1  1  1  1  1  1  1
   ]);
   logical([
     0  1  0  1  1
     1  1  1  1  1
     0  1  1  1  0
     1  1  1  1  1
     1  1  0  1  0
   ]);
  };
 assert (regionprops (l, {"FilledImage", "FilledArea"}),
         struct ("FilledImage", filled, "FilledArea", {48; 19}))
***** test
 l = uint8 ([
   0  0  0  0  0  0  0
   0  1  0  1  0  1  0
   0  1  0  1  0  1  0
   0  0  0  0  0  0  0
 ]);
 filled = logical ([
   1  0  1  0  1
   1  0  1  0  1
 ]);
 assert (regionprops (l, {"FilledImage", "FilledArea"}),
         struct ("FilledImage", filled, "FilledArea", 6))

 l = uint8 ([
   2  2  2  2  2  2  2
   2  1  2  1  2  1  2
   2  1  2  1  2  1  2
   2  2  2  2  2  2  2
 ]);
 filled = {
   logical([
     1  0  1  0  1
     1  0  1  0  1
   ]);
   true(4, 7)
 };
 assert (regionprops (l, {"FilledImage", "FilledArea"}),
         struct ("FilledImage", filled, "FilledArea", {6; 28}))
***** test
 l = uint8 ([
   0  0  0  0  0  0  0
   0  1  1  1  1  1  0
   0  1  2  2  2  1  0
   0  1  2  3  2  1  0
   0  1  2  2  2  1  0
   0  1  1  1  1  1  0
   0  0  0  0  0  0  0
 ]);
 filled = {true(5, 5); true(3, 3); true};
 assert (regionprops (l, {"FilledImage", "FilledArea"}),
         struct ("FilledImage", filled, "FilledArea", {25; 9; 1}))
***** test
 l = uint8 ([
   1  1  1  2  0  0
   1  0  2  1  2  0
   1  2  0  1  0  2
   1  2  1  1  0  2
   0  1  2  2  2  2
 ]);
 filled = {
   logical([
     1  1  1  0
     1  1  1  1
     1  1  1  1
     1  1  1  1
     0  1  0  0
   ]);
   logical([
     0  0  1  0  0
     0  1  1  1  0
     1  1  1  1  1
     1  1  1  1  1
     0  1  1  1  1
   ])
 };
 assert (regionprops (l, {"FilledImage", "FilledArea"}),
         struct ("FilledImage", filled, "FilledArea", {16; 18}))
***** test
 bw = false (5, 5, 5);
 bw(2:4, 2:4, [1 5]) = true;
 bw(2:4, [1 5], 2:4) = true;
 bw([1 5], 2:4, 2:4) = true;
 filled = bw;
 filled(2:4, 2:4, 2:4) = true;
 assert (regionprops (bw, {"FilledImage", "FilledArea"}),
         struct ("FilledImage", filled, "FilledArea", 81))
***** test
 l = uint8 ([
   1  1  1  2  0  0
   1  0  2  1  2  0
   1  2  0  1  0  2
   1  2  1  1  0  2
   0  1  2  2  2  2
 ]);
 assert (regionprops (l, {"Extent"}), struct ("Extent", {0.55; 0.44}))
***** test
 bw = logical ([0 0 0; 0 1 0; 0 0 0]);
 assert (regionprops (bw, {"MinorAxisLength", "MajorAxisLength", ...
                           "Eccentricity"}),
         struct ("MajorAxisLength", 4 .* sqrt (1/12),
                 "MinorAxisLength", 4 .* sqrt (1/12),
                 "Eccentricity", 0))
***** test
 a = eye (4);
 t = regionprops (a, "majoraxislength");
 assert (t.MajorAxisLength, 6.4291, 1e-3);
 t = regionprops (a, "minoraxislength");
 assert(t.MinorAxisLength, 1.1547 , 1e-3);
 t = regionprops (a, "eccentricity");
 assert (t.Eccentricity, 0.98374 , 1e-3);
 t = regionprops (a, "orientation");
 assert (t.Orientation, -45);
 t = regionprops (a, "equivdiameter");
 assert (t.EquivDiameter, 2.2568,  1e-3);
***** test
 b = ones (5);
 t = regionprops (b, "majoraxislength");
 assert (t.MajorAxisLength, 5.7735 , 1e-3);
 t = regionprops (b, "minoraxislength");
 assert (t.MinorAxisLength, 5.7735 , 1e-3);
 t = regionprops (b, "eccentricity");
 assert (t.Eccentricity, 0);
 t = regionprops (b, "orientation");
 assert (t.Orientation, 0);
 t = regionprops (b, "equivdiameter");
 assert (t.EquivDiameter, 5.6419,  1e-3);
***** test
 c = [0 0 1; 0 1 1; 1 1 0];
 t = regionprops (c, "minoraxislength");
 assert (t.MinorAxisLength, 1.8037 , 1e-3);
 t = regionprops (c, "majoraxislength");
 assert (t.MajorAxisLength, 4.1633 , 1e-3);
 t = regionprops (c, "eccentricity");
 assert (t.Eccentricity, 0.90128 , 1e-3);
 t = regionprops (c, "orientation");
 assert (t.Orientation, 45);
 t = regionprops (c, "equivdiameter");
 assert (t.EquivDiameter, 2.5231,  1e-3);
***** test
 f = [0 0 0 0; 1 1 1 1; 0 1 1 1; 0 0 0 0];
 t = regionprops (f, "Extrema");
 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];
 assert (t.Extrema, shouldbe,  eps);
***** test
 bw = false (5);
 bw([8 12 13 14 18]) = true;
 extrema = [2 1; 3 1; 4 2; 4 3; 3 4; 2 4; 1 3; 1 2] + 0.5;
 assert (regionprops (bw, "extrema"), struct ("Extrema", extrema))
***** test
 ext1 = [1 0; 5 0; 6 1; 6 2; 2 3; 1 3; 1 3; 1 0] + 0.5;
 ext2 = [3 3; 6 3; 6 3; 6 5; 6 5; 2 5; 2 5; 2 4] + 0.5;
 assert (regionprops (bw2d, "extrema"), struct ("Extrema", {ext1; ext2}))
***** assert (regionprops (bw2d, "equivDiameter"),
        struct ("EquivDiameter", {sqrt(4*8/pi); sqrt(4*6/pi)}))
***** assert (regionprops (bw2d_over_bb, "equivDiameter"),
        struct ("EquivDiameter", {sqrt(4*7/pi); sqrt(4*8/pi); sqrt(4*4/pi)}))
***** assert (regionprops (bw2d_insides, "equivDiameter"),
        struct ("EquivDiameter", {sqrt(4*20/pi); sqrt(4*4/pi)}))
***** test
 I = zeros (40);
 disk = fspecial ("disk",10);
 disk = disk ./ max (disk(:));
 I(10:30, 10:30) = disk;
 bw = im2bw (I, 0.5);
 props = regionprops (bw, "Perimeter");
 assert (props.Perimeter, 10*4 + (sqrt (2) * 4)*4, eps*100)

 props = regionprops (bwconncomp (bw), "Perimeter");
 assert (props.Perimeter, 10*4 + (sqrt (2) * 4)*4, eps*100)
***** assert (regionprops (bw2d, "Perimeter"),
        struct ("Perimeter", {(sqrt (2)*6 + 4); (sqrt (2)*3 + 4)}), eps*10)
***** assert (regionprops (bw2d_insides, "Perimeter"),
        struct ("Perimeter", {20; 4}))
***** assert (regionprops (bwconncomp (bw2d_insides), "Perimeter"),
        struct ("Perimeter", {20; 4}))
***** assert (regionprops ([1 0 1; 1 0 1], "Area"), struct ("Area", 4))
***** assert (regionprops ([1 0 2; 1 1 2], "Area"), struct ("Area", {3; 2}))
***** assert (regionprops ([1 0 3; 1 1 3], "Area"), struct ("Area", {3; 0; 2}))
***** assert (size (regionprops ([1 0 0; 0 0 2], "Area")), [2, 1])
***** error <L must be non-negative integers> regionprops ([1 -2   0 3])
***** error <L must be non-negative integers> regionprops ([1  1.5 0 3])
***** test
 im = rand (5);

 ## First do this so we get a list of all supported properties and don't
 ## have to update the list each time.
 bw = false (5);
 bw(13) = true;
 props = regionprops (bw, im, "all");
 all_props = fieldnames (props);

 bw = false (5);
 props = regionprops (bw, im, "all");
 assert (size (props), [0 1])
 assert (sort (all_props), sort (fieldnames (props)))
***** test
 im = rand (5);

 ## First do this so we get a list of all supported properties and don't
 ## have to update the list each time.
 labeled = zeros (5);
 labeled(13) = 1;
 props = regionprops (labeled, im, "all");
 all_props = fieldnames (props);

 labeled = zeros (5);
 props = regionprops (labeled, im, "all");
 assert (size (props), [0 1])
 assert (sort (all_props), sort (fieldnames (props)))
***** test
 im = rand (5);

 ## First do this so we get a list of all supported properties and don't
 ## have to update the list each time.
 bw = false (5);
 bw(13) = true;
 props = regionprops (bwconncomp (bw), im, "all");
 all_props = fieldnames (props);

 bw = false (5);
 props = regionprops (bwconncomp (bw), im, "all");
 assert (size (props), [0 1])
 assert (sort (all_props), sort (fieldnames (props)))
***** warning <ignoring perimeter, extrema properties for non 2 dimensional image>
        regionprops (rand (5, 5, 5) > 0.5, {"perimeter", "extrema"});
***** warning <ignoring minintensity, weightedcentroid properties due to missing grayscale image>
        regionprops (rand (5, 5) > 0.5, {"minintensity", "weightedcentroid"});
***** error <L must be non-negative integers only>
      regionprops ([0 -1 3 4; 0 -1 3 4])
***** error <L must be non-negative integers only>
      regionprops ([0 1.5 3 4; 0 1.5 3 4])
***** error <L must be non-negative integers only>
      regionprops (int8 ([0 -1 3 4; 0 -1 3 4]))
***** error <not yet implemented> regionprops (rand (5, 5) > 0.5, "ConvexArea")
***** error <not yet implemented> regionprops (rand (5, 5) > 0.5, "ConvexHull")
***** error <not yet implemented> regionprops (rand (5, 5) > 0.5, "ConvexImage")
***** error <not yet implemented> regionprops (rand (5, 5) > 0.5, "Solidity")
75 tests, 75 passed, 0 known failure, 0 skipped
[im2int16]
>>>>> /usr/share/octave/packages/image-2.6.1/im2int16.m
***** assert (im2int16 (int16 ([-2 2 3])),    int16 ([-2 2 3]));
***** assert (im2int16 (uint16 ([0 65535])),  int16 ([-32768 32767]));
***** assert (im2int16 ([false true]),        int16 ([-32768 32767]));
***** assert (im2int16 ([true false]),        int16 ([32767 -32768]));
***** assert (im2int16 (uint8 ([0 127 128 255])), int16 ([-32768 -129 128 32767]));
***** assert (im2int16 ([0 1.4/65535 1.5/65535 2/65535 1]), int16 ([-32768 -32767 -32766 -32766 32767]));
***** assert (im2int16 ([0 0.5 1]),  int16 ([-32768 0 32767]));
***** assert (im2int16 ([-1 0 1 2]), int16 ([-32768 -32768 32767 32767]));
***** error im2int16 ([1 2], "indexed");
9 tests, 9 passed, 0 known failure, 0 skipped
[im2single]
>>>>> /usr/share/octave/packages/image-2.6.1/im2single.m
***** assert (im2single (single ([1 2 3])), single ([1 2 3]));
***** assert (im2single ([1 2 3]), single ([1 2 3]));
***** assert (im2single (uint8 ([0 127 128 255])), single ([0 127/255 128/255 1]));
***** assert (im2single (uint16 ([0 127 128 65535])), single ([0 127/65535 128/65535 1]));
***** assert (im2single (int16 ([-32768 -32767 -32766 32767])), single ([0 1/65535 2/65535 1]));
***** assert (im2single (uint8 ([0 1 255]), "indexed"), single ([1 2 256]));
***** assert (im2single (uint16 ([0 1 2557]), "indexed"), single ([1 2 2558]));
***** assert (im2single ([3 25], "indexed"), single ([3 25]));
***** error <indexed> im2single ([0 1 2], "indexed");
***** error <indexed> im2single (int16 ([17 8]), "indexed");
***** error <indexed> im2single (int16 ([-7 8]), "indexed");
***** error <indexed> im2single ([false true], "indexed");
12 tests, 12 passed, 0 known failure, 0 skipped
[findbounds]
>>>>> /usr/share/octave/packages/image-2.6.1/findbounds.m
***** test
 im = checkerboard ();
 theta = pi/6;
 T = maketform ('affine', [cos(theta) -sin(theta); ...
                           sin(theta) cos(theta); 0 0]);
 inbnd = [0 0; 1 1];
 outbnd = findbounds (T, inbnd);
 diag = 2^.5;
 ang = pi/4;
 assert (diff (outbnd(:,1)), diag * abs (cos (theta - ang)), eps)
 assert (diff (outbnd(:,2)), diag * abs (cos (theta - ang)), eps)
1 test, 1 passed, 0 known failure, 0 skipped
[imclearborder]
>>>>> /usr/share/octave/packages/image-2.6.1/imclearborder.m
***** test
 a = logical ([
    0   1   0   0   1   0   0   0   0   1
    1   0   0   0   0   1   0   0   0   0
    0   1   0   0   0   0   0   0   0   0
    1   0   1   0   1   0   1   0   0   1
    0   0   0   0   0   0   0   1   1   0
    0   0   1   0   0   1   0   1   0   0
    0   1   0   1   0   1   1   0   0   0
    0   0   0   1   0   0   0   0   0   0
    0   0   0   1   0   1   1   0   0   0
    0   0   0   1   1   0   0   0   1   0]);

 a4 = logical ([
    0   0   0   0   0   0   0   0   0   0
    0   0   0   0   0   1   0   0   0   0
    0   1   0   0   0   0   0   0   0   0
    0   0   1   0   1   0   1   0   0   0
    0   0   0   0   0   0   0   1   1   0
    0   0   1   0   0   1   0   1   0   0
    0   1   0   0   0   1   1   0   0   0
    0   0   0   0   0   0   0   0   0   0
    0   0   0   0   0   1   1   0   0   0
    0   0   0   0   0   0   0   0   0   0]);

 a8 = logical ([
    0   0   0   0   0   0   0   0   0   0
    0   0   0   0   0   0   0   0   0   0
    0   0   0   0   0   0   0   0   0   0
    0   0   0   0   1   0   0   0   0   0
    0   0   0   0   0   0   0   0   0   0
    0   0   0   0   0   0   0   0   0   0
    0   0   0   0   0   0   0   0   0   0
    0   0   0   0   0   0   0   0   0   0
    0   0   0   0   0   0   0   0   0   0
    0   0   0   0   0   0   0   0   0   0]);

 assert (imclearborder (a, 4), a4)
 assert (imclearborder (a, [0 1 0; 1 1 1; 0 1 0]), a4)
 assert (imclearborder (a), a8)
 assert (imclearborder (a, 8), a8)
 assert (imclearborder (a, ones (3)), a8)
***** test
 a = false (5, 5, 3);
 a(2:4,2:4,:) = true;
 assert (imclearborder (a, 4), a)

 a(1,2) = true;
 a4 = a;
 a4(:,:,1) = false;
 assert (imclearborder (a, 4), a4)
2 tests, 2 passed, 0 known failure, 0 skipped
[@strel/strel]
>>>>> /usr/share/octave/packages/image-2.6.1/@strel/strel.m
***** test
 shape  = logical ([0 0 0 1]);
 assert (getnhood (strel (shape)), shape);
 assert (getnhood (strel ("arbitrary", shape)), shape);

 height = [0 0 0 3];
 assert (getnhood (strel ("arbitrary", shape, height)), shape);
 assert (getheight (strel ("arbitrary", shape, height)), height);
***** test
 shape = logical ([0 0 1]);
 height = [-2 1 3];  ## this works for matlab compatibility
 assert (getnhood (strel ("arbitrary", shape, height)), shape);
 assert (getheight (strel ("arbitrary", shape, height)), height);
***** test
 shape = logical ([0 0 0 1 0 0 0
                   0 1 1 1 1 1 0
                   0 1 1 1 1 1 0
                   1 1 1 1 1 1 1
                   0 1 1 1 1 1 0
                   0 1 1 1 1 1 0
                   0 0 0 1 0 0 0]);
 height = [ 0.00000   0.00000   0.00000   0.00000   0.00000   0.00000   0.00000
            0.00000   0.33333   0.66667   0.74536   0.66667   0.33333   0.00000
            0.00000   0.66667   0.88192   0.94281   0.88192   0.66667   0.00000
            0.00000   0.74536   0.94281   1.00000   0.94281   0.74536   0.00000
            0.00000   0.66667   0.88192   0.94281   0.88192   0.66667   0.00000
            0.00000   0.33333   0.66667   0.74536   0.66667   0.33333   0.00000
            0.00000   0.00000   0.00000   0.00000   0.00000   0.00000   0.00000];
 assert (getnhood (strel ("ball", 3, 1)), shape);
 assert (getheight (strel ("ball", 3, 1)), height, 0.0001);
***** test
 shape = logical ([0 0 0 1 0 0 0
                   0 0 1 1 1 0 0
                   0 1 1 1 1 1 0
                   1 1 1 1 1 1 1
                   0 1 1 1 1 1 0
                   0 0 1 1 1 0 0
                   0 0 0 1 0 0 0]);
 assert (getnhood (strel ("diamond", 3)), shape);
***** test
 shape = logical ([0 0 0 1 0 0 0
                   0 1 1 1 1 1 0
                   0 1 1 1 1 1 0
                   1 1 1 1 1 1 1
                   0 1 1 1 1 1 0
                   0 1 1 1 1 1 0
                   0 0 0 1 0 0 0]);
 assert (getnhood (strel ("disk", 3, 0)), shape);
***** test
 shape = logical ([1 1 1]);
 assert (getnhood (strel ("line", 3.9, 20.17)), shape);
 shape = logical ([0 0 1
                   0 1 0
                   1 0 0]);
 assert (getnhood (strel ("line", 3.9, 20.18)), shape);
 shape = logical ([1 0 0 0 0 0 0 0 0
                   0 1 0 0 0 0 0 0 0
                   0 0 1 0 0 0 0 0 0
                   0 0 1 0 0 0 0 0 0
                   0 0 0 1 0 0 0 0 0
                   0 0 0 0 1 0 0 0 0
                   0 0 0 0 0 1 0 0 0
                   0 0 0 0 0 0 1 0 0
                   0 0 0 0 0 0 1 0 0
                   0 0 0 0 0 0 0 1 0
                   0 0 0 0 0 0 0 0 1]);
 assert (getnhood (strel ("line", 14, 130)), shape);
***** test
 se = strel ("octagon", 0);
 seq = getsequence (se);
 assert (getnhood (se), true (1));
 assert (getnhood (seq(1)), true (1));

 se = strel ("octagon", 3);
 seq = getsequence (se);
 shape = logical ([0 0 1 1 1 0 0
                   0 1 1 1 1 1 0
                   1 1 1 1 1 1 1
                   1 1 1 1 1 1 1
                   1 1 1 1 1 1 1
                   0 1 1 1 1 1 0
                   0 0 1 1 1 0 0]);
 assert (getnhood (se), shape);
 assert (size (seq), [4 1]);

 templ1 = logical ([0 0 0; 1 1 1; 0 0 0]);
 templ2 = logical ([0 1 0; 0 1 0; 0 1 0]);
 templ3 = logical ([1 0 0; 0 1 0; 0 0 1]);
 templ4 = logical ([0 0 1; 0 1 0; 1 0 0]);
 assert ({getnhood(seq(1)) getnhood(seq(2)) getnhood(seq(3)) getnhood(seq(4))},
         {templ1 templ2 templ3 templ4});

 seq = getsequence (strel ("octagon", 21));
 assert (size (seq), [28 1]);
 assert (arrayfun (@(x) getnhood (seq(x)), 1:4:25, "UniformOutput", false),
         repmat ({templ1}, 1, 7));
 assert (arrayfun (@(x) getnhood (seq(x)), 2:4:26, "UniformOutput", false),
         repmat ({templ2}, 1, 7));
 assert (arrayfun (@(x) getnhood (seq(x)), 3:4:27, "UniformOutput", false),
         repmat ({templ3}, 1, 7));
 assert (arrayfun (@(x) getnhood (seq(x)), 4:4:28, "UniformOutput", false),
         repmat ({templ4}, 1, 7));
***** test
 shape = logical ([1 1 0]');
 assert (getnhood (strel ("pair", [-1 0])), shape);
 shape = logical ([1 0 0 0 0 0 0
                   0 0 0 1 0 0 0
                   0 0 0 0 0 0 0]);
 assert (getnhood (strel ("pair", [-1 -3])), shape);
 shape = logical ([0 0 0 0 0 0 0
                   0 0 0 0 0 0 0
                   0 0 0 1 0 0 0
                   0 0 0 0 0 0 0
                   0 0 0 0 0 0 1]);
 assert (getnhood (strel ("pair", [2 3])), shape);
***** test
 assert (getnhood (strel ("rectangle", [10 5])), true (10, 5));
 assert (getnhood (strel ("square", 5)), true (5));
***** shared se, seq
 se = strel ("square", 5);
 seq = getsequence (se);
 assert (class (se(1)),  "strel")
 assert (class (se(1,1)),"strel")
 assert (class (seq),    "strel")
 assert (class (seq(1)), "strel")
 assert (class (seq(2)), "strel")
 assert (numel (se), 1)
 assert (numel (seq), 2)
 assert (getnhood (seq(1)), true (5, 1))
 assert (getnhood (seq(2)), true (1, 5))
 assert (size (se),  [1 1])
 assert (size (seq), [2 1])
 assert (isscalar (se),  true)
 assert (isscalar (seq), false)
***** error <index out of bounds> se(2);
***** error <index out of bounds> seq(3);
!!!!! error failed.
Expected <index out of bounds>, but got <se(3): out of bound 2>

***** test
 se = strel ("arbitrary", [1 0 0; 1 1 0; 0 1 0], [2 0 0; 3 1 0; 0 3 0]);
 ref = reflect (se);
 assert (getnhood (ref), logical([0 1 0; 0 1 1; 0 0 1]));
 assert (getheight (ref), [0 3 0; 0 1 3; 0 0 2]);
***** error strel()
***** error strel("nonmethodthing", 2)
***** error strel("arbitrary", "stuff")
***** error strel("arbitrary", [0 0 1], [2 0 1; 4 5 1])
***** error strel("arbitrary", [0 0 1], "stuff")
***** error strel("ball", -3, 1)
***** error strel("diamond", -3)
***** error strel("disk", -3)
***** error strel("line", 0, 45)
***** error <positive integer multiple of 3> strel("octagon", 3.5)
***** error <positive integer multiple of 3> strel("octagon", 4)
***** error <positive integer multiple of 3> strel("octagon", -1)
***** error strel("pair", [45 67 90])
***** error strel("rectangle", 2)
***** error strel("rectangle", [2 -5])
***** error strel("square", [34 1-2])
28 tests, 27 passed, 0 known failure, 0 skipped
[imopen]
>>>>> /usr/share/octave/packages/image-2.6.1/imopen.m
***** shared in, out
 in =  [ 0   0   0   1   1   1   0   0   1   1
         0   1   0   1   1   1   0   0   0   1
         1   1   1   1   1   0   0   0   0   0
         0   1   1   1   1   0   0   0   0   0
         0   0   0   1   0   0   0   0   1   0
         0   0   0   0   0   0   0   1   1   1
         0   0   0   0   1   0   1   0   1   0
         0   0   0   1   1   1   1   1   0   0
         0   0   0   0   1   1   1   0   0   0
         0   0   0   1   1   1   0   0   0   0];

 out = [ 0   0   0   1   1   1   0   0   0   0
         0   0   0   1   1   1   0   0   0   0
         0   0   0   0   0   0   0   0   0   0
         0   0   0   0   0   0   0   0   0   0
         0   0   0   0   0   0   0   0   0   0
         0   0   0   0   0   0   0   0   0   0
         0   0   0   0   0   0   0   0   0   0
         0   0   0   0   0   0   0   0   0   0
         0   0   0   0   0   0   0   0   0   0
         0   0   0   0   0   0   0   0   0   0];
***** assert (imopen (logical (in), ones (3)), logical (out));

 out = [80   80    1    8   15   51   51   51   51   40
        80   80    7    8   15   54   55   55   55   40
         4    7    7    8   15   54   55   55   55   40
        17   17   17    7    3   54   55   55   55   28
        17   17   17    2    9   54   54   54   52   33
        17   17   17   29   29   29   29   26   33   33
         5    5   13   29   29   29   30   32   39   39
         6    6   13   29   29   29   30   32   39   39
        10   12   77   77   77   35   35   35   39   39
        10   12   77   77   77   35   35   35   27   27];
***** assert (imopen (magic (10), ones (3)), out);
***** assert (imopen (uint8 (magic (10)), strel ("square", 3)), uint8 (out));

 ## using a se that will be decomposed in 2 pieces
 out =[ 1    1    1    8   15   40   40   40   40   40
        4    4    4    8   15   40   40   40   40   40
        4    4    4    8   15   40   40   40   40   40
        5    5    5    3    3   28   28   28   28   28
        5    5    5    2    9   28   28   28   28   28
        5    5   13   26   26   26   26   26   26   26
        5    5   13   29   29   29   29   29   27   27
        6    6   13   29   29   29   29   29   27   27
        6    6   13   29   29   29   29   29   27   27
        6    6   13   29   29   29   29   29   27   27];
***** assert (imopen (magic (10), ones(5)), out);

 ## using a weird non-symmetric and even-size se
 out =[ 7    7    1    8   15   55   51   51   41   40
        7    7    7    8   16   55   55   55   51   41
        4    9    7    7   16   54   55   54   55   47
       25   25    9    9    3   52   54   52   54   28
       25   24   25    2    9   33   52   34   52   34
       17   24   29   31   29   30   33   26   33   34
       17    5   29   31   31   31   30   32   39   33
       10    6   13   35   35   29   31   32   45   39
       10   12   77   36   36   35   35   31   45   45
       11   12   77   77   77   36   36   35   27   45];
***** assert (imopen (magic (10), [1 0 0 0; 1 1 1 0; 0 1 0 1]), out);
5 tests, 5 passed, 0 known failure, 0 skipped
[bweuler]
>>>>> /usr/share/octave/packages/image-2.6.1/bweuler.m
***** demo
 A=zeros(9,10);
 A([2,5,8],2:9)=1;
 A(2:8,[2,9])=1
 bweuler(A)
 # Euler number (objects minus holes) is 1-2=-1 in an 8-like object
***** test
 A=zeros(10,10);
 A(2:9,3:8)=1;
 A(4,4)=0;
 A(8,8)=0; # not a hole
 A(6,6)=0;
 assert(bweuler(A),-1);
***** test
 A=zeros(10,10);
 A(2:4,2:4)=1;
 A(5:8,5:8)=1;
 assert(bweuler(A,4),2);
 assert(bweuler(A,8),1);
 assert(bweuler(A),1);
***** error <2 dimensions> bweuler (true (5, 5, 1, 5))
3 tests, 3 passed, 0 known failure, 0 skipped
[im2uint16]
>>>>> /usr/share/octave/packages/image-2.6.1/im2uint16.m
***** assert (im2uint16 (uint16 ([1 2 3])), uint16 ([1 2 3]));
***** assert (im2uint16 (uint8 ([0 127 128 255])), uint16 ([0 32639 32896 65535]));
***** assert (im2uint16 ([0 0.5 1]), uint16 ([0 32768 65535]));
***** assert (im2uint16 ([0 1/65535 1.4/65535 1.5/65535 1]), uint16 ([0 1 1 2 65535]));
***** assert (im2uint16 ([1 2]), uint16 ([65535 65535]));
***** assert (im2uint16 ([-1 0 0.5 1]), uint16 ([0 0 32768 65535]));
***** assert (im2uint16 (int16 ([-32768 -1 0 32768])), uint16 ([0 32767 32768 65535]));
***** assert (im2uint16 ([false true]), uint16 ([0 65535]));
***** assert (im2uint16 ([true false]), uint16 ([65535 0]));
***** assert (im2uint16 (uint8 ([3 25]), "indexed"), uint16 ([3 25]));
***** assert (im2uint16 ([1 3 25], "indexed"), uint16 ([0 2 24]));
***** error <indexed> im2uint16 ([0 1 2], "indexed");
***** error <indexed> im2uint16 (int16 ([17 8]), "indexed");
***** error <indexed> im2uint16 (int16 ([-7 8]), "indexed");
***** error <indexed> im2uint16 ([false true], "indexed");
***** error <range of values> im2uint16 (65537, "indexed");
16 tests, 16 passed, 0 known failure, 0 skipped
[imrotate]
>>>>> /usr/share/octave/packages/image-2.6.1/imrotate.m
***** test
 a = reshape (1:18, [2 3 3]);

 a90(:,:,1) = [5 6; 3 4; 1 2];
 a90(:,:,2) = a90(:,:,1) + 6;
 a90(:,:,3) = a90(:,:,2) + 6;

 a180(:,:,1) = [6 4 2; 5 3 1];
 a180(:,:,2) = a180(:,:,1) + 6;
 a180(:,:,3) = a180(:,:,2) + 6;

 am90(:,:,1) = [2 1; 4 3; 6 5];
 am90(:,:,2) = am90(:,:,1) + 6;
 am90(:,:,3) = am90(:,:,2) + 6;

 assert (imrotate (a,    0), a);
 assert (imrotate (a,   90), a90);
 assert (imrotate (a,  -90), am90);
 assert (imrotate (a,  180), a180);
 assert (imrotate (a, -180), a180);
 assert (imrotate (a,  270), am90);
 assert (imrotate (a, -270), a90);
 assert (imrotate (a,  360), a);
1 test, 1 passed, 0 known failure, 0 skipped
[imcomplement]
>>>>> /usr/share/octave/packages/image-2.6.1/imcomplement.m
***** assert (imcomplement (10), -9);
***** assert (imcomplement (single (10)), single (-9));
***** assert (imcomplement (0.2), 0.8);
***** assert (imcomplement (uint8 (0)), uint8 (255));
***** assert (imcomplement (uint8 (1)), uint8 (254));
***** assert (imcomplement (uint16 (0)), uint16 (65535));
***** assert (imcomplement (uint16 (1)), uint16 (65534));
***** assert (imcomplement (int8 (-128)), int8 ( 127));
***** assert (imcomplement (int8 ( 127)), int8 (-128));
***** assert (imcomplement (int16 (-1)), int16 ( 0));
***** assert (imcomplement (int16 ( 0)), int16 (-1));
***** assert (imcomplement (int16 ( 1)), int16 (-2));
***** assert (imcomplement ([true false true]), [false true false])
***** error <must be an image> imcomplement ("not an image")
14 tests, 14 passed, 0 known failure, 0 skipped
[immse]
>>>>> /usr/share/octave/packages/image-2.6.1/immse.m
***** error <same size> immse (rand (10), rand (12))
***** error <same class> immse (uint8 ([0 1 2 3]), uint16 ([0 1 2 3]))
***** error <same class> immse (double ([0 1 2 3]), single ([0 1 2 3]))
***** assert (immse (magic (5), magic (5)), 0)
***** assert (immse (single (magic (5)), single (magic (5))), single (0))
***** assert (immse (uint8 (magic (5)), uint8 (magic (5))), 0)
6 tests, 6 passed, 0 known failure, 0 skipped
[im2uint8]
>>>>> /usr/share/octave/packages/image-2.6.1/im2uint8.m
***** assert (im2uint8 (uint8 ([1 2 3])), uint8 ([1 2 3]));
***** assert (im2uint8 (uint16 ([0 65535])), uint8 ([0 255]));
***** assert (im2uint8 ([0 0.5 1]), uint8 ([0 128 255]));
***** assert (im2uint8 ([1 2]), uint8 ([255 255]));
***** assert (im2uint8 ([-1 0 0.5 1 2]), uint8 ([0 0 128 255 255]));
***** assert (im2uint8 (int16 ([-32768 0 32768])), uint8 ([0 128 255]));
***** assert (im2uint8 ([false true]), uint8 ([0 255]));
***** assert (im2uint8 ([true false]), uint8 ([255 0]));
***** assert (im2uint8 ([1 256], "indexed"), uint8 ([0 255]));
***** assert (im2uint8 ([3 25], "indexed"), uint8 ([2 24]));
***** assert (im2uint8 (uint16 ([3 25]), "indexed"), uint8 ([3 25]));
***** error <indexed> im2uint8 ([0 1 2], "indexed");
***** error <indexed> im2uint8 (int16 ([17 8]), "indexed");
***** error <indexed> im2uint8 (int16 ([-7 8]), "indexed");
***** error <indexed> im2uint8 ([false true], "indexed");
***** error <range of values> im2uint8 (uint16 (256), "indexed");
***** error <range of values> im2uint8 (257, "indexed");
17 tests, 17 passed, 0 known failure, 0 skipped
[rgb2xyz]
>>>>> /usr/share/octave/packages/image-2.6.1/rgb2xyz.m
***** assert (rgb2xyz ([0 0 0]), [0, 0, 0], 1e-3)
***** assert (rgb2xyz ([1 0 0]), [0.4125, 0.2127, 0.0193], 1e-3)
***** assert (rgb2xyz ([1 1 0]), [0.7700, 0.9278, 0.1385], 1e-3)
***** assert (rgb2xyz ([0 1 0]), [0.3576, 0.7152, 0.1192], 1e-3)
***** assert (rgb2xyz ([0 1 1]), [0.5380, 0.7873, 1.0694], 1e-3)
***** assert (rgb2xyz ([0 0 1]), [0.1804, 0.0722, 0.9502], 1e-3)
***** assert (rgb2xyz ([1 0 1]), [0.5929, 0.2848, 0.9696], 1e-3)
***** assert (rgb2xyz ([1 1 1]), [0.9505, 1.0000, 1.0888], 1e-3)
***** assert (rgb2xyz ([0.5 0.5 0.5]), [0.2034, 0.2140, 0.2330], 1e-3)
***** assert (rgb2xyz ([0.75 0 0]), [0.2155, 0.1111, 0.0101], 1e-3)
***** assert (rgb2xyz ([0.5 0 0]), [0.0883, 0.0455, 0.0041], 1e-3)
***** assert (rgb2xyz ([0.25 0 0]), [0.0210, 0.0108, 0.0010], 1e-3)
***** assert (rgb2xyz ([1 0.5 0.5]), [0.5276, 0.3812, 0.2482], 1e-3)
***** assert (rgb2xyz ([1.5 1 1]), [1.5845, 1.3269, 1.1185], 1e-3)
***** test
 rgb_map = rand (64, 3);
 assert (xyz2rgb (rgb2xyz (rgb_map)), rgb_map, 2e-5);
***** test
 rgb_img = rand (64, 64, 3);
 assert (xyz2rgb (rgb2xyz (rgb_img)), rgb_img, 2e-5);
***** assert (rgb2xyz (sparse ([0 0 0])), [0 0 0], 1e-3)
***** assert (rgb2xyz (sparse ([0 0 1])), [0.1804, 0.0722, 0.9502], 1e-3)
***** assert (rgb2xyz (uint8([255 255 255])), [0.9505, 1.0000, 1.0888], 1e-3)
***** assert (class (rgb2xyz (single([1 1 1]))), 'single')
***** error rgb2xyz ()
***** error rgb2xyz (1,2)
***** error <invalid data type 'cell'> rgb2xyz ({1})
***** error <RGB must be a colormap or RGB image> rgb2xyz (ones (2,2))
***** test
 rgb = rand (16, 16, 3, 5);
 xyz = zeros (size (rgb));
 for i = 1:5
   xyz(:,:,:,i) = rgb2xyz (rgb(:,:,:,i));
 endfor
 assert (rgb2xyz (rgb), xyz)
25 tests, 25 passed, 0 known failure, 0 skipped
[bestblk]
>>>>> /usr/share/octave/packages/image-2.6.1/bestblk.m
***** demo
 siz = bestblk ([200; 10], 50);
 disp (siz)
***** error <numeric vector> bestblk ("string")
***** error <positive scalar> bestblk ([100 200], "string")
***** error <2 elements> bestblk ([100], 5)
***** assert (bestblk ([ 10  12],   2), [  2   2]);
***** assert (bestblk ([ 10  12],   3), [  2   3]);
***** assert (bestblk ([300 100], 150), [150 100]);
***** assert (bestblk ([256 128],  17), [ 16  16]);
***** assert (bestblk ([ 17  17],   3), [  3   3]);
***** assert (bestblk ([230 470]), bestblk ([230 470], 100))
***** assert (bestblk ([10 12 10], 3), [2 3 2]);
***** assert (bestblk ([ 9 12  9], 3), [3 3 3]);
***** assert (bestblk ([10 12 10 11], 5), [5 4 5 4]);
12 tests, 12 passed, 0 known failure, 0 skipped
[bwmorph]
>>>>> /usr/share/octave/packages/image-2.6.1/bwmorph.m
***** demo
 bwmorph (true (11), "shrink", Inf)
 # Should return 0 matrix with 1 pixel set to 1 at (6,6)
***** test
 slBW = logical ([  0   0   0   0   0   0   0
                    0   1   0   0   0   0   0
                    0   0   1   1   0   0   0
                    0   0   1   1   0   0   0
                    0   0   1   1   1   0   0
                    0   0   1   1   1   0   0
                    0   1   1   1   1   1   0
                    0   1   1   1   1   1   0
                    0   1   1   1   1   1   0
                    0   1   1   1   1   1   0
                    0   1   1   1   1   1   0
                    0   0   0   0   0   0   0]);

 rslBW = logical ([ 0   0   0   0   0   0   0
                    0   1   0   0   0   0   0
                    0   0   1   1   0   0   0
                    0   0   1   1   0   0   0
                    0   0   0   0   0   0   0
                    0   0   0   1   0   0   0
                    0   0   0   1   0   0   0
                    0   0   0   0   0   0   0
                    0   0   0   1   0   0   0
                    0   0   0   0   0   0   0
                    0   0   0   0   0   0   0
                    0   0   0   0   0   0   0]);
 assert (bwmorph (slBW, "skel-lantuejoul",   1), [rslBW(1:5,:); false(7, 7)]);
 assert (bwmorph (slBW, "skel-lantuejoul",   2), [rslBW(1:8,:); false(4, 7)]);
 assert (bwmorph (slBW, "skel-lantuejoul",   3), rslBW);
 assert (bwmorph (slBW, "skel-lantuejoul", Inf), rslBW);
***** test
 bw = [
   0   1   1   1   1   1
   0   1   1   1   1   1
   0   1   1   1   1   1
   1   1   1   1   1   1
   1   1   1   1   1   1
   1   1   1   1   1   1
   1   1   1   1   1   0
   1   1   1   1   1   0
   1   1   1   1   1   0];

 final = logical ([
   0   1   0   0   0   1
   0   0   1   0   1   0
   0   0   0   1   0   0
   0   0   0   1   0   0
   0   0   1   1   0   0
   0   0   1   0   0   0
   0   0   1   0   0   0
   0   1   0   1   0   0
   1   0   0   0   1   0]);
 assert (bwmorph (bw, "skel", Inf), final)
 assert (bwmorph (bw, "skel", 3), final)
***** error bwmorph ("not a matrix", "dilate")
***** assert (bwmorph (magic (10), "dilate"), imdilate (logical (magic (10)), ones (3)));
***** test
 in = logical ([1  1  0  0  1  0  1  0  0  0  1  1  1  0  1  1  0  1  0  0
                1  1  1  0  1  0  1  1  1  1  0  1  0  1  0  0  0  0  0  0
                0  1  1  1  0  1  1  0  0  0  1  1  0  0  1  1  0  0  1  0
                0  0  0  0  0  1  1  1  1  0  0  1  1  1  1  1  1  0  0  1
                0  1  0  0  1  1  0  1  1  0  0  0  0  0  1  1  0  0  1  0
                0  0  1  1  1  1  1  0  0  1  0  1  1  1  0  0  1  0  0  1
                0  1  1  1  1  1  1  0  1  1  1  0  0  0  1  0  0  1  0  0
                1  0  1  1  1  0  1  1  0  1  0  0  1  1  1  0  0  1  0  0
                1  0  1  1  1  0  1  0  0  1  0  0  1  1  0  0  1  1  1  0
                1  0  1  1  1  1  0  0  0  1  0  0  0  0  0  0  1  1  0  0
                1  1  1  1  1  1  0  1  0  1  0  0  0  0  0  0  1  0  1  1
                0  1  0  1  1  0  0  1  1  1  0  0  0  0  0  0  0  1  0  0
                0  0  1  1  0  1  1  1  1  0  0  1  0  0  0  0  1  0  1  1
                0  0  1  1  0  0  1  1  1  0  0  0  1  1  1  1  0  0  0  0
                0  0  1  0  0  0  0  0  0  1  0  0  1  1  1  1  0  0  0  0
                0  0  0  0  0  0  1  1  1  0  0  0  1  1  1  1  1  0  0  0
                0  1  0  0  0  1  1  0  1  1  0  0  1  1  1  0  1  1  1  1
                1  0  0  1  0  1  1  0  1  0  0  0  0  0  0  1  0  1  1  1
                0  0  1  1  0  1  1  1  1  0  0  0  0  1  1  0  1  1  1  1
                0  1  1  0  0  1  0  0  1  1  0  0  1  0  0  1  0  0  0  1]);
 se = strel ("arbitrary", ones (3));

 assert (bwmorph (in, "dilate"), imdilate (in, se));
 assert (bwmorph (in, "dilate", 3), imdilate (imdilate (imdilate (in, se), se), se));
 assert (bwmorph (in, "bothat"), imbothat (in, se));
 assert (bwmorph (in, "tophat"), imtophat (in, se));
 assert (bwmorph (in, "open"), imopen (in, se));
 assert (bwmorph (in, "close"), imclose (in, se));
***** assert (bwmorph ([1 0 0; 1 0 1; 0 0 1], "bridge"), logical ([1 1 0; 1 1 1; 0 1 1]));
***** assert (bwmorph ([0 0 0; 1 0 1; 0 0 1], "clean"), logical ([0 0 0; 0 0 1; 0 0 1]));
***** assert (bwmorph ([0 0 0; 0 1 0; 0 0 0], "clean"), false (3));
***** assert (bwmorph ([0 1 0; 1 0 0; 0 0 0], "diag"), logical ([1 1 0; 1 1 0; 0 0 0]));
***** test
 in  = logical ([0  1  0  1  0
                 1  1  1  0  1
                 1  0  0  1  0
                 1  1  1  0  1
                 1  1  1  1  1]);
 out = logical ([0  1  0  1  0
                 1  1  1  1  1
                 1  0  0  1  0
                 1  1  1  1  1
                 1  1  1  1  1]);
 assert (bwmorph (in, "fill"), out);
***** assert (bwmorph ([1 1 1; 0 1 0; 1 1 1], "hbreak"), logical ([1 1 1; 0 0 0; 1 1 1]));
***** test
 in  = logical ([0  1  0  0  0
                 1  0  0  1  0
                 1  0  1  0  0
                 1  1  1  1  1
                 1  1  1  1  1]);

 out = logical ([0  1  0  0   0
                 1  0  0  1  0
                 1  0  1  0  0
                 1  1  0  1  1
                 1  1  1  1  1]);
 assert (bwmorph (in, "remove"), out);

 out = logical ([0  1  0  0  0
                 1  0  0  1  0
                 1  0  1  0  0
                 1  1  0  1  1
                 1  1  1  1  1]);
 assert (bwmorph (in, "remove", Inf), out);

 ## tests for spur are failing (matlab incompatible)
 out = logical ([0  1  0  0  0
                 1  0  0  0  0
                 1  0  1  0  0
                 1  1  1  1  1
                 1  1  1  1  1]);
 assert (bwmorph (in, "spur"), out);

 out = logical ([0  1  0  0  0
                 1  0  0  0  0
                 1  0  0  0  0
                 1  1  1  1  1
                 1  1  1  1  1]);
 assert (bwmorph (in, "spur", Inf), out);
!!!!! test failed
ASSERT errors for:  assert (bwmorph (in, "spur"),out)

  Location  |  Observed  |  Expected  |  Reason
   (1,2)          0            1         Abs err 1 exceeds tol 0
***** test
 in = [
   0   0   0   1   0
   1   1   1   1   0
   0   0   1   1   0
   0   0   1   1   0
   0   0   0   1   0];
 out = [
   0   0   0   0   0
   0   1   1   0   0
   0   0   0   1   0
   0   0   0   0   0
   0   0   0   0   0];
 assert (bwmorph (in, "shrink"), logical (out));
!!!!! test failed
ASSERT errors for:  assert (bwmorph (in, "shrink"),logical (out))

  Location  |  Observed  |  Expected  |  Reason
   (2,4)          1            0         Abs err 1 exceeds tol 0
   (3,4)          0            1         Abs err 1 exceeds tol 0
   (4,4)          1            0         Abs err 1 exceeds tol 0
   (5,4)          1            0         Abs err 1 exceeds tol 0
13 tests, 11 passed, 0 known failure, 0 skipped
[mat2gray]
>>>>> /usr/share/octave/packages/image-2.6.1/mat2gray.m
***** assert(mat2gray([1 2 3]), [0 0.5 1]);           # standard use
***** assert(mat2gray(repmat ([1 2; 3 3], [1 1 3])), repmat ([0 0.5; 1 1], [1 1 3])); # setting min and max
***** assert(mat2gray([1 2 3], [2 2]), [1 1 1]);      # equal min and max
***** assert(mat2gray([-1 0 0.5 3], [2 2]), [0 0 0.5 1]);      # equal min and max
***** assert(mat2gray(ones(3*0.5)), ones(3*0.5));      # equal min and max from the image (not set)
***** assert(mat2gray([1 2 3], [3 1]), [1 0.5 0]);    # max and min inverted
***** assert (mat2gray ([-3 -2 -1]), [0 0.5 1])
7 tests, 7 passed, 0 known failure, 0 skipped
[fftconvn]
>>>>> /usr/share/octave/packages/image-2.6.1/fftconvn.m
***** function test_shapes (a, b, precision)
  shapes = {"valid", "same", "full"};
  for i = 1:3
    shape = shapes{i};
    assert (fftconvn (a, b, shape), convn (a, b, shape), precision);
  endfor
  assert (fftconvn (a, b), fftconvn (a, b, "full"));
***** endfunction
***** test test_shapes (randi (255, 100), randi (255, 10), 0.1)
***** test test_shapes (randi (255, 100, 100), randi (255, 10, 10), 0.1)
***** test test_shapes (randi (255, 100, 100, 100), randi (255, 10, 10, 10), 0.1)
***** test test_shapes (randi (255, 100, 50, 20), randi (255, 10, 7), 0.1)
***** test test_shapes (randi (255, 100, 50, 20), randi (255, 10), 0.1)
***** test
 for s = [55 56 57 58]
   test_shapes (randi (255, 200, 200), randi (255, s, s), 0.1)
 endfor
***** test
 for s = [203 204 205 206]
   test_shapes (randi (255, s, s), randi (255, 52, 52), 0.1)
 endfor
***** test test_shapes (randi (255, 100, 100, "uint8"), randi (255, 10, 10, "uint8"), 0.1)
***** test test_shapes (randi (255, 100, 100, "uint8"), randi (255, 10, 10), 0.1)
***** test test_shapes (randi (255, 100, 100, "single"), randi (255, 10, 10, "single"), 0.9)
***** test test_shapes (randi (255, 100, 100, "single"), randi (255, 10, 10), 0.9)
11 tests, 11 passed, 0 known failure, 0 skipped
[imgradient]
>>>>> /usr/share/octave/packages/image-2.6.1/imgradient.m
***** test
 A = [0 1 0
      1 1 1
      0 1 0];

 [gMag, gDir] = imgradient (A);
 assert (gMag,[sqrt(18) 4 sqrt(18); 4 0 4; sqrt(18),4,sqrt(18)]);
 assert (gDir,[-45 -90 -135; -0 -0 -180; 45 90 135]);

 ## the following just test if passing gx and gy separately gets
 ## us the same as the image and method though imgradient
 [gxSobel, gySobel] = imgradientxy (A, "Sobel");
 [gxPrewitt, gyPrewitt] = imgradientxy (A, "Prewitt");
 [gxCd, gyCd] = imgradientxy (A, "CentralDifference");
 [gxId, gyId] = imgradientxy (A, "IntermediateDifference");

 assert (imgradient (A),
         imgradient (gxSobel, gySobel));
 assert (imgradient (A, "Sobel"),
         imgradient (gxSobel, gySobel));
 assert (imgradient (A, "Prewitt"),
         imgradient(gxPrewitt, gyPrewitt));
 assert (imgradient (A, "CentralDifference"),
         imgradient (gxCd, gyCd));
 assert (imgradient (A, "IntermediateDifference"),
         imgradient (gxId, gyId));
1 test, 1 passed, 0 known failure, 0 skipped
[poly2mask]
>>>>> /usr/share/octave/packages/image-2.6.1/poly2mask.m
***** demo
 s = [0:pi/4:2*pi];
 x = cos (s) * 90 + 101;
 y = sin (s) * 90 + 101;
 bw = poly2mask(x, y, 200, 200);
 imshow (bw);
***** demo
 s = [0:2*pi/5:pi*4];
 s = s ([1, 3, 5, 2, 4, 6]);
 x = cos (s) * 90 + 101;
 y = sin (s) * 90 + 101;
 bw = poly2mask (x, y, 200, 200);
 imshow (bw);
***** # Convex polygons
***** shared xs, ys, Rs, xt, yt, Rt
 xs=[3,3,10,10];
 ys=[4,12,12,4];
 Rs=zeros(16,14);
 Rs(5:12,4:10)=1;
 Rs=logical(Rs);
 xt=[1,4,7];
 yt=[1,4,1];
 Rt=[0,0,0,0,0,0,0;
     0,0,1,1,1,1,0;
     0,0,0,1,1,0,0;
     0,0,0,1,0,0,0;
     0,0,0,0,0,0,0];
 Rt=logical(Rt);
***** assert(poly2mask(xs,ys,16,14),Rs);          # rectangle
***** assert(poly2mask(xs,ys,8,7),Rs(1:8,1:7));   # clipped
***** assert(poly2mask(xs-7,ys-8,8,7),Rs(9:16,8:14)); # more clipping
***** assert(poly2mask(xt,yt,5,7),Rt);            # triangle
***** assert(poly2mask(xt,yt,3,3),Rt(1:3,1:3));   # clipped
***** # Concave polygons
***** test
 x=[3,3,5,5,8,8,10,10];
 y=[4,12,12,8,8,11,11,4];
 R=zeros(16,14);
 R(5:12,4:5)=1;
 R(5:8,6:8)=1;
 R(5:11,9:10)=1;
 R=logical(R);
 assert(poly2mask(x,y,16,14), R);
***** # Complex polygons
***** test
 x=[1,5,1,5];
 y=[1,1,4,4];
 R=[0,0,0,0,0,0;
    0,0,1,1,0,0;
    0,0,1,1,0,0;
    0,1,1,1,1,0;
    0,0,0,0,0,0];
 R=logical(R);
 assert(poly2mask(x,y,5,6), R);
7 tests, 7 passed, 0 known failure, 0 skipped
[medfilt2]
>>>>> /usr/share/octave/packages/image-2.6.1/medfilt2.m
***** shared b, f
 b = [ 0  1  2  3
       1  8 12 12
       4 20 24 21
       7 22 25 18];
 f = [ 0  1  2  0
       1  4 12  3
       4 12 20 12
       0  7 20  0];
***** assert (medfilt2 (b), f);

 f = [ 0  1  2  3
       1  8 12 12
       4 20 24 18
       4 20 24 18];
***** assert (medfilt2 (b, true (3, 1)), f);
***** assert (medfilt2 (b, [3 1]), f);

 f = [ 1  8 10 10
       1  8 12 12
       4 20 24 18
       7 20 24 18];
***** assert (medfilt2 (b, [3 1], 10), f);
***** assert (medfilt2 (b, 10, [3 1]), f);

 f = [ 0.5  4.5  7.0  7.5
       2.5 14.0 18.0 15.0
       2.5 14.0 18.0 15.0
       2.0 10.0 12.0  9.0];
***** assert (medfilt2 (b, true (4, 1)), f);
***** assert (medfilt2 (b, [4 1]), f);
7 tests, 7 passed, 0 known failure, 0 skipped
echo Checking CC files ...
warning: function /var/tmp/autopkgtest.ccVgDx/build.jQf/real-tree/inst/private/iscolormap.m shadows a core library function
warning: called from
    /var/tmp/file8moa2S at line 833 column 1
[watershed]
>>>>> /var/tmp/autopkgtest.ccVgDx/build.jQf/real-tree/src/watershed.cc
***** test
 ex = tril (ones (50), -1) + triu (repmat (2, [50 50]), 2);
 ex(1, 1) = 1;
 ex(end, end) = 1;

 in = ones (50);
 in(end,1) = 0;
 in(1,end) = 0;
 assert (watershed (in), ex)
***** test
 ex = tril (ones (49), -1) + triu (repmat (2, [49 49]), 2);
 ex(1, 1) = 1;
 ex(end, end) = 1;

 in = ones (49);
 in(end,1) = 0;
 in(1,end) = 0;
 assert (watershed (in), ex)

 c = (fspecial ('disk', 5) > 0) + 1;
 in(20:30,20:30) = c;
 c = (fspecial ('disk', 4) > 0) + 2;
 in(21:29,21:29) = c;
 assert (watershed (in), ex)
***** test
 ex = tril (ones (49), -1) + triu (repmat (2, [49 49]), 2);
 ex(1:28,1:28) = (tril (ones (28) ,7) + triu (repmat (2, [28 28]), 10));
 ex(1,9) = 1;
 ex(end,end) = 1;
 ex(20:29, 29) = 0;

 in = ones (49);
 in(end,1) = 0;
 in(1,end) = 0;
 c = (fspecial ("disk", 5) > 0) + 1;
 in(1:11,38:48) = c;

 assert (watershed (in), ex)
***** test
 im = [
     3     4     5     6     0
     2     3     4     5     6
     1     2     3     4     5
     0     1     2     3     4
     1     0     1     2     3];

 labeled8 = [
     1     1     1     0     2
     1     1     1     0     0
     1     1     1     1     1
     1     1     1     1     1
     1     1     1     1     1];
 labeled4 = [
     1     1     1     0     3
     1     1     1     0     0
     1     1     0     2     2
     1     0     2     2     2
     0     2     2     2     2];
 labeled_weird = [
     1     1     1     0     2
     1     1     1     1     0
     1     1     1     1     1
     1     1     1     1     1
     1     1     1     1     1];

 assert (watershed (im), labeled8);
 assert (watershed (im, 8), labeled8);
 assert (watershed (im, 4), labeled4);
 assert (watershed (im, [1 1 0; 1 1 1; 0 1 1]), labeled_weird);
***** test
 im = [
     2     3    30     2
     3    30     3    30
   255    31    30     4
     2   255    31    30
     1     2   255     5];

 labeled4 = [
     1     1     0     4
     1     0     3     0
     0     2     0     5
     2     2     2     0
     2     2     0     6];
 labeled_weird = [
     1     1     0     3
     1     1     1     0
     0     1     1     1
     2     0     0     0
     2     2     0     4];

 assert (watershed (im, 4), labeled4);
 assert (watershed (im, [1 1 0; 1 1 1; 0 1 1]), labeled_weird);
***** test
 im = [
     2     3    30     2
     3    30     3    30
   255    31    30     4
     2   255    31    30
     1     2   255     5];

 labeled8 = [
     1     1     0     3
     1     1     0     3
     0     0     0     0
     2     2     0     4
     2     2     0     4];
 assert (watershed (im), labeled8);
 assert (watershed (im, 8), labeled8);
!!!!! test failed
ASSERT errors for:  assert (watershed (im),labeled8)

  Location  |  Observed  |  Expected  |  Reason
   (3,4)          3            0         Abs err 3 exceeds tol 0
   (4,4)          0            4         Abs err 4 exceeds tol 0
***** test
 im = [
    2    2    2    2    2    2    2
    2    2   30   30   30    2    2
    2   30   20   20   20   30    2
   40   40   20   20   20   40   40
    1   40   20   20   20   40    0
    1    1   40   20   40    0    0
    1    1    1   20    0    0    0];

 labeled8 = [
    1    1    1    1    1    1    1
    1    1    1    1    1    1    1
    1    1    1    1    1    1    1
    0    0    0    0    0    0    0
    2    2    2    0    3    3    3
    2    2    2    0    3    3    3
    2    2    2    0    3    3    3];
 labeled4 = [
    1    1    1    1    1    1    1
    1    1    1    1    1    1    1
    1    1    1    1    1    1    1
    0    1    1    1    1    1    0
    2    0    1    1    1    0    3
    2    2    0    1    0    3    3
    2    2    2    0    3    3    3];
 labeled_weird = [
    1    1    1    1    1    1    1
    1    1    1    1    1    1    1
    1    1    1    1    1    1    1
    0    1    1    0    0    0    0
    2    0    0    0    3    3    3
    2    2    0    3    3    3    3
    2    2    2    0    3    3    3];

 assert (watershed (im), labeled8);
 assert (watershed (im, 8), labeled8);
 assert (watershed (im, 4), labeled4);
 assert (watershed (im, [1 1 0; 1 1 1; 0 1 1]), labeled_weird);
***** test
 im = [
   40   40   40   40   40   40   40   40   40   40   40   40   40
   40    3    3    5    5    5   10   10   10   10   15   20   40
   40    3    3    5    5   30   30   30   10   15   15   20   40
   40    3    3    5   30   20   20   20   30   15   15   20   40
   40   40   40   40   40   20   20   20   40   40   40   40   40
   40   10   10   10   40   20   20   20   40   10   10   10   40
   40    5    5    5   10   40   20   40   10   10    5    5   40
   40    1    3    5   10   15   20   15   10    5    1    0   40
   40    1    3    5   10   15   20   15   10    5    1    0   40
   40   40   40   40   40   40   40   40   40   40   40   40   40];

 labeled8 = [
    1    1    1    1    1    1    1    1    1    1    1    1    1
    1    1    1    1    1    1    1    1    1    1    1    1    1
    1    1    1    1    1    1    1    1    1    1    1    1    1
    1    1    1    1    1    1    1    1    1    1    1    1    1
    0    0    0    0    0    0    0    0    0    0    0    0    0
    2    2    2    2    2    2    0    3    3    3    3    3    3
    2    2    2    2    2    2    0    3    3    3    3    3    3
    2    2    2    2    2    2    0    3    3    3    3    3    3
    2    2    2    2    2    2    0    3    3    3    3    3    3
    2    2    2    2    2    2    0    3    3    3    3    3    3];
 labeled4 = [
    1    1    1    1    1    1    1    1    1    1    1    1    1
    1    1    1    1    1    1    1    1    1    1    1    1    1
    1    1    1    1    1    1    1    1    1    1    1    1    1
    1    1    1    1    1    1    1    1    1    1    1    1    1
    0    0    0    0    1    1    1    1    1    0    0    0    0
    2    2    2    2    0    1    1    1    0    3    3    3    3
    2    2    2    2    2    0    1    0    3    3    3    3    3
    2    2    2    2    2    2    0    3    3    3    3    3    3
    2    2    2    2    2    2    0    3    3    3    3    3    3
    2    2    2    2    2    2    0    3    3    3    3    3    3];
 labeled_weird = [
    1    1    1    1    1    1    1    1    1    1    1    1    1
    1    1    1    1    1    1    1    1    1    1    1    1    1
    1    1    1    1    1    1    1    1    1    1    1    1    1
    1    1    1    1    1    1    1    1    1    1    1    1    1
    0    0    0    0    1    1    0    0    0    0    0    0    0
    2    2    2    2    0    0    0    3    3    3    3    3    3
    2    2    2    2    2    0    3    3    3    3    3    3    3
    2    2    2    2    2    2    0    3    3    3    3    3    3
    2    2    2    2    2    2    0    3    3    3    3    3    3
    2    2    2    2    2    2    0    3    3    3    3    3    3];

 assert (watershed (im), labeled8);
 assert (watershed (im, 8), labeled8);
 assert (watershed (im, 4), labeled4);
 assert (watershed (im, [1 1 0; 1 1 1; 0 1 1]), labeled_weird);
***** test
 im_full = [
   1   2  10   3   8   7   5
   3   2   5  10   8   1   4
   1   8   2   3   8   3   6];

 matlab_result_full = [
   1   1   0   3   0   4   4
   0   0   0   0   0   4   4
   2   2   2   0   4   4   4];

 assert (watershed (im_crop), matlab_result_crop);

 im_crop = [
       2  10   3   8   7   5
       2   5  10   8   1   4
       8   2   3   8   3   6];

 matlab_result_crop = [
       1   0   2   0   3   3
       1   0   0   0   3   3
       1   1   1   0   3   3];

 assert (watershed (im_crop), matlab_result_crop);
!!!!! test failed
'im_crop' undefined near line 13 column 21
9 tests, 7 passed, 0 known failure, 0 skipped
[graycomatrix]
>>>>> /var/tmp/autopkgtest.ccVgDx/build.jQf/real-tree/src/graycomatrix.cc
***** shared a
***** test
  a = [0 0 0 1 2;
       1 1 0 1 1;
       2 2 1 0 0;
       1 1 0 2 0;
       0 0 1 0 1];
  squeeze(graycomatrix(a, 3, 1, -pi/4)) == [4 2 0;
                                     2 3 2;
                                     1 2 0];

***** assert(size(graycomatrix(a, 3, 1:5, [0:3]*-pi/4)), [3, 3, 5, 4])
***** demo

  # Pattern Recognition Engineering (Nadler & Smith)
  # Digital Image Processing (Gonzales & Woods), p. 668

  a = [0 0 0 1 2;
       1 1 0 1 1;
       2 2 1 0 0;
       1 1 0 2 0;
       0 0 1 0 1];

  graycomatrix(a, 3, 1, [0 1]*-pi/4)

2 tests, 2 passed, 0 known failure, 0 skipped
[imreconstruct]
>>>>> /var/tmp/autopkgtest.ccVgDx/build.jQf/real-tree/src/imreconstruct.cc
***** function recon = parallel_reconstruction (marker, mask,
                                          conn = conndef (ndims (marker), "maximal"))
  do
    previous = marker;
    marker = imdilate (marker, conn);
    ## FIXME https://savannah.gnu.org/bugs/index.php?43712
    if (strcmp (class (marker), "logical"))
      marker = marker & mask;
    else
      marker = min (marker, mask);
    endif
  until (all ((marker == previous)(:)))
  recon = marker;
***** endfunction
***** test
 for cl = {"int8", "uint8", "int16", "uint16", "int32", "uint32"}
   cl = cl{1};
   a = randi ([intmin(cl) intmax(cl)-30], 100, 100, cl);
   b = a + randi (20, 100, 100, cl);
   assert (imreconstruct (a, b), parallel_reconstruction (a, b))
 endfor
 for cl = {"double", "single"}
   cl = cl{1};
   a = (rand (100, 100, cl) - 0.5) .* 1000;
   b = a + rand (100, 100, cl) * 100;
   assert (imreconstruct (a, b), parallel_reconstruction (a, b))
 endfor
***** test
 for cl = {"int8", "uint8", "int16", "uint16", "int32", "uint32"}
   cl = cl{1};
   a = randi ([intmin(cl) intmax(cl)-30], 100, 100, cl);
   b = a + randi (20, 100, 100, cl);
   c = [0 1 0; 1 1 1; 0 1 0];
   assert (imreconstruct (a, b, c), parallel_reconstruction (a, b, c))
 endfor
***** test
 a = randi (210, 100, 100);
 b = a + randi (20, 100, 100);
 c = ones (3, 1);
 assert (imreconstruct (a, b, c), parallel_reconstruction (a, b, c))
***** test
 a = randi (210, 500, 500, 10, 4);
 b = a + randi (20, 500, 500, 10, 4);
 c = ones (3, 3, 3);
 assert (imreconstruct (a, b, c), parallel_reconstruction (a, b, c))
***** test
 a = randi (210, 500, 500, 10, 4);
 b = a + randi (20, 500, 500, 10, 4);
 c = conndef (4, "minimal");
 assert (imreconstruct (a, b, c), parallel_reconstruction (a, b, c))
***** test
 a = [   0   0   0   0   0   0   0   1   0   0
         0   0   0   0   0   0   0   1   0   0
         1   0   0   0   0   0   0   0   0   0
         0   0   0   0   0   0   0   0   0   0
         0   0   0   0   0   0   0   1   0   0
         0   0   0   0   0   0   1   0   0   0
         0   0   0   0   0   0   0   0   0   0
         0   0   0   0   0   0   0   0   0   0
         0   0   0   0   1   0   0   0   0   0
         0   0   0   0   0   0   0   1   0   0];

 b = [   0   1   0   0   0   0   0   1   1   0
         1   1   0   0   0   1   0   1   1   0
         1   1   0   0   1   0   0   0   0   0
         1   1   0   0   0   1   1   0   0   0
         1   0   0   0   0   0   1   1   0   0
         0   1   0   0   0   0   1   1   0   0
         0   0   0   1   0   0   0   0   0   0
         0   0   0   0   1   1   0   0   0   0
         0   0   0   1   1   0   0   0   0   0
         1   0   0   0   1   0   0   1   0   1];

 c = [   0   1   0   0   0   0   0   1   1   0
         1   1   0   0   0   1   0   1   1   0
         1   1   0   0   1   0   0   0   0   0
         1   1   0   0   0   1   1   0   0   0
         1   0   0   0   0   0   1   1   0   0
         0   1   0   0   0   0   1   1   0   0
         0   0   0   1   0   0   0   0   0   0
         0   0   0   0   1   1   0   0   0   0
         0   0   0   1   1   0   0   0   0   0
         0   0   0   0   1   0   0   1   0   0];
 assert (imreconstruct (logical (a), logical (b)), logical (c));

 c = [   0   1   0   0   0   0   0   1   1   0
         1   1   0   0   0   0   0   1   1   0
         1   1   0   0   0   0   0   0   0   0
         1   1   0   0   0   1   1   0   0   0
         1   0   0   0   0   0   1   1   0   0
         0   0   0   0   0   0   1   1   0   0
         0   0   0   0   0   0   0   0   0   0
         0   0   0   0   1   1   0   0   0   0
         0   0   0   1   1   0   0   0   0   0
         0   0   0   0   1   0   0   1   0   0];
 assert (imreconstruct (logical (a), logical (b), [0 1 0; 1 1 1; 0 1 0]),
         logical (c));
***** test
 do
   b = rand (100, 100, 100) > 0.98;
 until (nnz (b) > 4)
 b = imdilate (b, ones (5, 5, 5));
 a = false (size (b));
 f = find (b);
 a(f(randi (numel (f), 6, 1))) = true;
 assert (imreconstruct (a, b), parallel_reconstruction (a, b))
***** test
 a = randi (200, 100,100, 10, 10);
 b = a + randi (20, 100,100, 10, 10);
 c1 = ones (3, 3, 3);
 c2 = zeros (3, 3, 3, 3);
 c2(:,:,:,2) = c1;
 assert (imreconstruct (a, b, c1), imreconstruct (a, b, c2))
***** error <MARKER must be less or equal than MASK> imreconstruct (randi([5 10], [10 10]), randi([1 5], [10 10]))
9 tests, 9 passed, 0 known failure, 0 skipped
[imerode]
>>>>> /var/tmp/autopkgtest.ccVgDx/build.jQf/real-tree/src/imerode.cc
***** assert (imerode (eye (3), [1]), eye (3));
***** assert (imerode (eye (3), []), Inf (3, 3));
***** test
 im = [0 1 0
       1 1 1
       0 1 0];
 se = [1 0 0
       0 1 0
       0 1 1];
 assert (imerode (im,          se),          [0 1 0; 0 0 0; 0 1 0]);
 assert (imerode (logical(im), se), logical ([0 1 0; 0 0 0; 0 1 0]));
 assert (imerode (im, se, "full"),
                 [  0    0    0    0  Inf
                    1    0    1    0  Inf
                    0    0    0    0    0
                  Inf    0    1    0    1
                  Inf  Inf    0    1    0]);
 assert (imerode (logical(im), se, "full"),
                 logical([0     0     0     0     1
                          1     0     1     0     1
                          0     0     0     0     0
                          1     0     1     0     1
                          1     1     0     1     0]));
***** test
 a = rand ([10 40 15 6 8 5]) > 0.2;
 se = ones ([5 3 7]);

 ## the image is not really indexed but this way it is padded with 1s
 assert (imerode (a, se), colfilt (a, "indexed", size (se), "sliding", @all))

 assert (imerode (a, se, "valid"), convn (a, se, "valid") == nnz (se))
 ## again, we need to pad it ourselves because convn pads with zeros
 b = true (size (a) + [4 2 6 0 0 0]);
 b(3:12, 2:41, 4:18,:,:,:) = a;
 assert (imdilate (b, se, "same"), convn (b, se, "same") > 0)
 b = true (size (a) + [8 4 12 0 0 0]);
 b(5:14, 3:42, 7:21,:,:,:) = a;
 assert (imdilate (b, se, "full"), convn (b, se, "full") > 0)
***** test
 im = [0 0 0 0 0 0 0
       0 0 1 0 1 0 0
       0 0 1 1 0 1 0
       0 0 1 1 1 0 0
       0 0 0 0 0 0 0];
 se = [0 0 0
       0 1 0
       0 1 1];
 out = [0 0 0 0 0 0 0
        0 0 1 0 0 0 0
        0 0 1 1 0 0 0
        0 0 0 0 0 0 0
        0 0 0 0 0 0 0];
 assert (imerode (im, se), out);
 assert (imerode (logical (im), se), logical (out));
 assert (imerode (im, logical (se)), out);
 assert (imerode (logical (im), logical (se)), logical (out));

 # with an even-size SE
 se =  [0 0 0 1
        0 1 0 0
        0 1 1 1];
 out = [0 0 0 0 0 0 0
        0 0 0 0 0 0 0
        0 0 1 0 0 0 0
        0 0 0 0 0 0 0
        0 0 0 0 0 0 0];
 assert (imerode (im, se), out);
 out = [ 0 0 0 0 1 0 1
        0 0 1 0 1 1 0
        0 0 1 1 1 1 1
        0 0 1 1 1 1 1
        0 0 1 1 1 1 1];
 assert (imdilate (im, se), out);
***** test
 a = [ 82    2   97   43   79   43   41   65   51   11
       60   65   21   56   94   77   36   38   75   39
       32   68   78    1   16   75   76   90   81   56
       43   90   82   41   36    1   87   19   18   63
       63   64    2   48   18   43   38   25   22   99
       12   46   90   79    3   92   39   79   10   22
       38   98   11   10   40   90   88   38    4   76
       54   37    9    4   33   98   36   47   53   57
       38   76   82   50   14   74   64   99    7   33
       88   96   41   62   84   89   97   23   41    3];

 domain = ones (3);
 out = [  2    1    1    1   16   36   36   11
         21    1    1    1    1    1   18   18
          2    1    1    1    1    1   18   18
          2    2    2    1    1    1   10   10
          2    2    2    3    3   25    4    4
          9    4    3    3    3   36    4    4
          9    4    4    4   14   36    4    4
          9    4    4    4   14   23    7    3];
 assert (imerode (a, domain, "valid"), out);
 assert (imerode (uint8 (a), domain, "valid"), uint8 (out));
 assert (imerode (uint8 (a), strel ("arbitrary", domain), "valid"), uint8 (out));
 assert (imerode (uint8 (a), strel ("square", 3), "valid"), uint8 (out));

***** ## Test for non-flat strel
 assert (imerode (a, strel ("arbitrary", domain, ones (3)), "valid"), out -1);

 out = [ 97   97   97   94   94   90   90   90
         90   90   94   94   94   90   90   90
         90   90   82   75   87   90   90   99
         90   90   90   92   92   92   87   99
         98   98   90   92   92   92   88   99
         98   98   90   98   98   98   88   79
         98   98   82   98   98   99   99   99
         96   96   84   98   98   99   99   99];
 assert (imdilate (a, domain, "valid"), out);
 assert (imdilate (uint8 (a), domain, "valid"), uint8 (out));

***** ## Test for non-flat strel
 assert (imdilate (a, strel ("arbitrary", domain, ones (3)), "valid"), out +1);

 ## test while using SE that can be decomposed and an actual sequence
 domain = ones (5);
 out = [   2   1   1   1   1   1  16  11  11  11
           2   1   1   1   1   1   1   1  11  11
           2   1   1   1   1   1   1   1  11  11
           2   1   1   1   1   1   1   1  10  10
           2   1   1   1   1   1   1   1   4   4
           2   2   2   1   1   1   1   1   4   4
           2   2   2   2   2   3   3   4   4   4
           9   4   3   3   3   3   3   3   3   3
           9   4   4   4   4   4   4   3   3   3
           9   4   4   4   4   4   7   3   3   3];
 assert (imerode (a, domain), out);
 assert (imerode (a, strel ("square", 5)), out);
 assert (imerode (a, getsequence (strel ("square", 5))), out);

 ## using a non-symmetric SE
 domain = [ 1 1 0
            0 1 1
            0 1 0];

 out = [  2    2    1   16   36   36   38   39
         60    1    1   16    1   36   19   18
         32    2    1    1    1   19   18   18
          2    2   18    3    1    1   19   10
         46    2    2    3   18   38   10    4
         11    9    4    3    3   36    4    4
          9    4    4   10   36   36   38    4
         37    9    4    4   33   36    7    7];
 assert (imerode (a, domain, "valid"), out);
 assert (imerode (a, strel ("arbitrary", domain, ones (3)), "valid"), out -1);

 out = [ 78   97   56   94   94   90   90   81
         90   82   78   94   87   87   90   90
         90   90   82   43   75   87   90   99
         90   90   79   92   92   87   79   25
         98   90   90   90   92   92   79   79
         98   98   79   98   98   90   88   57
         98   82   50   74   98   99   99   53
         96   82   84   89   98   97   99   99];
 assert (imdilate (a, domain, "valid"), out);
 assert (imdilate (a, strel ("arbitrary", domain, ones (3)), "valid"), out +1);
***** test
 im = reshape (magic(16), [4 8 4 2]);
 se = true (3, 3, 3);
 out = zeros (4, 8, 4, 2);
 out(:,:,1,1) = [
     3   3  46   2   2   2  47  47
     3   3  30   2   2   2  31  31
    17  17  16  16  16  20  13  13
    33  33  16  16  16  36  13  13];
 out(:,:,2,1) = [
     3   3  46   2   2   2  43  43
     3   3  30   2   2   2  27  27
    17  17  12  12  12  20  13  13
    33  33  12  12  12  36  13  13];
 out(:,:,3,1) = [
     3   3  42   6   6   6  43  43
     3   3  26   6   6   6  27  27
    21  21  12  12  12  20   9   9
    37  37  12  12  12  36   9   9];
 out(:,:,4,1) = [
     7   7  42   6   6   6  43  43
     7   7  26   6   6   6  27  27
    21  21  12  12  12  24   9   9
    37  37  12  12  12  40   9   9];
 out(:,:,1,2) = [
    11  11  38  10  10  10  39  39
    11  11  22  10  10  10  23  23
    25  25   8   8   8  28   5   5
    41  41   8   8   8  44   5   5];
 out(:,:,2,2) = [
    11  11  38  10  10  10  35  35
    11  11  22  10  10  10  19  19
    25  25   4   4   4  28   5   5
    41  41   4   4   4  44   5   5];
 out(:,:,3,2) = [
    11  11  34  14  14  14  35  35
    11  11  18  14  14  14  19  19
    29  29   4   4   4  28   1   1
    45  45   4   4   4  44   1   1];
 out(:,:,4,2) = [
    15  15  34  14  14  14  35  35
    15  15  18  14  14  14  19  19
    29  29   4   4   4  32   1   1
    45  45   4   4   4  48   1   1];
 assert (imerode (im, se), out);
 assert (imerode (uint16 (im), se), uint16 (out));

 ## trying a more weird SE
 se(:,:,1) = [1 0 1; 0 1 1; 0 0 0];
 se(:,:,3) = [1 0 1; 0 1 1; 0 0 1];
 out(:,:,1,1) = [
    3  17  46   2   2   2  47  47
   17   3  30   2   2   2  31  31
   17  17  16  16  16  20  13  31
   33  33  16  16  16  36  13  13];
 out(:,:,2,1) = [
    3   3  46   2   2  20  43  61
    3   3  30   2  20   2  27  43
   33  17  12  20  20  20  13  13
   51  33  12  12  30  36  13  13];
 out(:,:,3,1) = [
    3  21  42   6   6   6  43  43
   21   3  26   6   6   6  27  27
   21  21  12  12  12  20   9  27
   37  37  12  12  12  36   9   9];
 out(:,:,4,1) = [
    7   7  42   6   6  24  57  57
    7   7  26   6  24   6  43  43
   37  21  26  24  24  24   9   9
   55  37  12  12  26  40   9   9];
 out(:,:,1,2) = [
   11  25  38  10  10  10  39  39
   25  11  22  10  10  10  23  23
   25  25   8   8   8  28   5  23
   41  41   8   8   8  44   5   5];
 out(:,:,2,2) = [
   11  11  38  10  10  28  35  53
   11  11  22  10  22  10  19  35
   41  25   4  22  22  28   5   5
   59  41   4   4  22  44   5   5];
 out(:,:,3,2) = [
   11  29  34  14  14  14  35  35
   29  11  18  14  14  14  19  19
   29  29   4   4   4  28   1  19
   45  45   4   4   4  44   1   1];
 out(:,:,4,2) = [
   15  15  34  14  14  32  49  49
   15  15  18  14  18  14  35  35
   45  29  18  18  18  32   1   1
   63  45   4   4  18  48   1   1];
 assert (imerode (im, se), out);
 assert (imerode (uint16 (im), se), uint16 (out));
***** error imerode (ones (10), 45)
***** error imerode (ones (10), "some text")
***** error imerode (ones (10), {23, 45})
***** error imerode (rand (10) > 10 , strel ("arbitrary", true (3), ones (3)))
***** test
 a = rand ([10 40 15 6 8 5]) > 0.8;
 se = ones ([5 3 7]);
 assert (imdilate (a, se), convn (a, se, "same") > 0)
 assert (imdilate (a, se, "full"), convn (a, se, "full") > 0)
 assert (imdilate (a, se, "valid"), convn (a, se, "valid") > 0)
 assert (imdilate (a, se), colfilt (a, size (se), "sliding", @any))
***** test
 im = reshape (magic(16), [4 8 4 2]);
 se = true (3, 3, 3);
 out = zeros (4, 8, 4, 2);

 out(:,:,1,1) = [
   256   256   209   253   253   253   212   212
   256   256   225   253   253   253   228   228
   238   238   243   243   243   239   242   242
   222   222   243   243   243   223   242   242];
 out(:,:,2,1) = [
   256   256   213   253   253   253   212   212
   256   256   229   253   253   253   228   228
   238   238   243   243   243   239   246   246
   222   222   243   243   243   223   246   246];
 out(:,:,3,1) = [
   252   252   213   253   253   253   216   216
   252   252   229   253   253   253   232   232
   238   238   247   247   247   235   246   246
   222   222   247   247   247   219   246   246];
 out(:,:,4,1) = [
   252   252   213   249   249   249   216   216
   252   252   229   249   249   249   232   232
   234   234   247   247   247   235   246   246
   218   218   247   247   247   219   246   246];
 out(:,:,1,2) = [
   248   248   217   245   245   245   220   220
   248   248   233   245   245   245   236   236
   230   230   251   251   251   231   250   250
   214   214   251   251   251   215   250   250];
 out(:,:,2,2) = [
   248   248   221   245   245   245   220   220
   248   248   237   245   245   245   236   236
   230   230   251   251   251   231   254   254
   214   214   251   251   251   215   254   254];
 out(:,:,3,2) = [
   244   244   221   245   245   245   224   224
   244   244   237   245   245   245   240   240
   230   230   255   255   255   227   254   254
   214   214   255   255   255   211   254   254];
 out(:,:,4,2) = [
   244   244   221   241   241   241   224   224
   244   244   237   241   241   241   240   240
   226   226   255   255   255   227   254   254
   210   210   255   255   255   211   254   254];
 assert (imdilate (im, se), out);
 assert (imdilate (uint16 (im), se), uint16 (out));

 ## trying a more weird SE
 se(:,:,1) = [1 0 1; 0 1 1; 0 0 0];
 se(:,:,3) = [1 0 1; 0 1 1; 0 0 1];
 out(:,:,1,1) = [
  256   256   209   239   253   253   212   194
  256   256   225   239   239   239   228   212
  222   222   243   239   243   239   242   242
  208   208   225   243   243   223   242   242];
 out(:,:,2,1) = [
  256   256   213   253   253   253   212   212
  238   256   229   253   253   253   228   228
  238   238   243   243   243   239   246   228
  222   222   243   243   243   223   228   246];
 out(:,:,3,1) = [
  252   252   213   235   253   253   216   198
  252   252   229   235   235   253   232   216
  222   238   247   235   247   235   246   246
  204   222   229   247   247   219   246   246];
 out(:,:,4,1) = [
  252   252   213   249   249   249   216   216
  234   252   229   249   249   249   232   232
  234   234   247   247   247   235   246   232
  218   218   247   247   247   219   232   246];
 out(:,:,1,2) = [
  248   248   217   231   245   245   220   202
  248   248   233   233   233   231   236   220
  214   214   251   233   251   231   250   250
  200   200   233   251   251   215   250   250];
 out(:,:,2,2) = [
  248   248   221   245   245   245   220   220
  230   248   237   245   245   245   236   236
  230   230   251   251   251   231   254   236
  214   214   251   251   251   215   236   254];
 out(:,:,3,2) = [
  244   244   221   227   245   245   224   206
  244   244   237   237   237   245   240   224
  214   230   255   237   255   227   254   254
  196   214   237   255   255   211   254   254];
 out(:,:,4,2) = [
  244   244   221   241   241   241   224   224
  226   244   237   241   241   241   240   240
  226   226   255   255   255   227   254   240
  210   210   255   255   255   211   240   254];
 assert (imdilate (im, se), out);
 assert (imdilate (uint16 (im), se), uint16 (out));
***** test    # scalar blank SE
 se = 0;
 assert (imerode (5, se), Inf)
 assert (imerode (true, se), true)
 assert (imerode (false, se), true)
 assert (imerode (uint8 (3), se), uint8 (255))

 assert (imdilate (5, se), -Inf)
 assert (imdilate (true, se), false)
 assert (imdilate (false, se), false)
 assert (imdilate (uint8 (3), se), uint8 (0))
***** test    # empty SE
 se = [];
 assert (imerode (5, se), Inf)
 assert (imerode (true, se), true)
 assert (imerode (false, se), true)
 assert (imerode (uint8 (3), se), uint8 (255))

 assert (imdilate (5, se), -Inf)
 assert (imdilate (true, se), false)
 assert (imdilate (false, se), false)
 assert (imdilate (uint8 (3), se), uint8 (0))
***** test    # non-scalar blank SE
 se = zeros (3, 3);
 assert (imerode (5, se), Inf)
 assert (imerode (true, se), true)
 assert (imerode (false, se), true)
 assert (imerode (uint8 (3), se), uint8 (255))

 assert (imdilate (5, se), -Inf)
 assert (imdilate(true, se), false)
 assert (imdilate (false, se), false)
 assert (imdilate (uint8 (3), se), uint8 (0))
***** test    # erode only with out-of-border elements
 se = [1 1 1; 1 0 1; 1 1 1];
 assert (imerode (5, se), Inf)
 assert (imerode (true, se), true)

 assert (imdilate (5, se), -Inf)
 assert (imdilate (true, se), false)
***** test    # only true elements of SE are out-of-border
 se = [0 0 0; 1 0 0; 1 1 0];
 assert (imerode (zeros (3), se), [0 0 0; 0 0 0; Inf 0 0])
 assert (imerode (false (3), se), logical ([0 0 0; 0 0 0; 1 0 0]))
 assert (imdilate (zeros (3), se), [0 0 -Inf; 0 0 0; 0 0 0])
 assert (imdilate (false (3), se), false (3, 3))

 se = [0 0 0; 0 0 0; 1 1 1];
 assert (imerode (zeros (3, 3), se), [0 0 0; 0 0 0; Inf Inf Inf])
 assert (imerode (false (3, 3), se), logical ([0 0 0; 0 0 0; 1 1 1]))
 assert (imdilate (zeros (3, 3), se), [-Inf -Inf -Inf; 0 0 0; 0 0 0])
 assert (imdilate (false (3, 3), se), false (3, 3))
***** test  # only true elements of even-sized SE are out-of-border
 se = logical ([0 1; 1 1]);
 assert (imerode (false (3, 3), se), logical ([0 0 0; 0 0 0; 0 0 1]))
 assert (imerode (zeros (3, 3), se), [0 0 0; 0 0 0; 0 0 Inf])

 assert (imdilate (false (3, 3), se), false (3, 3))
 assert (imdilate (zeros (3, 3), se), [-Inf 0 0; 0 0 0; 0 0 0])
19 tests, 19 passed, 0 known failure, 0 skipped
[intlut]
>>>>> /var/tmp/autopkgtest.ccVgDx/build.jQf/real-tree/src/intlut.cc
***** assert (intlut (uint8  (1:4), uint8  (  255:-1:0)), uint8  (254:-1:251));
***** assert (intlut (uint16 (1:4), uint16 (65535:-1:0)), uint16 (65534:-1:65531));
***** assert (intlut (int16  (1:4), int16  (32767:-1:-32768)), int16 (-2:-1:-5));
***** assert (intlut (uint8 (255), uint8 (0:255)), uint8 (255));
***** assert (intlut (uint16 (65535), uint16 (0:65535)), uint16 (65535));
***** assert (intlut (int16 (32767), int16 (-32768:32767)), int16 (32767));
***** error intlut ()
***** error intlut ("text")
***** error <must be of same class> intlut (1:20, uint8 (0:255));
***** error <must be of same class> intlut (uint16 (1:20), uint8 (0:255));
***** error <must have 256 elements> intlut (uint8 (1:20), uint8 (0:200));
***** error <must have 65536 elements> intlut (uint16 (1:20), uint16 (0:500));
 error <LUST must be a vector> intlut (uint8 (56), uint8 (magic (16) -1))
12 tests, 12 passed, 0 known failure, 0 skipped
[bwconncomp]
>>>>> /var/tmp/autopkgtest.ccVgDx/build.jQf/real-tree/src/bwconncomp.cc
***** test
 a = rand (10) > 0.5;
 cc = bwconncomp (a, 4);
 assert (cc.Connectivity, 4)
 assert (cc.ImageSize, [10 10])

 b = false (10);
 for i = 1:numel (cc.PixelIdxList)
   b(cc.PixelIdxList{i}) = true;
 endfor
 assert (a, b)
***** test
 a = rand (10, 13) > 0.5;
 cc = bwconncomp (a, 4);
 assert (cc.ImageSize, [10 13])

 b = false (10, 13);
 for i = 1:numel (cc.PixelIdxList)
   b(cc.PixelIdxList{i}) = true;
 endfor
 assert (a, b)
***** test
 a = rand (15) > 0.5;
 conn_8 = bwconncomp (a, 8);
 assert (conn_8, bwconncomp (a))
 assert (conn_8, bwconncomp (a, ones (3)))
 assert (conn_8.Connectivity, 8)
 assert (bwconncomp (a, ones (3)).Connectivity, 8)
 assert (bwconncomp (a, [0 1 0; 1 1 1; 0 1 0]).Connectivity, 4)
***** test
 a = rand (40, 40) > 0.2;
 cc = bwconncomp (a, 4);
 assert (rows (cc.PixelIdxList), 1)
 assert (columns (cc.PixelIdxList) > 1)
***** assert (bwconncomp (false (5)), struct ("ImageSize", [5 5], "NumObjects", 0,
                                        "PixelIdxList", {cell(1, 0)},
                                        "Connectivity", 8))
***** test
 in = [ 0   0   1   0   0   1   0   1   0   0
        0   0   1   0   0   0   0   0   1   1
        1   0   0   0   0   1   1   0   0   0
        1   0   0   0   1   0   0   0   0   0
        1   1   1   1   0   0   0   0   0   1
        0   1   0   1   1   0   0   1   0   0
        1   0   0   0   1   0   0   0   0   0
        0   0   0   1   1   0   0   1   0   0
        0   1   0   1   1   0   0   1   1   0
        0   1   0   1   1   1   0   0   1   0];
 assert (bwareaopen (in, 1, 4), logical (in))

 out = [0   0   0   0   0   0   0   0   0   0
        0   0   0   0   0   0   0   0   0   0
        1   0   0   0   0   0   0   0   0   0
        1   0   0   0   0   0   0   0   0   0
        1   1   1   1   0   0   0   0   0   0
        0   1   0   1   1   0   0   0   0   0
        0   0   0   0   1   0   0   0   0   0
        0   0   0   1   1   0   0   0   0   0
        0   0   0   1   1   0   0   0   0   0
        0   0   0   1   1   1   0   0   0   0];
 assert (bwareaopen (logical (in), 10, 4), logical (out))
 assert (bwareaopen (in, 10, 4), logical (out))
 assert (bwareaopen (in, 10, [0 1 0; 1 1 1; 0 1 0]), logical (out))

 out = [0   0   0   0   0   0   0   0   0   0
        0   0   0   0   0   0   0   0   0   0
        1   0   0   0   0   1   1   0   0   0
        1   0   0   0   1   0   0   0   0   0
        1   1   1   1   0   0   0   0   0   0
        0   1   0   1   1   0   0   0   0   0
        1   0   0   0   1   0   0   0   0   0
        0   0   0   1   1   0   0   0   0   0
        0   0   0   1   1   0   0   0   0   0
        0   0   0   1   1   1   0   0   0   0];
 assert (bwareaopen (in, 10, 8), logical (out))
 assert (bwareaopen (in, 10, ones (3)), logical (out))
 assert (bwareaopen (in, 10), logical (out))

 out = [0   0   0   0   0   0   0   0   0   0
        0   0   0   0   0   0   0   0   0   0
        1   0   0   0   0   0   0   0   0   0
        1   0   0   0   0   0   0   0   0   0
        1   1   1   1   0   0   0   0   0   0
        0   1   0   1   1   0   0   0   0   0
        0   0   0   0   1   0   0   0   0   0
        0   0   0   1   1   0   0   1   0   0
        0   0   0   1   1   0   0   1   1   0
        0   0   0   1   1   1   0   0   1   0];
 assert (bwareaopen (in, 4, [1 1 0; 1 1 1; 0 1 1]), logical (out))
***** error bwareaopen ("not an image", 78, 8)
***** error bwareaopen (rand (10) > 0.5, 10, 100)
***** error bwareaopen (rand (10) > 0.5, 10, "maximal")
***** error bwareaopen (rand (10) > 0.5, 10, [1 1 1; 0 1 1; 0 1 0])
10 tests, 10 passed, 0 known failure, 0 skipped
[hough_line]
>>>>> /var/tmp/autopkgtest.ccVgDx/build.jQf/real-tree/src/hough_line.cc
***** test
 I = zeros(100, 100);
 I(1,1) = 1; I(100,100) = 1; I(1,100) = 1; I(100, 1) = 1; I(50,50) = 1;
 [J, R] = houghtf(I); J = J / max(J(:));
 assert(size(J) == [length(R) 181]);

***** demo
 I = zeros(100, 150);
 I(30,:) = 1; I(:, 65) = 1; I(35:45, 35:50) = 1;
 for i = 1:90, I(i,i) = 1;endfor
 I = imnoise(I, 'salt & pepper');
 imshow(I);
 J = houghtf(I); J = J / max(J(:));
 imshow(J, bone(128), 'truesize');
1 test, 1 passed, 0 known failure, 0 skipped
[__spatial_filtering__]
>>>>> /var/tmp/autopkgtest.ccVgDx/build.jQf/real-tree/src/__spatial_filtering__.cc
***** shared a, domain, s, out
 a = [ 82    2   97   43   79   43   41   65   51   11
       60   65   21   56   94   77   36   38   75   39
       32   68   78    1   16   75   76   90   81   56
       43   90   82   41   36    1   87   19   18   63
       63   64    2   48   18   43   38   25   22   99
       12   46   90   79    3   92   39   79   10   22
       38   98   11   10   40   90   88   38    4   76
       54   37    9    4   33   98   36   47   53   57
       38   76   82   50   14   74   64   99    7   33
       88   96   41   62   84   89   97   23   41    3];

 domain = ones  (3);
 s      = zeros (3);

 out = [  2    1    1    1   16   36   36   11
         21    1    1    1    1    1   18   18
          2    1    1    1    1    1   18   18
          2    2    2    1    1    1   10   10
          2    2    2    3    3   25    4    4
          9    4    3    3    3   36    4    4
          9    4    4    4   14   36    4    4
          9    4    4    4   14   23    7    3];
***** assert (__spatial_filtering__ (a, domain, "min", s), out);
***** assert (__spatial_filtering__ (a, domain, "ordered", s, 1), out);

 out = [ 97   97   97   94   94   90   90   90
         90   90   94   94   94   90   90   90
         90   90   82   75   87   90   90   99
         90   90   90   92   92   92   87   99
         98   98   90   92   92   92   88   99
         98   98   90   98   98   98   88   79
         98   98   82   98   98   99   99   99
         96   96   84   98   98   99   99   99];
***** assert (__spatial_filtering__ (a, domain, "max", s), out);
***** assert (__spatial_filtering__ (a, domain, "ordered", s, nnz (domain)), out);

 out = [ 60   43   43   43   43   43   51   51
         60   56   36   36   36   38   38   39
         63   48   18   18   36   38   25   25
         46   48   36   36   36   38   22   22
         38   46   11   40   39   39   25   22
         37   11   10   33   39   47   38   38
         38   11   11   33   40   64   38   38
         41   41   33   50   64   64   41   33];
***** assert (__spatial_filtering__ (a, domain, "ordered", s, 4), out);

 out = [ 31.223   33.788   35.561   31.011   26.096   20.630   20.403   24.712
         23.428   29.613   32.376   34.002   33.593   32.470   29.605   26.333
         27.834   32.890   29.903   24.207   30.083   32.497   31.898   32.600
         32.027   28.995   33.530   31.002   32.241   32.004   27.501   32.070
         34.682   36.030   33.046   33.745   32.509   27.352   28.607   34.180
         32.709   37.690   32.992   40.036   34.456   26.656   27.685   26.863
         30.971   36.227   25.775   34.873   29.917   25.269   32.292   30.410
         29.135   31.626   30.056   33.594   30.814   28.853   30.917   29.120];
***** assert (__spatial_filtering__ (a, domain, "std", s), out, 0.001);

 out = [ 95   96   96   93   78   54   54   79
         69   89   93   93   93   89   72   72
         88   89   81   74   86   89   72   81
         88   88   88   91   91   91   77   89
         96   96   88   89   89   67   84   95
         89   94   87   95   95   62   84   75
         89   94   78   94   84   63   95   95
         87   92   80   94   84   76   92   96];
***** assert (__spatial_filtering__ (a, domain, "range", s), out);

 domain = [ 1 1 0
            0 1 1
            0 1 0];

 out = [  2    2    1   16   36   36   38   39
         60    1    1   16    1   36   19   18
         32    2    1    1    1   19   18   18
          2    2   18    3    1    1   19   10
         46    2    2    3   18   38   10    4
         11    9    4    3    3   36    4    4
          9    4    4   10   36   36   38    4
         37    9    4    4   33   36    7    7];
***** assert (__spatial_filtering__ (a, domain, "min", s), out);
***** assert (__spatial_filtering__ (a, domain, "ordered", s, 1), out);

 out = [ 82   97   97   94   79   76   90   81
         90   82   56   94   94   90   90   81
         90   82   78   36   87   87   90   90
         90   90   82   43   92   87   87   99
         98   90   79   92   92   88   79   25
         98   90   90   90   98   92   79   79
         98   98   50   98   98   90   99   57
         96   82   62   84   98   99   99   53];
***** assert (__spatial_filtering__ (a, domain, "max", s), out);
***** assert (__spatial_filtering__ (a, domain, "ordered", s, nnz (domain)), out);

 out = [ 68   78   94   79   77   43   75   75
         78   78   41   75   77   87   81   75
         82   78   48   18   75   76   76   81
         64   90   79   41   43   39   79   22
         90   79   48   48   90   79   38   22
         46   46   79   79   92   88   47   76
         76   82   33   40   90   88   88   53
         82   50   50   74   89   98   47   47];
***** assert (__spatial_filtering__ (a, domain, "ordered", s, 4), out);

 out = [ 34.2389   39.2772   39.6699   31.6812   20.7364   16.5439   22.2419   17.2395
         11.9248   36.3084   21.6217   30.8350   36.4047   21.6726   30.9144   26.1017
         22.2980   33.2746   27.5808   14.5017   36.8890   29.0259   34.6020   33.2521
         32.2490   37.9579   26.9685   17.1959   32.5346   31.3847   33.5976   36.8280
         21.3354   40.1833   34.0044   33.9882   32.9894   24.1102   25.6613    9.0995
         35.4641   35.3794   39.0871   35.4753   39.9775   28.7193   26.7451   35.6553
         35.2179   45.3398   19.3210   35.2987   28.4042   24.0832   26.8421   25.0539
         23.4307   26.2812   26.3287   35.6959   25.2646   28.1016   34.9829   17.9221];
***** assert (__spatial_filtering__ (a, domain, "std", s), out, 0.001);

 out = [ 80   95   96   78   43   40   52   42
         30   81   55   78   93   54   71   63
         58   80   77   35   86   68   72   72
         88   88   64   40   91   86   68   89
         52   88   77   89   74   50   69   21
         87   81   86   87   95   56   75   75
         89   94   46   88   62   54   61   53
         59   73   58   80   65   63   92   46];
***** assert (__spatial_filtering__ (a, domain, "range", s), out);

 s = [  1  -3   4
        6  -7   2
       -1   3  -5];

 out = [ -1    3    4   19   38   29   31   41
         61    3   -6    9    4   33   22   21
         33    5   -2    2   -6   21   12   11
          4   -5   20    6   -2    2   16   13
         39   -1    3   -4   19   32   12    3
         13    4    3    0    4   36    6   -3
         11    2   -3   11   38   29   35    1
         34    6    1    5   34   33    9    0];
***** assert (__spatial_filtering__ (a, domain, "min", s), out);
***** assert (__spatial_filtering__ (a, domain, "ordered", s, 1), out);

 out = [  83    94    98    87    80    79    93    84
          93    85    53    91    95    92    83    74
          84    75    79    29    89    80    87    91
          87    93    83    45    95    84    88   101
         101    83    72    94    93    91    72    26
          91    87    91    92   101    93    76    80
          95    99    53   100    91    91   102    59
          99    75    65    87    95   101    92    50];
***** assert (__spatial_filtering__ (a, domain, "max", s), out);
***** assert (__spatial_filtering__ (a, domain, "ordered", s, nnz (domain)), out);

 out = [  71    81    96    79    78    44    77    68
          80    71    44    77    78    90    83    72
          83    75    51    21    72    76    77    78
          57    91    82    42    40    42    82    20
          92    81    45    49    85    81    41    24
          43    47    76    80    90    81    50    78
          79    85    35    37    87    85    89    46
          84    52    43    76    92   100    44    48];
***** assert (__spatial_filtering__ (a, domain, "ordered", s, 4), out);

 out = [ 34.903   40.206   39.885   28.627   20.620   19.248   25.209   17.111
         14.536   35.865   23.221   32.230   34.903   23.923   28.879   22.621
         20.635   30.113   29.351   11.610   38.863   25.936   34.608   34.482
         29.811   40.998   28.279   17.897   34.666   29.978   36.150   38.213
         25.066   39.240   30.013   37.300   31.856   27.428   22.884   10.281
         31.890   34.761   39.645   37.526   39.336   27.031   25.648   39.285
         35.017   47.776   22.764   35.912   25.460   25.636   29.861   24.566
         25.213   25.000   26.391   38.451   24.631   31.305   31.118   20.611];
***** assert (__spatial_filtering__ (a, domain, "std", s), out, 0.001);

 out = [ 84   91   94   68   42   50   62   43
         32   82   59   82   91   59   61   53
         51   70   81   27   95   59   75   80
         83   98   63   39   97   82   72   88
         62   84   69   98   74   59   60   23
         78   83   88   92   97   57   70   83
         84   97   56   89   53   62   67   58
         65   69   64   82   61   68   83   50];
***** assert (__spatial_filtering__ (a, domain, "range", s), out);
21 tests, 21 passed, 0 known failure, 0 skipped
[bwdist]
>>>>> /var/tmp/autopkgtest.ccVgDx/build.jQf/real-tree/src/bwdist.cc
***** shared bw

 bw = [0   1   0   1   0   1   1   0
       0   0   0   1   1   0   0   0
       0   0   0   1   1   0   0   0
       0   0   0   1   1   0   0   0
       0   0   1   1   1   1   1   1
       1   1   1   1   0   0   0   1
       1   1   1   0   0   0   1   0
       0   0   1   0   0   0   1   1];
***** test
 out = [ 1.00000   0.00000   1.00000   0.00000   1.00000   0.00000   0.00000   1.00000
         1.41421   1.00000   1.00000   0.00000   0.00000   1.00000   1.00000   1.41421
         2.23607   2.00000   1.00000   0.00000   0.00000   1.00000   2.00000   2.00000
         2.00000   1.41421   1.00000   0.00000   0.00000   1.00000   1.00000   1.00000
         1.00000   1.00000   0.00000   0.00000   0.00000   0.00000   0.00000   0.00000
         0.00000   0.00000   0.00000   0.00000   1.00000   1.00000   1.00000   0.00000
         0.00000   0.00000   0.00000   1.00000   1.41421   1.00000   0.00000   1.00000
         1.00000   1.00000   0.00000   1.00000   2.00000   1.00000   0.00000   0.00000];
 out = single (out);

 assert (bwdist (bw), out, 0.0001);  # default is euclidean
 assert (bwdist (bw, "euclidean"), out, 0.0001);
 assert (bwdist (logical (bw), "euclidean"), out, 0.0001);
***** test
 out = [ 1   0   1   0   1   0   0   1
         1   1   1   0   0   1   1   1
         2   2   1   0   0   1   2   2
         2   1   1   0   0   1   1   1
         1   1   0   0   0   0   0   0
         0   0   0   0   1   1   1   0
         0   0   0   1   1   1   0   1
         1   1   0   1   2   1   0   0];
 out = single (out);

 assert (bwdist (bw, "chessboard"), out);
***** test
 out = [ 1   0   1   0   1   0   0   1
         2   1   1   0   0   1   1   2
         3   2   1   0   0   1   2   2
         2   2   1   0   0   1   1   1
         1   1   0   0   0   0   0   0
         0   0   0   0   1   1   1   0
         0   0   0   1   2   1   0   1
         1   1   0   1   2   1   0   0];
 out = single (out);

 assert (bwdist (bw, "cityblock"), out);
***** test
 out = [ 1.00000   0.00000   1.00000   0.00000   1.00000   0.00000   0.00000   1.00000
         1.41421   1.00000   1.00000   0.00000   0.00000   1.00000   1.00000   1.41421
         2.41421   2.00000   1.00000   0.00000   0.00000   1.00000   2.00000   2.00000
         2.00000   1.41421   1.00000   0.00000   0.00000   1.00000   1.00000   1.00000
         1.00000   1.00000   0.00000   0.00000   0.00000   0.00000   0.00000   0.00000
         0.00000   0.00000   0.00000   0.00000   1.00000   1.00000   1.00000   0.00000
         0.00000   0.00000   0.00000   1.00000   1.41421   1.00000   0.00000   1.00000
         1.00000   1.00000   0.00000   1.00000   2.00000   1.00000   0.00000   0.00000];
 out = single (out);

 assert (bwdist (bw, "quasi-euclidean"), out, 0.0001);

 bw(logical (bw)) = 3; # there is no actual check if matrix is binary or 0 and 1
 assert (bwdist (bw, "quasi-euclidean"), out, 0.0001);

 bw(logical (bw)) = -2; # anything non-zero is considered object
 assert (bwdist (bw, "quasi-euclidean"), out, 0.0001);
***** test
 bw =    [  1   1   1   1   0   1   1   1   1
            1   1   1   1   0   1   1   1   1
            1   1   0   1   1   1   1   1   1
            0   1   1   1   1   1   1   1   1];

 dist = [   0   0   0   0   1   0   0   0   0
            0   0   0   0   1   0   0   0   0
            0   0   1   0   0   0   0   0   0
            1   0   0   0   0   0   0   0   0];
 dist = single (dist);

 c =    [   1   5   9  13  13  21  25  29  33
            2   6  10  14  14  22  26  30  34
            3   7  10  15  19  23  27  31  35
            8   8  12  16  20  24  28  32  36];
 c = uint32 (c);

 [dout, cout] = bwdist (bw, "euclidean");
 assert (dout, dist)
 assert (cout, c)
***** test
 bw = [  0   1   1   0   0   0   1   0
         0   0   0   0   0   0   0   0
         1   1   0   0   0   0   0   0
         0   0   0   0   0   0   1   0
         0   0   0   0   1   0   0   1
         0   0   0   0   0   0   0   0
         1   0   0   0   0   0   0   0
         0   0   1   0   0   1   1   0];
 out = single ([
 1.00000   0.00000   0.00000   1.00000   2.00000   1.00000   0.00000   1.00000
 1.00000   1.00000   1.00000   sqrt(2)   sqrt(2)+1 sqrt(2)   1.00000   sqrt(2)
 0.00000   0.00000   1.00000   2.00000   2.00000   sqrt(2)   1.00000   sqrt(2)
 1.00000   1.00000   sqrt(2)   sqrt(2)   1.00000   1.00000   0.00000   1.00000
 2.00000   2.00000   2.00000   1.00000   0.00000   1.00000   1.00000   0.00000
 1.00000   sqrt(2)   2.00000   sqrt(2)   1.00000   sqrt(2)   sqrt(2)   1.00000
 0.00000   1.00000   1.00000   sqrt(2)   sqrt(2)   1.00000   1.00000   sqrt(2)
 1.00000   1.00000   0.00000   1.00000   1.00000   0.00000   0.00000   1.00000
 ]);
 assert (bwdist (bw, "quasi-euclidean"), out);
***** error <unknown METHOD> bwdist (bw, "not a valid method");
7 tests, 7 passed, 0 known failure, 0 skipped
[bwlabeln]
>>>>> /var/tmp/autopkgtest.ccVgDx/build.jQf/real-tree/src/bwlabeln.cc
***** shared a2d, a3d
 a2d = [1   0   0   0   0   0   1   0   0   1
        1   0   0   1   0   1   0   1   0   1
        1   0   1   0   0   0   0   0   0   0
        0   0   0   0   0   0   0   0   0   0
        0   1   0   0   0   0   0   0   0   0
        1   1   0   1   1   1   0   0   0   0
        1   1   0   1   0   0   0   1   0   0
        1   1   0   0   0   0   1   0   1   0
        1   1   0   0   0   0   0   0   0   0
        1   1   0   0   0   1   1   0   0   1];

 a3d = a2d;
 a3d(:,:,2) = [
        0   0   0   0   0   0   0   0   0   0
        1   0   0   1   1   0   0   1   0   0
        0   0   0   1   0   0   0   0   0   0
        0   0   0   0   0   0   0   0   0   0
        0   1   0   0   0   0   0   0   0   0
        1   1   0   0   1   1   0   0   0   0
        1   1   0   1   0   0   0   0   0   0
        1   0   0   0   0   0   1   0   0   0
        0   1   0   0   0   0   0   0   0   1
        1   1   0   0   0   0   1   0   0   0];

 a3d(:,:,3) = [
        1   0   0   0   0   0   0   0   0   0
        0   1   0   1   1   0   0   1   0   0
        0   0   0   1   0   0   0   0   0   0
        0   0   0   0   0   0   0   0   0   0
        0   0   0   0   0   0   0   0   0   0
        0   0   0   1   1   1   0   0   0   0
        0   0   0   0   0   0   0   0   0   0
        1   0   0   0   0   0   0   0   0   0
        1   1   0   0   0   0   0   0   0   1
        1   1   0   0   0   0   0   0   0   0];
***** test
 label2dc4 = [
        1   0   0   0   0   0   8   0   0  13
        1   0   0   4   0   6   0  10   0  13
        1   0   3   0   0   0   0   0   0   0
        0   0   0   0   0   0   0   0   0   0
        0   2   0   0   0   0   0   0   0   0
        2   2   0   5   5   5   0   0   0   0
        2   2   0   5   0   0   0  11   0   0
        2   2   0   0   0   0   9   0  12   0
        2   2   0   0   0   0   0   0   0   0
        2   2   0   0   0   7   7   0   0  14];
 assert (bwlabeln (a2d, 4), label2dc4)
 assert (bwlabeln (a2d, [0 1 0; 1 1 1; 0 1 0]), label2dc4)
 assert (bwlabeln (a2d, conndef (2, "minimal")), label2dc4)
 assert (bwlabeln (a2d, conndef (3, "minimal")), label2dc4)
***** test
 label2dc8 = [
        1   0   0   0   0   0   5   0   0   8
        1   0   0   3   0   5   0   5   0   8
        1   0   3   0   0   0   0   0   0   0
        0   0   0   0   0   0   0   0   0   0
        0   2   0   0   0   0   0   0   0   0
        2   2   0   4   4   4   0   0   0   0
        2   2   0   4   0   0   0   7   0   0
        2   2   0   0   0   0   7   0   7   0
        2   2   0   0   0   0   0   0   0   0
        2   2   0   0   0   6   6   0   0   9];
 assert (bwlabeln (a2d, 8), label2dc8)
 assert (bwlabeln (a2d, ones (3)), label2dc8)
 assert (bwlabeln (a2d, conndef (2, "maximal")), label2dc8)
 assert (bwlabeln (a2d, conndef (3, "maximal")), label2dc8)
***** test
 label3dc8 = [
        1   0   0   0   0   0   5   0   0   8
        1   0   0   3   0   5   0   5   0   8
        1   0   3   0   0   0   0   0   0   0
        0   0   0   0   0   0   0   0   0   0
        0   2   0   0   0   0   0   0   0   0
        2   2   0   4   4   4   0   0   0   0
        2   2   0   4   0   0   0   7   0   0
        2   2   0   0   0   0   7   0   7   0
        2   2   0   0   0   0   0   0   0   0
        2   2   0   0   0   6   6   0   0   9];
 label3dc8(:,:,2) = [
        0   0   0   0   0   0   0   0   0   0
       10   0   0  12  12   0   0  16   0   0
        0   0   0  12   0   0   0   0   0   0
        0   0   0   0   0   0   0   0   0   0
        0  11   0   0   0   0   0   0   0   0
       11  11   0   0  13  13   0   0   0   0
       11  11   0  13   0   0   0   0   0   0
       11   0   0   0   0   0  14   0   0   0
        0  11   0   0   0   0   0   0   0  17
       11  11   0   0   0   0  15   0   0   0];
 label3dc8(:,:,3) = [
       18   0   0   0   0   0   0   0   0   0
        0  18   0  20  20   0   0  22   0   0
        0   0   0  20   0   0   0   0   0   0
        0   0   0   0   0   0   0   0   0   0
        0   0   0   0   0   0   0   0   0   0
        0   0   0  21  21  21   0   0   0   0
        0   0   0   0   0   0   0   0   0   0
       19   0   0   0   0   0   0   0   0   0
       19  19   0   0   0   0   0   0   0  23
       19  19   0   0   0   0   0   0   0   0];
 assert (bwlabeln (a3d, 8), label3dc8)
 assert (bwlabeln (a3d, ones (3, 3)), label3dc8)
 assert (bwlabeln (a3d, conndef (2, "maximal")), label3dc8)
***** test
 label3dc26 = [
        1   0   0   0   0   0   3   0   0   7
        1   0   0   3   0   3   0   3   0   7
        1   0   3   0   0   0   0   0   0   0
        0   0   0   0   0   0   0   0   0   0
        0   2   0   0   0   0   0   0   0   0
        2   2   0   4   4   4   0   0   0   0
        2   2   0   4   0   0   0   6   0   0
        2   2   0   0   0   0   6   0   6   0
        2   2   0   0   0   0   0   0   0   0
        2   2   0   0   0   5   5   0   0   6];
 label3dc26(:,:,2) = [
        0   0   0   0   0   0   0   0   0   0
        1   0   0   3   3   0   0   3   0   0
        0   0   0   3   0   0   0   0   0   0
        0   0   0   0   0   0   0   0   0   0
        0   2   0   0   0   0   0   0   0   0
        2   2   0   0   4   4   0   0   0   0
        2   2   0   4   0   0   0   0   0   0
        2   0   0   0   0   0   6   0   0   0
        0   2   0   0   0   0   0   0   0   6
        2   2   0   0   0   0   5   0   0   0];
 label3dc26(:,:,3) = [
        1   0   0   0   0   0   0   0   0   0
        0   1   0   3   3   0   0   3   0   0
        0   0   0   3   0   0   0   0   0   0
        0   0   0   0   0   0   0   0   0   0
        0   0   0   0   0   0   0   0   0   0
        0   0   0   4   4   4   0   0   0   0
        0   0   0   0   0   0   0   0   0   0
        2   0   0   0   0   0   0   0   0   0
        2   2   0   0   0   0   0   0   0   6
        2   2   0   0   0   0   0   0   0   0];
 assert (bwlabeln (a3d, 26), label3dc26)
 assert (bwlabeln (a3d, ones (3, 3, 3)), label3dc26)
 assert (bwlabeln (a3d, conndef (3, "maximal")), label3dc26)
***** test
 label3dc18 = [
        1   0   0   0   0   0   3   0   0   7
        1   0   0   3   0   3   0   3   0   7
        1   0   3   0   0   0   0   0   0   0
        0   0   0   0   0   0   0   0   0   0
        0   2   0   0   0   0   0   0   0   0
        2   2   0   4   4   4   0   0   0   0
        2   2   0   4   0   0   0   6   0   0
        2   2   0   0   0   0   6   0   6   0
        2   2   0   0   0   0   0   0   0   0
        2   2   0   0   0   5   5   0   0   8];
 label3dc18(:,:,2) = [
        0   0   0   0   0   0   0   0   0   0
        1   0   0   3   3   0   0   3   0   0
        0   0   0   3   0   0   0   0   0   0
        0   0   0   0   0   0   0   0   0   0
        0   2   0   0   0   0   0   0   0   0
        2   2   0   0   4   4   0   0   0   0
        2   2   0   4   0   0   0   0   0   0
        2   0   0   0   0   0   6   0   0   0
        0   2   0   0   0   0   0   0   0   8
        2   2   0   0   0   0   5   0   0   0];
 label3dc18(:,:,3) = [
        1   0   0   0   0   0   0   0   0   0
        0   1   0   3   3   0   0   3   0   0
        0   0   0   3   0   0   0   0   0   0
        0   0   0   0   0   0   0   0   0   0
        0   0   0   0   0   0   0   0   0   0
        0   0   0   4   4   4   0   0   0   0
        0   0   0   0   0   0   0   0   0   0
        2   0   0   0   0   0   0   0   0   0
        2   2   0   0   0   0   0   0   0   8
        2   2   0   0   0   0   0   0   0   0];
 assert (bwlabeln (a3d, 18), label3dc18)
***** test
 label2dc3 = [
        1   0   0   0   0   0  11   0   0  17
        1   0   0   5   0   8   0  14   0  17
        1   0   4   0   0   0   0   0   0   0
        0   0   0   0   0   0   0   0   0   0
        0   3   0   0   0   0   0   0   0   0
        2   3   0   6   7   9   0   0   0   0
        2   3   0   6   0   0   0  15   0   0
        2   3   0   0   0   0  12   0  16   0
        2   3   0   0   0   0   0   0   0   0
        2   3   0   0   0  10  13   0   0  18];
 assert (bwlabeln (a2d, [1 1 1]'), label2dc3)

 label3dc3 = label2dc3;
 label3dc3(:,:,2) = [
        0   0   0   0   0   0   0   0   0   0
       19   0   0  24  26   0   0  31   0   0
        0   0   0  24   0   0   0   0   0   0
        0   0   0   0   0   0   0   0   0   0
        0  22   0   0   0   0   0   0   0   0
       20  22   0   0  27  28   0   0   0   0
       20  22   0  25   0   0   0   0   0   0
       20   0   0   0   0   0  29   0   0   0
        0  23   0   0   0   0   0   0   0  32
       21  23   0   0   0   0  30   0   0   0];
 label3dc3(:,:,3) = [
       33   0   0   0   0   0   0   0   0   0
        0  35   0  37  39   0   0  42   0   0
        0   0   0  37   0   0   0   0   0   0
        0   0   0   0   0   0   0   0   0   0
        0   0   0   0   0   0   0   0   0   0
        0   0   0  38  40  41   0   0   0   0
        0   0   0   0   0   0   0   0   0   0
       34   0   0   0   0   0   0   0   0   0
       34  36   0   0   0   0   0   0   0  43
       34  36   0   0   0   0   0   0   0   0];
 assert (bwlabeln (a3d, [1 1 1]'), label3dc3)
***** test
 label2dc1 = zeros (size (a2d));
 label2dc1(a2d != 0) = 1:nnz (a2d);
 assert (bwlabeln (a2d, [1]), label2dc1);
 assert (bwlabeln (a2d, [0 1 0]'), label2dc1);

 label3dc1 = zeros (size (a3d));
 label3dc1(a3d != 0) = 1:nnz (a3d);
 assert (bwlabeln (a3d, [1]), label3dc1);
 assert (bwlabeln (a3d, [0 1 0]'), label3dc1);
***** shared in
 in = rand (10) > 0.8;
***** assert (bwlabel (in, 4), bwlabeln (in, 4));
***** assert (bwlabel (in, 4), bwlabeln (in, [0 1 0; 1 1 1; 0 1 0]));
***** assert (bwlabel (in, 8), bwlabeln (in, 8));
***** assert (bwlabel (in, 8), bwlabeln (in, [1 1 1; 1 1 1; 1 1 1]));
***** assert (bwlabel (logical ([0 1 0; 0 0 0; 1 0 1])), [0 2 0; 0 0 0; 1 0 3]);
***** assert (bwlabel ([0 1 0; 0 0 0; 1 0 1]), [0 2 0; 0 0 0; 1 0 3]);
***** assert (bwlabel ([0 -1 0; 0 0 0; 5 0 0.2]), [0 2 0; 0 0 0; 1 0 3]);
***** shared in, out

 in = [  0   1   1   0   0   1   0   0   0   0
         0   0   0   1   0   0   0   0   0   1
         0   1   1   0   0   0   0   0   1   1
         1   0   0   0   0   0   0   1   0   0
         0   0   0   0   0   1   1   0   0   0
         0   0   0   0   0   0   0   0   0   0
         0   0   0   1   0   0   0   0   0   0
         0   0   0   0   1   1   0   1   0   0
         0   0   0   1   0   1   0   1   0   1
         1   1   0   0   0   0   0   1   1   0];

 out = [ 0   3   3   0   0   9   0   0   0   0
         0   0   0   5   0   0   0   0   0  13
         0   4   4   0   0   0   0   0  13  13
         1   0   0   0   0   0   0  11   0   0
         0   0   0   0   0  10  10   0   0   0
         0   0   0   0   0   0   0   0   0   0
         0   0   0   6   0   0   0   0   0   0
         0   0   0   0   8   8   0  12   0   0
         0   0   0   7   0   8   0  12   0  14
         2   2   0   0   0   0   0  12  12   0];
***** assert (nthargout ([1 2], @bwlabel, in, 4), {out, 14});
***** assert (nthargout ([1 2], @bwlabel, logical (in), 4), {out, 14});

 out = [ 0   3   3   0   0   7   0   0   0   0
         0   0   0   3   0   0   0   0   0  11
         0   4   4   0   0   0   0   0  11  11
         1   0   0   0   0   0   0   9   0   0
         0   0   0   0   0   8   8   0   0   0
         0   0   0   0   0   0   0   0   0   0
         0   0   0   5   0   0   0   0   0   0
         0   0   0   0   5   5   0  10   0   0
         0   0   0   6   0   5   0  10   0  12
         2   2   0   0   0   0   0  10  10   0];
***** assert (nthargout ([1 2], @bwlabel, in, 6), {out, 12});
***** assert (nthargout ([1 2], @bwlabel, logical (in), 6), {out, 12});

 ## The labeled image is not the same as Matlab, but they are
 ## labeled correctly. Do we really need to get them properly
 ## ordered? (the algorithm in bwlabeln does it)
 mout = [0   1   1   0   0   4   0   0   0   0
         0   0   0   1   0   0   0   0   0   5
         0   1   1   0   0   0   0   0   5   5
         1   0   0   0   0   0   0   5   0   0
         0   0   0   0   0   5   5   0   0   0
         0   0   0   0   0   0   0   0   0   0
         0   0   0   3   0   0   0   0   0   0
         0   0   0   0   3   3   0   6   0   0
         0   0   0   3   0   3   0   6   0   6
         2   2   0   0   0   0   0   6   6   0];

 out = [ 0   2   2   0   0   4   0   0   0   0
         0   0   0   2   0   0   0   0   0   5
         0   2   2   0   0   0   0   0   5   5
         2   0   0   0   0   0   0   5   0   0
         0   0   0   0   0   5   5   0   0   0
         0   0   0   0   0   0   0   0   0   0
         0   0   0   3   0   0   0   0   0   0
         0   0   0   0   3   3   0   6   0   0
         0   0   0   3   0   3   0   6   0   6
         1   1   0   0   0   0   0   6   6   0];
***** assert (nthargout ([1 2], @bwlabel, in, 8), {out, 6});
***** assert (nthargout ([1 2], @bwlabel, logical (in), 8), {out, 6});

***** error bwlabel (rand (10, 10, 10) > 0.8, 4)
***** error bwlabel (rand (10) > 0.8, "text")
***** error bwlabel ("text", 6)
23 tests, 23 passed, 0 known failure, 0 skipped
[conndef]
>>>>> /var/tmp/autopkgtest.ccVgDx/build.jQf/real-tree/src/conndef.cc
***** assert (conndef (1, "minimal"), [1; 1; 1]);
***** assert (conndef (2, "minimal"), [0 1 0; 1 1 1; 0 1 0]);
***** test
 C = zeros (3, 3, 3);
 C(:,2,2) = 1;
 C(2,:,2) = 1;
 C(2,2,:) = 1;
 assert (conndef (3, "minimal"), C);
***** test
 C = zeros (3, 3, 3, 3);
 C(:,:,2,1) = [0   0   0
               0   1   0
               0   0   0];
 C(:,:,1,2) = [0   0   0
               0   1   0
               0   0   0];
 C(:,:,2,2) = [0   1   0
               1   1   1
               0   1   0];
 C(:,:,3,2) = [0   0   0
               0   1   0
               0   0   0];
 C(:,:,2,3) = [0   0   0
               0   1   0
               0   0   0];
 assert (conndef (4, "minimal"), C);
***** assert (conndef (1, "maximal"), ones (3, 1));
***** assert (conndef (2, "maximal"), ones (3, 3));
***** assert (conndef (3, "maximal"), ones (3, 3, 3));
***** assert (conndef (4, "maximal"), ones (3, 3, 3, 3));
***** assert (nnz (conndef (3, "minimal")), 7)
***** assert (nnz (conndef (4, "minimal")), 9)
***** assert (nnz (conndef (5, "minimal")), 11)
***** assert (nnz (conndef (6, "minimal")), 13)
***** assert (find (conndef (3, "minimal")), [5 11 13 14 15 17 23](:))
***** assert (find (conndef (4, "minimal")), [14 32 38 40 41 42 44 50 68](:))
***** assert (find (conndef (5, "minimal")),
        [   41   95  113  119  121  122  123  125  131  149  203](:))
***** assert (find (conndef (6, "minimal")),
        [  122  284  338  356  362  364  365  366  368  374  392  446  608](:))
***** error conndef ()
***** error <must be a positive integer> conndef (-2, "minimal")
***** error conndef (char (2), "minimal")
***** error conndef ("minimal", 3)
***** error <TYPE must be "maximal" or "minimal"> conndef (3, "invalid")
***** error <CONN must be logical or in the set> conndef (10)
***** assert (conndef (2, "minimal"), conndef (4))
***** assert (conndef (2, "maximal"), conndef (8))
***** assert (conndef (3, "minimal"), conndef (6))
***** assert (conndef (3, "maximal"), conndef (26))
***** assert (conndef (18), reshape ([0 1 0 1 1 1 0 1 0
                                1 1 1 1 1 1 1 1 1
                                0 1 0 1 1 1 0 1 0], [3 3 3]))
***** error <expected error> fail ("iptcheckconn ( 4, 'func', 'var')");
***** error <expected error> fail ("iptcheckconn ( 6, 'func', 'var')");
***** error <expected error> fail ("iptcheckconn ( 8, 'func', 'var')");
***** error <expected error> fail ("iptcheckconn (18, 'func', 'var')");
***** error <expected error> fail ("iptcheckconn (26, 'func', 'var')");
***** error <expected error> fail ("iptcheckconn (1, 'func', 'var')");
***** error <expected error> fail ("iptcheckconn (ones (3, 1), 'func', 'var')");
***** error <expected error> fail ("iptcheckconn (ones (3, 3), 'func', 'var')");
***** error <expected error> fail ("iptcheckconn (ones (3, 3, 3), 'func', 'var')");
***** error <expected error> fail ("iptcheckconn (ones (3, 3, 3, 3), 'func', 'var')");
***** error <VAR must be logical or in> iptcheckconn (3, "func", "VAR");
***** error <VAR center is not true> iptcheckconn ([1 1 1; 1 0 1; 1 1 1], "func", "VAR");
***** error <VAR must be logical or in> iptcheckconn ([1 2 1; 1 1 1; 1 1 1], "func", "VAR");
***** error <VAR is not symmetric relative to its center> iptcheckconn ([0 1 1; 1 1 1; 1 1 1], "func", "VAR");
***** error <VAR is not 1x1, 3x1, 3x3, or 3x3x...x3> iptcheckconn (ones (3, 3, 3, 4), "func", "VAR");
42 tests, 42 passed, 0 known failure, 0 skipped
Summary: 1169 tests, 1134 passed, 21 known failures, 0 skipped
/usr/share/cdbs/1/class/octave-pkg.mk:108: recipe for target 'check-pkg' failed
make: *** [check-pkg] Error 1
autopkgtest [11:06:09]: test unit-tests: -----------------------]
autopkgtest [11:06:09]: test unit-tests:  - - - - - - - - - - results - - - - - - - - - -
unit-tests           FAIL non-zero exit status 2
autopkgtest [11:06:09]: @@@@@@@@@@@@@@@@@@@@ summary
unit-tests           FAIL non-zero exit status 2

Reply to: