Hi, I have images of a sample that has been analysed. The analysed spots can be seen on the image. I also have the XY-coordinates of the analysed spots. I want to reference the image to those analysed spots using fitgeotrans and imwarp. I get the image to rotate and stretch accordingly but I want the datapoints to plot on top of the image or to show the image below the datapoints. I'm using the functions in a gui, so I define the moving and fixed points using ginput. I want the moving and fixed points to plot at the exact same position in the diagram after carrying out the transformation. Instead the image is transformed correctly but is not stretched so that the fixed and moving points are located perfectly on top of each other.
Here are the code snippets that I use for the transformation at the moment:
movingPoints = ginput(2);
[xfix,yfix,~] = MagnetGInput(h,length(movingPoints));
tform = fitgeotrans(movingPoints,[xfix(1) yfix(1); xfix(2) yfix(2)],'NonreflectiveSimilarity');
img_new = imwarp(img,tform);
im = image(xlim,ylim,img_new);
im.AlphaData = 0.5;
In the attached photo I want the middle red line to span the whole range of the aligned circles. It is kind of parallel already but is to short. For referencing I clicked on the very ends of this line and on the very end of the line defined by the circles.
I would be very happy about some help. Thank you very much!