MATH: Image (2 Colors) to Vectors

i need a function, which will convert an image containing 2 colors (black and white) to a list of vectors(lines)/polygons which divide the black part from the white at the edges between them.

  1. Is there already such an function
  2. How do i reduce the produced data (at runtime of the algo), is there a way to approximate the result ?
  3. can i compress an image/data by doing this(or do i waste time trying this):
    1. let algo divide data into 2parts (min to half-max and half-max to max [by chars 0 to 127 and 127 to 255 as starting values] )
    1. store list, compress with other algos
    1. reduce values in area2(the area from half-max to max) by half-max, and set max to half-max
    1. repeat step 1 until max == 1

[This message has been edited by T2k (edited 01-31-2002).]

Not exactly an OpenGL question, but I would look into using a Hough transform if I were you. Depending on the complexity of your images, this can be a pretty expensive operation.