MATLAB: Impixel info – just coordinates

imageImage Processing Toolboximpixelinfopixel

Is it possible to obtain just the pixel x y vlaues from the impxelinfo command?
Im using this and want to get the X & Y seperately.
hp = impixelinfo;
set(hp,'Position',[5 1 300 20]);
Thanks Jason

Best Answer

Moved comment to here:
From impixelinfo question, which is a similar question to yours, Ashish Uthama suggests either to use ginput or to grab the coordinate data as
childHandles = get(hp,'Children');
get(childHandles(1),'Tag')
ans =
pixelinfo text
get(childHandles(1),'String')
ans =
(153, 152) <112> [0.50 0.00 0.00]
where hp is the handle to your impixelinfo object. From the '(153, 152) .<112> [0.50 0.00 0.00]' string, you can figure out the x,y coordinates as 153,152.