I'm attempting to draw a circle and a straight line a=b over an imported image. The plot appears but I've run into two problems:
- The image is not centered - here, the circle is supposed to be in the center of the image
- The line appears with an inverted slope
clear;close all;
I0 = imread('temp.png');
I1 = im2double(I0);
I = imresize(I1,[320 320]);
a=0:1:320;
b = a;
r=320/2;
xc=0; yc=0;
th = linspace( 0, 2*pi, 100);
x = r * cos(th) + xc;
y = r * sin(th) + yc;
figure,imshow(I)
hold on
plot(b,a,'linewidth',3)
hold on
plot(x,y,'white','linewidth',3)
I can fix the slope of the line by plotting (b,-a,'linewidth',3) instead but the line does not draw over the image.
Any help would be much appreciated. Yes this is for an assignment but it would not the final answer at all :)
