A method, device and equipment for generating a security pattern mosaic bottom line

By generating directional guiding curve groups and adaptive rotation fill color, the problems of excessive pattern regularity and harsh visual effects in existing graphic mosaic technology are solved, thereby improving anti-counterfeiting performance and visual effects.

CN122134539APending Publication Date: 2026-06-02XIAMEN UNIV MALAYSIA BRANCH

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
XIAMEN UNIV MALAYSIA BRANCH
Filing Date
2026-04-17
Publication Date
2026-06-02

AI Technical Summary

Technical Problem

Existing graphic mosaic technology suffers from problems such as overly regular patterns, harsh visual effects, inconsistent angles, and low color sampling accuracy in anti-counterfeiting scenarios, making it difficult to meet the comprehensive requirements of high-end anti-counterfeiting.

Method used

By generating a group of directional guiding curves, combined with the adaptive rotation and color filling of graphic unit objects, a new type of anti-counterfeiting mosaic background is generated, improving anti-counterfeiting performance and visual effects.

Benefits of technology

It achieves smooth angle transitions and precise color filling in the mosaic background of the anti-counterfeiting graphic, improving anti-counterfeiting performance and visual effects, and enhancing the complexity and aesthetics of the anti-counterfeiting graphic.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122134539A_ABST
    Figure CN122134539A_ABST
Patent Text Reader

Abstract

This invention provides a method, apparatus, and device for generating anti-counterfeiting graphic mosaic backgrounds, relating to the field of image processing technology. The method includes: acquiring an original image and at least one graphic unit object; generating a set of directional guiding curves based on the original image; arranging the at least one graphic unit object to generate a graphic object group; aligning the original image, the directional guiding curve group, and the graphic object group to obtain an overlapping image; determining the corresponding point of each graphic unit object in the graphic object group on the vector curve in the directional guiding curve group within the overlapping image; rotating each graphic unit object according to the tangent direction vector of the corresponding point relative to the vector curve to obtain a rotated graphic unit object; and filling the rotated graphic unit object with color to obtain a target graphic mosaic background object. This invention combines directional curve guidance with adaptive grid rotation to generate a novel anti-counterfeiting mosaic background, improving both anti-counterfeiting performance and visual effect.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image processing technology, and in particular to a method, apparatus and equipment for generating anti-counterfeiting graphic mosaic backgrounds. Background Technology

[0002] Image mosaic technology, as a classic image pixelation processing method, is widely used in fields such as image privacy protection, information hiding, and anti-counterfeiting background generation. Traditional image mosaic mainly divides the image into uniformly sized rectangular grids, and fills the grids with a solid color using the average pixel value or the center pixel value within the grid area to achieve image blurring and pixelation. Its implementation is simple and computationally efficient, and it has become one of the fundamental technologies in the field of image processing.

[0003] With the development of graphic design and anti-counterfeiting technology, graphic mosaics are gradually replacing traditional image mosaics, becoming a core technology in scenarios such as anti-counterfeiting backgrounds, special printing, and packaging security. Graphic mosaics are no longer limited to fixed rectangular fillings, but instead construct anti-counterfeiting background patterns with regularity, concealment, and recognizability through the arrangement, deformation, rotation, and color matching of regular graphic units, which can improve the difficulty of counterfeiting and visual recognition.

[0004] However, existing graphic mosaic technology still has obvious defects: graphic units mostly adopt a uniform arrangement with fixed angles and no deflection, resulting in an overly regular overall pattern that is easy to imitate and lacks sufficient anti-counterfeiting security; graphic rotation and direction control lack correlation with guide curves, making it impossible to achieve smooth directional changes along a specified path, resulting in a harsh visual effect and monotonous layers; it is difficult to achieve a smooth transition in angle between undeflected and deflected areas, easily leading to abrupt angle changes and discontinuous background textures, affecting the integrity and aesthetics of the anti-counterfeiting graphic; color sampling and grid filling matching accuracy is low, making it difficult to restore the color distribution and information characteristics of the original image while maintaining the mosaic effect.

[0005] The aforementioned issues make it difficult for existing mosaic technology to meet the comprehensive requirements of high-end anti-counterfeiting scenarios regarding the complexity of the background pattern, directional controllability, visual smoothness, and difficulty of counterfeiting. Summary of the Invention

[0006] This invention provides a method, apparatus, and device for generating anti-counterfeiting graphic mosaic backgrounds, which combines directional curve guidance and grid adaptive rotation to generate novel anti-counterfeiting mosaic backgrounds, thereby improving anti-counterfeiting performance and visual effects.

[0007] To solve the above-mentioned technical problems, the technical solution of the present invention is as follows: A method for generating anti-counterfeiting graphic mosaic backgrounds includes: Acquire the original image and at least one graphics unit object; A set of directional guidance curves is generated based on the original image; the set of directional guidance curves includes at least one vector curve. Arrange at least one graphic unit object according to its type and corresponding array method to generate a graphic object group; The original image, the directional guide curve group, and the graphic object group are aligned to obtain an overlapping image; In the overlapping image, determine the corresponding point of each graphic unit object in the graphic object group on the vector curve in the direction guide curve group; Each of the graphic unit objects is rotated according to the tangent direction vector of the corresponding point relative to the vector curve to obtain the rotated graphic unit object; Based on the color of the corresponding pixel in the original image, the rotated graphic unit object is filled with color to obtain the target graphic mosaic texture object of the original image.

[0008] Optionally, generating a set of directional guidance curves based on the original image includes: Generate the outline structure of the original image based on its shape; The contour structure is converted into at least one vector curve to obtain a set of directional guiding curves.

[0009] Optionally, in the overlapping image, determining the corresponding point of each graphic unit object in the graphic object group on the vector curve in the direction guide curve group includes: Determine the center point of each graphic unit object in the graphic object group; In the overlapping image, determine the point in the group of directional guide curves that is closest to each of the center points; The point closest to each of the center points is taken as the corresponding point of each center point.

[0010] Optionally, in the overlapping image, determining the point in the group of directional guiding curves that is closest to each of the center points via the vector curve includes: When the vector curve in the direction guidance curve group is composed of multiple straight line segments, the point in the vector curve that is closest to the center point is determined according to the position of the perpendicular point of the perpendicular line between the center point and each straight line segment. When the vector curve in the direction guidance curve group is composed of multiple curve segments, a parameter matrix is ​​constructed based on the coordinates of the points on the curve segments and the coordinates of the control points. The intersection point of the straight line passing through the center point and the curve segment is solved based on the parameter matrix. The point in the vector curve that is closest to the center point is determined based on the distance between the intersection point and the center point.

[0011] Optionally, each of the graphic unit objects is rotated according to the tangent direction vector of the corresponding point relative to the vector curve to obtain a rotated graphic unit object, including: Determine the tangent direction vector of the corresponding point of each of the graphic unit objects in the vector curve; The rotation angle is determined based on the angle between the tangent direction vector and the horizontal line; Each of the graphic unit objects is rotated according to the rotation angle and the direction of the tangent direction vector to obtain the rotated graphic unit object.

[0012] Optionally, determining the tangent direction vector of the corresponding point of each of the graphic unit objects in the vector curve includes: When the vector curve in the direction guiding curve group is composed of multiple straight line segments, the tangent direction of the corresponding point is the same as the direction of the straight line segment, and the tangent direction vector is determined according to the endpoint coordinates of the straight line segment; When the vector curve in the direction guidance curve group is composed of multiple curve segments, the corresponding point is taken as a newly added smooth node of the curve segment, and the coordinates of the two control points corresponding to the smooth node are obtained; the tangent direction vector is obtained according to the coordinates of the two control points.

[0013] Optionally, based on the color of the corresponding pixel in the original image, the rotated graphic unit object is filled with color to obtain the target graphic mosaic texture object of the original image, including: Determine the bounding rectangle of the rotated graphic unit object; Based on the average color of each pixel corresponding to the circumscribed rectangle in the original image, the rotated graphic unit object is filled with color to obtain the target graphic mosaic texture object of the original image.

[0014] The present invention also provides an anti-counterfeiting graphic mosaic background generation device, comprising: The acquisition module is used to acquire the original image and at least one graphic unit object; A processing module is configured to generate a set of directional guidance curves based on the original image; the set of directional guidance curves includes at least one vector curve; arrange at least one graphic unit object according to its type and corresponding array method to generate a graphic object group; align the original image, the set of directional guidance curves, and the graphic object group to obtain an overlapping image; determine the corresponding point of each graphic unit object in the graphic object group on the vector curve in the set of directional guidance curves in the overlapping image; rotate each graphic unit object according to the tangent direction vector of the corresponding point relative to the vector curve to obtain a rotated graphic unit object; fill the rotated graphic unit object with color according to the color of the corresponding pixel in the original image to obtain the target graphic mosaic texture object of the original image.

[0015] The present invention also provides a computing device, comprising: a processor and a memory storing a computer program, wherein the computer program, when executed by the processor, performs the method as described above.

[0016] The present invention also provides a computer-readable storage medium storing instructions that, when executed on a computer, cause the computer to perform the method described above.

[0017] The above-described solution of the present invention has at least the following beneficial effects: The above-described solution of the present invention involves: acquiring an original image and at least one graphic unit object; generating a directional guidance curve group based on the original image; the directional guidance curve group including at least one vector curve; arranging the at least one graphic unit object according to its type and corresponding array method to generate a graphic object group; aligning the original image, the directional guidance curve group, and the graphic object group to obtain an overlapping image; determining the corresponding point of each graphic unit object in the graphic object group on the vector curve of the directional guidance curve group in the overlapping image; rotating each graphic unit object according to the tangent direction vector of the corresponding point relative to the vector curve to obtain a rotated graphic unit object; and filling the rotated graphic unit object with color according to the color of the corresponding pixel in the original image to obtain the target graphic mosaic background object of the original image. This method can combine directional curve guidance with grid adaptive rotation to generate a novel anti-counterfeiting mosaic background, improving anti-counterfeiting performance and visual effects. Attached Figure Description

[0018] Figure 1 This is a flowchart illustrating the method for generating anti-counterfeiting graphic mosaic backgrounds according to an embodiment of the present invention. Figure 2This is a schematic diagram of the original image of the anti-counterfeiting graphic mosaic background generation method according to an embodiment of the present invention; Figure 3 This is a schematic diagram of the direction guide curve group of the anti-counterfeiting graphic mosaic background generation method according to an embodiment of the present invention; Figure 4 This is a schematic diagram of a group of graphic objects arranged in the same primitive matrix in the method for generating anti-counterfeiting graphic mosaic background according to an embodiment of the present invention. Figure 5 This is a schematic diagram of a group of graphic objects arranged in different primitive matrices for generating anti-counterfeiting graphic mosaic backgrounds according to an embodiment of the present invention. Figure 6 This is a schematic diagram of a group of graphic objects arranged in an alternating row of odd and even rows, representing the anti-counterfeiting graphic mosaic background generation method of this invention. Figure 7 This is a schematic diagram of a group of graphic objects with different graphic elements randomly arranged in the anti-counterfeiting graphic mosaic background generation method of this invention. Figure 8 This is a schematic diagram of the overlapping image of the anti-counterfeiting graphic mosaic background generation method according to an embodiment of the present invention; Figure 9 This is a schematic diagram of the method for generating anti-counterfeiting graphic mosaic backgrounds according to an embodiment of the present invention, where the directional guiding curve segment is a straight line segment; Figure 10 This is a schematic diagram of the anti-counterfeiting graphic mosaic background generation method according to an embodiment of the present invention, where the directional guiding curve segment is a curve segment; Figure 11 This is a schematic diagram of adding smooth nodes to the curve segments of the anti-counterfeiting graphic mosaic background generation method according to an embodiment of the present invention; Figure 12 This is a schematic diagram illustrating the tangent direction vector calculation effect of the anti-counterfeiting graphic mosaic background generation method according to an embodiment of the present invention; Figure 13 This is a schematic diagram of the rotation of the graphic object unit in the anti-counterfeiting graphic mosaic background generation method according to an embodiment of the present invention; Figure 14 This is a schematic diagram of the target graphic mosaic background object of the anti-counterfeiting graphic mosaic background generation method in this embodiment of the invention; Figure 15 This is a schematic diagram of a graphic mosaic background object formed by a group of graphic objects arranged in different primitive matrices according to the anti-counterfeiting graphic mosaic background generation method of this invention. Figure 16 This is a schematic diagram of a graphic mosaic background object formed by a group of graphic objects arranged in an alternating row of odd and even rows of the same graphic primitives in the anti-counterfeiting graphic mosaic background generation method of this invention. Figure 17This is a schematic diagram of a graphic mosaic background object formed by a group of graphic objects with different graphic elements randomly arranged in the anti-counterfeiting graphic mosaic background generation method of this invention. Figure 18 This is a schematic diagram of the anti-counterfeiting graphic mosaic background generation device according to an embodiment of the present invention. Detailed Implementation

[0019] Exemplary embodiments of the invention will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of the invention are shown in the drawings, it should be understood that the invention may be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this invention will be thorough and complete, and will fully convey the scope of the invention to those skilled in the art.

[0020] like Figure 1 As shown, an embodiment of the present invention proposes a method for generating anti-counterfeiting graphic mosaic backgrounds, comprising: Step 11: Obtain the original image and at least one graphic unit object; Here, as Figure 2 As shown, the original image is a pixel image of the mosaic background to be generated, which is composed of individual pixels. The graphic object group is as follows: Figures 4 to 7 As shown, it consists of multiple graphic unit objects arranged in a matrix, an alternating row and parity row arrangement, or a random arrangement. The graphic unit object can be a graphic unit of any geometric shape.

[0021] Step 12: Generate a set of directional guidance curves based on the original image; the set of directional guidance curves includes at least one vector curve; The direction guidance curve group is as follows Figure 3 As shown, it is the outline structure of the original image obtained by automatically performing edge search on the original image through computer algorithms, or by manually drawing it by hand.

[0022] Step 13: Arrange at least one graphic unit object according to its type and corresponding array method to generate a graphic object group. The graphical object group G can be obtained by arranging common, identical or different graphical unit objects in a standard matrix (e.g., ...). Figure 4 and Figure 5 ), or it can be arranged by the intersection of odd and even rows (e.g. Figure 6 ) or random arrangement (e.g. Figure 7 The graphic unit objects are obtained in a manner that allows for both regular and random selection of their type and position. Within the same group of graphic objects, there can be multiple types of graphic unit objects, which can be various geometric shapes such as rectangles and pentagons.

[0023] Step 14: Align the original image, the directional guide curve group, and the graphic object group to obtain an overlapping image; Here, the original image, the directional guide curve group, and the graphic object group are aligned at their centers and then superimposed to obtain an overlapping image, as shown in the image below. Figure 8 As shown.

[0024] Step 15: In the overlapping image, determine the corresponding point of each graphic unit object in the graphic object group on the vector curve in the direction guide curve group; Here, a corresponding point is determined for each graphic unit object in the graphic object group. The corresponding point is a point on the vector curve in the direction guide curve group. The corresponding point can be determined in different ways. For example, the point on the vector curve that is closest to the center point of the bounding rectangle of the graphic unit object can be selected as the corresponding point of the graphic unit object.

[0025] Step 16: Rotate each of the graphic unit objects according to the tangent direction vector of the corresponding point relative to the vector curve to obtain the rotated graphic unit object; Here, the graphic unit objects are rotated based on the slope of the tangent direction of the corresponding point on the vector curve, so that the original image and the graphic object group are organically combined to obtain the rotated graphic unit objects that can reflect the features of the original image.

[0026] Step 17: Fill the rotated graphic unit object with color according to the color of the corresponding pixel in the original image to obtain the target graphic mosaic texture object of the original image.

[0027] In this embodiment, each graphic unit object in the graphic object group G undergoes adaptive angular smooth rotation under the influence of the curve objects in the directional guidance curve group C. Then, combined with the pixel color values ​​from the corresponding original image I, the graphic unit object is used to fill the area, thereby obtaining a graphic mosaic texture effect. This anti-counterfeiting graphic mosaic texture generation method combines directional curve guidance, adaptive grid rotation, smooth angular transition, and precise color filling, which can improve anti-counterfeiting performance and visual effects.

[0028] In an optional embodiment of the present invention, step 12, generating a set of directional guidance curves based on the original image, may include: Step 121: Generate the contour structure of the original image based on its shape; Step 122: Convert the contour structure into at least one vector curve to obtain a group of direction guiding curves; Here, the direction guide curve group C can be composed of one or more vector curves, each vector curve consisting of one or more straight line segments or cubic Bezier curve segments connected end to end. The direction guide curve group C outlines the contour structure of the original image, which can be obtained automatically by computer algorithms for image edge search, or manually by hand.

[0029] In an optional embodiment of the present invention, step 15, determining the corresponding point of each graphic unit object in the graphic object group on the vector curve in the direction guide curve group in the overlapping image, may include: Step 151: Determine the center point of each graphic unit object in the graphic object group; Here, the center point is the geometric center point of the graphic unit object, as shown in the example below. Figure 4 Taking the group of graphic objects arranged in the same primitive matrix as an example, the center point is the graphic unit object. circumscribed rectangle R The center point.

[0030] Step 152: In the overlapping image, determine the point in the direction guide curve group that is closest to each of the center points by respect to the vector curve. Here, since the directional guide curves outline the general contours of the original image, in order to more realistically reproduce the image's layers and details, the rotation angle of the graphic unit object needs to be referenced to the corresponding point on the directional guide curves. (in such as) Figure 12 In the overlapping images shown, for a certain graphic unit object Its directional guiding curve segment The corresponding point at is The curve's direction at point (). Corresponding point There can be different ways to select the center point. In this embodiment, the method of selecting the center point closest to the center point is used in the directional guiding curve segment. Search for the corresponding point .

[0031] Step 153: Take the point closest to each of the center points as the corresponding point of each center point.

[0032] The point closest to the center point is selected as the reference point for the rotation operation of the graphic unit object. Each graphic unit object rotates according to the slope of the tangent direction of its corresponding point. Since the corresponding points on the direction guide curves of adjacent graphic unit objects change relatively continuously, a smooth angle transition effect can be obtained.

[0033] In an optional embodiment of the present invention, step 152, determining the point in the overlapping image where the vector curve in the directional guidance curve group is closest to each of the center points, may include: Step 1521: When the vector curve in the direction guidance curve group is composed of multiple straight line segments, determine the point in the vector curve that is closest to the center point based on the position of the perpendicular point of the perpendicular line between the center point and each straight line segment. Step 1522: When the vector curve in the direction guidance curve group is composed of multiple curve segments, construct a parameter matrix based on the coordinates of the points on the curve segments and the coordinates of the control points, solve for the intersection of the straight line passing through the center point and the curve segment based on the parameter matrix, and determine the point in the vector curve that is closest to the center point based on the distance between the intersection point and the center point.

[0034] In this embodiment, the directional guidance curve group It consists of multiple curves, each composed of one or more straight line segments or cubic Bezier curve segments connected end to end. The calculation is performed on the corresponding point closest to the center point. In this case, it is necessary to enumerate all straight line segments or curve segments on all curves, calculate the point closest to the center point for each segment, and then select the point with the smallest distance as the final corresponding point. In this embodiment, different methods are used to calculate the nearest distance for each straight line segment and cubic Bezier curve segment to improve calculation speed. For example... Figure 8 The black rectangular area shown represents a graphic unit object. Its center point is Let the current direction guiding curve segment be The processing is carried out according to whether it is a straight line segment or a cubic Bezier curve segment.

[0035] When the direction guides the curve segment When it is a straight line segment, such as Figure 9 As shown, The endpoints are respectively and First, with Draw a straight line segment for the reference point Let the perpendicular line be and the perpendicular point be . Determine whether the following conditions are met: (1) (2) If both equations (1) and (2) are satisfied, then the perpendicular point Falling Point and Between points, at this moment passing through point Towards the straight line segment Draw a perpendicular line , to the straight line segment The distance between them is the perpendicular point. To the center point The straight-line distance; If equation (1) is not satisfied, then the perpendicular point Falling from arrive On the extension line, at this time the center point arrive The distance between To the endpoint The straight-line distance between them; If equation (2) is not satisfied, then the perpendicular point Falling from arrive On the extension line, at this time the center point arrive The distance between To the endpoint The straight-line distance between them.

[0036] like Figure 9 In the middle, when Offset to When the position is such that equation (2) is not satisfied, then the point is not satisfied. perpendicular line and line segment Non-intersecting, perpendicular point Falling from arrive On the extension of the line, the minimum distance is the straight line segment. The length.

[0037] When the direction guides the curve segment When it is a curve segment, such as Figure 10 As shown, let The two points on the line are respectively and The two control points are respectively and Center point to The method for calculating the minimum distance is as follows: First, construct a matrix using two points on the line and two control points; then, pass through the points... Draw straight lines in the horizontal and vertical directions respectively, and determine whether each line intersects the curve segment at a point. Then, if there are one or two intersection points, use the constructed matrix and Point to intersection The curve length and Click The ratio of the curve lengths of the points The intersection point is calculated. The location; finally, calculate the points respectively. To the point The smaller of the distances is selected as the point. to The shortest distance. Similarly, when two straight lines do not intersect with the cubic Bezier curve segment, the points are calculated separately. To the point and The straight-line distances are calculated, and the smaller distance value is selected as the point. to The shortest distance, the corresponding point on the line is considered as Corresponding points on The calculation process is described in detail below.

[0038] First, construct a Bezier parameter matrix M as shown in equation (3): (3) in:

[0039] Passing Point Construct a horizontal straight line and judge Is it related to the curve segment? There are intersection points, i.e., all roots of equation (4) located between [0,1]: (4) If a root exists Then the horizontal line With curve segment There are intersections , That is Point to intersection The curve length and Click The ratio of the curve lengths of the points is used to calculate the intersection point using equation (5). Location coordinates: (5) Then, after passing through point Construct a vertical straight line and judge Is it related to the curve segment? There are intersection points, i.e., all roots of equation (6) located between [0,1]: (6) If a root exists If equation (6) is satisfied, then the vertical line With curve segment There are intersections , That is Point to intersection The curve length and Click The ratio of the curve lengths of the points can be used to obtain the intersection point using equation (7). Location coordinates: (7) Using the above method, for the directional guidance curve group All curves Search for each center point separately. set of all intersection points , The number of intersection points; for different center points, The number of elements may differ for each set. Calculate the distance from each intersection point to the center point. Find the straight-line distance and select the point with the smallest distance. This is considered as being in the direction guiding curve group Specific curves Corresponding points on the corresponding curve segments .

[0040] In an optional embodiment of the present invention, step 16, rotating each of the graphic unit objects according to the tangent direction vector of the corresponding point relative to the vector curve to obtain the rotated graphic unit object, may include: Step 161: Determine the tangent direction vector of the corresponding point of each graphic unit object in the vector curve; Step 162: Determine the rotation angle based on the angle between the tangent direction vector and the horizontal line; Step 163: Rotate each of the graphic unit objects according to the rotation angle and the direction of the tangent direction vector to obtain the rotated graphic unit objects.

[0041] In this embodiment, for the corresponding points of the graphic unit object Calculate at point The tangent direction vector relative to the direction guiding curve segment and the graphics unit object According to vector Perform a rotation operation.

[0042] Specifically, step 161 may include: Step 1611: When the vector curve in the direction guiding curve group is composed of multiple straight line segments, the tangent direction of the corresponding point is the same as the direction of the straight line segment, and the tangent direction vector is determined according to the endpoint coordinates of the straight line segment. Here, if the intersection point Located in Figure 9 The straight line segment shown Above, the tangent directions at any point on a line segment are the same. Let vectors... = Represents a straight line segment superior The direction of the tangent at a point is the vector. It can be obtained from equation (8): (8) Therefore, when When =0, the unit object The rotation angle is 90 degrees counterclockwise; when At 0, the unit object The rotation angle is .

[0043] Step 1612: When the vector curve in the direction guidance curve group is composed of multiple curve segments, the corresponding point is taken as a newly added smooth node of the curve segment, and the coordinates of the two control points corresponding to the smooth node are obtained; the tangent direction vector is obtained according to the coordinates of the two control points.

[0044] Here, if the intersection point Located in Figure 10 When the cubic Bezier curve segment shown is on the curve, let's assume that the curve obtained according to equation (4) or (6) is... The proportionality coefficient at point is Find the curve segment at... The direction of the tangent at a point is equivalent to a given smooth cubic Bezier curve. ,exist Add a smooth node, i.e., the newly added control point. and Online order On a straight line, and point to The vector direction and Tangent direction at point Maintain consistency; the effect after adding points is as follows Figure 11 As shown in the image. The specific process is described below.

[0045] First, calculate the new cubic Bezier sub-curve segment. .

[0046] Based on equation (3), a new Bezier matrix is ​​constructed from matrix M. as follows:

[0047] in: (9) The matrix constructed using equation (9) Calculate the control points after position adjustment and newly added control points The coordinates are obtained using the method shown in equation (10): (10) Calculate the new cubic Bezier sub-segment .

[0048] Construct a new Bezier matrix as follows:

[0049] in: (11) The matrix constructed using equation (11) Calculate the newly added control points and control points after position adjustment The method is as shown in equation (12): (12) Constructing by equations (10) and (12) point to The vector yields the curve segment exist The tangent direction of a point is used to obtain the graphic unit object. The deflection angle.

[0050] like Figure 12 As shown, for the center point The tangent direction vector on its corresponding directional guiding curve As shown in the figure, the rotation angle is the vector. The angle between the object and the horizontal line, and the effect after rotation are as follows: Figure 13 As shown. Group the graphic objects using the same method. Perform adaptive rotation operations on all objects.

[0051] In an optional embodiment of the present invention, step 17, filling the rotated graphic unit object with color according to the color of the corresponding pixel in the original image to obtain the target graphic mosaic texture object of the original image, may include: Step 171: Determine the bounding rectangle of the rotated graphic unit object; Step 172: Based on the average color of each pixel corresponding to the circumscribed rectangle in the original image, fill the rotated graphic unit object with color to obtain the target graphic mosaic texture object of the original image.

[0052] In this embodiment, the circumscribed rectangle is calculated. R Corresponding to the original image The average color value of each pixel in the region, and using that color value to define the graphic unit object. Perform area filling. It should be noted that the fill color of the graphic unit object is not limited to this embodiment; that is, the fill color of the rotated graphic unit object can be determined in other ways, for example, by using the center point. The image color value corresponding to the original image location is used as the fill color of the graphic unit object.

[0053] Group of graphics objects After rotating and filling all the graphic unit objects, the result is the mosaic texture object of the target graphic, as shown below. Figure 14 As shown. As mentioned earlier, the graphical object group The graphic unit objects within can be arranged and combined in different ways, resulting in different graphic mosaic texture effects. For example... Figures 15 to 17 As shown, they correspond to Figures 5 to 7 The graphic object group shown has a graphic mosaic background effect.

[0054] In the above embodiments of the present invention, each graphic unit object is adaptively rotated by combining directional guidance curves, thereby increasing the complexity of the background texture and improving the anti-counterfeiting effect. The reference point changes on the directional guidance curves corresponding to adjacent graphic unit objects are relatively continuous, resulting in a smooth angle transition effect. The area fill color of each graphic object is referenced to the color value of the image. When the area of ​​the graphic object is relatively small, a new type of anti-counterfeiting mosaic background texture with accurate color filling can be obtained.

[0055] like Figure 18 As shown, an embodiment of the present invention also provides an anti-counterfeiting graphic mosaic background generation device 180, comprising: Acquisition module 181 is used to acquire the original image and at least one graphic unit object; Processing module 182 is configured to generate a set of directional guidance curves based on the original image; the set of directional guidance curves includes at least one vector curve; arrange at least one graphic unit object according to its type and corresponding array method to generate a graphic object group; align the original image, the set of directional guidance curves, and the graphic object group to obtain an overlapping image; determine the corresponding point of each graphic unit object in the graphic object group on the vector curve in the set of directional guidance curves in the overlapping image; rotate each graphic unit object according to the tangent direction vector of the corresponding point relative to the vector curve to obtain a rotated graphic unit object; fill the rotated graphic unit object with color according to the color of the corresponding pixel in the original image to obtain the target graphic mosaic texture object of the original image.

[0056] Optionally, generating a set of directional guidance curves based on the original image includes: Generate the outline structure of the original image based on its shape; The contour structure is converted into at least one vector curve to obtain a set of directional guiding curves.

[0057] Optionally, in the overlapping image, determining the corresponding point of each graphic unit object in the graphic object group on the vector curve in the direction guide curve group includes: Determine the center point of each graphic unit object in the graphic object group; In the overlapping image, determine the point in the group of directional guide curves that is closest to each of the center points; The point closest to each of the center points is taken as the corresponding point of each center point.

[0058] Optionally, in the overlapping image, determining the point in the group of directional guiding curves that is closest to each of the center points via the vector curve includes: When the vector curve in the direction guidance curve group is composed of multiple straight line segments, the point in the vector curve that is closest to the center point is determined according to the position of the perpendicular point of the perpendicular line between the center point and each straight line segment. When the vector curve in the direction guidance curve group is composed of multiple curve segments, a parameter matrix is ​​constructed based on the coordinates of the points on the curve segments and the coordinates of the control points. The intersection point of the straight line passing through the center point and the curve segment is solved based on the parameter matrix. The point in the vector curve that is closest to the center point is determined based on the distance between the intersection point and the center point.

[0059] Optionally, each of the graphic unit objects is rotated according to the tangent direction vector of the corresponding point relative to the vector curve to obtain a rotated graphic unit object, including: Determine the tangent direction vector of the corresponding point of each of the graphic unit objects in the vector curve; The rotation angle is determined based on the angle between the tangent direction vector and the horizontal line; Each of the graphic unit objects is rotated according to the rotation angle and the direction of the tangent direction vector to obtain the rotated graphic unit object.

[0060] Optionally, determining the tangent direction vector of the corresponding point of each of the graphic unit objects in the vector curve includes: When the vector curve in the direction guiding curve group is composed of multiple straight line segments, the tangent direction of the corresponding point is the same as the direction of the straight line segment, and the tangent direction vector is determined according to the endpoint coordinates of the straight line segment; When the vector curve in the direction guidance curve group is composed of multiple curve segments, the corresponding point is taken as a newly added smooth node of the curve segment, and the coordinates of the two control points corresponding to the smooth node are obtained; the tangent direction vector is obtained according to the coordinates of the two control points.

[0061] Optionally, based on the color of the corresponding pixel in the original image, the rotated graphic unit object is filled with color to obtain the target graphic mosaic texture object of the original image, including: Determine the bounding rectangle of the rotated graphic unit object; Based on the average color of each pixel corresponding to the circumscribed rectangle in the original image, the rotated graphic unit object is filled with color to obtain the target graphic mosaic texture object of the original image.

[0062] It should be noted that this device is the same as the method described above. All implementations in the above method embodiments are applicable to the embodiments of this device and can achieve the same technical effect.

[0063] Embodiments of the present invention also provide a computing device, including: a processor and a memory storing a computer program, wherein the computer program, when executed by the processor, performs the method as described above. All implementations in the above method embodiments are applicable to this embodiment and can achieve the same technical effects.

[0064] Embodiments of the present invention also provide a computer-readable storage medium storing instructions that, when executed on a computer, cause the computer to perform the method as described above. All implementations in the above method embodiments are applicable to this embodiment and can achieve the same technical effects.

[0065] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.

[0066] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0067] In the embodiments provided by this invention, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative. For instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.

[0068] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0069] In addition, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0070] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, essentially, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, ROM, RAM, magnetic disks, or optical disks.

[0071] Furthermore, it should be noted that in the apparatus and method of the present invention, it is obvious that the components or steps can be decomposed and / or recombined. These decompositions and / or recombinations should be considered equivalent solutions of the present invention. Moreover, the steps performing the above series of processes can naturally be executed in the order described, but are not necessarily required to be executed in chronological order; some steps can be executed in parallel or independently of each other. Those skilled in the art will understand that all or any step or component of the method and apparatus of the present invention can be implemented in any computing device (including processors, storage media, etc.) or network of computing devices, in hardware, firmware, software, or a combination thereof. This is something that those skilled in the art can achieve by using their basic programming skills after reading the description of the present invention.

[0072] Therefore, the object of the present invention can also be achieved by running a program or a set of programs on any computing device. The computing device can be a known general-purpose device. Therefore, the object of the present invention can also be achieved simply by providing a program product containing program code implementing the method or apparatus. That is, such a program product also constitutes the present invention, and the storage medium storing such a program product also constitutes the present invention. Obviously, the storage medium can be any known storage medium or any storage medium developed in the future. It should also be noted that in the apparatus and method of the present invention, it is obvious that the components or steps can be decomposed and / or recombined. These decompositions and / or recombinations should be considered equivalent to the present invention. Furthermore, the steps performing the above series of processes can naturally be performed in the order described, but are not necessarily required to be performed in chronological order. Some steps can be performed in parallel or independently of each other.

[0073] The above description represents the preferred embodiments of the present invention. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principles of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.

Claims

1. A method for generating anti-counterfeiting graphic mosaic backgrounds, characterized in that, include: Acquire the original image and at least one graphics unit object; Generate a set of directional guidance curves based on the original image; The directional guidance curve group includes at least one vector curve; Arrange at least one graphic unit object according to its type and corresponding array method to generate a graphic object group; The original image, the directional guide curve group, and the graphic object group are aligned to obtain an overlapping image; In the overlapping image, determine the corresponding point of each graphic unit object in the graphic object group on the vector curve in the direction guide curve group; Each of the graphic unit objects is rotated according to the tangent direction vector of the corresponding point relative to the vector curve to obtain the rotated graphic unit object; Based on the color of the corresponding pixel in the original image, the rotated graphic unit object is filled with color to obtain the target graphic mosaic texture object of the original image.

2. The method for generating anti-counterfeiting graphic mosaic background according to claim 1, characterized in that, Generate a set of directional guidance curves based on the original image, including: Generate the outline structure of the original image based on its shape; The contour structure is converted into at least one vector curve to obtain a set of directional guiding curves.

3. The method for generating anti-counterfeiting graphic mosaic backgrounds according to claim 1, characterized in that, In the overlapping image, determining the corresponding point of each graphic unit object in the graphic object group on the vector curve in the direction guide curve group includes: Determine the center point of each graphic unit object in the graphic object group; In the overlapping image, determine the point in the group of directional guide curves that is closest to each of the center points; The point closest to each of the center points is taken as the corresponding point of each center point.

4. The method for generating anti-counterfeiting graphic mosaic backgrounds according to claim 3, characterized in that, In the overlapping image, determining the point in the group of directional guiding curves that is closest to each of the center points includes: When the vector curve in the direction guidance curve group is composed of multiple straight line segments, the point in the vector curve that is closest to the center point is determined according to the position of the perpendicular point of the perpendicular line between the center point and each straight line segment. When the vector curve in the direction guidance curve group is composed of multiple curve segments, a parameter matrix is ​​constructed based on the coordinates of the points on the curve segments and the coordinates of the control points. The intersection point of the straight line passing through the center point and the curve segment is solved based on the parameter matrix. The point in the vector curve that is closest to the center point is determined based on the distance between the intersection point and the center point.

5. The method for generating anti-counterfeiting graphic mosaic background according to claim 1, characterized in that, Each of the graphic unit objects is rotated according to the tangent direction vector of the corresponding point relative to the vector curve to obtain the rotated graphic unit object, including: Determine the tangent direction vector of the corresponding point of each of the graphic unit objects in the vector curve; The rotation angle is determined based on the angle between the tangent direction vector and the horizontal line; Each of the graphic unit objects is rotated according to the rotation angle and the direction of the tangent direction vector to obtain the rotated graphic unit object.

6. The method for generating anti-counterfeiting graphic mosaic background according to claim 5, characterized in that, Determining the tangent direction vector of the corresponding point of each of the graphic unit objects in the vector curve includes: When the vector curve in the direction guiding curve group is composed of multiple straight line segments, the tangent direction of the corresponding point is the same as the direction of the straight line segment, and the tangent direction vector is determined according to the endpoint coordinates of the straight line segment; When the vector curve in the direction guidance curve group is composed of multiple curve segments, the corresponding point is taken as a newly added smooth node of the curve segment, and the coordinates of the two control points corresponding to the smooth node are obtained; the tangent direction vector is obtained according to the coordinates of the two control points.

7. The method for generating anti-counterfeiting graphic mosaic background according to claim 1, characterized in that, Based on the color of the corresponding pixel in the original image, the rotated graphic unit object is filled with color to obtain the target graphic mosaic texture object of the original image, including: Determine the bounding rectangle of the rotated graphic unit object; Based on the average color of each pixel corresponding to the circumscribed rectangle in the original image, the rotated graphic unit object is filled with color to obtain the target graphic mosaic texture object of the original image.

8. A device for generating anti-counterfeiting graphic mosaic backgrounds, characterized in that, include: The acquisition module is used to acquire the original image and at least one graphic unit object; The processing module is used to generate a set of directional guidance curves based on the original image; The directional guide curve group includes at least one vector curve; according to the type of the at least one graphic unit object and the corresponding array method, the at least one graphic unit object is arranged to generate a graphic object group; the original image, the directional guide curve group, and the graphic object group are aligned to obtain an overlapping image; in the overlapping image, the corresponding point of each graphic unit object in the graphic object group on the vector curve in the directional guide curve group is determined; each graphic unit object is rotated according to the tangent direction vector of the corresponding point relative to the vector curve to obtain a rotated graphic unit object; according to the color of the corresponding pixel point of the rotated graphic unit object in the original image, the rotated graphic unit object is filled with color to obtain the target graphic mosaic texture object of the original image.

9. A computing device, characterized in that, include: A processor, a memory storing a computer program, wherein the computer program, when executed by the processor, performs the method as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, A storage instruction that, when executed on a computer, causes the computer to perform the method as described in any one of claims 1 to 7.