Hello,
im2double in package image doesn't work with uint16 images due to a
missing '/' (division).
The bug is present in image 1.0.10 (tested) and appears also to be
present in 1.0.12 / trunk.
Testcase:
im2double(uint16(65535))
Expected result:
ans = 1
Actual result:
error: A(I): Index exceeds matrix dimension.
error: called from:
error: /usr/share/octave/packages/3.2/image-1.0.10/im2double.m at
line 43, column 11
Please consider proposed trivial patch below.
Regards,
S
Index: trunk/octave-forge/main/image/inst/im2double.m
===================================================================
--- trunk/octave-forge/main/image/inst/im2double.m (revision 7188)
+++ trunk/octave-forge/main/image/inst/im2double.m (working copy)
@@ -40,7 +40,7 @@
case "uint8"
im2 = double(im1)/255;
case "uint16"
- im2 = double(im1)(pow2(16)-1);
+ im2 = double(im1)/(pow2(16)-1);
otherwise
error("im2double: unsupported image class");
endswitch
------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Octave-dev mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/octave-dev