bugGNU Octave - Bugs: bug #52029, [octave forge] (image) regionprops...

 
 

bug #52029: [octave forge] (image) regionprops error in Orientation or MajorAxisLength or MinorAxisLength

Submitted by:  None
Submitted on:  Fri 15 Sep 2017 07:18:41 AM UTC  
 
Category: Octave Forge PackageSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Incorrect Result
Status: FixedAssigned to: None
Originator Name: r2d3Originator Email: -unavailable-
Open/Closed: ClosedRelease: other
Operating System: Any

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Sun 17 Sep 2017 08:34:01 PM UTC, comment #3:

Using the fixed routine, I get the attached image (right_result.png).

Closing as fixed.

Avinoam Kalma <avinoam>
Project Member
Sat 16 Sep 2017 06:33:14 PM UTC, comment #2:

This bug has been reported and fixed. See bug #49613

Avinoam Kalma <avinoam>
Project Member
Fri 15 Sep 2017 04:00:36 PM UTC, comment #1:

It would be very helpful if you could narrow this down to reporting the specific bug.

Nevertheless, I guess that this looks like a duplicate of bug #49613, which has been fixed in the image package but not yet released. If you are willing to test it to see if that is true, you can test the updated function in the image package repository at http://hg.code.sf.net/p/octave/image.

Mike Miller <mtmiller>
Project Administrator
Fri 15 Sep 2017 07:18:41 AM UTC, original submission:

I just installed Octave 4.2.1 and tried this example code that uses Image Processing package to visualize the ellipse-based measurements produced by regionprops
(http://blogs.mathworks.com/steve/2010/07/30/visualizing-regionprops-ellipse-measurements/):

url='http://blogs.mathworks.com/images/steve/2010/rice_binary.png';
bw = imread(url);
imshow(bw)
hold on

pkg load image

s = regionprops(bw, 'Orientation', 'MajorAxisLength', ...
'MinorAxisLength', 'Eccentricity', 'Centroid');

phi = linspace(0,2*pi,50);
cosphi = cos(phi);
sinphi = sin(phi);

for k = 1:length(s)
xbar = s(k).Centroid(1);
ybar = s(k).Centroid(2);

a = s(k).MajorAxisLength/2;
b = s(k).MinorAxisLength/2;

theta = pi*s(k).Orientation/180;
R = [ cos(theta) sin(theta)
-sin(theta) cos(theta)];

xy = [acosphi; bsinphi];
xy = R*xy;

x = xy(1,:) + xbar;
y = xy(2,:) + ybar;

plot(x,y,'r','LineWidth',2);
end
hold off

The result I have obtained, shown in attached file ("wrong_result.JPG") - all ellipses are arranged horizontally.
"Orientation" does not work?
How it possible to workaround this problem?

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

Attached Files
file #41823:  right_result.png added by avinoam (46KiB - image/png)
file #41804:  wrong_result.JPG added by None (61KiB - image/jpeg)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by avinoam (Posted a comment)
  • -unavailable- added by mtmiller (Posted a comment)
  • -unavailable- added by None (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 7 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sun 17 Sep 2017 08:35:11 PM UTCavinoamAttached File-=>Added right_result.png, #41823
    Sun 17 Sep 2017 08:34:01 PM UTCavinoamStatusNone=>Fixed
      Open/ClosedOpen=>Closed
      Release4.2.1=>other
      Operating SystemMicrosoft Windows=>Any
    Fri 15 Sep 2017 04:00:36 PM UTCmtmillerSummaryCompatibility MATLAB and Octave code=>[octave forge] (image) regionprops error in Orientation or MajorAxisLength or MinorAxisLength
    Fri 15 Sep 2017 07:18:41 AM UTCNoneAttached File-=>Added wrong_result.JPG, #41804

    Back to the top


    Powered by Savane 3.1-cleanup1