Digital watermark extraction method and device, electronic equipment and storage medium
By identifying the target color channel in the screen capture image and performing feature enhancement, the problem of insufficient image sharpness is solved, enabling efficient and accurate watermark extraction and information source tracking.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- BEIJING VOLCANO ENGINE TECH CO LTD
- Filing Date
- 2023-10-07
- Publication Date
- 2026-07-31
AI Technical Summary
In existing technologies, the clarity of screen-captured images is poor, making it impossible to accurately obtain digital watermarks and increasing the difficulty of tracing the source of information leakage.
By acquiring the watermark parameter information of the screen-captured image, the target color channel where the foreground watermark is located is determined, and feature enhancement is performed based on this channel to generate the first enhanced image. Subsequently, watermark features are extracted to obtain the watermark content.
It reduces the difficulty of watermark extraction, improves the accuracy and efficiency of watermark extraction, and enables accurate tracking of information sources.
Smart Images

Figure CN117314718B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of image processing technology, and in particular to a digital watermark extraction method, apparatus, electronic device, and storage medium. Background Technology
[0002] In existing technologies, screen capture images obtained by taking pictures of the screen often have poor clarity due to factors such as the shooting environment and screen display effects, which leads to the inability to accurately obtain digital watermarks from the screen capture images. Summary of the Invention
[0003] This disclosure provides a digital watermark extraction method, apparatus, electronic device, and storage medium to overcome the problem of being unable to accurately obtain digital watermarks from screen-captured images.
[0004] In a first aspect, embodiments of this disclosure provide a digital watermark extraction method, including:
[0005] A screen capture image of a target display interface is acquired, wherein the target display interface has an embedded foreground watermark; based on the watermark parameter information, the target color channel in which the foreground watermark is located is determined, and based on the target color channel, the watermark features in the screen capture image are enhanced to obtain a first enhanced image; the watermark features in the first enhanced image are extracted to obtain a watermark extraction result, which is used to characterize the watermark content of the foreground watermark.
[0006] Secondly, embodiments of this disclosure provide a digital watermark extraction device, comprising:
[0007] The acquisition module is used to acquire a screen capture image of a target display interface, wherein the target display interface has a foreground watermark embedded in it.
[0008] An enhancement module is used to determine the target color channel where the foreground watermark is located based on watermark parameter information, and to perform feature enhancement on the watermark features in the screen capture image based on the target color channel to obtain a first enhanced image. The watermark parameter information is used to indicate the target color channel where the foreground watermark is located, and the feature enhancement of the watermark features is implemented based on the target color channel of the screen capture image.
[0009] The extraction module is used to extract watermark features from the first enhanced image to obtain watermark extraction results, which are used to characterize the watermark content of the foreground watermark.
[0010] Thirdly, embodiments of this disclosure provide an electronic device, including: a processor and a memory;
[0011] The memory stores computer-executed instructions;
[0012] The processor executes computer execution instructions stored in the memory, causing the at least one processor to perform the digital watermark extraction method as described in the first aspect and various possible designs of the first aspect.
[0013] Fourthly, embodiments of this disclosure provide a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the digital watermark extraction method described in the first aspect and various possible designs of the first aspect.
[0014] Fifthly, embodiments of this disclosure provide a computer program product, including a computer program that, when executed by a processor, implements the digital watermark extraction method as described in the first aspect and various possible designs of the first aspect.
[0015] The digital watermark extraction method, apparatus, electronic device, and storage medium provided in this embodiment acquire a screen capture image of a target display interface, in which a foreground watermark is embedded. Based on watermark parameter information, the target color channel where the foreground watermark is located is determined. Then, based on the target color channel, the watermark features in the screen capture image are enhanced to obtain a first enhanced image. Watermark features in the first enhanced image are extracted to obtain a watermark extraction result, which characterizes the watermark content of the foreground watermark. By using watermark parameter information as prior knowledge to determine the target color channel where the foreground watermark is located, and then enhancing the watermark features based on the target color channel to obtain a first enhanced image with more prominent watermark features, watermark extraction is then performed based on the first enhanced image to obtain the watermark extraction result. This achieves the effects of reducing the difficulty of watermark extraction and improving the accuracy and efficiency of watermark extraction. Attached Figure Description
[0016] To more clearly illustrate the technical solutions in the embodiments of this disclosure or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this disclosure. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0017] Figure 1 This is an application scenario diagram of the digital watermark extraction method provided in the embodiments of this disclosure;
[0018] Figure 2 Flowchart of the digital watermark extraction method provided in the embodiments of this disclosure Figure 1 ;
[0019] Figure 3 This is a schematic diagram illustrating a process for generating a first enhanced image, as provided in an embodiment of the present disclosure.
[0020] Figure 4 for Figure 2 A flowchart illustrating the specific implementation of step S103 in the illustrated embodiment;
[0021] Figure 5 A schematic diagram of a second enhanced image provided in an embodiment of this disclosure;
[0022] Figure 6 Flowchart of the digital watermark extraction method provided in the embodiments of this disclosure Figure 2 ;
[0023] Figure 7 for Figure 6 A flowchart illustrating the specific implementation of step S205 in the illustrated embodiment;
[0024] Figure 8 This is a schematic diagram illustrating a process for generating a first enhanced image, as provided in an embodiment of the present disclosure.
[0025] Figure 9 for Figure 6 A flowchart illustrating the specific implementation of step S209 in the illustrated embodiment;
[0026] Figure 10 A schematic diagram illustrating the generation of a second enhanced image according to an embodiment of this disclosure;
[0027] Figure 11 This is a structural block diagram of the digital watermark extraction device provided in the embodiments of this disclosure;
[0028] Figure 12 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present disclosure;
[0029] Figure 13 This is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of this disclosure. Detailed Implementation
[0030] To make the objectives, technical solutions, and advantages of the embodiments of this disclosure clearer, the technical solutions of the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this disclosure, and not all embodiments. Based on the embodiments of this disclosure, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this disclosure.
[0031] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this disclosure are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, use and processing of the relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and corresponding operation portals are provided for users to choose to authorize or refuse.
[0032] The application scenarios of the embodiments of this disclosure are explained below:
[0033] Figure 1 This diagram illustrates an application scenario of the digital watermark extraction method provided in this disclosure. The method can be applied to applications with watermark extraction capabilities, and more specifically, to applications that extract and recognize watermarks from screen-captured images. The executing entity in this embodiment can be a terminal device running the aforementioned application with watermark extraction capabilities, a server providing watermark extraction and recognition services, or other electronic devices performing similar functions. (Reference) Figure 1 As shown in the diagram, taking a server as an example, the capturing device obtains a screen capture image by photographing the display device. The content displayed on this device (such as classified images or documents) contains an embedded digital watermark. This digital watermark can be a texture with a specific shape and distribution pattern. By extracting and decoding the digital watermark (texture), corresponding identifiers and text representing specific meanings can be mapped. The display device (or the content displayed on it) is the source of the information leak. For example, a foreground watermark is a watermark set as a separate watermark layer on the display interface of the device. Foreground watermarks are widely used in various leak prevention scenarios because they do not require access to the screen display content and have fast algorithm execution speeds. Furthermore, this foreground watermark has high transparency, making it imperceptible to the human eye and thus offering high security. Subsequently, after obtaining the captured image, the user's terminal device sends it to a server providing watermark extraction services. The server then processes the captured image using the digital watermark extraction method provided in this embodiment, extracts the digital watermark, and sends the watermark content (watermark extraction result) back to the terminal device, completing the digital watermark extraction process. Afterwards, the terminal device or server can further identify the source of the information leak by analyzing the content of the digital watermark, such as a device identifier representing the aforementioned display device, thereby achieving information tracing and other purposes.
[0034] In existing technologies, screen capture images obtained by taking pictures of the screen are often poorly clear due to factors such as the shooting environment and screen display effects, including changes in shooting angle, light interference during shooting, and interference from screen moiré patterns. This results in the inability to accurately and completely extract the digital watermark from the screen capture image during subsequent watermark extraction, increasing the difficulty of tracing the source of information leakage.
[0035] This disclosure provides a digital watermark extraction method to solve the above-mentioned problems.
[0036] refer to Figure 2 , Figure 2 Flowchart of the digital watermark extraction method provided in the embodiments of this disclosure Figure 1 The method described in this embodiment can be applied to electronic devices such as terminal devices and servers. Taking a server as an example, the digital watermark extraction method includes:
[0037] Step S101: Obtain a screen capture image of the target display interface, which has a foreground watermark embedded in it.
[0038] Step S102: Based on the watermark parameter information, determine the target color channel where the foreground watermark is located, and perform feature enhancement on the watermark features in the screen capture image based on the target color channel to obtain the first enhanced image.
[0039] For example, refer to Figure 1 The illustrated application scenario diagram shows a screen capture image generated by photographing the screen of a display device. The screen capture image contains the target display interface on the display device's screen, with an embedded foreground watermark. More specifically, this target display interface can be the program interface of an application running on the display device, the operating system interface, etc. The foreground watermark is a digital watermark displayed through an independent display layer. After the associated program runs, the foreground watermark is displayed within the target display interface on the display device. The watermark content can be an identifier representing the display device or the corresponding device account, such as the encoded result of the display device's device identifier or account identifier. By identifying the foreground watermark, the traceability of a specific device or account can be achieved. The specific implementation method of the foreground watermark is existing technology, and its principle will not be elaborated here.
[0040] Furthermore, after receiving the screen capture image uploaded by the terminal device, the server first needs to parse the image. Since the screen capture image is generated by capturing the screen of the display device using another image-capturing device (such as a camera), it is essentially a secondary capture. Therefore, there are certain differences between the screen capture image and the original image displayed on the display device, which embeds the aforementioned foreground watermark. Moreover, the foreground watermark and the image content are superimposed during the capture process, making it impossible to directly extract the accurate watermark layer from the image file. The server obtains channel data for multiple data channels by parsing the screen capture image into multiple data channels. Since images are typically composed of pixels of different colors, these data channels can also be called color channels. For example, if the screen capture image is an RGB image, that is, an image based on the RGB color space, the server can obtain the channel data for the R (red) channel, the G (green) channel, and the B (blue) channel respectively.
[0041] Next, the server determines the target color channel among multiple color channels by obtaining the watermark parameter information, and then obtains the channel data corresponding to the target color channel. The target color channel is the color channel where the foreground watermark is located. Therefore, the watermark parameter information is essentially a kind of prior information for a specific foreground watermark. Using this watermark parameter information, the server can determine the color channel where the foreground watermark is located in advance, and then enhance that color channel to obtain the first enhanced image. This achieves the purpose of strengthening the watermark features in the screen capture image, making the watermark features in the first enhanced image more prominent.
[0042] Figure 3 This is a schematic diagram illustrating a process for generating a first enhanced image according to an embodiment of the present disclosure, such as... Figure 3As shown, exemplarily, after the server obtains the screen capture image P1, it first performs content recognition on the image content of the screen capture image P1 to obtain the corresponding content identifier, such as the content identifier Tag_1 representing the project information of project A. Then, it obtains the watermark parameter information Info_1 corresponding to the content identifier Tag_1. The target color channel indicated by the watermark parameter information Info_1 is the R color channel in the RGB color space. Next, the server converts the screen capture image P1 to the RGB color space to obtain image P2. Then, it enhances the target channel data D1 in the target color channel of image P2, i.e., the R color channel, to obtain the corresponding enhanced target channel data D1r. Finally, based on the target data D2, it combines it with the channel data D2 in the G color channel and the channel data D3 in the B color channel to form the first enhanced image. The specific implementation of feature enhancement for the watermark features includes, for example, contrast enhancement of the R color channel data or logarithmic coordinate transformation, thereby amplifying the weak signals in the R color channel to achieve the purpose of enhancing the watermark features. Of course, feature enhancement can also be performed based on other implementation methods. The specific implementation method can be set as needed, and will not be elaborated here.
[0043] Step S103: Extract watermark features from the first enhanced image to obtain watermark extraction results. The watermark extraction results are used to characterize the watermark content of the foreground watermark.
[0044] For example, after obtaining the first enhanced image with enhanced watermark features, the watermark features in the first enhanced image are extracted by combining the location information of the foreground watermark, thus obtaining the watermark extraction result. The location information of the foreground watermark is included in the watermark parameter information, which describes the location features of the foreground watermark in the image, such as its position and distribution.
[0045] More specifically, the location information of the foreground watermark can be a mask image used to represent the location of the foreground watermark. The specific implementation method for extracting watermark features based on the location information of the foreground watermark is prior art known to those skilled in the art and will not be elaborated here. Furthermore, the watermark extraction result is used to represent the watermark content of the foreground watermark. Specifically, it can be a set of specific strings used to represent the information source, such as file identifiers, account identifiers, etc. The specific representation of the watermark extraction result can be determined based on the specific encoding method of the foreground watermark, and will not be exemplified here.
[0046] In one possible implementation, after obtaining the first enhanced image, it can be further processed to further improve the saliency of the watermark features, thereby improving the accuracy of the watermark extraction result. Specifically, such as... Figure 4 As shown, the specific implementation of step S103 includes:
[0047] Step S1031: Binarize the first enhanced image to obtain a second enhanced image, wherein the second enhanced image includes binarized pixels and is used to represent the watermark texture constituting the watermark content.
[0048] Step S1032: Extract watermark features from the second enhanced image to obtain the watermark extraction result.
[0049] For example, binarization refers to the process of converting a numerical value into 0 and 1 (or Boolean values). There are various ways to implement binarization, which can be achieved through a preset binarization function. For example, a binarization function might compare the input value with a preset threshold; values greater than the threshold are assigned a value of 1, values less than or equal to the threshold are assigned a value of 0, or vice versa. The specific implementation of the binarization function can be set as needed; examples are given below.
[0050] In this embodiment, after obtaining the first enhanced image, the first enhanced image is binarized to obtain an image consisting only of binarized pixels 0 and 1, namely the second enhanced image. The 0s or 1s in the second enhanced image are used to represent the recessed and protruding parts of the watermark texture, and the watermark content is constructed through these protruding parts. Figure 5 This is a schematic diagram of a second enhanced image provided in an embodiment of the present disclosure, such as... Figure 5 As shown, exemplarily, the second enhanced image is an image of size N*M. Each pixel in the second enhanced image is a binary pixel, meaning each pixel has a value of either 0 or 1. For example, 1 represents a raised portion of the watermark texture, and 0 represents a recessed portion. Thus, the watermark feature in the second enhanced image is represented by the set of all pixels with a value of 1. Subsequently, watermark feature extraction is performed on the second enhanced image to obtain the watermark extraction result, such as textures, characters, or text composed of binary pixel values of 1. Using this watermark extraction result, the source of information corresponding to the foreground watermark can be traced.
[0051] In this embodiment, a screen capture image of a target display interface with an embedded foreground watermark is acquired. Based on watermark parameter information, the target color channel where the foreground watermark is located is determined. Then, based on the target color channel, the watermark features in the screen capture image are enhanced to obtain a first enhanced image. Watermark features in the first enhanced image are extracted to obtain a watermark extraction result, which is used to characterize the watermark content of the foreground watermark. By using watermark parameter information as prior knowledge to determine the target color channel where the foreground watermark is located, and then enhancing the watermark features based on the target color channel to obtain a first enhanced image with more prominent watermark features, watermark extraction is performed based on the first enhanced image to obtain the watermark extraction result. This achieves the effects of reducing the difficulty of watermark extraction and improving the accuracy and efficiency of watermark extraction.
[0052] refer to Figure 6 , Figure 6 Flowchart of the digital watermark extraction method provided in the embodiments of this disclosure Figure 2 This embodiment is in Figure 2 Based on the illustrated embodiment, steps S102 and S103 are further refined, and the digital watermark extraction method includes:
[0053] Step S201: Obtain a screen capture image of the target display interface, which has a foreground watermark embedded in it.
[0054] Step S202: Perform color space conversion on the screen capture image to generate an adapted screen capture image based on the second color space.
[0055] In one possible implementation, the screen capture image acquired by the server corresponds to a specific color space. In this case, color space conversion can be performed as needed to improve the feature enhancement effect in subsequent steps. Specifically, for example, the screen capture image acquired by the server might be based on the HSV (Hue, Saturation, Value) color space, which represents the content of a color image using hue, saturation, and brightness. In this case, color space conversion can be performed on the screen capture image first, converting it to a color space more suitable for extracting watermark features, i.e., a second color space. The image generated after color space conversion is the adapted screen capture image. In one possible implementation, the second color space is the RGB color space.
[0056] Of course, it is understood that the above-mentioned step of color space conversion of the screen capture image is optional. In other possible embodiments, the screen capture image can be used directly to perform subsequent steps without omitting step 202, and the subsequent processing is the same, which will not be described in detail here.
[0057] Step S203: Based on the watermark parameter information, extract the channel data of the target color channel of the adapted screen capture image to obtain the target channel data.
[0058] Step S204: Convert the adapted screen capture image to a first color space with a luminance channel, and obtain the luminance channel data corresponding to the luminance channel.
[0059] For example, the watermark parameter information corresponding to the screen capture image is then obtained, indicating the target color channel where the foreground watermark is located. By extracting channel data from the screen capture image or adapted screen capture image using the watermark parameter information, the target channel data corresponding to the target color channel can be obtained. The specific implementation process of the above-mentioned target channel data extraction process is described in... Figure 2 The embodiments shown have been described in detail and will not be repeated here.
[0060] On the other hand, the obtained adapted screen capture image undergoes color space conversion to a first color space with a luma channel, such as the YUV color space. Similar to the RGB color space, the YUV color space is also a color encoding method, describing the image content of a color image through luma and chromaticity. RGB and YUV color spaces are mutually convertible. In this embodiment, the adapted screen capture image undergoes color space conversion to obtain the first color space, and the luma channel data of the first color space, such as the luma channel data corresponding to the YUV space, is used for feature enhancement. Since luma can characterize the outline of object elements in an image to a certain extent, selecting the luma channel for subsequent residual processing can improve the clarity of the watermark outline in the image.
[0061] In one possible implementation, the first color space is the YUV color space, the second color space is the RGB color space, and the target color channel includes any one of the R channel, G channel, and B channel.
[0062] Step S205: Obtain the first enhanced image by using the residual between the target channel data and the luminance channel data.
[0063] For example, residual calculation is performed using the target channel data and luminance channel data obtained in the above steps. Since both target channel data and luminance channel data are generated based on screen-captured images and have the same number of data points, they can be subtracted point by point to obtain a residual image with the same number of data points, which is the first enhanced image. After performing residual calculation based on the luminance channel data, the purpose of eliminating image noise and interference and enhancing the contour of the foreground watermark can be achieved, thereby improving the effect of subsequent watermark feature extraction.
[0064] For example, such as Figure 7 As shown, the specific implementation of step S205 includes:
[0065] Step S2051: Perform residual calculation on the target channel data and the luminance channel data to obtain the first residual map.
[0066] Step S2052: Normalize the first residual map to obtain a normalized residual map.
[0067] Step S2053: Perform histogram equalization on the normalized residual map to obtain the first enhanced image.
[0068] For example, referring to the previous section, Figure 8 This is a schematic diagram illustrating a process for generating a first enhanced image according to an embodiment of the present disclosure. The following is in conjunction with... Figure 8 The above steps will be further explained. For example... Figure 8 As shown, after the server obtains the screen capture image P1, it performs color space conversion on the screen capture image P1 to generate an adapted screen capture image P2. Then, based on the adapted screen capture image P2, it extracts the channel data of the target color channel using the watermark parameter information to obtain the target channel data P3. It then performs color space conversion on the adapted screen capture image P2 to generate a YUV image, and extracts the luminance channel data from the YUV image to obtain the luminance channel data P4. Finally, it performs point-by-point residual calculation on the target channel data P3 and the luminance channel data P4 to obtain the first residual image P5.
[0069] Next, the first residual plot is normalized, that is, each value in the first residual plot is normalized to fall within a fixed numerical range, such as between 0 and 1, or between 0 and 255, thus obtaining the normalized residual plot P6. The implementation method of normalizing the dataset is existing technology known to those skilled in the art, and will not be described in detail here.
[0070] Next, histogram equalization is performed on the normalized residual map to obtain the first enhanced image. Histogram equalization, also known as histogram equalization, is a method in image processing that adjusts contrast using an image histogram. This method allows brightness to be better distributed across the histogram while reducing the impact of uneven lighting in screen captures. This allows for enhancing local contrast without affecting overall contrast; histogram equalization achieves this by effectively expanding commonly used brightness levels. In this embodiment, by performing histogram equalization on the normalized residual map, the image contrast is enhanced, thereby increasing the detail of the watermark features in the normalized residual map and strengthening the watermark characteristics.
[0071] Step S206: Obtain the target filter kernel size based on the image content features of the screen capture image.
[0072] Step S207: Based on the target filter kernel size, perform mean filtering on the watermark features in the first enhanced image to obtain a filtered feature map.
[0073] Furthermore, after obtaining the first enhanced image, mean filtering can be applied to it to reduce image noise, decrease noise introduced during the shooting process, and improve the clarity of the watermark features. Specifically, firstly, based on the image content features of the screen-captured image, the corresponding target filter kernel size is obtained. The image content features of the screen-captured image can be obtained through image feature extraction and content recognition steps. This step can be the same pre-step as obtaining the watermark parameter information, i.e., by recognizing the image content features of the screen-captured image to obtain the watermark parameter information and the corresponding target filter kernel size. Then, based on this target filter kernel size, mean filtering is applied to the watermark features in the first enhanced image to obtain a filtered feature map, which represents the non-watermark features in the image. The filtering result of the mean filtering is affected by the target filter kernel size. The larger the target filter kernel size, the more surrounding pixel information is referenced, and the stronger the filtering effect; conversely, the smaller the target filter kernel size, the less surrounding pixel information is referenced, and the weaker the filtering effect. By setting the target filter kernel size to match the image content features, the filtering intensity can be controlled, resulting in a better filtering effect in the generated filter feature map and improving the saliency of the watermark features.
[0074] Step S208: Obtain the second residual map based on the residual of the filtered feature map and the first enhanced image.
[0075] Step S209: Obtain a second enhanced image based on the second residual image. The second enhanced image includes binarized pixels and is used to characterize the watermark texture that constitutes the watermark content.
[0076] For example, after generating the filtered feature map, the residual between the filtered feature map and the first enhanced image is further calculated to obtain a second residual map. By calculating the residual between the filtered feature map and the first enhanced image, non-watermark features represented in the filtered feature map can be filtered out, thereby enhancing the watermark features in the first enhanced image. Further, as... Figure 9 As shown, the specific implementation of step S209 includes:
[0077] Step S2091: Obtain the residual threshold based on the image content features of the screen capture image.
[0078] Step S2092: Obtain the residual value corresponding to each pixel in the second residual image and compare it with the residual threshold to obtain the second enhanced image.
[0079] For example, for the second residual image, similar to the previous steps, the image content features of the screen capture image are obtained. The specific implementation method has been described previously and will not be repeated here. Another example is obtaining a corresponding residual threshold from the image content features, thus matching the value of the residual threshold with the image content. The image content features can characterize factors such as the distance of the target display interface from the shooting point and the brightness of the lights in the image. This avoids the problem of indistinct watermark features caused by an unreasonable residual threshold, thereby further improving the saliency of the watermark features, reducing the difficulty of subsequent foreground watermark recognition based on watermark features, and improving the recognition rate.
[0080] For example, Figure 10 This is a schematic diagram of generating a second enhanced image provided by an embodiment of the present disclosure, which is described below in conjunction with... Figure 10 The above steps are described below. For example, after obtaining the first enhanced image P1, the first enhanced image is filtered based on the image content features of the screen capture image. Specifically, the target filter kernel size is determined by the image content features of the screen capture image, and filtering is performed based on the target filter kernel size. This results in a filtered feature map. Next, residual operations are performed using the filtered feature map and the first enhanced image to obtain a second residual map. Finally, the second residual map is binarized to generate the second enhanced image.
[0081] Step S210: Extract watermark features from the second enhanced image to obtain the watermark extraction result.
[0082] In this embodiment, the implementation methods of steps S201 and S210 are the same as those of this disclosure. Figure 2 The implementation methods of steps S101 and S103 in the illustrated embodiment are the same, and will not be described in detail here.
[0083] Corresponding to the digital watermark extraction method in the above embodiment, Figure 11 This is a structural block diagram of a digital watermark extraction device provided in an embodiment of this disclosure. For ease of explanation, only the parts relevant to the embodiments of this disclosure are shown. (Refer to...) Figure 11 The digital watermark extraction device 3 includes:
[0084] The acquisition module 31 is used to acquire a screen capture image of the target display interface, which has a foreground watermark embedded in it.
[0085] The enhancement module 32 is used to determine the target color channel where the foreground watermark is located based on the watermark parameter information, and to perform feature enhancement on the watermark features in the screen capture image based on the target color channel to obtain the first enhanced image;
[0086] The extraction module 33 is used to extract watermark features from the first enhanced image to obtain watermark extraction results, which are used to characterize the watermark content of the foreground watermark.
[0087] In one embodiment of this disclosure, the enhancement module 32 is specifically used to: extract channel data from the target color channel of the screen capture image according to the watermark parameter information to obtain target channel data; convert the screen capture image to a first color space with a luminance channel and obtain the luminance channel data corresponding to the luminance channel; and obtain a first enhanced image through the residual between the target channel data and the luminance channel data.
[0088] In one embodiment of this disclosure, when the enhancement module 32 obtains the first enhanced image through the residual between the target channel data and the luminance channel data, it is specifically used to: perform residual calculation on the target channel data and the luminance channel data to obtain a first residual map; normalize the first residual map to obtain a normalized residual map; and perform histogram equalization on the normalized residual map to obtain the first enhanced image.
[0089] In one embodiment of this disclosure, the enhancement module 32 is further configured to: perform color space conversion on the screen capture image to generate an adapted screen capture image based on the second color space; when the enhancement module 32 extracts channel data from the target color channel of the screen capture image according to the watermark parameter information to obtain target channel data, it is specifically configured to: extract channel data from the adapted screen capture image based on the second color space according to the target color channel indicated by the watermark parameter information to obtain target channel data.
[0090] In one embodiment of this disclosure, the first color space is the YUV color space, the second color space is the RGB color space, and the target color channel includes any one of the R channel, G channel, and B channel.
[0091] In one embodiment of this disclosure, the extraction module 33 is specifically used to: binarize the first enhanced image to obtain a second enhanced image, wherein the second enhanced image includes binarized pixels and is used to characterize the watermark texture constituting the watermark content; and extract watermark features from the second enhanced image to obtain a watermark extraction result.
[0092] In one embodiment of this disclosure, when the extraction module 33 binarizes the first enhanced image to obtain the second enhanced image, it is specifically used to: obtain the target filter kernel size based on the image content features of the screen capture image; perform mean filtering on the watermark features in the first enhanced image based on the target filter kernel size to obtain a filter feature map; obtain a second residual map based on the residual between the filter feature map and the first enhanced image; and obtain the second enhanced image based on the second residual map.
[0093] In one embodiment of this disclosure, when the extraction module 33 obtains the second enhanced image based on the second residual image, it is specifically used to: obtain a residual threshold based on the image content features of the screen capture image; obtain the residual value corresponding to each pixel in the second residual image and compare it with the residual threshold to obtain the second enhanced image.
[0094] The acquisition module 31, enhancement module 32, and extraction module 33 are connected in sequence. The digital watermark extraction device 3 provided in this embodiment can execute the technical solution of the above method embodiment, and its implementation principle and technical effect are similar, so it will not be described again here.
[0095] Figure 12 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present disclosure, such as... Figure 12 As shown, the electronic device 4 includes:
[0096] Processor 41, and memory 42 communicatively connected to processor 41;
[0097] Memory 42 stores instructions executed by the computer;
[0098] The processor 41 executes computer execution instructions stored in the memory 42 to achieve, for example, Figures 2-10 The digital watermark extraction method in the illustrated embodiment.
[0099] Optionally, the processor 41 and the memory 42 are connected via a bus 43.
[0100] For relevant instructions, please refer to the corresponding text. Figures 2-10 The relevant descriptions and effects of the steps in the corresponding embodiments are understood, and will not be elaborated on here.
[0101] This disclosure provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement this disclosure. Figures 2-10 The digital watermark extraction method provided in any of the corresponding embodiments.
[0102] To implement the above embodiments, this disclosure also provides an electronic device.
[0103] refer to Figure 13The diagram illustrates a structural schematic of an electronic device 900 suitable for implementing embodiments of the present disclosure. The electronic device 900 can be a terminal device or a server. The terminal device can include, but is not limited to, mobile terminals such as mobile phones, laptops, digital radio receivers, personal digital assistants (PDAs), portable Android devices (PADs), portable media players (PMPs), and in-vehicle terminals (e.g., in-vehicle navigation terminals), as well as fixed terminals such as digital TVs and desktop computers. Figure 13 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments disclosed herein.
[0104] like Figure 13 As shown, the electronic device 900 may include a processing unit (e.g., a central processing unit, a graphics processing unit, etc.) 901, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 902 or a program loaded from a storage device 908 into a random access memory (RAM) 903. The RAM 903 also stores various programs and data required for the operation of the electronic device 900. The processing unit 901, ROM 902, and RAM 903 are interconnected via a bus 904. An input / output (I / O) interface 905 is also connected to the bus 904.
[0105] Typically, the following devices can be connected to I / O interface 905: input devices 906 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 907 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 908 including, for example, magnetic tapes, hard disks, etc.; and communication devices 909. Communication device 909 allows electronic device 900 to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 13 An electronic device 900 with various devices is shown; however, it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed alternatively.
[0106] In particular, according to embodiments of this disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this disclosure include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device 909, or installed from a storage device 908, or installed from a ROM 902. When the computer program is executed by a processing device 901, it performs the functions defined in the methods of embodiments of this disclosure.
[0107] It should be noted that the computer-readable medium described in this disclosure can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this disclosure, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in connection with an instruction execution system, apparatus, or device. In this disclosure, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium can be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wires, optical fibers, RF (radio frequency), etc., or any suitable combination thereof.
[0108] The aforementioned computer-readable medium may be included in the aforementioned electronic device; or it may exist independently and not assembled into the electronic device.
[0109] The aforementioned computer-readable medium carries one or more programs, which, when executed by the electronic device, cause the electronic device to perform the methods shown in the above embodiments.
[0110] Computer program code for performing the operations of this disclosure can be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, and C++, and conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a Local Area Network (LAN) or a Wide Area Network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0111] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0112] The units described in the embodiments of this disclosure can be implemented in software or in hardware. The name of a unit does not necessarily limit the unit itself; for example, the first acquisition unit can also be described as "a unit that acquires at least two Internet Protocol addresses".
[0113] The functions described above in this document can be performed, at least in part, by one or more hardware logic components. For example, exemplary types of hardware logic components that can be used, without limitation, include: Field Programmable Gate Arrays (FPGAs), Application-Specific Integrated Circuits (ASICs), Application Standard Products (ASSPs), System-on-Chip (SoCs), Complex Programmable Logic Devices (CPLDs), and so on.
[0114] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0115] In a first aspect, according to one or more embodiments of this disclosure, a digital watermark extraction method is provided, comprising:
[0116] A screen capture image of a target display interface is acquired, wherein the target display interface has an embedded foreground watermark; based on the watermark parameter information, the target color channel in which the foreground watermark is located is determined, and based on the target color channel, the watermark features in the screen capture image are enhanced to obtain a first enhanced image; the watermark features in the first enhanced image are extracted to obtain a watermark extraction result, which is used to characterize the watermark content of the foreground watermark.
[0117] According to one or more embodiments of this disclosure, the step of determining the target color channel where the foreground watermark is located based on watermark parameter information, and performing feature enhancement on the watermark features in the screen capture image based on the target color channel to obtain a first enhanced image includes: extracting channel data from the target color channel of the screen capture image based on the watermark parameter information to obtain target channel data; converting the screen capture image to a first color space with a luminance channel and obtaining luminance channel data corresponding to the luminance channel; and obtaining the first enhanced image through the residual between the target channel data and the luminance channel data.
[0118] According to one or more embodiments of this disclosure, obtaining the first enhanced image through the residual between the target channel data and the luminance channel data includes: performing residual calculation on the target channel data and the luminance channel data to obtain a first residual map; normalizing the first residual map to obtain a normalized residual map; and performing histogram equalization on the normalized residual map to obtain the first enhanced image.
[0119] According to one or more embodiments of this disclosure, the method further includes: performing color space conversion on the screen capture image to generate an adapted screen capture image based on a second color space; the step of extracting channel data from the target color channel of the screen capture image according to the watermark parameter information to obtain target channel data includes: extracting channel data from the adapted screen capture image based on the second color space according to the target color channel indicated by the watermark parameter information to obtain target channel data.
[0120] According to one or more embodiments of this disclosure, the first color space is the YUV color space, the second color space is the RGB color space, and the target color channel includes any one of the R channel, G channel, and B channel.
[0121] According to one or more embodiments of this disclosure, the step of extracting watermark features from a first enhanced image to obtain a watermark extraction result includes: binarizing the first enhanced image to obtain a second enhanced image, wherein the second enhanced image includes binarized pixels and is used to characterize the watermark texture constituting the watermark content; and extracting watermark features from the second enhanced image to obtain the watermark extraction result.
[0122] According to one or more embodiments of this disclosure, binarizing the first enhanced image to obtain a second enhanced image includes: obtaining a target filter kernel size based on the image content features of the screen capture image; performing mean filtering on the watermark features in the first enhanced image based on the target filter kernel size to obtain a filtered feature map; obtaining a second residual map based on the residual between the filtered feature map and the first enhanced image; and obtaining the second enhanced image based on the second residual map.
[0123] According to one or more embodiments of this disclosure, obtaining the second enhanced image based on the second residual image includes: obtaining a residual threshold based on the image content features of the screen capture image; obtaining the residual value corresponding to each pixel in the second residual image and comparing it with the residual threshold to obtain the second enhanced image.
[0124] Secondly, according to one or more embodiments of this disclosure, a digital watermark extraction device is provided, comprising:
[0125] The acquisition module is used to acquire a screen capture image of a target display interface, wherein the target display interface has a foreground watermark embedded in it.
[0126] An enhancement module is used to determine the target color channel where the foreground watermark is located based on watermark parameter information, and to perform feature enhancement on the watermark features in the screen capture image based on the target color channel to obtain a first enhanced image;
[0127] The extraction module is used to extract watermark features from the first enhanced image to obtain watermark extraction results, which are used to characterize the watermark content of the foreground watermark.
[0128] According to one or more embodiments of this disclosure, the enhancement module is specifically configured to: extract channel data from the target color channel of the screen capture image based on the watermark parameter information to obtain target channel data; convert the screen capture image to a first color space with a luminance channel and obtain luminance channel data corresponding to the luminance channel; and obtain the first enhanced image through the residual between the target channel data and the luminance channel data.
[0129] According to one or more embodiments of this disclosure, when the enhancement module obtains the first enhanced image through the residual between the target channel data and the luminance channel data, it is specifically configured to: perform residual calculation on the target channel data and the luminance channel data to obtain a first residual map; normalize the first residual map to obtain a normalized residual map; and perform histogram equalization on the normalized residual map to obtain the first enhanced image.
[0130] According to one or more embodiments of this disclosure, the enhancement module is further configured to: perform color space conversion on the screen capture image to generate an adapted screen capture image based on a second color space; when the enhancement module 32 extracts channel data from the target color channel of the screen capture image according to the watermark parameter information to obtain target channel data, it is specifically configured to: extract channel data from the adapted screen capture image based on the second color space according to the target color channel indicated by the watermark parameter information to obtain target channel data.
[0131] According to one or more embodiments of this disclosure, the first color space is the YUV color space, the second color space is the RGB color space, and the target color channel includes any one of the R channel, G channel, and B channel.
[0132] According to one or more embodiments of this disclosure, the extraction module is specifically configured to: binarize the first enhanced image to obtain a second enhanced image, wherein the second enhanced image includes binarized pixels and is used to characterize the watermark texture constituting the watermark content; and extract watermark features from the second enhanced image to obtain the watermark extraction result.
[0133] According to one or more embodiments of this disclosure, when the extraction module binarizes the first enhanced image to obtain the second enhanced image, it is specifically configured to: obtain a target filter kernel size based on the image content features of the screen capture image; perform mean filtering on the watermark features in the first enhanced image based on the target filter kernel size to obtain a filtered feature map; obtain a second residual map based on the residual between the filtered feature map and the first enhanced image; and obtain the second enhanced image based on the second residual map.
[0134] According to one or more embodiments of this disclosure, when the extraction module obtains the second enhanced image based on the second residual image, it is specifically used to: obtain a residual threshold based on the image content features of the screen capture image; obtain the residual value corresponding to each pixel in the second residual image and compare it with the residual threshold to obtain the second enhanced image.
[0135] Thirdly, according to one or more embodiments of the present disclosure, an electronic device is provided, comprising: at least one processor and a memory;
[0136] The memory stores computer-executed instructions;
[0137] The at least one processor executes computer execution instructions stored in the memory, causing the at least one processor to perform the digital watermark extraction method as described in the first aspect and various possible designs of the first aspect.
[0138] Fourthly, according to one or more embodiments of the present disclosure, a computer-readable storage medium is provided, wherein computer-executable instructions are stored therein, and when a processor executes the computer-executable instructions, the digital watermark extraction method described in the first aspect and various possible designs of the first aspect is implemented.
[0139] Fifthly, according to one or more embodiments of this disclosure, a computer program product is provided, including a computer program that, when executed by a processor, implements the digital watermark extraction method as described in the first aspect and various possible designs of the first aspect.
[0140] The above description is merely a preferred embodiment of this disclosure and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of this disclosure is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the above-described concept. For example, technical solutions formed by substituting the above features with (but not limited to) technical features disclosed in this disclosure that have similar functions.
[0141] Furthermore, while the operations are described in a specific order, this should not be construed as requiring these operations to be performed in the specific order shown or in a sequential order. In certain environments, multitasking and parallel processing may be advantageous. Similarly, while several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of this disclosure. Certain features described in the context of individual embodiments may also be implemented in combination in a single embodiment. Conversely, various features described in the context of a single embodiment may also be implemented individually or in any suitable sub-combination in multiple embodiments.
[0142] Although the subject matter has been described using language specific to structural features and / or methodological logic, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. Rather, the specific features and actions described above are merely illustrative examples of implementing the claims.
Claims
1. A method for extracting digital watermarks, characterized in that, include: A screen capture image of a target display interface is obtained, wherein the target display interface has an embedded foreground watermark; wherein the foreground watermark displayed in the target display interface is displayed through an independent display layer, and the screen capture image is generated by using an image capturing device to capture an image of the target display interface displayed on the screen of the display device, and the image content of the screen capture image is superimposed on the foreground watermark; Based on the image content of the screen capture image, watermark parameter information is obtained by identifying the image content features of the screen capture image, wherein the image content features characterize the distance of the target display interface in the screen capture image from the shooting point and / or the light brightness; Based on the watermark parameter information, the target color channel where the foreground watermark is located on the screen capture image is determined, and the watermark features in the screen capture image are enhanced based on the target color channel to obtain a first enhanced image. The screen capture image includes multiple data channels parsed by the server, and the target color channel is the target data channel among the multiple data channels. The watermark extraction result is obtained by calculating the residual between the filtered feature map and the first enhanced image to extract the watermark features in the first enhanced image. The watermark extraction result is used to characterize the watermark content of the foreground watermark. The filtered feature map is obtained by mean filtering the watermark features in the first enhanced image based on the target filter kernel size. The target filter kernel size is obtained according to the image content features. The watermark parameter information is used to indicate the target color channel where the foreground watermark is located; the target color channel includes any one of the R channel, G channel, and B channel in the RGB color space.
2. The method of claim 1, wherein, Based on the watermark parameter information, the target color channel where the foreground watermark is located is determined, and based on the target color channel, feature enhancement is performed on the watermark features in the screen capture image to obtain a first enhanced image, including: Based on the watermark parameter information, channel data is extracted from the target color channel of the screen capture image to obtain target channel data; The screen-captured image is converted to a first color space with a luminance channel, and the luminance channel data corresponding to the luminance channel is obtained; The first enhanced image is obtained by using the residual between the target channel data and the luminance channel data.
3. The method of claim 2, wherein, Obtaining the first enhanced image by the residual between the target channel data and the luminance channel data includes: Perform residual calculations on the target channel data and the luminance channel data to obtain a first residual map; The first residual map is normalized to obtain a normalized residual map. Histogram equalization is performed on the normalized residual image to obtain the first enhanced image.
4. The method of claim 2, wherein, Also includes: The screen capture image is converted to a different color space to generate an adapted screen capture image based on a second color space; The step of extracting channel data from the target color channel of the screen-captured image based on the watermark parameter information to obtain target channel data includes: Based on the target color channel indicated by the watermark parameter information, channel data is extracted from the adapted screen capture image based on the second color space to obtain target channel data.
5. The method of claim 4, wherein, The first color space is the YUV color space, and the second color space is the RGB color space.
6. The method of claim 1, wherein, The watermark features in the first enhanced image are extracted to obtain the watermark extraction results, including: The first enhanced image is binarized to obtain a second enhanced image, wherein the second enhanced image includes binarized pixels and is used to characterize the watermark texture that constitutes the watermark content; Watermark features are extracted from the second enhanced image to obtain the watermark extraction result.
7. The method of claim 6, wherein, The step of binarizing the first enhanced image to obtain the second enhanced image includes: A second residual map is obtained based on the residual between the filtered feature map and the first enhanced image; The second enhanced image is obtained based on the second residual map.
8. The method of claim 7, wherein, The step of obtaining the second enhanced image based on the second residual image includes: The residual threshold is obtained based on the image content features of the captured image; Obtain the residual value corresponding to each pixel in the second residual image and compare it with the residual threshold to obtain the second enhanced image.
9. A digital watermark extraction apparatus characterized by comprising: include: An acquisition module is used to acquire a screen capture image of a target display interface, wherein the target display interface has an embedded foreground watermark, and to obtain watermark parameter information by recognizing the image content features of the screen capture image based on the image content of the screen capture image; wherein the foreground watermark displayed in the target display interface is displayed through an independent display layer, the screen capture image is generated by capturing the image of the target display interface displayed on the screen of the display device using an image capturing device, the image content of the screen capture image is superimposed with the foreground watermark, and the image content features characterize the distance of the target display interface in the screen capture image from the shooting point and / or the light brightness; An enhancement module is used to determine the target color channel where the foreground watermark is located on the screen-captured image based on the watermark parameter information, and to perform feature enhancement on the watermark features in the screen-captured image based on the target color channel to obtain a first enhanced image. The screen-captured image includes multiple data channels parsed by the server, the target color channel is the target data channel among the multiple data channels, the watermark parameter information is used to indicate the target color channel where the foreground watermark is located, and the feature enhancement of the watermark features is implemented based on the target color channel of the screen-captured image. The extraction module is used to extract watermark features in the first enhanced image by calculating the residual between the filtered feature map and the first enhanced image, and to obtain a watermark extraction result. The watermark extraction result is used to characterize the watermark content of the foreground watermark. The filtered feature map is obtained by mean filtering the watermark features in the first enhanced image based on the target filter kernel size. The target filter kernel size is obtained according to the image content features. The watermark parameter information is used to indicate the target color channel where the foreground watermark is located; the target color channel includes any one of the R channel, G channel, and B channel in the RGB color space.
10. An electronic device, comprising: include: Processor and memory; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory, causing the processor to perform the digital watermark extraction method as described in any one of claims 1 to 8.
11. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, implement the digital watermark extraction method as described in any one of claims 1 to 8.
12. A computer program product comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the digital watermark extraction method as described in any one of claims 1 to 8.