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: Avinoam Kalma
Subject: [Octave-bug-tracker] [bug #49613] image package - regionprops.m majoraxislength broken
Date: Wed, 16 Nov 2016 07:51:48 +0000 (UTC)
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko

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

The problem is in the loop


  for idx = 1:no
    sel = c_idx:(c_idx + area(idx) -1);
    X = pixellist(sel, 2);
    Y = pixellist(sel, 1);
  ....


c_idx is constant in the loop. Adding the line


    c_idx += area(idx);


fixes the problem.

Another problem is in the line:


orientation(idx) = -(180/pi) .* atan (major_vec(2) ./ major_vec(1));


if major_vec(1)=0 we get "division by zero" warning, and not the correct
result. Maybe atan2 can fix this.

    _______________________________________________________

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]