US 12,417,567 B2
Method for generating signed distance field image, method for generating text effect image, device and medium
Liyou Xu, Beijing (CN); and Chenxiang Zhao, Beijing (CN)
Assigned to BEIJING ZITIAO NETWORK TECHNOLOGY CO., LTD., Beijing (CN)
Filed by BEIJING ZITIAO NETWORK TECHNOLOGY CO., LTD., Beijing (CN)
Filed on Jul. 24, 2023, as Appl. No. 18/357,651.
Application 18/357,651 is a continuation in part of application No. PCT/CN2021/133879, filed on Nov. 29, 2021.
Application 18/357,651 is a continuation in part of application No. PCT/CN2021/135953, filed on Dec. 7, 2021.
Application 18/357,651 is a continuation in part of application No. PCT/CN2022/072915, filed on Jan. 20, 2022.
Application 18/357,651 is a continuation in part of application No. PCT/CN2021/133880, filed on Nov. 29, 2021.
Application 18/357,651 is a continuation in part of application No. PCT/CN2022/072916, filed on Jan. 20, 2022.
Application 18/357,651 is a continuation in part of application No. PCT/CN2021/135952, filed on Dec. 7, 2021.
Claims priority of application No. 202110118987.7 (CN), filed on Jan. 28, 2021; application No. 202110118989.6 (CN), filed on Jan. 28, 2021; application No. 202110121057.7 (CN), filed on Jan. 28, 2021; application No. 202110121063.2 (CN), filed on Jan. 28, 2021; application No. 202110121068.5 (CN), filed on Jan. 28, 2021; and application No. 202110134319.3 (CN), filed on Jan. 28, 2021.
Prior Publication US 2024/0005573 A1, Jan. 4, 2024
Int. Cl. G06T 11/20 (2006.01); G06T 7/90 (2017.01); G06V 10/56 (2022.01); G06V 10/75 (2022.01)
CPC G06T 11/203 (2013.01) [G06T 7/90 (2017.01); G06V 10/56 (2022.01); G06V 10/751 (2022.01); G06T 2207/10024 (2013.01)] 20 Claims
OG exemplary drawing
 
1. A method for generating a signed distance field image, comprising:
determining a target closed curve in an unsigned distance field image of target text, and determining an origin corresponding to the target closed curve;
drawing a target triangle by taking two adjacent sample points on the target closed curve and the origin as vertices according to a sampling order of the adjacent sample points, wherein the sampling order is a preset direction along the target closed curve;
performing counting for pixels within the target triangle based on a drawing direction of the target triangle, wherein
the drawing direction of the target triangle is a clockwise direction or a counterclockwise direction;
a counting manner in a case where the drawing direction is the clockwise direction is inverse to a counting manner in a case where the drawing direction is the counterclockwise direction; and
the counting manners comprise increment by N per count or decrement by N per count, and N is a nonzero number;
determining that pixels having counting results equal to 0 in the unsigned distance field image are located in an interior region of the target text, and determining that pixels having counting results not equal to 0 in the unsigned distance field image are located in the exterior region of the target text; and
generating a signed distance field image of the target text based on the pixels located in the exterior region of the target text, the pixels located in the interior region of the target text, and the unsigned distance field image.