A watermark template management method, device and storage medium
By setting watermark type level parameters and using transparent background substrate merging technology, the problems of low watermark addition efficiency and overlapping interference in existing technologies are solved, achieving efficient and automated watermark management.
Patent Information
- Application Number
- CN202210658696.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-12
- Publication Date
- 2025-11-07
- Estimated Expiration
- 2042-06-12
AI Technical Summary
Existing watermarking software cannot efficiently add multiple different types of watermarks to a document at the same time, making the operation time-consuming and laborious, and it cannot automatically avoid watermark overlap interference.
By setting the watermark type level parameters, lower priority watermark blocks are adjusted first to ensure that high priority watermarks remain unchanged. The watermark blocks are then merged and adjusted using a transparent background substrate, thus achieving hierarchical adjustment of watermarks and automatic avoidance of overlap.
It improves the efficiency of watermark addition, reduces manual intervention, automates the handling of watermark overlap issues, and ensures that watermarks do not interfere with each other.
Smart Images

Figure CN114943066B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of medical information, in particular to a watermark template management method, device and storage medium. BACKGROUND
[0002] At present, there are a large number of documents when the research and development institutions of pharmaceutical enterprises prepare and organize drug declaration materials. In order to prevent illegal spread of documents, different watermarks need to be added to these documents in different declaration states and different business scenarios. At the same time, in order to present various information on these documents, sometimes it is necessary to add multiple different types of watermarks on the same document page, such as text watermarks for presenting text information, picture watermarks for presenting some logo information, and two-dimensional code / bar code watermarks for readers to obtain relevant information by scanning the code with a mobile phone. However, the current watermark software can only add various different types of watermarks to the document one after another, and each type of watermark adding step is independent. After an operator adds a type of watermark to the document, the operator manually adds another type of watermark. At the same time, the watermark added later can only be checked through the preview function to see whether it interferes with the watermark added earlier. If there is interference, the parameters and variables of the first watermark type need to be manually adjusted again, and then the preview operation is performed again until the watermarks do not interfere with each other. The operation process is time-consuming and laborious, which seriously affects the efficiency of document watermark adding. SUMMARY
[0003] The present application provides a watermark template management method, which comprises the following steps:
[0004] S1, generating a first watermark block containing a first type of watermark and a second watermark block containing a second type of watermark according to different watermark parameters;
[0005] S2, obtaining the level parameters set by the first watermark type and the second watermark type, preferentially arranging the second watermark type with higher priority, and calculating the second region of the second watermark block arranged on the watermark template according to the page distribution parameters and arrangement rule parameters of the second watermark type;
[0006] S3, obtaining the page distribution parameters and arrangement rule parameters of the first watermark type with lower priority, calculating the first initial region of the first watermark block arranged on the watermark template, adjusting part of the variable parameters in the first watermark type to form a first watermark adjustment block if the first initial region overlaps with the second region, and adding the first watermark adjustment block and the second watermark block to the same substrate with a transparent background to form a watermark template after the overlapping region of the first watermark adjustment block and the second watermark block meets the overlapping rule.
[0007] Preferably, the step S3 specifically comprises:
[0008] S31, acquiring the page distribution parameter and the arrangement rule parameter of the first watermark type with lower priority, generating at least one first watermark block and calculating the position parameter of the first initial area arranged on the watermark template;
[0009] S32, if the first initial area overlaps with the second area, acquiring the first variable with adjustable attribute in the first watermark type, and adjusting the first watermark block according to the attribute of the first variable to form the first watermark adjustment block;
[0010] S33, acquiring the overlapping area of the first watermark adjustment block and the second watermark block, calculating whether the overlapping area meets the preset overlapping rule, if yes, adding the first watermark adjustment block and the second watermark block to the watermark template formed on the same substrate with transparent background, if not, returning to the step S32 to adjust the first watermark adjustment block again until the overlapping area meets the preset overlapping rule.
[0011] Preferably, the first variable includes but is not limited to one or more of the watermark position parameter, the watermark angle parameter, the watermark size parameter, the number of watermark blocks, the watermark concentration parameter or the watermark layout parameter.
[0012] Preferably, the step S32 further comprises:
[0013] S321, if the first initial area overlaps with the second area, acquiring multiple first variables with adjustable attribute in the first watermark type;
[0014] S322, comparing the changeable levels of the multiple first variables, acquiring the parameter attribute of the first variable with the highest changeable level, and performing the corresponding change operation on the first watermark block according to the parameter attribute to form the first watermark adjustment block.
[0015] Preferably, the step S322 further comprises: acquiring the parameter attribute of the watermark angle parameter, if the first watermark type is a text watermark, acquiring the minimum watermark area of the text watermark, and obtaining the first watermark adjustment block by rotating the minimum watermark area by a preset angle, wherein the first watermark adjustment block comprises the position information of the minimum watermark area.
[0016] The application further discloses a watermark template management system, comprising: a block generation module, configured to generate a first watermark block containing a first type of watermark and a second watermark block containing a second type of watermark according to different watermark parameters; a watermark arrangement module, configured to acquire grade parameters of the first watermark type and the second watermark type, arrange the second watermark type with higher priority preferentially, and calculate a second area on a watermark template where the second watermark block is arranged according to page distribution parameters and arrangement rule parameters of the second watermark type; and a watermark adjustment module, configured to acquire page distribution parameters and arrangement rule parameters of the first watermark type with lower priority, calculate a first initial area on the watermark template where the first watermark block is arranged, adjust part of variable parameters in the first watermark type to form a first watermark adjustment block if the first initial area overlaps with the second area, and add the first watermark adjustment block and the second watermark block to a same watermark template formed by a substrate with a transparent background after the overlapping area of the first watermark adjustment block and the second watermark block meets overlapping rules.
[0017] Preferably, the watermark adjustment module further comprises: a secondary watermark module, configured to acquire page distribution parameters and arrangement rule parameters of the first watermark type with lower priority, generate at least one first watermark block and calculate position parameters of a first initial area on the watermark template where the first watermark block is arranged; a variable screening module, configured to acquire a first variable with adjustable attributes in the first watermark type when the first initial area overlaps with the second area, and adjust the first watermark block according to the attributes of the first variable to form a first watermark adjustment block; and a watermark template acquisition module, configured to acquire an overlapping area of the first watermark adjustment block and the second watermark block, calculate whether the overlapping area meets preset overlapping rules, and add the first watermark adjustment block and the second watermark block to the same watermark template formed by the substrate with the transparent background after the overlapping area meets the preset overlapping rules.
[0018] Preferably, the first variable comprises but is not limited to one or more of a watermark position parameter, a watermark angle parameter, a watermark size parameter, a number of watermark blocks, a watermark concentration parameter or a watermark layout parameter.
[0019] The application further discloses a watermark template management device, comprising a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements steps of any of the above methods when executing the computer program.
[0020] The application further discloses a computer readable storage medium, wherein the computer readable storage medium stores a computer program, and the computer program implements steps of any of the above methods when executed by a processor.
[0021] The watermark template management method, device and storage medium disclosed by the application add a level parameter in each watermark type, and the priority of each watermark can be set in advance, for example, the priority of the first watermark type is set to be low and the priority of the second watermark type is set to be high, when the watermark regions of the two types of watermarks overlap and need to be adjusted, the watermark with the higher priority is kept unchanged, and the watermark region with the lower priority is adjusted first, if there are multiple different types of watermarks, the watermark region with the highest priority is kept unchanged, and the other watermark regions are adjusted according to the priority from low to high. By setting the priority of each watermark type, the hierarchical adjustment of the combined watermark is realized, and each type of watermark can be adjusted according to the importance of each type of watermark to avoid mutual influence. The additional aspects and advantages of the application will be partially given in the following description, partially become obvious from the following description, or be understood through the practice of the application. BRIEF DESCRIPTION OF DRAWINGS
[0022] The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiments of the application and serve to explain the principles of the application, and do not limit the application. In the drawings:
[0023] Figure 1 The flowchart of the watermark template management method disclosed by an embodiment.
[0024] Figure 2 The specific flowchart of step S3 disclosed by an embodiment.
[0025] Figure 3 The specific flowchart of step S32 disclosed by an embodiment.
[0026] Figure 4 The specific flowchart of step S4 disclosed by an embodiment. DETAILED DESCRIPTION
[0027] To make the purpose, technical scheme and advantages of the embodiments of the application clearer, the technical scheme of the embodiments of the application will be described clearly and completely below with reference to the drawings of the embodiments of the application. Obviously, the described embodiments are part of the embodiments of the application, rather than all the embodiments of the application. Based on the described embodiments of the application, all other embodiments obtained by those skilled in the art without creative labor fall within the scope of protection of the application.
[0028] In the present application, unless otherwise explicitly specified and limited, the technical terms or scientific terms used herein shall be understood as the usual meanings understood by those skilled in the art to which the present application belongs. The terms "first", "second", and similar words used in the patent application description and claims of the present application do not represent any order, quantity or importance, but are only used to distinguish different components. Similarly, "one" or "a" and similar words do not represent a quantity limitation, but represent the existence of at least one.
[0029] As shown in the accompanying Figure 1 The embodiment discloses a watermark template management method, which can specifically include the following steps:
[0030] Step S1, according to different watermark parameters, respectively generate a first watermark block containing a first type of watermark and a second watermark block containing a second type of watermark.
[0031] In the specific setting of the embodiment, different watermark attributes can be defined according to the watermark type. The watermark type can include a first watermark type, a second watermark type and a third watermark type, wherein the first watermark type can be a text watermark, the second watermark type can be a picture watermark, and the third watermark type can be a two-dimensional code / bar code watermark.
[0032] The attributes of the first watermark type, i.e. the text watermark, can include but are not limited to the following contents. Watermark content: The watermark content can be manually entered to fix the watermark content, and a constant label can be clicked to add a constant field. A custom variable field can also be clicked. Therefore, the text watermark content can be a combination of fixed content, constants and variables. Font size: used to set the font size of the watermark text, in pixels (px). Watermark font: the watermark font is used to define the watermark text style, which can be "Songti" by default. Text color: the watermark color mainly defines the watermark text color, which can be black by default. Date format: the watermark format is mainly used for some watermarks that need to contain time information, but different watermarks have different requirements for the format of the date, so the definition of the date format is provided.
[0033] The attributes of the second watermark type, i.e. the picture watermark, can include but are not limited to the following contents. Upload watermark picture: upload a picture document to customize the watermark picture to be added to the picture type watermark. Picture height: according to the actual height of the uploaded picture and the set picture height, calculate the scaling ratio of the uploaded picture.
[0034] The attributes of the third watermark type, i.e. the two-dimensional code / bar code watermark, are similar to those of the picture watermark, except that it is not a fixed picture, but needs to be dynamically generated according to the user's custom information when used.
[0035] The watermark block refers to a file element containing corresponding watermark content. The file element can be a png picture with a transparent background containing corresponding watermark content such as text, pictures or a two-dimensional code, or a file in other formats. The file element can be added to the base plate to form a watermark template. The first watermark block is configured to generate a watermark picture containing input text according to input parameters of the first type of watermark. The second watermark block is configured to generate a watermark picture containing a bar code or a two-dimensional code according to input parameters of the second type of watermark.
[0036] In step S2, the level parameters of the first watermark type and the second watermark type are obtained, the second watermark type with higher priority is arranged preferentially, and the second area on the watermark template where the second watermark block is arranged is calculated according to the page distribution parameters and the arrangement rule parameters of the second watermark type. The second area is the area where the second watermark block is arranged on the watermark template.
[0037] In step S3, the page distribution parameters and the arrangement rule parameters of the first watermark type with lower priority are obtained, the first initial area on the watermark template where the first watermark block is arranged is calculated, and if the first initial area overlaps the second area, part of the variable parameters in the first watermark type are adjusted to form a first watermark adjustment block. After the overlapping area of the first watermark adjustment block and the second watermark block meets the overlapping rule, the first watermark adjustment block and the second watermark block are added to the same watermark template formed by the base plate with a transparent background. The overlapping rule can be the ratio of the overlapping area to the corresponding second area, or the depth of the overlapping area into the second area, which can be set according to specific conditions. The first initial area is the area where the first watermark block is arranged on the watermark template according to the original page distribution parameters and the arrangement rule parameters of the first watermark type. The overlapping area is the area where the first watermark adjustment block is arranged on the watermark template and overlaps with the second area.
[0038] In an embodiment, meeting the overlapping rule can mean that if the overlapping coefficient is lower than a preset value, the first initial area position is not adjusted, otherwise the first initial area is moved in the direction of reducing overlap to separate from the overlap or the overlapping coefficient is lower than the preset value. The overlapping coefficient is the proportion of the overlapping part of the first initial area and the second area in the area of the second area.
[0039] Specifically, according to the page distribution parameter and the arrangement rule parameter of the second type of watermark, the arrangement position, the arrangement number and the arrangement rule of the two-dimensional code watermark on the substrate are calculated. For example, the page distribution parameter can be a 1*2 layout, i.e. two two-dimensional codes are arranged on each page, and the arrangement rule parameter can be that the arrangement is only performed in the page area or the footer area or the arrangement is performed throughout the page including the text area. Meanwhile, the second area position occupied by the two generated second watermark blocks on the substrate can be finally confirmed according to the size parameter and the position parameter of the second type of watermark. Then, the first initial area position occupied by the first watermark block generated by the first type of watermark on the substrate is obtained according to the same manner. Then, it is judged whether the first initial area and the second area overlap. If the two-dimensional code in the two-dimensional code watermark overlaps the text in the text watermark, the text watermark can cover part of the two-dimensional code pattern, so that the identification of the two-dimensional code watermark is difficult. Therefore, when the combined watermark is generated, it is necessary to judge in advance whether the two-dimensional code watermark overlaps other watermarks. In this embodiment, whether the first watermark block needs to be adjusted can also be determined by judging the overlap coefficient of the overlapping area of the first initial area and the second area. The overlap coefficient can be the ratio of the overlapping area to the corresponding second area, or the depth of the overlapping area into the second area, which can be set according to the specific situation. If the overlap coefficient is lower than the preset value, the first initial area position is not adjusted, otherwise the first initial area is moved in the direction of reducing overlap to separate from the overlap. If there is no overlap, the corresponding first watermark block and second watermark block are added to the first initial area and the second area on the substrate
[0040] In this embodiment, a level parameter is added to each type of watermark, and the priority of the adjustment of each watermark can be set in advance. For example, the current watermark template has a first type of watermark and a second type of watermark, and if the priority of the first type of watermark is lower and the priority of the second type of watermark is higher, when the watermark areas of them overlap and need to be adjusted, the watermark with higher priority can be kept unchanged, and the watermark block with lower priority is adjusted first. If there are multiple watermarks of different types, the watermark block with the highest priority is kept unchanged, and the other watermark blocks are adjusted in order from low to high according to the priority. By setting the priority of each type of watermark, the hierarchical adjustment of the combined watermark is realized, and each type of watermark can be adjusted according to the importance of each type of watermark to avoid mutual influence.
[0041] As shown in FIG. 3, step S3 can further include the following contents. Figure 2
[0042] In step S31, the page distribution parameter and the arrangement rule parameter of the first type of watermark with lower priority are obtained, at least one first watermark block is generated, and the position parameter of the corresponding first initial area arranged on the watermark template is calculated.
[0043] Step S32, if the first initial region overlaps with the second region, a first variable with adjustable attribute in the first watermark type is obtained, and the first watermark block is adjusted according to the attribute of the first variable to form a first watermark adjusted block. The first variable can include but is not limited to one or more of a watermark position parameter, a watermark angle parameter, a watermark size parameter, a watermark block quantity, a watermark density parameter, or a watermark layout parameter.
[0044] As shown in the accompanying drawings, Figure 3 Step S32 can further include the following contents.
[0045] Step S321, if the first initial region overlaps with the second region, a plurality of first variables with adjustable attributes in the first watermark type are obtained.
[0046] Step S322, the changeable levels of the plurality of first variables are compared, the parameter attribute of the first variable with the highest changeable level is obtained, and the first watermark block is changed according to the parameter attribute to form a first watermark adjusted block.
[0047] For example, the first variable is a watermark angle parameter, a watermark position parameter, a watermark quantity parameter, or a watermark size parameter, etc. If the changeable level of the watermark angle parameter is the highest, the watermark angle parameter of the first watermark block is adjusted first when the first initial region overlaps with the second region. Specifically, the parameter attribute of the watermark angle parameter is obtained, if the first watermark type is a text watermark, the smallest watermark region of the text watermark is obtained, the first watermark adjusted block is obtained by rotating the smallest watermark region by a preset angle, and the first watermark adjusted block includes the position information of the smallest watermark region. It is judged whether the overlapping region of the first watermark adjusted block and the second watermark block meets the preset overlapping rule, if the preset overlapping rule is met, the first watermark adjusted block and the second watermark block are added to the watermark template formed in the same substrate with a transparent background, otherwise the watermark angle parameter is adjusted again until the preset overlapping rule is met.
[0048] If the changeable level of the watermark position parameter is the highest or higher, the watermark position parameter of the first watermark block is adjusted first when the first initial region overlaps with the second region. Specifically, the original parameter of the watermark position parameter is obtained, the first watermark adjusted block is obtained by adjusting the watermark position parameter by a set adjustment distance interval, it is judged whether the overlapping region of the first watermark adjusted block and the second watermark block meets the preset overlapping rule, if the preset overlapping rule is met, the first watermark adjusted block and the second watermark block are added to the watermark template formed in the same substrate with a transparent background, otherwise the watermark position parameter is adjusted again by the distance interval until the preset overlapping rule is met.
[0049] If the changeable level of the watermark size parameter is the highest or higher, the watermark of the first watermark block is given priority when the first initial region overlaps the second region. The parameter is adjusted. Specifically, the original parameter of the watermark position parameter is obtained, and the watermark position parameter is first reduced by a set reduction ratio to obtain a first watermark adjustment block. It is determined whether the overlapping region of the first watermark adjustment block and the second watermark block meets the preset overlapping rule. If the preset overlapping rule is met, the first watermark adjustment block and the second watermark block are added to the watermark template formed in the same substrate with a transparent background. Otherwise, the watermark position parameter is adjusted again by a proportional reduction, until the preset overlapping rule is met.
[0050] In step S33, the overlapping region of the first watermark adjustment block and the second watermark block is obtained, and it is determined whether the overlapping region meets the preset overlapping rule. If the preset overlapping rule is met, the first watermark adjustment block and the second watermark block are added to the watermark template formed in the same substrate with a transparent background. If the preset overlapping rule is not met, the first watermark adjustment block is adjusted again in step S32 until the overlapping region meets the preset overlapping rule.
[0051] In this embodiment, the changeable level of the parameter with adjustable attributes in each watermark type is increased, and the priority of the adjustment operation of each watermark can be set in advance. For example, the first watermark type needs to be adjusted in the current watermark template, and the variable with the highest changeable level can be obtained and modified. If the variable with the highest changeable level cannot meet the overlapping requirement of the two watermark blocks after adjustment, the variable with the second highest changeable level can be modified. By setting the changeable level of each adjustable variable in the watermark type, different adjustment actions of a certain watermark type in the combined watermark are realized, and the watermark adjustment action can be more reasonably customized to combine and adjust the watermark to avoid mutual influence.
[0052] In a specific embodiment, the watermark picture is generated according to the attribute information of each watermark configuration under the configured watermark template. The system obtains the configuration information of all watermarks under the template according to the selected / configured template, and loops through each watermark configuration information. If it is a text watermark or a two-dimensional code / barcode watermark, the system will analyze the final watermark content according to the watermark content and user-entered variables, global variables, and fixed content. The two-dimensional code / barcode will draw a picture according to the watermark content to generate a barcode / two-dimensional code picture, and change the barcode / two-dimensional code watermark type to a picture watermark type. Then, the watermark picture is generated according to the watermark configuration.
[0053] In another specific embodiment, the watermark template management method further includes the following steps:
[0054] Step S4, obtaining the page size of the target document, adjusting the size of the watermark template to a preset multiple of the target document page, and proportionally enlarging the first watermark block and the second watermark block in the watermark template by the same multiple.
[0055] In the present embodiment, as shown in the accompanying drawings, this step further comprises: Figure 4
[0056] Step S41, identifying each page of the target document to which the watermark is to be added to obtain the area where the text content in each page is located; marking each page of the target document as a plurality of page types according to the layout of the text content in each page, and identifying the largest text area in the first page type as the main text page. The largest text area is a rectangular area where the main text is located.
[0057] At the same time, the pages in the target document that have the same largest text area can be marked as the first page type, and the other pages can be marked as the second page type. The largest text area is a rectangular area. In the document, the pages with the largest text area are often main text pages, so these main text pages are marked as the first page type, and the other pages are marked as the second page type. These second page types can be table of contents pages, index pages, content separation pages, and other pages.
[0058] Step S42, determining whether there is at least one second watermark block in the initial watermark template, and if there is, calculating a second area on the initial watermark template where the second watermark block is arranged according to the page distribution parameters and the arrangement rule parameters of the second watermark type; the second watermark block is configured to generate a watermark picture containing a bar code or a two-dimensional code according to the input parameters of the second type of watermark. If there is only a first watermark block in the initial watermark template, a first area on the initial watermark template where the first watermark block is arranged is generated according to the page distribution parameters and the arrangement rule of the first watermark type, and the initial watermark template is added to each target page marked as the first page type.
[0059] Step S43, if the second area overlaps the largest text area or the overlapping area does not meet the set overlapping rule, adjusting part of the variable parameters in the second watermark type to form a second watermark adjustment block, replacing the second watermark block with the second watermark adjustment block in the initial watermark template to form a first watermark template corresponding to the first page type, and adding the first watermark template to each target page marked as the first page type. Adding the second watermark block to the initial watermark template forms a second watermark template corresponding to the second page type, and adding the second watermark template to each target page marked as the second page type.
[0060] In the embodiment, the step S43 can further include the following: if the second region overlaps with the largest text region or the overlapping region does not meet the set overlapping rule, determining whether the number of rows in the watermark layout parameter in the second watermark type is greater than 2, and if the number of rows is greater than 2, modifying the number of rows in the layout parameter to 2. The watermark position parameter in the second watermark type is modified, and the two second watermark blocks located above and below are respectively modified to move the corresponding second regions upward and downward to form two second watermark adjustment blocks. The second regions corresponding to the second watermark adjustment blocks do not overlap with the largest text region or the overlapping region meets the set overlapping rule. The second watermark blocks are replaced by the second watermark adjustment blocks in the initial watermark template to form a first watermark template corresponding to the first page type, and the first watermark template is added to each target page marked as the first page type. Specifically, the region where the generated two-dimensional code watermark of the second watermark type is located is on the page body, which will cause the two-dimensional code pattern to overlap with the text, so that the text destroys the two-dimensional code pattern and may cause the recognition efficiency of the two-dimensional code to decrease. Therefore, the position of the two-dimensional code watermark needs to be adjusted, and the position can be moved upward or downward to the header or footer area of the page, so as to avoid the interference of the text content on the two-dimensional code watermark.
[0061] In the embodiment, the watermark template is selected / configured. Different watermark templates used in different positions can be configured according to different business needs, and the corresponding watermark template is brought out for use according to the configuration binding information when used. Some can bring out all the watermark templates with permission and select the watermark template to be used. Different positions refer to different function points in the system, and the bound watermark template is obtained according to a certain rule (configuration binding information) of the business system. This is a flexible use mode of the use scenario. The to-be-processed document file is converted into a pdf, and in some embodiments, the word can also be converted into a pdf by relying on jaclob. The template watermark is added to the pdf by itextpdf, and a new document is finally generated.
[0062] The watermark template management method disclosed in the above embodiment can set the priority of the adjustment of each watermark in advance by adding a level parameter to each watermark type. For example, if the priority of the first watermark type is set to be lower and the priority of the second watermark type is set to be higher, when the watermark regions of the two types overlap and need to be adjusted, the watermark with the higher priority can be kept unchanged and the watermark region with the lower priority can be adjusted first. If there are multiple watermarks of different types, the watermark region with the highest priority can be kept unchanged and the other watermark regions can be adjusted in order from low to high priority. The hierarchical adjustment of the combined watermark can be realized by setting the priority of each watermark type, and the adjustment of each type of watermark can be more reasonable according to the importance of each type of watermark to avoid mutual influence. In addition, the variable parameters with adjustable attributes in each watermark type can be assigned a changeable level, and the priority of the adjustment operation variable of each watermark can be set in advance. For example, if the first watermark type needs to be adjusted in the current watermark template, the variable parameter with the highest changeable level of the first watermark type can be obtained and modified. If the variable parameter with the highest changeable level cannot satisfy the overlapping requirement of the two watermark regions after adjustment, the variable parameter with the second highest changeable level can be modified. By setting the changeable level of each adjustable variable in the watermark type, the different adjustment actions of a certain type of watermark in the combined watermark can be realized, and the watermark adjustment action can be more reasonably customized to avoid mutual influence.
[0063] In another embodiment, a watermark template management system is also disclosed, which includes: a block generation module configured to generate a first watermark block containing a first type of watermark and a second watermark block containing a second type of watermark according to different watermark parameters. A watermark arrangement module configured to obtain the level parameters set for the first watermark type and the second watermark type, arrange the second watermark type with higher priority first, and calculate a second region on the watermark template for the arrangement of the second watermark block according to the page distribution parameters and arrangement rule parameters of the second watermark type. A watermark adjustment module configured to obtain the page distribution parameters and arrangement rule parameters of the first watermark type with lower priority, calculate a first initial region on the watermark template for the arrangement of the first watermark block, adjust part of the variable parameters in the first watermark type to form a first watermark adjustment block if the first initial region overlaps with the second region, and add the first watermark adjustment block and the second watermark block to the same watermark template formed on a substrate with a transparent background after the overlapping region of the first watermark adjustment block and the second watermark block meets the overlapping rule.
[0064] In the embodiment, the watermark adjustment module further comprises: a secondary watermark module, configured to acquire the page distribution parameter and the arrangement rule parameter of the first watermark type with a lower priority, generate at least one first watermark block, and calculate the position parameter of the first initial area arranged on the watermark template. A variable screening module, configured to acquire a first variable with an adjustable attribute in the first watermark type when the first initial area overlaps with the second area, and adjust the first watermark block according to the attribute of the first variable to form a first watermark adjustment block. A watermark template acquisition module, configured to acquire the overlapping area of the first watermark adjustment block and the second watermark block, calculate whether the overlapping area meets the preset overlapping rule, and add the first watermark adjustment block and the second watermark block to the watermark template formed on the same substrate with a transparent background after the preset overlapping rule is met.
[0065] In the embodiment, the first variable includes but is not limited to one or more of a watermark position parameter, a watermark angle parameter, a watermark size parameter, a watermark block quantity, a watermark concentration parameter, or a watermark layout parameter.
[0066] The specific functions of the watermark template management system described above correspond to the watermark template management method disclosed in the foregoing embodiments one by one, and therefore will not be described in detail here. For details, reference can be made to the foregoing disclosed watermark template management method embodiments. It should be noted that the embodiments in the specification are described in a progressive manner, and each embodiment mainly describes the differences from other embodiments. The same or similar parts between the embodiments can be mutually referred to.
[0067] In some other embodiments, a watermark template management apparatus is also provided, which comprises a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor implements each step of the watermark template management method described in the foregoing embodiments when executing the computer program.
[0068] The watermark template management apparatus can include but is not limited to a processor and a memory. The server can include but is not limited to a processor and a memory. Those skilled in the art can understand that the schematic diagram is only an example of the server and does not limit the server device, which can include more or fewer components than the diagram, or combine certain components or different components, for example, the server device can also include an input / output device, a network access device, a bus, etc.
[0069] The processor can be a central processing unit (CPU), and can also be other general-purpose processors, a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor logic, discrete hardware components, etc. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor or the like, which is a control center of the server device and connects various parts of the server device through various interfaces and lines.
[0070] The memory can be used to store the computer programs and / or modules, and the processor realizes various functions of the server device by running or executing the computer programs and / or modules stored in the memory, and calling the data stored in the memory. The memory can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, at least one application program required for a function, etc. In addition, the memory can include a high-speed random access memory, and can also include a nonvolatile memory, such as a hard disk, a memory, a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, at least one disk storage device, a flash memory device, or other volatile solid-state memory device.
[0071] If the watermark template management method is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the above-mentioned embodiment methods can also be completed by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of each method embodiment when executed by a processor. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or some intermediate forms, etc. The computer-readable medium can include any entity or device that can carry the computer program code, recording medium, U disk, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signal, telecommunication signal, and software distribution medium, etc. It should be noted that the content included in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, the computer-readable medium does not include electrical carrier signals and telecommunication signals.
[0072] Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present application, and not to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions recorded in the foregoing embodiments, or make equivalent replacements for some technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the scope of the technical solutions of the embodiments of the present application.
[0073] In summary, the above is only a preferred embodiment of the present application, and any equivalent changes and modifications made within the scope of the patent application of the present application shall be included in the scope of the present application.
Claims
1. A watermark template management method characterized by, The method comprises the following steps: S1, generating a first watermark block containing a first type of watermark and a second watermark block containing a second type of watermark according to different watermark parameters respectively; S2, obtaining the level parameters of the first watermark type and the second watermark type, preferentially arranging the second watermark type with higher priority, and calculating a second area on the watermark template according to the page distribution parameters and arrangement rule parameters of the second watermark type; S3, obtaining the page distribution parameters and arrangement rule parameters of the first watermark type with lower priority, calculating a first initial area on the watermark template, if the first initial area and the second area overlap, adjusting part of the variable parameters in the first watermark type to form a first watermark adjustment block, and adding the first watermark adjustment block and the second watermark block to the same watermark template formed in the substrate with a transparent background after the overlapping area of the first watermark adjustment block and the second watermark block meets the overlapping rule; The S3 specifically comprises: S31, obtaining the page distribution parameters and arrangement rule parameters of the first watermark type with lower priority, generating at least one first watermark block and calculating the position parameters of the corresponding first initial area on the watermark template; S32, if the first initial area and the second area overlap, obtaining a first variable with adjustable attributes in the first watermark type, and adjusting the first watermark block according to the attributes of the first variable to form a first watermark adjustment block; S33, obtaining the overlapping area of the first watermark adjustment block and the second watermark block, calculating whether the overlapping area meets the preset overlapping rule, if yes, adding the first watermark adjustment block and the second watermark block to the same watermark template formed in the substrate with a transparent background, if not, returning to step S32 for re-adjustment of the first watermark adjustment block until the overlapping area meets the preset overlapping rule.
2. The watermark template management method of claim 1, wherein: The first variable comprises one or more of a watermark position parameter, a watermark angle parameter, a watermark size parameter, a watermark block quantity, a watermark density parameter or a watermark layout parameter.
3. The watermark template management method of claim 2, wherein, The S32 further comprises: S321, if the first initial area and the second area overlap, obtaining a plurality of first variables with adjustable attributes in the first watermark type; S322, comparing the changeable levels of the plurality of first variables, obtaining the parameter attributes of the first variable with the highest changeable level, and performing corresponding change operations on the first watermark block according to the parameter attributes to form a first watermark adjustment block.
4. The watermark template management method of claim 3, wherein, The S322 further comprises: obtaining the parameter attributes of the watermark angle parameter, if the first watermark type is a text watermark, obtaining the smallest watermark area of the text watermark, rotating the smallest watermark area by a preset angle to obtain a first watermark adjustment block, and the first watermark adjustment block comprises position information of the smallest watermark area.
5. A watermark template management system characterized by, Comprise: A block generation module for generating a first watermark block containing a first type of watermark and a second watermark block containing a second type of watermark according to different watermark parameters respectively; The watermark arrangement module is configured to obtain the level parameters set by the first watermark type and the second watermark type, arrange the second watermark type with higher priority preferentially, and calculate a second region on a watermark template for the second watermark block according to the page distribution parameters and the arrangement rule parameters of the second watermark type. The watermark adjustment module is configured to obtain the page distribution parameters and the arrangement rule parameters of the first watermark type with lower priority, calculate a first initial region on the watermark template for the first watermark block, adjust part of variable parameters in the first watermark type to form a first watermark adjustment block if the first initial region overlaps with the second region, and add the first watermark adjustment block and the second watermark block to the same watermark template formed by a substrate with a transparent background after the overlapping region of the first watermark adjustment block and the second watermark block meets the overlapping rule. The watermark adjustment module further comprises: The secondary watermark module is configured to obtain the page distribution parameters and the arrangement rule parameters of the first watermark type with lower priority, generate at least one first watermark block, and calculate the position parameters of the first initial region on the watermark template. The variable screening module is configured to obtain the first variable with adjustable attributes in the first watermark type when the first initial region overlaps with the second region, and adjust the first watermark block according to the attributes of the first variable to form the first watermark adjustment block. The watermark template obtaining module is configured to obtain the overlapping region of the first watermark adjustment block and the second watermark block, calculate whether the overlapping region meets the preset overlapping rule, add the first watermark adjustment block and the second watermark block to the same watermark template formed by the substrate with the transparent background after the overlapping region meets the preset overlapping rule, and return to the variable screening module to adjust the first watermark adjustment block again until the overlapping region meets the preset overlapping rule if the overlapping region does not meet the preset overlapping rule.
6. The watermark template management system of claim 5, wherein: The first variable comprises one or more of a watermark position parameter, a watermark angle parameter, a watermark size parameter, a watermark block quantity, a watermark density parameter, or a watermark layout parameter.
7. A watermark template management apparatus comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: The processor executes the computer program to implement the steps of the method of any one of claims 1-4.
8. A computer-readable storage medium, the computer-readable storage medium storing a computer program, characterized in that: The computer program is executed by the processor to implement the steps of the method of any one of claims 1-4.
Citation Information
Patent Citations
Video image processing method, computer device and computer readable storage medium
CN108668161A