Be the first to rate this file! 18 Downloads (last 30 days) File Size: 13.2 KB File ID: #32543
image thumbnail

Maximum Inscribed Circle using Voronoi Diagram

by Tolga Birdal

 

15 Aug 2011

A fast, subpixel accurate largest inner circle detection using Voronoi Diagrams

| Watch this File

File Information
Description

A sample application and a function for solving the maximum inscribed circle problem.
Unlike my other submission "Maximum Inscribed Circle using Distance Transform" (at http://www.mathworks.com/matlabcentral/fileexchange/30805-maximum-inscribed-circle-using-distance-transform), this algorithm is subpixel accurate. It operates only on the polygon and not the image points. Therefore, if the polygon is given in sub-pixels, the result will be accurate.
I use an O(n log(n)) algorithm as follows:
- Construct the Voronoi Diagram of the polygon.
- For Voronoi nodes which are inside the polygon:
- Find the node with the maximum distance to edges in P. This node is the centre of the maximum inscribed circle.
 
 For more details on the problem itself please checkout my previous submission as mentioned above.
 
 To speed things up, replace "inpolygon" function by Bruno Lunog's faster implementation "2D polygon interior detection" :
 http://www.mathworks.com/matlabcentral/fileexchange/27840-2d-polygon-interior-detection
 
 Copyright (c) 2011, Tolga Birdal <http://www.tbirdal.me>;

Acknowledgements

The author wishes to acknowledge the following in the creation of this submission:
Fast points-in-polygon test

Required Products Image Processing Toolbox
MATLAB release MATLAB 7.9 (2009b)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Please login to add a comment or rating.
Tag Activity for this File
Tag Applied By Date/Time
largest inner circle Tolga Birdal 16 Aug 2011 09:26:57
maximum empty circle Tolga Birdal 16 Aug 2011 09:26:57
maximum inscribed circle Tolga Birdal 16 Aug 2011 09:26:57
binary image processing Tolga Birdal 16 Aug 2011 09:26:57
voronoi diagram Tolga Birdal 16 Aug 2011 09:26:57
inpolygon Tolga Birdal 16 Aug 2011 09:26:57
subpixel Tolga Birdal 16 Aug 2011 09:26:57

Contact us at files@mathworks.com