From: <car...@us...> - 2011-12-05 04:42:05
|
Revision: 9271 http://octave.svn.sourceforge.net/octave/?rev=9271&view=rev Author: carandraug Date: 2011-12-05 04:41:59 +0000 (Mon, 05 Dec 2011) Log Message: ----------- isgray isbw isrgb: return false is argument is empty matrix Modified Paths: -------------- trunk/octave-forge/main/image/inst/isbw.m trunk/octave-forge/main/image/inst/isgray.m trunk/octave-forge/main/image/inst/isrgb.m Modified: trunk/octave-forge/main/image/inst/isbw.m =================================================================== --- trunk/octave-forge/main/image/inst/isbw.m 2011-12-05 04:40:59 UTC (rev 9270) +++ trunk/octave-forge/main/image/inst/isbw.m 2011-12-05 04:41:59 UTC (rev 9271) @@ -37,7 +37,7 @@ endif ## an image cannot be a sparse matrix - if (!ismatrix (BW) || issparse (BW)) + if (!ismatrix (BW) || issparse (BW) || isempty (BW)) bool = false; elseif (strcmpi (logic, "logical")) ## this is the matlab compatible way (before they removed the function) Modified: trunk/octave-forge/main/image/inst/isgray.m =================================================================== --- trunk/octave-forge/main/image/inst/isgray.m 2011-12-05 04:40:59 UTC (rev 9270) +++ trunk/octave-forge/main/image/inst/isgray.m 2011-12-05 04:41:59 UTC (rev 9271) @@ -38,7 +38,7 @@ endif bool = false; - if (ismatrix (img) && ndims (img) == 2 && !issparse (img)) + if (ismatrix (img) && ndims (img) == 2 && !issparse (img) && !isempty (img)) switch (class (img)) case "double" ## to speed this up, we can look at a sample of the image first Modified: trunk/octave-forge/main/image/inst/isrgb.m =================================================================== --- trunk/octave-forge/main/image/inst/isrgb.m 2011-12-05 04:40:59 UTC (rev 9270) +++ trunk/octave-forge/main/image/inst/isrgb.m 2011-12-05 04:41:59 UTC (rev 9271) @@ -39,7 +39,7 @@ endif bool = false; - if (ismatrix (img) && ndims (img) == 3 && size (img, 3) == 3 && !issparse (img)) + if (ismatrix (img) && ndims (img) == 3 && size (img, 3) == 3 && !issparse (img) && !isempty (img)) switch (class (img)) case "double" ## to speed this up, we can look at a sample of the image first This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |