2. The method of claim 1 , wherein the first down-sampling ratio is calculated from the input image, and the second down-sampling ratio for each line segment is calculated from the line segment.
2. The method of claim 1 , wherein the first down-sampling ratio is calculated from the input image, and the second down-sampling ratio for each line segment is calculated from the line segment. 3. The method of claim 2 , further comprising, before step (a), calculating the first down-sampling ratio, which comprises: (h1) detecting connected regions in the input image; (h2) calculating a horizontal distance between each pair of horizontally adjacent connected regions detected in step (h1); (h3) calculating a first average horizontal distance which is an average of all horizontal distances calculated in step (h2); and (h4) setting the first down-sampling ratio based on the first average horizontal distance calculated in step (h3).