From: <jo...@us...> - 2012-09-07 15:13:42
|
Revision: 10978 http://octave.svn.sourceforge.net/octave/?rev=10978&view=rev Author: jordigh Date: 2012-09-07 15:13:33 +0000 (Fri, 07 Sep 2012) Log Message: ----------- bwlabeln: Fix type checking of inputs Modified Paths: -------------- trunk/octave-forge/main/image/src/bwlabeln.cc Modified: trunk/octave-forge/main/image/src/bwlabeln.cc =================================================================== --- trunk/octave-forge/main/image/src/bwlabeln.cc 2012-09-07 14:52:03 UTC (rev 10977) +++ trunk/octave-forge/main/image/src/bwlabeln.cc 2012-09-07 15:13:33 UTC (rev 10978) @@ -304,9 +304,9 @@ return rval; } - if (!args(0).is_bool_type ()) + if (!args(0).is_numeric_type () && !args(0).is_bool_type ()) { - error ("bwlabeln: first input argument must be a 'logical' ND-array"); + error ("bwlabeln: first input argument must be an ND array"); return rval; } @@ -331,7 +331,7 @@ else conn_mask = get_mask (N); } - else if (args(2).is_bool_type() ) + else if (args(2).is_numeric_type () || args(2).is_bool_type ()) { conn_mask = args(2).bool_array_value (); dim_vector conn_mask_dims = conn_mask.dims (); @@ -349,7 +349,7 @@ } else error ("bwlabeln: second input argument must be a real scalar " - "or a 'logical' connectivity array"); + "or a connectivity array"); } else // Get the maximal mask that has same number of dims as BW. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |