Xref: utzoo comp.windows.x:11684 comp.graphics:6550 Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!bloom-beacon!mit-eddie!eric From: eric@eddie.MIT.EDU (Eric Van Tassell) Newsgroups: comp.windows.x,comp.graphics Subject: A fast algorithm to find all closed regions in an image Keywords: closed regions Message-ID: <12247@eddie.MIT.EDU> Date: 20 Jul 89 23:29:29 GMT Organization: MIT EE/CS Computer Facility, Cambridge, MA Lines: 41 Does anybody have a fast algorithm for taking an image (collection of pixel values) and determining the closed regions? See ascii pic below. |------------------------------------------------------------| | * * | | * 1 * | | * * | | **************** | | * * | | * 2 * | | * *********** | | * * * 3 * | | ******* ********** | | ** * | | ************ ******* | | * 4 * | | *************************** | | | | | |------------------------------------------------------------| What I want is an algorithm (fast) that will tell me that regions 2,3,4 are closed (and can be filled) but region 1 is not. By "telling me that they are closed I supposed I mean that the algorithm should return a list of lists of points representing the polygonal boundaries of all enclosed regions. I will be doing this under X11R3 but I am mostly concerned with a fast algorithm and dont really care if it is X specific. As a matter of fact since I will have to port this to PM, dependance on X would be a lose. But since I am asking for free advice I'll take anything. TIA! eric@eddie.mit.edu -- Eric Van Tassell(dlcdev!eric@eddie.mit.edu) Progress Software Corp. 22B Cotton Rd. Nashua, NH 03063 {603-882-2488}