필터 지우기
필터 지우기

white ellipse in black background

조회 수: 1 (최근 30일)
tala
tala 2017년 7월 31일
댓글: tala 2017년 8월 1일
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

채택된 답변

Walter Roberson
Walter Roberson 2017년 7월 31일
편집: Walter Roberson 2017년 7월 31일
[x, y] = meshgrid(1:512, 1:512);
result = (x-a).^2./A.^2 + (y-b).^2./B.^2 < 1;
  댓글 수: 2
tala
tala 2017년 8월 1일
thanks a lot for your answer
tala
tala 2017년 8월 1일
could you please tell me now how can i rotate this ellipse for example 80 degrees?

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Image Processing Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by