MATLAB: How to get pixel coordinates

coordinates

I have a image and have drawn,roipoly command,now i want to get the pixel coordinates,plz tell how to get these coordinates

Best Answer

BW = roipoly(...);
[x,y] = find(BW);