How to draw a curved rectangle on a matrix with given two points?

조회 수: 3 (최근 30일)
John W. Z
John W. Z 2016년 3월 31일
댓글: Joachim Schlosser 2016년 4월 1일
How to draw a curved rectangle matrix with given two points?
Assume, two points given:
a = [1,0.5];
b = [1,3.5];
And the created curved rectangle should be like this:
But the point is, all I finally want, is an image matrix return, not just to plot this figure using rectangle(); on screen.
Thanks, guys~
ps: in a binary scale.

답변 (1개)

Joachim Schlosser
Joachim Schlosser 2016년 3월 31일
If you want an image matrix, I still suggest using rectangle() to first draw, then exporting the figure to bitmap for getting the image matrix.
  댓글 수: 2
John W. Z
John W. Z 2016년 3월 31일
Hi Joachim, Thanks for your answer, It would work if I use getframe() converting figure to matrix, but it seems lack of efficiency, in which the speed is chief consideration. I found insertShape() could insert image to matrix, but I failed even with times trying. Would you mind help me with this?
Joachim Schlosser
Joachim Schlosser 2016년 4월 1일
insertShape cannot directly draw rounded rectangles. You may first want to try the above solution using
set(0,'DefaultFigureVisible','off');
to disable the display of the figure and thus drastically increase speed.

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

카테고리

Help CenterFile Exchange에서 Image Segmentation and Analysis에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by