CN109685708B - Image processing method and device, electronic equipment and computer readable storage medium - Google Patents

Image processing method and device, electronic equipment and computer readable storage medium Download PDF

Info

Publication number
CN109685708B
CN109685708B CN201811603656.7A CN201811603656A CN109685708B CN 109685708 B CN109685708 B CN 109685708B CN 201811603656 A CN201811603656 A CN 201811603656A CN 109685708 B CN109685708 B CN 109685708B
Authority
CN
China
Prior art keywords
watermark
region
halftone
image
attribute
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.)
Active
Application number
CN201811603656.7A
Other languages
Chinese (zh)
Other versions
CN109685708A (en
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.)
Zhuhai Pantum Electronics Co Ltd
Original Assignee
Zhuhai Pantum Electronics 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 Zhuhai Pantum Electronics Co Ltd filed Critical Zhuhai Pantum Electronics Co Ltd
Priority to CN201811603656.7A priority Critical patent/CN109685708B/en
Publication of CN109685708A publication Critical patent/CN109685708A/en
Application granted granted Critical
Publication of CN109685708B publication Critical patent/CN109685708B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T1/00General purpose image data processing
    • G06T1/0021Image watermarking

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Editing Of Facsimile Originals (AREA)
  • Image Processing (AREA)

Abstract

The application provides an image processing method and device, electronic equipment and a computer readable storage medium, and relates to the technical field of image processing. The image processing method comprises the following steps: determining a watermark region in an image to be processed according to watermark data to be embedded; the halftone properties of at least a portion of the region of the image to be processed are adjusted such that the watermark region and the non-watermark region have different halftone properties. By the method, the problem that watermark data embedded in the prior art is easy to lose can be solved.

Description

Image processing method and device, electronic equipment and computer readable storage medium
Technical Field
The present invention relates to the field of image processing technologies, and in particular, to an image processing method and apparatus, an electronic device, and a computer readable storage medium.
Background
With the continuous development of image processing technology, the demand for images is also increasing. For example, watermarks are typically embedded in digital images to avoid tampering or counterfeiting, etc., based on security considerations. The conventional watermark embedding technology generally comprises two modes of LSB and frequency domain transformation.
The LSB mode is mainly that watermark embedding is completed by changing low-order information of image data; the frequency domain transformation is mainly performed by performing complex fourier transformation or wavelet transformation on the digital image, and then embedding information in the frequency domain to complete watermark embedding. The watermark image obtained by the LSB mode is easy to be influenced by the deformation of the printer to lose information when being printed, scanned or copied; the watermark image obtained by frequency domain transformation is easy to lose because the whole image is processed, and the printer can only output HalfTone binarized image.
Therefore, providing a technical scheme capable of avoiding easy loss of watermark data embedded in a digital image is a technical problem to be solved.
Disclosure of Invention
In view of the foregoing, it is an object of the present application to provide an image processing method and apparatus, an electronic device, and a computer readable storage medium, so as to improve the problem that watermark data embedded in the prior art is easy to be lost.
In order to achieve the above purpose, the embodiment of the present application adopts the following technical scheme:
an image processing method, comprising:
determining a watermark region in an image to be processed according to watermark data to be embedded;
and adjusting the halftone attribute of at least part of the area of the image to be processed so that the watermark area and the non-watermark area have different halftone attributes.
In a preferred option of the embodiment of the present application, in the above image processing method, the step of adjusting a halftone attribute of at least a partial region in the image to be processed includes:
acquiring a predetermined target halftone attribute;
and adjusting the halftone attribute of the watermark region according to the target halftone attribute.
In a preferred option of the embodiment of the present application, in the above image processing method, the step of adjusting the halftone attribute of the watermark region according to the target halftone attribute specifically includes:
and adjusting at least one halftone attribute of the watermark region according to the target halftone attribute, wherein the halftone attribute comprises an angle, a frequency and a shape.
In a preferred option of the embodiment of the present application, in the above image processing method, the method further includes a step of determining the target halftone attribute in advance, specifically:
target halftone attribute information different from the halftone attribute is determined according to the halftone attribute of the non-watermark region.
In a preferred option of the embodiments of the present application, in the above image processing method, after adjusting the halftone attribute of at least a part of the area of the image to be processed to obtain the watermark image, the method further includes:
generating a template image according to the watermark region in the watermark image;
and extracting watermark data corresponding to the watermark region according to the template image.
The embodiment of the application also provides an image processing device, which comprises:
the watermark region determining module is used for determining a watermark region in the image to be processed according to watermark data to be embedded;
and the halftone attribute adjustment module is used for adjusting the halftone attribute of at least part of the area of the image to be processed so that the watermark area and the non-watermark area have different halftone attributes.
In a preferred option of the embodiment of the present application, in the image processing apparatus, the halftone attribute adjustment module includes:
a halftone attribute acquisition sub-module for acquiring a predetermined target halftone attribute;
and the halftone attribute adjustment sub-module is used for adjusting the halftone attribute of the watermark region according to the target halftone attribute.
In a preferred option of the embodiment of the present application, in the image processing apparatus, the halftone attribute adjustment submodule is specifically configured to:
and adjusting at least one halftone attribute of the watermark region according to the target halftone attribute, wherein the halftone attribute comprises an angle, a frequency and a shape.
In a preferred option of the embodiment of the present application, the image processing apparatus further includes:
and the halftone attribute determination module is used for determining target halftone attribute information different from the halftone attribute according to the halftone attribute of the non-watermark region.
In a preferred option of the embodiment of the present application, the image processing apparatus further includes:
the template image generation module is used for generating a template image according to a watermark region in the watermark image after the halftone attribute adjustment module adjusts the halftone attribute of at least part of the region of the image to be processed to obtain the watermark image;
and the watermark data extraction module is used for extracting watermark data corresponding to the watermark region according to the template image.
On the basis of the above, the embodiment of the application also provides an electronic device, which comprises a memory, a processor and the image processing device, wherein the image processing device comprises one or more software functional modules stored in the memory and executed by the processor.
On the basis of the above, the embodiments of the present application also provide a computer-readable storage medium having stored thereon a computer program which, when executed, implements the steps of the above-described image processing method.
According to the image processing method and device, the electronic equipment and the computer readable storage medium, the watermark region and the non-watermark region have different halftone properties by adjusting the halftone properties of the image to be processed, so that watermark data is embedded, the problem that watermark data embedded in the prior art is easy to lose is solved, the problem that the image is easy to tamper or forge due to the loss of the watermark data can be effectively avoided, and the use safety of the image is greatly improved. In addition, watermark embedding processing is performed by modifying the halftone attribute, so that the problem of deformation of a printing piece which is easy to occur when an image to be processed is printed can be effectively resisted. In addition, the scheme of the method allows the Xu Qianru watermark data to have more characters, is more convenient for users and has wider application range, and the problem that the user is inconvenient due to the fact that the number of watermark embedded characters is limited in some watermark embedding methods in the prior art is effectively avoided.
In order to make the above objects, features and advantages of the present application more comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
Fig. 1 is a block schematic diagram of an electronic device 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 view of the effect of the target area according to the embodiment of the present application.
Fig. 4 is a schematic diagram of the effect of the watermark area according to the embodiment of the present application.
Fig. 5 is a flow chart of step S130 in fig. 2.
Fig. 6 is a schematic diagram of the effect of watermark regions and non-watermark regions with different halftone properties according to an embodiment of the present application.
Fig. 7 is a schematic diagram of a first preset matrix according to an embodiment of the present application.
Fig. 8 is a schematic diagram of a second preset matrix according to an embodiment of the present application.
Fig. 9 is a flowchart illustrating other steps included in the image processing method according to the embodiment of the present application.
Fig. 10 is a block diagram of functional modules of an image processing apparatus according to an embodiment of the present application.
Fig. 11 is a block diagram of a sub-functional module included in the halftone attribute adjustment module according to an embodiment of the present application.
Fig. 12 is a block diagram of other functional modules included in the image processing apparatus according to the embodiment of the present application.
Icon: 10-an electronic device; 12-memory; 14-a processor; 100-an image processing device; 110-a watermark region determination module; 130-a halftone attribute adjustment module; 131-a halftone attribute acquisition sub-module; 133-a halftone attribute adjustment sub-module; 150-a template image generation module; 170-watermark data extraction module.
Detailed Description
For the purposes of making the objects, technical solutions and advantages of the embodiments of the present application more clear, the technical solutions of the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is apparent that the described embodiments are only some embodiments of the present application, but not all embodiments. The components of the embodiments of the present application, which are generally described and illustrated in the figures herein, may be arranged and designed in a wide variety of different configurations.
Thus, the following detailed description of the embodiments of the present application, as provided in the accompanying drawings, is not intended to limit the scope of the application, as claimed, but is merely representative of selected embodiments of the application. All other embodiments, which can be made by one of ordinary skill in the art based on the embodiments herein without making any inventive effort, are intended to be within the scope of the present application.
It should be noted that: like reference numerals and letters denote like items in the following figures, and thus once an item is defined in one figure, no further definition or explanation thereof is necessary in the following figures. In the description of the present application, the terms "first," "second," "third," "fourth," and the like are used merely to distinguish between descriptions and are not to be construed as merely or implying relative importance.
As shown in fig. 1, an embodiment of the present application provides an electronic device 10 that may include a memory 12 and a processor 14 and an image processing apparatus 100.
The memory 12 and the processor 14 are directly or indirectly electrically connected to each other to realize data transmission or interaction. For example, electrical connection may be made to each other via one or more communication buses or signal lines. The image processing device 100 comprises at least one software functional module which may be stored in the memory 12 in the form of software or firmware (firmware). The processor 14 is configured to execute executable computer programs stored in the memory 12, for example, software functional modules and computer programs included in the image processing apparatus 100, so as to implement an image processing method.
The Memory 12 may be, but is not limited to, a random access Memory (Random Access Memory, RAM), a Read Only Memory (ROM), a programmable Read Only Memory (Programmable Read-Only Memory, PROM), an erasable Read Only Memory (Erasable Programmable Read-Only Memory, EPROM), an electrically erasable Read Only Memory (Electric Erasable Programmable Read-Only Memory, EEPROM), etc. The memory 12 is used for storing a program, and the processor 14 executes the program after receiving an execution instruction.
The processor 14 may be an integrated circuit chip having signal processing capabilities. The processor 14 may be a general-purpose processor, including a central processing unit (Central Processing Unit, CPU), a network processor (Network Processor, NP), a System on Chip (SoC), etc.; but also Digital Signal Processors (DSPs), application Specific Integrated Circuits (ASICs), field Programmable Gate Arrays (FPGAs) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. The disclosed methods, steps, and logic blocks in the embodiments of the present application may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
It is to be understood that the configuration shown in fig. 1 is illustrative only, and that the electronic device 10 may also include more or fewer components than shown in fig. 1, or have a different configuration than shown in fig. 1. The components shown in fig. 1 may be implemented in hardware, software, or a combination thereof.
Alternatively, the type of the electronic device 10 is not limited, and may include, for example, but not limited to, a terminal device such as a computer, a tablet computer, a mobile phone, a server such as a web server, a data server, and an image forming device such as a printer, a copier, a facsimile machine, a scanner, and the like.
With reference to fig. 2, an embodiment of the present application further provides an image processing method applicable to the electronic device 10. Wherein the method steps defined by the flow related to the image processing method may be implemented by the electronic device 10. The specific flow shown in fig. 2 will be described in detail.
Step S110, determining a watermark area in the image to be processed according to watermark data to be embedded.
Step S130, adjusting the halftone attribute of at least a part of the area of the image to be processed, so that the watermark area and the non-watermark area have different halftone attributes.
In the present embodiment, it is considered that watermark data is embedded by adjusting halftone properties, and therefore, it is necessary to determine a watermark region first. Then, the watermark data is embedded by performing halftone attribute adjustment on at least a part of the region of the image to be processed so that the watermark region and the non-watermark region have different halftone attributes.
The source of the watermark data is not limited, and the watermark data can be selected according to the actual application requirements. For example, in an alternative example, it may be generated in response to a user's operation. Specifically, it may be generated in response to a user manually inputting an operation or selecting an operation at a user interface of the electronic device 10. As another alternative example, the operation information may be generated according to some specific operation information of the image to be processed currently, and the operation information may be a copy time, an operator, the number of operations, an operation place, or the like. For example, if the image to be processed is currently being subjected to the copying process, the copying time may be used as watermark data. For another example, in another alternative example, one of the data defaults to the electronic device 10 may be taken as watermark data, such as the electronic device 10 defaulting to the string "watermark" as watermark data.
Wherein the watermark data may be directly binary data, i.e. the watermark data consists of binary data 1 and/or binary data 0. The watermark data may also be a string of one or more characters corresponding to standard ASCII codes.
When the watermark data is a character string formed by one or more characters corresponding to the standard ASCII code, after the watermark data is acquired, the watermark data may be further converted into corresponding binary data for facilitating processing of the watermark data. In detail, in one possible example, each character in the watermark data may be converted into a corresponding standard ASCII code, which is then converted into corresponding binary data. The present embodiment provides a specific application example, as shown in the following table:
wherein, the correspondence between each character and binary data in the watermark data (20180910 zhangsancopyoneteimab) is as follows:
after converting the watermark data into corresponding binary data, it is also necessary to determine the specific location (watermark area) that needs to be embedded. In this embodiment of the present application, the watermark region may be an embedded region with binary data corresponding to watermark data being 1, and the non-watermark region includes an embedded region with binary data corresponding to watermark data being 0, and other regions in the image to be processed where watermark data is not needed to be embedded. It will be understood by those skilled in the art that, in the embodiment of the present application, the watermark region may also be an embedded region with binary bits of 0 in binary data corresponding to watermark data, and the non-watermark region includes an embedded region with binary bits of 1 in binary data corresponding to watermark data, and other regions in the image to be processed where watermark data is not needed to be embedded, which is not limited herein. For convenience of description, the watermark region is regarded as an embedded region with binary bit 1 in binary data corresponding to watermark data in the following unification.
The method for determining the watermark area is not limited, and can be selected according to actual application requirements. For example, in an alternative example, an area of an arbitrary shape corresponding to the number of binary characters in watermark data may be selected randomly from an image to be processed as a candidate watermark area, and then, the watermark area in which binary data 1 is required to be performed may be selected randomly according to the arrangement order of binary data 1 and 0 corresponding to the watermark data. Further, the shape of the watermark region may be rectangular, circular, elliptical, etc., which is not limited herein. The shape of the watermark region refers to the shape of a connected region formed by pixel points of which the watermark region is at a boundary.
For example, when the number of characters in binary data corresponding to watermark data is N and the number of binary data 1 is M, when determining watermark regions, an image to be processed may be divided into watermark regions with a number greater than or equal to N according to the number N of characters of the watermark data, each region is numbered separately, and then M watermark regions are selected from these regions according to any rule, so as to determine the watermark regions.
For example, in an alternative example, gray scale recognition may be performed on the image to be processed to determine a patch region having a particular gray scale (e.g., a gray scale value ranging from 80 to 220), and determine the region as a candidate watermark region (e.g., a black region as shown in fig. 3). The specific gray scale means that the pixel value of the pixel point satisfies a certain magnitude relation, for example, the pixel value may be greater than or less than a preset threshold value, or may be greater than a first preset threshold value and less than a second preset threshold value, and the like, which is not limited herein.
After determining the candidate watermark region, the corresponding watermark region is also determined according to the watermark data to be embedded. For example, if the watermark data includes 32 characters, each character is represented by 8-bit binary data, and if the number of binary data 1 corresponding to the watermark data is 50, then correspondingly, 32×8=256 candidate watermark regions need to be determined first, and then 50 watermark regions need to be selected from the determined 256 candidate watermark regions, so as to implement embedding of the 32 characters. The method for determining each watermark region in the candidate watermark regions is not limited, and may be selected according to practical application requirements, so long as each bit of binary data 1 of each character corresponds to one watermark region. For example, the image areas to be processed may be equally divided according to the number of binary data corresponding to the determined watermark data, so as to obtain candidate watermark areas (as shown in fig. 4, each black square represents a candidate watermark area).
It should be noted that, the correspondence between each binary data and each watermark area is not limited, and may be selected according to the actual application requirement. Specifically, the individual watermark regions may be ordered based on a certain direction (e.g., from top left to bottom right or top right to bottom left in fig. 4, etc.). After sorting, in an alternative example, the correspondence may be established sequentially according to the order of the binary data of each bit of each character. In another alternative example, to improve the security of the embedded watermark data, other order correspondence may be established, for example, in a specific application example, correspondence shown in the following table may be established:
binary data bits Watermark region sequence number
1 1
2 3
3 4
4 7
5 8
6 10
7 2
After the watermark region is determined, step S130 may be performed to perform halftone attribute adjustment. The method for adjusting the attribute is not limited, and the method can be selected according to the actual application requirement, so long as the halftone attribute of the watermark region and the halftone attribute of the non-watermark region are different, thereby realizing the purpose of embedding watermark data.
At least a part of the area of the image to be processed may be a watermark area, a non-watermark area, or a watermark area and a non-watermark area, which are not limited herein. For example, in an alternative example, halftone attribute adjustments may be made to both watermark regions and non-watermark regions, but in a different manner. For another example, in another alternative example, only the halftone properties of the non-watermark regions may be adjusted. For another example, in another alternative example, in conjunction with fig. 5, step S130 may include step S131 and step S133, as described in detail below.
Step S131, a predetermined target halftone attribute is acquired.
And step S133, adjusting the halftone attribute of the watermark region according to the target halftone attribute.
In this embodiment, a predetermined target halftone attribute may be acquired first, and then, the halftone attribute of each watermark region may be adjusted based on the target halftone attribute, so as to implement embedding of watermark data, thereby avoiding the problem that the efficiency of data processing is reduced due to adjustment of the halftone attribute only for a non-watermark region or for both the watermark region and the non-watermark region.
The watermark region and the non-watermark region may be selected differently according to the specific content of the target halftone attribute. For example, if the target halftone attribute is the same as the halftone attribute of the non-watermark region, then the halftone attribute of the watermark region may be adjusted to be different from the target halftone attribute; if the target halftone attribute is different from the halftone attribute of the non-watermark region, then the halftone attribute of the watermark region may be adjusted to the target halftone attribute.
That is, the manner of predetermining the target halftone attribute is not limited, and may be selected according to the actual application requirements, for example, in an alternative example, the step of predetermining the target halftone attribute may be: acquiring a halftone attribute of a non-watermark region; target halftone attribute information different from the halftone attribute is determined based on the halftone attribute of the non-watermark region.
Also, the particular implementation is not limited in the adjustment process, e.g., in an alternative example, the halftone properties of the watermark region may be adjusted and then the halftone properties of the non-watermark region may not be adjusted. For another example, in another alternative example, the halftone properties of the non-watermark region may be adjusted and then the halftone properties of the watermark region may not be adjusted.
Further, it is contemplated that halftone properties are generally numerous and may include, for example, but not limited to, angle, frequency, and shape. Correspondingly, when halftone adjustment is performed, one or two halftone attributes may be selected for adjustment, or each halftone attribute may be adjusted.
In this embodiment, to improve the reliability of the embedded watermark data, to further avoid the problem of easy loss, the angle, frequency and shape may be adjusted. The angle in the halftone attribute refers to the included angle between the horizontal direction and the line formed by two adjacent black dot regions (binary data is 0) or two adjacent white dot regions (binary data is 1) in one binarized image region. The frequency in the halftone attribute means the distance in the horizontal direction or the vertical direction between two adjacent black dot regions (binary data of 0) or two adjacent white dot regions (binary data of 1) in one binarized image region. The shape in the halftone attribute refers to the shape of a connected region constituted by boundary pixels of a black dot region (binary data of 0) or a white dot region (binary data of 1) in one binary image region. In particular, reference may be made to fig. 6, wherein the angle of the non-watermark region is 45 ° and the angle of the watermark region is 0 °.
Also, it should be noted that, in fig. 6, the arrangement direction of the black region and the white region may represent an "angle" halftone attribute, the interval between the two white regions may represent a "frequency" halftone attribute, and the shapes of the black region and the white region themselves may represent a "shape" halftone attribute.
The specific manner of adjusting the halftone properties such as angle, frequency, shape, etc. is not limited, and may be selected according to practical application requirements. For example, when the binarization process is performed, regions having different attributes may be automatically generated by setting different binary processing parameters. For example, when binarization processing is performed, different preset matrices (also called threshold matrices) may be used for the watermark region and the non-watermark region to perform conversion. In this embodiment, in a specific application example, the following two preset matrices are provided to process the watermark area and the non-watermark area, respectively.
Wherein, a first preset matrix for performing conversion processing on the watermark region may be shown with reference to fig. 7, and a second preset matrix for performing conversion processing on the non-watermark region may be shown with reference to fig. 8. That is, after the second preset matrix is determined, a different preset matrix from the second preset matrix may be set as the first preset matrix, so that different binarization conversion processes are performed for the watermark region and the non-watermark region, so that the watermark region and the non-watermark region have different halftone properties, thereby completing embedding of watermark data.
By the method, watermark data can be embedded into the image to be processed, so that a watermark image is obtained. The watermark region and the non-watermark region are converted by adopting different preset matrixes when binarization processing is carried out, so that the problem that watermark data are not easy to lose when the watermark image is printed can be realized. In addition, watermark embedding processing is performed by modifying the halftone attribute, so that the problem of deformation of a printing piece which is easy to occur when an image to be processed is printed can be effectively resisted. In addition, the scheme of the method allows the Xu Qianru watermark data to have more characters, is more convenient for users and has wider application range, and the problem that the user is inconvenient due to the fact that the number of watermark embedded characters is limited in some watermark embedding methods in the prior art is effectively avoided.
Further, after the print file is obtained through the print processing, watermark data embedded in the print file may also be extracted to obtain the watermark data. Therefore, in the present embodiment, in conjunction with fig. 9, the image processing method may further include step S150 and step S170, which are described in detail below.
Step S150, a template image is generated according to the watermark area in the watermark image.
In this embodiment, when performing the binarization processing in step S130, a matrix obtained by binarizing the watermark region may be obtained, and then a corresponding template image may be generated based on the matrix.
The halftone attribute in the template image is consistent with the halftone attribute of the watermark region or the halftone attribute of the non-watermark region, and the selection is performed according to the specific embedding mode of watermark data.
Step S170, extracting watermark data corresponding to the watermark region according to the template image.
In this embodiment, after the template image is generated in step S150, an image area including the current pixel point in the print file may be detected according to the template image, and whether the image area has watermark data embedded therein or not is determined by comparing the halftone attribute in the detection template with the halftone attribute in the image area, if so, it is determined that the image area has watermark embedded therein, or else the image area does not have watermark embedded therein. If watermark data is embedded, the watermark data can be marked as '1', and if watermark data is not embedded, the watermark data can be marked as '0'; alternatively, the watermark data may be marked as "0" when embedded, or "1" when not embedded.
In detail, in a specific application example, the size of the generated template image may be 21×21 pixels. In detection, for each pixel point of an image area in a print file, calculating the halftone matching degree between the area with the pixel point as the center and the side length of 21 pixel points and a template image, and if the matching degree meets the preset requirement, judging that watermark data is embedded in the pixel point.
After the above steps, a series of binary data can be obtained, then, according to the correspondence between each binary data and each watermark region when watermark data is embedded, the obtained series of binary data can be sequenced (decoding operation), and corresponding characters can be obtained according to the sequenced binary data, so as to complete extraction of watermark data.
Referring to fig. 10, an embodiment of the present application further provides an image processing apparatus 100 applicable to the electronic device 10 described above. The image processing apparatus 100 may include a watermark region determination module 110 and a halftone attribute adjustment module 130, among others.
The watermark region determining module 110 is configured to determine a watermark region in the image to be processed according to watermark data to be embedded. In this embodiment, the watermark region determination module 110 may be used to perform step S110 shown in fig. 2, and reference may be made to the foregoing description of step S110 with respect to the relevant content of the watermark region determination module 110.
The halftone attribute adjustment module 130 is configured to adjust halftone attributes of at least a portion of the to-be-processed image so that the watermark region and the non-watermark region have different halftone attributes. In this embodiment, the halftone attribute adjustment module 130 may be used to perform step S130 shown in fig. 2, and the description of step S130 may be referred to above for the relevant content of the halftone attribute adjustment module 130.
In connection with fig. 11, in the present embodiment, the halftone attribute adjustment module 130 may include a halftone attribute acquisition sub-module 131 and a halftone attribute adjustment sub-module 133.
The halftone attribute obtaining sub-module 131 is configured to obtain a predetermined target halftone attribute. In this embodiment, the halftone-attribute-obtaining sub-module 131 may be used to perform step S131 shown in fig. 5, and the description of step S131 may be referred to above for the relevant content of the halftone-attribute-obtaining sub-module 131.
The halftone attribute adjustment sub-module 133 is configured to adjust a halftone attribute of the watermark region according to the target halftone attribute. In this embodiment, the halftone attribute adjustment sub-module 133 may be used to perform step S133 shown in fig. 5, and the description of step S133 may be referred to above for the relevant content of the halftone attribute adjustment sub-module 133.
Wherein, the halftone attribute adjustment sub-module 133 is specifically configured to: and adjusting at least one halftone attribute of the watermark region according to the target halftone attribute, wherein the halftone attribute comprises an angle, a frequency and a shape.
Also, in the present embodiment, the image processing apparatus 100 may further include a halftone attribute determination module. The halftone attribute determination module is configured to determine target halftone attribute information different from the halftone attribute according to a halftone attribute of the non-watermark region.
In connection with fig. 12, in the present embodiment, the image processing apparatus 100 may further include a template image generation module 150 and a watermark data extraction module 170.
The template image generating module 150 is configured to generate a template image according to a watermark region in the watermark image after the halftone attribute adjusting module 130 adjusts the halftone attribute of at least a portion of the region of the image to be processed to obtain the watermark image. In this embodiment, the template image generation module 150 may be used to perform step S150 shown in fig. 9, and the description of step S150 may be referred to above with respect to the relevant content of the template image generation module 150.
The watermark data extraction module 170 is configured to extract watermark data corresponding to the watermark region according to the template image. In this embodiment, the watermark data extraction module 170 may be used to perform step S170 shown in fig. 9, and reference may be made to the foregoing description of step S170 regarding the relevant content of the watermark data extraction module 170.
In an embodiment of the present application, corresponding to the image processing method shown in fig. 2 to 9, there is also provided a computer-readable storage medium in which a computer program is stored, which executes the steps of the above-described image processing method when running.
The steps executed when the computer program runs are not described in detail herein, and reference may be made to the explanation of the image processing method.
In summary, the image processing method and apparatus, the electronic device 10, and the computer readable storage medium provided in the present application enable the watermark area and the non-watermark area to have different halftone attributes by performing halftone attribute adjustment on the image to be processed, so as to implement watermark data embedding, further improve the problem that watermark data embedded in the prior art is easy to be lost, effectively avoid the problem that the watermark data is lost to cause that the image is easy to be tampered or forged, and greatly improve the security of image use. In addition, watermark embedding processing is performed by modifying the halftone attribute, so that the problem of deformation of a printing piece which is easy to occur when an image to be processed is printed can be effectively resisted. In addition, the scheme of the method allows the Xu Qianru watermark data to have more characters, is more convenient for users and has wider application range, and the problem that the user is inconvenient due to the fact that the number of watermark embedded characters is limited in some watermark embedding methods in the prior art is effectively avoided.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other manners. The apparatus and method embodiments described above are merely illustrative, for example, flow diagrams and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
In addition, the functional modules in the embodiments of the present application may be integrated together to form a single part, or each module may exist alone, or two or more modules may be integrated to form a single part.
The functions, if implemented in the form of software functional modules and sold or used as a stand-alone product, may be stored in a computer-readable storage medium. Based on such understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution, in the form of a software product stored in a storage medium, including several instructions for causing a computer device (which may be a personal computer, an electronic device, or a network device, etc.) to perform all or part of the steps of the method described in the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, or an optical disk, or other various media capable of storing program codes. It should be noted that, in this document, 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 phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The foregoing description is only of the preferred embodiments of the present application and is not intended to limit the same, but rather, various modifications and variations may be made by those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principles of the present application should be included in the protection scope of the present application.

Claims (12)

1. An image processing method, comprising:
determining a watermark region in an image to be processed according to watermark data to be embedded, wherein the watermark region is an embedding region of 0 in binary data corresponding to the watermark data, or the watermark region is an embedding region of 1 in binary data corresponding to the watermark data;
and adjusting the halftone attribute of at least part of the area of the image to be processed so that the watermark area and the non-watermark area have different halftone attributes.
2. The image processing method according to claim 1, wherein the step of adjusting the halftone attribute of at least a partial region in the image to be processed includes:
acquiring a predetermined target halftone attribute;
and adjusting the halftone attribute of the watermark region according to the target halftone attribute.
3. The image processing method according to claim 2, wherein the step of adjusting the halftone attribute of the watermark region according to the target halftone attribute comprises:
and adjusting at least one halftone attribute of the watermark region according to the target halftone attribute, wherein the halftone attribute comprises an angle, a frequency and a shape, the angle in the halftone attribute refers to an included angle between a connecting line formed by two adjacent black point regions or two adjacent white point regions in a binary image region and a horizontal direction, the frequency in the halftone attribute refers to a distance between two adjacent black point regions or two adjacent white point regions in the binary image region in the horizontal direction or the vertical direction, and the shape in the halftone attribute refers to a shape of a connecting region formed by boundary pixels of the black point regions or the white point regions in the binary image region.
4. The image processing method according to claim 2, further comprising the step of predetermining said target halftone properties, in particular:
target halftone attribute information different from the halftone attribute is determined according to the halftone attribute of the non-watermark region.
5. The method according to any one of claims 1-4, wherein after adjusting the halftone properties of at least a portion of the image to be processed to obtain a watermark image, the method further comprises:
generating a template image according to the watermark region in the watermark image;
and extracting watermark data corresponding to the watermark region according to the template image.
6. An image processing apparatus, comprising:
the watermark region determining module is used for determining a watermark region in an image to be processed according to watermark data to be embedded, wherein the watermark region is an embedding region of 0 in binary data corresponding to the watermark data, or the watermark region is an embedding region of 1 in binary data corresponding to the watermark data;
and the halftone attribute adjustment module is used for adjusting the halftone attribute of at least part of the area of the image to be processed so that the watermark area and the non-watermark area have different halftone attributes.
7. The image processing apparatus according to claim 6, wherein the halftone attribute adjustment module includes:
a halftone attribute acquisition sub-module for acquiring a predetermined target halftone attribute;
and the halftone attribute adjustment sub-module is used for adjusting the halftone attribute of the watermark region according to the target halftone attribute.
8. The image processing apparatus according to claim 7, wherein the halftone attribute adjustment submodule is specifically configured to:
and adjusting at least one halftone attribute of the watermark region according to the target halftone attribute, wherein the halftone attribute comprises an angle, a frequency and a shape, the angle in the halftone attribute refers to an included angle between a connecting line formed by two adjacent black point regions or two adjacent white point regions in a binary image region and a horizontal direction, the frequency in the halftone attribute refers to a distance between two adjacent black point regions or two adjacent white point regions in the binary image region in the horizontal direction or the vertical direction, and the shape in the halftone attribute refers to a shape of a connecting region formed by boundary pixels of the black point regions or the white point regions in the binary image region.
9. The image processing apparatus according to claim 7, further comprising:
and the halftone attribute determination module is used for determining target halftone attribute information different from the halftone attribute according to the halftone attribute of the non-watermark region.
10. The image processing apparatus according to any one of claims 6 to 9, further comprising:
the template image generation module is used for generating a template image according to a watermark region in the watermark image after the halftone attribute adjustment module adjusts the halftone attribute of at least part of the region of the image to be processed to obtain the watermark image;
and the watermark data extraction module is used for extracting watermark data corresponding to the watermark region according to the template image.
11. An electronic device comprising a memory, a processor and an image processing apparatus according to any one of claims 6-10, the image processing apparatus comprising one or more software functional modules stored in the memory and executed by the processor.
12. A computer readable storage medium, on which a computer program is stored, characterized in that the program, when executed, implements the steps of the method according to any one of claims 1-5.
CN201811603656.7A 2018-12-26 2018-12-26 Image processing method and device, electronic equipment and computer readable storage medium Active CN109685708B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811603656.7A CN109685708B (en) 2018-12-26 2018-12-26 Image processing method and device, electronic equipment and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811603656.7A CN109685708B (en) 2018-12-26 2018-12-26 Image processing method and device, electronic equipment and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN109685708A CN109685708A (en) 2019-04-26
CN109685708B true CN109685708B (en) 2024-02-06

Family

ID=66189772

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811603656.7A Active CN109685708B (en) 2018-12-26 2018-12-26 Image processing method and device, electronic equipment and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN109685708B (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1243379A (en) * 1998-07-29 2000-02-02 日本电气株式会社 System of changing characteristic of picture through electronic watermark
CN101393635A (en) * 2008-10-27 2009-03-25 华为技术有限公司 Watermark information embedding, extracting method and processing system
CN101765847A (en) * 2007-04-04 2010-06-30 香港科技大学 Multimedia watermarking techniques with low distortion
CN103295184A (en) * 2013-05-13 2013-09-11 西安电子科技大学 Frequency domain and airspace combined halftone watermarking method
CN103996166A (en) * 2014-06-05 2014-08-20 上海理工大学 Holographic anti-counterfeiting algorithm based on shape of screen dot
CN104063834A (en) * 2013-03-22 2014-09-24 中国水利水电科学研究院 Watermark embedding method, watermark detecting method and device thereof
CN107392832A (en) * 2017-06-30 2017-11-24 广东欧珀移动通信有限公司 Image processing method and related product
CN108961138A (en) * 2017-05-19 2018-12-07 哈罗公司 The insertion and extracting method of watermark data

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1243379A (en) * 1998-07-29 2000-02-02 日本电气株式会社 System of changing characteristic of picture through electronic watermark
CN101765847A (en) * 2007-04-04 2010-06-30 香港科技大学 Multimedia watermarking techniques with low distortion
CN101393635A (en) * 2008-10-27 2009-03-25 华为技术有限公司 Watermark information embedding, extracting method and processing system
CN104063834A (en) * 2013-03-22 2014-09-24 中国水利水电科学研究院 Watermark embedding method, watermark detecting method and device thereof
CN103295184A (en) * 2013-05-13 2013-09-11 西安电子科技大学 Frequency domain and airspace combined halftone watermarking method
CN103996166A (en) * 2014-06-05 2014-08-20 上海理工大学 Holographic anti-counterfeiting algorithm based on shape of screen dot
CN108961138A (en) * 2017-05-19 2018-12-07 哈罗公司 The insertion and extracting method of watermark data
CN107392832A (en) * 2017-06-30 2017-11-24 广东欧珀移动通信有限公司 Image processing method and related product

Also Published As

Publication number Publication date
CN109685708A (en) 2019-04-26

Similar Documents

Publication Publication Date Title
JP6139396B2 (en) Method and program for compressing binary image representing document
US8331670B2 (en) Method of detection document alteration by comparing characters using shape features of characters
US7965894B2 (en) Method for detecting alterations in printed document using image comparison analyses
US9349237B2 (en) Method of authenticating a printed document
US10346661B2 (en) Method and system for generating two dimensional barcode including hidden data
US10970579B2 (en) Image processing apparatus for placing a character recognition target region at a position of a predetermined region in an image conforming to a predetermined format
US20120070030A1 (en) Payload recovery systems and methods
CN105701757B (en) Product anti-counterfeiting method and device based on digital watermark and graphic code
JP6115545B2 (en) Image processing apparatus and image processing method
CN111461102A (en) Anti-counterfeiting identification method, device, equipment terminal and readable storage medium
CN106251358A (en) A kind of image processing method and device
CN110210467B (en) Formula positioning method of text image, image processing device and storage medium
CN109671011B (en) Copyright information embedding method, copyright information extracting method and electronic equipment
CN109685708B (en) Image processing method and device, electronic equipment and computer readable storage medium
JP2016012767A (en) Image processing system
US11115560B2 (en) Image processing device, control method and control program for more accurately removing a background pattern from an image
CN113393363B (en) Watermark embedding and extracting method, storage medium and electronic device
JP4840224B2 (en) Form processing device
CN114329030A (en) Information processing method and device, computer equipment and storage medium
Borges et al. Document image processing for paper side communications
CN113076528A (en) Anti-counterfeiting information embedding method, anti-counterfeiting information extracting method, anti-counterfeiting information embedding device, anti-counterfeiting information extracting device and storage medium
KR20140063378A (en) Image forminag apparatus, method for image forming and computer-readable recording medium
CN110956568B (en) Independent secret information hiding method in shared image of halftone image
CN116894843B (en) Pu' er tea information tracing method based on perceptual hash algorithm and blockchain
KR100260923B1 (en) Apparatus and method for local binarization on images

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
GR01 Patent grant
GR01 Patent grant