[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #52029] Compatibility MATLAB and Octave code
From: |
anonymous |
Subject: |
[Octave-bug-tracker] [bug #52029] Compatibility MATLAB and Octave code |
Date: |
Fri, 15 Sep 2017 03:18:43 -0400 (EDT) |
User-agent: |
Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.112 Safari/537.36 |
URL:
<http://savannah.gnu.org/bugs/?52029>
Summary: Compatibility MATLAB and Octave code
Project: GNU Octave
Submitted by: None
Submitted on: Fri 15 Sep 2017 07:18:41 AM UTC
Category: Octave Forge Package
Severity: 3 - Normal
Priority: 5 - Normal
Item Group: Incorrect Result
Status: None
Assigned to: None
Originator Name: r2d3
Originator Email: address@hidden
Open/Closed: Open
Discussion Lock: Any
Release: 4.2.1
Operating System: Microsoft Windows
_______________________________________________________
Details:
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 = [a*cosphi; b*sinphi];
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?
_______________________________________________________
File Attachments:
-------------------------------------------------------
Date: Fri 15 Sep 2017 07:18:41 AM UTC Name: wrong_result.JPG Size: 61KiB
By: None
<http://savannah.gnu.org/bugs/download.php?file_id=41804>
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?52029>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
- [Octave-bug-tracker] [bug #52029] Compatibility MATLAB and Octave code,
anonymous <=