WO2021023085A1 - Watermark adding method and apparatus, watermark recognition method and apparatus, and electronic device - Google Patents

Watermark adding method and apparatus, watermark recognition method and apparatus, and electronic device Download PDF

Info

Publication number
WO2021023085A1
WO2021023085A1 PCT/CN2020/105682 CN2020105682W WO2021023085A1 WO 2021023085 A1 WO2021023085 A1 WO 2021023085A1 CN 2020105682 W CN2020105682 W CN 2020105682W WO 2021023085 A1 WO2021023085 A1 WO 2021023085A1
Authority
WO
WIPO (PCT)
Prior art keywords
image
watermark
information
original
recognized
Prior art date
Application number
PCT/CN2020/105682
Other languages
French (fr)
Chinese (zh)
Inventor
赵明明
刘立真
谢文珍
Original Assignee
北京大米科技有限公司
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 北京大米科技有限公司 filed Critical 北京大米科技有限公司
Publication of WO2021023085A1 publication Critical patent/WO2021023085A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T1/00General purpose image data processing
    • G06T1/0021Image watermarking
    • G06T1/0042Fragile watermarking, e.g. so as to detect tampering

Definitions

  • the present invention relates to the field of image processing, in particular to a watermark adding method, a watermark recognition method, device and electronic equipment.
  • Image can be defined as the reproduction of things on a certain medium. For example, pictures, movies, faxes, televisions and other media can enable people to obtain image information.
  • the process of transmitting image information to other storage devices through the network is image transmission. With the rapid development of the Internet, more and more images need to be transmitted over the network.
  • embodiments of the present invention provide a watermark adding method, watermark recognition method, device, and electronic equipment, which at least partially solve the problem The above problem.
  • an embodiment of the present invention provides a watermark adding method, including:
  • the original image is processed by using the second image to add the watermark to the original image.
  • the first image is generated based on image sub-regions of the original image.
  • the using the second image to process the original image includes:
  • the image base and the original image are synthesized.
  • the image sub-region is a high-frequency region.
  • processing the first image based on the watermark to obtain the second image includes:
  • the watermark is generated based on configuration information
  • the configuration information includes at least one of the following: content information of the original image, service information, and user information.
  • an embodiment of the present invention provides a watermark recognition method, including:
  • Acquiring an image to be recognized wherein the image to be recognized is generated by processing an original image based on a second image, and the second image is obtained by processing the first image based on a watermark;
  • the second image is obtained by processing the first image based on the watermark, including:
  • the identifying the watermark in the image to be identified includes: extracting the first image and a third image, and comparing the first image and the third image to identify the watermark.
  • the image to be recognized is generated by processing the original image based on the second image, including:
  • the image base and the original image are synthesized.
  • the extracting the first image and the third image includes:
  • the first image and the third image are extracted from the sub-region.
  • an embodiment of the present invention provides a watermark adding device, including:
  • An obtaining unit configured to process the first image based on the watermark to obtain the second image
  • the adding unit is configured to use the second image to process the original image to add the watermark to the original image.
  • an embodiment of the present invention provides a watermark recognition device, including:
  • An acquiring unit configured to acquire an image to be identified, wherein the image to be identified is generated by processing an original image based on a second image, and the second image is obtained by processing the first image based on a watermark;
  • An identification unit for identifying the watermark in the image to be identified
  • the determining unit is configured to determine whether the image to be recognized is a tampered image based on the watermark.
  • an embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon, and when the program is executed by a processor, the steps of any one of the above methods are implemented.
  • an embodiment of the present invention provides an electronic device, including a memory, a processor, and a computer program stored on the memory and capable of running on the processor.
  • the processor implements any of the above items when the program is executed. Method steps.
  • the watermark adding method, watermark recognition method, device and electronic equipment provided by the present invention process a first image based on the watermark to obtain a second image; use the second image to process the original image to add the watermark to The original image. .
  • the watermark information is added to the original image through the second image, and the watermark information carried in the subsequent image can be extracted and analyzed to determine whether the image has been tampered with during transmission. Once the image is tampered with, the image can be discarded and corresponding security investigations can be carried out. While ensuring the normal operation of various systems in the network, it also guarantees the security of the network.
  • Fig. 1 is a schematic diagram of an exemplary system architecture in which the watermark adding method, watermark identification method and device of the embodiments of the present application can be applied;
  • Fig. 2 is a schematic flowchart of a watermark adding method provided by an embodiment of the present invention
  • FIG. 3 is a schematic flowchart of another watermark adding method provided by an embodiment of the present invention.
  • Fig. 4 is a schematic flowchart of another watermark adding method provided by an embodiment of the present invention.
  • FIG. 5 is a schematic flowchart of another watermark adding method provided by an embodiment of the present invention.
  • Fig. 6 is a schematic flowchart of a watermark recognition method provided by an embodiment of the present invention.
  • FIG. 7 is a schematic flowchart of another watermark identification method provided by an embodiment of the present invention.
  • Fig. 8A is a schematic diagram of an original image provided by an embodiment of the present invention.
  • FIG. 8B is a schematic diagram of an image template containing watermark information provided by an embodiment of the present invention.
  • FIG. 8C is a schematic diagram of an image processed by the watermark adding method shown in FIG. 3 according to an embodiment of the present invention.
  • Figure 9 is a schematic structural diagram of a watermark adding device provided by an embodiment of the present invention.
  • FIG. 10 is a schematic structural diagram of another watermark recognition device provided by an embodiment of the present invention.
  • Fig. 11 is a schematic structural diagram of an electronic device related to an embodiment of the present invention.
  • Fig. 1 shows a schematic diagram of an exemplary system architecture 100 to which the watermark adding method, watermark identification method and device of the embodiments of the present application can be applied.
  • the system architecture 100 may include one or more of communication devices 101, 102, and 103, a network 104 and a server 105.
  • the network 104 is used to provide a medium for communication links between the terminal devices 101, 102, 103 and the server 105.
  • the network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables. It should be understood that the numbers of communication devices, networks, and servers in FIG. 1 are merely illustrative. According to implementation needs, there can be any number of communication devices, networks and servers.
  • the server 105 may be a server cluster composed of multiple servers.
  • the communication devices 101, 102, 103 can be used to interact with the server 105 through the network 104 to receive or send messages, and so on.
  • the communication devices 101, 102, 103 may be various electronic devices with display screens, including but not limited to smart phones, tablet computers, portable computers, desktop computers, and so on.
  • the communication devices 101, 102, 103 may also be servers.
  • the systems running on the communication devices 101, 102, 103 need to transmit image files to and from the system running on the server 105.
  • the server 105 processes the first image based on the watermark to obtain the second image; uses the second image to process the original image to add the watermark to the original image.
  • the server 105 sends images carrying watermark information to the communication devices 101, 102, 103 via the network 104; and accepts the images to be recognized returned by the communication devices 101, 102, 103; obtains the watermark information in the images to be recognized; The watermark information determines whether the image to be identified is a tampered image.
  • Figure 2 is a schematic flow chart of a watermark adding method provided by an embodiment of the present invention.
  • the schematic flow chart is based on the network architecture of Figure 1.
  • the method includes:
  • S201 Process the first image based on the watermark to obtain a second image.
  • Watermark is digital information added to image files. By adding watermark information to the image file, it can identify whether the file has been tampered with.
  • Watermark information can include image information, sequence information, barcodes, two-dimensional codes, etc., or a combination of image information, sequence information, barcodes, and two-dimensional codes. Among them, the sequence information can be text information, digital information or a combination.
  • the specific watermark information can be set according to specific needs.
  • the watermark is generated based on configuration information
  • the configuration information includes at least one of the following: content information of the original image, service information, and user information.
  • the content information of the original image may include image ID, attribution system, image description, and so on.
  • the business information is the business system information applied to the original image.
  • Business information may include: business ID, business name, business nature, business description, etc.
  • the image after adding the watermark information may need to be sent to the corresponding user, and the corresponding user information is the above-mentioned user information.
  • User information may include: user name, name, age, gender, hometown, level, etc.
  • the watermark information added to the picture can be "Ain Job" and so on.
  • the user can also customize the user's watermark information to better meet the personalized needs of different users.
  • the content information, service information, and user information of the original image to generate the corresponding watermark information, compared to generating unified watermark information for all users, it can generate a variety of watermark information based on the content information, service information, and user information of the original image, reducing The watermark information of a certain user is leaked, so that the watermark information of all users in the system will be leaked, so as to more effectively guarantee the safety of the system operation.
  • the configuration information also includes display parameters.
  • the display parameters are the display position, font, line spacing, etc. of the watermark in the second image. This can better cater to the different needs of different users and improve user experience.
  • the watermark information can be added to the original image.
  • the subsequent watermark recognition program can extract the watermark information, and use the watermark information to determine whether the image has been tampered with during transmission.
  • the first image is generated based on image sub-regions of the original image.
  • the aforementioned image sub-region may be a sub-image in a certain region of the original image.
  • the first image may be the aforementioned image sub-region.
  • the first image may also be an image generated by performing image processing on the above-mentioned image sub-regions, and the image processing includes: image gradation processing, image binarization processing, and the like.
  • the above-mentioned first image may also be a set image template.
  • said using the second image to process the original image includes:
  • the image base and the original image are synthesized.
  • Blank image can be set according to needs and image information. For example, if the blank image is a 24-bit image represented in RGB format, each pixel value of the blank image can be set to (0, 0, 0), and the blank image is displayed as a black image. You can also set each pixel value of the blank image to (255,255,255), and the blank image is displayed as a white image.
  • the image base plate generated by the blank image displays the watermark image at the preset position, and displays the black image or white image at other positions except the preset position.
  • the second image can be added to the first area of the blank image.
  • the watermark information is extracted from the image according to the above-mentioned first region.
  • each pixel value of the image base except the preset position is set to (0,0 ,0)
  • the pixel value on the image floor can also be set to other pixel values, and the realization principle is the same.
  • each pixel value of the image base plate except the preset position is set to (0,0,0).
  • the original image is combined with the image base to generate an image with watermark. Specifically, if the pixel value at the corresponding position of the image bottom plate is (0, 0, 0), the pixel value at that position of the processed image remains unchanged. If the pixel value at the corresponding position of the image bottom plate is not (0, 0, 0), the pixel value of the processed image at this position is the pixel value on the image bottom plate. This method enables the processed image to display watermark information at a preset position.
  • the position of the first region corresponds to the position of the image sub-region in the original image.
  • the position of the first area is the same as the position of the image sub-areas in the original image.
  • the sub-image is extracted from the position of the first area of the original image as the first image, the watermark is added to the first image to generate a second image, and the second image is added to the first area in the blank image to obtain an image base.
  • the image base and the original image are synthesized. In this way, only the watermark is added to the first area of the original image. Except for the pixels at the watermark position that display the watermark, the other pixels of the original image remain unchanged. Thereby, the visual difference between the images before and after processing is reduced, and the user experience is improved.
  • the size of the watermark added to the original image can be set smaller than the size of the original image, or the watermark can be added to the edge position of the original image. This makes it difficult for human eyes to detect and does not affect the user's visual experience.
  • the watermark information is text information
  • the text added in the picture is recognized, and the text is compared with the text corresponding to the watermark information stored in the system to determine whether the image has been tampered with during transmission.
  • storing the text information corresponding to the watermark is more flexible in operation and can also save system storage space.
  • the watermark information is added to the original image, and then the watermark information carried in the subsequent image can be extracted and analyzed to determine whether the image has been tampered with or damaged. Once the image has been tampered with or destroyed, the image can be discarded and the corresponding security investigation can be carried out. This can solve the problem that the image is often tampered and destroyed during the user's use of the image, which causes the system in the network to fail to operate normally .
  • the tampered pictures may contain viruses or Trojan horses that threaten the security of the system. Therefore, the present invention can also solve the security problem caused by the picture being tampered with during transmission.
  • Fig. 3 is a schematic flowchart of another watermark adding method provided by an embodiment of the present invention.
  • the method includes:
  • the high frequency area information is the area information in the image where the brightness or gray level of the image changes greatly.
  • the low-frequency area information is the area information in the image where the brightness or gray level of the image changes little.
  • the high frequency area usually corresponds to the edge area and the noise area in the image, and the low frequency area usually corresponds to the large patch area in the image.
  • the high and low frequency region information of the image can be obtained by PCA (principal components analysis) technology or whitening operation and other technical means, which will not be repeated here.
  • the above-mentioned watermark adding method provided by the embodiment of the present invention can add watermark information to the high frequency area of the original image. Because the high frequency area usually corresponds to the edge area and the noise area in the image, the low frequency area usually corresponds to the large patch area in the image. Therefore, adding a watermark to the high-frequency area of the original image, compared to adding a watermark to the low-frequency area of the original image, is to add the watermark to the insensitive area of the human eye, which can lessen the user's visual effect and is not easy to cause User perception.
  • Figure 4 is a schematic flowchart of another watermark adding method provided by an embodiment of the present invention.
  • the method includes:
  • the image to be recognized contains a first image and a third image, wherein the first image does not contain a watermark, and the third image is the first image after adding a watermark.
  • the first image and the third image are extracted from the image to be recognized, and the watermark can be recognized by comparing the first image and the third image.
  • the watermark information can be extracted by comparing the first image and the third image. Compared with the need to analyze and compare the entire image to be recognized, the watermark can be extracted, which improves Speed and efficiency of watermark extraction.
  • Fig. 5 is a schematic flowchart of another watermark adding method provided by an embodiment of the present invention.
  • the method includes:
  • S501 Process the first image based on the watermark to obtain a second image.
  • the predetermined location can be set according to specific needs. If the second image is to be added to the second area of the original image, the predetermined position is the corresponding position of the second area of the original image in the blank image. The predetermined position may also be a preset position in the blank image.
  • the watermark information is added to the original image through the image backplane, and then the watermark information carried in the subsequent image information can be extracted and analyzed to determine whether the image has been tampered with or destroyed during transmission.
  • Fig. 6 is a schematic flowchart of a watermark recognition method provided by an embodiment of the present invention.
  • the method includes:
  • Watermark information is digital information added to the image file, which can be image information, sequence information, or a combination of image information and sequence information.
  • the sequence information can be a combination of text information and digital information.
  • the specific watermark information can be set according to specific needs.
  • the watermark information in the image to be recognized can be obtained in many ways, including but not limited to the following ways or a combination thereof:
  • the predetermined position information represents the addition position information of the image template in the original image.
  • the watermark information is directly extracted from the image to be recognized.
  • Watermark information is text information, such as company name, business name and other specific words, numbers or combinations. Through image recognition technology, it is recognized whether the image to be recognized contains the text information, and then it is determined whether the recognized image contains a watermark corresponding to the text content.
  • the original image is stored in the system, and the watermark information in the image to be recognized is obtained by comparing the original image with the image to be recognized.
  • S603 Based on the watermark information, determine whether the image to be recognized is a tampered image.
  • the watermark information is text information
  • the text information corresponding to the watermark information is stored.
  • image recognition and other technologies the text contained in the watermark is recognized, and the text is compared with the text corresponding to the watermark information stored in the system to determine whether the image has been tampered with during transmission.
  • the watermark information is image information
  • extract the watermark information in the image to be recognized and analyze and compare it with the watermark information stored in the system to determine whether the image has been tampered with during transmission.
  • the method for determining whether the image to be identified is a tampered image includes, but is not limited to, the above-mentioned implementation methods. All methods that can be implemented to determine whether the image to be identified is a tampered image are within the protection scope of the present invention.
  • the above-mentioned watermark recognition method extracts and analyzes the watermark information carried by subsequent image information to determine whether the image has been tampered with or destroyed during transmission. Once the image has been tampered with or destroyed, the image can be discarded and the corresponding security investigations can be performed. This can solve the problem that the image is often tampered and destroyed during the transmission process, which causes the system in the network to fail to operate normally.
  • FIG 7 is a schematic flowchart of another watermark recognition method provided by an embodiment of the present invention.
  • the method includes:
  • S703 Process the original image based on the second image to generate a processed image.
  • the image to be recognized is generated by processing the original image based on the second image, including:
  • the image base and the original image are synthesized.
  • an online education platform needs to first send a promotion image to the participants. After the participant promotes, the forwarded image based on the promotion image will be sent to the online education platform.
  • the forwarded image can be a screenshot of WeChat (such as Moments screenshots, WeChat group screenshots, etc.), Weibo screenshots or browser screenshots, etc.
  • WeChat Such as Moments screenshots, WeChat group screenshots, etc.
  • the forwarded image is an image to be recognized, the promotion image is a processed image, and the forwarded image corresponds to the promotion image.
  • the online education platform first sends task images related to the learning task to the students. After the students complete the learning, they send a progress image generated based on the task image to the platform.
  • the progress image is an image that has completed a predetermined amount of learning tasks.
  • the above progress image is an image to be recognized, the above task image is a processed image, and the progress image corresponds to the task image.
  • S705 Extract the first image and the third image in the image to be recognized.
  • step S706 is executed.
  • the extracting the first image and the third image includes:
  • S707 Determine whether the image to be recognized is a tampered image based on the watermark extracted in S706.
  • the watermark information can be extracted by comparing the first image and the third image. Compared with the need to analyze and process the entire image to be recognized, the watermark information can be extracted, which improves the extraction of watermark information. Speed and efficiency.
  • the high frequency area usually corresponds to the edge area and the noise area in the image
  • the low frequency area usually corresponds to the large patch area in the image. Therefore, adding a watermark to the high-frequency area of the original image, compared to adding a watermark to the low-frequency area of the original image, is to add the watermark to the insensitive area of the human eye, which can lessen the user's visual effect and is not easy to cause User perception.
  • the obtaining unit 901 is configured to process the first image based on the watermark to obtain the second image;
  • the adding unit 902 is configured to process the original image by using the second image to add the watermark to the original image.
  • the first image is generated based on image sub-regions of the original image.
  • the image sub-region is a high-frequency region.
  • the obtaining unit 901 is specifically configured to:
  • Fig. 10 is a schematic structural diagram of a watermark recognition device provided by an embodiment of the present invention, referred to as device 10, and the device 10 may include:
  • the obtaining unit 1001 is configured to obtain an image to be recognized, wherein the image to be recognized is generated by processing an original image based on a second image, and the second image is obtained by processing the first image based on a watermark;
  • the determining unit 1003 is configured to determine whether the image to be recognized is a tampered image based on the watermark.
  • the device further includes a generating unit 1004, configured to add the watermark to the first image to obtain a third image;
  • the image base and the original image are synthesized.
  • the recognition unit 1002 is further configured to determine a sub-region corresponding to the position of the first region in the image to be recognized;
  • the first image and the third image are extracted from the sub-region.
  • the “unit” and “module” in this specification refer to software and/or hardware that can independently complete or cooperate with other components to complete specific functions.
  • the hardware may be FPGA (Field-Programmable Gate Array), for example. , IC (Integrated Circuit, integrated circuit), etc.
  • processing units and/or modules in the embodiments of the present invention may be implemented by analog circuits that implement the functions described in the embodiments of the present invention, or may be implemented by software that implements the functions described in the embodiments of the present invention.
  • FIG. 11 shows a schematic structural diagram of an electronic device related to an embodiment of the present invention.
  • the electronic device can be used to implement the watermark adding method or the watermark identifying method provided in the foregoing embodiment. Specifically:
  • the touch detection device detects the user's touch position, detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into contact coordinates, and then sends it To the processor 1180, and can receive and execute the commands sent by the processor 1180.
  • the touch-sensitive surface 1131 can be realized by multiple types such as resistive, capacitive, infrared, and surface acoustic wave.
  • the display unit of the terminal device is a touch screen display
  • the terminal device also includes a memory and one or more programs.
  • One or more programs are stored in the memory and configured to be configured by one or more programs.
  • the execution of the one or more programs by the above processor includes the steps of implementing the above watermark adding method and/or watermark identifying method.
  • the disclosed device and method may be implemented in other ways.
  • the device embodiments described above are merely illustrative.
  • the division of the units is only a logical function division, and there may be other divisions in actual implementation, such as: multiple units or components can be combined, or It can be integrated into another system, or some features can be ignored or not implemented.
  • the coupling, or direct coupling, or communication connection between the components shown or discussed may be indirect coupling or communication connection through some interfaces, devices or units, and may be electrical, mechanical or other forms of.
  • the functional units in the embodiments of the present invention can be all integrated into one processing unit, or each unit can be individually used as a unit, or two or more units can be integrated into one unit; the above-mentioned integrated unit It can be implemented in the form of hardware or in the form of hardware plus software functional units.

Abstract

A watermark adding method and apparatus, a watermark recognition method and apparatus, and an electronic device. A first image is processed on the basis of a watermark to obtain a second image (S201); an original image is processed by using the second image so as to add the watermark into the original image (S202). Watermark information is added to the original image by means of the second image, and whether the image is tampered in a transmission process is determined by extracting and analyzing the watermark information carried by subsequent image information, so that the normal operation of each system in the network is ensured, and the security of the network is also ensured.

Description

水印添加方法、水印识别方法、装置和电子设备Watermark adding method, watermark recognition method, device and electronic equipment 技术领域Technical field
本发明涉及图像处理领域,具体而言,涉及一种水印添加方法、水印识别方法、装置和电子设备。The present invention relates to the field of image processing, in particular to a watermark adding method, a watermark recognition method, device and electronic equipment.
背景技术Background technique
本发明对于背景技术的描述属于与本发明相关的相关技术,仅仅是用于说明和便于理解本发明的发明内容,不应理解为申请人明确认为或推定申请人认为是本发明在首次提出申请的申请日的现有技术。The description of the background technology of the present invention belongs to the related technology related to the present invention. It is only used to illustrate and facilitate the understanding of the content of the present invention. It should not be understood that the applicant clearly believes or presumes that the applicant believes that the present invention was first filed Existing technology on the filing date.
图像可以定义为事物在某种介质上的再现,例如图片、电影、传真、电视等介质都可以使人们获得图像信息。把图像信息通过网络传送到其它存储设备的过程为图像传输。随着互联网的高速发展,越来越多的图像需要在网络中被传输。Image can be defined as the reproduction of things on a certain medium. For example, pictures, movies, faxes, televisions and other media can enable people to obtain image information. The process of transmitting image information to other storage devices through the network is image transmission. With the rapid development of the Internet, more and more images need to be transmitted over the network.
系统中通常会存储多张图像,用户需要与系统互传图像,以达到推广、学习、交流等目的。但图片存在被篡改的风险,给系统的正常运行造成影响。Multiple images are usually stored in the system, and users need to exchange images with the system to achieve the purpose of promotion, learning, and communication. However, the pictures may be tampered with, which will affect the normal operation of the system.
发明内容Summary of the invention
为了解决目前图像在传输过程中常常被篡改、破坏而造成网络中各系统无法正常运行的问题,本发明实施例提供了一种水印添加方法、水印识别方法、装置和电子设备,至少部分地解决上述问题。In order to solve the problem that various systems in the network cannot operate normally due to the fact that images are often tampered and destroyed during transmission, embodiments of the present invention provide a watermark adding method, watermark recognition method, device, and electronic equipment, which at least partially solve the problem The above problem.
第一方面,本发明实施例提供了一种水印添加方法,包括:In the first aspect, an embodiment of the present invention provides a watermark adding method, including:
基于水印对第一图像进行处理,得到第二图像;Processing the first image based on the watermark to obtain the second image;
利用所述第二图像对原图像进行处理,以将所述水印添加到所述原图像中。The original image is processed by using the second image to add the watermark to the original image.
进一步地,述第一图像基于所述原图像的图像子区域生成。Further, the first image is generated based on image sub-regions of the original image.
进一步地,所述利用所述第二图像对原图像进行处理,包括:Further, the using the second image to process the original image includes:
将所述第二图像添加到空白图像中的第一区域,得到图像底板,所述第一区域的位置与所述图像子区域在所述原图像中的位置相对应;Adding the second image to the first area in the blank image to obtain an image bottom plate, and the position of the first area corresponds to the position of the image sub-area in the original image;
将所述图像底板与所述原图像进行合成。The image base and the original image are synthesized.
进一步地,所述图像子区域为高频区域。Further, the image sub-region is a high-frequency region.
进一步地,所述基于水印对第一图像进行处理,得到第二图像,包括:Further, the processing the first image based on the watermark to obtain the second image includes:
将所述水印添加到所述第一图像,得到第三图像;Adding the watermark to the first image to obtain a third image;
将所述第一图像与所述第三图像拼接,得到所述第二图像。Stitching the first image and the third image to obtain the second image.
进一步地,所述水印基于配置信息生成,所述配置信息包括如下至少之一:原图像的内容信息、业务信息、用户信息。Further, the watermark is generated based on configuration information, and the configuration information includes at least one of the following: content information of the original image, service information, and user information.
第二方面,本发明实施例提供了一种水印识别方法,包括:In the second aspect, an embodiment of the present invention provides a watermark recognition method, including:
获取待识别图像,其中,所述待识别图像基于第二图像对原图像进行处理而生成,所述第二图像基于水印对第一图像进行处理而得到;Acquiring an image to be recognized, wherein the image to be recognized is generated by processing an original image based on a second image, and the second image is obtained by processing the first image based on a watermark;
识别所述待识别图像中的所述水印;Identifying the watermark in the image to be identified;
基于所述水印,确定所述待识别图像是否为被篡改图像。Based on the watermark, it is determined whether the image to be recognized is a tampered image.
进一步地,所述第二图像基于水印对第一图像进行处理而得到,包括:Further, the second image is obtained by processing the first image based on the watermark, including:
将所述水印添加到所述第一图像,得到第三图像;Adding the watermark to the first image to obtain a third image;
将所述第一图像与所述第三图像拼接,得到所述第二图像。Stitching the first image and the third image to obtain the second image.
进一步地,所述识别所述待识别图像中的所述水印,包括:提取所述第一图像和第三图像,通过比对所述第一图像及第三图像,以识别所述水印。Further, the identifying the watermark in the image to be identified includes: extracting the first image and a third image, and comparing the first image and the third image to identify the watermark.
进一步地,所述待识别图像基于第二图像对原图像进行处理而生成,包括:Further, the image to be recognized is generated by processing the original image based on the second image, including:
将所述第二图像添加到空白图像中的第一区域,得到图像底板;Adding the second image to the first area in the blank image to obtain an image base plate;
将所述图像底板与所述原图像进行合成。The image base and the original image are synthesized.
进一步地,所述提取所述第一图像和第三图像,包括:Further, the extracting the first image and the third image includes:
确定所述待识别图像中与所述第一区域的位置相对应的子区域;Determining a sub-region corresponding to the position of the first region in the image to be recognized;
从所述子区域提取所述第一图像和第三图像。The first image and the third image are extracted from the sub-region.
第三方面,本发明实施例提供了一种水印添加装置,包括:In the third aspect, an embodiment of the present invention provides a watermark adding device, including:
取得单元,用于基于水印对第一图像进行处理,得到第二图像;An obtaining unit, configured to process the first image based on the watermark to obtain the second image;
添加单元,用于利用所述第二图像对原图像进行处理,以将所述水印添加到所述原图像中。The adding unit is configured to use the second image to process the original image to add the watermark to the original image.
第四方面,本发明实施例提供了一种水印识别装置,包括:In a fourth aspect, an embodiment of the present invention provides a watermark recognition device, including:
获取单元,用于获取待识别图像,其中,所述待识别图像基于第二图像对原图像进行处理而生成,所述第二图像基于水印对第一图像进行处理而得到;An acquiring unit, configured to acquire an image to be identified, wherein the image to be identified is generated by processing an original image based on a second image, and the second image is obtained by processing the first image based on a watermark;
识别单元,用于识别所述待识别图像中的所述水印;An identification unit for identifying the watermark in the image to be identified;
确定单元,用于基于所述水印,确定所述待识别图像是否为被篡改图像。The determining unit is configured to determine whether the image to be recognized is a tampered image based on the watermark.
第五方面,本发明实施例提供了一种计算机可读存储介质,其上存储有计算机程序,该程序被处理器执行时实现上述任一项方法的步骤。In a fifth aspect, an embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon, and when the program is executed by a processor, the steps of any one of the above methods are implemented.
第六方面,本发明实施例提供了一种电子设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述程序时实现上述任一项方法的步骤。In a sixth aspect, an embodiment of the present invention provides an electronic device, including a memory, a processor, and a computer program stored on the memory and capable of running on the processor. The processor implements any of the above items when the program is executed. Method steps.
本发明提供的水印添加方法、水印识别方法、装置和电子设备,基于水印对第一图像进行处理,得到第二图像;利用所述第二图像对原图像进行处理,以将所述水印添加到所述原图像中。。本发明通过第二图像将水印信息添加到原图像中,进而可通过提取并分析后续图像中所携带的水印信息,确定图像在传输过程中是否被篡改。一旦图像被篡改,可抛弃该图像,并进行对应的安全排查,在保障网络中各系统正常运行的同时,也保障网络的安全性。The watermark adding method, watermark recognition method, device and electronic equipment provided by the present invention process a first image based on the watermark to obtain a second image; use the second image to process the original image to add the watermark to The original image. . In the present invention, the watermark information is added to the original image through the second image, and the watermark information carried in the subsequent image can be extracted and analyzed to determine whether the image has been tampered with during transmission. Once the image is tampered with, the image can be discarded and corresponding security investigations can be carried out. While ensuring the normal operation of various systems in the network, it also guarantees the security of the network.
附图说明Description of the drawings
为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly describe the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings that need to be used in the description of the embodiments or the prior art. Obviously, the drawings in the following description are only These are some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative work.
图1是可以应用本申请实施例的水印添加方法、水印识别方法及装置的示例性系统架构的示意图;Fig. 1 is a schematic diagram of an exemplary system architecture in which the watermark adding method, watermark identification method and device of the embodiments of the present application can be applied;
图2是本发明实施例提供的一种水印添加方法的流程示意图;Fig. 2 is a schematic flowchart of a watermark adding method provided by an embodiment of the present invention;
图3是本发明实施例提供的另一种水印添加方法的流程示意图;Figure 3 is a schematic flowchart of another watermark adding method provided by an embodiment of the present invention;
图4是本发明实施例提供的又一种水印添加方法的流程示意图;Fig. 4 is a schematic flowchart of another watermark adding method provided by an embodiment of the present invention;
图5是本发明实施例提供的再一种水印添加方法的流程示意图;FIG. 5 is a schematic flowchart of another watermark adding method provided by an embodiment of the present invention;
图6是本发明实施例提供的一种水印识别方法的流程示意图;Fig. 6 is a schematic flowchart of a watermark recognition method provided by an embodiment of the present invention;
图7是本发明实施例提供的另一种水印识别方法的流程示意图;Figure 7 is a schematic flowchart of another watermark identification method provided by an embodiment of the present invention;
图8A是本发明实施例提供的原图像的示意图;Fig. 8A is a schematic diagram of an original image provided by an embodiment of the present invention;
图8B是本发明实施例提供的包含水印信息的图像模板的示意图;8B is a schematic diagram of an image template containing watermark information provided by an embodiment of the present invention;
图8C是本发明实施例提供的利用图3所示的水印添加方法处理后的图像的示意图;FIG. 8C is a schematic diagram of an image processed by the watermark adding method shown in FIG. 3 according to an embodiment of the present invention;
图9是本发明实施例提供的一种水印添加装置的结构示意图;Figure 9 is a schematic structural diagram of a watermark adding device provided by an embodiment of the present invention;
图10是本发明实施例提供的另一种水印识别装置的结构示意图;Figure 10 is a schematic structural diagram of another watermark recognition device provided by an embodiment of the present invention;
图11是本发明实施例所涉及的一种电子设备的结构示意图。Fig. 11 is a schematic structural diagram of an electronic device related to an embodiment of the present invention.
具体实施方式detailed description
下面结合附图和实施例对本申请进行进一步的介绍。The application will be further introduced below in conjunction with the drawings and embodiments.
在下述介绍中,术语“第一”、“第二”仅为用于描述的目的,而不能理解为指示或暗示相对重要性。下述介绍提供了本发明的多个实施例,不同实施例之间可以替换或者合并组合,因此本申请也可认为包含所记载的相同和/或不同实施例的所有可能组合。因而,如果一个实施例包含特征A、B、C,另一个实施例包含特征B、D,那么本申请也应视为包括含有A、B、C、D的一个或多个所有其他可能的组合的实施例,尽管该实施例可能并未在以下内容中有明确的文字记载。In the following introduction, the terms "first" and "second" are only used for descriptive purposes, and cannot be understood as indicating or implying relative importance. The following description provides multiple embodiments of the present invention, and different embodiments can be substituted or combined. Therefore, this application may also be considered to include all possible combinations of the same and/or different embodiments described. Therefore, if one embodiment includes features A, B, C, and another embodiment includes features B, D, then this application should also be considered as including all other possible combinations of one or more of A, B, C, and D Although the embodiment may not be clearly written in the following content.
下面的描述提供了示例,并且不对权利要求书中阐述的范围、适用性或示例进行限制。可以在不脱离本申请内容的范围的情况下,对描述的元素的功能和布置做出改变。各个示例可以适当省略、替代或添加各种过程或组件。例如所描述的方法可以以所描述的顺序不同的顺序来执行,并且可以添加、省略或组合各种步骤。此外,可以将关于一些示例描述的特征组合到其他示例中。The following description provides examples, and does not limit the scope, applicability, or examples set forth in the claims. Changes can be made to the function and arrangement of the described elements without departing from the scope of the content of this application. Various procedures or components may be omitted, substituted, or added in various examples as appropriate. For example, the described method may be executed in a different order from the described order, and various steps may be added, omitted, or combined. In addition, features described with respect to some examples can be combined into other examples.
图1示出了可以应用本申请实施例的水印添加方法、水印识别方法及装置的示例性系统架构100的示意图。Fig. 1 shows a schematic diagram of an exemplary system architecture 100 to which the watermark adding method, watermark identification method and device of the embodiments of the present application can be applied.
如图1所示,系统架构100可以包括通信设备101、102、103中的一种或多种,网络104和服务器105。网络104用以在终端设备101、102、103和服务器105之间提供通信链路的介质。网络104可以包括各种连接类型,例如有线、无线通信链路或者光纤电缆等等。应该理解,图1中的通信设备、网络和服务器的数目仅仅是示意性的。根据实现需要,可以具有任意数目的通信设备、网络和服务器。比如服务器105可以是多个服务器组成的服务器集群等。As shown in FIG. 1, the system architecture 100 may include one or more of communication devices 101, 102, and 103, a network 104 and a server 105. The network 104 is used to provide a medium for communication links between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables. It should be understood that the numbers of communication devices, networks, and servers in FIG. 1 are merely illustrative. According to implementation needs, there can be any number of communication devices, networks and servers. For example, the server 105 may be a server cluster composed of multiple servers.
可以使用通信设备101、102、103通过网络104与服务器105交互,以接收或发送消息等。通信设备101、102、103可以是具有显示屏的各种电子设备,包括但不限于智能手 机、平板电脑、便携式计算机和台式计算机等等。通信设备101、102、103也可以是服务器。运行于通信设备101、102、103的系统需要与运行于服务器105上的系统相互传输图像文件。The communication devices 101, 102, 103 can be used to interact with the server 105 through the network 104 to receive or send messages, and so on. The communication devices 101, 102, 103 may be various electronic devices with display screens, including but not limited to smart phones, tablet computers, portable computers, desktop computers, and so on. The communication devices 101, 102, 103 may also be servers. The systems running on the communication devices 101, 102, 103 need to transmit image files to and from the system running on the server 105.
服务器105基于水印对第一图像进行处理,得到第二图像;利用所述第二图像对原图像进行处理,以将所述水印添加到所述原图像中。服务器105通过网络104向通信设备101、102、103发送携带有水印信息的图像;并接受通信设备101、102、103返回的待识别图像;获取所述待识别图像中的水印信息;基于所述水印信息,确定所述待识别图像是否为被篡改图像。The server 105 processes the first image based on the watermark to obtain the second image; uses the second image to process the original image to add the watermark to the original image. The server 105 sends images carrying watermark information to the communication devices 101, 102, 103 via the network 104; and accepts the images to be recognized returned by the communication devices 101, 102, 103; obtains the watermark information in the images to be recognized; The watermark information determines whether the image to be identified is a tampered image.
参见图2,图2是本发明实施例提供的一种水印添加方法的流程示意图,该流程示意图基于图1的网络架构,在本发明实施例中,所述方法包括:Referring to Figure 2, Figure 2 is a schematic flow chart of a watermark adding method provided by an embodiment of the present invention. The schematic flow chart is based on the network architecture of Figure 1. In the embodiment of the present invention, the method includes:
S201、基于水印对第一图像进行处理,得到第二图像。S201: Process the first image based on the watermark to obtain a second image.
水印是向图像文件中添加的数字信息。通过向图像文件中添加水印信息,可达到鉴别文件是否被篡改的作用。水印信息可以包括图像信息、序列信息、条形码、二维码等,也可以是图像信息、序列信息、条形码、二维码的组合。其中,序列信息可以是文字信息、数字信息或组合。具体的水印信息可根据具体需要进行设定。Watermark is digital information added to image files. By adding watermark information to the image file, it can identify whether the file has been tampered with. Watermark information can include image information, sequence information, barcodes, two-dimensional codes, etc., or a combination of image information, sequence information, barcodes, and two-dimensional codes. Among them, the sequence information can be text information, digital information or a combination. The specific watermark information can be set according to specific needs.
可选地,所述水印基于配置信息生成,所述配置信息包括如下至少之一:原图像的内容信息、业务信息、用户信息。Optionally, the watermark is generated based on configuration information, and the configuration information includes at least one of the following: content information of the original image, service information, and user information.
原图像的内容信息可包括图像ID、归属系统、图像描述等。业务信息为原图像所应用的业务系统信息。业务信息可包括:业务ID、业务名称、业务性质、业务描述等。添加水印信息后的图像可能需要发送给对应用户,该对应用户的信息即为上述的用户信息。用户信息可包括:用户名、姓名、年龄、性别、籍贯、级别等。The content information of the original image may include image ID, attribution system, image description, and so on. The business information is the business system information applied to the original image. Business information may include: business ID, business name, business nature, business description, etc. The image after adding the watermark information may need to be sent to the corresponding user, and the corresponding user information is the above-mentioned user information. User information may include: user name, name, age, gender, hometown, level, etc.
举例来说,某求职系统与一个用户名为A的用户之间,需要相互传输图片,则该图片添加的水印信息可以为“Ain Job”等。进一步地,用户也可以自定义该用户的水印信息,以更好的满足不同用户的个性化需求。For example, if a job search system and a user whose user name is A need to transfer pictures to each other, the watermark information added to the picture can be "Ain Job" and so on. Further, the user can also customize the user's watermark information to better meet the personalized needs of different users.
利用原图像的内容信息、业务信息、用户信息生成对应的水印信息,相比针对所有用户生成统一的水印信息,可根据原图像的内容信息、业务信息、用户信息,生成多种水印信息,减少了由于泄露了某个用户的水印信息,使系统中所有用户的水印信息都遭到泄露的风险,从而更有效的保障系统运行的安全。Using the content information, service information, and user information of the original image to generate the corresponding watermark information, compared to generating unified watermark information for all users, it can generate a variety of watermark information based on the content information, service information, and user information of the original image, reducing The watermark information of a certain user is leaked, so that the watermark information of all users in the system will be leaked, so as to more effectively guarantee the safety of the system operation.
进一步地,所述配置信息中还包括显示参数。显示参数为水印在所述第二图像中的显示位置、字体、行间距等。从而可以较好地迎合不同用户的不同需求,提高用户体验。Further, the configuration information also includes display parameters. The display parameters are the display position, font, line spacing, etc. of the watermark in the second image. This can better cater to the different needs of different users and improve user experience.
S202、利用所述第二图像对原图像进行处理,以将所述水印添加到所述原图像中。S202. Use the second image to process the original image to add the watermark to the original image.
由于第二图像上包含有水印信息,利用第二图像对原图像进行处理时,可将该水印信息添加到原图像中。后续的水印识别程序可提取该水印信息,利用水印信息,判断图像在传输过程中有没有被篡改。Since the second image contains watermark information, when the original image is processed using the second image, the watermark information can be added to the original image. The subsequent watermark recognition program can extract the watermark information, and use the watermark information to determine whether the image has been tampered with during transmission.
可选地,所述第一图像基于所述原图像的图像子区域生成。Optionally, the first image is generated based on image sub-regions of the original image.
上述图像子区域可为原图像在的某区域内的子图像。第一图像可以为上述图像子区域。第一图像也可以是对上述图像子区域进行图像处理而生成的图像,图像处理包括:图像灰度化处理、图像二值化处理等。The aforementioned image sub-region may be a sub-image in a certain region of the original image. The first image may be the aforementioned image sub-region. The first image may also be an image generated by performing image processing on the above-mentioned image sub-regions, and the image processing includes: image gradation processing, image binarization processing, and the like.
此外,上述第一图像也可为设定的图像模板。In addition, the above-mentioned first image may also be a set image template.
可选地,所述利用所述第二图像对原图像进行处理,包括:Optionally, said using the second image to process the original image includes:
将所述第二图像添加到空白图像中的第一区域,得到图像底板,所述第一区域的位置与所述图像子区域在所述原图像中的位置相对应;Adding the second image to the first area in the blank image to obtain an image bottom plate, and the position of the first area corresponds to the position of the image sub-area in the original image;
将所述图像底板与所述原图像进行合成。The image base and the original image are synthesized.
通过空白图像处理后的图像不会发生变化,即通过空白图像处理原图像,处理后的图像仍然为原图像。空白图像可根据需要和图像信息进行设定。举例来说,如果空白图像是以RGB形式表示的24位图图像,可将空白图像的每个像素值都设为(0,0,0),空白图像显示为黑色图像。也可将空白图像的每个像素值都设为(255,255,255),空白图像显示为白色图像。利用该空白图像生成的图像底板,在预设位置处显示水印图像,在除预设位置的其它位置处显示为黑色图像或白色图像。The image processed by the blank image will not change, that is, the original image is processed through the blank image, and the processed image is still the original image. Blank image can be set according to needs and image information. For example, if the blank image is a 24-bit image represented in RGB format, each pixel value of the blank image can be set to (0, 0, 0), and the blank image is displayed as a black image. You can also set each pixel value of the blank image to (255,255,255), and the blank image is displayed as a white image. The image base plate generated by the blank image displays the watermark image at the preset position, and displays the black image or white image at other positions except the preset position.
水印添加过程中,可将第二图像添加到空白图像的第一区域处。在后续的水印识别过程中,再根据上述第一区域,从图像中提取出水印信息。During the watermark adding process, the second image can be added to the first area of the blank image. In the subsequent watermark recognition process, the watermark information is extracted from the image according to the above-mentioned first region.
利用该图像底板处理原图像时,可先生成与原图像尺寸和分辨率都相同的空白图像和图像底板,且该图像底板除预设位置处外的每个像素值都设为(0,0,0),图像底板上的像素值也可设为其它像素值,实现原理相同。以下以图像底板除预设位置处外的每个像素值都设为(0,0,0)进行说明。When processing the original image with this image base, a blank image and image base with the same size and resolution as the original image can be generated first, and each pixel value of the image base except the preset position is set to (0,0 ,0), the pixel value on the image floor can also be set to other pixel values, and the realization principle is the same. In the following description, each pixel value of the image base plate except the preset position is set to (0,0,0).
将原图像与图像底板进行合成,以生成含有水印的图像。具体地,如果图像底板对应位置的像素值为(0,0,0),则处理后的图像在该位置的像素值不变。如果图像底板对应位置的像素值不为(0,0,0),则处理后的图像在该位置的像素值为图像底板上的像素值。该方法可使处理后的图像在预设位置上显示水印信息。The original image is combined with the image base to generate an image with watermark. Specifically, if the pixel value at the corresponding position of the image bottom plate is (0, 0, 0), the pixel value at that position of the processed image remains unchanged. If the pixel value at the corresponding position of the image bottom plate is not (0, 0, 0), the pixel value of the processed image at this position is the pixel value on the image bottom plate. This method enables the processed image to display watermark information at a preset position.
第一区域的位置与图像子区域在所述原图像中的位置相对应。举例来说,假设空白图像的尺寸和分辨率都与原图像相同,则第一区域的位置与图像子区域在所述原图像中的位置相同。从原图像的第一区域的位置提取子图像作为第一图像,将水印添加到第一图像中生成第二图像,再将第二图像添加到空白图像中第一区域,得到图像底板。最后,将图像底板与原图像进行合成。如此,只是在原图像的第一区域处添加了水印,除水印位置的像素点显示水印外,原图像的其它像素点均保持不变。从而减少了处理前后的图像在用户视觉上的差别,提高了用户的体验。The position of the first region corresponds to the position of the image sub-region in the original image. For example, assuming that the size and resolution of the blank image are the same as the original image, the position of the first area is the same as the position of the image sub-areas in the original image. The sub-image is extracted from the position of the first area of the original image as the first image, the watermark is added to the first image to generate a second image, and the second image is added to the first area in the blank image to obtain an image base. Finally, the image base and the original image are synthesized. In this way, only the watermark is added to the first area of the original image. Except for the pixels at the watermark position that display the watermark, the other pixels of the original image remain unchanged. Thereby, the visual difference between the images before and after processing is reduced, and the user experience is improved.
进一步地,可将添加到原图像中的水印尺寸,相对于原图像的尺寸,设置的较小,或将水印添加到原图像的边缘位置。从而使人眼难以察觉,不影响用户的视觉体验。Further, the size of the watermark added to the original image can be set smaller than the size of the original image, or the watermark can be added to the edge position of the original image. This makes it difficult for human eyes to detect and does not affect the user's visual experience.
进一步地,如果水印信息为文字信息,无需存储图像模板。通过图像识别等技术,识别出图片中添加的文字,并将该文字与系统保存的水印信息对应的文字进行比对,即可确定该图像在传输过程中是否被篡改。相比存储水印对应的图像信息,存储水印对应的文字信息,操作更灵活,也能节省系统存储空间。Further, if the watermark information is text information, there is no need to store the image template. Through image recognition and other technologies, the text added in the picture is recognized, and the text is compared with the text corresponding to the watermark information stored in the system to determine whether the image has been tampered with during transmission. Compared with storing the image information corresponding to the watermark, storing the text information corresponding to the watermark is more flexible in operation and can also save system storage space.
本发明实施例提供的上述水印添加方法,将水印信息添加到原图像中,进而可通过提取并分析后续图像中所携带的水印信息,确定图像是否被篡改或破坏。一旦图像被篡改或破坏过,可抛弃该图像,并进行对应的安全排查,从而可以解决目前用户在使用图像的过程中,图像常常被篡改、破坏,而造成网络中各系统无法正常运行的问题。In the above-mentioned watermark adding method provided by the embodiment of the present invention, the watermark information is added to the original image, and then the watermark information carried in the subsequent image can be extracted and analyzed to determine whether the image has been tampered with or damaged. Once the image has been tampered with or destroyed, the image can be discarded and the corresponding security investigation can be carried out. This can solve the problem that the image is often tampered and destroyed during the user's use of the image, which causes the system in the network to fail to operate normally .
此外,由于篡改后的图片很可能还有威胁系统安全的病毒或木马。因此,本发明还可以解决由于图片在传输过程中被篡改,而造成的安全问题。In addition, the tampered pictures may contain viruses or Trojan horses that threaten the security of the system. Therefore, the present invention can also solve the security problem caused by the picture being tampered with during transmission.
参见图3,图3是本发明实施例提供的另一种水印添加方法的流程示意图,在本发明实施例中,所述方法包括:Referring to Fig. 3, Fig. 3 is a schematic flowchart of another watermark adding method provided by an embodiment of the present invention. In the embodiment of the present invention, the method includes:
S301、获取所述原图像的高频区域,所述高频区域位于原图像的第一区域处。S301. Acquire a high-frequency area of the original image, where the high-frequency area is located at a first area of the original image.
高频区域信息为图像中图像的亮度或灰度变化较大的区域信息。低频区域信息为图像中图像的亮度或灰度变化较小的区域信息。高频区域通常对应图像中的边缘区域和噪声区域,而低频区域通常对应图像中的大片色块区域。可通过PCA(principal components analysis,主成分分析)技术或白化操作等技术手段,获取图像的高低频区域信息,在此不再赘述。The high frequency area information is the area information in the image where the brightness or gray level of the image changes greatly. The low-frequency area information is the area information in the image where the brightness or gray level of the image changes little. The high frequency area usually corresponds to the edge area and the noise area in the image, and the low frequency area usually corresponds to the large patch area in the image. The high and low frequency region information of the image can be obtained by PCA (principal components analysis) technology or whitening operation and other technical means, which will not be repeated here.
S302、截取原图像在第一区域处的图像子区域,以生成第一图像。S302. Intercept the image sub-region of the original image at the first region to generate a first image.
S303、基于水印对第一图像进行处理,得到第二图像;S303. Process the first image based on the watermark to obtain a second image.
其中,S303的具体过程可参照图2中S201的描述,此处不再赘述。For the specific process of S303, refer to the description of S201 in FIG. 2, which will not be repeated here.
S304、利用所述第二图像对原图像进行处理,以将所述水印添加到所述原图像的第一区域处。S304. Use the second image to process the original image to add the watermark to the first area of the original image.
其中,S303的具体过程可参照图2中S202的描述,此处不再赘述。For the specific process of S303, refer to the description of S202 in FIG. 2, which will not be repeated here.
本发明实施例提供的上述水印添加方法,可将水印信息添加到原图像的高频区域上。由于高频区域通常对应图像中的边缘区域和噪声区域,而低频区域通常对应图像中的大片色块区域。因此,将水印添加到原图像的高频区域,相对于将水印添加到原图像的低频区域,是将水印添加到人眼的不敏感区域,可较小的影响到用户的视觉效果,不易引起用户的察觉。The above-mentioned watermark adding method provided by the embodiment of the present invention can add watermark information to the high frequency area of the original image. Because the high frequency area usually corresponds to the edge area and the noise area in the image, the low frequency area usually corresponds to the large patch area in the image. Therefore, adding a watermark to the high-frequency area of the original image, compared to adding a watermark to the low-frequency area of the original image, is to add the watermark to the insensitive area of the human eye, which can lessen the user's visual effect and is not easy to cause User perception.
参见图4,图4是本发明实施例提供的又一种水印添加方法的流程示意图,在本发明实施例中,所述方法包括:Referring to Figure 4, Figure 4 is a schematic flowchart of another watermark adding method provided by an embodiment of the present invention. In the embodiment of the present invention, the method includes:
S401、将水印添加到第一图像,得到第三图像。S401: Add a watermark to the first image to obtain a third image.
S402、将所述第一图像与所述第三图像拼接,得到所述第二图像。S402. Splicing the first image and the third image to obtain the second image.
S403、利用所述第二图像对原图像进行处理,以将所述水印添加到所述原图像中。S403. Use the second image to process the original image to add the watermark to the original image.
其中,S403的具体过程可参照图2中S202的描述,此处不再赘述。Among them, the specific process of S403 can refer to the description of S202 in FIG. 2, which will not be repeated here.
待识别图像中含有第一图像和第三图像,其中,第一图像不含有水印,第三图像为添加水印后的第一图像。在识别时,从待识别图像中提取所述第一图像和第三图像,通过比对所述第一图像及第三图像,就可以识别出水印。本发明实施例提供的上述水印添加方法,通过比对所述第一图像及第三图像,就可提取水印信息,相对于需要对整个待识别图像进行分析比对,才能提取出水印,提高了提取水印的速度和效率。The image to be recognized contains a first image and a third image, wherein the first image does not contain a watermark, and the third image is the first image after adding a watermark. During recognition, the first image and the third image are extracted from the image to be recognized, and the watermark can be recognized by comparing the first image and the third image. In the above-mentioned watermark adding method provided by the embodiment of the present invention, the watermark information can be extracted by comparing the first image and the third image. Compared with the need to analyze and compare the entire image to be recognized, the watermark can be extracted, which improves Speed and efficiency of watermark extraction.
参见图5,图5是本发明实施例提供的又一种水印添加方法的流程示意图,在本发明实施例中,所述方法包括:Referring to Fig. 5, Fig. 5 is a schematic flowchart of another watermark adding method provided by an embodiment of the present invention. In the embodiment of the present invention, the method includes:
S501、基于水印对第一图像进行处理,得到第二图像。S501: Process the first image based on the watermark to obtain a second image.
其中,S501的具体过程可参照图2中S201的描述,此处不再赘述。For the specific process of S501, refer to the description of S201 in FIG. 2, which will not be repeated here.
S502、将所述第二图像添加到空白图像的预定位置处,以生成图像底板。S502. Add the second image to a predetermined position of the blank image to generate an image base plate.
预定位置可根据具体需求进行设定。若要将第二图像添加在原图像的第二区域内,则预定位置为原图像的第二区域在空白图像的对应位置。预定位置也可以是空白图像中预先设定的位置。The predetermined location can be set according to specific needs. If the second image is to be added to the second area of the original image, the predetermined position is the corresponding position of the second area of the original image in the blank image. The predetermined position may also be a preset position in the blank image.
S503、将所述图像底板与所述原图像进行合成。S503: Synthesize the image base plate and the original image.
其中,S503的具体过程可参照图2中S202的描述,此处不再赘述。For the specific process of S503, refer to the description of S202 in FIG. 2, which will not be repeated here.
上述实施例提供的水印添加方法,通过图像底板,将水印信息添加到原图像中,进而可通过提取并分析后续图像信息所携带的水印信息,确定图像在传输过程中是否被篡改或破坏。In the watermark adding method provided by the foregoing embodiment, the watermark information is added to the original image through the image backplane, and then the watermark information carried in the subsequent image information can be extracted and analyzed to determine whether the image has been tampered with or destroyed during transmission.
参见图6,图6是本发明实施例提供的一种水印识别方法的流程示意图,在本发明实施例中,所述方法包括:Refer to Fig. 6, which is a schematic flowchart of a watermark recognition method provided by an embodiment of the present invention. In the embodiment of the present invention, the method includes:
S601、获取待识别图像,其中,所述待识别图像基于第二图像对原图像进行处理而生成,所述第二图像基于水印对第一图像进行处理而得到。S601. Acquire an image to be recognized, where the image to be recognized is generated by processing an original image based on a second image, and the second image is obtained by processing the first image based on a watermark.
水印信息为添加入图像文件的数字信息,可以是图像信息,也可以是序列信息,也可以是图像信息和序列信息的组合。序列信息可以是文字信息和数字信息的组合。具体的水印信息可根据具体需要进行设定。Watermark information is digital information added to the image file, which can be image information, sequence information, or a combination of image information and sequence information. The sequence information can be a combination of text information and digital information. The specific watermark information can be set according to specific needs.
上述基于第一图像生成第二图像,基于第二图像对原图像进行处理的具体步骤,详见上述S201及S202中相关表述,此处不再赘述。For the specific steps of generating the second image based on the first image and processing the original image based on the second image, refer to the relevant expressions in S201 and S202 above for details, and will not be repeated here.
S602、识别所述待识别图像中的所述水印。S602. Identify the watermark in the image to be identified.
可通过多种方式获取所述待识别图像中的水印信息,包括但不限于以下方式或其组合:The watermark information in the image to be recognized can be obtained in many ways, including but not limited to the following ways or a combination thereof:
(1)通过系统中保存的预定位置信息,该预定位置信息代表了图像模板在原图像中的添加位置信息。基于该预定位置信息,直接从待识别图像中提取水印信息。(1) Through the predetermined position information saved in the system, the predetermined position information represents the addition position information of the image template in the original image. Based on the predetermined location information, the watermark information is directly extracted from the image to be recognized.
(2)水印信息为文字信息,如公司名、业务名等特定文字、数字或组合。通过图像识别技术,识别待识别图像中是否包含有该文字信息,进而判断该识别图像中是否包含有对应文字内容为的水印。(2) Watermark information is text information, such as company name, business name and other specific words, numbers or combinations. Through image recognition technology, it is recognized whether the image to be recognized contains the text information, and then it is determined whether the recognized image contains a watermark corresponding to the text content.
(3)系统中保存有原图像,通过比对该原图像和该待识别图像,获取待识别图像中的水印信息。(3) The original image is stored in the system, and the watermark information in the image to be recognized is obtained by comparing the original image with the image to be recognized.
S603、基于所述水印信息,确定所述待识别图像是否为被篡改图像。S603: Based on the watermark information, determine whether the image to be recognized is a tampered image.
在水印信息为文字信息的情况下,无需存储第二图像,只需存储该水印信息对应的文字信息。通过图像识别等技术,识别出水印中包含的文字,并将该文字与系统保存的水印信息对应的文字进行比对,即可确定该图像在传输过程中是否被篡改。When the watermark information is text information, there is no need to store the second image, and only the text information corresponding to the watermark information is stored. Through image recognition and other technologies, the text contained in the watermark is recognized, and the text is compared with the text corresponding to the watermark information stored in the system to determine whether the image has been tampered with during transmission.
在水印信息为图像信息的情况下,提取待识别图像中的水印信息,并通过与系统中存储的水印信息进行分析比对,即可确定该图像在传输过程中是否被篡改。When the watermark information is image information, extract the watermark information in the image to be recognized, and analyze and compare it with the watermark information stored in the system to determine whether the image has been tampered with during transmission.
基于水印信息,确定待识别图像是否为被篡改图像的方式包括但并不仅限于上述实现方式,所有可实现确定待识别图像是否为被篡改图像的方式都在本发明的保护范围之内。Based on the watermark information, the method for determining whether the image to be identified is a tampered image includes, but is not limited to, the above-mentioned implementation methods. All methods that can be implemented to determine whether the image to be identified is a tampered image are within the protection scope of the present invention.
本发明实施例提供的上述水印识别方法,通过提取并分析后续图像信息所携带的水印信息,确定图像在传输过程中是否被篡改或破坏。一旦图像被篡改或破坏过,可抛弃该图像,并进行对应的安全排查,从而可以解决目前图像在传输过程中常常被篡改、破坏,而造成网络中各系统无法正常运行的问题。The above-mentioned watermark recognition method provided by the embodiment of the present invention extracts and analyzes the watermark information carried by subsequent image information to determine whether the image has been tampered with or destroyed during transmission. Once the image has been tampered with or destroyed, the image can be discarded and the corresponding security investigations can be performed. This can solve the problem that the image is often tampered and destroyed during the transmission process, which causes the system in the network to fail to operate normally.
参见图7,图7是本发明实施例提供的另一种水印识别方法的流程示意图,在本发明实施例中,所述方法包括:Refer to Figure 7, which is a schematic flowchart of another watermark recognition method provided by an embodiment of the present invention. In the embodiment of the present invention, the method includes:
S701、将所述水印添加到所述第一图像,得到第三图像。S701. Add the watermark to the first image to obtain a third image.
其中,S701的具体过程可参照图4中S401的描述,此处不再赘述。For the specific process of S701, refer to the description of S401 in FIG. 4, which is not repeated here.
S702、将所述第一图像与所述第三图像拼接,得到第二图像。S702. Splicing the first image and the third image to obtain a second image.
其中,S702的具体过程可参照图4中S402的描述,此处不再赘述。For the specific process of S702, refer to the description of S402 in FIG. 4, which is not repeated here.
S703、基于第二图像对原图像进行处理,以生成处理后的图像。S703: Process the original image based on the second image to generate a processed image.
可选地,所述待识别图像基于第二图像对原图像进行处理而生成,包括:Optionally, the image to be recognized is generated by processing the original image based on the second image, including:
将所述第二图像添加到空白图像中的第一区域,得到图像底板;Adding the second image to the first area in the blank image to obtain an image base plate;
将所述图像底板与所述原图像进行合成。The image base and the original image are synthesized.
其中,S703的具体过程可参照图4中S403的描述,此处不再赘述。For the specific process of S703, refer to the description of S403 in FIG. 4, which is not repeated here.
S704、获取待识别图像,所述待识别图像对应于所述处理后的图像。S704. Acquire an image to be recognized, where the image to be recognized corresponds to the processed image.
举例来说,在进行教育平台推广时,在线教育平台需要先向参与者发送推广图像,参与者进行推广后,会将基于推广图像的转发图像发送给在线教育平台,转发图像可以为微信截图(如朋友圈截图、微信群截图等)、微博截图或浏览器截图等。上述转发图像为待识别图像,上述推广图像为处理后的图像,转发图像与推广图像相对应。For example, when promoting an education platform, an online education platform needs to first send a promotion image to the participants. After the participant promotes, the forwarded image based on the promotion image will be sent to the online education platform. The forwarded image can be a screenshot of WeChat ( Such as Moments screenshots, WeChat group screenshots, etc.), Weibo screenshots or browser screenshots, etc. The forwarded image is an image to be recognized, the promotion image is a processed image, and the forwarded image corresponds to the promotion image.
再如,在线教育平台先向学员发送学习任务相关的任务图像,学员完成学习后,向平台发送基于任务图像生成的进度图像,进度图像为已完成预定学习任务量的图像。上述进度图像为待识别图像,上述任务图像为处理后的图像,进度图像与任务图像相对应。For another example, the online education platform first sends task images related to the learning task to the students. After the students complete the learning, they send a progress image generated based on the task image to the platform. The progress image is an image that has completed a predetermined amount of learning tasks. The above progress image is an image to be recognized, the above task image is a processed image, and the progress image corresponds to the task image.
S705、提取所述所述待识别图像中的第一图像和第三图像。S705: Extract the first image and the third image in the image to be recognized.
如果在待识别图像中提取不到第一图像和第三图像,则说明待识别图像为被篡改图像。如果在待识别图像中可以提取到第一图像和第三图像,则执行步骤S706。If the first image and the third image cannot be extracted from the image to be recognized, the image to be recognized is a tampered image. If the first image and the third image can be extracted from the image to be recognized, step S706 is executed.
可选地,所述提取所述第一图像和第三图像,包括:Optionally, the extracting the first image and the third image includes:
确定所述待识别图像中与所述第一区域的位置相对应的子区域;Determining a sub-region corresponding to the position of the first region in the image to be recognized;
从所述子区域提取所述第一图像和第三图像。The first image and the third image are extracted from the sub-region.
S706、比对所述第一图像及第三图像,以提取所述水印。S706. Compare the first image and the third image to extract the watermark.
S707、基于S706中提取的水印,确定所述待识别图像是否为被篡改图像。S707: Determine whether the image to be recognized is a tampered image based on the watermark extracted in S706.
如果S706中提取的水印符合预设规则,则所述待识别图像为合法图像。预设规则可根据实际需求进行设定,比如:提取的水印为图像,如该图像与系统中保存的水印图像一致,则所述待识别图像为合法图像。如提取的水印中包含的文字信息,该文字信息符合预设的文字信息,如公司名、业务名、课程名等,则所述待识别图像为合法图像。如提取的水印 为二维码水印,该二维码水印符合系统中预存的二维码水印信息,则所述待识别图像为合法图像。If the watermark extracted in S706 meets the preset rule, the image to be recognized is a legal image. The preset rules can be set according to actual needs. For example, the extracted watermark is an image. If the image is consistent with the watermark image stored in the system, the image to be recognized is a legal image. If the text information contained in the extracted watermark matches the preset text information, such as company name, business name, course name, etc., the image to be recognized is a legal image. If the extracted watermark is a two-dimensional code watermark, and the two-dimensional code watermark conforms to the two-dimensional code watermark information pre-stored in the system, the image to be recognized is a legal image.
本发明实施例提供的上述水印识别方法,通过比对第一图像及第三图像,就可提取水印信息,相对于需要对整个待识别图像进行分析处理,才能提取到水印信息,提高了提取水印的速度和效率。In the above-mentioned watermark recognition method provided by the embodiment of the present invention, the watermark information can be extracted by comparing the first image and the third image. Compared with the need to analyze and process the entire image to be recognized, the watermark information can be extracted, which improves the extraction of watermark information. Speed and efficiency.
图8A是本发明某个或某些实施例提供的原图像的示意图,该原图像为一幅宣传海报。图8B是本发明某个或某些实施例提供的包含水印信息的图像模板的示意图,该水印信息包括了文字信息“VIPKID”,水印信息也可根据版权信息、业务信息及用户信息进行设定。图8C是本发明某个或某些实施例提供的利用图3所示的水印添加方法处理后的图像的示意图。在某个或某些实施例中,本发明实施例中图3所示的水印添加方法,将水印信息添加到原图像的高频区域上。由于高频区域通常对应图像中的边缘区域和噪声区域,而低频区域通常对应图像中的大片色块区域。因此,将水印添加到原图像的高频区域,相对于将水印添加到原图像的低频区域,是将水印添加到人眼的不敏感区域,可较小的影响到用户的视觉效果,不易引起用户的察觉。通过比对图8A和图8C中的原始图片和处理后的图像可以看出,人眼很难察觉两者间的差别。FIG. 8A is a schematic diagram of an original image provided by one or some embodiments of the present invention, and the original image is a promotional poster. Figure 8B is a schematic diagram of an image template containing watermark information provided by one or some embodiments of the present invention. The watermark information includes text information "VIPKID". The watermark information can also be set based on copyright information, service information, and user information . FIG. 8C is a schematic diagram of an image processed by the watermark adding method shown in FIG. 3 provided by one or some embodiments of the present invention. In one or some embodiments, the watermark adding method shown in FIG. 3 in the embodiment of the present invention adds watermark information to the high-frequency area of the original image. Because the high frequency area usually corresponds to the edge area and the noise area in the image, the low frequency area usually corresponds to the large patch area in the image. Therefore, adding a watermark to the high-frequency area of the original image, compared to adding a watermark to the low-frequency area of the original image, is to add the watermark to the insensitive area of the human eye, which can lessen the user's visual effect and is not easy to cause User perception. By comparing the original pictures and processed images in Figs. 8A and 8C, it can be seen that it is difficult for human eyes to perceive the difference between the two.
上述图2~图5详细阐述了本申请实施例的水印添加方法。The foregoing Figures 2 to 5 illustrate in detail the watermark adding method of the embodiment of the present application.
请参见图9,图9是本发明实施例提供的一种水印添加装置的结构示意图,简称装置9,该装置9可以包括:Please refer to Figure 9. Figure 9 is a schematic structural diagram of a watermark adding device provided by an embodiment of the present invention, referred to as device 9. The device 9 may include:
取得单元901,用于基于水印对第一图像进行处理,得到第二图像;The obtaining unit 901 is configured to process the first image based on the watermark to obtain the second image;
添加单元902,用于利用所述第二图像对原图像进行处理,以将所述水印添加到所述原图像中。The adding unit 902 is configured to process the original image by using the second image to add the watermark to the original image.
可选地,所述第一图像基于所述原图像的图像子区域生成。Optionally, the first image is generated based on image sub-regions of the original image.
可选地,所述添加单元902,具体用于将所述第二图像添加到空白图像中的第一区域,得到图像底板,所述第一区域的位置与所述图像子区域在所述原图像中的位置相对应;Optionally, the adding unit 902 is specifically configured to add the second image to the first area in the blank image to obtain an image base plate, and the position of the first area and the image sub-area are in the original The position in the image corresponds;
将所述图像底板与所述原图像进行合成。The image base and the original image are synthesized.
可选地,所述图像子区域为高频区域。Optionally, the image sub-region is a high-frequency region.
可选地,所述取得单元901,具体用于:Optionally, the obtaining unit 901 is specifically configured to:
将所述水印添加到所述第一图像,得到第三图像;Adding the watermark to the first image to obtain a third image;
将所述第一图像与所述第三图像拼接,得到所述第二图像。Stitching the first image and the third image to obtain the second image.
可选地,所述水印基于配置信息生成,所述配置信息包括如下至少之一:原图像的内容信息、业务信息、用户信息。Optionally, the watermark is generated based on configuration information, and the configuration information includes at least one of the following: content information of the original image, service information, and user information.
上述图6、7详细阐述了本申请实施例的水印识别方法。The above-mentioned Figures 6 and 7 illustrate in detail the watermark recognition method of the embodiment of this application.
请参见图10,图10是本发明实施例提供的一种水印识别装置的结构示意图,简称装置10,该装置10可以包括:Please refer to Fig. 10. Fig. 10 is a schematic structural diagram of a watermark recognition device provided by an embodiment of the present invention, referred to as device 10, and the device 10 may include:
获取单元1001,用于获取待识别图像,其中,所述待识别图像基于第二图像对原图像进行处理而生成,所述第二图像基于水印对第一图像进行处理而得到;The obtaining unit 1001 is configured to obtain an image to be recognized, wherein the image to be recognized is generated by processing an original image based on a second image, and the second image is obtained by processing the first image based on a watermark;
识别单元1002,用于识别所述待识别图像中的所述水印;The recognition unit 1002 is configured to recognize the watermark in the image to be recognized;
确定单元1003,用于基于所述水印,确定所述待识别图像是否为被篡改图像。The determining unit 1003 is configured to determine whether the image to be recognized is a tampered image based on the watermark.
可选地,所述装置还包括生成单元1004,用于将所述水印添加到所述第一图像,得到第三图像;Optionally, the device further includes a generating unit 1004, configured to add the watermark to the first image to obtain a third image;
将所述第一图像与所述第三图像拼接,得到所述第二图像。Stitching the first image and the third image to obtain the second image.
可选地,所述识别单元1002具体用于:提取所述第一图像和第三图像,通过比对所述第一图像及第三图像,以识别所述水印。Optionally, the identification unit 1002 is specifically configured to: extract the first image and the third image, and compare the first image and the third image to identify the watermark.
可选地,所述生成单元1004还用于:Optionally, the generating unit 1004 is further configured to:
将所述第二图像添加到空白图像中的第一区域,得到图像底板;Adding the second image to the first area in the blank image to obtain an image base plate;
将所述图像底板与所述原图像进行合成。The image base and the original image are synthesized.
可选地,所述识别单元1002还用于:确定所述待识别图像中与所述第一区域的位置相对应的子区域;Optionally, the recognition unit 1002 is further configured to determine a sub-region corresponding to the position of the first region in the image to be recognized;
从所述子区域提取所述第一图像和第三图像。The first image and the third image are extracted from the sub-region.
本领域的技术人员可以清楚地了解到本发明实施例的技术方案可借助软件和/或硬件来实现。本说明书中的“单元”和“模块”是指能够独立完成或与其他部件配合完成特定功能的软件和/或硬件,其中硬件例如可以是FPGA(Field-Programmable Gate Array,现场可编程门阵列)、IC(Integrated Circuit,集成电路)等。Those skilled in the art can clearly understand that the technical solutions of the embodiments of the present invention can be implemented by software and/or hardware. The "unit" and "module" in this specification refer to software and/or hardware that can independently complete or cooperate with other components to complete specific functions. The hardware may be FPGA (Field-Programmable Gate Array), for example. , IC (Integrated Circuit, integrated circuit), etc.
本发明实施例的各处理单元和/或模块,可通过实现本发明实施例所述的功能的模拟电路而实现,也可以通过执行本发明实施例所述的功能的软件而实现。The processing units and/or modules in the embodiments of the present invention may be implemented by analog circuits that implement the functions described in the embodiments of the present invention, or may be implemented by software that implements the functions described in the embodiments of the present invention.
本发明实施例还提供了一种计算机可读存储介质,其上存储有计算机程序,该程序被处理器执行时实现上述图像处理方法的步骤。其中,计算机可读存储介质可以包括但不限于任何类型的盘,包括软盘、光盘、DVD、CD-ROM、微型驱动器以及磁光盘、ROM、RAM、EPROM、EEPROM、DRAM、VRAM、闪速存储器设备、磁卡或光卡、纳米系统(包括分子存储器IC),或适合于存储指令和/或数据的任何类型的媒介或设备。The embodiment of the present invention also provides a computer-readable storage medium on which a computer program is stored, and when the program is executed by a processor, the steps of the above-mentioned image processing method are realized. The computer-readable storage medium may include, but is not limited to, any type of disk, including floppy disks, optical disks, DVDs, CD-ROMs, micro drives, and magneto-optical disks, ROM, RAM, EPROM, EEPROM, DRAM, VRAM, flash memory devices , Magnetic or optical cards, nanosystems (including molecular memory ICs), or any type of media or equipment suitable for storing instructions and/or data.
参见图11,其示出了本发明实施例所涉及的一种电子设备的结构示意图,该电子设备可以用于实施上述实施例中提供的水印添加方法或水印识别方法。具体来讲:Refer to FIG. 11, which shows a schematic structural diagram of an electronic device related to an embodiment of the present invention. The electronic device can be used to implement the watermark adding method or the watermark identifying method provided in the foregoing embodiment. Specifically:
存储器1120可用于存储软件程序以及模块,处理器1180通过运行存储在存储器1120的软件程序以及模块,从而执行各种功能应用以及数据处理。存储器1120可主要包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需的应用程序(比如声音播放功能、图像播放功能等)等;存储数据区可存储根据终端设备的使用所创建的数据(比如音频数据、电话本等)等。此外,存储器1120可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件、闪存器件、或其他易失性固态存储器件。相应地,存储器1120还可以包括存储器控制器,以提供处理器1180和输入单元1130对存储器1120的访问。The memory 1120 may be used to store software programs and modules. The processor 1180 executes various functional applications and data processing by running the software programs and modules stored in the memory 1120. The memory 1120 may mainly include a program storage area and a data storage area. The program storage area may store an operating system, an application program required by at least one function (such as a sound playback function, an image playback function, etc.), etc.; The data (such as audio data, phone book, etc.) created by the use of the terminal device, etc. In addition, the memory 1120 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, or other volatile solid-state storage devices. Correspondingly, the memory 1120 may further include a memory controller to provide the processor 1180 and the input unit 1130 to access the memory 1120.
输入单元1130可用于接收输入的数字或字符信息,以及产生与用户设置以及功能控制有关的键盘、鼠标、操作杆、光学或者轨迹球信号输入。具体地,输入单元1130可包括触 敏表面1131(例如:触摸屏、触摸板或触摸框)。触敏表面1131,也称为触摸显示屏或者触控板,可收集用户在其上或附近的触摸操作(比如用户使用手指、触笔等任何适合的物体或附件在触敏表面1131上或在触敏表面1131附近的操作),并根据预先设定的程式驱动相应的连接装置。可选的,触敏表面1131可包括触摸检测装置和触摸控制器两个部分。其中,触摸检测装置检测用户的触摸方位,并检测触摸操作带来的信号,将信号传送给触摸控制器;触摸控制器从触摸检测装置上接收触摸信息,并将它转换成触点坐标,再送给处理器1180,并能接收处理器1180发来的命令并加以执行。此外,可以采用电阻式、电容式、红外线以及表面声波等多种类型实现触敏表面1131。The input unit 1130 may be used to receive inputted digital or character information, and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control. Specifically, the input unit 1130 may include a touch-sensitive surface 1131 (for example, a touch screen, a touch pad, or a touch frame). The touch-sensitive surface 1131, also called a touch screen or a touch pad, can collect user touch operations on or near it (for example, the user uses any suitable objects or accessories such as fingers, stylus, etc.) on or on the touch-sensitive surface 1131. Touch-sensitive surface 1131), and drive the corresponding connection device according to the preset program. Optionally, the touch-sensitive surface 1131 may include two parts: a touch detection device and a touch controller. Among them, the touch detection device detects the user's touch position, detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into contact coordinates, and then sends it To the processor 1180, and can receive and execute the commands sent by the processor 1180. In addition, the touch-sensitive surface 1131 can be realized by multiple types such as resistive, capacitive, infrared, and surface acoustic wave.
显示单元1140可用于显示由用户输入的信息或提供给用户的信息以及终端设备的各种图形用户接口,这些图形用户接口可以由图形、文本、图标、视频和其任意组合来构成。显示单元1140可包括显示面板1141,可选的,可以采用LCD(Liquid Crystal Display,液晶显示器)、OLED(Organic Light-Emitting Diode,有机发光二极管)等形式来配置显示面板1141。进一步的,触敏表面1131可覆盖显示面板1141,当触敏表面1131检测到在其上或附近的触摸操作后,传送给处理器1180以确定触摸事件的类型,随后处理器1180根据触摸事件的类型在显示面板1141上提供相应的视觉输出。虽然在图11中,触敏表面1131与显示面板1141是作为两个独立的部件来实现输入和输入功能,但是在某些实施例中,可以将触敏表面1131与显示面板1141集成而实现输入和输出功能。The display unit 1140 may be used to display information input by the user or information provided to the user and various graphical user interfaces of the terminal device. These graphical user interfaces may be composed of graphics, text, icons, videos, and any combination thereof. The display unit 1140 may include a display panel 1141. Optionally, the display panel 1141 may be configured in the form of LCD (Liquid Crystal Display), OLED (Organic Light-Emitting Diode), etc. Further, the touch-sensitive surface 1131 can cover the display panel 1141. When the touch-sensitive surface 1131 detects a touch operation on or near it, it is transmitted to the processor 1180 to determine the type of the touch event, and then the processor 1180 determines the type of the touch event. Type provides corresponding visual output on the display panel 1141. Although in FIG. 11, the touch-sensitive surface 1131 and the display panel 1141 are used as two independent components to implement input and input functions, in some embodiments, the touch-sensitive surface 1131 and the display panel 1141 can be integrated to implement input And output function.
处理器1180是终端设备的控制中心,利用各种接口和线路连接整个终端设备的各个部分,通过运行或执行存储在存储器1120内的软件程序和/或模块,以及调用存储在存储器1120内的数据,执行终端设备的各种功能和处理数据,从而对终端设备进行整体监控。可选的,处理器1180可包括一个或多个处理核心;其中,处理器1180可集成应用处理器和调制解调处理器,其中,应用处理器主要处理操作系统、用户界面和应用程序等,调制解调处理器主要处理无线通信。可以理解的是,上述调制解调处理器也可以不集成到处理器1180中。The processor 1180 is the control center of the terminal device. It uses various interfaces and lines to connect the various parts of the entire terminal device, runs or executes the software programs and/or modules stored in the memory 1120, and calls data stored in the memory 1120. , Perform various functions of the terminal equipment and process data, so as to monitor the terminal equipment as a whole. Optionally, the processor 1180 may include one or more processing cores; among them, the processor 1180 may integrate an application processor and a modem processor, where the application processor mainly processes an operating system, a user interface, and application programs, etc. The modem processor mainly deals with wireless communication. It can be understood that the foregoing modem processor may not be integrated into the processor 1180.
具体在本实施例中,终端设备的显示单元是触摸屏显示器,终端设备还包括有存储器,以及一个或者一个以上的程序,其中一个或者一个以上程序存储于存储器中,且经配置以由一个或者一个以上处理器执行述一个或者一个以上程序包含实现上述水印添加方法和/或水印识别方法的步骤。Specifically, in this embodiment, the display unit of the terminal device is a touch screen display, and the terminal device also includes a memory and one or more programs. One or more programs are stored in the memory and configured to be configured by one or more programs. The execution of the one or more programs by the above processor includes the steps of implementing the above watermark adding method and/or watermark identifying method.
在本申请所提供的几个实施例中,应该理解到,所揭露的装置和方法,可以通过其它的方式实现。以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,如:多个单元或组件可以结合,或可以集成到另一个系统,或一些特征可以忽略,或不执行。另外,所显示或讨论的各组成部分相互之间的耦合、或直接耦合、或通信连接可以是通过一些接口,设备或单元的间接耦合或通信连接,可以是电性的、机械的或其它形式的。In the several embodiments provided in this application, it should be understood that the disclosed device and method may be implemented in other ways. The device embodiments described above are merely illustrative. For example, the division of the units is only a logical function division, and there may be other divisions in actual implementation, such as: multiple units or components can be combined, or It can be integrated into another system, or some features can be ignored or not implemented. In addition, the coupling, or direct coupling, or communication connection between the components shown or discussed may be indirect coupling or communication connection through some interfaces, devices or units, and may be electrical, mechanical or other forms of.
在本发明各实施例中的各功能单元可以全部集成在一个处理单元中,也可以是各单元分别单独作为一个单元,也可以两个或两个以上单元集成在一个单元中;上述集成的单元既可以采用硬件的形式实现,也可以采用硬件加软件功能单元的形式实现。The functional units in the embodiments of the present invention can be all integrated into one processing unit, or each unit can be individually used as a unit, or two or more units can be integrated into one unit; the above-mentioned integrated unit It can be implemented in the form of hardware or in the form of hardware plus software functional units.
以上介绍仅为本发明的优选实施例而已,并不用于限制本发明,对于本领域的技术人员来说,本发明可以有各种更改和变化。凡在本发明的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。The above descriptions are only preferred embodiments of the present invention and are not intended to limit the present invention. For those skilled in the art, the present invention can have various modifications and changes. Any modification, equivalent replacement, improvement, etc., made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (15)

  1. 一种水印添加方法,其特征在于,所述方法包括:A watermark adding method, characterized in that the method includes:
    基于水印对第一图像进行处理,得到第二图像;Processing the first image based on the watermark to obtain the second image;
    利用所述第二图像对原图像进行处理,以将所述水印添加到所述原图像中。The original image is processed by using the second image to add the watermark to the original image.
  2. 根据权利要求1所述的方法,其特征在于,所述第一图像基于所述原图像的图像子区域生成。The method according to claim 1, wherein the first image is generated based on image sub-regions of the original image.
  3. 根据权利要求2所述的方法,其特征在于,所述利用所述第二图像对原图像进行处理,包括:The method according to claim 2, wherein the processing the original image by using the second image comprises:
    将所述第二图像添加到空白图像中的第一区域,得到图像底板,所述第一区域的位置与所述图像子区域在所述原图像中的位置相对应;Adding the second image to the first area in the blank image to obtain an image bottom plate, and the position of the first area corresponds to the position of the image sub-area in the original image;
    将所述图像底板与所述原图像进行合成。The image base and the original image are synthesized.
  4. 根据权利要求2所述的方法,其特征在于,所述图像子区域为高频区域。The method according to claim 2, wherein the image sub-region is a high-frequency region.
  5. 根据权利要求1-4任一所述的方法,其特征在于,所述基于水印对第一图像进行处理,得到第二图像,包括:The method according to any one of claims 1-4, wherein the processing the first image based on the watermark to obtain the second image comprises:
    将所述水印添加到所述第一图像,得到第三图像;Adding the watermark to the first image to obtain a third image;
    将所述第一图像与所述第三图像拼接,得到所述第二图像。Stitching the first image and the third image to obtain the second image.
  6. 根据权利要求1-4任一所述的方法,其特征在于,所述水印基于配置信息生成,所述配置信息包括如下至少之一:原图像的内容信息、业务信息、用户信息。The method according to any one of claims 1 to 4, wherein the watermark is generated based on configuration information, and the configuration information includes at least one of the following: content information of the original image, service information, and user information.
  7. 一种水印识别方法,其特征在于,所述方法包括:A watermark recognition method, characterized in that the method includes:
    获取待识别图像,其中,所述待识别图像基于第二图像对原图像进行处理而生成,所述第二图像基于水印对第一图像进行处理而得到;Acquiring an image to be recognized, wherein the image to be recognized is generated by processing an original image based on a second image, and the second image is obtained by processing the first image based on a watermark;
    识别所述待识别图像中的所述水印;Identifying the watermark in the image to be identified;
    基于所述水印,确定所述待识别图像是否为被篡改图像。Based on the watermark, it is determined whether the image to be recognized is a tampered image.
  8. 根据权利要求7所述的方法,其特征在于,所述第二图像基于水印对第一图像进行处理而得到,包括:8. The method according to claim 7, wherein the second image is obtained by processing the first image based on the watermark, comprising:
    将所述水印添加到所述第一图像,得到第三图像;Adding the watermark to the first image to obtain a third image;
    将所述第一图像与所述第三图像拼接,得到所述第二图像。Stitching the first image and the third image to obtain the second image.
  9. 根据权利要求87所述的方法,其特征在于,所述识别所述待识别图像中的所述水印,包括:提取所述第二图像,基于所述第二图像第一图像和第三图像,通过比对所述第 一图像及第三图像,以识别所述水印。The method according to claim 87, wherein the identifying the watermark in the image to be identified comprises: extracting the second image based on the first image and the third image of the second image, The first image and the third image are compared to identify the watermark.
  10. 根据权利要求9所述的方法,其特征在于,所述待识别图像基于第二图像对原图像进行处理而生成,包括:The method according to claim 9, wherein the image to be recognized is generated by processing the original image based on the second image, comprising:
    将所述第二图像添加到空白图像中的第一区域,得到图像底板;Adding the second image to the first area in the blank image to obtain an image base plate;
    将所述图像底板与所述原图像进行合成。The image base and the original image are synthesized.
  11. 根据权利要求10所述的方法,其特征在于,所述提取所述第一图像和第三图像,包括:The method according to claim 10, wherein said extracting said first image and said third image comprises:
    确定所述待识别图像中与所述第一区域的位置相对应的子区域;Determining a sub-region corresponding to the position of the first region in the image to be recognized;
    从所述子区域提取所述第一图像和第三图像。The first image and the third image are extracted from the sub-region.
  12. 一种水印添加装置,其特征在于,所述装置包括:A watermark adding device, characterized in that the device comprises:
    取得单元,用于基于水印对第一图像进行处理,得到第二图像;An obtaining unit, configured to process the first image based on the watermark to obtain the second image;
    添加单元,用于利用所述第二图像对原图像进行处理,以将所述水印添加到所述原图像中。The adding unit is configured to use the second image to process the original image to add the watermark to the original image.
  13. 一种水印识别装置,其特征在于,所述装置包括:A watermark recognition device, characterized in that the device includes:
    获取单元,用于获取待识别图像,其中,所述待识别图像基于第二图像对原图像进行处理而生成,所述第二图像基于水印对第一图像进行处理而得到;An acquiring unit, configured to acquire an image to be identified, wherein the image to be identified is generated by processing an original image based on a second image, and the second image is obtained by processing the first image based on a watermark;
    识别单元,用于识别所述待识别图像中的所述水印;An identification unit for identifying the watermark in the image to be identified;
    确定单元,用于基于所述水印,确定所述待识别图像是否为被篡改图像。The determining unit is configured to determine whether the image to be recognized is a tampered image based on the watermark.
  14. 一种计算机可读存储介质,其上存储有计算机程序,其特征在于,该程序被处理器执行时实现所述权利要求1-11中任一项所述方法的步骤。A computer-readable storage medium having a computer program stored thereon, characterized in that the program implements the steps of the method in any one of claims 1-11 when the program is executed by a processor.
  15. 一种电子设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,其特征在于,所述处理器执行所述程序时实现所述权利要求1-11中任一项所述方法的步骤。An electronic device, comprising a memory, a processor, and a computer program stored on the memory and running on the processor, wherein the processor implements any one of claims 1-11 when the program is executed The steps of the method described in item.
PCT/CN2020/105682 2019-08-02 2020-07-30 Watermark adding method and apparatus, watermark recognition method and apparatus, and electronic device WO2021023085A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910710585.9A CN110634095B (en) 2019-08-02 2019-08-02 Watermark adding method, watermark identifying device and electronic equipment
CN201910710585.9 2019-08-02

Publications (1)

Publication Number Publication Date
WO2021023085A1 true WO2021023085A1 (en) 2021-02-11

Family

ID=68969159

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/105682 WO2021023085A1 (en) 2019-08-02 2020-07-30 Watermark adding method and apparatus, watermark recognition method and apparatus, and electronic device

Country Status (2)

Country Link
CN (1) CN110634095B (en)
WO (1) WO2021023085A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116542840A (en) * 2023-07-06 2023-08-04 云南日报报业集团 Robust watermarking method based on news text image

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110634095B (en) * 2019-08-02 2023-08-08 北京大米科技有限公司 Watermark adding method, watermark identifying device and electronic equipment
CN112399250A (en) * 2020-11-20 2021-02-23 广州欢网科技有限责任公司 Movie and television program poster generation method and device based on image recognition

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106408497A (en) * 2016-08-31 2017-02-15 南京师范大学 Strong-robustness watermark embedding and extraction method for original remote sensing images
US20170161862A1 (en) * 2015-12-04 2017-06-08 Le Holdings(Beijing)Co., Ltd. Method and electronic device for adding watermark to video
CN109447888A (en) * 2018-10-26 2019-03-08 龙口味美思环保科技有限公司 A kind of watermark handling method of food packaging false-proof digital image
CN109829843A (en) * 2018-12-27 2019-05-31 北京奇安信科技有限公司 A kind of image blind watermarking processing method and processing device improving robustness and encoding amount
CN109840875A (en) * 2019-03-06 2019-06-04 深圳市金天速科技有限公司 A kind of anti-counterfei waterprint generation method, device, electronic equipment and storage medium
CN110634095A (en) * 2019-08-02 2019-12-31 北京大米科技有限公司 Watermark adding method, watermark identifying method, watermark adding device, watermark identifying device and electronic equipment

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2010091208A1 (en) * 2009-02-04 2010-08-12 William Charles Fisher Digital watermarking system and method
CN103971323B (en) * 2014-05-22 2017-02-15 复旦大学 Digital watermark steganography method based on scrambling transformation and morphological component analysis
CN105023237A (en) * 2015-07-17 2015-11-04 上海理工大学 Method for improving concealment performance of image digital watermarks
CN107392832A (en) * 2017-06-30 2017-11-24 广东欧珀移动通信有限公司 Image processing method and related product
CN107464206A (en) * 2017-07-26 2017-12-12 维沃移动通信有限公司 A kind of watermark adding method and mobile terminal
CN108648132B (en) * 2018-04-16 2020-08-14 深圳市联软科技股份有限公司 Method, system, terminal and medium for generating watermark according to image
CN108959509A (en) * 2018-06-27 2018-12-07 中国建设银行股份有限公司 Webpage watermark processing method, device and electronic equipment
CN109146760B (en) * 2018-07-25 2021-05-14 腾讯科技(深圳)有限公司 Watermark generation method, device, terminal and storage medium
CN109767376A (en) * 2018-12-13 2019-05-17 平安科技(深圳)有限公司 Image authentication method, device, computer equipment and storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170161862A1 (en) * 2015-12-04 2017-06-08 Le Holdings(Beijing)Co., Ltd. Method and electronic device for adding watermark to video
CN106408497A (en) * 2016-08-31 2017-02-15 南京师范大学 Strong-robustness watermark embedding and extraction method for original remote sensing images
CN109447888A (en) * 2018-10-26 2019-03-08 龙口味美思环保科技有限公司 A kind of watermark handling method of food packaging false-proof digital image
CN109829843A (en) * 2018-12-27 2019-05-31 北京奇安信科技有限公司 A kind of image blind watermarking processing method and processing device improving robustness and encoding amount
CN109840875A (en) * 2019-03-06 2019-06-04 深圳市金天速科技有限公司 A kind of anti-counterfei waterprint generation method, device, electronic equipment and storage medium
CN110634095A (en) * 2019-08-02 2019-12-31 北京大米科技有限公司 Watermark adding method, watermark identifying method, watermark adding device, watermark identifying device and electronic equipment

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116542840A (en) * 2023-07-06 2023-08-04 云南日报报业集团 Robust watermarking method based on news text image
CN116542840B (en) * 2023-07-06 2023-09-22 云南日报报业集团 Robust watermarking method based on news text image

Also Published As

Publication number Publication date
CN110634095A (en) 2019-12-31
CN110634095B (en) 2023-08-08

Similar Documents

Publication Publication Date Title
US10572779B2 (en) Electronic information board apparatus, information processing method, and computer program product
WO2021023085A1 (en) Watermark adding method and apparatus, watermark recognition method and apparatus, and electronic device
US11704764B2 (en) Method and system for generating watermark on the basis of graphic, terminal, and medium
US10013408B2 (en) Information processing apparatus, information processing method, and computer readable medium
US20210216336A1 (en) Method of Remote Access
WO2020029466A1 (en) Image processing method and apparatus
CN108427589B (en) Data processing method and electronic equipment
US9658990B2 (en) Reordering text from unstructured sources to intended reading flow
US11829667B2 (en) Creation of component templates and removal of dead content therefrom
US11144276B2 (en) Communication terminal, management system, communication system, and display method
CN111290722A (en) Screen sharing method, device and system, electronic equipment and storage medium
US20160269586A1 (en) System, control method, and recording medium
WO2021018229A1 (en) Image processing method and apparatus, and electronic device
JP2014171121A (en) Projection system, projection apparatus, projection method, and projection program
CN111062377B (en) Question number detection method, system, storage medium and electronic equipment
JP6553217B1 (en) Data input device, data input program and data input system
CN111290721A (en) Online interaction control method, system, electronic device and storage medium
US20190095637A1 (en) Information processing apparatus and non-transitory computer readable medium storing information processing program
US11526652B1 (en) Automated optimization of displayed electronic content imagery
US11030473B2 (en) Information processing apparatus and non-transitory computer readable medium storing information processing program
JP2019016379A (en) Data input device and data input program
JP6734445B2 (en) Data input device, data input method, and data input program
JP2018136709A (en) Data input device, data input program and data input system
JP2018128850A (en) Information processing program, information processing method, and information processing device
CN112579991A (en) Page data protection method, device, equipment and medium

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20850025

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20850025

Country of ref document: EP

Kind code of ref document: A1

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 19.08.2022)

122 Ep: pct application non-entry in european phase

Ref document number: 20850025

Country of ref document: EP

Kind code of ref document: A1