|
"Dave Brackett" <davebrackett@hotmail.com> wrote in message <gi3da6$ig9$1@fred.mathworks.com>...
> shailesh gupta <sha.gupta.88@gmail.com> wrote in message <7613d61e-d2a3-4f28-95be-428eb314332a@w24g2000prd.googlegroups.com>...
> > Hi
> > I am trying to make a Gui in which i load image in axes. User has to
> > click anywhere in the image and i have to know where he clicked. i.e I
> > want to get co-ordinates of the point of mouse-click.
> > I tried it out. I am getting points without image i.e. on blank axes.
> > But with image, nothing happens..
> > Can anyone help me out with what to do..
> >
> > thanking in advance...
>
> It works fine for me. Check that your code is similar to this:
>
> h=imread('image_file.jpg');
> figure
> image(h)
> [x,y]=ginput(5)
>
> where 5 is the number of points. if you use ginput you can take unlimited points, but the user has to press enter after the last point. also note, that you won't get the coordinates until all of the points have been taken (as far as I'm aware).
sorry just realised that you wanted it in a GUI. it is basically the same, but replaces 'figure' in the second line with 'axes(handles.axes1)' or whatever your axes tag is.
|