A method and apparatus for generating an anti-counterfeit mark
By obtaining the bounding rectangle of the graphic element and performing translation and rotation operations on the trajectory curve, the problems of slow calculation speed and single arrangement in the existing technology are solved, realizing diversified arrangement of graphic anti-counterfeiting marks and improving calculation speed.
Patent Information
- Application Number
- CN202511480306.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-16
- Publication Date
- 2026-01-27
- Estimated Expiration
- 2045-10-16
AI Technical Summary
Existing technologies for generating anti-counterfeiting marks by arranging graphics along curves are slow in computation and have limited arrangement options.
By acquiring the graphic to be arranged and the trajectory curve, the bounding rectangle of the graphic element is determined, and it is translated onto the trajectory curve. After calculating the rotation angle, the rotation operation is performed to generate the graphic anti-counterfeiting mark.
It enables diverse arrangements of graphics on trajectory curves, improving computational speed and the diversity of graphic arrangements.
Smart Images

Figure CN120976371B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of security and anti-counterfeiting technology, and in particular to a method and apparatus for generating anti-counterfeiting marks. Background Technology
[0002] With the rapid development of the printing and publishing industry and the commodity economy, complex graphic design and anti-counterfeiting printing have become increasingly important. Pattern anti-counterfeiting is one of the most important technologies in anti-counterfeiting printing. Pattern anti-counterfeiting, also known as background anti-counterfeiting, refers to a complex and intricate collection of line graphics appearing on the printed surface, obtained by irregular deformation and special effects processing of multiple vector lines. Among these, microtext technology, as a highly efficient and difficult-to-replicate anti-counterfeiting method, is widely used. This technology achieves anti-counterfeiting by printing normal-sized or reduced text in a very small area. This text is usually difficult to see with the naked eye and requires tools such as a magnifying glass or microscope to read clearly. This technology can not only hide important information but also quickly verify its authenticity when needed using magnification tools. Its principle is to use high-precision printing equipment to reduce text or patterns to an extremely small size (usually within 0.2mm). The process of generating microtext mainly involves converting the text (string) to be hidden into an outline curve object, and then arranging the outline curve object along a specified curve to generate a graphic arrangement effect with a specific trajectory. Therefore, in this process, how to design the graphic arrangement along the curve is crucial. Current technology can achieve conventional curve arrangements, but it has drawbacks such as slow calculation speed and limited arrangement options. Summary of the Invention
[0003] This invention provides a method and apparatus for generating anti-counterfeiting marks, which solves the problems of slow calculation speed and limited graphic arrangement when generating anti-counterfeiting marks by arranging graphics along curves.
[0004] To solve the above-mentioned technical problems, the technical solution of the present invention is as follows:
[0005] This invention provides a method for generating anti-counterfeiting marks, comprising:
[0006] Obtain the graphic to be arranged and the trajectory curve to be arranged;
[0007] Based on the graphic to be arranged, at least one graphic element and at least one bounding rectangle are obtained;
[0008] Based on the at least one circumscribed rectangle, the at least one graphic element is translated onto the trajectory curve to be arranged to obtain the intermediate graphic anti-counterfeiting mark;
[0009] Determine the rotation angle of the at least one graphic element when it is arranged on the intermediate graphic anti-counterfeiting mark;
[0010] According to the rotation angle, at least one graphic element on the intermediate graphic anti-counterfeiting mark is rotated to generate a graphic anti-counterfeiting mark.
[0011] Optionally, based on the graphics to be arranged, at least one graphic element and at least one circumscribed rectangle are obtained, including:
[0012] The elements of the graphic to be arranged are extracted to obtain at least one graphic element;
[0013] The width and height of the at least one graphic element are used as the width and height of its circumscribed rectangle, respectively, to form at least one circumscribed rectangle.
[0014] Optionally, based on the at least one circumscribed rectangle, the at least one graphic element is translated onto the trajectory curve to be arranged to obtain an intermediate graphic anti-counterfeiting mark, including:
[0015] The coordinates of the end point are obtained based on the starting point coordinates of the at least one circumscribed rectangle and the at least one graphic element.
[0016] According to the starting point coordinates and the ending point coordinates, all graphic elements are evenly arranged on the trajectory curve to be arranged, and all the outer rectangles are connected end to end to obtain the middle graphic anti-counterfeiting mark.
[0017] Optionally, when the trajectory curve to be arranged is a straight line segment, the coordinates of the ending point are obtained based on the starting point coordinates of the at least one circumscribed rectangle and the at least one graphic element, including:
[0018] Based on the trajectory curve to be arranged, the coordinates of the endpoints of the straight line segments are obtained;
[0019] Based on the endpoint coordinates, the first vector is obtained;
[0020] The coordinates of the termination point are obtained based on the first vector, the coordinates of the at least one circumscribed rectangle, and the coordinates of the starting point of the at least one graphic element.
[0021] Optionally, when the trajectory curve to be arranged is a curve segment, the coordinates of the ending point are obtained based on the starting point coordinates of the at least one circumscribed rectangle and the at least one graphic element, including:
[0022] Based on the trajectory curves to be arranged, the target matrix of the curve segments is obtained;
[0023] The first distance is obtained based on the trajectory curve to be arranged, the at least one circumscribed rectangle, the target matrix, and the coordinates of the starting point;
[0024] The trajectory curve to be arranged is evenly divided to obtain at least two intermediate curve segments;
[0025] Select a target point on each of the at least two intermediate curve segments to form a point set with at least two target points;
[0026] Based on the at least two intermediate curve segments, the point set, the target matrix, and the starting point coordinates, determine at least two second distances between the target point in the point set and the starting point;
[0027] Based on the first distance, the at least two second distances, and the preset conditions, determine whether the termination point exists in the point set;
[0028] Based on the judgment result, the coordinates of the termination point are obtained by acquiring the target point that meets the preset conditions or by acquiring the midpoint of the adjacent target points.
[0029] Optionally, if the target trajectory curve to be arranged is a single line, all graphic elements are evenly arranged on the trajectory curve according to the starting point coordinates and the ending point coordinates, and all the circumscribed rectangles are connected end to end to obtain the intermediate graphic anti-counterfeiting mark, including:
[0030] By placing the midpoint of the first boundary of the circumscribed rectangle on the starting point coordinates of the target trajectory curve to be arranged, all graphic elements are translated onto the target trajectory curve to be arranged, and all circumscribed rectangles are connected end to end to obtain the intermediate graphic anti-counterfeiting mark; wherein, the ending point coordinates of the first graphic element in two adjacent graphic elements are the starting point coordinates of the second graphic element.
[0031] Optionally, if there are two or more target trajectory curves to be arranged, all graphic elements are evenly arranged on the trajectory curves according to the starting point coordinates and the ending point coordinates, and all the outer rectangles are connected end to end to obtain the intermediate graphic anti-counterfeiting mark, including:
[0032] Obtain the boundary line between each pair of target trajectory curves to be arranged;
[0033] Align the midpoint of the first boundary of the circumscribed rectangle with the starting point coordinates of the boundary line, translate all graphic elements onto the boundary line, and connect all circumscribed rectangles end to end to obtain the middle graphic anti-counterfeiting mark; wherein, the ending point coordinates of the first graphic element in two adjacent graphic elements are the starting point coordinates of the second graphic element.
[0034] Optionally, determining the rotation angle of the at least one graphic element when it is arranged on the intermediate graphic anti-counterfeiting mark includes:
[0035] Determine the verticality of the target trajectory curve range occupied by the at least one graphic element on the intermediate graphic anti-counterfeiting mark, and obtain the vertical result;
[0036] Based on the vertical result, determine the rotation angle.
[0037] This invention also provides an apparatus for generating anti-counterfeiting marks, comprising:
[0038] The acquisition module is used to acquire the graphic to be arranged and the trajectory curve to be arranged;
[0039] The processing module is configured to obtain at least one graphic element and at least one circumscribed rectangle based on the graphic to be arranged; translate the at least one graphic element onto the trajectory curve to be arranged based on the at least one circumscribed rectangle to obtain an intermediate graphic anti-counterfeiting mark; and determine the rotation angle of the at least one graphic element when it is arranged on the intermediate graphic anti-counterfeiting mark.
[0040] The generation module is used to rotate at least one graphic element on the intermediate graphic anti-counterfeiting mark according to the rotation angle to generate the graphic anti-counterfeiting mark.
[0041] This invention also provides a computer-readable storage medium storing instructions that, when executed on a computer, cause the computer to perform the above-described method.
[0042] The technical solution of the present invention has at least the following effects:
[0043] The above-described solution of the present invention obtains a graphic to be arranged and a trajectory curve to be arranged; based on the graphic to be arranged, at least one graphic element and at least one circumscribed rectangle are obtained; based on the at least one circumscribed rectangle, the at least one graphic element is translated onto the trajectory curve to be arranged to obtain an intermediate graphic anti-counterfeiting mark; the rotation angle of the at least one graphic element when arranged on the intermediate graphic anti-counterfeiting mark is determined; and the at least one graphic element on the intermediate graphic anti-counterfeiting mark is rotated according to the rotation angle to generate a graphic anti-counterfeiting mark. By generating the anti-counterfeiting mark, various graphic anti-counterfeiting methods on trajectory curves can be provided, realizing the diversification of graphic arrangement methods on trajectory curves. Attached Figure Description
[0044] Figure 1 This is a flowchart of the method for generating anti-counterfeiting marks provided in an embodiment of the present invention;
[0045] Figure 2 This is a schematic diagram of the trajectory curve of the straight line segment to be arranged provided in an embodiment of the present invention;
[0046] Figure 3 This is a schematic diagram of the trajectory curve to be arranged for the curve segment provided in an embodiment of the present invention;
[0047] Figure 4This is a schematic diagram of the graphics to be arranged according to an embodiment of the present invention;
[0048] Figure 5 This is a schematic diagram of a single target trajectory curve to be arranged, provided in an embodiment of the present invention;
[0049] Figure 6 This is a graphic anti-counterfeiting mark effect diagram formed by a single target trajectory curve to be arranged, provided in an embodiment of the present invention;
[0050] Figure 7 This is a schematic diagram of the trajectory curves and boundary lines of two parallel targets to be arranged, provided in an embodiment of the present invention;
[0051] Figure 8 This is a graphic anti-counterfeiting mark effect diagram formed by two parallel target trajectory curves to be arranged, provided in an embodiment of the present invention;
[0052] Figure 9 This is a schematic diagram of multiple parallel target trajectory curves to be arranged according to an embodiment of the present invention;
[0053] Figure 10 This is an illustration of the graphic anti-counterfeiting mark effect formed by multiple parallel target trajectory curves to be arranged, provided in an embodiment of the present invention.
[0054] Figure 11 This is a schematic diagram of multiple non-parallel target trajectory curves to be arranged according to an embodiment of the present invention;
[0055] Figure 12 This is a graphic anti-counterfeiting mark effect diagram formed by multiple non-parallel target trajectory curves to be arranged, provided in an embodiment of the present invention;
[0056] Figure 13 This is a structural diagram of the anti-counterfeiting mark generation device provided in an embodiment of the present invention. Detailed Implementation
[0057] 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.
[0058] like Figure 1 As shown, an embodiment of the present invention proposes a method for generating anti-counterfeiting marks, comprising:
[0059] Step 11: Obtain the graphic to be arranged and the trajectory curve to be arranged;
[0060] Step 12: Based on the graphic to be arranged, obtain at least one graphic element and at least one bounding rectangle.
[0061] Step 13: Based on the at least one circumscribed rectangle, translate the at least one graphic element onto the trajectory curve to be arranged to obtain the intermediate graphic anti-counterfeiting mark;
[0062] Step 14: Determine the rotation angle of the at least one graphic element when it is arranged on the intermediate graphic anti-counterfeiting mark;
[0063] Step 15: Rotate at least one graphic element on the intermediate graphic anti-counterfeiting mark according to the rotation angle to generate a graphic anti-counterfeiting mark.
[0064] In this embodiment, in step 11, the graphic to be arranged is a vector graphic arrangement object composed of a set of text-to-outline curves and / or graphic elements, and the graphic to be arranged has at least one graphic element; the trajectory curve to be arranged is a vector graphic trajectory curve object composed of one target trajectory curve to be arranged or multiple target trajectory curves to be arranged, and each target trajectory curve to be arranged is composed of a series of straight line segments and / or a series of cubic Bézier curve segments connected end to end.
[0065] In step 12, each element in the graphic to be arranged is extracted and separated as a single graphic element. Each graphic element has a minimum bounding rectangle whose width and height are the same as the width and height of the graphic element. The graphic to be arranged is then arranged on the trajectory curve to be arranged, which essentially means that each graphic element is arranged on the trajectory curve to be arranged.
[0066] In step 13, each graphic element is translated onto the trajectory curve to be arranged, resulting in a curve with graphic elements, which is the intermediate graphic anti-counterfeiting mark. During translation, the midpoint of the first boundary of the smallest bounding rectangle of each graphic element needs to coincide with the starting point on the target trajectory curve to be arranged. The first boundary is the left side of the smallest bounding rectangle. For a target trajectory curve to be arranged, the starting point of the first graphic element to be arranged onto the trajectory curve is the coordinate of the left endpoint of the entire target trajectory curve. The ending point calculated based on this starting point is the starting point of the second graphic element to be arranged onto the trajectory curve, and so on, to obtain the starting points of each graphic element to be arranged onto the trajectory curve.
[0067] In step 14, it is necessary to determine the vertical position of the current graphic element within the range of the target band's arrangement curve, thereby obtaining the angle by which the graphic element should rotate along the curve within this range. Since the target band's arrangement curve consists of straight line segments and curved segments, it is also necessary to classify and discuss the straight line segments and curved segments separately.
[0068] In step 15, the graphic element is rotated according to the rotation angle obtained in step 14 to generate a graphic anti-counterfeiting mark that rotates along the curve direction.
[0069] This technical solution arranges the graphics to be arranged along the trajectory curve according to specific rules, and then performs graphic modulation operations on this basis to achieve anti-counterfeiting of graphics on various trajectory curves. It can also provide more complex and diverse graphic arrangement pattern effects, and the computational complexity is reduced by optimizing the algorithm, thereby improving the calculation speed.
[0070] like Figure 4 As shown, in an optional embodiment of the present invention, step 12, obtaining at least one graphic element and at least one circumscribed rectangle based on the graphic to be arranged, may include:
[0071] Step 121: Extract the graphic to be arranged to obtain at least one graphic element;
[0072] Step 122: Use the width and height of the at least one graphic element as the width and height of its circumscribed rectangle, respectively, to form at least one circumscribed rectangle.
[0073] In this embodiment, the graphic to be arranged is a collection of graphic elements. These graphic elements can be freely designed graphics or outline curve graphics obtained by converting text to curves. The graphic elements that need to be arranged onto the trajectory curve are extracted from the graphic to be arranged. A minimum bounding rectangle is constructed for each graphic element, and the width and height of each graphic element are the width and height of the minimum bounding rectangle. Figure 4 As shown, the figures to be arranged are ABCD. The graphic formed by "Hello" can have the following graphic elements: A, B, C, C. At least one of the elements, you, and good, when each element is a graphic, its corresponding bounding rectangle is determined according to its length, width, and height, so that when these graphic elements are translated onto the trajectory curve, they can be balanced according to their bounding rectangles. It has a unified standard coordinate system, which makes it easy to determine the position of the graphic elements on the trajectory curve during translation and improves the calculation speed.
[0074] In an optional embodiment of the present invention, step 13, translating the at least one graphic element onto the trajectory curve to be arranged according to the at least one circumscribed rectangle to obtain the intermediate graphic anti-counterfeiting mark, may include:
[0075] Step 131: Obtain the coordinates of the end point based on the starting point coordinates of the at least one circumscribed rectangle and the at least one graphic element;
[0076] Step 132: According to the starting point coordinates and the ending point coordinates, arrange all graphic elements evenly on the trajectory curve to be arranged, and connect all the outer rectangles end to end to obtain the middle graphic anti-counterfeiting mark.
[0077] The trajectory curves to be arranged include at least one target trajectory curve to be arranged.
[0078] In this embodiment, in step 131, the starting point coordinates are the starting point coordinates of each graphic element, and the ending point coordinates are the ending point coordinates of each graphic element. Based on the minimum bounding rectangle of the graphic element and the starting point coordinates, the ending point coordinates of the graphic element can be obtained.
[0079] The trajectory curves to be arranged include at least one target trajectory curve to be arranged. When there is one target trajectory curve to be arranged, the coordinates of the left endpoint of the target trajectory curve to be arranged are the coordinates of the starting point of the first graphic element to be placed on the trajectory curve to be arranged.
[0080] When there are two or more target trajectory curves to be arranged, the coordinates of the left endpoint of the boundary between each pair of target trajectory curves to be arranged are the coordinates of the starting point of the first graphic element to be placed on the trajectory curve to be arranged.
[0081] Since each graphic element on the trajectory curve to be arranged is connected end to end, the coordinates of the end point of the first graphic element are the coordinates of the starting point of the second graphic element to be placed on the trajectory curve, and so on, so that the coordinates of the starting point and the ending point of all graphic elements can be obtained.
[0082] In step 132, during translation, it is only necessary to determine the position of the graphic element and a point on the trajectory curve to be arranged to obtain the translated intermediate graphic anti-counterfeiting mark. Therefore, when the midpoint of the first boundary of the smallest bounding rectangle of the graphic element coincides with the starting point, the position of the entire graphic element on the trajectory curve to be arranged can be determined. Each graphic element is translated onto the trajectory curve to be arranged so that the bounding rectangles of all graphic elements are connected end to end, thus obtaining the intermediate graphic anti-counterfeiting mark. At this time, the center positions of the bounding rectangles of all graphic elements are evenly arranged on the trajectory curve to be arranged.
[0083] In an optional embodiment of the present invention, step 131, obtaining the end point coordinates based on the at least one circumscribed rectangle and the starting point coordinates, includes:
[0084] Step 1311: When the trajectory curve to be arranged is a straight line segment, the coordinates of the end point are obtained based on the at least one circumscribed rectangle and the coordinates of the starting point.
[0085] Step 1312: When the trajectory curve to be arranged is a curve segment, the coordinates of the termination point are obtained based on the at least one circumscribed rectangle and the coordinates of the starting point.
[0086] In this embodiment, the process of obtaining the coordinates of the termination point is classified and discussed according to the straightness or curvature of the line segment currently being processed by the trajectory curve to be arranged. In step 1311, the case where the currently processed line segment is a straight line segment is discussed; in step 1312, the case where the currently processed line segment is a cubic Bézier curve segment is discussed.
[0087] like Figure 2 As shown, in an optional embodiment of the present invention, in step 1311, when the trajectory curve to be arranged is a straight line segment, the straight line segment here is as follows: Figure 2 The line segment p1p2 shown is used to obtain the coordinates of the ending point based on the at least one circumscribed rectangle and the coordinates of the starting point, including:
[0088] Step 13111: Obtain the endpoint coordinates based on the trajectory curve to be arranged;
[0089] Step 13112: Obtain the first vector based on the endpoint coordinates;
[0090] Step 13113: Obtain the coordinates of the termination point based on the first vector, the at least one circumscribed rectangle, and the coordinates of the starting point.
[0091] In this embodiment, in step 13111, the line segment being processed is a straight line segment. Based on the straight line segment, the coordinates of the endpoints at both ends of the straight line segment, i.e., the coordinates of the first endpoint, can be obtained. Second endpoint coordinates .
[0092] In step 13112, based on the coordinates of the first endpoint and the coordinates of the second endpoint ,pass A first vector pointing from the first endpoint to the second endpoint can be obtained. ;in, These are the x and y coordinates of the first and second endpoints, respectively. and Let these represent the components of the first vector in the horizontal and vertical directions, respectively. This represents the distance between the first endpoint and the second endpoint;
[0093] In step 13113, according to This yields the coordinates of the endpoint of the current graphic element; where, The starting point, whose coordinates are: L is the width of the current graphic element, and also the width of the minimum bounding rectangle. The terminator is the obtained termination point, and the coordinates of the termination point are... .
[0094] like Figure 3 As shown, in an optional embodiment of the present invention, in step 1312, when the trajectory curve to be arranged is a curve segment, as follows: Figure 3 The curve segment p3p6 shown is used to obtain the coordinates of the ending point based on the at least one circumscribed rectangle and the coordinates of the starting point, including:
[0095] Step 13121: Obtain the target matrix of the curve segments based on the trajectory curves to be arranged;
[0096] Step 13122: Obtain the first distance based on the trajectory curve to be arranged, the at least one circumscribed rectangle, the target matrix, and the coordinates of the starting point;
[0097] Step 13123: Divide the trajectory curve to be arranged evenly to obtain at least two intermediate curve segments;
[0098] Step 13124: Select a target point on each of the at least two intermediate curve segments to form a point set with at least two target points;
[0099] Step 13125: Based on the at least two intermediate curve segments, the point set, the target matrix, and the starting point coordinates, determine at least two second distances between the target point in the point set and the starting point;
[0100] Step 13126: Based on the first distance, the at least two second distances, and the preset conditions, determine the existence of the termination point in the point set;
[0101] Step 13127: Based on the existing results, obtain the coordinates of the termination point by acquiring the target point that satisfies the preset conditions or by acquiring the midpoint of the adjacent target points.
[0102] In this embodiment, in step 13121, the line segment being processed can be a cubic Bézier curve segment. Based on the curve segment, the two endpoints and two control points on the curve segment can be obtained, which are the coordinates of the third endpoint. and the coordinates of the sixth endpoint and the coordinates of the fourth control point and the coordinates of the fifth control point Based on the endpoints and control points, through The target matrix, namely the Bessel matrix, can be obtained. ;in, These are the x and y coordinates of the third endpoint, the fourth control point, the fifth control point, and the sixth endpoint, respectively. Each of these is an element in the Bessel matrix.
[0103] In step 13122, a first proportional relationship can be obtained based on the current curve segment; based on the first proportional relationship and the Bessel matrix, through... We obtain a first proportional function and a second proportional function, and then substitute the first proportional function and the second proportional function into... The curvature can be obtained; based on the curvature and the width of the minimum bounding rectangle, through... The first distance is obtained, which is the straight-line distance between the start point and the end point of the graphic element on the curve segment; wherein, It is the first proportional relationship, which can be obtained by dividing the length from the third endpoint to a point on the curve segment by the length from the third endpoint to the sixth endpoint. When the point on the curve segment is the third endpoint, that is, t=0; It is the first proportional function, and can also be expressed as ; It is the second proportional function, and can also be expressed as C is the curvature; L is the width of the minimum bounding rectangle. The first distance is the straight-line distance between the starting point and the ending point of the graphic element.
[0104] In steps 13123 and 13124, the trajectory curve to be arranged is uniformly divided into... Section, obtained The middle curve segment; on each middle curve segment, select a target point (select the left endpoint of the middle curve segment) to form a point set with n target points.
[0105] In step 13125, based on the t value of each target point in the point set, by... This yields the coordinates of the target point on each intermediate curve segment. ( ), sequentially obtain the coordinates of all target points in the point set; based on the target point coordinates and the starting point coordinates, through The second distance is determined; wherein, t is the first proportional relationship; It is the x-coordinate of the target point. It is the ordinate of the target point; It is the target point; ( ) indicates finding the straight-line distance between two points; It is the starting point; It is the distance between the target point and the starting point, i.e., the second distance.
[0106] In steps 13126 and 13127, the second distance and the first distance are determined based on whether they satisfy the following conditions: The existence of a termination point in the point set is determined. If there exists a target point in the point set whose second distance satisfies the first distance, then a termination point exists in the point set, and the target point satisfying the condition is the desired termination point. The termination point is thus obtained. Coordinates; otherwise, there is no endpoint in the point set, that is, there is no target point in the point set that satisfies this judgment condition. In this case, it is necessary to find two adjacent points in the point set that satisfy the condition. At this point, there is a first point between two adjacent points. Based on the second and third proportional relationships corresponding to the two points, through... The fourth proportional relationship of the first point is obtained, and the fourth proportional relationship is substituted into... Obtain the coordinates of the first point. ( If the first point is satisfied If the first point's coordinates are true, then the coordinates of the first point are the coordinates of the desired termination point; otherwise... We continue searching for the termination point in two cases: when the condition is met... < This indicates that the second point that satisfies the condition is located at... and In between, at this time through Take the median value of the coefficients to obtain the coordinates of the second point; when the condition is satisfied... > This indicates that the second point that satisfies the condition is located at... and In between, at this time through Take the median of the coefficients to obtain the coordinates of the second point; use this second point to continue performing the same distance judgment until a point that meets the conditions is found. The point that meets the conditions is the desired termination point. It is the starting point; It is the endpoint; It is the first distance; It is the second distance; It is a very small positive real number, for example, take ; ( ) indicates finding the straight-line distance between two points; It is the fourth proportional relationship; and These are two adjacent target points; These are the coordinates of the first point; It is the fifth proportional relationship.
[0107] In an optional embodiment of the present invention, in step 132, according to the starting point coordinates and the ending point coordinates, all graphic elements are evenly arranged on the trajectory curve to be arranged, and all the outer rectangles are connected end to end to obtain the intermediate graphic anti-counterfeiting mark, including:
[0108] Step 1321: If there is only one target trajectory curve to be arranged, arrange all graphic elements evenly on the trajectory curve according to the starting point coordinates and the ending point coordinates, and connect all the outer rectangles end to end to obtain the intermediate graphic anti-counterfeiting mark.
[0109] Step 1322: When there are two or more target trajectory curves to be arranged, arrange all graphic elements evenly on the trajectory curves to be arranged according to the starting point coordinates and the ending point coordinates, and connect all the outer rectangles end to end to obtain the intermediate graphic anti-counterfeiting mark.
[0110] In this embodiment, the cases where there is one or more target trajectory curves to be arranged are classified and described respectively. According to the starting point coordinates and the ending point coordinates, the graphic elements are translated and arranged onto the trajectory curves to be arranged to obtain the intermediate graphic anti-counterfeiting mark. For a graphic element, the left midpoint of the smallest bounding rectangle of the graphic element is placed at the starting point coordinates to complete the translation process.
[0111] like Figure 5 As shown, in an optional embodiment of the present invention, in step 1321, when the target trajectory curve to be arranged is one, all graphic elements are evenly arranged on the trajectory curve to be arranged according to the starting point coordinates and the ending point coordinates, and all the outer rectangles are connected end to end to obtain the intermediate graphic anti-counterfeiting mark, including:
[0112] Step 13211: By placing the midpoint of the first boundary of the circumscribed rectangle on the starting point coordinates of the target trajectory curve to be arranged, all graphic elements are translated onto the target trajectory curve to be arranged, and all circumscribed rectangles are connected end to end to obtain the intermediate graphic anti-counterfeiting mark; the ending point coordinates of the previous graphic element are the starting point coordinates of the next graphic element.
[0113] In this embodiment, the target trajectory curve to be arranged is one in the trajectory curve to be arranged. At this time, according to the starting point position on the target trajectory curve to be arranged, the graphic element is translated onto the target trajectory curve to be arranged to obtain the intermediate graphic anti-counterfeiting mark.
[0114] like Figure 9 and Figure 11 As shown, in an optional embodiment of the present invention, in step 1322, when there are two or more target trajectory curves to be arranged, all graphic elements are evenly arranged on the trajectory curves to be arranged according to the starting point coordinates and the ending point coordinates, and all the outer rectangles are connected end to end to obtain the intermediate graphic anti-counterfeiting mark, including:
[0115] Step 13221: Obtain the boundary line between each pair of target trajectory curves to be arranged;
[0116] Step 13222: By placing the midpoint of the first boundary of the circumscribed rectangle on the starting point coordinates of the boundary line, all graphic elements are translated onto the boundary line, and all circumscribed rectangles are connected end to end to obtain the intermediate graphic anti-counterfeiting mark; the ending point coordinates of the previous graphic element are the starting point coordinates of the next graphic element.
[0117] In this embodiment, since there are more than two target trajectory curves to be arranged, it is necessary to select two adjacent target trajectory curves. There is a boundary line between each pair of target trajectory curves. This boundary line can be the midline obtained by interpolation between the two target trajectory curves, or it can be a specified line. Then, according to the starting point position on the boundary, the graphic element is translated onto the target trajectory curve to be arranged to obtain the intermediate graphic anti-counterfeiting mark.
[0118] In an optional embodiment of the present invention, step 14, determining the rotation angle of the at least one graphic element when arranged on the intermediate graphic anti-counterfeiting mark, may include:
[0119] Step 141: Determine the verticality of the target trajectory curve range occupied by the at least one graphic element on the intermediate graphic anti-counterfeiting mark, and obtain the vertical result.
[0120] Step 142: Determine the rotation angle based on the vertical result.
[0121] In this embodiment, when the target trajectory curve to be arranged is a straight line segment, it is processed in two ways: if the x-coordinates of the two endpoints of the straight line segment are equal, it means that the straight line segment is perpendicular to the x-axis, and the rotation angle of the graphic element is 1. If the x-coordinates of the two endpoints of the line segment are not equal, then the rotation angle of the graphic element is obtained based on the two endpoints of the line segment, i.e. When the target trajectory curve to be arranged in the current processing is a curve segment, by... , thus obtaining the second vector At this point, two situations need to be addressed: when =0 indicates that the curve segment is perpendicular to the x-axis at this time, and the rotation angle of the graphic element is . ;when Then the rotation angle of the graphic element is Among them, the aforementioned The rotation angle; and The two endpoints of the line segment; , , , Let x and y be the x and y coordinates of the two endpoints; It is the second vector; and These are the components of the second vector along the x and y axes.
[0122] In an optional embodiment of the present invention, step 15, rotating at least one graphic element on the intermediate graphic anti-counterfeiting mark according to the rotation angle to generate the graphic anti-counterfeiting mark, may include:
[0123] Step 151: The graphic element is rotated according to the rotation angle to generate a graphic anti-counterfeiting mark.
[0124] In this embodiment, if the graphic elements are arranged along a curve, the graphic elements are directly rotated after obtaining the rotation angle to obtain the graphic anti-counterfeiting mark; if the graphic elements are arranged along the curve spacing, after obtaining the rotation angle, the first scaling factor and the second scaling factor are calculated first through the rotation angle, the graphic elements are scaled and then rotated according to the rotation angle.
[0125] like Figure 7 and Figure 8 As shown, in an optional embodiment of the present invention, the method for generating the anti-counterfeiting mark further includes:
[0126] Step 16: When there are two or more target trajectory curves to be arranged, the graphic elements between each pair of target trajectory curves need to fill the space between the upper and lower curves (excluding the line width area). At this time, the center point of the graphic element falls on the boundary between the two curves. Above; at this point, the graphic element needs to be scaled according to the scaling ratio before rotation. The specific process for obtaining the scaling ratio of the graphic element is as follows:
[0127] Based on the central axis of the smallest bounding rectangle of the rotated graphic element and the two target trajectory curves to be arranged, the first intersection point and the second intersection point are obtained: if the currently processed first target trajectory curve If it is a straight line segment, then the equation of the straight line is rearranged as follows: ; Compare the equation of the straight line with the equation of the central axis Solve the system of equations simultaneously; if the system of equations has a root and that root lies between the two endpoints of the straight line, then that root is the first intersection point; otherwise, the central axis does not intersect the straight line segment. If the first target trajectory curve to be arranged is a cubic Bézier curve segment, then construct the coefficients using the Bézier matrix and the central axis equation. When the central axis intersects the curve segment, the proportional relationship at the intersection point is: The root of the equation is found when the equation has a solution and the solution is a positive real number less than 1, indicating that the central axis intersects the curve segment; by substituting all the real solutions that satisfy the condition into... This yields a set of all intersection points between the central axis and the curve segment. The point in this set closest to the center of the smallest rectangle is taken as the first intersection point. Similarly, the intersection points between the central axis and the second target trajectory curve are obtained. The second point of intersection. According to This yields the first scaling factor and the second scaling factor. It is the equation of the central axis; It is the equation of a straight line; These are the construction coefficients; Each of these is an element in the Bessel matrix; Here is the x-coordinate of the point we are looking for; Let be the ordinate of the point to be found; t is the solution to the equation. This is the first scaling factor; This is the second scaling factor; It is the first intersection point; It is the second intersection point; It is the center point of the smallest bounding rectangle of the graphic element; It is the height of the smallest bounding rectangle.
[0128] The specific process of scaling is as follows:
[0129] For each point on the arranged graphic object, first translate it to... point;
[0130] Then the x-axis remains unchanged, and the y-axis is multiplied by the corresponding scaling factor;
[0131] Finally, the scaled point is translated to the original center point, that is, for any point on the arranged graphic object. The transformed point coordinates It is possible get.
[0132] Finally, the scaled object is rotated, and each graphic element is processed in the same way to fill the area between the first and second target trajectory curves to be arranged. The coordinates of the point before scaling; These are the scaled point coordinates; It is the ordinate of the center point; It is either the first scaling factor or the second scaling factor.
[0133] like Figure 6As shown, a specific embodiment of the method provided by this invention is as follows: the process of translating a graphic element onto a trajectory curve to generate a graphic anti-counterfeiting mark includes:
[0134] Obtain the left and right boundary points of all elements to be arranged on a complete trajectory curve object, translate the curve object to be arranged to the corresponding position on the trajectory curve object, and perform modulation operations through geometric transformation to obtain the final graphic arrangement effect.
[0135] Specifically, given a set of graphic elements to be arranged ,…, And a trajectory curve object P, and take one graphic object to be arranged from the set S. The detailed element arrangement process is as follows:
[0136] Step 1: The left boundary of the previous element The right boundary of the path coincides with the left boundary of the path P, and the intersection of the left boundary and the path P is set as... Step 131 can be used to obtain The intersection of the right boundary and path P , will object The midpoint of the left boundary is translated to the same point as... coincide;
[0137] Step 2: Translate the... by Rotation transformation is performed with point as the center, and the rotation angle is... The size is equal to the curve located at The arctangent of the slope of the tangent line is calculated as follows:
[0138] 1) When When it is a straight line segment located in path P, such as Figure 2 As shown, if at this time , The rotation angle is ;like The rotation angle is: .
[0139] 2) When When located within a Bézier curve segment in path P, such as Figure 3 As shown, let arrive The curve length and arrive The ratio of the curve lengths is At this time, the curve is Tangent vector at point pass get.
[0140] When equal to 0, The rotation angle is ;otherwise, The rotation angle is .
[0141] Step 3: Extract all the arranged curve objects from set S in sequence. Arrange the elements on the trajectory curve object until the entire trajectory curve is filled, achieving the desired effect. Figure 6 The effect shown Figure 4 The curve object elements to be arranged, i.e. the graphics to be arranged, include the outline curve objects of four English letters and two Chinese characters after conversion to curves, and a drawn pentagram primitive object. Figure 5 The object is a trajectory curve composed of a sine curve, and the final curve arrangement result is as follows. Figure 6 As shown.
[0142] Example 2: By further expanding the trajectory curve object, more complex graphic object arrangement effects can be achieved.
[0143] For example, given two or more parallel trajectory curve objects arranged vertically, with the same distance between each pair of adjacent curves. Each curve has a certain line width. In this example, the graphic objects are arranged to fill the blank area between each pair of adjacent parallel curves (excluding the line width area), which is called arranging graphic objects along the curve spacing.
[0144] like Figure 7 As shown, Figure 7 This represents two parallel trajectory curves arranged vertically; the black area represents the line width of each curve. The lower boundary curve of the trajectory curve object above. This is the boundary line between the upper and lower curves. The upper boundary curve of the line width of the trajectory curve object below. Figure 8 Arrange graphic object "a" along the trajectory curve object The uniform arrangement effect. The above extension can be simply understood as: given three parallel trajectory curves arranged vertically. , and Let each arranged curve object follow the trajectory curve While arranging the elements, perform geometric transformations (scaling and rotation) sequentially until the surface is completely covered. and The blank area between.
[0145] For ease of description, let's assume there are only two parallel trajectory curve objects. and For the current object Let the height of the minimum bounding rectangle be... The rotation angle is The central axis after rotation (i.e., the axis of symmetry of the circumscribed rectangle) is The center point after rotation is Calculate separately and and The intersection point, based on the intersection point and Determining the straight-line distance from the midpoint The scaling factor should be specified, and finally, the scaled curve object is rotated. The specific implementation method is as follows:
[0146] Step 1: Arrange the graphics according to the method described in Example 1 The left boundary point is translated to On Point.
[0147] Step 2: Calculate the central axis after rotation and... and The intersection of the two curves. Let... The angle to be rotated is The rotated shaft It can be written as an equation in the following form: Calculate the straight line and the curve respectively. and The intersection point. It is necessary to calculate whether each line segment intersects with the first line segment. There are intersections, until a match is found. The line segments that intersect at a point are considered complete. Here, we will introduce them separately according to the different types of line segments:
[0148] (1) The line segment being processed is as follows: Figure 2 When dealing with a straight line segment as shown, rearrange the equation of the line into the following form: The linear method, combined If the system of two equations relating a line segment has a root, then... And point Located at point Between, it means and line segment Intersect at point ,otherwise and line segment There are no intersections.
[0149] (2) The line segment being processed is as follows: Figure 3 When showing a cubic Bézier curve segment, it passes through the Bézier matrix and the axis of symmetry. Constructing coefficients of the equation :
[0150] ,
[0151] when When there is an intersection with the curve segment, the proportionality constant t at the intersection is The root.
[0152] Therefore, when the equation has a solution and the solution is a positive real number less than 1, it indicates that the axis of symmetry intersects the curve segment. Substituting all the real solutions that satisfy the condition into...
[0153] ,
[0154] get The set of all intersection points with the curve segment, taking the center point as the center point. The point closest to the curve is taken as the intersection of the axis of symmetry and the curve.
[0155] Step 3: Based on the proportional relationship between the distance between the intersection point and the center point of the arranged graphic object, scale and rotate the arranged graphic object.
[0156] For the current object Let its axis of symmetry be... Its upper curve The intersection point is , and its lower curve The intersection point is ,according to They were obtained respectively Scaling factor for the upper and lower halves:
[0157] object Before rotation, a scaling transformation is performed. This involves translating each point on the arranged graphic object to (0,0); then keeping the x-coordinate unchanged while multiplying the y-coordinate by a scaling factor; finally, translating the scaled point back to its original center point. In other words, for any point on the arranged graphic object... The transformed point coordinates It is possible get;
[0158] Among them, the points in the upper half of the graphic object are arranged. The value is The value for the points in the lower half is... Finally, rotate the scaled objects. Performing the same process on each arranged graphic object will ensure the arranged graphic objects fill the entire space. and The region between the two curves.
[0159] Based on the above method, more complex effects of arranging graphic objects along curves can be achieved. For example... Figure 9 A group of trajectory curves arranged vertically in parallel, such as Figure 10 This creates an effect where graphic objects are arranged along the curve spacing.
[0160] For example, given two or more trajectory curve objects arranged vertically, the distance between each pair of adjacent curves can be different. The specific processing method is as follows: First, the centerline (a type of boundary line) obtained by interpolation algorithm between corresponding points of the two curves is used as the trajectory graphic object; next, the intersection points of the left and right boundaries with the upper trajectory curve object are calculated; then, a curvilinear quadrilateral is constructed using the two centerlines and the upper and lower boundary curve segments; finally, a bilinear transformation is performed on the arranged graphic object to achieve graphic distortion, thus realizing the arrangement of curves with unequal spacing. Figure 11 It is a group of trajectory curves with unequal spacing arranged on the upper line. Figure 12 This is the effect of arranging graphic objects along a curve using the method described in Example 2.
[0161] The proposed method for generating graphic anti-counterfeiting marks involves providing vector graphic arrangement objects and trajectory curve objects, and calculating the minimum bounding rectangle of each object to be arranged. The starting and ending coordinates of the trajectory curve objects are determined, resulting in all specific arrangement point positions of the arranged objects on the trajectory curve objects. The arranged objects are then translated to the corresponding arrangement point positions on the trajectory curve, and a modulation operation is performed on the arranged objects to generate the graphic arrangement effect. By arranging vector graphic objects along the vector graphic trajectory curve according to specific rules, and then performing graphic modulation operations on this basis, more complex and diverse graphic arrangement pattern effects can be achieved, with fast calculation speed. By providing the graphics to be arranged and the trajectory curve to be arranged, graphic anti-counterfeiting marks are obtained. The algorithm for graphic anti-counterfeiting marks has been optimized, reducing computational complexity and thus improving calculation speed, while providing more diverse graphic arrangement methods than traditional anti-counterfeiting marks.
[0162] like Figure 13 As shown, this embodiment of the invention also provides an anti-counterfeiting mark generation device 130, comprising:
[0163] The acquisition module 1301 is used to acquire the graphic to be arranged and the trajectory curve to be arranged;
[0164] Processing module 1302 is configured to obtain at least one graphic element and at least one circumscribed rectangle based on the graphic to be arranged; translate the at least one graphic element onto the trajectory curve to be arranged based on the at least one circumscribed rectangle to obtain an intermediate graphic anti-counterfeiting mark; and determine the rotation angle of the at least one graphic element when it is arranged on the intermediate graphic anti-counterfeiting mark.
[0165] The generation module 1303 is used to rotate at least one graphic element on the intermediate graphic anti-counterfeiting mark according to the rotation angle to generate the graphic anti-counterfeiting mark.
[0166] Optionally, the processing module 1302 is specifically used for:
[0167] The elements of the graphic to be arranged are extracted to obtain at least one graphic element;
[0168] The width and height of the at least one graphic element are used as the width and height of its circumscribed rectangle, respectively, to form at least one circumscribed rectangle.
[0169] Optionally, based on the at least one circumscribed rectangle, the at least one graphic element is translated onto the trajectory curve to be arranged to obtain an intermediate graphic anti-counterfeiting mark, including:
[0170] The coordinates of the end point are obtained based on the starting point coordinates of the at least one circumscribed rectangle and the at least one graphic element.
[0171] According to the starting point coordinates and the ending point coordinates, all graphic elements are evenly arranged on the trajectory curve to be arranged, and all the outer rectangles are connected end to end to obtain the middle graphic anti-counterfeiting mark.
[0172] Optionally, when the trajectory curve to be arranged is a straight line segment, the coordinates of the ending point are obtained based on the at least one circumscribed rectangle and the coordinates of the starting point, including:
[0173] Based on the trajectory curve to be arranged, the coordinates of the endpoints of the straight line segments are obtained;
[0174] Based on the endpoint coordinates, the first vector is obtained;
[0175] The coordinates of the termination point are obtained based on the first vector, the coordinates of the at least one circumscribed rectangle, and the coordinates of the starting point of the at least one graphic element.
[0176] Optionally, when the trajectory curve to be arranged is a curve segment, the coordinates of the ending point are obtained based on the at least one circumscribed rectangle and the coordinates of the starting point, including:
[0177] Based on the trajectory curves to be arranged, the target matrix of the curve segments is obtained;
[0178] The first distance is obtained based on the trajectory curve to be arranged, the at least one circumscribed rectangle, the target matrix, and the coordinates of the starting point;
[0179] The trajectory curve to be arranged is evenly divided to obtain at least two intermediate curve segments;
[0180] Select a target point on each of the at least two intermediate curve segments to form a point set with at least two target points;
[0181] Based on the at least two intermediate curve segments, the point set, the target matrix, and the starting point coordinates, determine at least two second distances between the target point in the point set and the starting point;
[0182] Based on the first distance, the at least two second distances, and the preset conditions, determine whether the termination point exists in the point set;
[0183] Based on the judgment result, the coordinates of the termination point are obtained by acquiring the target point that meets the preset conditions or by acquiring the midpoint of the adjacent target points.
[0184] Optionally, if the target trajectory curve to be arranged is a single line, all graphic elements are evenly arranged on the trajectory curve according to the starting point coordinates and the ending point coordinates, and all the circumscribed rectangles are connected end to end to obtain the intermediate graphic anti-counterfeiting mark, including:
[0185] By placing the midpoint of the first boundary of the circumscribed rectangle on the starting point coordinates of the target trajectory curve to be arranged, all graphic elements are translated onto the target trajectory curve to be arranged, and all circumscribed rectangles are connected end to end to obtain the intermediate graphic anti-counterfeiting mark; wherein, the ending point coordinates of the first graphic element in two adjacent graphic elements are the starting point coordinates of the second graphic element.
[0186] Optionally, if there are two or more target trajectory curves to be arranged, all graphic elements are evenly arranged on the trajectory curves according to the starting point coordinates and the ending point coordinates, and all the outer rectangles are connected end to end to obtain the intermediate graphic anti-counterfeiting mark, including:
[0187] Obtain the boundary line between each pair of target trajectory curves to be arranged;
[0188] Align the midpoint of the first boundary of the circumscribed rectangle with the starting point coordinates of the boundary line, translate all graphic elements onto the boundary line, and connect all circumscribed rectangles end to end to obtain the middle graphic anti-counterfeiting mark; wherein, the ending point coordinates of the first graphic element in two adjacent graphic elements are the starting point coordinates of the second graphic element.
[0189] Optionally, determining the rotation angle of the at least one graphic element when it is arranged on the intermediate graphic anti-counterfeiting mark includes:
[0190] Determine the verticality of the target trajectory curve range occupied by the at least one graphic element on the intermediate graphic anti-counterfeiting mark, and obtain the vertical result;
[0191] Based on the vertical result, determine the rotation angle.
[0192] It should be noted that this device is a device corresponding to the above method. All implementation methods in the above method embodiments are applicable to this embodiment and can achieve the same technical effect.
[0193] 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.
[0194] 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.
[0195] 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 apparatuses or units may be electrical, mechanical, or other forms.
[0196] 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.
[0197] 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.
[0198] 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, 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 of 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.
[0199] 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.
[0200] 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 for 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 for 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.
[0201] The above are preferred embodiments of the present invention. It should be noted that, for those skilled in the art, several improvements and modifications can be made without departing from the principle 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 marks, characterized in that, include: Obtain the graphic to be arranged and the trajectory curve to be arranged; Based on the graphic to be arranged, at least one graphic element and at least one bounding rectangle are obtained; Based on the at least one circumscribed rectangle, the at least one graphic element is translated onto the trajectory curve to be arranged to obtain the intermediate graphic anti-counterfeiting mark; Determining the rotation angle of the at least one graphic element when it is arranged on the intermediate graphic anti-counterfeiting mark includes: determining the verticality of the target trajectory curve range to be arranged on the intermediate graphic anti-counterfeiting mark occupied by the at least one graphic element, and obtaining a vertical result; and determining the rotation angle based on the vertical result. According to the rotation angle, at least one graphic element on the intermediate graphic anti-counterfeiting mark is rotated to generate a graphic anti-counterfeiting mark.
2. The method for generating anti-counterfeiting marks according to claim 1, characterized in that, Based on the graphics to be arranged, at least one graphic element and at least one circumscribed rectangle are obtained, including: The elements of the graphic to be arranged are extracted to obtain at least one graphic element; The width and height of the at least one graphic element are used as the width and height of its circumscribed rectangle, respectively, to form at least one circumscribed rectangle.
3. The method for generating anti-counterfeiting marks according to claim 1, characterized in that, Based on the at least one circumscribed rectangle, the at least one graphic element is translated onto the trajectory curve to be arranged to obtain the intermediate graphic anti-counterfeiting mark, including: The coordinates of the end point are obtained based on the starting point coordinates of the at least one circumscribed rectangle and the at least one graphic element. According to the starting point coordinates and the ending point coordinates, all graphic elements are evenly arranged on the trajectory curve to be arranged, and all the outer rectangles are connected end to end to obtain the middle graphic anti-counterfeiting mark.
4. The method for generating anti-counterfeiting marks according to claim 3, characterized in that, When the trajectory curve to be arranged is a straight line segment, the coordinates of the ending point are obtained based on the starting point coordinates of the at least one circumscribed rectangle and the at least one graphic element, including: Based on the trajectory curve to be arranged, the coordinates of the endpoints of the straight line segments are obtained; Based on the endpoint coordinates, the first vector is obtained; The coordinates of the termination point are obtained based on the first vector, the coordinates of the at least one circumscribed rectangle, and the coordinates of the starting point of the at least one graphic element.
5. The method for generating anti-counterfeiting marks according to claim 3, characterized in that, When the trajectory curve to be arranged is a curve segment, the coordinates of the ending point are obtained based on the starting point coordinates of the at least one circumscribed rectangle and the starting point coordinates of the at least one graphic element, including: Based on the trajectory curves to be arranged, the target matrix of the curve segments is obtained; The first distance is obtained based on the trajectory curve to be arranged, the at least one circumscribed rectangle, the target matrix, and the coordinates of the starting point; The trajectory curve to be arranged is evenly divided to obtain at least two intermediate curve segments; Select a target point on each of the at least two intermediate curve segments to form a point set with at least two target points; Based on the at least two intermediate curve segments, the point set, the target matrix, and the starting point coordinates, determine at least two second distances between the target point in the point set and the starting point; Based on the first distance, the at least two second distances, and the preset conditions, determine whether the termination point exists in the point set; Based on the judgment result, the coordinates of the termination point are obtained by acquiring the target point that meets the preset conditions or by acquiring the midpoint of the adjacent target points.
6. The method for generating anti-counterfeiting marks according to claim 3, characterized in that, When the target trajectory curve to be arranged is one, all graphic elements are evenly arranged on the trajectory curve according to the starting point coordinates and the ending point coordinates, and all the outer rectangles are connected end to end to obtain the intermediate graphic anti-counterfeiting mark, including: By placing the midpoint of the first boundary of the circumscribed rectangle on the starting point coordinates of the target trajectory curve to be arranged, all graphic elements are translated onto the target trajectory curve to be arranged, and all circumscribed rectangles are connected end to end to obtain the intermediate graphic anti-counterfeiting mark; wherein, the ending point coordinates of the first graphic element in two adjacent graphic elements are the starting point coordinates of the second graphic element.
7. The method for generating anti-counterfeiting marks according to claim 3, characterized in that, When there are two or more target trajectory curves to be arranged, all graphic elements are evenly arranged on the trajectory curves according to the starting point coordinates and the ending point coordinates, and all the outer rectangles are connected end to end to obtain the intermediate graphic anti-counterfeiting mark, including: Obtain the boundary line between each pair of target trajectory curves to be arranged; Align the midpoint of the first boundary of the circumscribed rectangle with the starting point coordinates of the boundary line, translate all graphic elements onto the boundary line, and connect all circumscribed rectangles end to end to obtain the middle graphic anti-counterfeiting mark; wherein, the ending point coordinates of the first graphic element in two adjacent graphic elements are the starting point coordinates of the second graphic element.
8. A device for generating anti-counterfeiting marks, characterized in that, The device for generating the anti-counterfeiting mark includes: The acquisition module is used to acquire the graphic to be arranged and the trajectory curve to be arranged; The processing module is configured to: obtain at least one graphic element and at least one bounding rectangle based on the graphic to be arranged; translate the at least one graphic element onto the trajectory curve to be arranged based on the at least one bounding rectangle to obtain an intermediate graphic anti-counterfeiting mark; determine the rotation angle of the at least one graphic element when arranged on the intermediate graphic anti-counterfeiting mark, including: determining the verticality of the at least one graphic element occupying the target trajectory curve range to be arranged on the intermediate graphic anti-counterfeiting mark, and obtaining a vertical result; and determine the rotation angle based on the vertical result. The generation module is used to rotate at least one graphic element on the intermediate graphic anti-counterfeiting mark according to the rotation angle to generate the graphic anti-counterfeiting mark.
9. A computer-readable storage medium, characterized in that, The system stores instructions that, when executed on a computer, cause the computer to perform the method as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Method and apparatus for generating safety shading in plate making false prevetion
CN101231758A
Image anti-counterfeiting recognition method applied to bills
CN103729672A