octave-patch-tracker
[Top][All Lists]
Advanced

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

[Octave-patch-tracker] [patch #9849] [octave forge] (image) New function


From: Hartmut
Subject: [Octave-patch-tracker] [patch #9849] [octave forge] (image) New function integralImage3
Date: Sat, 19 Oct 2019 15:26:43 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:69.0) Gecko/20100101 Firefox/69.0

Follow-up Comment #1, patch #9849 (project octave):

I have had a close look at the attached file integralImage3 in comment #0. It
looks fine to me.

Some minor comments:

* I am unsure about the english grammar in the error message "I should be at
most 3-dimensional image"

* I have looked at the coding (there isn' too much), this looks fine to me.

* I have tested the code examples on the Matlab help page, those produce
identical results as this Octave implementation.

* All tests included into this Octave file do pass.

* Regarding coding style: There are some missing spaces after Octave commands
in the test code. E.g. "class(J)" or "uint8(10)".

* I have also done my own tests with the following code. I got the same
results as with an online Matlab version. Feel free to add those examples as
additional tests, but I think it would also be fine to leave the tests as they
are, there are enough relevant tests, already.


# test of 3d input image:

K = magic (8);
K = reshape (K, [4 4 4]);

L = integralImage3 (K);

L1_ML = zeros (5);
L2_ML = [0 0 0 0 0;
   0 64 96 98 132;
   0 73 146 203 260;
   0 90 212 316 388;
   0 130 260 390 520];
L3_ML = [0 0 0 0 0;
  0 67 134 197 260;
  0 130 260 390 520;
  0 193 386 583 780;
  0 260 520 780 1040];
L4_ML = [0 0 0 0 0; 
  0 127 222 291 392;
  0 203 406 593 780;
  0 287 606 903 1168;
  0 390 780 1170 1560];
L5_ML = [0 0 0 0 0;
  0 134 268 394 520;
  0 260 520 780 1040;
  0 386 772 1166 1560;
  0 520 1040 1560 2080];
L_ML = cat(3, L1_ML, L2_ML, L3_ML, L4_ML, L5_ML);
  
assert (L, L_ML);
  
# test of 2d input image:
X = ones(3);
Y = integralImage3(X);
Y_ML = zeros(4,4,2);
Y_ML(:,:,2) = [0 0 0 0; 0 1 2 3; 0 2 4 6; 0 3 6 9];

assert(Y, Y_ML);


So in my opinion this new function integralImage3 could be added to the image
package.

Could you as a next step generate a patch file, Avinoam? Including the changes
to NEWS and other bookkeeping files?


    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/patch/?9849>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]