Re: Pixel values surrounding object of interest



Matlab has an undocumented handle-graphics property called
'PixelBounds'. However, note that it returns data in Java coordinates
(origin = top-left), rather than Matlab ones (origin = bottom-left).
Also, I have found some cases in which this value is undependable,
which is a real pity.

So, the solution I use is to retrieve the java handle of an object
(with FINDJOBJ in the File Exchange) and then calling the getLocation
function on this object:

jobj = findjobj(hobj);
objLocation = jObj.getLocation; % or: get(jobj,'Location')

Yair Altman
.