1

basically, i am supposed to create a image with circles and lines... not using plot function. because the final output is to pop out by imshow().or image().or imagesc()... and the created image will contiune the color processing.

3 Answers 3

1

The simplest way is to draw it as usual, then use getframe to grab an image of the figure.

EDIT: I don't have time for much detail, but look at the following:

The MATLAB help is really very useful.

2
  • Thanks a lot! i'm doing school project now. actually i am starting from zero, i have little knowledge about matlab. my objective is to create a basic image of body tissue(further more i also need to do the color processing). do you have any suggestions on the topics i need to learn if i want to get these work done? because i really don't know how to start....
    – zuo
    Commented Sep 26, 2011 at 2:20
  • I'm not really sure what you are asking but you can start by up-voting and accepting an answer.
    – Nzbuu
    Commented Sep 27, 2011 at 8:43
1

If you are trying to draw lines and circles directly on a raster image (matrix of pixels), then check out the Bresenham line-drawing algorithm and its variants for circles.

I am sure you can find existing implementations for them on FEX

Another possibility is to show the image (IMSHOW, IMAGESC, ..), use the plotting functions as usual (PLOT, LINE, ...), then grab the displayed figure as image again using GETFRAME as Nzbuu suggested.

0

Use the matlab function "rectangle" and specify the 'Curvature" parameter to one. i.e.

rectangle('Position',[0 0 100 100],'Curvature',[1 1])

This is obviously counter intuitive, but in Matlab, rectangle is the function you use to draw ellipses and circles.

Here is the appropriate mathworks doc:

http://www.mathworks.com/help/techdoc/ref/rectangle.html

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.