How to display coordinates and use ginput

It doesn't seem to me that my image displays the coordinates of my mouse cursor, and also uses ginput to store points at the same time.

I am currently trying to do the following:

MriHotrod = imread('Image.bmp');
Fig = figure('Name','BobDole'),...
    imshow(Image, 'InitialMagnification', 250)

axis on
impixelinfo

Image_1 = ginput(4)

close BobDole

ginput still works, but impixelinfo remains constant

Pixel Info = (X, Y) Pixel Value

I know some ways around this, but they include functions. This seems like a pretty simple problem that can avoid using functions.

+5
source share
1 answer

If you type edit ginputand scroll to line 238-ish, you will see

% Adding this to enable automatic updating of currentpoint on the figure 
set(fig,'WindowButtonMotionFcn',@(o,e) dummy());

, ginput a WindowButtonMotionFcn . , impixelinfo , , ginput.

, impixelinfoval (, impixelinfo), 83:

callbackID = iptaddcallback(hFig,'WindowButtonMotionFcn', @displayPixelInfo);

: reset , 4 ?

222-ish ginput:

initialState.uisuspendState = uisuspend(fig);

-, uisuspend , WindowButton*, reset . ,

%initialState.uisuspendState = uisuspend(fig);

ginput, , , .

, . , , , .

+4

All Articles