Patent attributes
Vectorizing a raster image includes identifying a connectivity component in the raster image, detecting a contour of the connectivity component, building tangent vectors for each point of the contour, for each sharp angle of the contour, positioning a segmentation point of two segments at a point thereof, for each location of high curvature of the contour, positioning segments proximal thereto, composing an optimization task to approximate a piecewize Bezier curve, solving the optimization task to provide a vectorization of the raster image, and, in response to there not being a sufficient number of segments, adding additional segments. Vectorizing a raster image may also include applying perspective, color, brightness and contrast correction to the raster image and building a binary black-white representation of the raster image prior to identifying the connectivity component. The optimization task may minimize a root-mean square deviation of the piecewize Bezier curve.