CN111246046B - Pattern encoding method and device, pattern decoding method and device - Google Patents

Pattern encoding method and device, pattern decoding method and device Download PDF

Info

Publication number
CN111246046B
CN111246046B CN202010231956.8A CN202010231956A CN111246046B CN 111246046 B CN111246046 B CN 111246046B CN 202010231956 A CN202010231956 A CN 202010231956A CN 111246046 B CN111246046 B CN 111246046B
Authority
CN
China
Prior art keywords
pattern
basic
attribute
graphic
parameter
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010231956.8A
Other languages
Chinese (zh)
Other versions
CN111246046A (en
Inventor
吴玉强
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Alipay Hangzhou Information Technology Co Ltd
Original Assignee
Alipay Hangzhou Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Alipay Hangzhou Information Technology Co Ltd filed Critical Alipay Hangzhou Information Technology Co Ltd
Priority to CN202010231956.8A priority Critical patent/CN111246046B/en
Publication of CN111246046A publication Critical patent/CN111246046A/en
Application granted granted Critical
Publication of CN111246046B publication Critical patent/CN111246046B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N1/00Scanning, transmission or reproduction of documents or the like, e.g. facsimile transmission; Details thereof
    • H04N1/32Circuits or arrangements for control or supervision between transmitter and receiver or between image input and image output device, e.g. between a still-image camera and its memory or between a still-image camera and a printer device
    • H04N1/32101Display, printing, storage or transmission of additional information, e.g. ID code, date and time or title
    • H04N1/32144Display, printing, storage or transmission of additional information, e.g. ID code, date and time or title embedded in the image data, i.e. enclosed or integrated in the image, e.g. watermark, super-imposed logo or stamp
    • H04N1/32149Methods relating to embedding, encoding, decoding, detection or retrieval operations
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N1/00Scanning, transmission or reproduction of documents or the like, e.g. facsimile transmission; Details thereof
    • H04N1/32Circuits or arrangements for control or supervision between transmitter and receiver or between image input and image output device, e.g. between a still-image camera and its memory or between a still-image camera and a printer device
    • H04N1/32101Display, printing, storage or transmission of additional information, e.g. ID code, date and time or title
    • H04N1/32144Display, printing, storage or transmission of additional information, e.g. ID code, date and time or title embedded in the image data, i.e. enclosed or integrated in the image, e.g. watermark, super-imposed logo or stamp
    • H04N1/32149Methods relating to embedding, encoding, decoding, detection or retrieval operations
    • H04N1/32267Methods relating to embedding, encoding, decoding, detection or retrieval operations combined with processing of the image

Abstract

The present specification provides a pattern encoding method and apparatus, and a pattern decoding method and apparatus, wherein the pattern encoding method includes: acquiring a pattern to be coded; decomposing a pattern to be coded into a plurality of preset basic patterns, and determining a pattern attribute corresponding to the basic patterns contained in the pattern to be coded and a first drawing parameter of the pattern attribute; adjusting the first drawing parameter of the graphic attribute to construct at least one second drawing parameter of the graphic attribute; and mapping the graphic attribute with each of the first rendering parameter and the at least one second rendering parameter, respectively, to generate a mapping table. By adopting the pattern coding method in the specification, multiple patterns with slight differences are generated from one pattern based on the graphic attributes and drawing parameters of the patterns, and the same effect as that of the watermark is achieved. The pattern coding method has low requirements on image resolution and can be applied to dynamically-changed images and has high anti-interference performance.

Description

Pattern encoding method and device, pattern decoding method and device
Technical Field
The present disclosure relates to the field of image watermarking technologies, and in particular, to a pattern encoding method and apparatus, and a pattern decoding method and apparatus. The present specification also relates to a computing device, and a computer-readable storage medium.
Background
With the development of image watermarking technology, digital watermarking is widely used.
In the prior art, digital watermarking technology is used to realize copyright tracking, copyright statement, content tamper resistance and the like of multimedia content. However, the digital watermarking technology has the following defects: the digital watermark can be added to the high-resolution image, and the digital watermark cannot be added to the low-resolution image; the digital watermark cannot be applied to dynamically changing images, such as screenshots during mobile phone application operation; in addition, the anti-interference is low, the digital watermark information is lost after the high-definition image is compressed in a loss mode or is reduced integrally, the digital watermark can only be kept when the original image is distributed, and if the digital watermark information is transmitted in a photographing mode or the like, the digital watermark information can be lost.
Disclosure of Invention
In view of this, embodiments of the present disclosure provide a pattern encoding method and apparatus, and a pattern decoding method and apparatus. The present specification also relates to a computing device and a computer-readable storage medium to address technical deficiencies in the prior art.
According to a first aspect of embodiments herein, there is provided a pattern encoding method including:
acquiring a pattern to be coded;
the pattern to be coded is disassembled into a plurality of preset basic patterns, and a pattern attribute corresponding to the basic patterns contained in the pattern to be coded and a first drawing parameter of the pattern attribute are determined;
adjusting the first drawing parameter of the graphic attribute to construct at least one second drawing parameter of the graphic attribute; and
and mapping the graphic attribute with each of the first drawing parameter and the at least one second drawing parameter respectively to generate a mapping table.
Further, the pattern encoding method further includes:
and in response to receiving the association request, associating the identifier to be associated carried in the association request with a conversion code to form an association table, wherein the conversion code is determined by the graphic attribute in the mapping table and any drawing parameter of the graphic attribute.
Further, the pattern attributes corresponding to the basic patterns include attribute information of each basic pattern and a relative relationship between any two basic patterns, and determining the pattern attributes corresponding to the basic patterns included in the pattern to be encoded includes:
and determining the attribute information of each basic graph and the relative relationship between any two basic graphs.
Further, adjusting the first rendering parameter of the graphic attribute to construct at least one second rendering parameter of the graphic attribute comprises:
and modifying the first drawing parameter of the graphic attribute within a preset range to form at least one second drawing parameter of the graphic attribute.
According to a second aspect of embodiments herein, there is provided a pattern encoding apparatus comprising:
the acquisition module is used for acquiring a pattern to be coded;
the determining module is used for disassembling the pattern to be coded into a plurality of preset basic patterns and determining a pattern attribute corresponding to the basic patterns contained in the pattern to be coded and a first drawing parameter of the pattern attribute;
the construction module is used for adjusting the first drawing parameters of the graphic attributes to construct at least one second drawing parameter of the graphic attributes; and
a mapping module, configured to map the graphic attribute with each of the first rendering parameter and the at least one second rendering parameter, respectively, so as to generate a mapping table.
Further, the pattern encoding apparatus further includes:
and the association module is used for associating the identifier to be associated carried in the association request with the conversion code in response to receiving the association request to form an association table, wherein the conversion code is determined by the graphic attribute in the mapping table and any drawing parameter of the graphic attribute.
Further, the graphic attributes corresponding to the basic graphics include attribute information of each basic graphic and a relative relationship between any two basic graphics, and the determining module is further configured to:
and determining the attribute information of each basic graph and the relative relationship between any two basic graphs.
Further, the construction module is further configured to:
and modifying the first drawing parameter of the graphic attribute within a preset range to form at least one second drawing parameter of the graphic attribute.
According to a third aspect of embodiments herein, there is provided a pattern decoding method including:
acquiring a pattern to be decoded;
decomposing the pattern to be decoded into a plurality of preset basic patterns, and determining the pattern attribute corresponding to the basic patterns contained in the pattern to be decoded and the drawing parameters of the pattern attribute;
determining the graphic attribute and the drawing parameter of the graphic attribute as a conversion code;
based on the conversion code, searching a corresponding association identifier in a pre-configured association table, wherein the association table records the association relationship between the association identifier and the conversion code.
Further, the graphic attributes corresponding to the basic graphics include attribute information of each basic graphic and a relative relationship between any two basic graphics, and determining the graphic attributes corresponding to the basic graphics included in the pattern to be decoded includes:
and determining the attribute information of each basic graph and the relative relationship between any two basic graphs.
According to a fourth aspect of embodiments herein, there is provided a pattern decoding apparatus comprising:
the acquisition module is used for acquiring a pattern to be decoded;
the determining module is used for decomposing the pattern to be decoded into a plurality of preset basic patterns and determining the pattern attributes corresponding to the basic patterns contained in the pattern to be decoded and the drawing parameters of the pattern attributes;
the conversion module is used for determining the graphic attributes and the drawing parameters of the graphic attributes as conversion codes;
and the searching module is used for searching the corresponding association identifier in a pre-configured association table based on the conversion code, wherein the association relationship between the association identifier and the conversion code is recorded in the association table.
Further, the graphic attributes corresponding to the basic graphics include attribute information of each basic graphic and a relative relationship between any two basic graphics, and the determining module is further configured to:
and determining the attribute information of each basic graph and the relative relationship between any two basic graphs.
According to a fifth aspect of embodiments herein, there is provided a computing device comprising:
a memory and a processor;
the memory is to store computer-executable instructions, and the processor is to execute the computer-executable instructions to:
acquiring a pattern to be coded;
the pattern to be coded is disassembled into a plurality of preset basic patterns, and a pattern attribute corresponding to the basic patterns contained in the pattern to be coded and a first drawing parameter of the pattern attribute are determined;
adjusting the first drawing parameter of the graphic attribute to construct at least one second drawing parameter of the graphic attribute; and
and mapping the graphic attribute with each of the first drawing parameter and the at least one second drawing parameter respectively to generate a mapping table.
According to a sixth aspect of embodiments herein, there is provided a computing device comprising:
a memory and a processor;
the memory is to store computer-executable instructions, and the processor is to execute the computer-executable instructions to:
acquiring a pattern to be decoded;
decomposing the pattern to be decoded into a plurality of preset basic patterns, and determining the pattern attribute corresponding to the basic patterns contained in the pattern to be decoded and the drawing parameters of the pattern attribute;
determining the graphic attribute and the drawing parameter of the graphic attribute as a conversion code;
based on the conversion code, searching a corresponding association identifier in a pre-configured association table, wherein the association table records the association relationship between the association identifier and the conversion code.
According to a seventh aspect of embodiments herein, there is provided a computer-readable storage medium storing computer-executable instructions that, when executed by a processor, implement the steps of any of the pattern encoding methods and pattern decoding methods.
In the pattern encoding method provided in an embodiment of the present specification, a pattern to be encoded is obtained, the pattern to be encoded is disassembled into a plurality of preset basic patterns, a pattern attribute corresponding to a basic pattern included in the pattern to be encoded and a first drawing parameter of the pattern attribute are determined, the first drawing parameter of the pattern attribute is adjusted to construct at least one second drawing parameter of the pattern attribute, and the pattern attribute is mapped with each of the first drawing parameter and the at least one second drawing parameter, so as to generate a mapping table, so that a plurality of patterns with slight differences are generated from one pattern based on the pattern attribute and the drawing parameter of the pattern, and the same effect as a watermark is achieved. The pattern coding method provided by the embodiment has low requirements on image resolution, can be applied to dynamically-changed images and has high anti-interference performance.
Drawings
Fig. 1 is a flowchart of a pattern encoding method provided in an embodiment of the present specification;
fig. 2 is a schematic diagram of an example of a pattern encoding method provided in an embodiment of the present specification;
FIG. 3 is a schematic structural diagram of a pattern encoding apparatus according to an embodiment of the present disclosure;
FIG. 4 is a flow chart of a pattern decoding method provided in an embodiment of the present disclosure;
fig. 5 is a schematic structural diagram of a pattern decoding apparatus according to an embodiment of the present disclosure;
fig. 6 is a block diagram of a computing device according to an embodiment of the present disclosure.
Detailed Description
In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present description. This description may be embodied in many different forms and should not be construed as limited to the embodiments set forth herein, as those skilled in the art will be able to make and use the present disclosure without departing from the spirit and scope of the present disclosure.
The terminology used in the description of the one or more embodiments is for the purpose of describing the particular embodiments only and is not intended to be limiting of the description of the one or more embodiments. As used in one or more embodiments of the present specification and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used in one or more embodiments of the present specification refers to and encompasses any and all possible combinations of one or more of the associated listed items.
It will be understood that, although the terms first, second, etc. may be used herein in one or more embodiments to describe various information, these information should not be limited by these terms. These terms are only used to distinguish one type of information from another. For example, a first can also be referred to as a second and, similarly, a second can also be referred to as a first without departing from the scope of one or more embodiments of the present description. The word "if" as used herein may be interpreted as "at … …" or "when … …" or "in response to a determination", depending on the context.
First, the noun terms to which one or more embodiments of the present specification relate are explained.
The service identifier is a unique identifier allocated to each service instance after the service server creates the service instance for each service of the client in the internet application.
In the present specification, a pattern encoding method is provided, and the present specification simultaneously relates to a pattern encoding apparatus, a computing device, and a computer-readable storage medium, which are described in detail one by one in the following embodiments.
Fig. 1 shows a flowchart of a pattern encoding method provided in an embodiment of the present specification, which specifically includes the following steps:
step 102: and acquiring a pattern to be coded.
The pattern to be coded may be an icon of an application or a pattern of an object desired to be shared.
Step 104: the method comprises the steps of disassembling a pattern to be coded into a plurality of preset basic patterns, and determining pattern attributes corresponding to the basic patterns contained in the pattern to be coded and first drawing parameters of the pattern attributes.
The pattern is disassembled based on a preset basic pattern, and the basic pattern can be points, line segments, arcs, circles, ellipses and the like.
The graphic attributes corresponding to the basic graphics may include attribute information of each basic graphic and a relative relationship between any two basic graphics, and determining the graphic attributes corresponding to the basic graphics included in the pattern to be encoded may include: and determining the attribute information of each basic graph and the relative relationship between any two basic graphs.
Because the relative relation between the attribute information of each basic graph and the basic graph is easy to determine and has fixed parameters, the method for determining the graph attribute is simplified, and the accuracy is improved.
The attribute information of the basic figures can be length, width, curvature, radius, etc., and the relative relationship between the basic figures can be expressed as distance, included angle, etc. between the basic figures. The first drawing parameter of the graph attribute is a numerical value corresponding to the attribute information and the relative relationship of the basic graph, and is used as a baseline drawing parameter.
Step 106: and adjusting the first drawing parameter of the graphic attribute to construct at least one second drawing parameter of the graphic attribute.
Adjusting the baseline rendering parameters of the graphic attributes to construct at least one second rendering parameter of the graphic attributes comprises:
and modifying the first drawing parameter of the graphic attribute within a predetermined range to form at least one second drawing parameter of the graphic attribute.
The modification within the predetermined range may be, for example, a ratio of a difference between the modified rendering parameter and the baseline rendering parameter to the baseline rendering parameter within a predetermined range, for example, a modification range of the length parameter to the width parameter is within 15%, a modification range of the curvature parameter to the radius parameter is within 25%, a modification range of the distance parameter to the angle parameter is within 20%, the above parameter modification ranges are listed for illustrative purposes only, and are not to be construed as limiting the scope of the present specification.
Modifying the rendering parameters within a predetermined range can make the finally formed pattern not to differ too much from the pattern to be encoded, have visual consistency and can identify the difference.
Step 108: mapping the graphic attribute with each of the first rendering parameter and the at least one second rendering parameter, respectively, to generate a mapping table.
The mapping table may have n rows (n is greater than or equal to 2), the first row records the mapping relationship between the graphic attribute and the baseline drawing parameter, and the 2 nd to n th rows record the mapping relationship between the graphic attribute and the first adjusted drawing parameter value, i.e., the n-1 th adjusted drawing parameter, and the arrangement of the mapping table is not limited to the above manner.
Fig. 2 is a schematic diagram illustrating an example of a pattern encoding method provided in an embodiment of the present specification.
As shown in part (a) of fig. 2, the pattern to be encoded is formed by combining two basic patterns of a circle and a line segment. After the pattern to be coded is disassembled, the corresponding graphic attributes of the basic graphic contained in the pattern to be coded are A, B, C, D and E, wherein A is the width parameter of the basic line frame; b is the distance between the circular edge and the base line frame; c is a length parameter of the line segment; d is an included angle parameter between the line segment and the horizontal line; and E is the distance between the intersection point of the two line segments and the center of the circle.
At least one of the drawing parameters of A, B, C, D and E is modified within a predetermined range, and the ratio of the difference between the modified drawing parameter and the baseline drawing parameter to the baseline drawing parameter is within the predetermined range, so that the finally formed pattern as shown in part (b) of FIG. 2 does not differ too much from the pattern shown in part (a) of FIG. 2, has visual consistency, and is able to be identified differently.
As shown in part (b) of fig. 2, in the example of the present embodiment, the drawing parameters of the graphic attributes C and E are modified, and the remaining parameters are not changed.
The graphics attributes A, B, C, D and E are mapped with each of the baseline rendering parameters and the modified rendering parameters, respectively, to generate a mapping table.
TABLE 1 mapping table
Code A-B-C-D-E
000 60-10-15-105-08
001 60-10-13-105-06
002 60-10-14-105-07
B. C, D and E are drawn with A as a proportional base line and drawing parameters of other attributes are drawn as the proportion of the drawing parameters of the attribute A, so that the pattern stretching/cutting can be realized with high recognition degree and high anti-interference performance.
The pattern encoding method provided in this embodiment generates a plurality of patterns having a slight difference from one pattern based on the graphic attributes and the drawing parameters of the patterns, and achieves the same effect as the watermark. The pattern coding method provided by the embodiment has no requirement on the pixels of the image, so that the method does not depend on the image resolution, the graphic attribute and the drawing parameter are not changed during screenshot or photographing, the method can be applied to the dynamically changed image, and the parameters are changed in proportion under the condition of pattern stretching/cutting, so that the anti-interference performance is high.
In an alternative embodiment, the pattern encoding method shown in fig. 1 may further include:
and in response to the received display instruction, drawing and displaying the variant pattern according to the graphic attribute and the modified drawing parameter, wherein the display instruction carries the image attribute and the drawing parameter of the pattern to be displayed.
A coded pattern can be drawn according to the image attributes and each set of drawing parameters. In practical application, the coded pattern to be displayed can be drawn and displayed according to the received display instruction.
Further, in an optional embodiment, the pattern encoding method shown in fig. 1 may further include:
responding to a received association request, associating the identifier to be associated carried in the association request with a conversion code to form an association table, wherein the conversion code is determined by a graphic attribute in a mapping table and any drawing parameter of the graphic attribute.
In practical application, the conversion code can be directly determined by the n-row mapping relationship in the mapping table or converted by the n-row mapping relationship.
According to the pattern coding method of the embodiment, the association between the identifier to be associated and the mapping table is realized, and the correspondence between each identifier to be associated and one of different drawing parameters of the graphic attribute is realized.
The association request may be a service association request or a user association request, where the service association request carries different service identifiers and the user association request carries different user identifiers.
After the mapping table shown in table 1 is generated, in response to receiving user association requests of different users, user identifications of the different users are associated with the conversion codes to form a user association table. The user identifications of different users correspond to the graphic attributes and different drawing parameters in the mapping table, so that patterns drawn by the different drawing parameters can be distributed to different users.
Or, in response to receiving the different service association request, associating the different service identifier with the conversion code to form a service association table. The service identifications of different users correspond to the graphic attributes and different drawing parameters in the mapping table, so that patterns drawn by the different drawing parameters can be distributed to different services.
Next, the pattern coding method according to the present embodiment is further described by taking an application scenario in which a pattern to be coded is an application icon as an example.
In the present application scenario, it is desirable to assign to each business the same application icon that appears the same, but is substantially different, to facilitate tracing back the business based on the application icon.
In the present embodiment, the application icon is as shown in part (a) of fig. 2.
As described above, after the pattern is acquired, it is decomposed into the graphic attributes A, B, C, D and E, the baseline drawing parameters 60-10-15-105-08 are measured, the drawing parameters are modified within a predetermined range, and a mapping table is generated. The modified pattern may be rendered based on the graphic attributes and the modified rendering parameters.
In response to a request related to service execution, a service identification may be associated with a conversion code (e.g., 001) determined by a graphic attribute and any drawing parameter (e.g., 60-10-13-105-06) in a mapping table to form an association table.
The modified pattern drawn with the corresponding drawing parameter 60-10-13-105-06, i.e., the pattern in (b) of fig. 2, is associated with the service as the display pattern of the application icon corresponding to the service.
By applying the coding method provided by the embodiment of the application, the effect of distributing the personalized icon to each service can be realized.
The pattern encoding method according to the present embodiment is further described below by taking a pattern application scenario in which a pattern to be encoded is an object desired to be shared as an example.
In the case where the pattern to be encoded is a pattern of an object desired to be shared, the pattern is similarly decomposed into graphic attributes A, B, C, D and E as shown in part (a) of fig. 2, baseline rendering parameters 60-10-15-105-08 are measured, the rendering parameters are modified within a predetermined range, and a mapping table is generated. In response to a browsing request of a user, associating a user identification with a conversion code (e.g. 001) determined by a graphic attribute and any one of the rendering parameters (e.g. 60-10-13-105-06) in the mapping table to form an association table, and allocating a variant pattern, i.e. the pattern in (b) of fig. 2, rendered with the corresponding rendering parameter 60-10-13-105-06 to the user as a pattern of an object which the user browses and wishes to share.
By applying the coding method provided by the embodiment of the application, the effect of distributing personalized patterns of sharing objects to each user can be realized.
Corresponding to the above method embodiment, the present specification further provides a pattern encoding apparatus embodiment, and fig. 3 shows a schematic structural diagram of a pattern encoding apparatus provided in an embodiment of the present specification. As shown in fig. 3, the apparatus includes an obtaining module 302, a determining module 304, a constructing module 306, and a mapping module 308.
An obtaining module 302, configured to obtain a pattern to be encoded.
The determining module 304 is configured to disassemble the pattern to be encoded into a plurality of preset basic patterns, and determine a pattern attribute corresponding to the basic pattern included in the pattern to be encoded and a first drawing parameter of the pattern attribute.
The constructing module 306 adjusts the first drawing parameter of the graphic attribute to construct at least one second drawing parameter of the graphic attribute.
A mapping module 308, configured to map the graphic attribute with each of the first rendering parameter and the at least one second rendering parameter, respectively, to generate a mapping table.
The pattern encoding apparatus according to the present embodiment generates a plurality of patterns having a slight difference from one pattern based on the graphic properties and the drawing parameters of the pattern, and achieves the same effect as the watermark. The pattern coding device provided by the embodiment has no requirement on the pixels of the image, so the device does not depend on the image resolution, and the graphic attribute and the drawing parameter are not changed when in screenshot or photographing, so the device can be applied to the dynamically changed image, and the parameters are changed in proportion under the condition of pattern stretching/cutting, so the anti-interference performance is high.
Further, the pattern encoding apparatus may further include an association module 310.
The association module 310 is configured to associate, in response to receiving an association request, the identifier to be associated carried in the association request with a conversion code to form an association table, where the conversion code is determined by any drawing parameter of the graphic attribute and the graphic attribute in the mapping table.
The pattern coding device according to this embodiment associates the to-be-associated identifier with the mapping table, and associates each to-be-associated identifier with one of the different drawing parameters of the graphic attribute.
Further, in an optional embodiment, the graphic attributes corresponding to the basic graphics include attribute information of each basic graphic and a relative relationship between any two basic graphics, and the determining module 304 is further configured to: and determining the attribute information of each basic graph and the relative relationship between any two basic graphs. Because the relative relation between the attribute information of each basic graph and the basic graph is easy to determine and has fixed parameters, the method for determining the graph attribute is simplified, and the accuracy is improved.
Further, in an alternative embodiment, the configuration module 306 may be further configured to: and modifying the first drawing parameter of the graphic attribute within a predetermined range to form at least one second drawing parameter of the graphic attribute. Modifying the rendering parameters within a predetermined range can make the finally formed pattern not to differ too much from the pattern to be encoded, have visual consistency and can identify the difference.
Fig. 4 is a flowchart illustrating a pattern decoding method according to an embodiment of the present disclosure, which specifically includes the following steps:
step 402: and acquiring a pattern to be decoded.
The pattern to be decoded may be an icon of an application or a pattern of an object desired to be shared.
Step 404: and disassembling the pattern to be decoded into a plurality of preset basic patterns, and determining the pattern attribute corresponding to the basic patterns contained in the pattern to be decoded and the drawing parameter of the pattern attribute.
The pattern is disassembled based on a preset basic pattern, and the basic pattern can be points, line segments, arcs, circles, ellipses and the like.
The graphic attributes corresponding to the basic graphic may include attribute information of each basic graphic and a relative relationship between any two basic graphics, and determining the graphic attributes corresponding to the basic graphic included in the pattern to be decoded may include: and determining the attribute information of each basic graph and the relative relationship between any two basic graphs.
Because the relative relation between the attribute information of each basic graph and the basic graph is easy to determine and has fixed parameters, the method for determining the graph attribute is simplified, and the accuracy is improved.
The attribute information of the basic patterns themselves may be length, width, curvature, major diameter, minor diameter, etc., and the relative relationship between the basic patterns may be expressed as distance, included angle, etc. between the basic patterns. The first drawing parameter of the graph attribute is a numerical value corresponding to the attribute information and the relative relationship of the basic graph, and is used as a baseline drawing parameter.
Step 406: the graphic attributes and the drawing parameters of the graphic attributes are determined as conversion codes.
The conversion code can be directly determined or converted by the mapping relation in the pre-configured mapping table.
Step 408: based on the conversion code, searching a corresponding association identifier in a pre-configured association table, wherein the association table records the association relationship between the association identifier and the conversion code.
The association table is formed in the pattern encoding method according to the first embodiment of the present invention.
According to the pattern decoding method of the embodiment, the associated identification is obtained according to the graphic attribute of the pattern and the drawing parameter of the graphic attribute.
The pattern decoding method according to the present embodiment is further described below by taking an application scenario in which a pattern to be decoded is an application icon corresponding to a service as an example.
After the pattern as in fig. 2(b) is acquired, it is disassembled and basic graphic attributes A, B, C, D and E are obtained and drawing parameters 60-10-13-105-06 of the graphic attributes are obtained.
And determining the conversion code to be 001 based on the mapping relation, and then finding the service identifier corresponding to the conversion code 001 in a pre-configured association table, so that the service identifier corresponding to the icon display pattern of the application program can be determined.
In the case that a modified pattern which is changed by taking the pattern of fig. 2(a) as a baseline is allocated as an application display icon in response to the execution of a plurality of businesses, the display icon corresponding to each business is a changed unique pattern, which business corresponds to the plurality of businesses can be determined based on the pattern, which is convenient for tracing the source of the image outflow, so that the business tracing is realized.
In the case where the pattern to be decoded is a pattern of an object desired to be shared, after the pattern as in fig. 2(b) is acquired, it is disassembled and basic graphic attributes A, B, C, D and E are obtained and drawing parameters 60-10-13-105-06 of the graphic attributes are obtained. The conversion code is determined to be 001 based on the mapping relation, and then the user identification corresponding to the conversion code 001 is found in a pre-configured association table, so that the corresponding user identification can be determined based on the pattern, the follow-up source tracing of image outflow is facilitated, and the user tracing is achieved.
Corresponding to the above method embodiment, the present specification further provides an embodiment of a pattern decoding apparatus, and fig. 5 shows a schematic structural diagram of a pattern decoding apparatus provided in an embodiment of the present specification. As shown in fig. 5, the apparatus includes an obtaining module 502, a determining module 504, a converting module 506, and a searching module 508.
An obtaining module 502 is configured to obtain a pattern to be decoded.
A determining module 504, configured to disassemble the pattern to be decoded into a plurality of preset basic graphics and determine a graphics attribute corresponding to the basic graphics included in the pattern to be decoded and a drawing parameter of the graphics attribute.
A conversion module 506, configured to determine the graphics attribute and the rendering parameter of the graphics attribute as a conversion code.
The searching module 508 is configured to search, based on the conversion code, a corresponding association identifier in a pre-configured association table, where an association relationship between the association identifier and the conversion code is recorded in the association table.
The pattern decoding device according to the embodiment realizes that the associated identifier is obtained according to the graphic attribute of the pattern and the drawing parameter of the graphic attribute.
Further, in an optional embodiment, the graphic attributes corresponding to the basic graphics include attribute information of each basic graphic and a relative relationship between any two basic graphics, and the determining module 504 may be further configured to: and determining the attribute information of each basic graph and the relative relationship between any two basic graphs.
Fig. 6 illustrates a block diagram of a computing device 600 provided according to an embodiment of the present description. The components of the computing device 600 include, but are not limited to, a memory 610 and a processor 620. The processor 620 is coupled to the memory 610 via a bus 630 and a database 650 is used to store data.
Computing device 600 also includes access device 640, access device 640 enabling computing device 600 to communicate via one or more networks 660. Examples of such networks include the Public Switched Telephone Network (PSTN), a Local Area Network (LAN), a Wide Area Network (WAN), a Personal Area Network (PAN), or a combination of communication networks such as the internet. Access device 640 may include one or more of any type of network interface (e.g., a Network Interface Card (NIC)) whether wired or wireless, such as an IEEE802.11 Wireless Local Area Network (WLAN) wireless interface, a worldwide interoperability for microwave access (Wi-MAX) interface, an ethernet interface, a Universal Serial Bus (USB) interface, a cellular network interface, a bluetooth interface, a Near Field Communication (NFC) interface, and so forth.
In one embodiment of the present description, the above-described components of computing device 600, as well as other components not shown in FIG. 6, may also be connected to each other, such as by a bus. It should be understood that the block diagram of the computing device architecture shown in FIG. 6 is for purposes of example only and is not limiting as to the scope of the present description. Those skilled in the art may add or replace other components as desired.
Computing device 600 may be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (e.g., tablet, personal digital assistant, laptop, notebook, netbook, etc.), mobile phone (e.g., smartphone), wearable computing device (e.g., smartwatch, smartglasses, etc.), or other type of mobile device, or a stationary computing device such as a desktop computer or PC. Computing device 600 may also be a mobile or stationary server.
Wherein processor 620 is configured to execute the following computer-executable instructions:
acquiring a pattern to be coded;
the method comprises the steps of disassembling a pattern to be coded into a plurality of preset basic patterns, and determining pattern attributes corresponding to the basic patterns and first drawing parameters of the pattern attributes, wherein the pattern to be coded comprises the basic patterns;
adjusting the first drawing parameter of the graphic attribute to construct at least one second drawing parameter of the graphic attribute; and
the graphic attributes are mapped with each of the first rendering parameters and the at least one second rendering parameters, respectively, to generate a mapping table.
Processor 620 may also be used to execute the following computer-executable instructions:
acquiring a pattern to be decoded;
decomposing the pattern to be decoded into a plurality of preset basic patterns, and determining the pattern attribute corresponding to the basic patterns contained in the pattern to be decoded and the drawing parameters of the pattern attribute;
determining the graphic attribute and the drawing parameter of the graphic attribute as a conversion code;
based on the conversion code, searching a corresponding association identifier in a pre-configured association table, wherein the association table records the association relationship between the association identifier and the conversion code.
The above is an illustrative scheme of a computing device of the present embodiment. It should be noted that the technical solution of the computing device belongs to the same concept as the technical solution of the pattern encoding method and the pattern decoding method, and details that are not described in detail in the technical solution of the computing device can be referred to the description of the technical solution of the pattern encoding method and the pattern decoding method.
An embodiment of the present specification also provides a computer readable storage medium storing computer instructions which, when executed by a processor, are used for executing any step of the pattern encoding method of the embodiment of the present specification or any step of the pattern decoding method of the embodiment of the present specification.
The above is an illustrative scheme of a computer-readable storage medium of the present embodiment. It should be noted that the technical solution of the storage medium is the same concept as the technical solution of the pattern encoding method and the pattern decoding method, and details of the technical solution of the storage medium, which are not described in detail, can be referred to the description of the technical solution of the pattern encoding method and the pattern decoding method.
The foregoing description has been directed to specific embodiments of this disclosure. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims may be performed in a different order than in the embodiments and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing may also be possible or may be advantageous.
The computer instructions comprise computer program code which may be in the form of source code, object code, an executable file or some intermediate form, or the like. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, usb disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-Only Memory (ROM), Random Access Memory (RAM), electrical carrier wave signals, telecommunications signals, software distribution medium, and the like. It should be noted that the computer readable medium may contain content that is subject to appropriate increase or decrease as required by legislation and patent practice in jurisdictions, for example, in some jurisdictions, computer readable media does not include electrical carrier signals and telecommunications signals as is required by legislation and patent practice.
It should be noted that, for the sake of simplicity, the foregoing method embodiments are described as a series of acts or combinations, but those skilled in the art should understand that the present disclosure is not limited by the described order of acts, as some steps may be performed in other orders or simultaneously according to the present disclosure. Further, those skilled in the art should also appreciate that the embodiments described in this specification are preferred embodiments and that acts and modules referred to are not necessarily required for this description.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
The preferred embodiments of the present specification disclosed above are intended only to aid in the description of the specification. Alternative embodiments are not exhaustive and do not limit the invention to the precise embodiments described. Obviously, many modifications and variations are possible in light of the above teaching. The embodiments were chosen and described in order to best explain the principles of the specification and its practical application, to thereby enable others skilled in the art to best understand the specification and its practical application. The specification is limited only by the claims and their full scope and equivalents.

Claims (15)

1. A pattern encoding method, comprising:
acquiring a pattern to be coded;
the method comprises the steps of decomposing a pattern to be coded into a plurality of preset basic patterns, and determining a pattern attribute corresponding to a basic pattern contained in the pattern to be coded and a first drawing parameter of the pattern attribute, wherein the pattern attribute corresponding to the basic pattern comprises attribute information of each basic pattern and a relative relationship between any two basic patterns, and the first drawing parameter comprises numerical values corresponding to the attribute information of the basic pattern and the relative relationship between the basic patterns;
adjusting the first drawing parameter of the graphic attribute to construct at least one second drawing parameter of the graphic attribute; and
and mapping the graphic attribute with each of the first drawing parameter and the at least one second drawing parameter respectively to generate a mapping table.
2. The pattern encoding method of claim 1, further comprising:
and in response to receiving an association request, associating the identifier to be associated carried in the association request with a conversion code to form an association table, wherein the conversion code is determined by the graphic attribute in the mapping table and any drawing parameter of the graphic attribute.
3. The pattern encoding method as claimed in claim 1 or 2,
the pattern attributes corresponding to the basic patterns include attribute information of each basic pattern and a relative relationship between any two basic patterns, and determining the pattern attributes corresponding to the basic patterns included in the pattern to be encoded includes:
and determining the attribute information of each basic graph and the relative relationship between any two basic graphs.
4. The pattern encoding method as claimed in claim 1 or 2,
the step of adjusting the first rendering parameter of the graphic attribute to construct at least one second rendering parameter of the graphic attribute comprises:
and modifying the first drawing parameter of the graphic attribute within a preset range to form at least one second drawing parameter of the graphic attribute.
5. A pattern encoding apparatus comprising:
the acquisition module is used for acquiring a pattern to be coded;
the determining module is used for disassembling the pattern to be coded into a plurality of preset basic patterns and determining a pattern attribute corresponding to the basic patterns contained in the pattern to be coded and a first drawing parameter of the pattern attribute, wherein the pattern attribute corresponding to the basic patterns comprises attribute information of each basic pattern and a relative relationship between any two basic patterns, and the first drawing parameter comprises numerical values corresponding to the attribute information of the basic patterns and the relative relationship between the basic patterns;
the construction module is used for adjusting the first drawing parameters of the graphic attributes to construct at least one second drawing parameter of the graphic attributes; and
a mapping module, configured to map the graphic attribute with each of the first rendering parameter and the at least one second rendering parameter, respectively, so as to generate a mapping table.
6. The pattern encoding device of claim 5, further comprising:
and the association module is used for associating the identifier to be associated carried in the association request with a conversion code in response to receiving the association request to form an association table, wherein the conversion code is determined by the graphic attribute in the mapping table and any drawing parameter of the graphic attribute.
7. The pattern encoding device according to claim 5 or 6,
the corresponding graph attribute of the basic graph comprises attribute information of each basic graph and a relative relation between any two basic graphs, and the determining module is further used for:
and determining the attribute information of each basic graph and the relative relationship between any two basic graphs.
8. The pattern encoding device according to claim 5 or 6,
the construction module is further configured to:
and modifying the first drawing parameter of the graphic attribute within a preset range to form at least one second drawing parameter of the graphic attribute.
9. A pattern decoding method, comprising:
acquiring a pattern to be decoded;
the pattern to be decoded is disassembled into a plurality of preset basic patterns, and the pattern attributes corresponding to the basic patterns and the drawing parameters of the pattern attributes contained in the pattern to be decoded are determined, wherein the pattern attributes corresponding to the basic patterns comprise attribute information of each basic pattern and a relative relationship between any two basic patterns, and the drawing parameters comprise values corresponding to the attribute information of the basic patterns and the relative relationship between the basic patterns;
determining the graphic attribute and the drawing parameter of the graphic attribute as a conversion code;
based on the conversion code, searching a corresponding association identifier in a pre-configured association table, wherein the association table records the association relationship between the association identifier and the conversion code.
10. The pattern decoding method as claimed in claim 9,
the graphic attributes corresponding to the basic graphics comprise attribute information of each basic graphic and a relative relationship between any two basic graphics, and determining the graphic attributes corresponding to the basic graphics contained in the pattern to be decoded comprises:
and determining the attribute information of each basic graph and the relative relationship between any two basic graphs.
11. A pattern decoding apparatus comprising:
the acquisition module is used for acquiring a pattern to be decoded;
the determining module is used for decomposing the pattern to be decoded into a plurality of preset basic patterns and determining the pattern attributes corresponding to the basic patterns and the drawing parameters of the pattern attributes, wherein the pattern attributes corresponding to the basic patterns comprise attribute information of each basic pattern and a relative relationship between any two basic patterns, and the drawing parameters comprise values corresponding to the attribute information of the basic patterns and the relative relationship between the basic patterns;
the conversion module is used for determining the graphic attributes and the drawing parameters of the graphic attributes as conversion codes;
and the searching module is used for searching the corresponding association identifier in a pre-configured association table based on the conversion code, wherein the association relationship between the association identifier and the conversion code is recorded in the association table.
12. The pattern decoding apparatus of claim 11,
the corresponding graph attribute of the basic graph comprises attribute information of each basic graph and a relative relation between any two basic graphs, and the determining module is further used for:
and determining the attribute information of each basic graph and the relative relationship between any two basic graphs.
13. A computing device, comprising:
a memory and a processor;
the memory is to store computer-executable instructions, and the processor is to execute the computer-executable instructions to:
acquiring a pattern to be coded;
the method comprises the steps of decomposing a pattern to be coded into a plurality of preset basic patterns, and determining a pattern attribute corresponding to a basic pattern contained in the pattern to be coded and a first drawing parameter of the pattern attribute, wherein the pattern attribute corresponding to the basic pattern comprises attribute information of each basic pattern and a relative relationship between any two basic patterns, and the first drawing parameter comprises a numerical value corresponding to the relative relationship between the attribute information of the basic pattern and the basic pattern;
adjusting the first drawing parameter of the graphic attribute to construct at least one second drawing parameter of the graphic attribute; and
and mapping the graphic attribute with each of the first drawing parameter and the at least one second drawing parameter respectively to generate a mapping table.
14. A computing device, comprising:
a memory and a processor;
the memory is to store computer-executable instructions, and the processor is to execute the computer-executable instructions to:
acquiring a pattern to be decoded;
the pattern to be decoded is disassembled into a plurality of preset basic patterns, and the pattern attributes corresponding to the basic patterns and the drawing parameters of the pattern attributes contained in the pattern to be decoded are determined, wherein the pattern attributes corresponding to the basic patterns comprise attribute information of each basic pattern and a relative relationship between any two basic patterns, and the drawing parameters comprise values corresponding to the attribute information of the basic patterns and the relative relationship between the basic patterns;
determining the graphic attribute and the drawing parameter of the graphic attribute as a conversion code;
based on the conversion code, searching a corresponding association identifier in a pre-configured association table, wherein the association table records the association relationship between the association identifier and the conversion code.
15. A computer readable storage medium storing computer instructions which, when executed by a processor, carry out the steps of the pattern encoding method of any one of claims 1 to 4 or the steps of the pattern decoding method of any one of claims 9 to 10.
CN202010231956.8A 2020-03-27 2020-03-27 Pattern encoding method and device, pattern decoding method and device Active CN111246046B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010231956.8A CN111246046B (en) 2020-03-27 2020-03-27 Pattern encoding method and device, pattern decoding method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010231956.8A CN111246046B (en) 2020-03-27 2020-03-27 Pattern encoding method and device, pattern decoding method and device

Publications (2)

Publication Number Publication Date
CN111246046A CN111246046A (en) 2020-06-05
CN111246046B true CN111246046B (en) 2022-03-15

Family

ID=70877371

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010231956.8A Active CN111246046B (en) 2020-03-27 2020-03-27 Pattern encoding method and device, pattern decoding method and device

Country Status (1)

Country Link
CN (1) CN111246046B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113610937B (en) * 2021-07-13 2023-09-08 河北省地矿局第二地质大队 Universal path drawing data feature coding and decoding method, terminal and medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101105833A (en) * 2007-06-12 2008-01-16 李曙光 2D linear graphics coding anti-fake method
CN101677702A (en) * 2007-05-22 2010-03-24 美利肯公司 Use the automated randomized pattern of predefined design overlays to generate
CN103258314A (en) * 2005-09-16 2013-08-21 北京书生国际信息技术有限公司 Method for embedding and detecting cryptical code
CN106878725A (en) * 2010-10-08 2017-06-20 Ge视频压缩有限责任公司 Encoder and coding method and decoder and coding/decoding method
EP3459757A1 (en) * 2017-09-26 2019-03-27 Gemalto Sa Method for generating variable guilloche patterns, implementing device and identity document comprising such patterns

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7259765B2 (en) * 2003-04-04 2007-08-21 S3 Graphics Co., Ltd. Head/data scheduling in 3D graphics

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103258314A (en) * 2005-09-16 2013-08-21 北京书生国际信息技术有限公司 Method for embedding and detecting cryptical code
CN101677702A (en) * 2007-05-22 2010-03-24 美利肯公司 Use the automated randomized pattern of predefined design overlays to generate
CN101105833A (en) * 2007-06-12 2008-01-16 李曙光 2D linear graphics coding anti-fake method
CN106878725A (en) * 2010-10-08 2017-06-20 Ge视频压缩有限责任公司 Encoder and coding method and decoder and coding/decoding method
EP3459757A1 (en) * 2017-09-26 2019-03-27 Gemalto Sa Method for generating variable guilloche patterns, implementing device and identity document comprising such patterns

Also Published As

Publication number Publication date
CN111246046A (en) 2020-06-05

Similar Documents

Publication Publication Date Title
US10388042B2 (en) Efficient display of data points in a user interface
CN109949693B (en) Map drawing method and device, computing equipment and storage medium
CN109769141B (en) Video generation method and device, electronic equipment and storage medium
CN111950056B (en) BIM display method and related equipment for building informatization model
US11244153B2 (en) Method and apparatus for processing information
CN110570506A (en) Map resource management method and device, computing equipment and storage medium
CN111246046B (en) Pattern encoding method and device, pattern decoding method and device
CN110647372A (en) Position adjusting method and device of page display module
CN113778604A (en) Display method and device of operation interface, electronic equipment and storage medium
CN110363837B (en) Method and device for processing texture image in game, electronic equipment and storage medium
CN113516697A (en) Image registration method and device, electronic equipment and computer-readable storage medium
CN111049735B (en) Group head portrait display method, device, equipment and storage medium
US8687011B2 (en) Techniques for efficient sampling for image effects
CN115731319A (en) Graph drawing method, device, equipment and storage medium
CN114820988A (en) Three-dimensional modeling method, device, equipment and storage medium
US11048670B2 (en) Node layout determining method and apparatus, computing device, and computer readable medium
WO2021135325A1 (en) Method and apparatus for gis point data rendering, computer device, and storage medium
CN103294788A (en) Universal background processing method and system for websites
CN114419203A (en) File processing method and device
CN111127140A (en) Display method, device, client and storage medium
CN111080763A (en) Method and device for merging maps
Wu et al. Chain-based polyline tessellation algorithm for cartographic rendering
CN116977154B (en) Visible light image and infrared image fusion storage method, device, equipment and medium
CN113268279B (en) Data processing method and device
CN110990104B (en) Texture rendering method and device based on Unity3D

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant