Image processing method and related equipment
By adding watermarks to target elements of multimedia data in the image processing method, the problem of insufficient personalized watermark settings and anti-attackability in the prior art is solved, and the protection effect of watermarks is improved.
Patent Information
- Application Number
- CN202310576718.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-19
- Publication Date
- 2024-11-22
AI Technical Summary
The prior art is difficult to meet the personalized setting requirements of watermarks in multimedia data, and its resistance to geometric attacks is insufficient, which affects the protection effect of watermarks.
An image processing method is provided, by configuring watermark indication information and a pending image by displaying the service interface, watermark addition processing is performed on target elements in the image, and a new image with a watermark is generated, thereby improving the anti-aggression of the watermark.
It realizes the personalized setting of watermarks and effective resistance to geometric attacks, ensures the amount and location of watermarks, and enhances the protection effect of multimedia data.
Smart Images

Figure CN119011867A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to an image processing method, an image processing apparatus, a computer device, a computer-readable storage medium, and a computer program product. Background Art
[0002] With the development of computer technology, the dissemination of multimedia data such as videos and pictures has become more and more widespread. Based on the corresponding business needs, computer equipment can add digital watermarks to these multimedia data before dissemination, so as to achieve the purpose of protecting and maintaining multimedia data. However, multimedia data with corresponding digital watermarks often have certain geometric attacks (such as cropping, scaling, and translation), which seriously affect the amount and position of watermarks in multimedia data, and thus affect the protection effect of watermarks on multimedia data. At present, adding watermarks to multimedia data cannot meet some personalized setting requirements well, and the resistance to various geometric attacks needs to be improved. Therefore, how to meet the personalized needs of watermarking and improve the anti-attack ability of watermarks in multimedia data has become a current research hotspot. Summary of the invention
[0003] The embodiments of the present application provide an image processing method and related equipment, which can meet the personalized needs of watermark addition and improve the anti-attack capability of watermarks in multimedia data.
[0004] On the one hand, an embodiment of the present application provides an image processing method, including:
[0005] Displaying the first service interface;
[0006] Acquire the first image to be processed and watermark indication information configured in the first service interface;
[0007] A second image with a watermark is displayed, wherein the second image is obtained after a watermark is added to a target element of the first image based on the watermark indication information, and the target element refers to any one or more elements contained in the first image.
[0008] On the one hand, an embodiment of the present application provides an image processing device, including:
[0009] A display module, used for displaying a first service interface;
[0010] An acquisition module, used to acquire the first image to be processed and the watermark indication information configured in the first service interface;
[0011] The display module is also used to display a second image with a watermark, wherein the second image is obtained after watermarking the target elements of the first image based on the watermark indication information, and the target element refers to any one or more elements contained in the first image.
[0012] Accordingly, an embodiment of the present application provides a computer device, including:
[0013] a processor suitable for executing a computer program;
[0014] A computer-readable storage medium having a computer program stored therein, wherein when the computer program is executed by the processor, the image processing method of the embodiment of the present application is executed.
[0015] Accordingly, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the image processing method of the embodiment of the present application is executed.
[0016] Accordingly, an embodiment of the present application provides a computer program product, which includes a computer program or computer instructions. When the computer program or computer instructions are executed by a processor, the image processing method of the embodiment of the present application is implemented.
[0017] In an embodiment of the present application, a first service interface can be displayed, and the first service interface can provide configuration functions related to watermarking, and supports configuration in the first service interface: the first image to be watermarked and the watermark indication information required for the watermarking process, so as to better meet the personalized needs of watermarking and enrich the way of watermarking. The watermark indication information configured in the first service interface and the first image to be processed are obtained. Further, based on the watermark indication information, the target element of the first image is watermarked to obtain a second image with a watermark, and the second image with a watermark can be displayed; the above-mentioned target element is any one or more elements contained in the first image. It can be seen that by adding a watermark to the target element contained in the first image, the target element of the first image can be provided with a watermark. The target element is one or more elements in the first image, which contain relatively valuable image content. By adding a watermark thereto, it can better resist the impact of geometric attacks and ensure the use value of the watermark. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Figure 1a is an architecture diagram of an image processing system provided by an exemplary embodiment of the present application;
[0019] Figure 1b is an interactive schematic diagram of image processing provided by an exemplary embodiment of the present application;
[0020] Figure 2 is a flowchart of an image processing method provided by an exemplary embodiment of the present application;
[0021] Figure 3a is a schematic diagram of a first service interface provided by an exemplary embodiment of the present application;
[0022] Figure 3b is a schematic diagram of displaying a watermark list provided by an exemplary embodiment of the present application;
[0023] Figure 3c is a schematic diagram of components of a display watermark provided by an exemplary embodiment of the present application;
[0024] Figure 4a is a schematic diagram of setting indication information of a target element provided by an exemplary embodiment of the present application;
[0025] Figure 4b is a schematic diagram of another method of setting indication information of a target element provided by an exemplary embodiment of the present application;
[0026] Figure 4c is a schematic diagram of a type list of elements provided by an exemplary embodiment of the present application;
[0027] Figure 4d is a schematic diagram of a specific element list provided by an exemplary embodiment of the present application;
[0028] Figure 4e It is a schematic diagram of setting adding mode indication information provided by an exemplary embodiment of the present application;
[0029] Figure 5a It is a schematic diagram of a flow chart of a target detection process provided by an exemplary embodiment of the present application;
[0030] Figure 5b It is a schematic diagram of a process of adding a watermark provided by an exemplary embodiment of the present application;
[0031] Figure 5c is a flowchart of another watermark adding process provided by an exemplary embodiment of the present application;
[0032] Figure 6 is a flowchart of another image processing method provided by an exemplary embodiment of the present application;
[0033] Figure 7a is a schematic diagram of a second service interface provided by an exemplary embodiment of the present application;
[0034] Figure 7b is a schematic diagram of a detected watermark and a reference watermark jointly displayed according to an exemplary embodiment of the present application;
[0035] Figure 7c is a schematic diagram of another detected watermark and a reference watermark jointly displayed according to an exemplary embodiment of the present application;
[0036] Figure 7d is a flowchart of a watermark detection process provided by an exemplary embodiment of the present application;
[0037] Figure 8 is a flowchart of an image processing provided by an exemplary embodiment of the present application;
[0038] Fig. 9 is a structural schematic diagram of an image processing device provided by an exemplary embodiment of the present application;
[0039] Fig.10 It is a structural diagram of a computer device provided by an exemplary embodiment of the present application. DETAILED DESCRIPTION
[0040] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0041] To facilitate understanding, the terms involved in the embodiments of the present application are explained below.
[0042] 1. Watermark
[0043] Watermark refers to the information used to mark multimedia data (such as images, videos or audio, etc.). A watermark can be a certain pattern, pattern, or text. Based on the marking of watermark, on the one hand, it can prevent the corresponding multimedia data from being forged, thereby improving the authenticity and reliability of the marked multimedia data. On the other hand, it can also maintain and appeal the copyright of multimedia data, thereby protecting the copyright of digital multimedia data (such as game content, video content or article content, etc.).
[0044] Depending on whether the watermark is visible, the watermark includes a visible watermark or an invisible digital watermark. Among them, a visible watermark is, for example, a watermark added for the confidentiality of a file, or an anti-counterfeiting mark added to an electronic resource. An invisible digital watermark is a watermark hidden in the added object (or carrier), and can only be detected and discovered through the corresponding digital watermark detection technology. Among them, digital watermark detection technology is a detection algorithm designed for the process of watermark addition, which determines whether a watermark exists based on the original watermark (such as characters or icons, etc.) or the test results based on statistical principles. For example, the presence of a watermark is determined by comparing the extracted watermark with the original watermark.
[0045] As an information hiding technology, digital watermarking mainly embeds secret information in the original carrier (such as image, audio, video, etc.) to play the role of copyright protection or content authentication of the original carrier. The embedded secret information can be a signature, serial number or other specific text or image, etc., and then the secret information is embedded in the original carrier through a specific watermark embedding algorithm, which does not affect the use of the original carrier and is not easy to be detected. When the digital watermark is added to the video, the digital watermark technology is a digital watermark technology for the video carrier, which can be referred to as video digital watermarking technology. In the implementation of adding digital watermarks in video digital watermarking technology, a watermark signal can be generated according to a password, and the watermark can be added to the original video through a certain adding algorithm, and finally a video embedded with a watermark (i.e., a video containing a watermark) is obtained. Based on the embedding of digital watermarks, the video embedded with a watermark has a higher video fidelity, which is a measure of the similarity before and after the video is watermarked, that is, the degree of distinguishability between the original video and the watermarked video. Videos with higher fidelity can also avoid affecting the viewing effect of the video.
[0046] The watermark mentioned in the embodiments of the present application may be a digital watermark. By adding a digital watermark, the watermark can be hidden in multimedia data (such as an image or video) and not easily discovered, which will not affect the visual presentation of the image, and thus will not affect the use value of the original carrier, and will not be easily detected and modified again, that is, the watermark will not be easily removed by technical means, and can achieve more reliable protection for multimedia data.
[0047] 2. Elements
[0048] In the embodiment of the present application, an element refers to a constituent element in an image. An object instance in an image can be understood as an element, such as a virtual game equipment, a virtual game character, etc. in an image. The target element mentioned in the embodiment of the present application refers to one or more elements in an image, which can be an object instance of a predefined category accurately and efficiently identified and located from an image or video by target detection technology. For example, the target element includes a life bar that appears in a game video, which is used to identify the life value of a virtual game character during the game. The target element can also be a class of elements in an image, such as: a class of virtual game characters contained in a picture captured from a game video. If the image is a frame of an image in a video, the target element can also be an element whose frequency of appearance in the video is greater than a preset frequency threshold, such as: the target element is a virtual character A that appears in all images of a preset number of frames in the video.
[0049] In the embodiment of the present application, by performing watermarking processing on the target element, the robustness of the watermark can be increased, so that even if the multimedia data (such as video) after the watermark is added is attacked intentionally or unintentionally, the watermark can still be detected.
[0050] The present application proposes an image processing scheme, which relates to an image processing system, method and related equipment. The scheme can display a first service interface and obtain a first image to be processed and watermark indication information configured in the first service interface. Then, a second image with a watermark can be displayed. The second image is obtained by adding a watermark to a target element of the first image based on the watermark indication information. In the watermark adding process, by adding a watermark to the target element of the first image, the target element can be provided with a watermark. Since the target element is a valuable image content in the first image, by adding a watermark thereto, the anti-attack property of the watermark can be improved, thereby achieving a better protection effect for digital multimedia data (such as images and videos, etc.). Furthermore, one or more elements in the first image that are not watermarked are watermarked and are elements containing watermarks in the second image. Based on the target element, the area where the watermark is added can be located, and it can help to better detect the location information of the watermark embedding, and even if it is subjected to geometric attacks such as cropping, the watermark can be detected faster. If the watermark is a digital watermark, the images before and after the watermark is added are the same in visual presentation, that is, the first image and the second image look the same, thereby ensuring the fidelity of the multimedia data.
[0051] The architecture of the image processing system provided in the embodiments of the present application will be introduced below in conjunction with the accompanying drawings.
[0052] See also Figure 1a , is an architecture diagram of an image processing system provided by an exemplary embodiment of the present application. Figure 1aAs shown, the image processing system includes a database 101 and a computer device 102; the database 101 can establish a communication connection with the computer device 102 in a wired or wireless manner. The computer device 102 is used to execute the image processing process; the database 101 is used to provide data support for the image processing process of the computer device 102. For example, the database 101 can store one or more of images and videos, so that the computer device 102 can directly obtain images or videos from them to determine the first image to be processed.
[0053] According to the deployment location, the database 101 can be a local database of the computer device 102, or a cloud database that can establish a connection with the computer device 102. According to the attributes, the database 101 can be a public database, that is, a database open to all computer devices; or it can be a private database, that is, a database open only to specific computer devices (such as the computer device 102). According to the different stored contents, the database 101 includes a content database, a watermark database, an element database and a result database. Among them, the content database is used to store one or more of images and videos. The watermark database is used to store predefined watermarks or components that constitute watermarks, which can be provided to users for selection to quickly determine the reference watermark. The element database is used to store each element identified from the image. The result database is used to store images or videos obtained after the watermark addition process, and the watermark detection results obtained by performing watermark detection on any image or video.
[0054] The computer device 102 includes one or both of a terminal device and a server, wherein the terminal device includes but is not limited to: smart phones, tablet computers, smart wearable devices, smart voice interaction devices, smart home appliances, personal computers, vehicle-mounted terminals and other devices, which are not limited in this application. This application does not limit the number of terminal devices. The server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers. It can also be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms, but is not limited to this. This application does not limit the number of servers.
[0055] The process of the computer device 102 executing the image processing method generally includes the following contents described in ①-④: ① Displaying the first service interface, the first service interface refers to any interface provided by the service program for executing watermark addition, and the service program may be an offline service program or an online service program. Watermark indication information and the first image to be processed may be configured in the first service interface. Further, ② Obtaining the first image to be processed and the watermark indication information configured in the first service interface. The first image may include any of the following: an image input in the first service interface; or an image downloaded based on the image address input in the first service interface; or any frame image selected from the video downloaded based on the video address input in the first service interface; or any frame image selected from the video input in the first service interface, and a frame image specified in the video. This application does not limit this. Watermark indication information refers to information related to watermark addition processing. The watermark indication information includes a reference watermark, which refers to a watermark to be used when performing watermark addition processing. Schematically, the reference watermark may specifically be a digital watermark. In one implementation, the watermark indication information may also include an identifier of a reference watermark, such as the name of the reference watermark, a pattern identifier of the reference watermark, etc., and the reference watermark may be subsequently acquired based on the identifier of the reference watermark for watermark addition processing.
[0056] ③ Based on the watermark indication information, a watermark is added to the target element of the first image to obtain a second image with a watermark, wherein the target element refers to any one or more elements contained in the first image.
[0057] The computer device 102 includes a terminal device, and the service program corresponding to the first service interface is an offline service program and is deployed locally on the terminal device. The computer device 102 can support offline watermark adding services. In this way, after the terminal device obtains the first image and the watermark adding indication information, it can execute the content described in ③ above. In a feasible implementation method, the terminal device can first extract the added area image corresponding to the target element from the first image. The added area image is a regional image containing the target element, generally an image corresponding to the local area occupied by the target element in the first image. Then, the terminal device can add the reference watermark contained in the watermark adding indication information to the extracted added area image to obtain a watermarked regional image, and then the watermarked regional image can be used to replace the added area image in the first image, and finally a second image with a watermark is obtained.
[0058] In another implementation, the computer device 102 includes a terminal device and a server, and the service program that provides the watermarking service is an online service program and is deployed on the server. Based on this, the computer device 102 supports online watermarking services. The terminal device can send the acquired first image and watermark indication information to the server. Afterwards, the server performs watermarking processing on the target element of the first image based on the watermark indication information to obtain a second image with a watermark, and returns the second image to the terminal device for display.
[0059] As an implementable manner, the server may also execute ② and ③ above. The terminal device may send the watermark indication information configured in the first service interface to the server. For the first image, it may be any of the following: the terminal device directly sends the image input in the first service interface as the first image to the server; or, directly sends the video input in the first service interface to the server and the server determines any frame image from the video as the first image; or, sends the image address input in the first service interface to the server and the server downloads the corresponding image based on the image address as the first image; or, directly sends the video address input in the first service interface to the server and the server downloads the corresponding video based on the video address, and then selects any frame image from the video as the first image.
[0060] ④ Display the second image with the watermark.
[0061] The computer device 102 may directly display the second image, or may output an address information and download the second image based on the address information for display. In one implementation, if the first image is any frame image in a video, the output address information is a video address, and the video is downloaded based on the video address, and the video includes the second image with a watermark.
[0062] In the image processing system provided by the embodiment of the present application, the computer device can display the first service interface, and the first service interface can provide the configuration function related to watermark addition, and support the configuration in the first service interface: the first image to be watermarked and the watermark indication information required for the watermark addition process, so as to better meet the personalized needs of watermark addition and enrich the way of watermark addition. The watermark indication information configured in the first service interface and the first image to be processed are obtained. Further, based on the watermark indication information, the target element of the first image is watermarked to obtain a second image with a watermark, and the second image with a watermark can be displayed; the above-mentioned target element is any one or more elements contained in the first image. It can be seen that by adding a watermark to the target element contained in the first image, the target element of the first image can be provided with a watermark. The target element is one or more elements in the first image, which contains relatively valuable image content. By adding a watermark thereto, it can better resist the influence of geometric attacks and ensure the use value of the watermark.
[0063] The image processing system and image processing method provided in the embodiments of the present application can be applied to various sharing scenarios, including but not limited to: game sharing scenarios, live broadcast sharing scenarios, and content sharing scenarios. This application is not limited here. In the game sharing scenario, users can upload game videos and perform watermarking on the image frames in the game videos to obtain watermarked game videos. Furthermore, users can share watermarked game videos to other platforms to protect the rights and interests of the game videos belonging to users.
[0064] In one embodiment, based on the above image processing system, the following may also be provided: Figure 1b An interactive diagram of an exemplary image processing is shown. The sharing object refers to the user who shares and disseminates multimedia data (such as videos, images, etc.). The watermark system supports watermark addition processing and watermark detection processing. Among them, the watermark detection processing can perform watermark detection processing on the image with the watermark added, so as to determine whether the watermark is successfully added. On the other hand, watermark detection can be performed on any image or video to determine whether a watermark is added thereto, and in the case of adding a watermark, the source can be traced based on the watermark.
[0065] like Figure 1bAs shown, when the sharing object has the need to share and disseminate, in order to ensure the copyright of the video that he / she disseminates, a watermark can be added to the video. The sharing object can upload the video to be watermarked based on the first service interface, and then the watermark system obtains the corresponding image from the video and obtains the watermark indication information. The watermark system can add a watermark to the corresponding image based on the watermark indication information, and then obtain a new video containing the watermark, and the sharing object can share and disseminate the obtained new video. When the sharing object has a detection need to verify whether the corresponding video is his / her own video, the watermark detection function provided by the watermark system can be used to detect whether the video contains the watermark that he / she added before, so as to obtain feedback on the detection result. Taking a game video as an example, illustratively, the watermark can be added when a computer device detects that the corresponding game video needs to be shared and disseminated, so that the game video with the watermark added in the corresponding game image frame can be shared and disseminated. Based on the sharing and dissemination of the game video with the watermark added, the watermark in the corresponding image frame can be detected and processed during any dissemination process of the game video, so that the authenticity of the game video in the dissemination process can be confirmed based on the result of the watermark detection, so as to safeguard the copyright protection rights and claims rights of the corresponding sharing object of the game video.
[0066] Next, the image processing method provided in the embodiment of the present application is introduced.
[0067] See also Figure 2 , is a flowchart of an image processing method provided by an exemplary embodiment of the present application. The image processing method can be performed by a computer device (such as Figure 1a The image processing method may be executed by the computer device 102 in the system shown in the figure, and may include the following steps S201-S203.
[0068] S201, displaying a first service interface.
[0069] The first service interface refers to any interface provided by the service program for executing watermark addition. The first service interface can be used to configure the first image to be processed and the watermark indication information. For example, Figure 3a In the first service interface shown, the first service interface 300 may include a file configuration item 301, an address configuration item 302, and a watermark configuration item 303. Based on the file configuration item 301, an image to be watermarked may be configured, and based on the watermark configuration item 303, a required watermark may be added. When an uploaded image or video is received, the corresponding image address or video address may be displayed in the address configuration item 202. When automatic configuration is started, the watermark may be randomly configured by the system.
[0070] S202: Acquire the first image to be processed and watermark indication information configured in the first service interface.
[0071] The computer device can obtain the first image configured in the first service interface, which is the image to be watermarked, and can be an image uploaded in the first service interface or an image in an uploaded video, or an image obtained based on a corresponding address.
[0072] In one implementation, the specific implementation of the computer device acquiring the first image to be processed configured in the first service interface may include but is not limited to any of the following ①-④:
[0073] ① Obtain a first image input in the first service interface. The first image may be any picture. The first service interface may include input configuration items, such as Figure 3a The file upload option shown can upload local or cloud images to the first service interface by triggering the input configuration item.
[0074] ② Obtain the first video imported in the first service interface, and extract the first image from the first video, where the first image is any frame image in the first video. The imported first video may be a video stored locally on the computer device, or a video stored in the cloud. This application is not limited. Exemplarily, the first service interface may include an import configuration item, such as an import button, through which you can connect to a corresponding storage space (such as a local computer device, or in the cloud) to select a corresponding video for import. Then, the computer device may randomly select a frame image from the first video as the first image, or it may extract a corresponding frame image from the first video as the first image according to the indication of the time interval for adding a watermark in the video. For details, please refer to the processing of the first video, which will not be repeated here.
[0075] ③ Obtain the image address entered in the first service interface, and download the first image according to the image address. The image address is the address where the image is stored, which can be used to address the image. The image address includes but is not limited to any of the following: an email address where the image is stored, a website link where the image is stored, a storage path of the image, etc., which is not limited in this application. The computer device can find the first image according to the image address, and then download the first image.
[0076] ④ Obtain the video address of the second video entered in the first service interface, and extract the first image from the second video according to the video address, where the first image is any frame image in the second video. The video address is the address where the video is stored, and can be used to address the second video. The video address includes, but is not limited to, any of the following: an email address where the second video is stored, a website link where the second video is stored, a storage path of the second video, etc., and this application does not limit this. The computer device can find the second video according to the video address and download it, and then extract any frame image from the second video as the first image. In one achievable method, the computer device can also obtain an indication of the time interval for adding a watermark to the video, and extract the corresponding image from the second video as the first image according to the indication. The indication of the time interval for adding watermarks to the video can be pre-configured in the first service interface. For example, the indication of the time interval for adding watermarks to the video configured in the first service interface is an interval of 1 second. Then, a watermark is added to the video every 1 second. Then, a frame of image can be selected from each frame of image corresponding to the 1st second of the second video as the first image. After the watermark adding process is completed, a frame of image can be selected from each frame of image corresponding to the 2nd second as the new first image and the watermark adding process is performed, and so on, until the video is processed. For the input of address information in the first service interface, the following can be provided: Figure 3a The address configuration item 302 shown can support inputting one or more of a video address and an image address. In addition, for an image or video inputted in the first service interface, the corresponding address can also be analyzed and displayed in the address configuration item.
[0077] It is understandable that if the computer device includes a terminal device and a server, the contents shown in ①-④ above can be implemented by the cooperation of the two. For example, the terminal device can directly send the content information (such as images, videos, image addresses and video addresses) configured in the first service interface to the server, and then the server obtains the first image based on the received content information, such as: obtaining the video according to the video address, and extracting a frame of image from the video, and then using it as the first image. In a feasible implementation, if the content information is an image address or a video address, it can be written into the corresponding field of the script. Subsequently, only the script needs to be started, and the server can obtain the corresponding image or video to be watermarked according to the content information and perform the watermark adding process. In a feasible implementation, the server can also send the content information to the watermark adding service, and the service program corresponding to the watermark adding service can obtain the image and watermark to perform the watermark adding process, and finally feed back the watermark adding result to the terminal device through the communication protocol.
[0078] In the contents described in ①-④ above, the computer device can obtain the first image based on any one of the images, image addresses, videos, video addresses, etc., and supports diversified inputs in the first service interface. This can greatly enrich the methods of obtaining the first image and expand the ways of obtaining the first image.
[0079] In one implementation, the watermark indication information includes a reference watermark, which refers to a watermark to be used when performing watermark addition processing. Schematically, the reference watermark can be a digital watermark that can be added to the first image. The reference watermark is, for example, a text pattern, a floral pattern, etc., which is not limited in this application. The specific implementation of the computer device obtaining the watermark indication information configured in the first service interface includes any of the following ⑤-⑦:
[0080] ⑤ Obtain the reference watermark entered in the first service interface. The first service interface may include watermark configuration items, such as Figure 3a The watermark input button marked as 301 in the first service interface is shown. Through the watermark configuration item, an image can be selected from the local or cloud as a reference watermark. In this way, the user can input any combination of one or more of text and image as a reference watermark.
[0081] ⑥ Display the watermark list in the first service interface, and obtain the watermark selected in the watermark list as a reference watermark. In a feasible implementation, the watermark list can be displayed in the first service interface in the form of a floating window, and the watermark list includes multiple watermarks arranged in order. When any watermark is confirmed to be selected, the computer device can use the selected watermark as a reference watermark. Each watermark has a watermark identifier, and the watermark list can also include a watermark identifier. The identifier of the selected watermark can be added to the watermark indication information so that the computer device can obtain the reference watermark based on the identifier. For example, Figure 3b The schematic diagram of displaying the watermark list is shown in FIG. Figure 3a When the watermark configuration item 303 in is clicked, the following may be displayed in the first service interface: Figure 3b The watermark list 320 shown includes multiple watermarks and each watermark has a corresponding check item, so that when the check item is clicked, it indicates that the corresponding watermark is selected.
[0082] By providing a watermark list for users to select watermarks, the reference watermark can be selected from the watermarks provided by the system, and these watermarks may have been selected when adding watermarks to other images before. The relevant information (such as the scrambled watermark matrix) can be directly obtained later to complete the watermark addition, thereby improving the processing efficiency to a certain extent.
[0083] ⑦ Display watermark components in the first service interface, and obtain a reference watermark formed by one or more watermark components. Watermark components refer to the elements that constitute the watermark, which can be specifically provided by the service program. The watermark components include but are not limited to: patterns, colors, backgrounds, signatures, etc. Among them, the signature can be used to identify the copyright to which the object (such as a video) to which the watermark is added belongs. The signature is an identity identifier, such as a user ID. Exemplarily, if user A records a game video in which he participates, the watermark added to the game video may include a user ID, thereby indicating that the production copyright of the game video belongs to user A. The watermark components can be displayed based on the triggering of the custom watermark button in the first service interface, or they can be displayed directly following the display of the first service interface. The watermark components can be displayed in a fixed area in the first service interface, or in a floating window. Schematically, as Figure 3c The schematic diagram of the components of the watermark is shown in FIG. Figure 3c After the custom watermark control 320 in the first service interface shown in (1) is checked, the following may be displayed: Figure 3c The watermark components are shown in (2) in the figure, and the watermark components are displayed in the floating window 321, including various patterns, characters and signatures in various forms.
[0084] In a feasible implementation, L (an integer greater than 0) watermark components may be displayed in the first service interface, and at least one watermark component may be selected from the L watermark components to generate a reference watermark. When multiple watermark components are selected, the combination of the multiple watermark components may also be provided to the user for specification. The combination includes, but is not limited to, random superposition, sequential splicing, and intelligent combination, etc. This application is not limited here. By providing watermark components, the reference watermark can be customized for the user, thereby forming a personalized reference watermark, and the reference watermark has better recognition.
[0085] In the contents described in ⑤-⑦ above, the reference watermark includes text, image, or a combination of text and image. The computer device can directly input the reference watermark, or provide a watermark list for the user to choose, or provide watermark components for the user to customize the watermark, which can greatly enrich the way of obtaining the reference watermark and generate personalized watermarks. In addition, it should be noted that the serial numbers such as ①, ②, etc. in the embodiments of the present application do not necessarily constitute a restriction on the execution order. The contents represented by consecutive serial numbers are not necessarily related.
[0086] Furthermore, in one implementation, the watermark indication information also includes indication information of the target element; when the computer device obtains the watermark indication information configured in the first service interface, it can also specifically execute any of the following (1.1)-(1.5).
[0087] (1.1) Receive a watermark adding region set for a first image, and set the watermark adding region as indication information of a target element.
[0088] The watermark adding area is used to indicate the position information of the target element in the first image. The watermark adding area includes the target element, which can be a local image area of the first image. Since a reference watermark can be added to the local image area during the watermark adding process, the watermark adding area is also an image area that needs to include the reference watermark after the watermark adding process. If the target element refers to multiple elements in the first image, the watermark adding area can be used to indicate the position information of each element in the first image. The first service interface supports setting the watermark adding area. For example, Figure 4a As shown, after the computer device acquires the first image, the watermark adding area control 410 can be clicked to display the first image, and the image area containing the target element can be directly selected from the first image as the watermark adding area 411. The watermark adding area is represented by a coordinate range, and during the selection process, the coordinate range can be displayed in the watermark adding area in the first service interface.
[0089] (1.2) Displaying an element list of the first image in the first service interface, and setting an identifier of an element selected in the element list as indication information of the target element.
[0090] The element list of the first image includes the identifiers of each element in the first image. The identifier of the element can be the name of the element, the serial number of the element, the thumbnail of the element, etc. The first service interface may provide an element configuration item, which can be triggered to display the element list and then set the indication information of the target element. For example, the first image is a frame captured from a game video, then the elements in the first image include virtual game characters controlled by players, non-player characters, and buildings in the virtual game environment, etc. Then, click on Figure 4b The watermark adding element control 420 (element configuration item) shown in (1) can display the following Figure 4b The element list 421 of the first image shown in (2) in FIG. The element list includes the names of each virtual game character, the names of non-player characters, and the names of various buildings in the first image. In addition, the identifiers of each element in the element list can be displayed in a random arrangement or can be displayed in a classified manner according to the element type.
[0091] As a feasible implementation, the computer device can identify the first image, obtain the elements included in the first image, and then form an element list of the first image according to the identifiers of the elements. The identifier of each element in the element list supports being selected to indicate that the corresponding element is selected as the target element. The computer device can set the identifier of the selected element in the element list as the indication information of the target element. Exemplarily, the identifier of the selected element includes the names of three elements, then the three elements can be used as the indication information of the target element, so that the target element to be watermarked in the first image can be determined based on the indication information of the target element. In this way, by providing the element list of the first image for selection, the target element to be watermarked in the first image can be specified by the user, thereby realizing the personalized setting of the target element.
[0092] (1.3) Displaying a type list of elements of the first image in the first service interface, and setting the element type selected in the type list as indication information of the target element, wherein the selected element type is used to indicate the element type of the target element.
[0093] The type list of the elements of the first image includes one or more element types. The element type may be determined according to any one or more of the following criteria: the function of the element, the content of the element, and the object that controls the element. Each element type may have one or more elements. For example, Figure 4c Schematic diagram of the element type list shown. According to the different objects of controlling the elements, the displayed element type list 431 includes the virtual characters controlled by the player in the first image (referred to as player characters) and the virtual characters controlled by non-players (referred to as non-player characters). When any element type is confirmed to be selected, the computer device can set the selected element type as the indication information of the target element. Subsequently, the target element to be watermarked in the first image can be determined based on the indication information of the target element, and the target element includes all elements under the selected element type. By selecting the element type in the element type list, the indication information of the target element can be obtained, so as to realize the convenient setting of the element to be affected by the watermark addition.
[0094] (1.4) If the first image is a frame of an image in a video, a list of specific elements in the video is displayed in the first service interface, and an identifier of a specific element selected in the list of specific elements is set as indication information of the target element.
[0095] The video can be any video, for example: game video, live video, shopping sharing video and beauty video, etc. The specific element list includes one or more specific element identifiers, such as the name of the specific element, such as Figure 4dThe specific element list 440 is shown. The specific elements include elements whose frequency of appearance in the video is greater than a preset frequency threshold, wherein the frequency of appearance of the elements in the video can be determined based on the number of frames of the image occupied by the elements in each frame of the video. For example, the virtual game character S1 exists in 60 frames of the 120 frames of the video corresponding to the image, that is, the virtual game character S1 is included in all 60 frames, and the frequency of appearance of the virtual game character S1 is 60. By setting the identifier of the element with a higher frequency of appearance as the indication information of the target element, the target element includes the element with a higher frequency of appearance in the video, so that after the watermark is added, the video can contain more images with watermarks, thereby increasing the ability to resist geometric attacks.
[0096] (1.5) If the first image is a frame of an image in a game video, the identifier of the virtual game character in the first image is set as the indication information of the target element.
[0097] The game video may be any of the following: a live game video, a game match video, a game video obtained by recording the game process, a video obtained by processing the game video, etc., and this application does not limit this. In the game video, the existence of the virtual game character makes the game video have corresponding value, so the virtual character is a valuable element in the game video. Based on this, the computer device may set the identifier of the virtual character in the first image as the indication information of the target element. Based on the setting of the identifier of the virtual game character, a watermark may be added to the indicated virtual game character later, so as to better resist geometric attacks such as cropping. In one implementation, the computer device may first identify the virtual game character of the first image and display the corresponding identifier, and then use the identifier of the selected virtual game character as the indication information of the target element. In another implementation, the computer device may directly set the identifiers of all virtual game characters in the first image as the indication information of the target element, and in the subsequent processing process, the determined target element includes all virtual game characters in the first image.
[0098] Optionally, if there are elements in the first image whose number is greater than a threshold, the identification of the element can also be used as the indication information of the target element, so that after the watermark is added, a second image containing a corresponding number of watermarks is obtained, so that the number of watermarks in the second image increases, which can also resist geometric attacks to a certain extent.
[0099] In one implementation, the watermark indication information further includes adding method indication information; the adding method indication information can be used to indicate a specific method of adding the reference watermark to the target element. The adding method indication information includes at least one of the following (2.1)-(2.3).
[0100] (2.1) indicates the number of reference watermarks added to the target element.
[0101] The adding mode indication information includes information for indicating the number of reference watermarks added to the target element. If the number of target elements is 1, then the corresponding number of reference watermarks can be added to the target element based on the information. If the number of target elements is greater than 1, then the corresponding number of reference watermarks can be added to each target element based on the information. Exemplarily, if the number of reference watermarks added to the target element is 2 and the target element includes 2 elements, then 2 reference watermarks can be added to the 2 elements respectively based on the information, which can enhance the robustness of the watermark.
[0102] (2.2) If the number of target elements is greater than 1, it indicates that the same reference watermark is added to each target element, or it indicates that a different reference watermark is added to each target element.
[0103] The number of target elements is greater than 1, that is, the target element refers to multiple (that is, at least two) elements in the first image. The adding method indication information includes information for indicating that the same reference watermark is added to each target element. The watermark adding process is performed according to this information, and the reference watermarks of each target element in the second image finally obtained are the same. Alternatively, the adding method indication information includes information for indicating that a different reference watermark is added to each target element. The watermark adding process is performed according to this information, and the reference watermarks of each target element in the second image finally obtained are different. By setting the same or different reference watermarks for each element to be watermarked, the personalized watermark processing effect can be improved.
[0104] (2.3) If the number of target elements is greater than 1, and each target element belongs to one or more element types, it is indicated that the same reference watermark is added to the target elements of the same element type, and different reference watermarks are added to the target elements of different element types.
[0105] When the number of target elements is greater than 1, and the element types to which each target element belongs include one or more, the adding method indication information includes information for indicating that the same reference watermark is added to each target element, and information for adding different reference watermarks to target elements of different element types. Then, watermark adding processing is performed according to the information, so that target elements of the same element type in the first image have the same reference watermark after watermark addition, and target elements of different element types have different reference watermarks after watermark addition. Exemplarily, the virtual game character controlled by the player in the first image can be added with watermark character AA, while the virtual game character not controlled by the player can be added with watermark character TT. Adding different reference watermarks to target elements of different element types by indicating different reference watermarks through corresponding adding method indication information is also a personalized watermark addition, and target elements of different element types can be distinguished based on the added watermarks.
[0106] In one implementation, the content indicated by the adding method indication information shown in (2.1)-(2.3) above can be set through the watermark adding method configuration item provided in the first service interface. Figure 4e As shown, when the watermark adding mode control 450 is clicked, an interface 451 for selecting the adding mode can be triggered. In this interface, the number of watermarks to be added can be set, and the number of watermarks to be added can indicate the number of watermarks added to the target element. It can also be set to add the same or different watermarks. Further, the same or different watermarks can be combined with the setting of the added dimension. For example, if "same" is selected and "element" is selected as the added dimension, the same watermark can be added to different elements in the first image. If "different" is selected and "element type" is selected as the added dimension, different watermarks can be added to target elements of different element types in the first image.
[0107] S203, displaying a second image with a watermark, where the second image is obtained by adding a watermark to a target element of the first image based on the watermark indication information, where the target element refers to any one or more elements contained in the first image.
[0108] If the added reference watermark is a digital watermark, the second image is almost indistinguishable from the first image in visual presentation. That is, the elements contained in the first image are also contained in the second image. In terms of data dimension, the values of the pixels in the area where the watermark is added are different between the second image and the first image. This is specifically reflected in the fact that the pixels covered in the image area corresponding to the target element of the first image contain information representing the watermark, which can only be detected by watermark detection processing. After the target element of the first image is processed by watermarking, the first image containing the reference watermark can be obtained, and the first image containing the reference watermark is output as the result of the watermarking process, i.e., the second image.
[0109] In one implementation, the image address of the second image may be output, and the second image may be downloaded for display based on the image address of the second image, or the second image may be directly displayed.
[0110] The image processing method provided in the embodiment of the present application can display a first service interface, and the first service interface can provide configuration functions related to watermark addition, and supports configuration in the first service interface: the first image to be watermarked and the watermark indication information required for the watermark addition process, so as to better meet the personalized needs of watermark addition and enrich the way of watermark addition. The watermark indication information configured in the first service interface and the first image to be processed are obtained. Further, based on the watermark indication information, the target element of the first image is subjected to watermark addition process, so as to obtain a second image with a watermark, and the second image with a watermark can be displayed; the above-mentioned target element is any one or more elements contained in the first image. It can be seen that by adding a watermark to the target element contained in the first image, the target element of the first image can be provided with a watermark. The target element is one or more elements in the first image, which contain relatively valuable image content. By adding a watermark thereto, it can better resist the influence of geometric attacks and ensure the use value of the watermark.
[0111] In one embodiment, when the computer device performs watermarking processing on the target element of the first image based on the watermark indication information, it may specifically perform the following steps 11 to 13.
[0112] Step 11: extracting an added region image corresponding to the target element from the first image, where the added region image refers to a region image containing the target element.
[0113] The first image is the original image before the watermark is added. Compared with the first image, the image area covered by the added area image is a local image area in the first image, which contains the target element, so that the reference watermark added therein can play a corresponding protective role.
[0114] In one embodiment, when extracting the added area image corresponding to the target element from the first image, the computer device may specifically perform the following steps (11-1) to (11-2): Step (11-1) calls the target detection model to perform target detection processing on the first image to obtain a detection result. Step (11-2) determines the target element from the N elements, and extracts the added area image from the first image according to the position information of the target element in the first image.
[0115] The detection result obtained after the target detection processing includes N elements and the position information (box) corresponding to each element in the first image, where N is a positive integer. The N elements may refer to all elements detected based on the detection capability of the target detection model. The target detection model is a trained detection model. Schematically, the target detection model may be a deep improved model based on yolo (you only look once, a target detection model). Based on the yolo model, it only takes one glance to identify the category and position of objects in the image. The yolo model does not need to find the image area (region) where the target may exist in advance, but directly predicts the category and position of all elements in the image.
[0116] For the training of the target detection model, a supervised training method can be used. In the supervised training method, by giving a training image set and the category label and position label of the target element in each training image contained in the training image set, in the process of training the target detection model, based on the predicted category information and the given category label, as well as the predicted position information and the position label, the model parameters can be adjusted to learn the characteristics of elements of different element types. Based on the learning of the characteristics of various elements, more accurate detection can be performed in the model inference stage.
[0117] As a feasible implementation, the object detection model includes an encoder, a decoder, and a loss side. The structure and function of each part are introduced in detail below.
[0118] 1. Encoder
[0119] The encoder contains multiple coding layers, and the multiple coding layers are connected using a full cross-layer connection method, and the local cross-layer fusion mode is supported between the multiple coding layers.
[0120] Among them, the full cross-layer connection mode means that each coding layer is connected arbitrarily, not just adjacent coding layers. With the full cross-layer connection mode, cross-layer learning can be applied to the output of each coding layer to increase the utilization rate of image features, and cross-layer connections can speed up the flow of information between information, shorten the information path between low-level features and high-level features, thereby improving the learning efficiency of the target detection model. The local cross-layer fusion mode enables some coding layers in multiple coding layers to achieve the fusion of different layer coding results based on cross-layer connections.
[0121] Each encoding layer of the encoder is used to encode the first image to obtain an encoding result to extract the visual information of the first image. To ensure learning efficiency and reasoning efficiency, the encoding layer can use a shallow deep network to learn the visual information in the training image. In one implementation, the encoding layer can be a local fusion network based on CSPNet (Cross Stage PartialNetwork, a lightweight network). CSPNet is a cross-stage local network that can respect the variability of gradients by integrating feature maps at the beginning and end of the network stage. In order to reduce memory consumption, the encoding layer can also be an improved local fusion network of CSPNet. The improved local fusion network of CSPNet adopts a partial local cross-layer fusion method, and achieves a balance between processing accuracy and network parameter quantity by fusing the output of a small number of encoding layers, that is, while ensuring processing accuracy, the network parameters are reduced as much as possible to achieve more efficient calculation. It is understandable that the encoding layer can be other network structures, such as residual network ResNet, deep residual network DenseNet, convolutional neural network CNN, etc.
[0122] 2. Decoder
[0123] The decoder includes multiple decoding layers, and the multiple decoding layers are connected using a full cross-layer connection method; the decoder is used to fuse the encoding results of each encoding layer of the encoder to obtain a decoding result.
[0124] In one implementation, the decoder can be a spatial pyramid pooling structure. By using the spatial pyramid pooling structure, the size of the decoder output can be fixed, and different sizes of the same image can be used as input to obtain pooling features of the same dimension. It can be seen that fixed-size feature vectors can be extracted from multi-scale features based on the spatial pyramid. Through the full cross-layer connection between decoding layers, the flow of information can be accelerated, and the information path between the bottom-level features and the high-level features can be shortened to improve the learning efficiency of the network.
[0125] The decoder can fuse the encoding results output by different encoding layers to obtain a decoding result. The decoding result can be a feature vector representing the added area image, and the loss end can further process the decoding result to obtain the final detection result.
[0126] 3. Loss end
[0127] The loss end is used to predict the elements in the first image and the corresponding position information of the elements in the first image based on the decoding results of the decoder. The loss end can be used to predict the category information of the elements and the position information of the elements in the image during the model training stage, and then calculate the loss value based on the corresponding category label and position label, and adjust the model parameters based on the loss value, so as to learn the characteristics of elements of different element types during the training stage. In the model inference stage, the loss end can also predict the elements in the processed first image and the corresponding position information of the elements in the first image based on the decoding results output by the decoder, and use it as the final detection result.
[0128] Based on the cross-layer connection method used by the encoding layer and decoding layer in the target detection model, the target detection model can have a faster detection speed and higher detection accuracy. Based on the local cross-layer fusion mode, the model parameter quantity and prediction accuracy can be better balanced, thereby speeding up the calculation efficiency while ensuring the prediction accuracy.
[0129] Based on the above introduction to the structure and function of the target detection model, the target detection processing flow performed by the target detection model can be provided as follows: Figure 5a The example diagram shown. The first image is an input video frame, which can be input to the encoder of the target detection model, and then pass through the encoding layer for encoding processing to obtain the encoding result, and then the encoding result of the last encoding layer is input to the first decoding layer of the decoder, and then pass through the decoding layer for decoding processing, and output the decoding result, which then enters the loss end, and the loss end predicts the detection result of the video frame, including multiple elements existing in the video frame and the position information of each element.
[0130] Furthermore, after obtaining the detection result, if the watermark indication information includes indication information based on the target element, the computer device can determine the target element from the N elements based on the indication information of the target element. For example, if the indication information of the target element is the identifier of an element of a certain type of element, then the element of a certain type of element can be determined as the target element. The target element includes, but is not limited to: game icons, progress bars that identify the life value of heroes, virtual characters unique to the game, and the like. If the watermark indication information does not include indication information based on the target element, the computer device can determine all the N detected elements as target elements, or determine the target element according to a certain selection strategy, such as determining an element whose appearance frequency exceeds a preset frequency threshold as a target element. Since each element in the detection result corresponds to position information, the computer device can extract the area image containing the target element according to the position information of the target element in the first image, and use it as the added area image.
[0131] Step 12: Add a reference watermark to the added area image to obtain the target area image.
[0132] The target region image is a region image with a reference watermark relative to the added region image. In one implementation, when the computer device executes step 12, it may specifically execute the following steps (12-1) to (12-3).
[0133] Step (12-1) decomposes the added area image to obtain multiple sub-images of the added area image under different image channels.
[0134] The multiple sub-images include detail sub-images and approximation sub-images. When the computer device decomposes the added area image, it can decompose the image from three image channels respectively, so as to obtain detail sub-images and approximation sub-images corresponding to the added area image under three different image channels. Optionally, the three image channels used for decomposing the added area image can be image channels based on RGB color division, or can also be image channels determined by other methods, such as image channels divided by YUV color.
[0135] In the specific implementation of the decomposition process, the computer device may first preprocess the added area image to obtain the processed added area image, and then decompose the processed added area image. The preprocessing includes one or more of the color space transformation process and the image size adjustment process. The color space transformation process refers to transforming the added area image X from the first color space to the second color space, thereby obtaining the transformed added area image X, the first color space is the original color space where the added area image X is located, such as the RGB space, and the second color space is the transformed color space, such as the YUV space. Through the color space transformation process, the influence of the added watermark on the image texture can be reduced. The image size adjustment process refers to resizing the extracted added area image X to obtain the adjusted added area image X, for example, by adjusting the image size to obtain the target area image with an image size of H*H. Through the image size adjustment process, the image size can be regularized, thereby facilitating the improvement of the efficiency of the watermark adding process.
[0136] If the preprocessing only includes the color space transformation process, the transformed added region image X can be used as the processed added region image X, and the decomposition process is performed on this basis. If the preprocessing only includes the image size adjustment process, the adjusted added region image X can be used as the processed added region image X, and the decomposition process is performed on this basis. If the preprocessing includes the color space transformation process and the image size adjustment process, optionally, the added region image can be firstly subjected to the image size adjustment process to obtain the adjusted added region image X, and then the adjusted added region image X can be transformed from the first color space to the second color space to obtain the transformed region image, and then the transformed region image can be used as the processed added region image, and the decomposition process is performed on this basis.
[0137] As a feasible method, the computer device can use a first-level discrete wavelet transform (DWT) to decompose the added area image. DWT processing refers to the wavelet transform that uses scaling and translation on a specific subset. It is a signal processing method that has multi-resolution capabilities in both time domain and frequency domain. Among them, the frequency domain refers to the frequency of the image, which is an indicator used to characterize the intensity of grayscale changes in the image, and is the gradient of grayscale in the plane space. The added area image is processed by a first-level DWT, and the wavelet domain of the added area image is divided into four sub-bands. Each sub-band contains not only the frequency domain component of the added area image, but also the corresponding spatial domain component.
[0138] After the added area image is processed by the first-level DWT, the main information of any image channel is concentrated in the LL subband (i.e., the approximation subimage), while the other subbands (i.e., the detail subimages) are the HL subband (i.e., the vertical detail subimage), the LH subband (the horizontal detail subimage), and the HH subband (the diagonal detail subimage). Figure 5a In the image marked by 51, the HL subband, LH subband and HH subband are not illustrated, but only used to indicate the existence of these three subbands (or detail sub-images) based on the first-level DWT processing. By performing the first-level DWT decomposition on the added area image, the detail sub-image after the wavelet transform corresponding to each image channel of the added area image X can be obtained. and approximation subgraph Among them, the approximation subgraph It is a base sub-image that restores the added area image, which retains the more important information in the added area image.
[0139] Exemplarily, the calculation method of performing a first-level DWT process on the added area image X to obtain the detail sub-image and the approximation sub-image in each image channel is as follows: Formula 1).
[0140]
[0141] Wherein, c represents each image channel corresponding to the added area image X, and a corresponding value thereof is used to indicate an image channel. For example, if the image channel is a YUV channel, then the value of c may be c=y, u, v. represents the detail sub-image under image channel c, represents the approximation sub-image under the image channel c. The approximation sub-image under each image channel is a low-frequency image under each image channel. For example, the YUV channel includes a Y channel low-frequency image, a U channel low-frequency image, and a V channel low-frequency image.
[0142] Step (12-2) uses a matching watermark adding rule to add a reference watermark to any one of the multiple sub-images of the added area image under each image channel, thereby obtaining a sub-image with a watermark added under each image channel.
[0143] The reference watermark can be a carrier of watermark information such as a character image input by the user as required, or it can be a digital watermark randomly configured by the computer device when the user does not specify a watermark. For each image channel, a sub-image can be selected to add a reference watermark, thereby obtaining a sub-image with a watermark added under each image channel.
[0144] In a feasible implementation, the computer device may first obtain the watermark matrix elements of the watermark matrix corresponding to the reference watermark. For obtaining the watermark matrix corresponding to the reference watermark, the specific implementation process is as follows: the computer device may first perform grayscale conversion processing on the reference watermark to obtain the grayscale image corresponding to the reference watermark, and then convert the grayscale image into a binary matrix W0 according to a preset threshold, wherein the matrix elements contained in the binary matrix W0 are 0 or 1. Optionally, the size of the binary matrix W0 may be adjusted to obtain a watermark matrix W that matches the size of the added area image processed by the decomposition process, for example: the binary matrix may be resized to obtain an H*H watermark matrix W, and the watermark matrix W is still a binary matrix, that is, the matrix elements only contain 0 and 1. Then, the watermark matrix W may be divided into blocks to obtain multiple matrix sub-blocks, each of which contains multiple matrix elements and can be used to represent a watermark sub-block. Exemplarily, it can be divided into n*n watermark sub-blocks in equal proportions. Then, multiple matrix sub-blocks are permuted to obtain a scrambled watermark matrix WL. When performing the scrambling process, the computer device may use a scrambling algorithm (such as the Arnold scrambling algorithm) to obtain a scrambled sub-block queue, which includes a plurality of matrix sub-blocks arranged in sequence, and then rearrange the matrix sub-blocks in the sub-block queue according to the new arrangement order, and then splice to obtain a scrambled watermark matrix WL, which can be used to represent the scrambled watermark. The matrix elements contained in the scrambled watermark matrix WL are used as watermark matrix elements. In another implementation, the watermark matrix corresponding to the reference watermark may not be decomposed and scrambled (which may be combined as a block reset process), and the values in the watermark matrix may be directly used to update the pixel values of the corresponding sub-image.
[0145] After completing the above preparations, the computer device can continue to obtain the watermark adding rules and watermark adding strength corresponding to the watermark matrix elements. Then, the matched watermark adding rules are used to update the added object according to the watermark adding strength to add the watermark to the added object. The added object here refers to the image matrix element in the image matrix corresponding to the sub-image to be watermarked. Since the image matrix and the watermark matrix are of the same size, the image matrix element is a value in the same position as the watermark matrix element and in the image matrix.
[0146] The computer device may obtain the watermark adding strength α from the watermark indication information. The calculation principle of the watermark adding strength may be shown in the following formula 2).
[0147]
[0148] Among them, int guarantees that the result is an integer, λ 1 is the first hyperparameter, λ 2is the second hyperparameter; mean means the mean operation, TanH is the activation function, abs means the absolute value, ⊙ means the dot multiplication of the corresponding values of the vector, Indicates adding an object.
[0149] The matched watermark adding rule may be the first adding processing rule or the second adding processing rule, which may be determined based on the value in the scrambled watermark matrix WL. Further, under the matched watermark adding processing rule, the computer device may update the value of the pixel in the corresponding sub-image according to the watermark adding strength, thereby adding the reference watermark to the approximation sub-image. Or detail sub-image For example, taking the reference watermark added to the approximation sub-image as an example, the definition of the watermark adding process can be shown in the following formula 3).
[0150]
[0151] in, represents the value of the i-th pixel in the approximation sub-image after adding the watermark corresponding to the image channel c, α represents the watermark adding strength, Indicates the first added processing rule, Indicates the second addition processing rule, / / indicates integer division to return the largest integer not greater than the result. i Represents the watermark information added to the pixel at the corresponding position, such as the value in the scrambled watermark matrix, and i represents the position of the corresponding watermark matrix element. Since the scrambled watermark matrix WL and the image matrix corresponding to the sub-image are matched in size, for example, the size is H*H. Therefore, the above two watermark addition processing rules can be used according to the 0 or 1 represented in the scrambled watermark matrix WL to complete the update of each pixel in the approximation sub-image, so as to add the reference watermark to the approximation sub-image. For the above process, please refer to Figure 5b The schematic diagram of watermark adding process is shown in FIG. 53 is an image block in the approximation sub-image, which may include one or more pixels; the image marked by 500 is a second image obtained after adding the digital watermark. The second image includes the watermark.
[0152] The above process of adding the reference watermark to the approximation sub-image of each image channel can realize the parity remainder correction of the three-channel low-frequency image values. It is understandable that if the reference watermark needs to be added to the detail sub-image, the computer device can also follow the similar process. For the detail sub-image under any image channel, the watermark addition processing rule matched by the scrambled watermark matrix can be used to add the detail sub-image according to the watermark addition strength. The value of the pixel at the corresponding position in is updated to complete the watermarking process, thereby obtaining the detail sub-image after the watermark is added.
[0153] Step (12-3) performs fusion processing on the sub-images with watermarks added and the sub-images without watermarks added in each image channel to obtain the target area image.
[0154] If the sub-image with watermark is the approximation sub-image after watermarking, and the sub-image without watermarking is the detail sub-image, then the approximation sub-image after watermarking and the detail sub-image without watermarking under each image channel can be fused to obtain the target region image, which is the region image after watermarking and is the region image with watermarking. Exemplarily, the fusion process can be implemented by using inverse wavelet transform, which can be specifically executed according to the definition of the following formula 4).
[0155]
[0156] Among them, X′ represents the area image with watermark added, IDWT represents the inverse wavelet transform processing, represents the approximation sub-image after adding the watermark, represents the detail sub-image without watermark, c represents each image channel corresponding to the added area image X, and a corresponding value is used to indicate an image channel. For example, if the image channel is a YUV channel, the value of c can be c=y,u,v.
[0157] In one implementation, if the decomposition is directly based on the added region image X, then the watermarked region image X′ obtained here is used as the target region image. In another implementation, if the added region image X is preprocessed and then decomposed, then after the watermarked region image X′ is obtained by inverse wavelet transform, it is necessary to perform inverse preprocessing to obtain the target region image. Exemplarily, during preprocessing, the size of the added region image is adjusted and transformed from RGB space to YUV space. Then, after inverse wavelet transform processing, it is obtained that X′ needs to be converted from YUV space to RGB space, and X′ is inversely resized to finally obtain the target region image, and the target region image has the same image size as the added region image, so that the added region image can be replaced later to obtain a new image with a watermark.
[0158] Step 13: Use the target area image to replace the added area image in the first image to obtain a second image.
[0159] After obtaining the target area image, the target area image can be used to replace the added area image in the first image, so that the area image originally containing the target element is transformed into an area image with a watermark, while the image content of other areas in the first image remains unchanged, thereby obtaining a second image with a watermark.
[0160] It is understandable that if there are multiple target elements in the first image, for each target element corresponding to the added area image, the corresponding target area image can be obtained in the above manner, and then the target area image is used to replace the corresponding added area image, and finally a second image with a watermark is obtained.
[0161] In the watermark adding process shown in the above steps 11 to 13, the following can be provided: Figure 5c The flowchart of watermark adding is shown in FIG. Taking the first image (i.e., the original image frame) as the game image as an example, by extracting the target image area (corresponding to the added area image), and then sequentially undergoing YUV channel transformation and discrete wavelet transformation, the low-frequency image under each channel can be obtained. In this regard, the reference watermark (such as the watermark pattern) can be sequentially binarized, scaled, and reset in blocks to obtain the scrambled watermark. Combined with the scrambled watermark, the three-channel low-frequency image values can be corrected with the same remainder (the specific implementation of adding the reference watermark) to obtain the updated low-frequency image, which is then subjected to an inverse discrete wavelet transform to obtain the image area containing the watermark, and then the image area containing the watermark can be used to replace the target image area in the original image, and finally the second image (i.e., the watermarked image frame) is obtained.
[0162] In the above process, a reference watermark can be added to any sub-image obtained by decomposing the extracted added image area, and the reference watermark can be scrambled and added to the sub-image to achieve watermarking of the target element of the first image. The overall complexity is low, the robustness of the watermark can be enhanced, and the balance between the speed of watermarking and the robustness of watermarking can be ensured. The use of digital watermarks for watermarking can ensure that the visual effect of the first image is not affected before and after the watermark is added. Since the target element is a more valuable content in the image (such as a conventional logo, an indispensable character), adding a watermark to the target element in the first image can better resist geometric attacks and ensure the amount and position of the watermark in the video, which is conducive to detecting the watermark information in the video to ensure a better application of digital watermarks in the video.
[0163] If the detection result includes the target element and its position information, then the detection result indicates that the detection target exists in the first image, that is, the target element can be detected in the first image. Exemplarily, the first image is an image frame in a game video, and the detection target is hero character A in the game video. Then, after the target detection process, the detection result of the image frame includes the category of each hero character and the position of each hero character in the image frame. If the detection result includes hero character A, then the detection result indicates that the detection target exists. In the case of the presence of a detection target, the watermarking of the target element can be achieved by following the watermarking process described in steps 11-13 above. In the case of the absence of a detection target, in order to ensure the effect of watermarking, other methods of watermarking can be considered.
[0164] In one implementation, the first image is any frame image in the game video; the watermark indication information also includes interval indication information, and the interval indication information is used to indicate the time interval for adding watermarks in the game video. The computer device can obtain the image frame to be watermarked in the game video as the first image according to the time interval indicated by the interval indication information. Exemplarily, the watermark interval information is 1 second, which means that a watermark needs to be added to the video every 1 second. If the frame rate of the video is 30fps, then at least one image frame can be randomly obtained from 30 frames per second as the image frame to be watermarked. The image frame obtained from the video can also be called a video frame. The interval indication information can be used to add watermarks to the specified image frames in the game video without adding watermarks to each image frame. When there are many image frames in the game video, the watermark adding speed can be increased, so as to quickly feedback the watermark adding results to the user, improve the user experience, and also improve the popularity of the use of the watermark adding capability. If the target element is not detected in the first image, it means that the target element does not exist in the N elements included in the detection result, and the reference watermark cannot be added to the required element. Then the computer device can also execute any one of the following (1)-(2).
[0165] (1) A reference watermark will be added in the entire image area of the first image.
[0166] Here, the reference watermark can be added to the entire first image, for example, the reference watermark is added to cover the entire first image. Even if there is a geometric attack such as cropping, the reference watermark can be restored by corresponding technical means to have a better protection effect.
[0167] (2) Determine the time period corresponding to the watermark adding time interval to which the first image belongs, and reselect a frame of image within the time period from the game video to determine it as a new first image.
[0168] Since the first image is determined based on the interval indication information, the time of the game video can be divided into multiple time periods according to the adding time interval indicated by the interval indication information. The time period corresponding to the watermark adding time interval to which the first image belongs in the game video can be described by data in the time (such as seconds) dimension or the image frame number dimension. Exemplarily, the interval indication information is 1 second, indicating that a frame of image is selected from the video for watermarking every 1 second. The video duration of the game video is 10 seconds, and the frame rate is 60fps (i.e., 60 frames of image per second), then a frame of image can be selected from the 1st second as the first image. If there is no target element in the first image, it can be determined that the first image belongs to the first watermark adding time interval, and then the corresponding time period is determined to be 0-1 seconds. Then, a frame of image can be reselected from the 60 frames of image corresponding to 0-1 seconds, for example, an image adjacent to the previous first image, or an image with a preset number of frames interval, as a new first image, and the computer device can perform watermarking according to the steps described in S201-S203.
[0169] It can be seen that if the detection result indicates that there is no detection target in the first image, the computer device will add the watermark to the entire image area of the first image, or reselect an image frame in the video and repeat the above detection processing steps, thereby ensuring that when the originally specified image frame in the game video cannot be watermarked, the image of the adjacent frame is selected for watermarking, ensuring that the number of frames of the image with the watermark added in the game video is in line with expectations, thereby ensuring the robustness of the watermarking of the game video.
[0170] See also Figure 6 , is a flowchart of another image processing method provided by an exemplary embodiment of the present application. The image processing method can be performed by a computer device (such as Figure 1a The image processing method may be executed by the computer device 102 in the system shown in the figure, and may include the following steps S601-S603.
[0171] S601, displaying a second service interface.
[0172] The second service interface refers to any interface provided by the service program for performing watermark detection. As a feasible implementation, the service program for performing watermark addition and the service program for performing watermark detection are the same service program, or they are different service programs. If they are the same service program, one service program may integrate the functions of watermark addition and watermark detection. If they are different service programs, the two service programs may have different functions, for example: service program AP1 has the function of watermark addition, and service program AP2 has the function of watermark detection. When the service program performs watermark addition, a digital watermark may be added to the target element in the first image according to the steps shown in S201-S203 above. When the service program performs watermark detection, the watermark present in the second image may be detected according to the steps shown in S601-S603 in this embodiment.
[0173] The service program includes any one of an offline service program and an online service program. If the service program is an online service program, then the service program provides online services (such as one or more of online watermark adding services and online watermark detection services), and the service program can be deployed on the server side. The online service program can process service requests from multiple terminal devices, and then process the data carried by the corresponding service requests, such as performing watermark detection processing on the second image carried by the watermark detection request. If the service program is an offline service program, then the service program provides offline services, the service program is deployed locally on a computer device (such as a terminal device), and watermark adding / watermark detection can be implemented locally on the computer device.
[0174] The computer device displays a second service interface, which can provide a setting function for multimedia data that needs to be watermarked. Figure 7a The second service interface shown. The second service interface 710 includes a file configuration item 701, an address configuration item 702, and a watermark configuration item 703. The file configuration item 701 can be used to upload the image or video to be detected, the address configuration item 702 can be used to obtain the address of the image or video file, and the watermark configuration item 703 can be used to upload the watermark for comparison or directly select from the watermarks provided by the detection system. Then triggering the "Start Detection" control can obtain the detection information and start the watermark detection process.
[0175] S602: Acquire detection information set in the second service interface, where the detection information includes a second image.
[0176] The computer device may receive the second image input in the second service interface to obtain the second image; or, receive the image address of the second image input in the second service interface, and obtain the second image based on the image address of the second image; or, receive a video (or video address) input in the second service interface, the video (or the video corresponding to the video address) contains the second image, and the second image can be obtained from the video. In one implementation, after the computer device performs watermark adding processing to obtain the second image, it can provide a second service interface to perform watermark detection on the second image. Optionally, the detection information may also include a reference watermark so that the subsequently detected watermark can be compared with it to determine whether it is an image or video containing a reference watermark.
[0177] S603, displaying the watermark detected from the second image, where the detected watermark is obtained by performing watermark detection processing on a target element in the second image.
[0178] In one embodiment, before executing S603, the computer device may further: calculate the similarity between the detected watermark and the reference watermark; if the similarity is greater than or equal to a preset similarity threshold, then execute step S603. The similarity can be used to reflect the similarity between the detected watermark and the reference watermark added in the watermark adding process. The detected watermark and the reference watermark each correspond to a watermark matrix, and the similarity between the detected watermark and the reference watermark can be calculated based on the values of the two watermark matrices at the same position. In one implementation, the similarity can be a grayscale similarity calculated based on the grayscale value, and the preset similarity threshold can be a grayscale threshold. When the similarity is greater than the preset similarity threshold, it can be determined that the detected watermark and the reference watermark are relatively similar, and then it can be determined that the detected watermark is the reference watermark used in the watermark adding process, and the detected watermark is displayed. If the similarity is less than the preset similarity threshold, it means that the detected watermark is quite different from the reference watermark, then the computer device may not display the watermark, but output the similarity between the two. In another embodiment, no matter whether the similarity between the two exceeds a preset similarity threshold, the detected watermark can be displayed, thereby returning the detected watermark to the user to confirm whether it is the added reference watermark.
[0179] In one embodiment, the computer device can display a reference watermark together with the watermark detected from the second image. In this way, the detected watermark and the reference watermark can be displayed together to give the user a more intuitive comparison experience. Furthermore, through the display of the detected watermark and the reference watermark, the user can also independently confirm whether the watermark detected from the second image is the added reference watermark. Among them, the joint display method includes one or more of the following ①-③: ① Display the detected watermark and the reference watermark in the same or different interfaces. For example, the detected watermark and the reference watermark can be displayed in different areas of the second service interface, or the detected watermark and the reference watermark can be displayed in different interfaces, and the two interfaces can be switched between each other. Figure 7b As shown, the detected watermark is displayed in interface 720, and the reference watermark is displayed in interface 721, and the two interfaces can be switched to display different watermarks. ② The detected watermark and the reference watermark are displayed for comparison. Specifically, the detected watermark and the reference watermark can be placed in the same interface for comparison. ③ The detected watermark and the reference watermark are presented at the same time, and the similarity between the detected watermark and the reference watermark is displayed. The similarity can be a percentage value. The higher the similarity, the more similar the two watermarks are, that is, the probability that the detected watermark is the reference watermark is higher. For example, Figure 7c Schematic diagram of joint display shown. When the computer device compares and displays the detected watermark and the reference watermark, it also shows that the similarity between the two is 95%. The similarity data can more intuitively show the judgment result of the computer device on the detected watermark and the reference watermark. In addition, the similarity can also be used to maintain and appeal the copyright of the second image or the video to which the second image belongs.
[0180] The contents described in ① to ③ above can enrich the joint display mode between the detected watermark and the reference watermark. Furthermore, the joint display between the detected watermark and the reference watermark can make the detection result more intuitive.
[0181] It should be noted that, according to the content described in S601-403 above, any image or video can also be processed for watermark detection to obtain the watermark detection result, which can be used to indicate whether the detected image or video contains a watermark. Furthermore, if the watermark contains a signature, the detected image or video can be traced back according to the watermark to find out the copyright object to which the image or video belongs. In addition, the detection information contains the watermark for comparison, and the computer device can also obtain the watermark in the detection information based on the second service interface, and then calculate the similarity between the watermark used for the comparison and the detected watermark.
[0182] The image processing method provided in the embodiment of the present application can display a second service interface, and the second interface supports the configuration of the information required for detection, including: the image to be detected, and can also include a watermark for reference comparison. Further, the detection information configured in the second service interface can be obtained, and the target element of the second image contained therein can be watermark detected, the detected watermark can be obtained, and the detected watermark can be displayed. It can be seen that through the watermark detection process, on the one hand, for the image that has been processed by adding watermarks, it can be determined whether the watermark is successfully added. On the other hand, for any image or video, it is also possible to perform watermark detection on the target element in the corresponding image and quickly obtain the watermark detection result, which can be used to indicate whether it contains a watermark for reference comparison. Furthermore, based on the detected watermark, the copyright of the image / video can also be traced back, thereby achieving better protection for multimedia data such as images / videos.
[0183] Illustratively, the reference watermark added in the embodiment of the present application is a digital watermark, so the watermark detection process mentioned in the embodiment of the present application is also the detection of the digital watermark. In one embodiment, when the computer device performs watermark detection on the target element of the second image, the following steps 21-22 can be specifically performed.
[0184] Step 21: extracting a detection area image corresponding to the target element from the second image, where the detection area image refers to an area image containing the target element.
[0185] If the target element includes one element, the computer device may extract a region image including the target element; if the target element includes multiple elements, the computer device may extract multiple detection region images, each detection region image including one element.
[0186] In one embodiment, the computer device extracts the detection area image corresponding to the target element from the second image in the following manner: the second image is subjected to target detection processing to obtain the target element and the position information of the target element, and then the detection area image is extracted from the second image based on the position information of the target element. As a feasible implementation method, the computer device may call the target detection model to perform target detection processing on the second image to obtain a detection result, which includes N elements and the position information of each element. Then, the target element may be determined from the N elements. For details of this process, please refer to the aforementioned description of the watermarking process for the first image, which will not be described in detail here.
[0187] Step 22: Perform watermark detection on the detection area image.
[0188] In a feasible implementation, when the computer device performs watermark detection processing on the detection area image, it can specifically execute the following steps (22-1) to (22-3).
[0189] Step (22-1) decomposes the detection area image to obtain multiple sub-images of the detection area image under different image channels.
[0190] When the detection area image is decomposed, the detection area image can also be preprocessed, and the preprocessing includes: one or more of image resizing and color space transformation. Exemplarily, the detection area image can be resized to obtain an H*H image area X, and then the image area X is converted from the RGB space to the YUV space, so that adding a watermark can reduce the impact on the image texture. Then, the converted image area X is decomposed into a first-level DWT to obtain the detail sub-image and approximation sub-image of the image area after the wavelet transform under each image channel. For details, please refer to the above formula 1), that is, by substituting the detection area image or the preprocessed detection area image into the above formula 1), the detail sub-image and approximation sub-image of the detection area image under different image channels can be obtained.
[0191] Step (22-2) uses the matched detection rules to perform watermark detection on multiple sub-images of the detection area image in each image channel to obtain watermark information.
[0192] The computer device adopts corresponding detection rules to perform watermark detection processing on the detail sub-image and the approximation sub-image under each image channel, and obtains the watermark information representing the watermark in the corresponding sub-image. In another implementation, the processed sub-image can be marked during the watermark adding process, and then the watermark detection can be directly performed on the corresponding sub-image according to the mark during the watermark detection process.
[0193] In one implementation, the computer device may first determine the detection object currently performing watermark detection from the sub-graph, and obtain the watermark adding strength used when adding the watermark. Then, the matched detection rule is used to perform watermark detection on the sub-graph containing the watermark based on the watermark adding strength and the detection object to obtain watermark information. The matched detection rule includes a first detection rule and a second detection rule, and whether the match is determined based on the comparison result between the sub-graph containing the watermark and the calculated value of the watermark adding strength and the preset value.
[0194] Exemplarily, the sub-image containing the watermark is an approximation sub-image of the detection area image under each image channel. The computer device can perform watermark detection processing on the approximation sub-image. In a specific implementation, the watermark information in the approximation sub-image can be determined according to the definition shown in the following formula 5).
[0195]
[0196] Among them, WL i Represents the value of the pixel at the ith position in the watermark matrix, represents the value of the approximation sub-image of the image channel c at the i-th pixel, and α represents the watermarking strength. represents the first detection rule, represents the second detection rule. Wherein, % represents the remainder operation. It can be understood that the process calculated according to the above formula 5) can also be understood as the process of remaindering the image values of the three-channel low-frequency image.
[0197] After the above formula (4), a complete watermark matrix WL can be obtained, and then the watermark matrix can be divided into blocks to obtain multiple matrix sub-blocks. A matrix sub-block contains some matrix elements in the watermark matrix, and each matrix sub-block represents a watermark sub-block. For example: the H*H watermark matrix WL is divided into n*n matrix sub-blocks in equal proportion to indicate that the watermark is divided into n*n watermark sub-blocks. Then, multiple matrix sub-blocks are inversely scrambled to obtain the inversely scrambled watermark matrix. In a specific implementation, an inverse scrambling algorithm (such as the Arnold scrambling inverse algorithm for the n*n watermark sub-block) can be used for inverse scrambling to obtain an inversely scrambled sub-block queue, which contains matrix sub-blocks arranged in order. Arrange them according to the new arrangement order to obtain the inversely scrambled watermark matrix W. The inversely scrambled watermark matrix is the watermark information. It can be seen that in this process, the processing of the reference watermark in watermark detection and watermark addition is inverse.
[0198] Step (22-3) performs watermark restoration processing according to the watermark information to obtain the watermark contained in the detection area image.
[0199] Since the watermark is converted into grayscale to obtain a binary watermark matrix during the watermark adding process, the watermark matrix W after inverse scrambling here is a binary watermark matrix. The watermark matrix is then converted to the image space to obtain the final watermark matrix. A watermark can be generated based on the watermark matrix, and the watermark can be visually presented in the form of an image.
[0200] If the first image is an image frame in the video to be detected, then the probability of whether the video has a watermark can be obtained, and the probability can be determined based on the similarity. A higher probability indicates that the possibility of a watermark is greater, and a lower probability indicates that the possibility of a watermark is less. The watermark detection result can be used for its own copyright dimension and appeal.
[0201] In a feasible implementation, a detection area image corresponding to each element can be extracted from the second image, and a detection area image corresponding to one element contains one element. Watermark detection processing can be performed on each detection area image to determine the detection area image to which the watermark has been added, and finally the watermark in the corresponding detection area image can be extracted.
[0202] After the contents shown in the above steps (22-1) to (22-3), the following can be provided: Figure 7d Schematic diagram of the watermark detection process shown. Exemplarily, for the image frame to be detected, the target image area (corresponding to the detection area image) can be extracted, and the target image area can be transformed to obtain the low-frequency image under each image channel, and then the image numerical remainder calculation is performed on the low-frequency image of each image channel to obtain the watermark information contained in the low-frequency image, and then the watermarks are merged and reversely reset in blocks, and finally the watermark is detected. Furthermore, the grayscale similarity between the detected watermark and the reference watermark (such as the watermark pattern) can be calculated, and then compared with the grayscale threshold to determine whether the detected image frame is a watermark frame (i.e., an image containing a watermark).
[0203] It can be seen that by performing watermark detection processing on the image frames in the image / video, it is possible to determine whether the multimedia data contains a watermark. In the specific watermark detection processing process, the image can be subjected to target detection processing to extract the target image area, so that the target image area can be used as the processing object for transformation, watermark information extraction and other processing, thereby quickly detecting the watermark contained therein. The detected watermark can be compared with the reference watermark for similarity, thereby determining whether the image to be detected is an image containing the reference watermark.
[0204] Combined with the above Figure 2 and Figure 6 In the embodiment described, the computer device can provide two levels of experience flow for the corresponding user:
[0205] First, the user provides the video address to be digitally watermarked, the reference watermark to be added, and the watermark adding interval, and writes the path of the video file and other corresponding fields into the script. Then, the computer device only needs to start the script, and the video address, the digital watermark to be added, and the watermark adding interval can be directly sent to the online watermark adding service, and finally the calculated video watermark adding result address is fed back to the user through the http protocol. The http protocol refers to the Hyper Text Transfer Protocol, which is a transmission protocol used to transmit hypertext from the World Wide Web server to the local browser.
[0206] Secondly, the user provides the video address of the watermark to be detected and the reference watermark to be detected, and the computer device can write the two pieces of information into the corresponding fields of the script. Then, you only need to start the script, and the computer device can directly send the video address and the reference watermark to be detected to the online watermark detection service, and finally feedback the matching degree between the detection result and the watermark to the user through the http protocol.
[0207] Finally, users can obtain the watermarked video and the probability of the reference watermark existing in the video to be detected according to their needs. After obtaining the watermarked video, users can directly use it as a finished film for their own needs and share it on other platforms. The watermark detection results can also be used for copyright maintenance and complaints. The service supports watermarking and detection of general game videos, with low computing power requirements and fast computing without GPU (graphics processing unit), meeting the needs of adding and detecting in various scenarios.
[0208] It can be seen that the online watermarking service can provide the watermarking function and feedback the calculated watermarking result or the address of the watermarking result. The online watermark detection service can provide the watermark detection function and feedback the detection result.
[0209] The image processing method provided in this application can support watermark addition and watermark detection of various game videos (games with fixed icons). Figure 8 As shown in the flowchart of image processing, after obtaining the game video, the watermark adding model (providing watermark adding service) can be used to add watermark to the game video to obtain the watermarked game video. After the watermarked game video is edited, processed with special effects, etc., it can be published to the corresponding content platform. Furthermore, the computer device can obtain the video (for example, obtain the processed game video from multiple platforms), and then use the watermark detection model (providing watermark detection service) to perform watermark detection processing to obtain the watermark detection result. Then, based on the detection result, it can be determined whether the obtained video is a video containing a watermark, so that the source of the video material can be traced based on the watermark, and the detection result of the video can be counted in a list.
[0210] The above method was tested on several game videos according to user needs, and it can achieve good watermarking effect without affecting the fidelity of the video. In actual tests, the uncropped video has a recall rate of more than 80% after the attack, and the cropped video has a recall rate of more than 70% after the attack. It can be seen that it also has high robustness to resist geometric attacks such as cropping. It can be seen that the image processing method provided by the present application can realize fast digital watermark encryption of game videos that can resist cropping based on target detection, and can solve the problem of watermarking of game videos in a concealed, non-visually damaged, low-cost and efficient way. At the same time, it can also respond quickly based on ordinary computer equipment, and can realize real-time addition or detection of watermarks in videos.
[0211] Next, the image processing device provided in the embodiment of the present application is described.
[0212] See also Fig. 9 , Fig. 9 : is a schematic diagram of the structure of an image processing device provided by an exemplary embodiment of the present application. The above-mentioned image processing device can be a computer program (including program code) running on a computer device (such as a computer device in an image processing system). For example, the image processing device is an application software; the image processing device can be used to execute the corresponding steps of the image processing method provided by the embodiment of the present application. Fig. 9 As shown, the image processing device 900 includes: a display module 901, an acquisition module 902 and a processing module 903. Among them:
[0213] Display module 901, used to display the first service interface;
[0214] An acquisition module 902 is used to acquire the first image to be processed and the watermark indication information configured in the first service interface;
[0215] The display module 901 is also used to display a second image with a watermark, wherein the second image is obtained by adding a watermark to a target element of the first image based on the watermark indication information, and the target element refers to any one or more elements contained in the first image.
[0216] In one embodiment, the acquisition module 902 is specifically used to: acquire a first image input in the first service interface; or, acquire a first video imported in the first service interface, and extract a first image from the first video, where the first image is any frame image in the first video; or, acquire an image address input in the first service interface, and download the first image according to the image address; or, acquire a video address of a second video input in the first service interface, and extract a first image from the second video according to the video address, where the first image is any frame image in the second video.
[0217] In one embodiment, the watermark indication information includes a reference watermark; the acquisition module 902 is specifically used to: acquire the reference watermark input in the first service interface; or, display a watermark list in the first service interface, and acquire a watermark selected in the watermark list as a reference watermark; or, display watermark components in the first service interface, and acquire a reference watermark formed by a combination of one or more watermark components; wherein the reference watermark includes text, an image, or a combination of text and an image.
[0218] In one embodiment, the watermark indication information also includes indication information of the target element; the acquisition module 902 is specifically used to: receive a watermark adding area set for the first image, set the watermark adding area as the indication information of the target element, and the watermark adding area is used to indicate the position information of the target element in the first image; or, display an element list of the first image in the first service interface, and set the identifier of the element selected in the element list as the indication information of the target element; or, display a type list of elements of the first image in the first service interface, and set the element type selected in the type list as the indication information of the target element, and the selected element type is used to indicate the element type of the target element; or, if the first image is a frame image in a video, then display a specific element list in the video in the first service interface, and set the identifier of the specific element selected in the specific element list as the indication information of the target element; the specific element includes an element whose appearance frequency in the video is greater than a preset frequency threshold; or, if the first image is a frame image in a game video, then set the identifier of the virtual game character in the first image as the indication information of the target element.
[0219] In one embodiment, the watermark indication information also includes adding method indication information; the adding method indication information includes at least one of the following: indicating the number of reference watermarks added to the target element; if the number of target elements is greater than 1, indicating adding the same reference watermark to each target element; if the number of target elements is greater than 1, indicating adding a different reference watermark to each target element; if the number of target elements is greater than 1, and each target element belongs to one or more element types, indicating adding the same reference watermark to target elements of the same element type, and adding different reference watermarks to target elements of different element types.
[0220] In one embodiment, the display module 901 is also used to: display the second service interface; the acquisition module 902 is also used to: obtain the detection information set in the second service interface, the detection information includes the second image; the display module 901 is also used to: display the watermark detected from the second image, and the detected watermark is obtained by performing watermark detection processing on the target element in the second image.
[0221] In one embodiment, the processing module 903 is used to: calculate the similarity between the detected watermark and the reference watermark; if the similarity is greater than or equal to a preset similarity threshold, execute the step of displaying the watermark detected from the second image.
[0222] In one embodiment, the display module 901 is specifically used to: when displaying the watermark detected from the second image, jointly display the reference watermark; wherein: the joint display method includes any one or more of the following: displaying the detected watermark and the reference watermark in the same or different interfaces; comparing and displaying the detected watermark and the reference watermark; and presenting the detected watermark and the reference watermark at the same time, and displaying the similarity between the detected watermark and the reference watermark.
[0223] In one embodiment, the first service interface refers to any interface provided by a service program for performing watermark addition; the second service interface refers to any interface provided by a service program for performing watermark detection; the service program for performing watermark addition and the service program for performing watermark detection are the same service program, or different service programs; wherein the service program includes any one of an offline service program and an online service program.
[0224] In one embodiment, the watermark indication information includes a reference watermark; the processing module 903 is specifically used to: extract an added area image corresponding to the target element from the first image, the added area image refers to an area image containing the target element; add the reference watermark to the added area image to obtain the target area image; and replace the added area image in the first image with the target area image to obtain a second image.
[0225] In one embodiment, the processing module 903 is specifically used to: call the target detection model to perform target detection processing on the first image to obtain a detection result, the detection result includes N elements and the position information corresponding to each element in the first image; N is a positive integer; determine the target element from the N elements, and extract the target area image from the first image based on the position information of the target element in the first image.
[0226] In one embodiment, a target detection model includes an encoder, a decoder and a loss end; the encoder includes multiple coding layers, and the multiple coding layers are connected by a full cross-layer connection method, and the multiple coding layers support a local cross-layer fusion mode; each coding layer of the encoder is used to encode a first image to obtain a coding result to extract visual information of the first image; the decoder includes multiple decoding layers, and the multiple decoding layers are connected by a full cross-layer connection method; the decoder is used to fuse the coding results of each coding layer of the encoder to obtain a decoding result; the loss end is used to predict elements in the first image and corresponding position information of the elements in the first image based on the decoding results of the decoder.
[0227] In one embodiment, the processing module 903 is specifically used to: decompose the added area image to obtain multiple sub-images of the added area image in different image channels; use a matching watermark adding rule to add a reference watermark to any sub-image of the multiple sub-images of the added area image in each image channel to obtain a watermarked sub-image in each image channel; and perform fusion processing on the sub-images with watermarks and the sub-images without watermarks in each image channel to obtain a target area image.
[0228] In one embodiment, the first image is any frame image in a game video; the watermark indication information also includes interval indication information, and the interval indication information is used to indicate the time interval for adding a watermark in the game video; the processing module 903 is used to: if the target element is not detected in the first image, then add a reference watermark to the entire image area of the first image; or, if the target element is not detected in the first image, determine the time period corresponding to the time interval for adding the watermark to which the first image belongs, and reselect a frame image from the time period in the game video to determine it as a new first image.
[0229] In one embodiment, the processing module 903 is used to: extract a detection area image corresponding to the target element from the second image, where the detection area image refers to an area image containing the target element; and perform watermark detection processing on the detection area image.
[0230] In one embodiment, the processing module 903 is specifically used to: decompose the detection area image to obtain multiple sub-images of the detection area image under each image channel; use the matched detection rules to perform watermark detection on the multiple sub-images of the detection area image under each image channel to obtain watermark information; perform watermark restoration processing based on the watermark information to obtain the watermark contained in the detection area image.
[0231] It is understandable that the functions of the functional modules of the image processing device described in the embodiment of the present application can be specifically implemented according to the method in the above method embodiment, and the specific implementation process can refer to the relevant description of the above method embodiment, which will not be repeated here. In addition, the description of the beneficial effects of using the same method will not be repeated.
[0232] Next, the computer device provided in the embodiment of the present application is described.
[0233] See also Fig.10 , Fig.10 FIG. 1 is a schematic diagram of a computer device provided by an exemplary embodiment of the present application. In one embodiment, the computer device may be a terminal device. Fig.10As shown, the computer device 1000 may specifically include an input device 1001, an output device 1002, a processor 1003, a memory 1004, a network interface 1005 and at least one communication bus 1006. Among them: the processor 1003 may be a central processing unit (CPU). The processor may further include a hardware chip. The above-mentioned hardware chip may be an application-specific integrated circuit (ASIC), a programmable logic device (PLD), etc. The above-mentioned PLD may be a field programmable gate array (FPGA), a generic array logic (GAL), etc.
[0234] The memory 1004 may include a volatile memory (Volatile Memory), such as a random-access memory (Random-Access Memory, RAM); the memory 1004 may also include a non-volatile memory (Non-Volatile Memory), such as a flash memory (Flash Memory), a solid-state drive (SSD), etc.; the memory 1004 may be a high-speed RAM memory, or a non-volatile memory (Non-Volatile Memory), such as at least one disk memory. The memory 1004 may optionally be at least one storage device located away from the aforementioned processor 1003. The memory 1004 may also include a combination of the above-mentioned types of memories. Fig.10 As shown, the memory 1004 as a computer-readable storage medium may include an operating system, a network communication module, an interface module, and a device control application.
[0235] The network interface 1005 may include a standard wired interface and a wireless interface (such as a WI-FI interface). The network interface serves as a communication interface and can be used to provide data communication functions. The communication bus 1006 is responsible for connecting various communication elements. The input device 1001 receives instructions input by an object to generate signal input related to the object setting and function control of the computer device. In one embodiment, the input device 1001 includes but is not limited to one or more of a touch panel, a physical keyboard or a virtual keyboard (Keyboard), a function key, a mouse, etc. The output device 1002 is used to output data information. In the embodiment of the present application, the output device 1002 can be used to display the first service interface / the second service interface, display a watermark, etc. The output device 1002 may include a display screen (Display) or other display devices. The processor 1003 is the control center of the computer device. Various interfaces and lines connect various parts of the entire computer device. Various functions are executed by scheduling and running computer programs stored in the memory 1004.
[0236] Among them, the processor 1003 can be used to call the computer program in the memory 1004 to perform the following operations: display the first service interface; obtain the first image to be processed and the watermark indication information configured in the first service interface; display the second image with a watermark, wherein the second image is obtained after the watermark is added to the target element of the first image based on the watermark indication information, and the target element refers to any one or more elements contained in the first image.
[0237] In one embodiment, processor 1003 is specifically used to: obtain a first image input in a first service interface; or, obtain a first video imported in the first service interface, and extract a first image from the first video, where the first image is any frame image in the first video; or, obtain an image address input in the first service interface, and download the first image according to the image address; or, obtain a video address of a second video input in the first service interface, and extract a first image from the second video according to the video address, where the first image is any frame image in the second video.
[0238] In one embodiment, the watermark indication information includes a reference watermark; the processor 1003 is specifically used to: obtain the reference watermark input in the first service interface; or, display a watermark list in the first service interface, and obtain a watermark selected in the watermark list as a reference watermark; or, display watermark components in the first service interface, and obtain a reference watermark formed by a combination of one or more watermark components; wherein the reference watermark includes text, an image, or a combination of text and an image.
[0239] In one embodiment, the watermark indication information also includes indication information of the target element; the processor 1003 is specifically used to: receive a watermark adding area set for the first image, set the watermark adding area as the indication information of the target element, and the watermark adding area is used to indicate the position information of the target element in the first image; or, display an element list of the first image in the first service interface, and set the identifier of the element selected in the element list as the indication information of the target element; or, display a type list of elements of the first image in the first service interface, and set the element type selected in the type list as the indication information of the target element, and the selected element type is used to indicate the element type of the target element; or, if the first image is a frame image in a video, then display a specific element list in the video in the first service interface, and set the identifier of the specific element selected in the specific element list as the indication information of the target element; the specific element includes an element whose appearance frequency in the video is greater than a preset frequency threshold; or, if the first image is a frame image in a game video, then set the identifier of the virtual game character in the first image as the indication information of the target element.
[0240] In one embodiment, the watermark indication information also includes adding method indication information; the adding method indication information includes at least one of the following: indicating the number of reference watermarks added to the target element; if the number of target elements is greater than 1, indicating adding the same reference watermark to each target element; if the number of target elements is greater than 1, indicating adding a different reference watermark to each target element; if the number of target elements is greater than 1, and each target element belongs to one or more element types, indicating adding the same reference watermark to target elements of the same element type, and adding different reference watermarks to target elements of different element types.
[0241] In one embodiment, the processor 1003 is also used to: display a second service interface; obtain detection information set in the second service interface, the detection information includes a second image; display a watermark detected from the second image, and the detected watermark is obtained by performing watermark detection processing on a target element in the second image.
[0242] In one embodiment, the processor 1003 is configured to: calculate the similarity between the detected watermark and the reference watermark; and if the similarity is greater than or equal to a preset similarity threshold, execute the step of displaying the watermark detected from the second image.
[0243] In one embodiment, the processor 1003 is specifically used to: when displaying the watermark detected from the second image, jointly display the reference watermark; wherein: the joint display method includes any one or more of the following: displaying the detected watermark and the reference watermark in the same or different interfaces; comparing and displaying the detected watermark and the reference watermark; and presenting the detected watermark and the reference watermark at the same time, and displaying the similarity between the detected watermark and the reference watermark.
[0244] In one embodiment, the first service interface refers to any interface provided by a service program for performing watermark addition; the second service interface refers to any interface provided by a service program for performing watermark detection; the service program for performing watermark addition and the service program for performing watermark detection are the same service program, or different service programs; wherein the service program includes any one of an offline service program and an online service program.
[0245] In one embodiment, the watermark indication information includes a reference watermark; the processor 1003 is specifically used to: extract an added area image corresponding to the target element from the first image, the added area image refers to an area image containing the target element; add the reference watermark to the added area image to obtain the target area image; and replace the added area image in the first image with the target area image to obtain a second image.
[0246] In one embodiment, the processor 1003 is specifically used to: call the target detection model to perform target detection processing on the first image to obtain a detection result, the detection result includes N elements and the position information corresponding to each element in the first image; N is a positive integer; determine the target element from the N elements, and extract the target area image from the first image based on the position information of the target element in the first image.
[0247] In one embodiment, a target detection model includes an encoder, a decoder and a loss end; the encoder includes multiple coding layers, and the multiple coding layers are connected by a full cross-layer connection method, and the multiple coding layers support a local cross-layer fusion mode; each coding layer of the encoder is used to encode a first image to obtain a coding result to extract visual information of the first image; the decoder includes multiple decoding layers, and the multiple decoding layers are connected by a full cross-layer connection method; the decoder is used to fuse the coding results of each coding layer of the encoder to obtain a decoding result; the loss end is used to predict elements in the first image and corresponding position information of the elements in the first image based on the decoding results of the decoder.
[0248] In one embodiment, the processor 1003 is specifically used to: decompose the added area image to obtain multiple sub-images of the added area image in different image channels; use a matching watermark adding rule to add a reference watermark to any sub-image of the multiple sub-images of the added area image in each image channel to obtain a watermarked sub-image in each image channel; and perform fusion processing on the sub-images with watermarks and the sub-images without watermarks in each image channel to obtain a target area image.
[0249] In one embodiment, the first image is any frame image in a game video; the watermark indication information also includes interval indication information, and the interval indication information is used to indicate the time interval for adding a watermark in the game video; the processor 1003 is used to: if the target element is not detected in the first image, then add a reference watermark to the entire image area of the first image; or, if the target element is not detected in the first image, determine the time period corresponding to the time interval for adding a watermark to which the first image belongs, and reselect a frame image from the time period in the game video to determine it as a new first image.
[0250] In one embodiment, the processor 1003 is used to: extract a detection area image corresponding to the target element from the second image, where the detection area image refers to an area image containing the target element; and perform watermark detection processing on the detection area image.
[0251] In one embodiment, the processor 1003 is specifically used to: decompose the detection area image to obtain multiple sub-images of the detection area image under each image channel; use the matched detection rules to perform watermark detection on the multiple sub-images of the detection area image under each image channel to obtain watermark information; perform watermark restoration processing according to the watermark information to obtain the watermark contained in the detection area image.
[0252] It should be understood that the computer device 1000 described in the embodiment of the present application can execute the description of the image processing method in the above corresponding embodiment, and can also execute the above corresponding embodiment. Fig. 9 The description of the image processing device 900 in the corresponding embodiment will not be repeated here. In addition, the description of the beneficial effects of adopting the same method will not be repeated here either.
[0253] In addition, it should be noted that an exemplary embodiment of the present application also provides a storage medium, in which a computer program of the aforementioned image processing method is stored, and the computer program includes program instructions. When one or more processors load and execute the program instructions, the description of the image processing method in the embodiment can be implemented, which will not be repeated here, and the description of the beneficial effects of using the same method will not be repeated here. It is understandable that the program instructions can be deployed on one or multiple computer devices that can communicate with each other for execution.
[0254] The computer-readable storage medium may be an internal storage unit of the image processing apparatus or the computer device provided in any of the aforementioned embodiments, such as a hard disk or memory of the computer device. The computer-readable storage medium may also be an external storage device of the computer device, such as a plug-in hard disk, a smart memory card (smart media card, SMC), a secure digital (secure digital, SD) card, a flash card (flash card), etc. equipped on the computer device. Further, the computer-readable storage medium may also include both an internal storage unit of the computer device and an external storage device. The computer-readable storage medium is used to store the computer program and other programs and data required by the computer device. The computer-readable storage medium may also be used to temporarily store data that has been output or is to be output.
[0255] In one aspect of the present application, a computer program product or a computer program is provided, the computer program product or the computer program includes computer instructions, the computer instructions are stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the method provided in one aspect of the embodiments of the present application.
[0256] The steps in the method of the embodiment of the present application can be adjusted in order, combined and deleted according to actual needs.
[0257] The modules in the device of the embodiment of the present application can be merged, divided and deleted according to actual needs.
[0258] The above disclosure is only part of the embodiments of the present application, which certainly cannot be used to limit the scope of rights of the present application. Ordinary technicians in this field can understand that all or part of the processes of implementing the above embodiments and making equivalent changes according to the claims of this application are still within the scope of the invention.
Claims
1. An image processing method, characterized in that: include: Displaying a first service interface; Acquire the first image to be processed and the watermark indication information configured in the first service interface; A second image with a watermark is displayed, wherein the second image is obtained after a watermark is added to a target element of the first image based on the watermark indication information, and the target element refers to any one or more elements included in the first image.
2. The method according to claim 1, characterized in that Acquiring a first image to be processed configured in the first service interface, including: Acquire a first image input in the first service interface; or, Acquire a first video imported into the first service interface, and extract a first image from the first video, where the first image is any frame image in the first video; or, Obtaining the image address input in the first service interface, and downloading the first image according to the image address; or, The video address of the second video input in the first service interface is obtained, and a first image is extracted from the second video according to the video address, where the first image is any frame image in the second video.
3. The method according to claim 1, characterized in that The watermark indication information includes a reference watermark; obtaining the watermark indication information configured in the first service interface includes: Acquire a reference watermark input in the first service interface; or, Displaying a watermark list in the first service interface, and obtaining a watermark selected from the watermark list as a reference watermark; or, Displaying watermark components in the first service interface, and obtaining a reference watermark formed by combining one or more watermark components; The reference watermark includes text, image, or a combination of text and image.
4. The method according to claim 3, characterized in that The watermark indication information also includes indication information of the target element; and the acquiring of the watermark indication information configured in the first service interface further includes: receiving a watermark adding region set for the first image, and setting the watermark adding region as indication information of the target element, wherein the watermark adding region is used to indicate position information of the target element in the first image; or, Displaying the element list of the first image in the first service interface, and setting the identifier of the element selected in the element list as the indication information of the target element; or, Displaying a type list of elements of the first image in the first service interface, and setting the element type selected in the type list as indication information of the target element, wherein the selected element type is used to indicate the element type of the target element; or, If the first image is a frame of an image in a video, a list of specific elements in the video is displayed in the first service interface, and an identifier of a specific element selected from the list of specific elements is set as indication information of a target element; the specific element includes an element whose appearance frequency in the video is greater than a preset frequency threshold; or, If the first image is a frame of image in a game video, the identifier of the virtual game character in the first image is set as the indication information of the target element.
5. The method according to claim 3, characterized in that The watermark indication information further includes adding mode indication information; the adding mode indication information includes at least one of the following: Indicates the number of reference watermarks added to the target element; If the number of the target elements is greater than 1, it is indicated to add the same reference watermark to each target element; If the number of the target elements is greater than 1, it is indicated to add a different reference watermark to each target element; If the number of the target elements is greater than 1, and each target element belongs to one or more element types, it is indicated to add the same reference watermark to the target elements of the same element type, and to add different reference watermarks to the target elements of different element types.
6. The method according to claim 1, characterized in that The method further comprises: Display the second service interface; Acquire detection information set in the second service interface, the detection information including the second image; The watermark detected from the second image is displayed, where the detected watermark is obtained by performing watermark detection processing on a target element in the second image.
7. The method according to claim 6, characterized in that The method further comprises: calculating a similarity between the detected watermark and the reference watermark; If the similarity is greater than or equal to the preset similarity threshold, the step of displaying the watermark detected from the second image is performed.
8. The method according to claim 6, characterized in that The method further comprises: When displaying the watermark detected from the second image, jointly displaying the reference watermark; Among them: the joint display method includes any one or more of the following: displaying the detected watermark and the reference watermark in the same or different interfaces; comparing and displaying the detected watermark and the reference watermark; and presenting the detected watermark and the reference watermark at the same time, and displaying the similarity between the detected watermark and the reference watermark.
9. The method according to claim 6, characterized in that The first service interface refers to any interface provided by the service program for performing watermark addition; The second service interface refers to any interface provided by the service program that performs watermark detection; The service program for performing watermark addition and the service program for performing watermark detection are the same service program, or are different service programs; The service program includes any one of an offline service program and an online service program.
10. The method according to claim 1, characterized in that The watermark indication information includes a reference watermark; and the step of performing a watermark adding process on a target element of the first image based on the watermark indication information includes: Extracting an added region image corresponding to the target element from the first image, wherein the added region image refers to a region image including the target element; Add the reference watermark to the added area image to obtain a target area image; The target area image is used to replace the added area image in the first image to obtain the second image.
11. The method according to claim 10, characterized in that The step of extracting the added area image corresponding to the target element from the first image includes: Calling the target detection model to perform target detection processing on the first image to obtain a detection result, wherein the detection result includes N elements and position information corresponding to each element in the first image; N is a positive integer; A target element is determined from the N elements, and a target area image is extracted from the first image according to position information of the target element in the first image.
12. The method according to claim 11, characterized in that The target detection model includes an encoder, a decoder and a loss end; The encoder includes multiple encoding layers, the multiple encoding layers are connected in a full cross-layer connection manner, and the multiple encoding layers support a local cross-layer fusion mode; each encoding layer of the encoder is used to encode the first image to obtain an encoding result, so as to extract visual information of the first image; The decoder comprises a plurality of decoding layers, and the plurality of decoding layers are connected in a full cross-layer connection manner; The decoder is used to perform fusion processing on the encoding results of each encoding layer of the encoder to obtain a decoding result; The loss end is used to predict elements in the first image and position information corresponding to the elements in the first image based on a decoding result of the decoder.
13. The method according to claim 10, characterized in that Adding the reference watermark in the added area image comprises: Decomposing the added region image to obtain a plurality of sub-images of the added region image under different image channels; Using a matching watermark adding rule, the reference watermark is added to any one of the multiple sub-images of the added area image in each image channel to obtain the sub-image with the watermark added in each image channel; The target area image is obtained by performing fusion processing on the sub-images with watermarks and the sub-images without watermarks under each image channel.
14. The method according to claim 10, characterized in that The first image is any frame image in the game video; the watermark indication information further includes interval indication information, and the interval indication information is used to indicate the time interval for adding the watermark in the game video; the method further includes: If no target element is detected in the first image, the reference watermark is added to the entire image area of the first image; or, If the target element is not detected in the first image, the time period corresponding to the watermark adding time interval to which the first image belongs is determined, and a frame of image is reselected from the game video within the time period to be determined as a new first image.
15. The method according to claim 6, characterized in that The performing watermark detection processing on the target element in the second image includes: Extracting a detection area image corresponding to the target element from the second image, wherein the detection area image refers to an area image containing the target element; Perform watermark detection processing on the detection area image.
16. The method according to claim 15, characterized in that Performing watermark detection processing on the detection area image includes: Decomposing the detection area image to obtain multiple sub-images of the detection area image under each image channel; Using the matched detection rule, watermark detection is performed on multiple sub-images of the detection area image under each image channel to obtain watermark information; A watermark restoration process is performed according to the watermark information to obtain the watermark contained in the detection area image.
17. An image processing device, characterized in that: include: A display module, used for displaying a first service interface; An acquisition module, used to acquire the first image to be processed and the watermark indication information configured in the first service interface; The display module is also used to display a second image with a watermark, wherein the second image is obtained after watermarking the target elements of the first image based on the watermark indication information, and the target element refers to any one or more elements contained in the first image.
18. A computer device, characterized in that: include: a processor suitable for executing a computer program; A computer-readable storage medium, wherein a computer program is stored in the computer-readable storage medium, and when the computer program is executed by the processor, the image processing method according to any one of claims 1 to 16 is executed.
19. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the image processing method according to any one of claims 1 to 16 is executed.
20. A computer program product, characterized in that The computer program product comprises a computer program or a computer instruction, and the computer program or the computer instruction is executed by a processor according to any one of claims 1 to 16.
