CN115481374A - Image watermark processing method, device, equipment and storage medium - Google Patents

Image watermark processing method, device, equipment and storage medium Download PDF

Info

Publication number
CN115481374A
CN115481374A CN202211199713.6A CN202211199713A CN115481374A CN 115481374 A CN115481374 A CN 115481374A CN 202211199713 A CN202211199713 A CN 202211199713A CN 115481374 A CN115481374 A CN 115481374A
Authority
CN
China
Prior art keywords
image
watermark
pixel
watermark information
dot matrix
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211199713.6A
Other languages
Chinese (zh)
Inventor
梁骏峰
邓旭晖
朱仁杰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Bank of China Ltd
Original Assignee
Bank of China Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Bank of China Ltd filed Critical Bank of China Ltd
Priority to CN202211199713.6A priority Critical patent/CN115481374A/en
Publication of CN115481374A publication Critical patent/CN115481374A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/10Protecting distributed programs or content, e.g. vending or licensing of copyrighted material ; Digital rights management [DRM]
    • G06F21/16Program or content traceability, e.g. by watermarking
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T1/00General purpose image data processing
    • G06T1/0021Image watermarking
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/90Determination of colour characteristics

Abstract

The application provides a processing method, a device, equipment and a storage medium of image watermarks, which can be applied to the field of network security or the field of finance, wherein the method comprises the steps of obtaining a gray image corresponding to an image to be processed, and determining a watermark loading area in the gray image and the image to be processed; the size of the area is determined according to the image resolution; generating a watermark information dot matrix consisting of a plurality of pixels in the watermark loading area according to the watermark information; the gray value of the pixel in the watermark information dot matrix is the upper limit of the gray value of the pixel; and loading the watermark information dot matrix into any color channel of a watermark loading area of the image to be processed to obtain the image containing the watermark. According to the scheme, the watermark information dot matrix formed by the pixels is loaded into one channel of the image, the influence on the image is small, and the effect of preventing the image leakage can be achieved while the use of the image is not influenced.

Description

Image watermark processing method, device, equipment and storage medium
Technical Field
The present invention relates to the field of digital watermarking technologies, and in particular, to a method, an apparatus, a device, and a storage medium for processing an image watermark.
Background
With the digital technology innovation and the iteration speed being obviously accelerated, data becomes basic strategic resources and key production elements, the data is important power and core assets for development of banking data, office digitization greatly enriches the propagation modes of various information, and hidden dangers such as information leakage are buried while the efficiency is improved.
Therefore, how to prevent leakage of important data, especially image data such as file screenshots or paper file photos, without affecting normal use of the important data becomes an urgent problem to be solved.
Disclosure of Invention
In view of the above-mentioned shortcomings of the prior art, the present invention provides a method, an apparatus, a device and a storage medium for processing an image watermark, so as to provide a digital watermark loading scheme capable of loading a specified digital watermark in an image without affecting the use of the image.
A first aspect of the present application provides a method for processing an image watermark, including:
acquiring a gray image corresponding to an image to be processed, and determining a watermark loading area in the gray image and the image to be processed; the size of the watermark loading area is determined according to the resolution of the image to be processed;
generating a watermark information dot matrix in the watermark loading area according to preset watermark information; the watermark information dot matrix comprises a plurality of pixels, and the gray value of each pixel of the watermark information dot matrix is the upper limit of the gray value of the pixel in the gray image;
loading the watermark information dot matrix into any color channel of the watermark loading area of the image to be processed to obtain a watermark-containing image; the color channels of the image to be processed comprise a red channel, a green channel and a blue channel in an RGB color mode.
Optionally, the loading the watermark information dot matrix into any color channel of the image to be processed to obtain the image containing the watermark, further includes:
splitting the watermark-containing image into three image layers according to a color channel;
extracting a target pixel from each layer to obtain a dot matrix of the layer formed by the target pixels of the layer; wherein the target pixel refers to a pixel whose pixel value reaches an upper limit of a pixel value;
and identifying the dot matrix of each layer, thereby detecting the watermark information carried in the dot matrix of any layer.
Optionally, the loading the watermark information dot matrix into any color channel of the watermark loading area of the image to be processed includes:
and for each pixel in the watermark loading area of the image to be processed, if the pixel and the pixel of the watermark information dot matrix are located at the same position, replacing the pixel value of the pixel in a pre-specified color channel with the gray value of the pixel of the watermark information dot matrix located at the same position.
Optionally, the obtaining a grayscale image corresponding to the image to be processed includes:
calculating the average value of the pixel values of the pixels in three color channels aiming at each pixel of the image to be processed, and determining the average value as a gray value corresponding to the pixel; and each pixel with the determined gray value forms a gray image corresponding to the image to be processed.
Optionally, the generating a watermark information dot matrix according to preset watermark information in the watermark loading area includes:
carrying out scaling operation on preset watermark information to obtain scaled watermark information; wherein the size of the scaled watermark information matches the size of the watermark loading area;
and generating a watermark information dot matrix according to the scaling watermark information.
A second aspect of the present application provides an apparatus for processing image watermarks, comprising:
the watermark processing device comprises a region selection module, a watermark processing module and a watermark processing module, wherein the region selection module is used for obtaining a gray level image corresponding to an image to be processed and determining a watermark loading region in the gray level image and the image to be processed; the size of the watermark loading area is determined according to the resolution of the image to be processed;
the dot matrix generating module is used for generating a watermark information dot matrix in the watermark loading area according to preset watermark information; the watermark information dot matrix comprises a plurality of pixels, and the gray value of each pixel of the watermark information dot matrix is the upper limit of the gray value of the pixel in the gray image;
the watermark loading module is used for loading the watermark information dot matrix into any color channel of the watermark loading area of the image to be processed to obtain a watermark-containing image; the color channels of the image to be processed comprise a red channel, a green channel and a blue channel in an RGB color mode.
Optionally, the apparatus further includes a watermark extraction module, configured to:
splitting the watermark-containing image into three layers according to a color channel;
extracting a target pixel from each layer to obtain a dot matrix of the layer formed by the target pixels of the layer; wherein the target pixel refers to a pixel whose pixel value reaches an upper limit of a pixel value;
and identifying the dot matrix of each layer, thereby detecting the watermark information carried in the dot matrix of any layer.
Optionally, when the watermark loading module loads the watermark information dot matrix into any color channel of the watermark loading area of the image to be processed, the watermark loading module is specifically configured to:
and for each pixel in the watermark loading area of the image to be processed, if the pixel and the pixel of the watermark information dot matrix are located at the same position, replacing the pixel value of the pixel in a pre-specified color channel with the gray value of the pixel of the watermark information dot matrix located at the same position.
Optionally, when the region selection module obtains the grayscale image corresponding to the image to be processed, the region selection module is specifically configured to:
calculating the average value of the pixel values of the pixels in three color channels aiming at each pixel of the image to be processed, and determining the average value as the gray value corresponding to the pixel; and each pixel with the determined gray value forms a gray image corresponding to the image to be processed.
Optionally, when the dot matrix generation module generates the watermark information dot matrix according to preset watermark information in the watermark loading area, the dot matrix generation module is specifically configured to:
carrying out scaling operation on preset watermark information to obtain scaled watermark information; wherein the size of the scaled watermark information matches the size of the watermark loading area;
and generating a watermark information dot matrix according to the scaling watermark information.
A third aspect of the present application provides an electronic device comprising a memory and a processor;
wherein the memory is for storing a computer program;
the processor is configured to execute the computer program, and in particular to implement the image watermarking processing method as provided in any one of the first aspects of the present application.
A fourth aspect of the present application provides a computer storage medium for storing a computer program, which when executed is particularly adapted to implement the image watermarking processing method provided in any one of the first aspects of the present application.
The application provides a processing method, a device, equipment and a storage medium of image watermarks, wherein the method comprises the steps of obtaining a gray image corresponding to an image to be processed, and determining a watermark loading area in the gray image and the image to be processed; the size of the area is determined according to the image resolution; generating a watermark information dot matrix formed by a plurality of pixels in the watermark loading area according to the watermark information; the gray value of the pixel in the watermark information dot matrix is the upper limit of the gray value of the pixel; and loading the watermark information dot matrix into any color channel of a watermark loading area of the image to be processed to obtain the image containing the watermark. According to the scheme, the watermark information dot matrix formed by the pixels is loaded into one channel of the image, so that the influence on the image is small, and the effect of preventing the image leakage can be achieved while the use of the image is not influenced.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the embodiments or the prior art descriptions will be briefly described below, it is obvious that the drawings in the following description are only embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
Fig. 1 is a flowchart of a method for processing an image watermark according to an embodiment of the present application;
fig. 2 is a schematic diagram of generating a watermark information lattice according to an embodiment of the present application;
fig. 3 is a schematic structural diagram of an image watermark processing apparatus according to an embodiment of the present application;
fig. 4 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
With the digital technology innovation and the iteration speed being obviously accelerated, data becomes basic strategic resources and key production elements, the data is important power and core assets for development of banking data, office digitization greatly enriches the propagation modes of various information, and hidden dangers such as information leakage are buried while the efficiency is improved. According to the data display of the national computer information security evaluation center: in a unit causing economic loss due to internal important secrets leaked through a network, the ratio of hacking to leakage by internal staff is 1:99. in recent years, bank supervision units and financial institutions pay high attention to data security, and require the financial institutions to strengthen personal financial information protection of clients, clearly 'strengthen working mechanisms' and make internal prevention and control; the technical means is improved, and the safety level is improved; the service flow is optimized, the propaganda strength is increased, and the behavior of 'illegal inquiry, acquisition, use, leakage, sale of customer information or trade secret' is strictly prevented so as to earn private interest.
In view of the above problems, the present application provides a method for adding a digital watermark to an original image during file transmission or screenshot forwarding, which is important for preventing the original image from being used and being not easily perceived, and can prevent key information from leaking from the inside.
The basic idea of the invention is as follows:
when the picture is forwarded or sent to the outside, the watermark information is added into the area with the relatively close picture pixel value, the watermark information is displayed and superposed into any single channel of the RGB channels of the corresponding area of the picture in a dot matrix mode, the influence on the original picture is small, and under the condition that the use of the original picture is not influenced, the method can help the staff to improve the information safety consciousness and carry out safety deterrence. Once data leakage occurs, who leaks the data can be judged through watermark information, relevant measures are taken to reduce a diffusion range, and a divulgence person is traced to the source and blamed through extraction of a divulgence photo watermark.
The scheme of the application is further explained in the following with the attached drawings.
Referring to fig. 1, a flowchart of a method for processing an image watermark according to an embodiment of the present application is provided, where the method may include the following steps.
S101, obtaining a gray image corresponding to the image to be processed, and determining a watermark loading area in the gray image and the image to be processed.
The size of the watermark loading area is determined according to the resolution of the image to be processed.
The image to be processed may be any image to which a digital watermark needs to be loaded, including, but not limited to, an image obtained by drawing or screenshot on an electronic device (e.g., a mobile phone or a computer), a photograph obtained by taking a paper document or other objects with a photographing device, and the like.
Generally, the size of the watermark loading area may be positively correlated with the resolution of the image to be processed, that is, the larger the resolution of the image to be processed is, the larger the size of the watermark loading area is.
An optional method for determining the size of the watermark loading area is to preset a mapping relation table of the size and the resolution, wherein a plurality of common image resolutions and sizes corresponding to the resolutions are recorded in the table. Therefore, in step S101, a corresponding size may be found in the mapping relation table according to the resolution of the image to be processed, and the size may be determined as the size of the watermark loading area.
Another optional method for determining the size of the watermark loading area is to introduce the resolution of the image to be processed into a preset size calculation function, and calculate the resolution according to the size calculation function to obtain the size of the watermark loading area.
Of course, the size of the watermark loading area may also be determined according to the resolution of the image to be processed in other ways, which is not limited in this embodiment.
Alternatively, the size of the watermark loading area may be expressed by the number of pixels, for example, the size of the watermark loading area may be 50 pixels long and 30 pixels wide.
The position of the watermark loading area can be at one corner of the image to be processed and the gray scale map, for example, the lower right corner, or certainly can be at the middle of the image to be processed and the gray scale map, that is, the center of the watermark loading area can coincide with the center of the image to be processed and the gray scale map.
Among them, the benefit of placing the watermark loading area in the middle of the image is: the cutting operation in the image transmission process is prevented from damaging the integrity of the watermark information dot matrix loaded into the image, so that the watermark information dot matrix loaded into the image can continuously play a role.
Optionally, obtaining a grayscale image corresponding to the image to be processed includes:
and calculating the average value of the pixel values of the pixels in the three color channels for each pixel of the image to be processed, and determining the average value as the gray value corresponding to the pixel.
And each pixel with the determined gray value forms a gray image corresponding to the image to be processed.
The three color channels described in this embodiment are the red (R), green (G) and blue (B) channels in the RGB color scheme, respectively. Considering that the average value may include a decimal number, the average value may be converted into an integer by rounding up, rounding down, or rounding down, and then the converted integer is used as the gray value of the corresponding pixel.
Illustratively, the pixel value of each channel of a certain pixel in the image to be processed is R,100; g,120; b,119. The average value of the three pixel values is calculated to obtain 113, and then the gradation value of the pixel is determined to be 113.
After determining a gray value for each pixel in the image to be processed, replacing the original RGB pixel values with the gray values to obtain a gray map corresponding to the image to be processed.
And S102, generating a watermark information dot matrix in the watermark loading area according to preset watermark information.
The watermark information lattice comprises a plurality of pixels, and the gray value of each pixel of the watermark information lattice is the upper limit of the gray value of the pixel in the gray image.
Specifically, if the upper limit of the gray scale value of each pixel in the gray scale image is 255, the gray scale value of each pixel in the watermark information lattice is 255 in step S102, and if the upper limit of the gray scale value of each pixel in the gray scale image is 1023, the gray scale value of each pixel in the watermark information lattice is 1023 in step S102.
The watermark information may be understood as a preset pattern as a watermark, and the pattern may be a simple pattern composed of geometric figures, or may be a more complex pattern obtained by other means (such as drawing, screenshot).
The simple pattern formed by the geometric figures is adopted as the watermark information, and the advantages that when the watermark information dot matrix is loaded to the image to be processed, the simple pattern contains fewer pixels, so that the influence of the watermark loading on the image to be processed is smaller, the watermark loaded in the image is less likely to be perceived, and the influence of the watermark on the original image is weakened as much as possible.
Optionally, generating a watermark information dot matrix according to preset watermark information in the watermark loading area includes:
and carrying out scaling operation on the preset watermark information to obtain scaled watermark information.
Wherein the size of the scaled watermark information matches the size of the watermark loading area.
For example, if the size of the watermark loading area is 50 pixels long and 30 pixels wide, the scaled watermark information obtained after scaling may also be 50 pixels long and 30 pixels wide.
Further optionally, when the preset length-width ratio of the watermark information is not consistent with the length-width ratio of the watermark loading area, in the scaling operation, it may be only required to ensure that the length of the scaled watermark information is consistent with the length of the watermark loading area, or that the width of the scaled watermark information is consistent with the width of the watermark loading area.
And generating a watermark information dot matrix according to the scaling watermark information. In this step, an upper limit of the gray scale value (e.g., 255) may be assigned to each pixel constituting the scaled watermark information, and the scaled watermark information after the assignment is the watermark information lattice generated in step S102.
The following describes a specific implementation of step S102 in conjunction with the example of fig. 2.
As shown in fig. 2, in step S101, a grayscale image 201 is obtained from an image to be processed, and then a watermark loading area 202 is determined in the grayscale image 201 according to the resolution of the image.
Based on this, when step S102 is executed, the watermark information 203 is first read, and it can be seen that the watermark information 203 shown in fig. 2 is a simple pattern formed by intersecting two circular rings, then step A1 is executed, scaling is performed to the size equal to the size of the watermark loading area, step A2 is executed on the scaled watermark information, and each pixel point is assigned as the upper limit of the gray scale value (e.g., 255), thereby obtaining the watermark information lattice 204.
It should be noted that, in step S102, only the pixels of the pattern as the watermark information are assigned as the upper limit of the gray scale value, which is to say, taking fig. 2 as an example, the above assignment operation is performed only on the pixels in the pattern where the two circular rings intersect in the watermark information 203, and no assignment is performed on the pixels of the background (for example, the white portion in the rectangular frame where the watermark information 203 is located) bearing the watermark information.
In summary, the watermark information lattice can be understood as a pattern formed by a plurality of pixels with the gray value reaching the upper limit, and the pattern is consistent with the preset watermark information. For example, the watermark information lattice generated based on the watermark information 203 shown in fig. 2 also has a double circular cross pattern.
S103, loading the watermark information dot matrix into any color channel of the watermark loading area of the image to be processed to obtain the image containing the watermark.
The color channels of the image to be processed comprise a red channel, a green channel and a blue channel in an RGB color mode.
Optionally, loading the watermark information dot matrix into any color channel of the watermark loading area of the image to be processed includes:
and for each pixel in the watermark loading area of the image to be processed, if the pixel and the pixel of the watermark information dot matrix are located at the same position, replacing the pixel value of the pixel in the pre-specified color channel with the gray value of the pixel of the watermark information dot matrix located at the same position.
In other words, step S103 is equivalent to replacing the gray value of each pixel in the watermark information dot matrix with the pixel value of a certain color channel of the pixel at the same position in the watermark loading area of the image to be processed.
The description is made with reference to a specific example:
assuming that a replacement red (R) channel is specified, in step S103, for any pixel P (x, y) in the watermark loading area of the image to be processed, a pixel I (x, y) located at the same position may be searched in the watermark information lattice generated in S102, and if there is a pixel I (x, y) located at the same position in the watermark information lattice and the gray value of the pixel I (x, y) is the upper limit of the gray value assigned in step S102 (e.g., 255), the pixel value of the red channel of the pixel P (x, y) of the image to be processed (i.e., the R pixel value) is replaced with the gray value of the pixel I (x, y) (e.g., 255). And by analogy, executing the operation on each pixel in the watermark loading area of the image to be processed, and completing the step of loading the watermark information dot matrix to the image to be processed.
Optionally, in step S103, after loading the watermark information dot matrix into any color channel of the image to be processed to obtain the image containing the watermark, the method further includes:
and S104, detecting watermark information from the watermark-containing image.
The specific implementation of step S104 may include:
and B1, splitting the watermark-containing image into three image layers according to the color channels.
And B2, extracting target pixels from each layer to obtain a dot matrix of the layer formed by the target pixels of the layer. Wherein the target pixel refers to a pixel whose pixel value reaches an upper limit of the pixel value.
And B3, identifying the dot matrix of each layer, thereby detecting the watermark information carried in the dot matrix of any layer.
Next, a specific embodiment of step S104 will be described by taking an example in which the upper limit of the pixel value is 255.
Firstly, splitting a watermark-containing image into three layers of red, green and blue, wherein pixels in each layer only have pixel values of corresponding channels of pixels in the watermark-containing image, namely, each pixel in the red layer only has a pixel value of a red channel, each pixel in the green layer only has a pixel value of a green channel, and each pixel in the blue layer only has a pixel value of a blue channel.
Then, B2 is executed to extract the target pixel in the red, green, and blue image layers, respectively. That is to say, a pixel with a red channel pixel value of 255 is extracted from the red layer, and a dot matrix of the red layer is obtained; extracting pixels with the pixel value of 255 of each green channel from the green layer to obtain a dot matrix of the green layer; and extracting pixels with the pixel value of 255 of each blue channel from the blue map layer to obtain a dot matrix of the blue map layer.
And finally, executing B3, sequentially identifying the dot matrix of the red layer, the dot matrix of the green layer and the dot matrix of the blue layer, and respectively matching the three dot matrixes with the preset watermark information patterns, so that the watermark information dot matrix loaded in any one of the red channel, the green channel and the blue channel can be detected.
The application provides a processing method of image watermarks, which comprises the steps of obtaining a gray image corresponding to an image to be processed, and determining a watermark loading area in the gray image and the image to be processed; the size of the area is determined according to the image resolution; generating a watermark information dot matrix formed by a plurality of pixels in the watermark loading area according to the watermark information; the gray value of the pixel in the watermark information dot matrix is the upper limit of the gray value of the pixel; and loading the watermark information dot matrix into any color channel of a watermark loading area of the image to be processed to obtain the image containing the watermark. According to the scheme, the watermark information dot matrix formed by the pixels is loaded into one channel of the image, so that the influence on the image is small, and the effect of preventing the image leakage can be achieved while the use of the image is not influenced.
Referring to fig. 3, a schematic structural diagram of an image watermark processing apparatus according to an embodiment of the present disclosure is shown, where the apparatus may include the following modules.
The region selection module 301 is configured to obtain a grayscale image corresponding to the image to be processed, and determine a watermark loading region in the grayscale image and the image to be processed.
The size of the watermark loading area is determined according to the resolution of the image to be processed.
The dot matrix generating module 302 is configured to generate a watermark information dot matrix according to preset watermark information in the watermark loading area.
The watermark information lattice comprises a plurality of pixels, and the gray value of each pixel of the watermark information lattice is the upper limit of the gray value of the pixel in the gray image.
The watermark loading module 303 is configured to load the watermark information dot matrix into any color channel of the watermark loading area of the image to be processed, so as to obtain the image containing the watermark.
The color channels of the image to be processed comprise a red channel, a green channel and a blue channel in an RGB color mode.
Optionally, the apparatus further comprises a watermark extraction module 304, configured to:
splitting the watermark-containing image into three layers according to a color channel;
extracting a target pixel from each layer to obtain a dot matrix of the layer formed by the target pixels of the layer; wherein the target pixel refers to a pixel whose pixel value reaches an upper limit of the pixel value;
and identifying the dot matrix of each layer, thereby detecting the watermark information carried in the dot matrix of any layer.
Optionally, when the watermark loading module 303 loads the watermark information dot matrix into any color channel of the watermark loading area of the image to be processed, the watermark loading module is specifically configured to:
and for each pixel in the watermark loading area of the image to be processed, if the pixel and the pixel of the watermark information dot matrix are located at the same position, replacing the pixel value of the pixel in the pre-specified color channel with the gray value of the pixel of the watermark information dot matrix located at the same position.
Optionally, when the region selection module 301 obtains the grayscale image corresponding to the image to be processed, the region selection module is specifically configured to:
calculating the average value of pixel values of the pixels in three color channels for each pixel of the image to be processed, and determining the average value as a gray value corresponding to the pixel; and each pixel with the determined gray value forms a gray image corresponding to the image to be processed.
Optionally, when the dot matrix generation module 302 generates the watermark information dot matrix according to the preset watermark information in the watermark loading area, it is specifically configured to:
carrying out scaling operation on preset watermark information to obtain scaled watermark information; wherein, the size of the scaling watermark information is matched with the size of the watermark loading area;
and generating a watermark information dot matrix according to the scaling watermark information.
For the specific working principle of the apparatus for processing an image watermark provided in the embodiments of the present application, reference may be made to relevant steps in the method for processing an image watermark provided in any embodiment of the present application, and details are not described here again.
The application provides a processing device of image watermarks, which comprises an area selection module 301, a watermark loading module, a watermark storage module and a watermark processing module, wherein the area selection module 301 obtains a gray level image corresponding to an image to be processed, and determines a watermark loading area in the gray level image and the image to be processed; the size of the area is determined according to the image resolution; the dot matrix generating module 302 generates a watermark information dot matrix composed of a plurality of pixels in the watermark loading area according to the watermark information; the gray value of the pixel in the watermark information dot matrix is the upper limit of the gray value of the pixel; the watermark loading module 303 loads the watermark information dot matrix into any color channel of the watermark loading area of the image to be processed, so as to obtain the image containing the watermark. According to the scheme, the watermark information dot matrix formed by the pixels is loaded into one channel of the image, so that the influence on the image is small, and the effect of preventing the image leakage can be achieved while the use of the image is not influenced.
An electronic device is further provided in the embodiments of the present application, please refer to fig. 4, and the electronic device includes a memory 401 and a processor 402.
The memory 401 is used for storing computer programs.
The processor 402 is configured to execute a computer program, and is specifically configured to implement the image watermarking processing method according to any embodiment of the present application.
The embodiments of the present application further provide a computer storage medium, configured to store a computer program, where when the computer program is executed, the computer program is specifically configured to implement the image watermark processing method provided in any embodiment of the present application.
It should be noted that the image watermark processing method, apparatus, device and storage medium provided by the present invention may be used in the network security field or the financial field. The foregoing is merely an example, and does not limit the application fields of the image watermark processing method, apparatus, device, and storage medium provided in the present invention.
Finally, it should also be noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrases "comprising one of 8230; \8230;" 8230; "does not exclude the presence of additional like elements in a process, method, article, or apparatus that comprises the element.
It should be noted that the terms "first", "second", and the like in the present invention are only used for distinguishing different devices, modules or units, and are not used for limiting the order or interdependence relationship of the functions performed by the devices, modules or units.
Those skilled in the art can make or use the present application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the application. Thus, the present application is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (12)

1. A method for processing an image watermark, comprising:
acquiring a gray image corresponding to an image to be processed, and determining a watermark loading area in the gray image and the image to be processed; the size of the watermark loading area is determined according to the resolution of the image to be processed;
generating a watermark information dot matrix in the watermark loading area according to preset watermark information; the watermark information dot matrix comprises a plurality of pixels, and the gray value of each pixel of the watermark information dot matrix is the upper limit of the gray value of the pixel in the gray image;
loading the watermark information dot matrix into any color channel of the watermark loading area of the image to be processed to obtain a watermark-containing image; the color channels of the image to be processed comprise a red channel, a green channel and a blue channel in an RGB color mode.
2. The method according to claim 1, wherein after loading the watermark information lattice into any color channel of the image to be processed to obtain a watermarked image, the method further comprises:
splitting the watermark-containing image into three image layers according to a color channel;
extracting a target pixel from each layer to obtain a dot matrix of the layer formed by the target pixels of the layer; wherein the target pixel refers to a pixel whose pixel value reaches an upper limit of a pixel value;
and identifying the dot matrix of each layer, thereby detecting the watermark information carried in the dot matrix of any layer.
3. The method according to claim 1, wherein the loading the watermark information lattice into any color channel of the watermark loading area of the image to be processed comprises:
and for each pixel in the watermark loading area of the image to be processed, if the pixel and the pixel of the watermark information dot matrix are located at the same position, replacing the pixel value of the pixel in a pre-specified color channel with the gray value of the pixel of the watermark information dot matrix located at the same position.
4. The method according to claim 1, wherein the obtaining of the grayscale image corresponding to the image to be processed comprises:
calculating the average value of the pixel values of the pixels in three color channels aiming at each pixel of the image to be processed, and determining the average value as a gray value corresponding to the pixel; and each pixel with the determined gray value forms a gray image corresponding to the image to be processed.
5. The method according to claim 1, wherein the generating a watermark information lattice according to preset watermark information in the watermark loading area comprises:
carrying out scaling operation on preset watermark information to obtain scaled watermark information; wherein the size of the scaled watermark information matches the size of the watermark loading area;
and generating a watermark information dot matrix according to the scaling watermark information.
6. An apparatus for processing image watermarks, comprising:
the watermark processing device comprises a region selection module, a watermark processing module and a watermark processing module, wherein the region selection module is used for obtaining a gray level image corresponding to an image to be processed and determining a watermark loading region in the gray level image and the image to be processed; the size of the watermark loading area is determined according to the resolution of the image to be processed;
the dot matrix generating module is used for generating a watermark information dot matrix in the watermark loading area according to preset watermark information; the watermark information dot matrix comprises a plurality of pixels, and the gray value of each pixel of the watermark information dot matrix is the upper limit of the gray value of the pixel in the gray image;
the watermark loading module is used for loading the watermark information dot matrix into any color channel of the watermark loading area of the image to be processed to obtain a watermark-containing image; the color channels of the image to be processed comprise a red channel, a green channel and a blue channel in an RGB color mode.
7. The apparatus of claim 6, further comprising a watermark extraction module configured to:
splitting the watermark-containing image into three layers according to a color channel;
extracting a target pixel from each layer to obtain a dot matrix of the layer formed by the target pixels of the layer; wherein the target pixel refers to a pixel whose pixel value reaches an upper limit of a pixel value;
and identifying the dot matrix of each layer, thereby detecting the watermark information carried in the dot matrix of any layer.
8. The apparatus according to claim 6, wherein when the watermark loading module loads the watermark information lattice into any color channel of the watermark loading area of the image to be processed, the watermark loading module is specifically configured to:
and for each pixel in the watermark loading area of the image to be processed, if the pixel and the pixel of the watermark information dot matrix are located at the same position, replacing the pixel value of the pixel in a pre-specified color channel with the gray value of the pixel of the watermark information dot matrix located at the same position.
9. The apparatus according to claim 6, wherein the region selection module, when obtaining the grayscale image corresponding to the image to be processed, is specifically configured to:
calculating the average value of the pixel values of the pixels in three color channels aiming at each pixel of the image to be processed, and determining the average value as the gray value corresponding to the pixel; and each pixel with the determined gray value forms a gray image corresponding to the image to be processed.
10. The apparatus according to claim 6, wherein the dot matrix generating module, when generating the watermark information dot matrix according to preset watermark information in the watermark loading area, is specifically configured to:
carrying out scaling operation on preset watermark information to obtain scaled watermark information; wherein the size of the scaled watermark information matches the size of the watermark loading area;
and generating a watermark information dot matrix according to the scaling watermark information.
11. An electronic device comprising a memory and a processor;
wherein the memory is for storing a computer program;
the processor is configured to execute the computer program, and in particular to implement the image watermarking processing method according to any one of claims 1 to 5.
12. A computer storage medium for storing a computer program which, when executed, is particularly adapted to implement the image watermarking processing method according to any one of claims 1 to 5.
CN202211199713.6A 2022-09-29 2022-09-29 Image watermark processing method, device, equipment and storage medium Pending CN115481374A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211199713.6A CN115481374A (en) 2022-09-29 2022-09-29 Image watermark processing method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211199713.6A CN115481374A (en) 2022-09-29 2022-09-29 Image watermark processing method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN115481374A true CN115481374A (en) 2022-12-16

Family

ID=84393202

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211199713.6A Pending CN115481374A (en) 2022-09-29 2022-09-29 Image watermark processing method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115481374A (en)

Similar Documents

Publication Publication Date Title
US10970804B2 (en) Image processing device and image processing method for selecting regions based on gradiation for embedding a watermark
AbdelRaouf A new data hiding approach for image steganography based on visual color sensitivity
US11704764B2 (en) Method and system for generating watermark on the basis of graphic, terminal, and medium
US11057539B2 (en) Method of embedding watermark data in an image by adjusting a pixel when color channel values are above or below a threshold and based on a pixel of a transformed noise-based image being white or black
CN111310134B (en) Screen watermark generation method, device and equipment
Pal et al. Weighted matrix based reversible watermarking scheme using color image
US6831991B2 (en) Reliable detection of LSB steganography in color and grayscale images
KR101960290B1 (en) Method for embedding and extraction of watermarking data
CN114418825B (en) Image processing method, image processing device, computer equipment and storage medium
JP6127225B1 (en) Image processing apparatus, image processing method, and program
CN115841413A (en) Image processing method and device
AU2011200831B2 (en) Dynamic thresholds for document tamper detection
US20220156873A1 (en) Image synthesis device and method for embedding watermark
Al-Otum et al. Copyright protection of color images for android-based smartphones using watermarking with quick-response code
JP6127227B1 (en) Image processing apparatus, image processing method, and program
CN113962838A (en) Watermark image embedding/enhancing method, device and computer system
CN115481374A (en) Image watermark processing method, device, equipment and storage medium
CN116109465A (en) Text document processing method and device, storage medium and electronic equipment
CN111284157A (en) Commodity package anti-counterfeiting printing and verifying method based on fractional order steganography technology
US11954756B1 (en) Anti-leak digital document marking system and method using distributed ledger
WO2024040474A1 (en) Encrypted image watermark processing method and apparatus, and display device
Al-Otum Semiblind copyright protection of color images based on a hybrid classified watermarking technique
CN113822785A (en) Resource copyright setting method, resource copyright checking device and electronic equipment
CN117952814A (en) Training method of watermark extraction model, watermark extraction method and related equipment
CN117974408A (en) Image watermark processing method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination