havakok
havakok

Reputation: 1247

Extracting actual pixel number from `ginput()`

I am using the following code on a given image:

imshow(image);
[out1,out2]=ginput(1);

I am getting a non-integer relative number.

Upvotes: 0

Views: 243

Answers (1)

Adriaan
Adriaan

Reputation: 18172

ginput gives you relative positions, so

round(ginput(1))

should get you to the centre of the pixel, which is what you'll probably want, as it's difficult to select matching features on a level finer than pixels. If you can select features on a level finer than pixels, you should of course use that, and do that for both images.

Upvotes: 1

Related Questions