roipolyaa.m

Select a region of interest with blended (anti-aliased) edges
443 Downloads
Updated 10 Jul 2014

View License

roipolyaa: Region of Interest Polygon Anti-Aliased.
This function works the same way as roipoly in the image processing toolbox, with one change. Elements along the boundary are shaded, depending on how far across the boundary they are. This removes the stepped edges when being used for image processing, creating a much smoother, antialiased polygon.

The method is as discussed on this blog post:

http://blogs.mathworks.com/steve/2007/02/06/antialiased-polygon-scan-conversion/

The function works in Matlab with no additional toolboxes.

The screenshot shows a mask using 'inpolygon' alone (left) and using roipolyaa (right). At full resolution, the right thumbnail has smoother edges.

It can be quite slow for large masks, especially if strong antialiasing is required. The majority of the time spent on the use of 'inpolygon'. It may be possible to speed this up by using one of the inpolygon replacements here on File Exchange.

Cite As

Andrew Simpson (2024). roipolyaa.m (https://www.mathworks.com/matlabcentral/fileexchange/47190-roipolyaa-m), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2014a
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

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

Start Hunting!
Version Published Release Notes
1.1.0.0

Updated description and tags

1.0.0.0