How can I draw a circle on an image in MATLAB? -
I have a picture in MATLAB:
im = rgb2gray (imread ('some_image .jpg ';;;);;); Normal value = IM / max (max);
to be between 0 and 1 and I have done some processing, Which I want to highlight:
points = some_processing (IM);
Where digits
is the same size as a matrix
/ P>
It seems to be somewhat rude. What is a way to solve the same as the [x_p, y_p] = find (digits); [x, y (= 1), 1: aa Doors (IM, 1), 1: size (IM, 2)) R = 5; Circle = zero (size (IM)); For = 1: length (x_p) circle = circle + (floor ((x - x_p (k)). ^ 2 + (y - y_p (k)). ^ 2) == r); End% normal circle circle = circle / max (max (circle)); Output = IM + circles; Emasho (Output)
line
function?
You can use the common command with one:
[X_p, y_p] = find (digits); Imshow (im); % # Hold your image; Add later plots to% # image plot (y_p, x_p, 'o'); % # Note: x_p and y_p are switched (see note below)! Hold down; % # Will be overwritten by any subsequent plot!
You can also adjust these other properties of plot marker: ,,,
If you want to save the new image again from the pictures placed on the markers, then you
Note: with image data (or, etc.) ) While plotting, the general meaning of rows and illustrations can ask a question about retaining the image dimension. Columns are basically flipped. Generally, the first dimension (i.e. rows) of the data is considered as the data written on the x-axis, and possibly as the first set of values returned by the function, you x_p
However, IMSHOW displays the first dimension of image data with y-axis , so the first value returned by FIND is to end y-coordinate value in this case Happens
Comments
Post a Comment