Blind watermark processing method and device, and storage medium
By determining non-overlapping image blocks to be embedded in the image and using frequency domain transformation to embed watermark information, the problem that traditional blind watermarking schemes are unable to resist photo attacks is solved, and the effect of accurately extracting watermark information can be achieved even when taking photos.
Patent Information
- Application Number
- CN202410288972.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-13
- Publication Date
- 2025-09-16
AI Technical Summary
Traditional blind watermarking schemes cannot resist camera attacks, resulting in the inability to parse watermark information from the photographed image.
The watermark information is embedded into these image blocks by determining multiple non-overlapping image blocks to be embedded in the target image and adopting frequency domain transformation and adjustment of transformation coefficients. The embedding is performed using the transformation frequency group of the mid-frequency band.
The anti-interference ability of the watermark information is improved, and the watermark information can still be accurately extracted from the photographed image under attacks such as taking photos, thereby enhancing the data security protection capability.
Smart Images

Figure CN120655480A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of Internet technology, and in particular to a blind watermark processing method, device, and storage medium. Background Art
[0002] Adding watermark information to data such as images and videos for data security protection has become a widely adopted data security protection measure. Compared with explicit watermarks, blind watermarks (also known as dark watermarks) have the advantage of being less perceptible and can provide better data security protection, thus being more widely adopted.
[0003] Traditional solutions can blindly add watermarks to the image's spatial domain. For example, a transparent layer is added to the image, and the pixel values of certain pixels in the transparent layer are modified to embed the watermark information. However, this watermark embedding method is not immune to photo attacks because when the image with the transparent layer is photographed, the resulting photographic image will not contain the transparent layer, making it impossible to successfully decipher the watermark from the photographic image. Summary of the Invention
[0004] The embodiments of the present invention provide a blind watermark processing method, device, and storage medium for improving the anti-interference ability of watermark information embedded in an image, so that the embedded watermark information can resist various attack methods such as taking photos.
[0005] In a first aspect, an embodiment of the present invention provides a blind watermark processing method, the method comprising:
[0006] Obtain target image and target watermark information;
[0007] Determining a plurality of first key points contained in the target image;
[0008] Determining a plurality of non-overlapping image blocks to be embedded in the target image according to the plurality of first key points, wherein each image block to be embedded contains at least one first key point, and the image block to be embedded has a set size;
[0009] performing frequency domain transforms on the plurality of image blocks to be embedded using a first transform frequency group and a second transform frequency group, respectively, to obtain first transform coefficients and second transform coefficients corresponding to the plurality of image blocks to be embedded, wherein the horizontal transform frequencies and vertical transform frequencies respectively included in the first transform frequency group and the second transform frequency group are located in a set mid-frequency band;
[0010] adjusting first transform coefficients and second transform coefficients corresponding to respective ones of a plurality of image blocks to be embedded according to the target watermark information;
[0011] Perform frequency domain inverse transformation on the updated first transformation coefficients and the second transformation coefficients corresponding to each of the multiple image blocks to be embedded, so that the target watermark information is embedded in the multiple image blocks to be embedded.
[0012] In a second aspect, an embodiment of the present invention provides a blind watermark processing device, the device comprising:
[0013] An acquisition module, used to acquire target image and target watermark information;
[0014] A first determining module, configured to determine a plurality of first key points contained in the target image;
[0015] a second determining module, configured to determine, in the target image, a plurality of non-overlapping image blocks to be embedded according to the plurality of first key points, wherein each image block to be embedded includes at least one first key point and the image block to be embedded has a set size;
[0016] a transform module, configured to perform frequency domain transforms on the plurality of image blocks to be embedded using a first transform frequency group and a second transform frequency group, respectively, to obtain first transform coefficients and second transform coefficients corresponding to the plurality of image blocks to be embedded, wherein the horizontal transform frequencies and vertical transform frequencies included in the first transform frequency group and the second transform frequency group are located in a set mid-frequency band;
[0017] An adjustment module, configured to adjust first transform coefficients and second transform coefficients corresponding to respective ones of a plurality of image blocks to be embedded according to the target watermark information;
[0018] The inverse transformation module is configured to perform frequency domain inverse transformation on the updated first transformation coefficients and second transformation coefficients corresponding to each of the plurality of image blocks to be embedded, so as to embed the target watermark information into the plurality of image blocks to be embedded.
[0019] In a third aspect, an embodiment of the present invention provides an electronic device, comprising: a memory, a processor, and a communication interface; wherein, the memory stores executable code, and when the executable code is executed by the processor, the processor can at least implement the blind watermark processing method described in the first aspect.
[0020] In a fourth aspect, an embodiment of the present invention provides a non-transitory machine-readable storage medium, on which executable code is stored. When the executable code is executed by a processor of an electronic device, the processor can at least implement the blind watermark processing method described in the first aspect.
[0021] In a fifth aspect, an embodiment of the present invention provides a blind watermark processing method, which is applied to a cloud desktop server. The method includes:
[0022] Acquire a target image and target watermark information, wherein the target image is an image that needs to be transmitted to a cloud desktop client for display, and the target watermark information corresponds to the cloud desktop client;
[0023] Determining a plurality of key points contained in the target image;
[0024] Determining a plurality of non-overlapping image blocks to be embedded in the target image according to the plurality of key points, wherein each image block to be embedded contains at least one key point and the image block to be embedded has a set size;
[0025] performing frequency domain transforms on the plurality of image blocks to be embedded using a first transform frequency group and a second transform frequency group, respectively, to obtain first transform coefficients and second transform coefficients corresponding to the plurality of image blocks to be embedded, wherein the horizontal transform frequencies and vertical transform frequencies respectively included in the first transform frequency group and the second transform frequency group are located in a set mid-frequency band;
[0026] adjusting first transform coefficients and second transform coefficients corresponding to respective ones of a plurality of image blocks to be embedded according to the target watermark information;
[0027] Performing frequency domain inverse transformation on the updated first transform coefficients and second transform coefficients corresponding to each of the plurality of image blocks to be embedded, so that the target watermark information is embedded in the plurality of image blocks to be embedded;
[0028] The target image embedded with the target watermark information is transmitted to the cloud desktop client for display.
[0029] In a sixth aspect, an embodiment of the present invention provides a blind watermark processing device located at a cloud desktop server, the device comprising:
[0030] An acquisition module, configured to acquire a target image and target watermark information, wherein the target image is an image that needs to be transmitted to a cloud desktop client for display, and the target watermark information corresponds to the cloud desktop client;
[0031] A first determining module, configured to determine a plurality of key points contained in the target image;
[0032] a second determining module, configured to determine, in the target image according to the plurality of key points, a plurality of non-overlapping image blocks to be embedded, wherein each image block to be embedded contains at least one key point and the image block to be embedded has a set size;
[0033] a transform module, configured to perform frequency domain transforms on the plurality of image blocks to be embedded using a first transform frequency group and a second transform frequency group, respectively, to obtain first transform coefficients and second transform coefficients corresponding to the plurality of image blocks to be embedded, wherein the horizontal transform frequencies and vertical transform frequencies included in the first transform frequency group and the second transform frequency group are located in a set mid-frequency band;
[0034] An adjustment module, configured to adjust first transform coefficients and second transform coefficients corresponding to respective ones of a plurality of image blocks to be embedded according to the target watermark information;
[0035] an inverse transformation module, configured to perform frequency domain inverse transformation on the updated first transformation coefficients and second transformation coefficients corresponding to each of the plurality of image blocks to be embedded, so as to embed the target watermark information into the plurality of image blocks to be embedded;
[0036] The transmission module is used to transmit the target image embedded with the target watermark information to the cloud desktop client for display.
[0037] In the seventh aspect, an embodiment of the present invention provides an electronic device, comprising: a memory, a processor, and a communication interface; wherein, the memory stores executable code, and when the executable code is executed by the processor, the processor can at least implement the blind watermark processing method described in the fifth aspect.
[0038] In an eighth aspect, an embodiment of the present invention provides a non-transitory machine-readable storage medium, on which executable code is stored. When the executable code is executed by a processor of an electronic device, the processor can at least implement the blind watermark processing method described in the fifth aspect.
[0039] In a ninth aspect, an embodiment of the present invention provides a computer program product, which includes a computer program. When the computer program product is executed by a processor of an electronic device, the processor can at least implement the blind watermark processing method described in the first aspect.
[0040] The blind watermark processing scheme provided by an embodiment of the present invention embeds target watermark information in a target image. The scheme can first determine multiple image blocks corresponding to the target watermark information within the target image. The target watermark information is then added to the multiple image blocks within the target image using a frequency domain transform to obtain a target image embedded with the target watermark information. Specifically, the scheme first obtains the target image and target watermark information, determines multiple first key points within the target image, and determines multiple image blocks within the target image that contain at least one key point. The multiple image blocks are non-overlapping. Next, frequency domain transforms are performed on the multiple image blocks using two sets of transform frequency groups to obtain first transform coefficients and second transform coefficients corresponding to each of the multiple image blocks. The horizontal transform frequencies and vertical transform frequencies within each of the two transform frequency groups are within a predetermined mid-frequency band. The scheme then adjusts the first transform coefficients and second transform coefficients corresponding to each of the multiple image blocks based on the target watermark information to obtain updated first transform coefficients and second transform coefficients. Finally, frequency domain inverse transformation is performed on the updated first transformation coefficients and second transformation coefficients corresponding to each of the multiple image blocks to be embedded, so that the target watermark information is embedded in the multiple image blocks to be embedded.
[0041] In the above scheme, multiple image blocks (i.e., multiple embedding regions) corresponding to the target watermark information are determined based on multiple key points contained in the target image. The target watermark information is then embedded into the multiple image blocks using frequency domain embedding. This ensures that the target watermark information is embedded in multiple important regions of the target image, effectively reducing the risk of users easily circumventing the embedding regions by taking screenshots or other methods. Furthermore, during the embedding process, two sets of transform frequencies located in the mid-frequency band are used to perform frequency domain transforms on the multiple image blocks to be embedded, obtaining first and second transform coefficients corresponding to each of the multiple image blocks to be embedded. The target watermark information is then embedded by adjusting the first and second transform coefficients corresponding to each of the multiple image blocks to be embedded. Because the transform frequencies in the mid-frequency band have greater stability and anti-interference properties than low- and high-frequency transform frequencies, the target watermark information embedded in the target image has greater resistance to attacks. Under various attacks, such as photography, the target watermark information can be accurately extracted from the photographed image without being affected by chromatic aberration, moiré patterns, and other artifacts introduced by the photography process, thereby improving data security. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following is a brief introduction to the drawings required for use in the description of the embodiments. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0043] Figure 1 A flowchart of a blind watermark processing method provided by an embodiment of the present invention;
[0044] Figure 2 A schematic diagram of determining multiple image blocks to be embedded provided by an embodiment of the present invention;
[0045] Figure 3 A flowchart of a blind watermark embedding process provided by an embodiment of the present invention;
[0046] Figure 4 A schematic diagram of a blind watermark processing method provided by an embodiment of the present invention;
[0047] Figure 5 A schematic diagram of embedding target watermark information into a target image block to be embedded provided by an embodiment of the present invention;
[0048] Figure 6 A flowchart of another blind watermark processing method provided by an embodiment of the present invention;
[0049] Figure 7 A schematic diagram of determining whether a target parsed image block contains target watermark information provided by an embodiment of the present invention;
[0050] Figure 8 A flowchart of another blind watermark processing method provided by an embodiment of the present invention;
[0051] Figure 9 A schematic structural diagram of a blind watermark processing device provided by an embodiment of the present invention;
[0052] Figure 10 A schematic structural diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0053] To make the objectives, technical solutions, and advantages of the embodiments of the present invention more clear, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.
[0054] 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, stored data, displayed data, etc.) involved in the embodiments of the present invention are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0055] The following describes some embodiments of the present invention in detail with reference to the accompanying drawings. The following embodiments and features thereof may be combined with one another unless they conflict with each other. Furthermore, the sequence of steps in the following method embodiments is provided for illustrative purposes only and is not intended to be a strict limitation.
[0056] In practical applications, watermarks commonly found in data such as images and videos are divided into two types: explicit watermarks and blind watermarks. Directly adding explicit watermarks to data can be easily perceived by users, leading to circumvention of the watermark using methods such as fuzzy watermarks, thus failing to ensure data security. Adding blind watermarks to data is less easily perceived by users, preventing circumvention methods such as fuzzy watermarks and providing better data security protection. Therefore, blind watermarks are often used in applications with high data security requirements.
[0057] In traditional blind watermark processing solutions, spatial domain embedding is usually used to add blind watermarks to images. However, the spatial domain embedding method mainly embeds watermark information by adding a transparent layer to the image. Then, when the user takes a photo of the image with the transparent layer added, the transparent layer cannot be captured due to problems such as chromatic distortion and moiré introduced by taking a photo. As a result, the blind watermark embedded in the photographed image cannot be recognized when the photographed image is analyzed.
[0058] Based on this, an embodiment of the present invention provides a new blind watermark processing scheme. According to multiple key points contained in the target image, multiple non-overlapping image blocks to be embedded are determined in the target image, and the target watermark information is embedded into the multiple image blocks to be embedded through frequency domain embedding, so that the target watermark information is added to multiple important areas in the target image, and the data security protection of the key information at different positions in the target image is achieved. In addition, when the target watermark information is embedded into the multiple image blocks to be embedded using the frequency domain embedding method, the target watermark information is embedded using a transformation frequency located in the mid-frequency band area. This allows the embedded target watermark information to better resist problems such as coding compression and image chromatic distortion, and has better anti-interference performance. In various attack situations such as taking photos, the target watermark information can still be accurately extracted from the photographed image to prove the source of the data, thereby improving the data security protection capability.
[0059] The following is a detailed introduction to the blind watermark processing solution provided in the embodiment of the present invention.
[0060] Figure 1 A flow chart of a blind watermark processing method provided by an embodiment of the present invention is shown in FIG. Figure 1 As shown, the method may include the following steps:
[0061] 101. Obtain target image and target watermark information.
[0062] 102. Determine a plurality of first key points contained in the target image.
[0063] 103. Determine a plurality of non-overlapping image blocks to be embedded in the target image according to the plurality of first key points, wherein each image block to be embedded includes at least one first key point and has a set size.
[0064] 104. Perform frequency domain transforms on the plurality of image blocks to be embedded using the first transform frequency group and the second transform frequency group, respectively, to obtain first transform coefficients and second transform coefficients corresponding to the plurality of image blocks to be embedded, wherein the horizontal transform frequencies and vertical transform frequencies respectively included in the first transform frequency group and the second transform frequency group are located in a set mid-frequency band.
[0065] 105. Adjust first transform coefficients and second transform coefficients corresponding to each of a plurality of image blocks to be embedded according to target watermark information.
[0066] 106. Perform frequency domain inverse transformation on the updated first transform coefficients and second transform coefficients corresponding to each of the multiple image blocks to be embedded, so as to embed target watermark information into the multiple image blocks to be embedded.
[0067] The blind watermark processing method provided in an embodiment of the present invention can be used to add blind watermarks to various images, videos, and other data to protect data security. Specifically, when performing blind watermark processing, the target image and target watermark information are first obtained. The target image can be any image to be embedded with a blind watermark, such as a cloud desktop image or an image frame contained in a video. The target watermark information refers to the specific content corresponding to the blind watermark embedded in the target image and can be customized.
[0068] In practical applications, the initial watermark information is generally non-encoded string information (such as text, letters, etc.). Therefore, before embedding the target watermark information into the target image, the initial watermark information can be converted into a binary string to embed the watermark information in binary string format into the target image.
[0069] In an optional embodiment, the specific implementation process for obtaining the target watermark information may include converting the initial watermark information in a non-binary string format into an initial binary string, and setting an error correction code on the initial binary string to obtain a target binary string serving as the target watermark information. The initial watermark information may be converted into a binary string by performing binary encoding on each character in the initial watermark information. Specifically, each character in the initial watermark information may be binary encoded using ASCII code, Unicode encoding, or the like to obtain the initial binary string.
[0070] Furthermore, in practical applications, when users transmit the data contained in a target image by photographing it, the effects of the photographic process may cause deviations in certain bits of the target watermark information in the photographed image, making it impossible to accurately extract the target watermark information from the photographed image. To improve the robustness of the target watermark information, after obtaining the initial binary string, an error correction code can be applied to the initial binary string to increase error tolerance. The error correction code can be a BCH error correction code, a CRC code, a Hamming code, or a RS code. For example, a BCH error correction code can be used to add redundant information to the initial binary string to improve error tolerance and obtain the target binary string.
[0071] Because error correction codes are added to the target binary string used as the target watermark information, when extracting the watermark information, the extracted binary string can be error-corrected before recognition analysis is performed on the corrected binary string. This helps achieve more accurate extraction results. For example, if the camera's effects cause the recognition of several bits of the target watermark information in the photographed image to be incorrectly recognized, the error correction code can correct the erroneous encoding and obtain a more accurate target watermark information.
[0072] It is understandable that in the embodiment of the present invention, the length of the target binary string serving as the target watermark information is fixed. After obtaining the target image and the target watermark information, the multiple first key points contained in the target image are then determined. The first key points may be image feature points corresponding to key areas in the target image, such as relatively prominent pixel points, contour points, bright spots in darker areas, dark spots in brighter areas, etc. in the target image. Key point detection may be performed on the target image using a key point detection algorithm to determine the multiple first key points contained in the target image. The key point detection algorithm may be an ORB algorithm, a Fast algorithm, etc., and the corresponding key point detection algorithm may be selected according to actual needs to determine the multiple first key points contained in the target image.
[0073] For example, the ORB algorithm is used to detect the key points contained in the target image as multiple first key points. The ORB algorithm can quickly detect the position of the pixel point where the pixel value in the target image changes suddenly as a key point, and calculate the descriptor of the key point based on its neighborhood pixels. The specific execution process of the ORB algorithm can refer to the existing related technology implementation and will not be described here. It is only emphasized here that when the ORB algorithm is used to detect the key points of the target image, not only the coordinate information corresponding to each first key point can be obtained, but also the descriptor corresponding to each first key point can be obtained. Among them, the descriptor includes a variety of feature information of the corresponding first key point, including intensity information, angle information, etc. Intensity information refers to the degree of difference between the pixel values of a first key point and the surrounding pixels.
[0074] After determining the multiple first key points contained in the target image, the embedding position corresponding to the target watermark information can be determined based on the multiple first key points. Specifically, in an embodiment of the present invention, after determining the multiple first key points, multiple non-overlapping image blocks to be embedded are determined in the target image based on the multiple first key points to be used for embedding the target watermark information respectively. Each image block to be embedded contains at least one first key point, and the image block to be embedded has a set size, wherein the size of the image block to be embedded can be set to a rectangular area of size*size, for example, the image block to be embedded is a rectangular area of 20*20 size, etc. The size of the image block to be embedded is related to the length of the target binary string as the target watermark information. The longer the length of the target binary string, the larger the set size corresponding to the image block to be embedded.
[0075] Optionally, a specific implementation method of determining a plurality of non-overlapping image blocks to be embedded from a target image based on a plurality of first key points may be: determining a plurality of first key points contained in the target image and the intensity values of the plurality of first key points, the intensity values being used to reflect the degree of difference between the pixel values of the corresponding first key points and the surrounding pixel points; sorting the plurality of first key points according to their intensity values; and determining a plurality of non-overlapping image blocks to be embedded in the target image in sequence based on the sorting results.
[0076] That is, multiple first key points are detected in the target image, and coordinate information and descriptors corresponding to the multiple first key points are obtained. The descriptors corresponding to the multiple first key points contain intensity information corresponding to the first key points. After obtaining the intensity information corresponding to each first key point, the multiple first key points are sorted in descending order of intensity information to obtain a sorting result corresponding to the multiple first key points. For example, assuming that five key points are detected in target image A: key point 1 to key point 5, and the five key points are sorted according to their corresponding intensity information, the resulting sorting result is assumed to be: key point 5, key point 2, key point 1, key point 4, key point 3.
[0077] After obtaining the sorting results of multiple first key points, each first key point is traversed in sequence according to the sorting results, and a rectangular area of a preset size is created with the currently traversed first key point as the center. If this rectangular area does not overlap with the previously determined image block to be embedded, the rectangular area is determined as a new image block to be embedded. Otherwise, the first key point is deleted and the corresponding rectangular area is not used as an image block to be embedded. In actual applications, the rectangular area may contain other first key points. In this case, when the rectangular area is determined as an image block to be embedded, it means that these other first key points contained therein do not need to be traversed again (because another rectangular area determined by other first key points will overlap with the rectangular area determined by the current first key point).
[0078] Following the above examples, combined with Figure 2 The implementation process of determining multiple image blocks to be embedded is exemplified. Assume that 5 key points are detected in the target image A. According to the intensity information, the 5 key points are sorted, and the sorting results are key point 5, key point 2, key point 1, key point 4, and key point 3. According to the sorting results, each key point is traversed separately. First, a rectangular area of size*size with key point 5 as the center is determined as an image block k1 to be embedded. If this image block k1 to be embedded contains key point 2, key point 2 will no longer be traversed. Then the next key point 1 is determined. With key point 1 as the center, a rectangular area of size*size is determined. It is judged whether the rectangular area has an overlapping area with the image block k1 to be embedded corresponding to key point 5. Figure 2It can be seen that the rectangular area overlaps with the image block k1 to be embedded corresponding to the key point 5, so the key point 1 is deleted; then the next key point 4 is determined, and a rectangular area of size*size is determined in the same way. If the rectangular area does not overlap with the image block k1 to be embedded, the rectangular area is retained and determined as the image block k2 to be embedded corresponding to the key point 4; then, the next key point 3 is determined, and a rectangular area of size*size is also determined, and it is determined whether the rectangular area overlaps with the image blocks k1 to be embedded and the image blocks k2 to be embedded. Figure 2 It can be seen that the rectangular area does not overlap with the image block k1 to be embedded and the image block k2 to be embedded, so the rectangular area is retained and determined as the image block k3 to be embedded corresponding to the key point 3.
[0079] The above-mentioned sorting of key points based on their strength information enables important key points to be arranged at a front position. In this way, when determining the image blocks to be embedded based on the key point sorting result, it can be ensured that the image blocks containing important key points are retained.
[0080] In an optional embodiment, the number of image blocks to be embedded that need to be determined in the target image may not be set. However, in another optional embodiment, the number of image blocks to be embedded may be pre-set, and according to the preset number of image blocks to be embedded and the sorting results corresponding to the plurality of first key points, the preset number of image blocks to be embedded is determined in the target image in sequence. The preset number K of image blocks to be embedded can be any value. The larger K is, the more blind watermarks are embedded and the more robust the watermark is, but the greater the impact on the quality of the target image is. However, if the value of K is too small, the user may bypass the blind watermark when obtaining the target image by taking a screenshot or other means. Therefore, in actual applications, the value of K can be set according to the actual data security protection required by the target image. For example, the value of K can be 20.
[0081] In a specific implementation, when traversing multiple first key points, if a preset number of image blocks to be embedded has been obtained before all first key points have been traversed, traversing the subsequent multiple first key points can be stopped, and the multiple image blocks to be embedded currently determined can be used as the embedding area. However, in actual applications, there may be a situation where the multiple first key points contained in the target image are densely packed or the number of determined first key points is small. When the multiple first key points contained in the target image are densely packed or the number of determined first key points is small, it may be impossible to determine the preset number of image blocks to be embedded in the target image based on the multiple first key points.
[0082] In order to ensure the robustness of the blind watermark, after traversing the above-mentioned multiple first key points, if it is found that the number of image blocks to be embedded does not meet the preset number, some more key points can be selected at the edge position of the target image, and the traversal of the image blocks to be embedded can be continued until the number of image blocks to be embedded meets the requirement of the preset number of image blocks to be embedded.
[0083] The edge position of the target image refers to a portion of the local area of the image where the brightness changes significantly. The grayscale profile of this area can be regarded as a step, that is, a grayscale value changes sharply from one grayscale value within a very small buffer area to another grayscale value with a large grayscale difference. Usually, the edge position of an image concentrates most of the feature information of the image. Therefore, selecting multiple pixel points from the edge position of the target image to continue to determine the image blocks to be embedded based on the multiple pixel points can better distribute the determined multiple image blocks to be embedded in various important areas of the target image. Specifically, assuming that the number of the multiple image blocks to be embedded is set to a first number, if the number of image blocks to be embedded determined in the target image based on the sorting results of the multiple first key points is less than the first number, then multiple pixel points corresponding to the edge position in the target image are determined to determine a second number of non-overlapping image blocks to be embedded in the target image based on these multiple pixel points, so that the number of image blocks to be embedded reaches the first number.
[0084] For example, assuming that the number of multiple embedded image blocks set for the target image A is 20, 15 image blocks to be embedded are determined in the target image A based on the sorting results of the aforementioned multiple first key points, and then multiple pixel points can be selected from the edge position, and the multiple pixel points can be traversed in sequence in a random order to determine a rectangular area of the preset size (size*size) centered on the currently traversed pixel point. If the rectangular area does not overlap with the 15 image blocks to be embedded determined above, the rectangular area is retained as the image block to be embedded corresponding to the pixel point; if the rectangular area overlaps with the 15 image blocks to be embedded determined above, the pixel point is deleted, and then the next pixel point is traversed, and so on, until 20 image blocks to be embedded are determined.
[0085] In addition, in an optional embodiment, an edge detection algorithm can be used to determine multiple pixel points corresponding to edge positions in the target image. The edge detection algorithm can be a Canny edge detection algorithm, etc. Taking the Canny edge detection algorithm as an example, the Canny edge detection algorithm is essentially equivalent to implementing a binary classification process of whether each pixel in the target image is located at an edge position. The algorithm will output a binary image, wherein the pixel points corresponding to the edge position in the target image have a pixel value of 255 in the binary image, and the pixel points in the target image that are not located at the edge position have a pixel value of 0 in the binary image. Therefore, the pixel points with a pixel value of 255 in the binary image are the multiple pixel points corresponding to the edge position in the target image.
[0086] Afterwards, the target watermark information is embedded into multiple image blocks using frequency domain embedding. Compared with spatial domain watermark embedding, frequency domain embedding has less impact on the quality of the target image, providing a better user experience.
[0087] Specifically, frequency domain transforms are first performed on multiple image blocks to be embedded using a first transform frequency group and a second transform frequency group, respectively, to obtain first transform coefficients and second transform coefficients corresponding to each of the multiple image blocks to be embedded. The horizontal transform frequencies and vertical transform frequencies contained in the first transform frequency group and the second transform frequency group are located in a predetermined mid-frequency band. Subsequently, the first transform coefficients and second transform coefficients corresponding to each of the multiple image blocks to be embedded are adjusted based on the target watermark information. An inverse frequency domain transform is then performed on the updated first transform coefficients and second transform coefficients corresponding to each of the multiple image blocks to be embedded, so that the target watermark information is embedded in the multiple image blocks to be embedded.
[0088] The reason for selecting a mid-band transformation frequency to embed the target watermark information is that if a low-band transformation frequency is used to embed the target watermark information, the user will be able to visually perceive the presence of the target watermark information, affecting the user experience. If a high-band transformation frequency is used to embed the target watermark information, although the user will not be able to clearly perceive it with the naked eye, the high-frequency information in the target image will be significantly affected in the image quality of the photographed image when the photograph is taken, making it difficult to accurately extract the target watermark information from the photographed image. The mid-band transformation frequency has better stability and anti-interference properties. Therefore, in the embodiment of the present invention, a mid-band transformation frequency is used to embed the target watermark information in the target image when performing frequency domain transformation.
[0089] In an embodiment of the present invention, the values of the horizontal conversion frequency and the vertical conversion frequency in the two conversion frequency groups can be set according to actual needs, and the horizontal conversion frequency and the vertical conversion frequency contained in each of the two conversion frequency groups can be located in the set mid-frequency band.
[0090] Each transformation frequency group includes both horizontal and vertical transformation frequencies, effectively performing a two-dimensional frequency domain transformation on each image block to be embedded. Two transformation frequency groups are required because the target binary string, serving as the target watermark information, includes both "1" and "0" bit values that need to be embedded.
[0091] The frequency conversion method adopted in the embodiment of the present invention may be a discrete cosine transform (DCT) method, but is not limited thereto.
[0092] After determining the two transformation frequency groups, each image block to be embedded is subjected to a frequency domain transform (from the spatial domain to the frequency domain) using the two transformation frequency groups to obtain the first transformation coefficient and the second transformation coefficient corresponding to the image block to be embedded. The target watermark information can then be embedded into each image block to be embedded by adjusting the two transformation coefficients corresponding to each image block to be embedded. Finally, an inverse frequency domain transform (from the frequency domain to the spatial domain) is performed on the updated first and second transformation coefficients corresponding to each of the multiple image blocks to be embedded, so that the target watermark information is embedded in the multiple image blocks to be embedded.
[0093] In summary, in this embodiment of the present invention, multiple image blocks (i.e., multiple embedding regions) corresponding to the target watermark information are determined by using multiple key points contained in the target image. The target watermark information is then embedded into these multiple image blocks using a frequency-domain embedding method. This ensures that the target watermark information is embedded in multiple important regions of the target image, enhancing the data security of the target image. Furthermore, during the watermark embedding process, a mid-band frequency shift is selected to embed the target watermark information in the target image. This ensures that the watermark information is not easily interfered with by video or other video feeds while maintaining a good visual experience for the user.
[0094] The above embodiment introduces the implementation process of embedding the target watermark information into multiple image blocks to be embedded based on the frequency domain embedding method. In order to facilitate a clearer understanding of the embedding process of the target watermark information, the specific implementation process of embedding the target watermark information into multiple image blocks to be embedded is exemplified in combination with the following embodiment.
[0095] Figure 3 A flowchart of a blind watermark embedding process provided by an embodiment of the present invention is shown in FIG. Figure 3 As shown, the method may include the following steps:
[0096] 301 . Divide a target image block to be embedded into sub-blocks to obtain a plurality of image sub-blocks to be embedded contained in the target image block to be embedded. The target image block to be embedded is any image block among the plurality of image blocks to be embedded.
[0097] 302. Determine a target image sub-block to be embedded corresponding to a target bit value from a plurality of image sub-blocks to be embedded according to a set embedding order. The target bit value is the value of any bit in a target binary string serving as target watermark information.
[0098] 303 . Perform frequency domain transform on the target to-be-embedded image sub-block using the first transform frequency group and the second transform frequency group respectively to obtain third transform coefficients and fourth transform coefficients corresponding to the target to-be-embedded image sub-block.
[0099] 304 . Determine a first statistical value and a second statistical value in the third transform coefficient and the fourth transform coefficient corresponding to the target to-be-embedded image sub-block, where the first statistical value is greater than the second statistical value.
[0100] 305. If the target bit value is the first binary value, adjust the third transform coefficient and the fourth transform coefficient so that the third transform coefficient is greater than the fourth transform coefficient.
[0101] 306. If the target bit value is the second binary value, adjust the third transform coefficient and the fourth transform coefficient so that the third transform coefficient is smaller than the fourth transform coefficient.
[0102] 307 . Perform frequency domain inverse transform on the updated third transform coefficient and fourth transform coefficient corresponding to the target to-be-embedded image sub-block, so as to embed the target bit value into the target to-be-embedded image sub-block.
[0103] As mentioned above, a target watermark is typically encoded as a corresponding target binary string. This target binary string has a set length, i.e., it consists of a set number of bit values. To ensure that each bit value in the target watermark is added to each image block to be embedded, each image block to be embedded can be first segmented according to the length of the target binary string to obtain multiple image sub-blocks corresponding to each image block to be embedded. The bit values in the target binary string are then embedded one-to-one into each image sub-block within each image block to be embedded.
[0104] It can be seen that the preset size of the image block to be embedded is related to the length of the target binary string, and is also related to the size of each image sub-block to be embedded. Optionally, the set size of the image block to be embedded can be determined according to the following formula: size*size: Here, size refers to the side length of the image block to be embedded, ceil refers to the rounding operation, and len(wmString) refers to the length of the target watermark information. wmString represents the target binary string serving as the target watermark information. n refers to the side length of the set image sub-block, where the size of the image sub-block is: side length * side length. In specific implementations, the image sub-block size can be set in advance. For example, if the set image sub-block size is 8*8, that is, its side length is 8, and assuming the length of the target binary string is 5 bits, then the set size of the image block to be embedded can be 24*24. Thus, by dividing the image block to be embedded according to this image sub-block size, nine 8*8 image sub-blocks to be embedded can be obtained. In this case, the number of image sub-blocks to be embedded is greater than or equal to the length of the target binary string.
[0105] In this embodiment, any one of the aforementioned multiple image blocks to be embedded is used as a target image block to be embedded to illustrate how to embed the bit values in the target binary string into the target image block to be embedded. The target image block to be embedded is divided according to a predetermined image sub-block size to obtain multiple image sub-blocks to be embedded. When embedding the bit values in the target binary string into the target image block to be embedded, an embedding order must first be determined to establish a one-to-one correspondence between the bit values in the target binary string and the multiple image sub-blocks to be embedded contained in the target image block to be embedded. It will be appreciated that when the number of the multiple image sub-blocks to be embedded is greater than the number of bit values contained in the target binary string, some of the image sub-blocks to be embedded do not need to have the bit values contained in the target binary string embedded.
[0106] In practical applications, the embedding order can be "top-down, left-to-right", that is, each row in the target image block to be embedded is traversed from top to bottom, and for the currently traversed row, each image sub-block to be embedded in this row is traversed from left to right.
[0107] For example, Figure 4 As shown in the figure, when the target image block to be embedded is segmented, nine image sub-blocks to be embedded are obtained. The embedding order is shown in the figure by the number of each image sub-block to be embedded. Assuming that the target binary string includes eight bit values, namely 11000101, image sub-block 1 is determined as the image sub-block to be embedded corresponding to the first bit value 1, image block 2 is determined as the image sub-block to be embedded corresponding to the second bit value 1, and image sub-block 3 is determined as the image sub-block to be embedded corresponding to the third bit value 0. The same logic is used to determine the image sub-blocks to be embedded corresponding to each bit value.
[0108] Since the bit value embedding process for each target image block to be embedded is the same, here we only take the embedding of the target bit value into any target image sub-block to be embedded as an example. It can be understood that the correspondence between the target bit value and the target image sub-block to be embedded is determined by the above-mentioned embedding order.
[0109] Specifically, a frequency domain transform is performed on the target image sub-block to be embedded using the first transform frequency group and the second transform frequency group, respectively, to obtain third and fourth transform coefficients corresponding to the target image sub-block to be embedded. The target bit value is then embedded into the third and fourth transform coefficients according to a predetermined embedding rule.
[0110] As previously mentioned, the transform frequencies in the two transform frequency groups can be selected from the mid-frequency band. Under the constraints of the aforementioned image block size, when using the DCT transform, the corresponding frequency range can be expressed as: T*k / n, where T = 2π, n represents the side length of the image sub-block, and k is a frequency coefficient with a value range of [0, n-1]. The mid-frequency band is the middle portion of the frequency range, i.e., the middle portion of the value range of k. In practical applications, multiple image blocks to be embedded share the same first and second transform frequency groups. For ease of description, the horizontal and vertical transform frequencies in the first transform frequency group are denoted as the first horizontal transform frequency and the first vertical transform frequency, and the horizontal and vertical transform frequencies in the second transform frequency group are denoted as the second horizontal transform frequency and the second vertical transform frequency. In practical applications, the first horizontal transform frequency and the first vertical transform frequency can be different, and the second horizontal transform frequency and the second vertical transform frequency can be different. Optionally, under the hypothetical situation of the above-mentioned frequency range, the frequency coefficient k corresponding to the first horizontal transformation frequency and the first vertical transformation frequency can be set to (3, 4), and the frequency coefficient k corresponding to the second horizontal transformation frequency and the second vertical transformation frequency can be set to (4, 3), but is not limited to this.
[0111] The embedding rule may utilize the size relationship between the two transform coefficients to implement bit value embedding. For example, when the target bit value is a first binary value (e.g., 0), the third transform coefficient may be adjusted to be greater than the fourth transform coefficient; and when the target bit value is a second binary value (e.g., 1), the third transform coefficient may be adjusted to be less than the fourth transform coefficient. Other embedding rules may also be used to implement bit value embedding, and the present invention is not limited thereto.
[0112] Under the constraints of the above-mentioned embedding rules, in an optional embodiment, assuming that the target bit value is 0, in order to adjust the third transform coefficient and the fourth transform coefficient so that the adjusted third transform coefficient is greater than the adjusted fourth transform coefficient, the adjustment method may be: increase the set value for the third transform coefficient and decrease the set value for the fourth transform coefficient, and the set value may be pre-set. Similarly, if the target bit value is 1, in order to adjust the third transform coefficient and the fourth transform coefficient so that the adjusted third transform coefficient is less than the adjusted fourth transform coefficient, the adjustment method may be: decrease the set value for the third transform coefficient and increase the set value for the fourth transform coefficient. Since it is difficult to determine the set value that meets the above requirements, the embodiment of the present invention provides another method for adjusting the third transform coefficient and the fourth transform coefficient.
[0113] Specifically, a first statistical value and a second statistical value are determined for the third transform coefficient and the fourth transform coefficient corresponding to the target to-be-embedded image sub-block, where the first statistical value is greater than the second statistical value. Thus, if the target bit value is a first binary value (e.g., 0), the third transform coefficient and the fourth transform coefficient are adjusted based on the first statistical value and the second statistical value so that the third transform coefficient is greater than the fourth transform coefficient. If the target bit value is a second binary value, the third transform coefficient and the fourth transform coefficient are adjusted based on the first statistical value and the second statistical value so that the third transform coefficient is less than the fourth transform coefficient.
[0114] Optionally, the first statistical value and the second statistical value can be the maximum value c1 and the minimum value c2 of the two transform coefficients, respectively, and the difference between the maximum value c1 and the minimum value c2 can be determined as follows: d = c1 - c2. Thus, adjusting the third and fourth transform coefficients so that the third transform coefficient is greater than the fourth transform coefficient can be accomplished by increasing the third transform coefficient by a predetermined multiple of the difference value d and decreasing the fourth transform coefficient by a predetermined multiple of the difference value d. Similarly, adjusting the third and fourth transform coefficients so that the third transform coefficient is less than the fourth transform coefficient can be accomplished by decreasing the third transform coefficient by a predetermined multiple of the difference value d and increasing the fourth transform coefficient by a predetermined multiple of the difference value d. The predetermined multiple can be, for example, a value such as 0.5 or 1.
[0115] The above method realizes updating the third transform coefficient and the fourth transform coefficient according to the target bit value. Afterwards, the updated third transform coefficient and the fourth transform coefficient corresponding to the target image sub-block to be embedded are subjected to frequency domain inverse transform so that the target bit value is embedded in the target image sub-block to be embedded.
[0116] Similarly, the embedding process of the bit values corresponding to the other image sub-blocks to be embedded in the target image block to be embedded is completed, thereby realizing the embedding of the target binary string in the target image block to be embedded.
[0117] The following combination Figure 5The specific implementation process of embedding the target binary string into the target image block to be embedded is illustrated by an example. First, the target image block to be embedded, Ki, is divided into nine 8*8 image sub-blocks to be embedded. Then, according to the set embedding order, the image sub-blocks to be embedded corresponding to the respective bit values in the target binary string are sequentially determined. For the currently traversed target image sub-block to be embedded, a frequency domain transform is performed on the target image sub-block using the frequency coefficients k corresponding to the first transform frequency group (i, j) and the frequency coefficients k corresponding to the second transform frequency group (j, i), respectively. This yields the third transform coefficients DCT(i, j) and the fourth transform coefficients DCT(j, i) corresponding to the target image sub-block to be embedded. (i, j) indicates that the frequency coefficient k corresponding to the horizontal transform frequency is i and the frequency coefficient k corresponding to the vertical transform frequency is j; (j, i) indicates that the frequency coefficient k corresponding to the horizontal transform frequency is j and the frequency coefficient k corresponding to the vertical transform frequency is i. Determine the maximum and minimum values of the two transform coefficients corresponding to the target image sub-block to be embedded: c1 = Max(DCT(i,j), DCT(j,i)), c2 = Min(DCT(i,j), DCT(j,i)), and determine d = c1 - c2. If the target bit value corresponding to the target image sub-block to be embedded is 0, adjust the third transform coefficient to DCT'(i,j) = c2 + d / 2, and adjust the fourth transform coefficient to DCT'(j,i) = c1 - d / 2. If the target bit value corresponding to the target image sub-block to be embedded is 1, adjust the third transform coefficient to DCT'(i,j) = c2 - d / 2, and adjust the fourth transform coefficient to DCT'(j,i) = c1 + d / 2. Then, process the next image sub-block to be embedded, and continue processing until the last image sub-block to be embedded is processed.
[0118] In practical applications, embedding the target watermark information into multiple image blocks to be embedded in the target image by modifying the transformation coefficients described above may result in a reduction in the image quality of some image blocks, and even affect the detection results of key points contained therein. As a result, when key point detection is subsequently performed on the target image embedded with the target watermark information, key points may not be detected in some image blocks that were originally embedded with the watermark information. To avoid this situation, in an embodiment of the present invention, after embedding the target watermark information in the multiple image blocks to be embedded, a screening process may be performed on the multiple image blocks to be embedded with the target watermark information.
[0119] Optionally, the specific implementation process of screening the multiple image blocks to be embedded with the target watermark information may include: performing key point detection on the target image embedded with the target watermark information to obtain multiple second key points, determining the image blocks to be embedded that do not contain the second key points among the multiple image blocks to be embedded, and ultimately determining that the target watermark information is not added to the image blocks to be embedded that do not contain the second key points. The specific method of key point detection can refer to the key point detection method in the above embodiment, or a key point detection method different from the above embodiment can be used.
[0120] In a specific implementation, if the second key point is not detected in a certain image block to be embedded in the target image in which the target watermark information is embedded, the image block to be embedded in which the target watermark information is embedded can be replaced with the original image block to be embedded in which the target watermark information is not embedded. In practical applications, after obtaining multiple image blocks to be embedded in the target image (which have not yet been embedded with the target watermark information), these image blocks to be embedded can be temporarily stored. When it is determined through the above screening process that some of the image blocks to be embedded should not be embedded with the target watermark information, the corresponding image blocks not yet embedded with the target watermark information can be restored.
[0121] It is understandable that if, during a key point extraction operation on the target image embedded with the target watermark information, no key points are detected in the image block originally embedded with the watermark information, it indicates that the embedding of the watermark information has caused the loss of key points in that image block. In this case, in the photographed image obtained after performing a photo feed on the target image embedded with the target watermark information, key points will no longer be detected in the image block at that location, and the watermark cannot be extracted from that image block. Therefore, the above-mentioned screening process can filter out image blocks where key points have been lost due to the embedding of the target watermark information, thereby improving the robustness of the watermark embedding result.
[0122] In practical applications, the purpose of embedding target watermark information in the target image is mainly to protect the data security and facilitate the subsequent tracing of the leakage source. When performing security tracing, the processing object is the image to be parsed obtained by a certain operation behavior (such as taking a photo, screenshot, etc.) on the target image embedded with the watermark information. It is necessary to extract the watermark information in the image to be parsed. When the target watermark information embedded in the target image is extracted, it means that the user who performed the above operation behavior is disseminating the target image in an unauthorized manner. Figure 6 and Figure 7 The process of extracting target watermark information is illustrated with an example.
[0123] Figure 6 A flowchart of another blind watermark processing method provided by an embodiment of the present invention is shown in FIG. Figure 6 As shown, based on the above embodiment, the method further includes the following steps:
[0124] 601. Obtain an image to be parsed obtained by performing a set operation on a target image.
[0125] 602. Determine a plurality of third key points contained in the image to be parsed.
[0126] 603 . Determine, according to the set size, a plurality of image blocks to be parsed corresponding to the plurality of third key points in the image to be parsed.
[0127] 604. Determine whether each of the multiple image blocks to be parsed contains target watermark information.
[0128] In actual applications, users often disseminate target images by photographing or capturing them. Therefore, when extracting the target watermark information, the first step is to obtain the image to be parsed, which is obtained by performing a set operation on the target image. The set operation can be taking a photo or screenshot, and the image to be parsed refers to the disseminated image containing the target image content.
[0129] After obtaining the image to be parsed, a plurality of third key points contained in the image to be parsed are determined. Here, a key point detection algorithm can be used to perform key point detection on the image to be parsed to determine the plurality of third key points contained in the image to be parsed.
[0130] Before determining the plurality of third key points contained in the image to be analyzed, the method may further include: performing image perspective transformation on the image to be analyzed to achieve alignment correction of the image to be analyzed. The image to be analyzed may be corrected horizontally and vertically.
[0131] Specifically, taking the act of taking a photo as an example, the image to be parsed obtained by taking a photo of the target image may often contain, in addition to the content contained in the target image, an image area of the photographing environment. For example, in a cloud desktop scenario, in addition to the cloud desktop image, the image to be parsed may also contain images of the display frame and other environments around the display. Therefore, optionally, the environmental image area can be first identified and removed from the image to be parsed, such as retaining only the cloud desktop image area. The retained image area is then subjected to perspective transformation processing. For the above-mentioned retained image area, the image area may not be a rectangular image area aligned horizontally and vertically. For example, it may present a non-rectangular image area similar to a trapezoid. First, the four vertex coordinates after correcting it to a rectangular image area can be estimated based on the aspect ratio corresponding to the non-rectangular image area. Then, based on the four vertex coordinates of the non-rectangular image area and the estimated four vertex coordinates, a perspective transformation matrix is obtained to complete the perspective transformation processing according to the perspective transformation matrix to obtain a rectangular image.
[0132] After obtaining the multiple third key points contained in the image to be parsed, multiple image blocks to be parsed corresponding to the multiple third key points are determined in the image to be parsed based on the set size corresponding to the image block to be embedded used during watermark embedding. In this case, the number of image blocks to be parsed is equal to the number of the multiple third key points, that is, each third key point determines a single image block to be parsed, and different image blocks to be parsed may overlap.
[0133] Finally, each of the multiple image blocks to be parsed is determined to contain the target watermark information. For each image block to be parsed, determining whether it contains the target watermark information is similar to determining whether the target binary string serving as the target watermark information is embedded therein, a process similar to the embedding process. Specifically, taking any target image block to be parsed as an example, the target image block to be parsed is divided into sub-blocks to obtain multiple image sub-blocks to be parsed contained within the target image block to be parsed. The number of these multiple image sub-blocks to be parsed is the same as the number of image sub-blocks to be embedded into the image block to be embedded when embedding the target watermark information. In other words, the size of the image to be parsed is the same as the size of the target image, and the size of the image sub-block to be parsed is the same as the size of the image sub-block to be embedded during the embedding process. Subsequently, a frequency domain transform is performed on the target image sub-block to be parsed using the first transform frequency group and the second transform frequency group, respectively, to obtain fifth and sixth transform coefficients corresponding to the target image sub-block to be parsed. The target image sub-block to be parsed is any one of the multiple image sub-blocks to be parsed. Afterwards, based on the embedding rules introduced above, it can be judged that: if the fifth transform coefficient is greater than the sixth transform coefficient, the bit value contained in the target image sub-block to be parsed is determined to be the first binary value (for example, 0); if the fifth transform coefficient is less than the sixth transform coefficient, the bit value contained in the target image sub-block to be parsed is determined to be the second binary value (for example, 1). In this way, the identification of the bit value corresponding to one image sub-block to be parsed is completed, and the identification process of other image sub-blocks to be parsed is the same.
[0134] Next, the decoded watermark is determined based on the bit values corresponding to the multiple image sub-blocks to be decoded and the embedding order of the target watermark. Specifically, the bit values extracted from the multiple image sub-blocks to be decoded are concatenated in an order consistent with the embedding order to form a recognized binary string. Furthermore, as mentioned above, if the target watermark utilizes an error-correcting code, the recognized binary string can be corrected to produce a corrected binary string.
[0135] Finally, if the parsed watermark information is consistent with the target watermark information, it is determined that the target image block to be parsed contains the target watermark information. If the parsed watermark information is inconsistent with the target watermark information, it cannot be directly determined that the target image to be parsed does not contain the target watermark information. Optionally, the image block obtained by offsetting the target image block to be parsed by a set distance can be used as a newly added image block to be parsed, and then the new image block to be parsed is analyzed to determine whether it contains the target watermark information.
[0136] Because in actual applications, taking photos and other methods will cause the positions of some pixels in the target image to be offset in the image to be parsed obtained by taking photos, then the target watermark information is not extracted from a certain image block to be parsed originally determined, and the target watermark information may be extracted after offsetting the image block to be parsed by a certain distance. For example, the coordinates of the key point i in the original target image are (100,100), but the coordinates of the key point detected in the image to be parsed obtained by taking photos are (99,99). Watermark extraction is performed in the image block to be parsed determined based on the coordinates, and part of the watermark information may be extracted. Assuming that the target binary string cannot be successfully obtained after error correction, the coordinates of the key point can be offset, for example, moved to (100,100), and watermark extraction is performed in the newly added image block to be parsed determined based on the new coordinates, and the target binary string may be extracted.
[0137] In practical applications, the position offset direction of the image block to be parsed can be traversed in four directions, namely, up, down, left, and right, with set moving steps. For example, each direction is shifted by 2 pixels at a time, with an upper limit of 6 pixels.
[0138] The following example illustrates the specific implementation process of determining whether the target parsed image block contains the target watermark information. Figure 7As shown, for each image block to be parsed, the block is first divided into sub-blocks, for example, to obtain nine 8*8 image sub-blocks. In the embedding order, the DCT transform is performed on the currently traversed target image sub-block using the frequency coefficients k corresponding to the first transform frequency group (i, j) and the frequency coefficients k corresponding to the second transform frequency group (j, i), respectively, to obtain the fifth transform coefficient DCT(i, j) and the sixth transform coefficient DCT(j, i) corresponding to the target image sub-block to be parsed. If DCT(i, j) corresponding to the target image sub-block to be parsed is greater than DCT(j, i), the bit value contained in the target image sub-block to be parsed is determined to be 0; if DCT(i, j) corresponding to the target image sub-block to be parsed is less than DCT(j, i), the bit value contained in the target image sub-block to be parsed is determined to be 1. After determining the bit values corresponding to the multiple image sub-blocks to be parsed, the parsed watermark information is determined based on the bit values corresponding to the multiple image sub-blocks to be parsed.
[0139] In practical applications, many application fields involve the need to embed blind watermarks in images, and the technical solutions of the embodiments of the present invention can be used. The following is an exemplary description with reference to specific embodiments.
[0140] Figure 8 A flowchart of another blind watermark processing method provided by an embodiment of the present invention is shown in FIG. Figure 8 As shown, the method is applied to the cloud desktop server, and the specific method includes the following steps:
[0141] 801. The cloud desktop server obtains a target image and target watermark information. The target image is an image that needs to be transmitted to the cloud desktop client for display, and the target watermark information corresponds to the cloud desktop client.
[0142] 802. The cloud desktop server determines a plurality of key points contained in the target image, and determines a plurality of non-overlapping image blocks to be embedded in the target image based on the plurality of key points, wherein each image block to be embedded contains at least one key point, and the image block to be embedded has a set size.
[0143] 803. The cloud desktop server performs frequency domain transformation on the multiple image blocks to be embedded using the first transformation frequency group and the second transformation frequency group respectively to obtain first transformation coefficients and second transformation coefficients corresponding to the multiple image blocks to be embedded, and the horizontal transformation frequencies and vertical transformation frequencies respectively contained in the first transformation frequency group and the second transformation frequency group are located in a set mid-frequency band.
[0144] 804. The cloud desktop server adjusts the first transformation coefficients and the second transformation coefficients corresponding to each of the multiple image blocks to be embedded according to the target watermark information, and performs frequency domain inverse transformation on the updated first transformation coefficients and the second transformation coefficients corresponding to each of the multiple image blocks to be embedded, so that the target watermark information is embedded in the multiple image blocks to be embedded.
[0145] 805. The cloud desktop server transmits the target image embedded with the target watermark information to the cloud desktop client for display.
[0146] In actual applications, many corporate users use the cloud desktop service. In the cloud desktop scenario, the cloud desktop server can transmit the video stream that needs to be displayed to the cloud desktop client in the form of a certain video stream, and the video stream is composed of frames of images. For the purpose of enterprise information security, enterprise managers will need to embed the images displayed on the cloud desktop client with the target watermark information they set, and even set different target watermark information for cloud desktop clients of different employees. Therefore, before transmitting the video stream to the cloud desktop client, the cloud desktop server needs to embed the target watermark information into each frame of the image contained therein. The process of embedding the target watermark information by the cloud desktop server can be implemented by referring to the other aforementioned embodiments and will not be repeated here.
[0147] The blind watermark processing apparatus of one or more embodiments of the present invention will be described in detail below. Those skilled in the art will appreciate that these apparatuses can be constructed by configuring commercially available hardware components through the steps taught in this solution.
[0148] Figure 9 This is a schematic diagram of the structure of a blind watermark processing device provided by an embodiment of the present invention. Figure 9 As shown, the device includes: an acquisition module 11, a first determination module 12, a second determination module 13, a transformation module 14, an adjustment module 15, and an inverse transformation module 16.
[0149] The acquisition module 11 is used to acquire the target image and target watermark information.
[0150] The first determining module 12 is configured to determine a plurality of first key points contained in the target image.
[0151] The second determining module 13 is configured to determine a plurality of non-overlapping image blocks to be embedded in the target image according to the plurality of first key points, wherein each image block to be embedded includes at least one first key point and the image block to be embedded has a set size.
[0152] The transformation module 14 is configured to perform frequency domain transformation on the plurality of image blocks to be embedded using a first transformation frequency group and a second transformation frequency group, respectively, to obtain first transformation coefficients and second transformation coefficients corresponding to each of the plurality of image blocks to be embedded, wherein the horizontal transformation frequencies and vertical transformation frequencies respectively included in the first transformation frequency group and the second transformation frequency group are located in a set mid-frequency band.
[0153] The adjustment module 15 is configured to adjust the first transformation coefficients and the second transformation coefficients corresponding to each of the plurality of image blocks to be embedded according to the target watermark information.
[0154] The inverse transformation module 16 is configured to perform frequency domain inverse transformation on the updated first transformation coefficients and second transformation coefficients corresponding to each of the plurality of image blocks to be embedded, so as to embed the target watermark information into the plurality of image blocks to be embedded.
[0155] Optionally, the acquisition module 11 is specifically configured to: convert the initial watermark information in a non-binary string format into an initial binary string; and perform error correction code processing on the initial binary string to obtain a target binary string as the target watermark information.
[0156] Optionally, the first determination module 12 is specifically used to: determine multiple first key points contained in the target image and intensity values of the multiple first key points, wherein the intensity values are used to reflect the degree of difference between the pixel values of the corresponding first key points and the surrounding pixel points.
[0157] Optionally, the second determining module 13 is specifically configured to: sort the multiple first key points according to their intensity values; and sequentially determine the multiple non-overlapping image blocks to be embedded in the target image based on the sorting result.
[0158] Optionally, the second determination module 13 is specifically used to: if the number of image blocks to be embedded determined in the target image based on the sorting result is less than a set first number, determine a plurality of pixel points corresponding to edge positions in the target image; and determine a second non-overlapping number of image blocks to be embedded in the target image based on the plurality of pixel points, so that the number of image blocks to be embedded reaches the first number.
[0159] Optionally, the second determining module 13 is further configured to determine a set size of the image block to be embedded according to the length of the target watermark information and a set image sub-block size, where the image sub-block size refers to the size of the image sub-blocks to be embedded into which the image block to be embedded is divided.
[0160] Optionally, the transformation module 14 is specifically configured to: perform sub-block segmentation on the target image block to be embedded to obtain a plurality of image sub-blocks to be embedded contained in the target image block to be embedded, where the target image block to be embedded is any image block among the plurality of image blocks to be embedded; determine, according to a set embedding order, a target image sub-block to be embedded corresponding to a target bit value from the plurality of image sub-blocks to be embedded, where the target bit value is the value of any bit in a target binary string serving as the target watermark information; and perform frequency domain transformation on the target image sub-block to be embedded using the first transformation frequency group and the second transformation frequency group, respectively, to obtain a third transformation coefficient and a fourth transformation coefficient corresponding to the target image sub-block to be embedded.
[0161] Optionally, the adjustment module 15 is specifically configured to: determine a first statistical value and a second statistical value in a third transform coefficient and a fourth transform coefficient corresponding to the target to-be-embedded image sub-block, the first statistical value being greater than the second statistical value; if the target bit value is a first binary value, adjusting the third transform coefficient and the fourth transform coefficient according to the first statistical value and the second statistical value so that the third transform coefficient is greater than the fourth transform coefficient; if the target bit value is a second binary value, adjusting the third transform coefficient and the fourth transform coefficient according to the first statistical value and the second statistical value so that the third transform coefficient is less than the fourth transform coefficient;
[0162] Optionally, the inverse transform module 16 is specifically configured to perform frequency domain inverse transform on the updated third transform coefficient and fourth transform coefficient corresponding to the target image sub-block to be embedded, so as to embed the target bit value into the target image sub-block to be embedded.
[0163] Optionally, the device further includes: a screening module, configured to perform key point detection on the target image in which the target watermark information is embedded to obtain a plurality of second key points; determine an image block to be embedded that does not contain the second key point among the plurality of image blocks to be embedded; and determine not to add the target watermark information to the image block to be embedded that does not contain the second key point.
[0164] Optionally, the device also includes: a parsing module, used to obtain an image to be parsed obtained by performing a set operation on the target image; determine multiple third key points contained in the image to be parsed; according to the set size, determine multiple image blocks to be parsed corresponding to the multiple third key points in the image to be parsed; and determine whether the target watermark information is contained in the multiple image blocks to be parsed.
[0165] Optionally, the parsing module is specifically configured to: perform sub-block segmentation on the target image block to be parsed to obtain a plurality of image sub-blocks to be parsed contained in the target image block to be parsed, wherein the target image block to be parsed is any image block among the plurality of image blocks to be parsed, and the number of the plurality of image sub-blocks to be parsed is consistent with the number of image sub-blocks to be embedded into which the image block to be embedded is divided when embedding the target watermark information; perform frequency domain transformation on the target image sub-block to be parsed using the first transformation frequency group and the second transformation frequency group respectively to obtain a fifth transformation coefficient and a sixth transformation coefficient corresponding to the target image sub-block ... The sub-block is any one of the multiple image sub-blocks to be parsed; if the fifth transform coefficient is greater than the sixth transform coefficient, determining that the bit value contained in the target image sub-block to be parsed is a first binary value; if the fifth transform coefficient is less than the sixth transform coefficient, determining that the bit value contained in the target image sub-block to be parsed is a second binary value; determining the parsed watermark information based on the bit values corresponding to each of the multiple image sub-blocks to be parsed and the embedding order of the target watermark information; if the parsed watermark information is consistent with the target watermark information, determining that the target image block to be parsed contains the target watermark information.
[0166] Optionally, the parsing module is further configured to: if the parsed watermark information is inconsistent with the target watermark information, use an image block obtained by offsetting the target image block to be parsed by a set distance as a newly added image block to be parsed.
[0167] Optionally, before determining the plurality of third key points contained in the image to be analyzed, the analyzing module is further configured to: perform image perspective transformation processing on the image to be analyzed.
[0168] Figure 9 The device shown can execute the steps in the aforementioned embodiments. For detailed execution process and technical effects, please refer to the description in the aforementioned embodiments and will not be repeated here.
[0169] In one possible design, the above Figure 9 The structure of the blind watermark processing device shown can be implemented as an electronic device. Figure 10 As shown, the electronic device may include: a processor 21, a memory 22, and a communication interface 23. The memory 22 stores executable code, and when the executable code is executed by the processor 21, the processor 21 can at least implement the blind watermark processing method provided in the above embodiment.
[0170] In addition, an embodiment of the present invention provides a non-transitory machine-readable storage medium, on which executable code is stored. When the executable code is executed by a processor of an electronic device, the processor can at least implement the blind watermark processing method provided in the aforementioned embodiment.
[0171] The device embodiments described above are merely illustrative, wherein the network elements described as separate components may or may not be physically separate. Some or all of these modules may be selected based on actual needs to achieve the objectives of this embodiment. Persons of ordinary skill in the art can understand and implement these embodiments without inventive effort.
[0172] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by adding a necessary general hardware platform, and of course can also be implemented by a combination of hardware and software. Based on this understanding, the above technical solution, or the part that contributes to the prior art, can be embodied in the form of a computer product. The present invention can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0173] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present invention.
Claims
1. A blind watermark processing method, characterized in that: include: Obtain target image and target watermark information; Determining a plurality of first key points contained in the target image; Determining a plurality of non-overlapping image blocks to be embedded in the target image according to the plurality of first key points, wherein each image block to be embedded contains at least one first key point, and the image block to be embedded has a set size; performing frequency domain transforms on the plurality of image blocks to be embedded using a first transform frequency group and a second transform frequency group, respectively, to obtain first transform coefficients and second transform coefficients corresponding to the plurality of image blocks to be embedded, wherein the horizontal transform frequencies and vertical transform frequencies respectively included in the first transform frequency group and the second transform frequency group are located in a set mid-frequency band; adjusting first transform coefficients and second transform coefficients corresponding to respective ones of a plurality of image blocks to be embedded according to the target watermark information; Perform frequency domain inverse transformation on the updated first transformation coefficients and the second transformation coefficients corresponding to each of the multiple image blocks to be embedded, so that the target watermark information is embedded in the multiple image blocks to be embedded.
2. The method according to claim 1, characterized in that Get target watermark information, including: Converting the initial watermark information in a non-binary string format into an initial binary string; The initial binary character string is processed by setting an error correction code to obtain a target binary character string as the target watermark information.
3. The method according to claim 1, characterized in that The determining of a plurality of first key points contained in the target image includes: Determine a plurality of first key points contained in the target image and intensity values of the plurality of first key points, wherein the intensity values are used to reflect the degree of difference between pixel values of the corresponding first key point and surrounding pixel points; The determining, in the target image according to the plurality of first key points, a plurality of non-overlapping image blocks to be embedded, comprises: sorting the plurality of first key points according to their intensity values; Based on the sorting result, the plurality of non-overlapping image blocks to be embedded are sequentially determined in the target image.
4. The method according to claim 3, characterized in that The method further comprises: If the number of image blocks to be embedded in the target image determined based on the sorting result is less than a set first number, determining a plurality of pixel points corresponding to edge positions in the target image; A second number of non-overlapping image blocks to be embedded is determined in the target image according to the plurality of pixel points, so that the number of image blocks to be embedded reaches the first number.
5. The method according to claim 1, wherein The method further comprises: The set size of the image block to be embedded is determined according to the length of the target watermark information and the set image sub-block size, where the image sub-block size refers to the size of the image sub-blocks to be embedded into which the image block to be embedded is divided.
6. The method according to claim 5, characterized in that The performing frequency domain transforms on the plurality of image blocks to be embedded using the first transform frequency group and the second transform frequency group respectively to obtain first transform coefficients and second transform coefficients corresponding to the plurality of image blocks respectively, comprising: Dividing the target image block to be embedded into sub-blocks to obtain a plurality of image sub-blocks to be embedded contained in the target image block to be embedded, wherein the target image block to be embedded is any image block among the plurality of image blocks to be embedded; Determining, according to a set embedding order, a target image sub-block to be embedded corresponding to a target bit value from the plurality of image sub-blocks to be embedded, wherein the target bit value is a value of any bit in a target binary string serving as the target watermark information; Frequency domain transforms are performed on the target to-be-embedded image sub-block using the first transform frequency group and the second transform frequency group respectively to obtain third transform coefficients and fourth transform coefficients corresponding to the target to-be-embedded image sub-block.
7. The method according to claim 6, characterized in that The adjusting, according to the target watermark information, first transform coefficients and second transform coefficients corresponding to each of the plurality of image blocks to be embedded comprises: Determining a first statistical value and a second statistical value in a third transform coefficient and a fourth transform coefficient corresponding to the target to-be-embedded image sub-block, wherein the first statistical value is greater than the second statistical value; If the target bit value is a first binary value, adjusting the third transform coefficient and the fourth transform coefficient according to the first statistical value and the second statistical value so that the third transform coefficient is greater than the fourth transform coefficient; if the target bit value is a second binary value, adjusting the third transform coefficient and the fourth transform coefficient according to the first statistical value and the second statistical value so that the third transform coefficient is less than the fourth transform coefficient; The performing frequency domain inverse transformation on the updated first transformation coefficients and second transformation coefficients corresponding to each of the plurality of image blocks to be embedded comprises: Perform frequency domain inverse transformation on the updated third transform coefficient and the fourth transform coefficient corresponding to the target to-be-embedded image sub-block, so that the target bit value is embedded in the target to-be-embedded image sub-block.
8. The method according to claim 1, characterized in that The method further comprises: Performing key point detection on the target image embedded with the target watermark information to obtain a plurality of second key points; Determine an image block to be embedded that does not include the second key point among the multiple image blocks to be embedded; Determine not to add the target watermark information to the image block to be embedded that does not include the second key point.
9. The method according to any one of claims 1 to 8, characterized in that The method further comprises: Obtaining an image to be parsed obtained by performing a set operation on the target image; Determining a plurality of third key points contained in the image to be analyzed; According to the set size, determining a plurality of image blocks to be parsed corresponding to the plurality of third key points in the image to be parsed; It is determined whether the target watermark information is included in each of the plurality of image blocks to be parsed.
10. The method according to claim 9, characterized in that The respectively determining whether the plurality of image blocks to be parsed contain the target watermark information includes: Dividing a target image block to be parsed into sub-blocks to obtain a plurality of image sub-blocks to be parsed contained in the target image block to be parsed, wherein the target image block to be parsed is any image block among the plurality of image blocks to be parsed, and the number of the plurality of image sub-blocks to be parsed is consistent with the number of image sub-blocks to be embedded into which the image block to be embedded is divided when embedding the target watermark information; performing frequency domain transforms on a target image sub-block to be analyzed using the first transform frequency group and the second transform frequency group, respectively, to obtain fifth transform coefficients and sixth transform coefficients corresponding to the target image sub-block to be analyzed, where the target image sub-block to be analyzed is any one of the multiple image sub-blocks to be analyzed; If the fifth transform coefficient is greater than the sixth transform coefficient, determining that the bit value contained in the target to-be-parsed image sub-block is a first binary value; if the fifth transform coefficient is less than the sixth transform coefficient, determining that the bit value contained in the target to-be-parsed image sub-block is a second binary value; Determining the parsed watermark information according to the bit values corresponding to the plurality of image sub-blocks to be parsed and the embedding order of the target watermark information; If the parsed watermark information is consistent with the target watermark information, it is determined that the target image block to be parsed contains the target watermark information.
11. The method according to claim 10, characterized in that The method further comprises: If the parsed watermark information is inconsistent with the target watermark information, an image block obtained by offsetting the target image block to be parsed by a set distance is used as a new image block to be parsed.
12. The method according to claim 9, characterized in that Before determining the plurality of third key points contained in the image to be parsed, the method further includes: Perform image perspective transformation processing on the image to be analyzed.
13. A blind watermark processing method, characterized in that: Applied to cloud desktop servers, including: Acquire a target image and target watermark information, wherein the target image is an image that needs to be transmitted to a cloud desktop client for display, and the target watermark information corresponds to the cloud desktop client; Determining a plurality of key points contained in the target image; Determining a plurality of non-overlapping image blocks to be embedded in the target image according to the plurality of key points, wherein each image block to be embedded contains at least one key point and the image block to be embedded has a set size; performing frequency domain transforms on the plurality of image blocks to be embedded using a first transform frequency group and a second transform frequency group, respectively, to obtain first transform coefficients and second transform coefficients corresponding to the plurality of image blocks to be embedded, wherein the horizontal transform frequencies and vertical transform frequencies respectively included in the first transform frequency group and the second transform frequency group are located in a set mid-frequency band; adjusting first transform coefficients and second transform coefficients corresponding to respective ones of a plurality of image blocks to be embedded according to the target watermark information; Performing frequency domain inverse transformation on the updated first transform coefficients and second transform coefficients corresponding to each of the plurality of image blocks to be embedded, so that the target watermark information is embedded in the plurality of image blocks to be embedded; The target image embedded with the target watermark information is transmitted to the cloud desktop client for display.
14. An electronic device, characterized in that: include: A memory, a processor, and a communication interface; wherein the memory stores an executable code, and when the executable code is executed by the processor, the processor executes the blind watermark processing method according to any one of claims 1 to 13.
15. A non-transitory machine-readable storage medium, characterized in that The non-transitory machine-readable storage medium stores executable code, and when the executable code is executed by a processor of an electronic device, the processor is caused to execute the blind watermark processing method according to any one of claims 1 to 13.
16. A computer program product, characterized in that include: A computer program, when executed by a processor of an electronic device, causes the processor to perform the blind watermark processing method according to any one of claims 1 to 13.