File:Regression elliptique distance algebrique ellipse bruitee pleine.svg
מתוך Wikimedia Commons
קפיצה לניווט
קפיצה לחיפוש
גודל התצוגה המקדימה הזאת מסוג PNG של קובץ ה־SVG הזה: 414 × 364 פיקסלים. רזולוציות אחרות: 273 × 240 פיקסלים | 546 × 480 פיקסלים | 874 × 768 פיקסלים | 1,165 × 1,024 פיקסלים | 2,329 × 2,048 פיקסלים.
לקובץ המקורי (קובץ SVG, הגודל המקורי: 414 × 364 פיקסלים, גודל הקובץ: 22 ק"ב)
מידע על הקובץ
נתונים מובְנים
כיתובים
תקציר
[עריכה]תיאורRegression elliptique distance algebrique ellipse bruitee pleine.svg |
English: Ellipse fitting with the algebraic distance method (Fitzgibbon). Created with Scilab, modified with Inkscape.
Français : Régression elliptique avec la méthode de la distance algébrique (Fitzgibbon).Créé avec Scilab, modifié avec Inkscape. |
תאריך יצירה | |
מקור | נוצר על־ידי מעלה היצירה |
יוצר | Cdang |
Parameters | Original values |
Fitted values |
---|---|---|
φ | 30° | 28.2° |
xc | 4 | 4.16 |
yc | 3 | 2.98 |
a | 4 | 4.03 |
b | 2 | 1.89 |
- φ: tilt angle;
- (xc, yc): position of the center;
- a, b: major and minor radii.
Scilab source
This media was created with Scilab, a free open-source software. Here is a listing of the Scilab source used to create this file. |
Generation of data.
// **********
// Initialisation
// **********
clear;
chdir('monchemin/');
// **********
// Données
// **********
phiinit = 30/180*%pi;
xcinit = 4; ycinit = 3;
ainit = 4; binit = 2;
varbruit = 0.2;
// **********
// Fonctions
// **********
function [XY] = cree_points(xc, yc, a, b, phi, var)
// trace l'ellipse de centre (xc, yc)
// de rayons a et b et tournée de phi
pas = 0.5;
t = 0:pas:%pi/2;
X = a*cos(t);
Y = b*sin(t);
n = 4*size(X,'*');
XY1 = [X, -flipdim(X,2), -X, flipdim(X,2);...
Y, flipdim(Y,2), -Y, -flipdim(Y,2)];
bruit = var*rand(XY1, 'normal')
XY = rotate(XY1, phi) + [xc*ones(1,n);yc*ones(1,n)] + bruit;
endfunction
// **********
// Programme principal
// **********
// Génération des données
XYdef = cree_points(xcinit, ycinit, ainit, binit, phiinit, varbruit);
Xdef = XYdef(1,:)';
Ydef = XYdef(2,:)';
// enregistrement
write('ellipse_bruitee.txt', XYdef')
Fitting. Very similar to File:Regression elliptique distance algebrique donnees gander.svg.
// **********
// Initialisation
// **********
clear;
chdir('monchemin/');
// **********
// Fonctions
// **********
function [a] = regression_elliptique(X, Y)
// méthode de la distance algébrique
// X, Y : points expérimentaux, matrices colonnes réelles
// a : coefficients de la formule quadratique (matrice colonne réelle)
D = [X.*X, X.*Y, Y.*Y, X, Y, ones(X)]; // matrice de conception (design m.)
S = D'*D; // matrice de dispersion (scatter m.)
C = zeros(6,6);
C(1,3) = 2; C(2,2) = -1; C(3,1) = 2; // matrice de contrainte
[vecpropres, valpropres] = spec(inv(S)*C); // détermination du
// système propre
if imag(vecpropres) <> 0 then
error('Les vecteurs propres contiennent des valeurs complexes')
end
if imag(valpropres) <> 0 then
error('Les valeurs propres contiennent des valeurs complexes')
end
vecpropres = real(vecpropres); // complexes -> réels
valpropres = real(valpropres);
[PosLigne, PosColonne] = find((valpropres > 0 & ~isinf(valpropres)));
// recherche les indices des valeurs propres positives
a = vecpropres(:, PosLigne); // vecteur propre correspondant
endfunction
function [phi]=trouve_rotation(A)
// A : coefficients de la formule quadratique (matrice colonne réelle)
// phi : angle que fait un axe de l'ellipse avec x (radians)
delta = 1 - 1/(1 + (A(3) - A(1))^2/A(2)^2);
absphi = acos(sqrt((1 + sqrt(delta))/2));
signephi = sign(A(2)*(cos(absphi)^2 - sin(absphi)^2)/(A(1) - A(3)));
phi = signephi*absphi;
endfunction
function [x,y]=trouve_centre(A)
// A : coefficients de la formule quadratique (matrice colonne réelle)
// x, y : coordonées du centre de l'ellipse (réels)
delta = A(2)^2 - 4*A(1)*A(3);
x = (2*A(3)*A(4) - A(2)*A(5))/delta;
y = (2*A(1)*A(5) - A(2)*A(4))/delta;
endfunction
function [rx, ry]=trouve_rayons(a, phi, xc, yc)
// a : coefficients de la formule quadratique (matrice colonne réelle)
// phi : angle que fait un axe de l'ellipse avec x
// xc, yc : coordonnées du centre de l'ellipse
// rx, ry : rayons (grand et petit demi-grands axes) de l'ellipse
A = [a(1), a(2)/2 ; a(2)/2, a(3)];
Q = rotate([1,0;0,1], phi); // matrice de rotation
t = [xc;yc]; // matrice de translation
Abar = Q'*A*Q;
b = [a(4);a(5)];
bbar = (2*t'*A + b')*Q;
c = a(6);
cbar = t'*A*t + b'*t + c;
rx = sqrt(-cbar/Abar(1,1));
ry = sqrt(-cbar/Abar(2,2));
endfunction
function [] = trace_ellipse(xc, yc, a, b, phi)
// trace l'ellipse de centre (xc, yc)
// de rayons a et b et tournée de phi
pas = 0.1;
t = 0:pas:%pi/2;
X = a*cos(t);
Y = b*sin(t);
n = 4*size(X,'*');
XY1 = [X, -flipdim(X,2), -X, flipdim(X,2);...
Y, flipdim(Y,2), -Y, -flipdim(Y,2)];
XY = rotate(XY1, phi) + [xc*ones(1,n);yc*ones(1,n)];
xpoly(XY(1,:), XY(2,:));
endfunction
// **********
// Programme principal
// **********
// lecture des données
XYdef = read('ellipse_bruitee.txt', -1, 2);
Xdef = XYdef(:,1);
Ydef = XYdef(:,2);
// Régression
aopt = regression_elliptique(Xdef, Ydef);
// affichage des paramètres
disp(aopt);
phi = trouve_rotation(aopt);
phideg = phi*180/%pi;
[xc, yc] = trouve_centre(aopt);
[a, b] = trouve_rayons(aopt, phi, xc, yc);
disp('phi = '+string(phi)+' rad = '+string(phideg)+'°.');
disp('C('+string(xc)+' ; '+string(yc)+').');
disp('a = '+string(a)+' ; b = '+string(b)+'.');
// tracé
clf;
plot(Xdef, Ydef, 'b+');
isoview(0, 8, -0.5, 6);
plot(xc, yc, 'r+');
trace_ellipse(xc, yc, a, b, phi);
ell = gce();
ell.foreground = 5;
רישיון
[עריכה]אני, בעל זכויות היוצרים על היצירה הזאת, מפרסם אותה בזאת תחת הרישיונות הבאים:
מוענקת בכך הרשות להעתיק, להפיץ או לשנות את המסמך הזה, לפי תנאי הרישיון לשימוש חופשי במסמכים של גנו, גרסה 1.2 או כל גרסה מאוחרת יותר שתפורסם על־ידי המוסד לתוכנה חופשית; ללא פרקים קבועים, ללא טקסט עטיפה קדמית וללא טקסט עטיפה אחורית. עותק של הרישיון כלול בפרק שכותרתו הרישיון לשימוש חופשי במסמכים של גנו.http://www.gnu.org/copyleft/fdl.htmlGFDLGNU Free Documentation Licensetruetrue |
הקובץ הזה מתפרסם לפי תנאי רישיונות קריאייטיב קומונז ייחוס-שיתוף זהה 3.0 לא מותאם, 2.5 כללי, 2.0 כללי ו־1.0 כללי.
- הנכם רשאים:
- לשתף – להעתיק, להפיץ ולהעביר את העבודה
- לערבב בין עבודות – להתאים את העבודה
- תחת התנאים הבאים:
- ייחוס – יש לתת ייחוס הולם, לתת קישור לרישיון, ולציין אם נעשו שינויים. אפשר לעשות את זה בכל צורה סבירה, אבל לא בשום צורה שמשתמע ממנה שמעניק הרישיון תומך בך או בשימוש שלך.
- שיתוף זהה – אם תיצרו רמיקס, תשנו, או תבנו על החומר, חובה עליכם להפיץ את התרומות שלך לפי תנאי רישיון זהה או תואם למקור.
הנכם מוזמנים לבחור את הרישיון הרצוי בעיניכם.
היסטוריית הקובץ
ניתן ללחוץ על תאריך/שעה כדי לראות את הקובץ כפי שנראה באותו זמן.
תאריך/שעה | תמונה ממוזערת | ממדים | משתמש | הערה | |
---|---|---|---|---|---|
נוכחית | 10:13, 21 בדצמבר 2012 | 364 × 414 (22 ק"ב) | Cdang (שיחה | תרומות) | {{Information |Description ={{en|1=sign error in algorithm}} |Source ={{own}} |Author =Cdang |Date = |Permission = |other_versions = }} | |
16:16, 19 בדצמבר 2012 | 323 × 368 (21 ק"ב) | Cdang (שיחה | תרומות) | {{Information |Description ={{en|1=Ellipse fitting with the algebraic distance method (Fitzgibbon). Created with Scilab, modified with Inkscape.}} {{fr|1=Régression elliptique avec la méthode de la distance algébrique (Fitzgibbon).Créé avec Sci... |
אין באפשרותך לדרוס את הקובץ הזה.
שימוש בקובץ
אין דפים המשתמשים בקובץ זה.
מטא־נתונים
קובץ זה מכיל מידע נוסף, שכנראה הגיע ממצלמה דיגיטלית או מסורק שבהם הקובץ נוצר או עבר דיגיטציה.
אם הקובץ שונה ממצבו הראשוני, כמה מהנתונים להלן עלולים שלא לשקף באופן מלא את הקובץ הנוכחי.
כותרת קצרה | Régression elliptique |
---|---|
כותרת התמונה | Creator: GL2PS 1.3.2, (C) 1999-2006 Christophe Geuzaine (geuz@geuz.org)
For: Scilab CreationDate: Fri Dec 21 11:09:48 2012 |
רוחב | 413.80469 |
גובה | 364.31445 |