Effacer les filtres
Effacer les filtres

white ellipse in black background

1 vue (au cours des 30 derniers jours)
tala
tala le 31 Juil 2017
Commenté : tala le 1 Août 2017
hi every one.
i'm a beginner in matlab. i need to draw a white ellipse in a black background(512*512) as shown in the picture attached below.
i also have the center and axis of the ellipse.
i just need to implement the equation of ellipse:
if (x-a)2/A2 + (y-b)2/B2<1 assign 1 to pixels inside the ellipse
if (x-a)2/A2 + (y-b)2/B2>=1 assign 0 to pixels outside the ellipse
center of ellipse: (a,b)
A & B: min&max axis of ellipse

Réponse acceptée

Walter Roberson
Walter Roberson le 31 Juil 2017
Modifié(e) : Walter Roberson le 31 Juil 2017
[x, y] = meshgrid(1:512, 1:512);
result = (x-a).^2./A.^2 + (y-b).^2./B.^2 < 1;
  2 commentaires
tala
tala le 1 Août 2017
thanks a lot for your answer
tala
tala le 1 Août 2017
could you please tell me now how can i rotate this ellipse for example 80 degrees?

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Image Processing Toolbox dans Help Center et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by