Watermark generation method and device based on image semantics, equipment and medium
By using an image semantic-based watermark generation method, the composition, display method, and color of the watermark are dynamically adjusted, which solves the problems of traditional watermarks obscuring information in complex scenes and appearing abrupt in simple scenes, and achieves a high degree of integration between the watermark and the image and a good anti-counterfeiting effect.
Patent Information
- Application Number
- CN202511103385.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-07
- Publication Date
- 2025-11-18
AI Technical Summary
In existing technologies, image watermarking methods are prone to obscuring key visual information or appearing abrupt in simple scenes when faced with complex image content. They lack adaptability and affect the anti-counterfeiting effect and visual experience.
Image semantic watermarking generation method dynamically adjusts the composition, display method and color of watermark by acquiring object information, scene information and color information of target image, so as to ensure the watermark blends with the image, avoid occluding key information and improve visual harmony.
It achieves the concealment and anti-counterfeiting effect of watermarks in complex scenarios, enhances the visual experience and anti-counterfeiting capabilities of images, and adapts to the diverse needs of different image content.
Smart Images

Figure CN120976003A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of artificial intelligence technology, and more specifically to a method, apparatus, device, and medium for generating watermarks based on image semantics. Background Technology
[0002] In the process of generating watermarks for images, fixed thresholds or preset rules are typically used to determine the watermark's position (e.g., always placed in the four corners of the image), form (e.g., a single text or pattern), and transparency. This static embedding mechanism can maintain basic anti-counterfeiting functions in simple scenarios, but it exposes significant defects when faced with complex image content. For example, when an image contains dense main objects or specific semantic elements, watermarks with fixed parameters can easily obscure key visual information or even damage the integrity of the image content. In scenarios with a simple background or a lot of white space, traditional watermarks appear abrupt due to a lack of adaptability, affecting both the visual experience and lowering the anti-attack threshold.
[0003] Therefore, there is an urgent need for a watermark generation method based on image semantics to address the shortcomings of related technologies. Summary of the Invention
[0004] In view of the above problems, this application provides a method, apparatus, device and medium for generating watermarks based on image semantics.
[0005] The first aspect of this application provides a watermark generation method based on image semantics, the method comprising: acquiring image information of a target image, the image information including at least one of object information, scene information and color information; and generating a watermark in the target image based on the image information.
[0006] According to the embodiments provided in this application, generating a watermark in a target image based on image information includes: determining the composition of the watermark based on object information and / or scene information; wherein the composition includes text content and / or pattern content; determining the display method of the watermark in the target image based on object information; and determining the color of the watermark in the target image based on color information.
[0007] According to the embodiments provided in this application, determining the composition of a watermark based on object information and / or scene information includes: determining the number and area of objects in a target image based on object information; determining the composition of a watermark based on the number and area of objects in the target image; wherein, if the number and area of objects in the target image simultaneously meet a preset number threshold and a preset area threshold, the composition of the watermark is determined to be text content.
[0008] According to the embodiments provided in this application, determining the display method of a watermark in a target image based on object information includes: determining a first region of each object in the target image based on object information; and determining a second region in the target image, wherein the second region represents the image background in the target image, and the first region and the second region are different; and displaying the watermark in the second region.
[0009] According to the embodiments provided in this application, displaying a watermark in the second area further includes: partially displaying a watermark in the first area; or not displaying a watermark in the first area.
[0010] According to the embodiments provided in this application, determining the color of a watermark in a target image based on color information includes: obtaining the display area of the watermark in the target image according to the display method; determining the color features and texture features of the display area based on the color information; and determining the color of the watermark in the display area based on the color features and texture features of the display area.
[0011] According to the embodiments provided in this application, color features include one or more of saturation, contrast, and dominant hue.
[0012] According to the embodiments provided in this application, obtaining image information of a target image includes: identifying at least one object in the target image through a pre-trained image processing model to obtain object information; and determining scene information of the target image based on at least one object.
[0013] A second aspect of this application provides an image semantic watermark generation apparatus, characterized in that the apparatus comprises:
[0014] The information acquisition module is used to acquire image information of the target image, including at least one of object information, scene information, and color information.
[0015] The information processing module is used to generate watermarks in the target image based on image information.
[0016] A third aspect of this application provides an electronic device comprising: one or more processors; and a memory for storing one or more computer programs, wherein the one or more processors execute the one or more computer programs to implement the steps of the method described above.
[0017] A fourth aspect of this application also provides a computer-readable storage medium having a computer program or instructions stored thereon, which, when executed by a processor, implement the steps of the above-described method.
[0018] The fifth aspect of this application also provides a computer program product, including a computer program or instructions that, when executed by a processor, implement the steps of the above-described method. Attached Figure Description
[0019] The above-mentioned contents, other objects, features and advantages of this application will become clearer from the following description of embodiments with reference to the accompanying drawings, in which:
[0020] Figure 1 The illustration shows an application scenario of the image semantic watermark generation method, apparatus, device, and medium according to embodiments of this application;
[0021] Figure 2 One of the flowcharts illustrating an image semantic-based watermark generation method according to an embodiment of this application is shown schematically;
[0022] Figure 3 A second flowchart illustrating an image semantic-based watermark generation method according to an embodiment of this application is shown schematically.
[0023] Figure 4 A flowchart illustrating the image semantic-based watermark generation method according to an embodiment of this application is shown in Figure 3.
[0024] Figure 5 This schematic diagram illustrates the structural block diagram of an image semantic watermark generation apparatus according to an embodiment of the present application;
[0025] Figure 6 A block diagram schematically illustrates an electronic device suitable for implementing an image semantic-based watermark generation method according to an embodiment of this application. Detailed Implementation
[0026] The embodiments of this application will now be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of this application. In the following detailed description, numerous specific details are set forth to provide a thorough understanding of the embodiments of this application for ease of explanation. However, it will be apparent that one or more embodiments may be implemented without these specific details. Furthermore, descriptions of well-known structures and technologies are omitted in the following description to avoid unnecessarily obscuring the concepts of this application.
[0027] The terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the scope of this application. The terms “comprising,” “including,” etc., as used herein indicate the presence of features, steps, operations, and / or components, but do not exclude the presence or addition of one or more other features, steps, operations, or components.
[0028] All terms used herein (including technical and scientific terms) have the meanings commonly understood by those skilled in the art, unless otherwise defined. It should be noted that the terms used herein are to be interpreted in a manner consistent with the context of this specification, and not in an idealized or overly rigid way.
[0029] When using expressions such as "at least one of A, B and C", they should generally be interpreted in accordance with the meaning that is commonly understood by those skilled in the art (e.g., "a system having at least one of A, B and C" should include, but is not limited to, a system having A alone, a system having B alone, a system having C alone, a system having A and B, a system having A and C, a system having B and C, and / or a system having A, B and C, etc.).
[0030] In the technical solution of this application, the user information (including but not limited to user personal information, user image information, user device information, such as location information) and data (including but not limited to data used for analysis, stored data, and displayed data) involved are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, storage, use, processing, transmission, provision, application, and application of related data all comply with relevant laws, regulations, and standards, take necessary confidentiality measures, do not violate public order and good morals, and provide corresponding operation entry points for users to choose to authorize or refuse.
[0031] In scenarios involving automated decision-making using personal information, the methods, devices, and systems provided in this application all offer users corresponding entry points for choosing to agree to or reject the automated decision-making results. If the user chooses to reject, the process proceeds to the expert decision-making stage. Here, "automated decision-making" refers to the activity of automatically analyzing and evaluating an individual's behavioral habits, interests, or economic, health, and credit status through computer programs, and then making a decision. Here, "expert decision-making" refers to the activity of making decisions by personnel who specialize in a particular field, possess specialized experience, knowledge, and skills, and have reached a certain level of professional expertise.
[0032] Figure 1 The illustration schematically depicts an application scenario of image semantic watermark generation, apparatus, device, medium, and program products according to embodiments of this application.
[0033] like Figure 1 As shown, application scenario 100 according to this embodiment may include a first terminal device 101, a second terminal device 102, a third terminal device 103, a network 104, and a server 105. The network 104 serves as a medium for providing communication links between the first terminal device 101, the second terminal device 102, the third terminal device 103, and the server 105. The network 104 may include various connection types, such as wired or wireless communication links, or fiber optic cables, etc.
[0034] Users can use the first terminal device 101, the second terminal device 102, and the third terminal device 103 to interact with the server 105 via the network 104 to receive or send messages, etc. Various communication client applications can be installed on the first terminal device 101, the second terminal device 102, and the third terminal device 103, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social media platform software, etc. (for example only).
[0035] The first terminal device 101, the second terminal device 102, and the third terminal device 103 can be various electronic devices with displays and support web browsing, including but not limited to smartphones, tablets, laptops, and desktop computers.
[0036] Server 105 can be a server that provides various services, such as a backend management server that supports websites browsed by users using the first terminal device 101, the second terminal device 102, and the third terminal device 103 (this is just an example). The backend management server can analyze and process data such as received user requests, and feed back the processing results (such as web pages, information, or data obtained or generated according to user requests) to the terminal devices.
[0037] It should be noted that the image semantics-based watermark generation method provided in this application embodiment can generally be executed by server 105. Correspondingly, the image semantics-based watermark generation device provided in this application embodiment can generally be located in server 105. The image semantics-based watermark generation method provided in this application embodiment can also be executed by a server or server cluster that is different from server 105 and capable of communicating with the first terminal device 101, the second terminal device 102, the third terminal device 103, and / or server 105. Correspondingly, the image semantics-based watermark generation device provided in this application embodiment can also be located in a server or server cluster that is different from server 105 and capable of communicating with the first terminal device 101, the second terminal device 102, the third terminal device 103, and / or server 105.
[0038] In some scenarios, the image semantic-based watermark generation method of this application can be applied to information processing in the financial field. For example, by adding watermarks to relevant financial images, the risk of image leakage can be avoided, and the traceability of image and text information can be improved.
[0039] It should be understood that Figure 1 The number of terminal devices, networks, and servers shown is merely illustrative. Depending on implementation needs, any number of terminal devices, networks, and servers can be included.
[0040] The following will be based on Figure 1The described scene, through Figures 2-6 A watermark generation method based on image semantics according to embodiments of this application will be described in detail.
[0041] Figure 2 One of the flowcharts illustrating an image semantic-based watermark generation method according to an embodiment of this application is shown.
[0042] like Figure 2 As shown, the image semantic watermark generation method according to the embodiment of this application includes: operations S201 to S202.
[0043] Operation S201: Acquire image information of the target image, including at least one of object information, scene information, and color information.
[0044] Specifically, before generating a watermark in a target image, it is necessary to fully understand the image semantics of the target image. By obtaining information about objects, scenes, colors, etc. contained in the target image, a foundation is provided for generating a watermark adapted to the target image based on the image semantics.
[0045] In some embodiments, a beach landscape image is input as the target image, containing elements such as people, parasols, and the ocean. Objects in the image are identified using a pre-trained object detection model, obtaining object information, specifically: "People: bounding box 1", "Parasy: bounding box 2". Simultaneously, a scene classification model analyzes the overall content of the target image, outputting the scene information as "beach". Finally, the dominant color tone of the image is extracted using a clustering algorithm to obtain color information.
[0046] In other embodiments, the target image is a landscape photograph, which may contain elements such as mountains, lakes, and sky. Image recognition techniques, such as convolutional neural networks, are used to analyze the image and obtain image information. Objects such as mountains and lakes in the image are identified, and object information is obtained. Based on these objects, the scene is determined to be a natural landscape scene, and scene information is obtained. Simultaneously, the overall color distribution of the image is analyzed to obtain color information, such as the dominant color being blue (sky and lakes) and green (mountain vegetation).
[0047] Operation S202 generates a watermark in the target image based on image information.
[0048] In some embodiments, the composition of the watermark generated in the target image, the location distribution of the watermark, and the color attributes of the watermark are comprehensively determined based on object information, scene information, and color information. The watermark form includes single text content, single pattern content, and mixed text and image content. The location distribution of the watermark includes parameter data that reflects the distribution of the watermark, such as the size, number, and coordinates of the watermark on the target image. The color attributes of the watermark include color changes and transparency.
[0049] Compared to traditional methods of embedding watermarks with fixed parameters, the method in this application allows the watermark generation process to fully consider the characteristics of the image itself, making the generated watermark more suitable for the target image. This avoids the watermark obscuring key visual information in complex image content scenarios and the abruptness in simple scenarios, thereby improving the anti-counterfeiting effect and visual experience of the watermark.
[0050] According to an embodiment of this application, in operation S202, a watermark is generated in the target image based on image information, including operations S2021 to S2023.
[0051] In step S2021, the composition of the watermark is determined based on object information and / or scene information; wherein the composition includes text content and / or graphic content.
[0052] Operation S2022 determines how the watermark will be displayed in the target image based on the object information.
[0053] Operation S2023 determines the color of the watermark in the target image based on the color information.
[0054] Specifically, based on the image information obtained from the target image, the watermark generation process is further refined. Object and scene information is used to determine the specific content of the watermark, the display method is determined based on object information, and color information is combined to set the watermark color. From the aspects of content, display method, and color, the watermark is comprehensively integrated with the target image to achieve better anti-counterfeiting and visual effects.
[0055] For example, using the aforementioned natural scenery photo, based on the identified object information (mountains, lakes, etc.) and scene information (natural scenery), if it is determined that the current scene is suitable for highlighting natural elements, the watermark content can be determined to be a nature-related pattern, such as a bird pattern. Based on the object information, the area occupied by objects such as mountains and lakes is determined as the first area, and the surrounding blank or background area is determined as the second area. The watermark is then displayed in the second area. Next, based on the color information, the color characteristics of the display area (such as the background area of the sky) are analyzed. If the sky has a high blue saturation, to prevent the watermark from being too conspicuous, white with a moderate contrast to blue is selected as the watermark color.
[0056] By adopting the above method, the content, display method, and color of the watermark are closely related to the target image. This not only enhances the concealment of the watermark, making it difficult to detect and remove, but also effectively achieves anti-counterfeiting function without affecting the visual effect of the image. This solves the problems of traditional static watermarks being easy to obscure information in complex scenes and abrupt in simple scenes.
[0057] According to embodiments of this application, the composition of the watermark is determined based on object information and / or scene information, including:
[0058] Based on the object information, determine the number and area of objects in the target image; based on the number and area of objects in the target image, determine the composition of the watermark; wherein, if the number and area of objects in the target image simultaneously meet the preset quantity threshold and the preset area threshold, the composition of the watermark is determined to be text content.
[0059] Specifically, when determining the watermark content based on object and scene information, a quantitative judgment method is provided. By setting thresholds for the number and area of objects, it is possible to more reasonably select whether the watermark content is text or pattern in image scenes of varying complexity, thereby making the watermark more compatible with the image content.
[0060] In one embodiment, the target image is a photograph of a city street scene. An image processing model is used to count the number of objects in the image, such as vehicles, pedestrians, and buildings, and to calculate the area occupied by each object. If the number of objects exceeds a preset threshold (e.g., 50), and the total area of the objects exceeds a preset area threshold (e.g., 60% of the total image area), it indicates that the image content is relatively complex. In this case, the watermark is determined to consist of text content, such as the words "Copyright". In complex images, patterns may interfere with each other among numerous objects, while concise text can more clearly serve as an anti-counterfeiting measure and is less likely to obscure key information.
[0061] By using the above-mentioned method of determining the watermark composition based on quantitative judgment, a more suitable watermark form can be adaptively selected for images of different complexity, further improving the integration of the watermark and the image. This ensures the anti-counterfeiting function while avoiding interference with key information in the image, thus enhancing the user's visual experience of the image.
[0062] Figure 3 The flowchart illustrating the second method for generating watermarks based on image semantics according to an embodiment of this application is shown schematically.
[0063] According to an embodiment of this application, in operation S2022, the display method of the watermark in the target image is determined based on the object information, including operations S301 to S303.
[0064] Operation S301 determines the first region of each object in the target image based on the object information.
[0065] Operation S302 determines a second region in the target image. The second region represents the image background in the target image, and the first region and the second region are different.
[0066] Operate S303 to display the watermark in the second area.
[0067] Specifically, image regions are divided based on object information, and the watermark should be displayed in a different image background region than the object region, i.e., the second region. The purpose is to avoid the watermark obscuring the main content of the image, ensure the complete presentation of key image information, and make the watermark easier to identify in a relatively simple background region, thus balancing image integrity and watermark recognizability.
[0068] For example, in a portrait painting, an image processing model determines the face, body, and other parts of the subject as the first region, and the background surrounding the subject as the second region. For instance, if the background behind the subject is a solid-colored wall, then the wall area is the second region, and the generated watermark is displayed on the wall area. This ensures both the integrity of the subject and the clarity of the watermark.
[0069] In some embodiments, the first region of each object in the obtained target image can be further processed. Based on the image content of the target image, for a certain object A in the target image, its corresponding first region can be converted into a second region, that is, the generated watermark can be displayed in the first region corresponding to object A.
[0070] Furthermore, for each object in the target image, its corresponding first region can be converted into a second region if at least one of the following conditions is met:
[0071] The area of the first region corresponding to the object is smaller than the preset area;
[0072] The object has a low degree of correlation with other objects in the target image;
[0073] Displaying the generated watermark on an object does not affect the user's ability to identify the object's appearance, main content, or other information.
[0074] By adopting the above method, the display area of the watermark is determined, which effectively solves the problem that traditional watermarks may obscure key visual information of the image. While protecting the integrity of the image content, it ensures the normal display of the watermark and improves the practicality and effectiveness of the watermark.
[0075] According to embodiments of this application, displaying a watermark in the second area further includes:
[0076] Display the watermark in the first area; or, do not display the watermark in the first area.
[0077] Specifically, based on the determination to display the watermark in the second area, the method of displaying the watermark in the first area is further determined. By providing two options, namely, partially displaying or not displaying the watermark in the first area, the method can meet different needs and scenarios, making the watermark display more diversified and adaptive, and better balancing the presentation of image content and the anti-counterfeiting requirements of the watermark.
[0078] For example, the target image is a picture of a flower, with the flower as the first area and the background as the second area. If you want the watermark to be somewhat concealed and not affect the visual effect of the flower, you can choose not to display the watermark in the first area and only display it in the second area of the background. If you feel that displaying the watermark only in the background is not prominent enough, you can choose to display the watermark in the first area, such as the edge of the flower, which does not affect the visual effect of the main subject. For example, you can add a semi-transparent thin line watermark pattern to the edge of the flower.
[0079] By adopting the above method, the watermark generation method can more accurately control the watermark display according to different image content and usage requirements, further improve the adaptability of watermark and image, and meet diverse anti-counterfeiting and visual effect requirements.
[0080] Figure 4 The flowchart of the image semantic watermark generation method according to an embodiment of this application is illustrated in part three.
[0081] According to an embodiment of this application, in operation S2023, the color of the watermark in the target image is determined based on the color information, including operations S401 to S403.
[0082] Operation S401: Based on the display method, obtain the display area of the watermark in the target image.
[0083] Operation S402 determines the color and texture features of the display area based on the color information.
[0084] Operation S403 determines the color of the watermark in the display area based on the color and texture features of the display area.
[0085] In this embodiment of the application, after determining the display area in conjunction with the display method of the watermark, the watermark color is determined according to the color and texture characteristics of the area, so that the watermark color blends better with the background of the display area, further enhancing the concealment and visual coordination of the watermark, and enabling the watermark to achieve specific functions without destroying the overall visual effect of the image.
[0086] For example, the target image is an autumn forest picture, and the watermark defines the sky area displayed among the trees (i.e., the display area). By acquiring the color characteristics of the display area, such as the sky's dominant color being light blue with low saturation and moderate contrast; and analyzing its texture characteristics, the sky is relatively smooth with no obvious texture. Based on these characteristics, to ensure the watermark blends with the background, a light blue within the light blue family, similar to the background color but still distinguishable by a certain contrast, is selected as the watermark color. Furthermore, the watermark uses relatively smooth lines or shapes to match the texture characteristics of the sky.
[0087] By adopting the above method, the watermark color is determined based on the color and texture features of the display area, which further optimizes the fusion effect between the watermark and the image, making the watermark more concealed and natural, and not easy to detect or remove. At the same time, it ensures the visual quality of the image and improves the anti-counterfeiting ability and overall aesthetics of the watermark.
[0088] According to embodiments of this application, color features include one or more of saturation, contrast, and dominant hue.
[0089] Specifically, the specific elements included in color characteristics provide more concrete quantitative indicators for determining watermark colors based on the display area. By considering factors such as saturation, contrast, and dominant hue, the color characteristics of the display area can be analyzed more accurately, thereby selecting a more suitable watermark color and achieving a more delicate watermark-image fusion effect.
[0090] According to embodiments of this application, obtaining image information of the target image includes:
[0091] By using a pre-trained image processing model, at least one object in the target image is identified, and object information is obtained; based on at least one object, scene information of the target image is determined.
[0092] For example, a pre-trained object detection model can be used to process the target image. For instance, if the target image is a moving scene, the model can identify objects such as people, basketballs, and basketball courts, obtaining object information. Based on these identified objects, the scene information is determined to be a basketball game. This information will serve as the basis for subsequent watermark generation. For example, based on the characteristics of the basketball game scene, basketball-related patterns can be selected as watermark components, and background areas such as the basketball court surface can be selected as watermark display areas.
[0093] By employing a pre-trained image processing model to acquire image information, the accuracy and efficiency of information acquisition are improved, reducing errors and subjectivity that may arise from manual intervention. Simultaneously, it can quickly adapt to different types of images, making the watermark generation method more versatile and robust.
[0094] Figure 5The schematic diagram illustrates a structural block diagram of an image semantic watermark generation apparatus according to an embodiment of this application.
[0095] Based on the above-mentioned image semantic watermark generation method, this application provides an image semantic watermark generation device, which will be described below in conjunction with... Figure 5 The device is described in detail.
[0096] like Figure 5 As shown, the image semantic watermark generation device 500 of this embodiment includes an information acquisition module 510 and an information processing module 520.
[0097] The information acquisition module 510 is used to acquire image information of the target image, wherein the image information includes at least one of object information, scene information and color information;
[0098] The information processing module 520 is used to generate a watermark in the target image based on image information.
[0099] According to an embodiment of this disclosure, the information processing module 520 is further configured to: determine the composition of the watermark based on the object information and / or scene information; wherein the composition includes text content and / or pattern content; determine the display method of the watermark in the target image based on the object information; and determine the color of the watermark in the target image based on the color information.
[0100] According to an embodiment of this disclosure, the information processing module 520 is further configured to: determine the number and area of objects in the target image based on the object information; determine the composition of the watermark based on the number and area of objects in the target image; wherein, when the number and area of objects in the target image simultaneously satisfy a preset number threshold and a preset area threshold, the composition of the watermark is determined to be text content.
[0101] According to an embodiment of this disclosure, the information processing module 520 is further configured to: determine a first region of each object in the target image based on the object information; and determine a second region in the target image, the second region representing the image background in the target image, the first region and the second region being different; and display the watermark in the second region.
[0102] According to an embodiment of this disclosure, the information processing module 520 is further configured to: partially display the watermark in the first area; or, not display the watermark in the first area.
[0103] According to an embodiment of this disclosure, the information processing module 520 is further configured to: obtain the display area of the watermark in the target image according to the display method; determine the color features and texture features of the display area according to the color information; and determine the color of the watermark in the display area based on the color features and texture features of the display area.
[0104] According to an embodiment of this disclosure, the information acquisition module 510 is further configured to: identify at least one object in the target image through a pre-trained image processing model to obtain the object information; and determine the scene information of the target image based on the at least one object.
[0105] According to embodiments of this application, any plurality of modules in the information acquisition module 510 and the information processing module 520 can be combined into one module, or any one of the modules can be split into multiple modules. Alternatively, at least a portion of the functionality of one or more of these modules can be combined with at least a portion of the functionality of other modules and implemented in one module. According to embodiments of this application, at least one of the information acquisition module 510 and the information processing module 520 can be at least partially implemented as hardware circuitry, such as a field-programmable gate array (FPGA), a programmable logic array (PLA), a system-on-a-chip, a system-on-a-substrate, a system-on-package, an application-specific integrated circuit (ASIC), or any other reasonable means of integrating or packaging circuitry, or implemented in software, hardware, or firmware, or in any appropriate combination of any of these three implementation methods. Alternatively, at least one of the information acquisition module 510 and the information processing module 520 can be at least partially implemented as a computer program module, which, when run, can perform corresponding functions.
[0106] Figure 6 A block diagram schematically illustrates an electronic device suitable for implementing an image semantic-based watermark generation method according to an embodiment of this application.
[0107] like Figure 6As shown, an electronic device 600 according to an embodiment of this application includes a processor 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage portion 608 into a random access memory (RAM) 603. The processor 601 may include, for example, a general-purpose microprocessor (e.g., a CPU), an instruction set processor and / or an associated chipset and / or a special-purpose microprocessor (e.g., an application-specific integrated circuit (ASIC)), etc. The processor 601 may also include onboard memory for caching purposes. The processor 601 may include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of this application.
[0108] RAM 603 stores various programs and data required for the operation of electronic device 600. Processor 601, ROM 602, and RAM 603 are interconnected via bus 604. Processor 601 executes various operations of the method flow according to embodiments of this application by executing programs in ROM 602 and / or RAM 603. It should be noted that programs may also be stored in one or more memories other than ROM 602 and RAM 603. Processor 601 may also execute various operations of the method flow according to embodiments of this application by executing programs stored in one or more memories.
[0109] According to embodiments of this application, the electronic device 600 may further include an input / output (I / O) interface 605, which is also connected to a bus 604. The electronic device 600 may also include one or more of the following components connected to the input / output (I / O) interface 605: an input section 606 including a keyboard, mouse, etc.; an output section 607 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 608 including a hard disk, etc.; and a communication section 609 including a network interface card such as a LAN card, modem, etc. The communication section 609 performs communication processing via a network such as the Internet. A drive 610 is also connected to the input / output (I / O) interface 605 as needed. A removable medium 611, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on the drive 610 as needed so that computer programs read from it can be installed into the storage section 608 as needed.
[0110] This application also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments; or it may exist independently and not assembled into the device / apparatus / system. The computer-readable storage medium carries one or more programs, which, when executed, implement the watermark generation method according to the embodiments of this application.
[0111] According to embodiments of this application, the computer-readable storage medium can be a non-volatile computer-readable storage medium, such as including but not limited to: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this application, the computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. For example, according to embodiments of this application, the computer-readable storage medium may include ROM 602 and / or RAM 603 and / or one or more memories other than ROM 602 and RAM 603 described above.
[0112] Embodiments of this application also include a computer program product comprising a computer program containing program code for performing the methods shown in the flowchart. When the computer program product is run on a computer system, the program code is used to enable the computer system to implement the watermark generation method provided in the embodiments of this application.
[0113] When the computer program is executed by the processor 601, it performs the functions defined in the system / apparatus of this application embodiment. According to the embodiments of this application, the systems, apparatuses, modules, units, etc., described above can be implemented by computer program modules.
[0114] In one embodiment, the computer program may rely on a tangible storage medium such as an optical storage device or a magnetic storage device. In another embodiment, the computer program may also be transmitted and distributed in the form of signals over a network medium, and downloaded and installed via the communication section 609, and / or installed from the removable medium 611. The program code contained in the computer program can be transmitted using any suitable network medium, including but not limited to: wireless, wired, etc., or any suitable combination thereof.
[0115] In such an embodiment, the computer program can be downloaded and installed from a network via the communication section 609, and / or installed from the removable medium 611. When the computer program is executed by the processor 601, it performs the functions defined in the system of this application embodiment. According to the embodiments of this application, the systems, devices, apparatuses, modules, units, etc., described above can be implemented by computer program modules.
[0116] According to embodiments of this application, program code for executing the computer programs provided in the embodiments of this application can be written in any combination of one or more programming languages. Specifically, these computational programs can be implemented using high-level procedural and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages include, but are not limited to, languages such as Java, C++, Python, "C", or similar programming languages. The program code can be executed entirely on the user's computing device, partially on the user's device, partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing device can be connected to the user's computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via the Internet using an Internet service provider).
[0117] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0118] Those skilled in the art will understand that the features described in the various embodiments of this application can be combined and / or combined in various ways, even if such combinations or combinations are not explicitly described in this application. In particular, the features described in the various embodiments of this application can be combined and / or combined in various ways without departing from the spirit and teachings of this application. All such combinations and / or combinations fall within the scope of this application.
Claims
1. A watermark generation method based on image semantics, characterized in that, The method includes: Acquire image information of the target image, wherein the image information includes at least one of object information, scene information, and color information; A watermark is generated in the target image based on the image information.
2. The method according to claim 1, characterized in that, Based on the image information, a watermark is generated in the target image, including: Based on the object information and / or scene information, the composition of the watermark is determined; wherein, the composition includes text content and / or graphic content; Based on the object information, determine how the watermark is displayed in the target image; Based on the color information, the color of the watermark in the target image is determined.
3. The method according to claim 2, characterized in that, Based on the object information and / or scene information, the composition of the watermark is determined, including: Based on the object information, determine the number and area of objects in the target image; The composition of the watermark is determined based on the number and area of objects in the target image; Specifically, if the number and area of objects in the target image simultaneously meet a preset number threshold and a preset area threshold, the watermark content is determined to be text content.
4. The method according to claim 2, characterized in that, Based on the object information, determining how the watermark is displayed in the target image includes: Based on the object information, determine the first region of each object in the target image; In addition, a second region in the target image is determined, the second region representing the image background in the target image, and the first region and the second region are different; The watermark is displayed in the second area.
5. The method according to claim 4, further comprising displaying the watermark in the second region: The watermark is displayed in the first area. Alternatively, the watermark may not be displayed in the first area.
6. The method according to claim 2, characterized in that, Determining the color of the watermark in the target image based on the color information includes: Based on the display method, obtain the display area of the watermark in the target image; Based on the color information, determine the color features and texture features of the display area; The color of the watermark in the display area is determined based on the color and texture features of the display area.
7. The method according to claim 6, characterized in that, The color features include one or more of saturation, contrast, and dominant hue.
8. The method according to claim 1, characterized in that, The acquisition of image information of the target image includes: By using a pre-trained image processing model, at least one object in the target image is identified, and information about the object is obtained. Based on the at least one object, determine the scene information of the target image.
9. A watermark generation device based on image semantics, characterized in that, The device includes: The information acquisition module is used to acquire image information of the target image, wherein the image information includes at least one of object information, scene information and color information; An information processing module is used to generate a watermark in the target image based on the image information.
10. An electronic device, comprising: One or more processors; Memory, used to store one or more computer programs. The characteristic feature is that the one or more processors execute the one or more computer programs to implement the steps of the method according to any one of claims 1 to 8.
11. A computer-readable storage medium having a computer program or instructions stored thereon, characterized in that, When the computer program or instructions are executed by a processor, they implement the steps of the method according to any one of claims 1 to 8.
12. A computer program product, comprising a computer program or instructions, characterized in that, When the computer program or instructions are executed by a processor, they implement the steps of the method according to any one of claims 1 to 8.