[go: up one dir, main page]

CN115841413A - Image processing method and device - Google Patents

Image processing method and device Download PDF

Info

Publication number
CN115841413A
CN115841413A CN202211608535.8A CN202211608535A CN115841413A CN 115841413 A CN115841413 A CN 115841413A CN 202211608535 A CN202211608535 A CN 202211608535A CN 115841413 A CN115841413 A CN 115841413A
Authority
CN
China
Prior art keywords
image
mapping
watermark
processed
pixel
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
CN202211608535.8A
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.)
Shanghai Bilibili Technology Co Ltd
Original Assignee
Shanghai Bilibili Technology Co 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 Shanghai Bilibili Technology Co Ltd filed Critical Shanghai Bilibili Technology Co Ltd
Priority to CN202211608535.8A priority Critical patent/CN115841413A/en
Publication of CN115841413A publication Critical patent/CN115841413A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Image Processing (AREA)
  • Editing Of Facsimile Originals (AREA)

Abstract

The application provides an image processing method and an image processing device, wherein the image processing method comprises the following steps: acquiring an image to be processed, and determining a watermark image associated with the image to be processed; mapping the watermark image to an image to be processed to obtain a mapping area corresponding to the watermark image in the image to be processed; determining a pixel point corresponding relation between a watermark pixel point in the watermark image and a mapping pixel point in the mapping area, and calculating a target pixel value of the mapping pixel point based on the pixel point corresponding relation; and generating a target image corresponding to the image to be processed based on the target pixel value and the pixel value of the original pixel point in the image to be processed. The method and the device realize that the watermark is added in the appointed area of the image to be processed in a mode of calculating partial pixel points, further realize copyright protection, and only change the pixel values of the pixel points in the mapping area, so that the visual influence of the watermark image on the image to be processed is reduced after the watermark image is added into the image to be processed.

Description

Image processing method and device
Technical Field
The present application relates to the field of computer technologies, and in particular, to an image processing method. The present application also relates to an image processing apparatus, a computing device, and a computer-readable storage medium.
Background
With the popularization of computer networks, multimedia information can be spread more rapidly and widely in the internet, which makes the problems of information security, intellectual property protection, identity authentication and the like prominent. In order to solve the problems of multimedia copyright infringement, illegal copy and the like, people widely explore the fields of encryption and digital watermarking. Encryption can ensure the safe transmission of multimedia files between a provider and a user who obtains a secret key, but after the user obtains the encrypted multimedia files, an encryption algorithm does not work any more, and the user can copy and transmit the decrypted files, which can also cause the problems of illegal copying and the like.
In the prior art, the digital watermark can implicitly embed copyright information into multimedia files such as audio, images and videos, and is not easy to be perceived by people and attacked or removed. In the prior art, image encryption is usually realized by using an LSB algorithm, however, this method needs to calculate the pixel value of each pixel point in an image, which will improve the visual impact of the watermark on the image. Therefore, an image processing method is needed to solve the above problems.
Disclosure of Invention
In view of this, the present application provides an image processing method. The application also relates to an image processing device, a computing device and a computer readable storage medium, which are used for solving the problem that the influence of the watermark on the image vision is large in the prior art.
According to a first aspect of embodiments of the present application, there is provided an image processing method, including:
acquiring an image to be processed, and determining a watermark image associated with the image to be processed;
mapping the watermark image to the image to be processed to obtain a mapping area corresponding to the watermark image in the image to be processed;
determining a pixel point corresponding relation between a watermark pixel point in the watermark image and a mapping pixel point in the mapping region, and calculating a target pixel value of the mapping pixel point based on the pixel point corresponding relation;
and generating a target image corresponding to the image to be processed based on the target pixel value and the pixel value of the original pixel point in the image to be processed.
According to a second aspect of embodiments of the present application, there is provided an image processing apparatus comprising:
the acquisition module is configured to acquire an image to be processed and determine a watermark image associated with the image to be processed;
the mapping module is configured to map the watermark image to the image to be processed, and obtain a mapping area corresponding to the watermark image in the image to be processed;
a calculation module configured to determine a pixel point correspondence between a watermark pixel point in the watermark image and a mapping pixel point in the mapping region, and calculate a target pixel value of the mapping pixel point based on the pixel point correspondence;
the generating module is configured to generate a target image corresponding to the image to be processed based on the target pixel value and the pixel value of the original pixel point in the image to be processed.
Optionally, the mapping the watermark image to the image to be processed to obtain a mapping region corresponding to the watermark image in the image to be processed includes:
determining a preset mapping numerical value;
and mapping the watermark image to the image to be processed based on the preset mapping numerical value to obtain a mapping area corresponding to the watermark image in the image to be processed.
Optionally, the determining a pixel point correspondence between a watermark pixel point in the watermark image and a mapping pixel point in the mapping region includes:
all pixel points in the watermark image are used as watermark pixel points;
selecting a mapping pixel point in the mapping region according to the preset mapping numerical value;
and determining the pixel point corresponding relation between the watermark pixel point and the mapping pixel point.
Optionally, the calculating a target pixel value of the mapped pixel based on the pixel correspondence includes:
and screening mapping pixel points in the mapping region based on the pixel point corresponding relation, and calculating target pixel values of the mapping pixel points.
Or,
and calculating a mapping pixel value of the mapping pixel point based on the pixel point corresponding relation, calculating a non-mapping pixel value of a non-mapping pixel point without the pixel point corresponding relation in the mapping region, and taking the mapping pixel value and the non-mapping pixel value as the target pixel value.
Optionally, the acquiring an image to be processed and determining a watermark image associated with the image to be processed includes:
receiving a data query instruction aiming at query service, and reading data to be processed based on the data query instruction;
and generating an image to be processed based on the data to be processed, and determining a watermark image associated with the image to be processed.
Optionally, after the step of mapping the watermark image to the image to be processed and obtaining the mapping region corresponding to the watermark image in the image to be processed is executed, the method further includes:
determining the position information of the mapping area in the image to be processed;
generating encryption information based on the location information and the attribute information of the mapping area.
Optionally, the mapping the watermark image to the image to be processed to obtain a mapping region corresponding to the watermark image in the image to be processed includes:
and determining an adding position in the image to be processed, and mapping the watermark image to the image to be processed according to the adding position to obtain a mapping area corresponding to the watermark image in the image to be processed.
Optionally, after the step of generating the target image corresponding to the image to be processed is executed, the method further includes:
determining a watermark area in the target image according to the encryption information;
determining watermark pixel points in the watermark region according to the watermark image;
and calculating the watermark pixel points based on a preset calculation rule to obtain reduction pixel points, and generating the image to be processed based on the reduction pixel points and target pixel points in the target image.
According to a third aspect of embodiments of the present application, there is provided a computing device comprising a memory, a processor and computer instructions stored on the memory and executable on the processor, the processor implementing the steps of the image processing method when executing the computer instructions.
According to a fourth aspect of embodiments of the present application, there is provided a computer-readable storage medium storing computer instructions which, when executed by a processor, implement the steps of the image processing method.
The image processing method provided by the application comprises the following steps: acquiring an image to be processed, and determining a watermark image associated with the image to be processed; mapping the watermark image to an image to be processed to obtain a mapping area corresponding to the watermark image in the image to be processed; determining a pixel point corresponding relation between a watermark pixel point in the watermark image and a mapping pixel point in the mapping area, and calculating a target pixel value of the mapping pixel point based on the pixel point corresponding relation; and generating a target image corresponding to the image to be processed based on the target pixel value and the pixel value of the original pixel point in the image to be processed.
According to the embodiment of the application, the watermark is added in the appointed area of the image to be processed in a mode of calculating part of pixel points, so that the copyright protection is realized, and the visual influence of the watermark image on the image to be processed is reduced after the watermark image is added into the image to be processed by only changing the pixel values of the pixel points in the mapping area. The visual influence of the watermark on the picture is reduced on the basis of protecting the copyright of the picture.
Drawings
Fig. 1 is a schematic structural diagram of an image processing method according to an embodiment of the present application;
FIG. 2 is a flowchart of an image processing method according to an embodiment of the present application;
fig. 3 is a schematic diagram of an image processing method according to an embodiment of the present application;
fig. 4 is a process flow diagram of an image processing method applied to watermarking in an image according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of an image processing apparatus according to an embodiment of the present application;
fig. 6 is a block diagram of a computing device according to an embodiment of the present application.
Detailed Description
In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present application. This application is capable of implementation in many different ways than those herein set forth and of similar import by those skilled in the art without departing from the spirit of this application and is therefore not limited to the specific implementations disclosed below.
The terminology used in the one or more embodiments of the present application is for the purpose of describing particular embodiments only and is not intended to be limiting of the one or more embodiments of the present application. As used in one or more embodiments of the present application and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used in one or more embodiments of the present application refers to and encompasses any and all possible combinations of one or more of the associated listed items.
It will be understood that, although the terms first, second, etc. may be used herein in one or more embodiments of the present application to describe various information, these information should not be limited by these terms. These terms are only used to distinguish one type of information from another. For example, a first aspect may be termed a second aspect, and, similarly, a second aspect may be termed a first aspect, without departing from the scope of one or more embodiments of the present application. The word "if," as used herein, may be interpreted as "at … …" or "at … …" or "in response to a determination," depending on the context.
First, the noun terms to which one or more embodiments of the present application relate are explained.
LSB (LeastSignificant Bits) algorithm: the secret information is embedded in the least significant bits, also called least significant bits, of the carrier image pixel values, and changing this position has a minimal impact on the quality of the carrier image. The basic principle of the LSB algorithm: and replacing LSBs in the space domain, wherein the sequence for replacing the LSBs is watermark information to be added, a digital summary of the watermark or a pseudo-random sequence generated by the watermark. Since the position where the watermark information is embedded is LSB, the watermark strength allowed to be embedded cannot be too high in order to satisfy the invisibility of the watermark. However, various processing in the spatial domain, such as pre-processing before run-length encoding, will compress some of the insignificant components, so the LSB algorithm is sensitive to these operations. The LSB algorithm is therefore initially used for fragile watermarking.
Optical three primary colors (RGB): the RGB color scheme is a color standard in the industry, which obtains various colors by changing three color channels of red (R), green (G) and blue (B) and superimposing them on each other, and RGB represents the colors of the three channels of red, green and blue, and the standard includes almost all colors perceived by human vision, which is one of the most widely used color systems.
Color channel: i.e. the channel in which the image color information is stored is the color channel. Each image has one or more color channels, and the default number of channels in an image depends on its color mode, i.e., the color mode of an image will determine the number of color channels. Each color channel stores information of the color elements in the image. The colors in all color channels are mixed in superposition to produce the colors of the pixels in the image.
Watermarking: the method originated from woodcarving printing of pictorial works refers to adding translucent logo and icon on picture to prevent others from stealing picture.
Dark watermarking: refers to a mark hidden in the information content of some plasmid carrier, and the mark is beyond the acceptable range of people and machine equipment. Compared with common bright picture watermarks, the method has the advantages that enterprise logo marks in picture videos, picture watermark lines in paper money and the like are included. The dark picture watermark is transparent and invisible to most perceptual systems.
Spatial domain space signal Bits (LSB) picture watermark: interpreted as the "least significant bit". Pixels are the basic elements of digital images, and an image is composed of pixels, each pixel is composed of a multi-bit mode, each pixel is usually 8 bits in a gray scale image, and each pixel is 24 bits (8 bits of R, G, B three colors) in an RGB image, and each bit takes a value of 0 or 1.
Text watermarking: refers to embedding hidden watermark information in text information. This is inspired by the handwritten font. The writing style of each person is different, and the stroke shape of each word is also different, so that the unique font file is introduced into the document with higher security level to realize the embedding of the identification information of the person.
With the development of network technology and multimedia technology, a great number of enterprises taking streaming media technology as core business emerge, and the enterprises have good development trends and wide development prospects, so that more and more free-job owners and organizations are attracted to participate in multimedia creation. However, with the popularization of computer networks, multimedia information can be spread more rapidly and widely in the internet, which makes the problems of information security, intellectual property protection, identity authentication and the like prominent. In order to solve the problems of multimedia copyright infringement, illegal copy and the like, people widely explore the fields of encryption and digital watermarking.
Encryption can ensure the safe transmission of multimedia files between a provider and a user who obtains a secret key, but after the user obtains the encrypted multimedia files, an encryption algorithm does not work any more, and the user can copy and transmit the decrypted files, so that the problems of illegal copying and the like can be caused. The digital watermark can implicitly embed copyright information into multimedia files such as audio, images, videos and the like, and is not easy to be perceived by ordinary people and is not easy to attack or remove. Therefore, the digital watermarking technology is more widely applied to multimedia copyright protection. The common jpg image adopts an RGB mode, that is, three channels, and a pixel point of each channel is identified by 8 bits, for example, a pixel value at a certain position of the image is represented by binary: r =10000010, g =10000001, b =01001111.
Fig. 1 is a schematic structural diagram of an image processing method according to an embodiment of the present application, and as shown in fig. 1, after an image to be processed is obtained, a watermark image associated with the image to be processed is determined, where the watermark image may be a signature image or an arbitrary image; mapping the watermark image to an image to be processed according to a preset pixel point interval to obtain a mapping area corresponding to the watermark image in the image to be processed; taking pixel points in the watermark image as watermark pixel points, determining the pixel point corresponding relation between the watermark pixel points 1, 2, 3 and 4 in the watermark image and the mapping pixel points in the mapping area, and calculating the target pixel values of the mapping pixel points based on the pixel point corresponding relation, namely calculating the pixel values of the pixel points in a first row, a first line, a fourth line, a first column and a fourth line, a fourth line and a fourth line; and generating a target image corresponding to the image to be processed based on the target pixel value and the pixel value of the original pixel point in the image to be processed.
In the present application, an image processing method is provided, and the present application relates to an image processing apparatus, a computing device, and a computer-readable storage medium, which are described in detail one by one in the following embodiments.
Fig. 2 shows a flowchart of an image processing method according to an embodiment of the present application, which specifically includes the following steps:
step S202: acquiring an image to be processed, and determining a watermark image associated with the image to be processed.
Specifically, the image to be processed refers to an image that needs to be subjected to watermarking, and the image to be processed may be any image; in the financial field, the image to be processed may be an image type transaction record; the image to be processed can be an image corresponding to any frame in a video or animation; the image to be processed can also be an image corresponding to the spreadsheet, for example, data such as student scores and classes are read, and an image generated according to the data is the image to be processed; the watermark image is an image used for watermarking an image to be processed, and the watermark image is added to the image to be processed as a watermark to play a role in marking. The watermark image can be an image with special significance, such as a handwritten signature, a randomly generated line image and the like, is not easy to imitate and has uniqueness.
Based on the method, under the scene of adding the watermark to the image, the to-be-processed image needing to be added with the watermark is obtained, the watermark image related to the to-be-processed image is determined according to the watermark adding requirement, the watermark image is used for identifying the to-be-processed image, and the watermark image has uniqueness relative to the to-be-processed image. The watermark image may be an image of a trademark, logo, signature, watermark texture, or the like.
In practical application, in an inquiry scene, a user may perform inquiry based on specified data, for example, inquiry of transaction records of the specified user, inquiry of data such as examination scores of a certain class, after the data is obtained through inquiry, an image generated based on the inquired data is an image to be processed, and a signature image of an inquirer is a watermark image, so that watermarking is performed on the image generated based on the data, that is, the watermark is added to the image generated based on the data by using the signature image as the watermark.
Further, considering that only watermarking processing is performed on an image, the limitation is high, so that watermarking processing can be performed on data, the data is converted into an image format, and then watermarking processing is performed on the image, and in an inquiry scene, when an acquired inquiry result is data, the data is converted into the image format, and the following concrete implementation is that:
receiving a data query instruction aiming at query service, and reading data to be processed based on the data query instruction; and generating a to-be-processed image based on the to-be-processed data, and determining a watermark image associated with the to-be-processed image.
Specifically, the query service refers to a task of performing data query, including but not limited to performing data query through an application program, performing data query through a web page, performing data query in a data management system, performing data query in an existing database, and the like; correspondingly, the data query instruction is a computer command submitted by a user aiming at the query service and is used for realizing data query; the data to be processed is the data corresponding to the data query instruction fed back by the server after the data query instruction is submitted.
Based on the method, after a data query instruction submitted by a user for the query service is received, the data to be processed corresponding to the data query instruction is read in the database for the data query instruction, and the image to be processed is generated based on the attribute characteristics of the data to be processed. And determining the watermark image associated with the image to be processed according to the query information carried in the data query instruction, wherein the query information carried in the data query instruction includes but is not limited to the signature information of the user submitting the query instruction, the watermark image information submitted by the user and the like.
For example, the student management system records student personal information and examination scores of each student in each examination, a user of the student management system may be a teacher, when inquiring examination scores of students in a class, the user inputs a class name and an examination name (3 month and month in a certain year, an examination in a certain period of a school, and after receiving a data inquiry instruction submitted by the user, the server feeds an inquiry result back to the user to obtain the examination scores of the students in the class, and displays the examination scores to the user in a form, and after receiving a student score form, the user converts the examination scores into a picture form to store. And selecting a watermark picture associated with the picture to be processed by the user, wherein the watermark picture can be a nickname of the user, a signature of the user and the like, and storing the nickname of the user and the signature of the user as a picture format for use as the watermark picture.
In summary, the to-be-processed image is generated based on the queried to-be-processed data, so that watermarking processing is performed on the data, flexibility of watermarking processing is improved, an object processing range of watermarking processing is expanded, and watermarking processing can be performed on the image and the data.
Step S204: and mapping the watermark image to the image to be processed to obtain a mapping area corresponding to the watermark image in the image to be processed.
Specifically, after the to-be-processed image is obtained and the watermark image associated with the to-be-processed image is determined, the watermark image can be mapped to the to-be-processed image to obtain a mapping area corresponding to the watermark image in the to-be-processed image, wherein the mapping area is an image area corresponding to the watermark image determined in the to-be-processed image after the watermark image is mapped into the to-be-processed image; the number of the pixel points contained in the mapping region may be equal to or greater than the number of the pixel points contained in the watermark image.
Based on the method, after the image to be processed is obtained and the watermark image associated with the image to be processed is determined, the watermark adding position is selected from the image to be processed, the watermark image is mapped to the watermark adding position in the image to be processed, and the mapping area corresponding to the watermark image in the image to be processed is obtained.
In practical application, any position in an image to be processed can be added with a watermark image for watermarking, when the image to be processed is watermarked based on the watermark image, a watermark area is selected in the image to be processed, and the watermark image is mapped to the watermark area in the image to be processed, so that the watermark is added in the designated area of the image to be processed. In addition, since the watermark image needs to be added to the image to be processed in a watermark manner, the image size of the watermark image needs to be smaller than that of the image to be processed, that is, the length and width of the watermark image need to be smaller than those of the image to be processed.
Further, in consideration of the fact that the number of the pixel points included in the image to be processed is far greater than the number of the pixel points of the watermark image, when the watermark image is mapped to the image to be processed, a mapping numerical value can be preset based on the number of the pixel points included in the watermark image, and the mapping area corresponding to the watermark image is determined in the image to be processed based on the preset mapping numerical value, and the specific implementation is as follows:
determining a preset mapping numerical value; and mapping the watermark image to the image to be processed based on the preset mapping numerical value to obtain a mapping area corresponding to the watermark image in the image to be processed.
Specifically, the preset mapping numerical value refers to a preset numerical value used for representing a pixel point selection interval of the image to be processed, and the purpose of mapping the watermark image into the image to be processed is to determine pixel points corresponding to watermark pixel points in the watermark image in the image to be processed, so that when the preset mapping numerical value is 0, the size of a mapping area determined in the image to be processed is equal to the size of the watermark image, namely the number of pixel points contained in the mapping area is equal to the number of pixel points contained in the watermark image. The purpose of mapping the watermark image into the image to be processed is to determine a mapping region in the image to be processed, and pixel points contained in the watermark image all have pixel points corresponding to the pixel points in the mapping region, so that the requirement that the size of the watermark image is necessarily smaller than the size of the image to be processed is met, that is, the number of the pixel points contained in the watermark image is smaller than the number of the pixel points in the image to be processed, and when the preset mapping value is determined, whether the mapping region determined based on the preset mapping value can contain the mapping pixel points corresponding to the watermark pixel points of each watermark image also needs to be considered.
Based on the method, a preset mapping numerical value is determined based on the number of watermark pixel points in the watermark image, the watermark image is mapped to the image to be processed based on the preset mapping numerical value, mapping pixel points corresponding to each watermark pixel point are sequentially determined in the image to be processed according to the arrangement sequence of the watermark pixel points in the watermark image, and a mapping area is formed by areas formed by the mapping pixel points in the image to be processed. The size of the mapping area is determined by the watermark pixel points at four corners in the watermark image, that is, the watermark image contains 4 pixel points, 1, 2, 3 and 4 respectively, under the condition that the preset mapping numerical value is 1, the watermark pixel point 1 in the watermark image corresponds to the mapping pixel point of the first row and the first column in the image to be processed, the watermark pixel point 2 corresponds to the mapping pixel point of the first row and the third column, the watermark pixel point 3 corresponds to the mapping pixel point of the third row and the first column, and the watermark pixel point 4 corresponds to the mapping pixel point of the third row and the third column, so the mapping area is an area with three rows and three columns.
In the above example, as shown in fig. 3, when the image to be processed includes 121 pixel points of eleven rows and eleven columns, and the watermark image includes 16 pixel points of four rows and four columns, the preset mapping value is set to 1, and since the watermark image includes 16 pixel points of four rows and four columns, the pixel points in the image to be processed corresponding to 1, 2, 3, and 4 in the first row in the watermark image are the pixel points 1, 3, 5, and 7 in the first row, and the pixel points in the image to be processed corresponding to 1, 2, 3, and 4 in the first column in the watermark image are the pixel points 1, 3, 5, and 7 in the first column, and then each watermark pixel point in the watermark image corresponds to a pixel point in the image to be processed, so as to obtain a dotted line region in the image to be processed in fig. 3, where the region is a mapping region.
In summary, the watermark image is mapped to the image to be processed based on the preset mapping value, so as to obtain the mapping region corresponding to the watermark image in the image to be processed, thereby improving the diversity of the determination of the mapping region.
Further, considering that the size of the image to be processed may be much larger than the size of the watermark image, the watermark may be added at any position in the image to be processed, that is, before mapping, the position to be added with the watermark is determined in the image to be processed, and then mapping is performed, which is specifically implemented as follows:
and determining an adding position in the image to be processed, and mapping the watermark image to the image to be processed according to the adding position to obtain a mapping area corresponding to the watermark image in the image to be processed.
Specifically, the adding position refers to a watermark adding position to be added with a watermark in the image to be processed, and the adding position can be determined by combining the size of the watermark image, the size of the image to be processed and a preset mapping numerical value, that is, by combining the number of pixel points included in the watermark image, the number of pixel points included in the image to be processed and the preset mapping numerical value, for example, when the watermark needs to be added at the lower right corner of the image to be processed, the number of watermark pixel points in the watermark image and the preset mapping numerical value are considered, two rows and two columns of 4 pixel points are included in the watermark image, the preset mapping numerical value is 2, and under the condition that the image to be processed includes 100 pixel points in ten rows and ten columns, the pixel point corresponding to the watermark pixel point in the second row and the second column of the watermark image to be processed is a pixel point in the tenth row and correspondingly, the pixel point corresponding to each watermark pixel point in the image to be processed is determined, so as to form a mapping region, that the region is formed by starting from the seventh row and the tenth column in the image to be processed.
Based on the above, the adding position is determined in the image to be processed according to the number of the pixel points contained in the watermark image, the number of the pixel points contained in the image to be processed and the preset mapping value, and the adding position can be the pixel point position corresponding to the pixel point at any position in the watermark image in the image to be processed. And mapping the watermark image to the image to be processed according to the adding position to obtain a mapping area corresponding to the watermark image in the image to be processed.
Along with the above example, as shown in fig. 3, the adding position of the watermark is the upper left corner of the image to be processed, in practical application, the adding position of the watermark can also be selected from the image to be processed according to requirements, for example, the watermark is added at the center position, the lower right corner position, the upper right corner position, and the like of the image to be processed, and after the adding position is determined, mapping is performed, so that the mapping region corresponding to the adding position can be obtained.
In summary, before the watermark image is mapped to the image to be processed, the adding position of the watermark is determined in the image to be processed, so that the adding position of the watermark is flexibly selected in the image to be processed, and the flexibility of selecting the watermark position is improved.
Further, considering that the purpose of adding the watermark to the image to be processed is to add copyright information to the image to be processed, and to prevent the processed image from being stolen, the watermark plays a role in encrypting the image to be processed, and therefore an encryption key, that is, encryption information, needs to be determined according to the watermark adding information, which is specifically implemented as follows:
determining the position information of the mapping area in the image to be processed; generating encryption information based on the location information and the attribute information of the mapping area.
Specifically, the position information refers to position information of the mapping region in the image to be processed, and the position information may be represented by positions of pixel points or may be represented in a coordinate manner, for example, a pixel point at a lower left corner in the mapping region is used as a reference pixel point, and when the coordinate system is a coordinate system corresponding to the image to be processed, a coordinate value of the pixel point is used as coordinate information, that is, the position information; the attribute information of the mapping region includes length and width information of the mapping region; accordingly, the encryption information refers to a secret key generated based on the location information and the attribute information.
Based on the position information, determining the position information of the mapping area in the image to be processed according to the position of the mapping area in the image to be processed; and (3) constructing a coordinate system by taking any position in the image to be processed as an origin, so that the position information can be represented in the form of position coordinates of pixel points. The length information and the width information of the mapping area are used as the attribute information of the mapping area, and the encryption information is generated based on the position information and the attribute information of the mapping area.
Along the above example, as shown in fig. 3, a coordinate system is constructed with the pixel point in the seventh row and the first column in the image to be processed as the origin of the coordinate system, the position coordinate of the pixel point in the seventh row and the first column in the mapping region corresponding to the dashed line frame is the position information, and the length information 7 and the width information 7 of the mapping region are the attribute information, thereby constituting the encrypted information (7.1,7,7).
In summary, the encryption information is generated based on the position information of the mapping region in the image to be processed and the attribute information of the mapping region, and is further used for performing decryption processing on the target image subsequently, so as to verify the ownership of the target image according to the watermark image obtained after decryption.
Furthermore, considering that the watermark is added to the image to be processed, there is a decryption requirement after the image is encrypted, so that the watermarked image to be processed can be decrypted based on the encryption information, which is specifically realized as follows:
determining a watermark area in the target image according to the encryption information; determining watermark pixel points in the watermark region according to the watermark image; and calculating the watermark pixel points based on a preset calculation rule to obtain reduction pixel points, and generating the image to be processed based on the reduction pixel points and target pixel points in the target image.
Specifically, the watermark region refers to a partial region of a target image to which a watermark is added, because the encrypted information includes position information corresponding to the mapping region and attribute information of the mapping region, the watermark region can be determined in the target image based on the information, and then pixel points included in the watermark region are restored through inverse operation of an encryption algorithm.
Based on the above, determining a watermark region in the target image according to the encrypted information, and determining watermark pixel points corresponding to the pixel points contained in the watermark image in the watermark region according to the watermark image; and calculating the watermark pixel points based on a preset calculation rule to obtain reduction pixel points, generating an image to be processed based on the reduction pixel points and target pixel points in the target image, and performing watermark removal processing on the target image.
Following the above example, after the encrypted information (7.1,7,7) is obtained, 7.1 represents the coordinate value of the pixel point at the bottom left corner in the mapping region, and 7 represent the length and width of the mapping region, respectively, so that the watermark region subjected to the watermarking process is determined in the target image according to the coordinate value and the length 7 and width 7. Determining pixel points corresponding to watermark pixel points in a watermark region according to the watermark pixel points contained in the watermark image, and further restoring the pixel points, namely processing by adopting inverse operation of encryption calculation, obtaining the pixel value 182 of the pixel point in the image to be processed by adopting inverse operation of summation and remainder on the basis of the known pixel value 11, quotient 11 and remainder 12 of the watermark pixel points in the watermark image, namely multiplying 11 by 17 and then adding 12 to be equal to 199, 199 and then subtracting the watermark pixel value 17 to obtain the pixel value 182 of the pixel point in the image to be processed, and obtaining the original image to be processed after processing each pixel point in the watermark region.
In summary, the target image is restored by using the encrypted information to obtain the image to be processed, and then the copyright information can be verified based on the restored target image.
Step S206: and determining a pixel point corresponding relation between a watermark pixel point in the watermark image and a mapping pixel point in the mapping area, and calculating a target pixel value of the mapping pixel point based on the pixel point corresponding relation.
Specifically, after the watermark image is mapped to the image to be processed and the mapping region corresponding to the watermark image in the image to be processed is obtained, the pixel point correspondence between the watermark pixel point in the watermark image and the mapping pixel point in the mapping region can be determined, and the target pixel value of the mapping pixel point is calculated based on the determined pixel point correspondence, wherein the mapping pixel point refers to the pixel point contained in the mapping region, the mapping pixel point and the watermark pixel point in the watermark image have a position correspondence, and the position correspondence is the pixel point correspondence between the watermark pixel point in the watermark image and the mapping pixel point contained in the mapping region.
Based on this, after the watermark image is mapped to the image to be processed and the mapping area corresponding to the watermark image in the image to be processed is obtained, the corresponding relation of pixel points between the watermark pixel points in the watermark image and the mapping pixel points in the mapping area is determined, namely after the watermark pixel points in the watermark image are mapped to the image to be processed, the mapping pixel points in the mapping area corresponding to each watermark pixel point are determined, and the pixel value of each mapping pixel point is calculated as the target pixel value based on the determined corresponding relation of the pixel points.
In practical application, when the target pixel value of the mapping pixel point is calculated based on the pixel point corresponding relation between the watermark pixel point and the mapping pixel point, the watermark pixel point and the mapping pixel point can be summed and subjected to remainder calculation, and the calculation result is the target pixel value of the mapping pixel point. It should be noted that, when calculating the target pixel value of the mapping pixel, the averaging calculation may be performed in addition to the sum and remainder algorithm, and the calculation method may be determined according to actual requirements, which is not limited in this embodiment.
Furthermore, in consideration of the integrity of the watermark image when the watermark image is added into the image to be processed, each watermark pixel point has a mapping pixel point uniquely corresponding to the watermark pixel point in the image to be processed, so that the pixel point corresponding relationship between the watermark pixel point and the mapping pixel point can be determined, and the method is specifically realized as follows:
all pixel points in the watermark image are used as watermark pixel points; selecting a mapping pixel point in the mapping region according to the preset mapping numerical value; and determining the pixel point corresponding relation between the watermark pixel point and the mapping pixel point.
Specifically, the watermark pixel points refer to all pixel points contained in the watermark image; the mapping pixel points refer to pixel points which have a mapping relation with the watermark pixel points in the watermark image in the image to be processed; correspondingly, the mapping relationship is a pixel point correspondence relationship, that is, a correspondence relationship between a pixel point in the mapping region and a watermark pixel point in the watermark image.
Based on the above, all the pixel points in the watermark image are used as watermark pixel points; selecting a mapping pixel point corresponding to each watermark pixel point in the watermark image in the mapping region according to a preset mapping numerical value; and taking the mapping relation between the watermark pixel point and the mapping pixel point as the corresponding relation of the pixel point.
In the above example, as shown in fig. 3, after 16 pixel points such as four rows, four columns, and the like in the watermark image are determined, 16 pixel points also exist in the mapping region represented by the dashed line box in the image to be processed and respectively correspond to 16 watermark pixel points in the watermark image, and the mapping relationship between the mapping pixel points in the mapping region and the watermark pixel points in the watermark image is a pixel point correspondence relationship, so that the calculated pixel value corresponding to each mapping pixel point is calculated based on the pixel point correspondence relationship in the subsequent process.
In summary, the mapping pixel points are selected in the mapping region according to the preset mapping value, so that the diversity of the selection modes of the mapping pixel points is improved.
Further, considering the diversity and flexibility of the calculation method of the target pixel value, two methods can be used to calculate the target pixel value, that is, only the mapping pixel points in the mapping region that have pixel point correspondence with the watermark pixel points are calculated, or different calculation methods are used to calculate the mapping pixel points in the mapping region that have pixel point correspondence with the watermark pixel points, and the specific implementation of calculating the pixel points in the mapping region that do not have pixel point correspondence with the watermark pixel points is as follows:
screening mapping pixel points in the mapping region based on the corresponding relation of the pixel points, and calculating target pixel values of the mapping pixel points; or calculating a mapping pixel value of the mapping pixel point based on the pixel point corresponding relation, calculating a non-mapping pixel value of a non-mapping pixel point without the pixel point corresponding relation in the mapping region, and taking the mapping pixel value and the non-mapping pixel value as the target pixel value.
Specifically, the unmapped pixel points are pixel points which do not have a pixel point correspondence relationship with the watermark pixel points in the watermark image in the mapping region, that is, when the preset mapping numerical values are different, the number of the unmapped pixel points included in the mapping region is also different, and the number of the mapped pixel points included in the mapping region is the same as the number of the watermark pixel points in the watermark image.
Based on the mapping, screening mapping pixel points corresponding to the watermark pixel points in the watermark image in the mapping region based on the pixel point corresponding relation, and calculating a target pixel value of each mapping pixel point; or screening mapping pixel points corresponding to watermark pixel points in the watermark image in the mapping region based on the pixel point corresponding relation, calculating the mapping pixel value of each mapping pixel point, then calculating the non-mapping pixel value of the non-mapping pixel point without the pixel point corresponding relation in the mapping region, and taking the mapping pixel value and the non-mapping pixel value as target pixel values.
Following the above example, when calculating a target pixel value corresponding to a mapping pixel point in a mapping region, there are two calculation methods, the first one is to find a mapping pixel point corresponding to a watermark pixel point in a watermark image in the mapping region according to a pixel point correspondence relationship between pixel points, as shown in fig. 3, the mapping pixel point is a pixel point having a pixel point correspondence relationship between 16 pixel points 1, 3, 5, 7, etc. in an image to be processed and 16 watermark pixel points in the watermark image, and the watermark pixel point and the mapping pixel point are summed and remainder calculated according to the pixel point correspondence relationship, for example, the pixel value of the mapping pixel point is 182, the quotient after summing and remainder is 11, the remainder is 12, and the target pixel value is 11. Secondly, determining a mapping pixel point in a mapping area, performing summation and remainder calculation on the mapping pixel point and a watermark pixel point, taking pixel points such as pixel points 2, 4 and 6 without pixel point correspondence in the mapping area as unmapped pixel points, performing pixel value invariant calculation on the unmapped pixel points, for example, multiplying the pixel value of the unmapped pixel points by 1, and taking the pixel value of the unmapped pixel points and the pixel value of the mapping pixel points as target pixel values.
In summary, the target pixel value of the mapping pixel point in the mapping region is calculated in various ways, so that the flexibility of determining the target pixel value is improved.
Step S208: and generating a target image corresponding to the image to be processed based on the target pixel value and the pixel value of the original pixel point in the image to be processed.
Specifically, after the correspondence between the watermark pixel points in the watermark image and the mapping pixel points in the mapping region is determined, and the target pixel values of the mapping pixel points are calculated based on the correspondence between the pixel points, the target image corresponding to the image to be processed can be generated based on the target pixel values and the pixel values of the original pixel points in the image to be processed, wherein the original pixel points are pixel points which do not have the correspondence between the pixel points in the image to be processed and the watermark pixel points in the watermark image, and the target image is a watermarked image obtained by adding a watermark to the image to be processed.
Based on the method, after the corresponding relation of pixel points between the watermark pixel points in the watermark image and the mapping pixel points in the mapping area is determined, the target pixel values of the mapping pixel points are calculated based on the corresponding relation of the pixel points, the original pixel points are determined in the image to be processed, the target image corresponding to the image to be processed is generated based on the target pixel values and the pixel values of the original pixel points in the image to be processed, and watermarking processing of the image to be processed is achieved.
In practical application, the target pixel value is a pixel value obtained by calculating the mapping pixel point after being selected as the mapping pixel point in the image to be processed, the pixel point which is not calculated in the image to be processed is an original pixel point, and a target image corresponding to the image to be processed, namely the watermarked image, can be generated based on the pixel value of the original pixel point and the target pixel value.
In summary, the image processing method provided by the application obtains the image to be processed, and determines the watermark image associated with the image to be processed; mapping the watermark image to an image to be processed to obtain a mapping area corresponding to the watermark image in the image to be processed; determining a pixel point corresponding relation between a watermark pixel point in the watermark image and a mapping pixel point in the mapping area, and calculating a target pixel value of the mapping pixel point based on the pixel point corresponding relation; and generating a target image corresponding to the image to be processed based on the target pixel value and the pixel value of the original pixel point in the image to be processed. The method and the device realize that the watermark is added in the appointed area of the image to be processed in a mode of calculating partial pixel points, further realize copyright protection, and only change the pixel values of the pixel points in the mapping area, so that the visual influence of the watermark image on the image to be processed is reduced after the watermark image is added into the image to be processed. The visual influence of the watermark on the picture is reduced on the basis of protecting the copyright of the picture.
The following description will further describe the image processing method with reference to fig. 4 by taking an application of the image processing method provided in the present application to watermark addition in an image as an example. Fig. 4 shows a processing flow chart of an image processing method applied to watermark addition in an image according to an embodiment of the present application, and specifically includes the following steps:
step S402: and receiving a data query instruction aiming at the query service, and reading the data to be processed based on the data query instruction.
The business inquiry system stores the transaction information and other private information of the user, the user can check the transaction records in the business inquiry system, when inquiring the transaction records of one transaction, the data inquiry command can be sent to the server by inputting the transaction date or number and clicking the inquiry button, and after receiving the data inquiry command submitted by the user, the server feeds back the inquiry result to the user to obtain the transaction information of the one transaction and displays the transaction information to the user in a form mode.
Step S404: and generating an image to be processed based on the data to be processed, and determining a watermark image associated with the image to be processed.
And after receiving the transaction information, the user converts the transaction information into a picture form to be stored. And selecting the watermark picture associated with the picture to be processed by the user, wherein the watermark picture can be a nickname of the user, a signature of the user and the like, and storing the nickname of the user or the signature of the user into a picture format to be used as the watermark picture.
Step S406: and determining a preset mapping numerical value, and mapping the watermark image to the image to be processed based on the preset mapping numerical value to obtain a mapping area corresponding to the watermark image in the image to be processed.
The method comprises the steps of setting a preset mapping numerical value to be 1 under the condition that an image to be processed comprises 81 pixel points of nine rows and nine columns and a watermark image comprises 9 pixel points of three rows and three columns, wherein the pixel points of the image to be processed, which correspond to 1, 2 and 3 of a first row in the watermark image, are pixel points 1, 3 and 5 of the first row, and the pixel points of the image to be processed, which correspond to 1, 2 and 3 of the first column in the watermark image, are pixel points 1, 3 and 5 of the first column, so that each watermark pixel point in the watermark image corresponds to a pixel point in the image to be processed, and a mapping area is obtained, wherein the mapping area is an area to be subjected to watermarking calculation. It should be noted that before mapping, the position of watermark addition may be determined in the image to be processed according to the size of the watermark image.
Step S408: and determining the position information of the mapping area in the image to be processed, and generating encryption information based on the position information and the attribute information of the mapping area.
And (3) constructing a coordinate system by taking the pixel points in the fifth row and the first column in the image to be processed as the origin of the coordinate system, taking the position coordinates of the pixel points in the fifth row and the first column in the mapping area corresponding to the dotted line frame as position information, and taking the length information 5 and the width information 5 of the mapping area as attribute information, thereby forming the encrypted information (5.1,5,5).
Step S410: and taking all pixel points in the watermark image as watermark pixel points, selecting mapping pixel points in the mapping region according to a preset mapping numerical value, and determining the pixel point corresponding relation between the watermark pixel points and the mapping pixel points.
After 9 pixel points such as three rows and three columns in the watermark image are determined, 9 pixel points also exist in a mapping region represented by a dotted line frame in the image to be processed and correspond to 9 watermark pixel points in the watermark image respectively, and the mapping relationship between the mapping pixel points in the mapping region and the watermark pixel points in the watermark image is a pixel point corresponding relationship, so that the calculated pixel value corresponding to each mapping pixel point can be calculated respectively based on the pixel point corresponding relationship.
Step S412: and screening the mapping pixel points in the mapping region based on the pixel point corresponding relation, and calculating the target pixel value of the mapping pixel points.
When a target pixel value corresponding to a mapping pixel point in a mapping region is calculated, the mapping pixel point corresponding to a watermark pixel point in a watermark image is found in the mapping region according to the pixel point corresponding relationship among the pixel points, the mapping pixel point is a pixel point having a pixel point corresponding relationship between 9 pixel points 1, 3, 5 and the like in an image to be processed and 9 watermark pixel points in the watermark image, and the watermark pixel point and the mapping pixel point are summed and subjected to remainder calculation according to the pixel point corresponding relationship, so that the target pixel value corresponding to each mapping pixel point can be obtained. It should be noted that, during calculation, the pixel values may be converted into a binary form, and then the calculation is performed, that is, in the encryption process, the pixel values of all the pixel points of the image to be processed are stored in the two-dimensional array, and the watermark image is also subjected to the binary storage of the pixels in the same way.
Step S414: and generating a target image corresponding to the image to be processed based on the target pixel value and the pixel value of the original pixel point in the image to be processed.
And generating a watermarked target image based on the target pixel value corresponding to each mapping pixel point obtained after calculation and the original pixel point pixel value which is not calculated in the image to be processed.
Step S416: and determining a watermark area in the target image according to the encrypted information, and determining watermark pixel points in the watermark area according to the watermark image.
When the watermarking processing is performed, restoration processing can be performed based on the encrypted information (5.1,5,5). 5.1 represents the coordinate value of the pixel point at the lower left corner in the mapping region, and 5 represent the length and width of the mapping region, respectively, so that the watermarking region subjected to watermarking processing is determined in the target image according to the coordinate value and the length 5 and width 5.
Step S418: and calculating the watermark pixel points based on a preset calculation rule to obtain restoration pixel points, and generating the image to be processed based on the restoration pixel points and target pixel points in the target image.
And determining pixel points corresponding to the watermark image in the watermark region according to the watermark pixel points contained in the watermark image, and further performing reduction processing on the pixel points, namely processing by adopting the inverse operation of encryption calculation, so as to obtain the original image to be processed.
In summary, the image processing method provided by the application obtains the image to be processed, and determines the watermark image associated with the image to be processed; mapping the watermark image to an image to be processed to obtain a mapping area corresponding to the watermark image in the image to be processed; determining a pixel point corresponding relation between a watermark pixel point in the watermark image and a mapping pixel point in the mapping area, and calculating a target pixel value of the mapping pixel point based on the pixel point corresponding relation; and generating a target image corresponding to the image to be processed based on the target pixel value and the pixel value of the original pixel point in the image to be processed. The method and the device have the advantages that the watermark is added in the appointed area of the image to be processed in a mode of calculating partial pixel points, so that copyright protection is realized, and the visual influence of the watermark image on the image to be processed is reduced after the watermark image is added into the image to be processed by only changing the pixel values of the pixel points in the mapping area. The visual influence of the watermark on the picture is reduced on the basis of protecting the copyright of the picture.
Corresponding to the above method embodiment, the present application further provides an image processing apparatus embodiment, and fig. 5 shows a schematic structural diagram of an image processing apparatus provided in an embodiment of the present application. As shown in fig. 5, the apparatus includes:
an obtaining module 502 configured to obtain an image to be processed and determine a watermark image associated with the image to be processed;
a mapping module 504, configured to map the watermark image to the image to be processed, to obtain a mapping region corresponding to the watermark image in the image to be processed;
a calculating module 506 configured to determine a pixel point correspondence between a watermark pixel point in the watermark image and a mapping pixel point in the mapping region, and calculate a target pixel value of the mapping pixel point based on the pixel point correspondence;
a generating module 508 configured to generate a target image corresponding to the image to be processed based on the target pixel value and the pixel values of the original pixel points in the image to be processed.
In an optional embodiment, the mapping module 504 is further configured to:
determining a preset mapping numerical value; and mapping the watermark image to the image to be processed based on the preset mapping numerical value to obtain a mapping area corresponding to the watermark image in the image to be processed.
In an optional embodiment, the calculation module 506 is further configured to:
all pixel points in the watermark image are used as watermark pixel points; selecting a mapping pixel point in the mapping region according to the preset mapping numerical value; and determining the pixel point corresponding relation between the watermark pixel point and the mapping pixel point.
In an optional embodiment, the calculation module 506 is further configured to:
screening mapping pixel points in the mapping region based on the pixel point corresponding relation, and calculating target pixel values of the mapping pixel points; or calculating a mapping pixel value of the mapping pixel point based on the pixel point corresponding relation, calculating a non-mapping pixel value of a non-mapping pixel point without the pixel point corresponding relation in the mapping region, and taking the mapping pixel value and the non-mapping pixel value as the target pixel value.
In an optional embodiment, the obtaining module 502 is further configured to:
receiving a data query instruction aiming at query service, and reading data to be processed based on the data query instruction; and generating an image to be processed based on the data to be processed, and determining a watermark image associated with the image to be processed.
In an optional embodiment, the mapping module 504 is further configured to:
determining the position information of the mapping region in the image to be processed; generating encryption information based on the location information and the attribute information of the mapping area.
In an optional embodiment, the mapping module 504 is further configured to:
and determining an adding position in the image to be processed, and mapping the watermark image to the image to be processed according to the adding position to obtain a mapping area corresponding to the watermark image in the image to be processed.
In an optional embodiment, the calculation module 506 is further configured to:
determining a watermark area in the target image according to the encryption information; determining watermark pixel points in the watermark region according to the watermark image; and calculating the watermark pixel points based on a preset calculation rule to obtain reduction pixel points, and generating the image to be processed based on the reduction pixel points and target pixel points in the target image.
In summary, the image processing apparatus provided by the present application obtains an image to be processed, and determines a watermark image associated with the image to be processed; mapping the watermark image to an image to be processed to obtain a mapping area corresponding to the watermark image in the image to be processed; determining a pixel point corresponding relation between a watermark pixel point in the watermark image and a mapping pixel point in the mapping area, and calculating a target pixel value of the mapping pixel point based on the pixel point corresponding relation; and generating a target image corresponding to the image to be processed based on the target pixel value and the pixel value of the original pixel point in the image to be processed. The method and the device have the advantages that the watermark is added in the appointed area of the image to be processed in a mode of calculating partial pixel points, so that copyright protection is realized, and the visual influence of the watermark image on the image to be processed is reduced after the watermark image is added into the image to be processed by only changing the pixel values of the pixel points in the mapping area. The visual influence of the watermark on the picture is reduced on the basis of protecting the copyright of the picture.
The above is a schematic configuration of an image processing apparatus of the present embodiment. It should be noted that the technical solution of the image processing apparatus belongs to the same concept as the technical solution of the image processing method, and details that are not described in detail in the technical solution of the image processing apparatus can be referred to the description of the technical solution of the image processing method.
Fig. 6 illustrates a block diagram of a computing device 600 provided according to an embodiment of the present application. The components of the computing device 600 include, but are not limited to, a memory 610 and a processor 620. The processor 620 is coupled to the memory 610 via a bus 630 and a database 650 is used to store data.
Computing device 600 also includes access device 640, access device 640 enabling computing device 600 to communicate via one or more networks 660. Examples of such networks include a Public Switched Telephone Network (PSTN), a Local Area Network (LAN), a Wide Area Network (WAN), a Personal Area Network (PAN), or a combination of communication networks such as the internet. The Access device 640 may include one or more of any type of Network interface (e.g., a Network interface controller) that may be wired or Wireless, such as an IEEE802.11 Wireless Local Area Network (WLAN) Wireless interface, a Worldwide Interoperability for Microwave Access (Wi-MAX) interface, an ethernet interface, a Universal Serial Bus (USB) interface, a cellular Network interface, a bluetooth interface, a Near Field Communication (NFC) interface, and so forth.
In one embodiment of the present application, the above-described components of computing device 600, as well as other components not shown in FIG. 6, may also be connected to each other, such as by a bus. It should be understood that the block diagram of the computing device architecture shown in FIG. 6 is for purposes of example only and is not limiting as to the scope of the present application. Those skilled in the art may add or replace other components as desired.
Computing device 600 may be any type of stationary or mobile computing device, including a mobile Computer or mobile computing device (e.g., tablet, personal digital assistant, laptop, notebook, netbook, etc.), a mobile phone (e.g., smartphone), a wearable computing device (e.g., smartwatch, smartglasses, etc.), or other type of mobile device, or a stationary computing device such as a desktop Computer or Personal Computer (PC). Computing device 600 may also be a mobile or stationary server.
Wherein the processor 620, when executing the computer instructions, performs the steps of the image processing method.
The above is an illustrative scheme of a computing device of the present embodiment. It should be noted that the technical solution of the computing device and the technical solution of the image processing method belong to the same concept, and details that are not described in detail in the technical solution of the computing device can be referred to the description of the technical solution of the image processing method.
An embodiment of the present application further provides a computer readable storage medium, which stores computer instructions, and the computer instructions, when executed by a processor, implement the steps of the image processing method as described above.
The above is an illustrative scheme of a computer-readable storage medium of the present embodiment. It should be noted that the technical solution of the storage medium belongs to the same concept as the technical solution of the image processing method, and details that are not described in detail in the technical solution of the storage medium can be referred to the description of the technical solution of the image processing method.
The foregoing description of specific embodiments of the present application has been presented. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims may be performed in a different order than in the embodiments and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing may also be possible or may be advantageous.
The computer instructions comprise computer program code which may be in the form of source code, object code, an executable file or some intermediate form, or the like. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, usb disk, removable hard disk, magnetic disk, optical disk, computer Memory, read-Only Memory (ROM), random Access Memory (RAM), electrical carrier wave signals, telecommunications signals, software distribution medium, and the like. It should be noted that the computer readable medium may contain content that is subject to appropriate increase or decrease as required by legislation and patent practice in jurisdictions, for example, in some jurisdictions, computer readable media does not include electrical carrier signals and telecommunications signals as is required by legislation and patent practice.
It should be noted that for simplicity and convenience of description, the above-described method embodiments are described as a series of combinations of acts, but those skilled in the art will appreciate that the present application is not limited by the order of acts, as some steps may, in accordance with the present application, occur in other orders and/or concurrently. Further, those skilled in the art should also appreciate that the embodiments described in the specification are preferred embodiments and that the acts and modules referred to are not necessarily required in this application.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
The preferred embodiments of the present application disclosed above are intended only to aid in the explanation of the application. Alternative embodiments are not exhaustive and do not limit the invention to the precise embodiments described. Obviously, many modifications and variations are possible in light of the above teaching. The embodiments were chosen and described in order to best explain the principles of the application and its practical applications, to thereby enable others skilled in the art to best understand and utilize the application. The application is limited only by the claims and their full scope and equivalents.

Claims (11)

1. An image processing method, comprising:
acquiring an image to be processed, and determining a watermark image associated with the image to be processed;
mapping the watermark image to the image to be processed to obtain a mapping area corresponding to the watermark image in the image to be processed;
determining a pixel point corresponding relation between a watermark pixel point in the watermark image and a mapping pixel point in the mapping region, and calculating a target pixel value of the mapping pixel point based on the pixel point corresponding relation;
and generating a target image corresponding to the image to be processed based on the target pixel value and the pixel value of the original pixel point in the image to be processed.
2. The method according to claim 1, wherein the mapping the watermark image to the image to be processed to obtain a mapping region corresponding to the watermark image in the image to be processed comprises:
determining a preset mapping numerical value;
and mapping the watermark image to the image to be processed based on the preset mapping numerical value to obtain a mapping area corresponding to the watermark image in the image to be processed.
3. The method of claim 2, wherein the determining a pixel correspondence between a watermark pixel in the watermark image and a mapping pixel in the mapping region comprises:
all pixel points in the watermark image are used as watermark pixel points;
selecting a mapping pixel point in the mapping region according to the preset mapping numerical value;
and determining the pixel point corresponding relation between the watermark pixel point and the mapping pixel point.
4. The method of claim 1, wherein said calculating a target pixel value for said mapped pixel based on said pixel correspondence comprises:
screening mapping pixel points in the mapping region based on the pixel point corresponding relation, and calculating target pixel values of the mapping pixel points;
or,
and calculating a mapping pixel value of the mapping pixel point based on the pixel point corresponding relation, calculating a non-mapping pixel value of a non-mapping pixel point without the pixel point corresponding relation in the mapping region, and taking the mapping pixel value and the non-mapping pixel value as the target pixel value.
5. The method of claim 1, wherein the obtaining of the to-be-processed image and the determining of the watermark image associated with the to-be-processed image comprises:
receiving a data query instruction aiming at query service, and reading data to be processed based on the data query instruction;
and generating a to-be-processed image based on the to-be-processed data, and determining a watermark image associated with the to-be-processed image.
6. The method according to claim 1, wherein after the step of mapping the watermark image to the image to be processed and obtaining the mapping region corresponding to the watermark image in the image to be processed is performed, the method further comprises:
determining the position information of the mapping area in the image to be processed;
generating encryption information based on the location information and the attribute information of the mapping area.
7. The method according to claim 1, wherein the mapping the watermark image to the image to be processed to obtain a mapping region corresponding to the watermark image in the image to be processed comprises:
and determining an adding position in the image to be processed, and mapping the watermark image to the image to be processed according to the adding position to obtain a mapping area corresponding to the watermark image in the image to be processed.
8. The method according to claim 6, wherein after the step of generating the target image corresponding to the image to be processed is performed, the method further comprises:
determining a watermark area in the target image according to the encryption information;
determining watermark pixel points in the watermark region according to the watermark image;
and calculating the watermark pixel points based on a preset calculation rule to obtain reduction pixel points, and generating the image to be processed based on the reduction pixel points and target pixel points in the target image.
9. An image processing apparatus characterized by comprising:
the acquisition module is configured to acquire an image to be processed and determine a watermark image associated with the image to be processed;
the mapping module is configured to map the watermark image to the image to be processed to obtain a mapping area corresponding to the watermark image in the image to be processed;
a calculation module configured to determine a pixel point correspondence between a watermark pixel point in the watermark image and a mapping pixel point in the mapping region, and calculate a target pixel value of the mapping pixel point based on the pixel point correspondence;
the generating module is configured to generate a target image corresponding to the image to be processed based on the target pixel value and the pixel value of the original pixel point in the image to be processed.
10. A computing device comprising a memory, a processor, and computer instructions stored on the memory and executable on the processor, wherein the processor implements the steps of the method of any one of claims 1-8 when executing the computer instructions.
11. A computer-readable storage medium storing computer instructions, which when executed by a processor, perform the steps of the method of any one of claims 1 to 8.
CN202211608535.8A 2022-12-14 2022-12-14 Image processing method and device Pending CN115841413A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211608535.8A CN115841413A (en) 2022-12-14 2022-12-14 Image processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211608535.8A CN115841413A (en) 2022-12-14 2022-12-14 Image processing method and device

Publications (1)

Publication Number Publication Date
CN115841413A true CN115841413A (en) 2023-03-24

Family

ID=85578627

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211608535.8A Pending CN115841413A (en) 2022-12-14 2022-12-14 Image processing method and device

Country Status (1)

Country Link
CN (1) CN115841413A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116109469A (en) * 2023-04-12 2023-05-12 山东云海国创云计算装备产业创新中心有限公司 Baseboard management controller, image display method, device and computer medium
CN117793267A (en) * 2024-02-23 2024-03-29 山东交通学院 Privacy protection method and system for passenger data

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116109469A (en) * 2023-04-12 2023-05-12 山东云海国创云计算装备产业创新中心有限公司 Baseboard management controller, image display method, device and computer medium
WO2024213006A1 (en) * 2023-04-12 2024-10-17 山东云海国创云计算装备产业创新中心有限公司 Baseboard management controller, image display method, and device and computer medium
CN117793267A (en) * 2024-02-23 2024-03-29 山东交通学院 Privacy protection method and system for passenger data

Similar Documents

Publication Publication Date Title
Wan et al. A comprehensive survey on robust image watermarking
Chan et al. Hiding data in images by simple LSB substitution
EP3410685B1 (en) Image processing device, image processing method, and program
JP4296126B2 (en) Screen creation device
JP2005328528A (en) Processing method and system for secret mark of digital image
Pal et al. Weighted matrix based reversible watermarking scheme using color image
CN115841413A (en) Image processing method and device
Ni et al. Secure semi-blind watermarking based on iteration mapping and image features
TWI692743B (en) A color image authentication method and computer program product based on palette compression technique
WO2018155331A1 (en) Digital watermark padding device, digital watermark detecting device, digital watermark padding method, digital watermark detecting method, and program
JPWO2008035401A1 (en) Digital watermark embedding device and detection device
Ni et al. Pinpoint authentication watermarking based on a chaotic system
CN106228503B (en) The digital watermark embedding and extracting method of satellite remote-sensing image SHP dot files
CN118570040A (en) A digital image watermark embedding method and device based on quantum encryption
Qian et al. Constructive steganography using texture synthesis
CN118229499A (en) A multi-mode quantum watermarking method, device, equipment and storage medium
Kurniawan et al. Hiding secret data by using modulo function in quad difference expansion
CN113160028B (en) Information hiding and recovering method and equipment based on colorful character picture and storage medium
WO2022098255A1 (en) Method for steganographically encoding and decoding a digital image
Kumar et al. A reversible high embedding capacity data hiding technique for hiding secret data in images
JP2020184663A (en) High resistance digital watermarking method
Lee A distortion-free authentication method for color images with tampering localization and self-recovery
Yang et al. A Data Hiding Method Based on Partition Variable Block Size with Exclusive-or Operation on Binary Image
CN117494083A (en) Blockchain-based watermark processing methods, devices, equipment and storage media
Nadim Protection of Creative Rights Through Digital Image Watermarking

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