How can I add functionality to move an ROI created using the ROIPOLY function around the image axes?

2 views (last 30 days)
I can use the ROIPOLY function to create an ROI (region of interest) that can be used to extract useful information from an image. However, after creating this ROI, I would like to be able to shift it interactively to a different location in the image.

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 21 Jan 2010
The ability to move an ROI created with the ROIPOLY function is not available in the Image Processing Toolbox.
To work around this issue, download the following ZIP-file which contains an example that illustrates how this feature can be implemented. To view this example, run the file named "main".
The example creates a figure with 2 sets of axes. The left set of axes contains the ROI applied to a grayscale image of US coins. Only the area defined by the ROI is visible. The right set of axes contains a binary image where the ROI is represented by the foreground (white object). When you click in the center of the ROI in the right axes, you can drag it around the image. When you release the mouse button, the ROI in the left axes moves to the new position.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!