i try to use im2bw function on indexed image, but octave produce a strange
error:

octave:8> bm1 = im2bw (x,double(m)/255,0.5)
error: im2bw: threshold value must be scalar
error: evaluating if command near line 54, column 3
error: called from `im2bw' in file
`/usr/share/octave/packages/image-1.0.6/im2bw.m'
error: evaluating assignment expression near line 8, column 5

i write a patch which fix this error.

--------------- im2bw.patch ---------------
--- im2bw.m--old        2009-03-12 19:03:47.000000000 +0600
+++ im2bw.m     2009-03-12 19:13:25.000000000 +0600
@@ -49,8 +49,9 @@
   else
     error ("im2bw: first input argument must be an image");
   endif
-
+
   ## Do the thresholding
+  a=t;
   if (isscalar (a))
     if (a < 0 || a > 1)
       error("im2bw: threshold must be in the interval [0, 1]");
--------------- im2bw.patch end here ---------------

------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
_______________________________________________
Octave-dev mailing list
Octave-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/octave-dev

Reply via email to