Patent Document ID: 20170350051
Application ID: 15613171
Patent Status: 0

Claim One:
1. A method of converting a photographic Image Into realistic and customized embroidery using software to perform the following: a) computer software reads a photographic image and calculates the size of an embroidered product based on a frame size selected by a user; b) said photographic image is down-sampled or up-sampled so that a single pixel of said photographic image has a predefined size approximately 0.06 mm, defined as Density, resulting in a photographic image close to 42.3 DPI; c) two copies of said image are stored, one as color image (C 1 ) and one as grayscale image (G 1 ); d) for each pixel of the grayscale image (G 1 ), the software calculates the partial derivatives (dx and dy) of said photographic image using a SOBEL operator; from the two partial derivatives (dx and dy), the software calculates a SOBEL Angle, which is a tan 2(dy,dx) and the magnitude (M), which is sqrt(dx̂2+dŷ2), and stores them to a table (SOBEL table); e) the software or user selects the number of colors to be used (usually between 10 and 15 colors) and then the software materializes the color selection and reduction of the C 1 image, using a median-cut algorithm; f) the software then calculates a series of open polylines that connect same-color pixels using the following method: i. start from an unused pixel closest to the lowest left corner of the photographic image and mark it as used (PIXEL); ii. read the SOBEL Angle of the PIXEL from the SOBEL table; iii. find a new unused pixel near the PIXEL with the same color, favoring the pixel towards the SOBEL Angle, mark it as used and add it as a point to the polyline; iv. continue with step ii until all closest pixels (max. 3 pixels distance) are gathered, resulting in a stored polyline that is the same color as the pixels from which this polyline was generated; v. start a new polyline from step i for as long as unused pixels exist; g) the software minimizes the number of resulting polylines to a manageable size using the following rules: i. if two separate polylines of the same color (p 1 , p 2 ) have a point where they come close (less than 2.5 mm), join them at said point into one polyline (P-result); ii. if there is a very small polyline that has less than 7 points, join said very small polyline to any similar color polyline, so that the color of the resulting polyline remains the color of the largest of the two (joined) polylines; iii. discard polylines with only one or two points; iv. group the polylines by color and place the color polyline groups from dark to light, if the base fabric color is dark, or from light to dark, if the base fabric color is light, so that the color polyline groups are put into one sequence; v. get pairs of polylines with the same color and determine if there is any path that passes underneath pixels that will be covered later in the sequence; if this is true, join the two polylines at such path; where more than one path satisfies this criteria, join the polylines at the shortest path; and h) the software generates the embroidery using an embroidery machine to execute the following procedure: i. all points of the polylines have their coordinates multiplied by the Density on output, so that the resulting stitch data is in physical units (mm); ii. for each of the polylines, output the first point of the polyline as-is to the embroidery machine; iii. for all other points of the polyline, the software executes the following: a. read the SOBEL Angle and the Magnitude of the point from the SOBEL table; b. If the Magnitude is less than 0.0001, output the point as-is, then continue with the next point from step a; c. Move the point to a pre-defined distance close to 2.0 mm, perpendicular to the SOBEL angle defined in the SOBEL table; for odd points, add 90 degrees to the SOBEL Angle, for even points, subtract 90 degrees from the SOBEL Angle to calculate the resulting perpendicular angle; d. Output the point to the embroidery machine and return to step a; and iv. append embroidery commands to the embroidery machine as follows: a. if the polyline is the last, the software signals an end of a command list to the embroidery machine and finish; b. if the following polyline has the same color, the software instructs the embroidery machine or a user to cut the thread and jump to step h(i) and; c. if the following polyline has a different color, the software instructs the embroidery machine or user to change the thread color and jump to step h(i).