The Raster-to-Vector Conversion Library utilizes the following algorithms:

  1. Morphology Operations
    Morphology operations are performed to separate line, area, and character drawings. By combining filters such as dilation, erosion, and inversion, the library separates lines, areas, and characters from raster images.
  2. Fast Thinning
    Line images are thinned using a fast thinning filter. Simultaneously, spike noise along the lines is smoothed out.
  3. Fast Contour Extraction
    Polygonal contours surrounding regions are obtained without using differential filters.
  4. Optimization Using Least Squares Method
    The combination of vertices that minimizes the total error between the thinned raster and the approximated polygon is calculated using a fast algorithm. Of course, fewer vertices result in smaller errors, so an evaluation function is used to optimize the combination.
  5. Network Path Calculation
    When core vectors intersect, the library obtains the longest path while respecting the angle constraints at the intersection points.
  6. Finite Element Method
    The coordinates of intersection points are optimized using the finite element method. Since the correction of one intersection point affects the correction of neighboring intersection points, coordinate correction is performed using the finite element method to achieve the optimal correction for all intersection points.