views:

166

answers:

1

hi, please help with Matlab beginner challenge i need to create an image with few geometrical objects (circles, ellipses) and then to apply some projective transforms my problem is that i cant understand how to actually "drow" on image

image is AFAIU generally defined as [X;Y;3] matrix, functions as SCIRCLE1 can compute/return collection of points representing circle, but the problem is that points are not discrete , coordinates are real numbers and not pixels

how can i recompute the scircle output to be valid in image coordinates system ? i.e. how can i "pixelize" it?

thanks for your attention, i really missing some basic concept and will appreciate your help

John

A: 

well, below is an answer i received on Matlab newsgroups BOTTOM LINE-no built-in way in Matlab

====================================== 'getframe' can be used to merge axes even though it is more commonly used to create movie frames.

MATLAB is really weak in this area. There are some primitive functions for drawing into the overlay (such as rectangle() if you want to draw a circle, and line() if you want to draw a line) but no real way that I know of to draw right into the underlying image. So you have to use "tricks" such as getframe and then apply logical operations. And you have to be careful with that since I think when it gives you the rasterized version of the overlay it might be the size of the image on the screen, not the true original matrix size of the underlying image (I'd have to recheck this).

full thread here : http://www.mathworks.com.au/matlabcentral/newsreader/view_thread/261232

noisybobx7