ginput returning non integer values of pixels (matlab)

748 views Asked by At

I am trying to use ginput to return the indices of the a pixel I click on from within an .bmp image I have displayed using imshow(). For some reason it's returning non integer values which is impossible, you can't half a pixel which is what I'm getting for some reason. Anyone have any reason why this is happening.

1

There are 1 answers

0
Robert McMurry On

My understanding is that ginput returns coordinates of the mouse click based on a set of axes in the figure.

I would recommend scaling the axes of the figure to correspond to the number of pixels in the image. and then either rounding up or down to get the integer value of the given pixel.

Hope that helps.