Forwarded from the octave-maintainers mailing list:
---------- Forwarded message ----------
From: Przemek Klosowski <[email protected]>
Date: 13 July 2011 17:19
Subject: bwlabel problems
To: "[email protected]" <[email protected]>
OCTAVE_VERSION 3.4.0 on vanilla Fedora 15, image 1.0.14
bwlabel/regionprops behave funny:
bw=[0 1 0 0 0; 1 1 1 0 1; 0 1 0 0 1; 0 0 0 1 1] == 1
bw =
0 1 0 0 0
1 1 1 0 1
0 1 0 0 1
0 0 0 1 1
First problem:
regionprops(bw,"all")
error: regionprops: unsupported property 'all'
error: called from:
error: /.../packages/image-1.0.14/regionprops.m at line 276, column 9
Second problem:
regionprops(bw, "meanintensity")
error: mean: X must be a numeric vector or matrix
error: called from:
error: /.../3.4.0/m/statistics/base/mean.m at line 69, column 5
error: /.../packages/image-1.0.14/regionprops.m at line 218, column 35
regionprops(bw) works fine (returns three basic properties area/centroid/bbox).
The first problem is due to varargin returning a cell array, so
ischar() and strcmpi() tests don't work on it. I am awkward with
cell/string operations, so I am not sure if this is the best approach,
but the attached patch seems to work.
I haven't had the time to look at the second problem.
---------- Forwarded message ----------
From: Jordi Gutiérrez Hermoso <[email protected]>
Date: 2011/7/13
Subject: Re: bwlabel problems
To: Przemek Klosowski <[email protected]>
Cc: "[email protected]" <[email protected]>
On 13 July 2011 11:19, Przemek Klosowski <[email protected]> wrote:
> OCTAVE_VERSION 3.4.0 on vanilla Fedora 15, image 1.0.14
>
> bwlabel/regionprops behave funny:
This is an Octave-Forge package, isn't it? So you should take it to
that mailing list?
We should work into integrating Octave-Forge more properly with Octave. :-/
- Jordi G. H.
*** regionprops.m 2011-07-13 12:15:30.666993598 -0400
--- /usr/share/octave/packages/image-1.0.14/regionprops.m 2011-04-18
13:17:38.000000000 -0400
***************
*** 101,107 ****
endif
if (numel (varargin) == 0)
! properties = {"basic"};
elseif (numel (varargin) == 1 && iscellstr (varargin {1}))
properties = varargin {1};
elseif (iscellstr (varargin))
--- 101,107 ----
endif
if (numel (varargin) == 0)
! properties = "basic";
elseif (numel (varargin) == 1 && iscellstr (varargin {1}))
properties = varargin {1};
elseif (iscellstr (varargin))
***************
*** 110,118 ****
error ("regionprops: properties must be a cell array of strings");
endif
! if (ischar (properties{1}) && strcmpi (properties{1}, "basic"))
properties = {"Area", "Centroid", "BoundingBox"};
! elseif (ischar (properties{1}) && strcmpi (properties{1}, "all"))
properties = {"area", "eulernumber", "boundingbox", "extent",
"perimeter", ...
"centroid", "pixelidxlist", "filledarea", "pixellist",
...
"filledimage", "image", "maxintensity", "minintensity",
...
--- 110,118 ----
error ("regionprops: properties must be a cell array of strings");
endif
! if (ischar (properties) && strcmpi (properties, "basic"))
properties = {"Area", "Centroid", "BoundingBox"};
! elseif (ischar (properties) && strcmpi (properties, "all"))
properties = {"area", "eulernumber", "boundingbox", "extent",
"perimeter", ...
"centroid", "pixelidxlist", "filledarea", "pixellist",
...
"filledimage", "image", "maxintensity", "minintensity",
...
------------------------------------------------------------------------------
AppSumo Presents a FREE Video for the SourceForge Community by Eric
Ries, the creator of the Lean Startup Methodology on "Lean Startup
Secrets Revealed." This video shows you how to validate your ideas,
optimize your ideas and identify your business strategy.
http://p.sf.net/sfu/appsumosfdev2dev
_______________________________________________
Octave-dev mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/octave-dev