Scaling and rotating the image by selecting three known reference point in image

I have a image with lithography alignment mark on them. The distance between the mark is 200 micro meter and two alignment mark are in straight line. While taking image in microscope the image gets little rotated and the distace between the markers is in pixels. I want to write a program where I will upload the image, select three markers, assign coordinate to them and the program should return me with the scaled and roated image such that distance between marker is 200 micro meter and these markers are in straight line.
I know how to read, rotate and scale but the I am facing problem in asigning cordinate to referece points.

Antworten (1)

Matt J
Matt J am 16 Aug. 2021
You could use drawpoint() or drawcrosshair(). This will return an object containing the position coordinates of the selected point.

4 Kommentare

I dont want to draw a point in the image. Suppose I click at one of the cross mark in the image it should give me coordinate of that point. The idea is if I get coordinate of 3 crosses in the image then I can use 3 point alignment to correct the image.
Matt J
Matt J am 16 Aug. 2021
Bearbeitet: Matt J am 16 Aug. 2021
Suppose I click at one of the cross mark in the image it should give me coordinate of that point.
As I said, the object returned by drawpoint() will give you the coordinates at the selected location. Once you have that, you can delete the point object from the image.
Use function ginput after display your image.
[x,y] = ginput(3);
I don't recommend ginput, since that will not give you the option of refining the position of the selected locations, as in the following:
obj=drawpoint;
wait(obj) %%double-click on the point to proceed from here.
coordinates=obj.Position,
delete(obj)

Melden Sie sich an, um zu kommentieren.

Produkte

Version

R2020b

Tags

Gefragt:

am 16 Aug. 2021

Bearbeitet:

am 16 Aug. 2021

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by