Dea all, I am doing some image analysis. My basic problem is that images and plots in matlab have different conventions on their coordinate system (CS) and this screws me. this makes some stuff really tricky and i could not yet solve that:
clear all;close all
I = imread('coins.png');
figure(1); imagesc(I); colormap(gray); axis equal; axis tight; hold on;
[centers, radii, metric] = imfindcircles(I,[15 30]);
viscircles(centers, radii,'EdgeColor','b');
plot(centers(:,1),centers(:,2));
x=round(centers(1,1))-5:round(centers(1,1))+5;
y=round(centers(1,2))-5:round(centers(1,2))+5;
I(x,y)=0;
figure(2)
imagesc(I); colormap(gray); axis equal; axis tight; hold on;
plot(x,y,'.')
additionally, I want the image CS to match the plot CS, such that the pixel (0,0) is in the lower left, (1,0) it right neigbor and (0,1) just above (0,0). I manageed to do this via
figure(); imagesc(I'); set(gca,'YDir','normal');
but this screws up coordinate matching completely. can you help me?
In the end I need plot(point1,point1) and I(point1,point2) to be displayed in the same spot, within the standard plot CS.
Thank you very much for any suggestions!