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

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

[Octave-bug-tracker] [bug #49613] image package - regionprops.m majoraxi


From: Hartmut
Subject: [Octave-bug-tracker] [bug #49613] image package - regionprops.m majoraxislength broken
Date: Thu, 17 Nov 2016 17:41:52 +0000 (UTC)
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:49.0) Gecko/20100101 Firefox/49.0

Follow-up Comment #5, bug #49613 (project octave):

Regarding Avinoam's second topic (the tan function in the calculation of the
ellipse orientation):

I have implemented this calculation myself (see bug #44100) two years ago.
When I remember right, I succeeded to make this orientation value also Matlab
compatible. So chances are high that changes in the resulting orientation
values would be a regression. Do the included test cases still pass when you
switch to atan2 ? (But even if yes, I would hesitate to change this).

Here is the Matlab blog article, that I used at that time to work towards
Matlab compatibility of the ellipse orientation:
http://blogs.mathworks.com/steve/2010/07/30/visualizing-regionprops-ellipse-measurements/

The problem with tan would only occur if major_vec(1)=0. But can this happen
at all? Even a region with only one single pixel shoud receive the 1/12 value
for its width (it's second moment). So I would guess it is impossible that one
of the eigenvalues can become zero here. That would mean that the ellipse
degrades to a 0-thin line, but there are still some pixels in it, because
without any pixels it wouldn't count as a region at all... (But you could test
some corner cases and try to prove me wrong, that's fine!)

Regarding Avinoam's first topic (the missing +1 for the loop counter): This
sounds reasonable to fix. Thanks's for spotting this. Could you add some test
for calculation the Orientation two regions at once (that have different
orientations)? Maybe BW = [1 0 0 0 1; 0 1 0 1 0] or something similar?


    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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