octave-bug-tracker
[Top][All Lists]
Advanced

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

[Octave-bug-tracker] [bug #52926] [octave-forge] (image) regionprops('pe


From: Hartmut
Subject: [Octave-bug-tracker] [bug #52926] [octave-forge] (image) regionprops('perimeter') gives unexpected error / 'eccentricicty' inaccurate
Date: Thu, 18 Jan 2018 16:45:45 -0500 (EST)
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:57.0) Gecko/20100101 Firefox/57.0

URL:
  <http://savannah.gnu.org/bugs/?52926>

                 Summary: [octave-forge] (image) regionprops('perimeter')
gives unexpected error / 'eccentricicty' inaccurate
                 Project: GNU Octave
            Submitted by: hardy
            Submitted on: Thu 18 Jan 2018 09:45:44 PM UTC
                Category: Octave Forge Package
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Regression
                  Status: None
             Assigned to: None
         Originator Name: 
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
                 Release: dev
        Operating System: Any

    _______________________________________________________

Details:

quote (slightly adapted) from the mailing list
(
http://octave.1599824.n4.nabble.com/Octave-vs-Matlab-regionprops-differences-td4686389.html
)

-------------

Hi all,

please try this script in Matlab (with the image processing toolbox) and
in octave (first loading the image package):


BW = logical([1 1 1 0 0 0 0 0
              1 1 1 0 1 1 0 0
              1 1 1 0 1 1 0 0
              1 1 1 0 0 0 1 0
              1 1 1 0 0 0 1 0
              1 1 1 0 0 0 1 0
              1 1 1 0 0 1 1 0
              1 1 1 0 0 0 0 0]);

L = bwlabel(BW, 8);   % ,4 or ,8 (default)
s = regionprops(L, 'Perimeter', 'Eccentricity')

for j = 1:size(s)
   disp(s(j).Perimeter)
   disp(s(j).Eccentricity)
end



Here is the result, with connectivity = 4 or 8, and Matlab or octave:


Connectivity = 4, Matlab:

s =

   3×1 struct array with fields:
     Eccentricity
     Perimeter

    17.2760
     0.9270
     3.5560
      0
     7.0130
     0.9315


Connectivity = 4,  octave

error: vertical dimensions mismatch (1x3 vs 1x2)
error: called from
     regionprops>rp_perimeter at line 767 column 8
     regionprops at line 412 column 26
     testOctaveVSMatlab at line 13 column 3
 >>

Connectivity = 8, Matlab

s =
   2×1 struct array with fields:
     Eccentricity
     Perimeter

    17.2760
     0.9270
    13.1080
     0.9429


Connectivity = 8, octave

s =
   2x1 struct array containing the fields:
     Perimeter
     Eccentricity

  18
  0.92702
  14.243
  0.98641
 >>


As you see, with 4-connectivity, octave breaks. With 8-connectivity,
perimeters and eccentricities are different.

Thanks

Giorgio (Denunzio)




    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?52926>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

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