octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bwlabel problems


From: Przemek Klosowski
Subject: bwlabel problems
Date: Wed, 13 Jul 2011 12:19:52 -0400
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.17) Gecko/20110428 Fedora/3.1.10-1.fc15 Lightning/1.0b2 Thunderbird/3.1.10

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.

Attachment: regionprops.diff
Description: Text document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]