From: Elior on
hi
I would like to set several ROI on an image, as shown in the code below

fig = figure;
I = imread('coins.png');
imshow(I);

roi1 = imrect;
position = wait(roi1);

roi2 = imrect;
position = wait(roi2);

Now, based on a user click on the figure, how can I retrieve which of the ROIs was selected?

Thanks, Elior