CN-121998810-A - Image processing method, identification method, device and electronic equipment
Abstract
The disclosure provides an image processing method, an identification device and electronic equipment, wherein the processing method comprises the steps of obtaining an image to be processed and determining a watermark type corresponding to the image to be processed; the method comprises the steps of obtaining content to be signed corresponding to the determined watermark type, signing the content to be signed by using a preset private key to obtain watermarks, wherein the content to be signed corresponding to different watermark types is different, the private key is generated by hardware in electronic equipment to which the image processing method is applied, and the watermarks are added into an image to be processed to generate a target image. The method and the device have the advantages that the private key generated by hardware is utilized to carry out signature encryption on the image, so that the watermark image is generated, illegal damage and tampering of the watermark are effectively prevented, the safety and reliability of the watermark are enhanced, the image is further protected from being influenced by illegal copying and tampering, and originality and copyright attribution of the image are fully proved.
Inventors
- WEI SHUYANG
Assignees
- 北京小米移动软件有限公司
Dates
- Publication Date
- 20260508
- Application Date
- 20241101
Claims (17)
- 1. An image processing method, comprising: acquiring an image to be processed, and determining a watermark type corresponding to the image to be processed; Obtaining content to be signed corresponding to the determined watermark type, and signing the content to be signed by using a preset private key to obtain watermarks, wherein the content to be signed corresponding to different watermark types is different; and adding the watermark to the image to be processed to generate a target image.
- 2. The method of claim 1, wherein the hardware comprises a SE chip loaded on the electronic device.
- 3. The method according to claim 1, wherein the watermark comprises a tamper-resistant watermark and/or a copyright watermark; The tamper-resistant watermark characterizes image information of the image to be processed to determine whether the target image is tampered with based on the image information; the copyright watermark characterizes copyright attribution of the image to be processed.
- 4. A method according to claim 3, wherein the watermark type comprises a tamper resistant watermark type or a copyright watermark type; The obtaining the content to be signed corresponding to the watermark type determined comprises the following steps: if the determined watermark type is the tamper-resistant watermark type, carrying out hash operation on the image information of the image to be processed to obtain a first hash value, and determining the first hash value as the content to be signed corresponding to the tamper-resistant watermark type; If the determined watermark type is the copyright watermark type, acquiring copyright owner information corresponding to the image to be processed, carrying out hash operation on the copyright owner information to obtain a second hash value, and determining the second hash value as the content to be signed corresponding to the copyright watermark type.
- 5. The method of claim 4, wherein signing the content to be signed with the preset private key to obtain the watermark comprises: If the determined watermark type is the tamper-proof watermark type, encrypting the first hash value by using a preset first encryption algorithm and the preset private key to obtain the tamper-proof watermark; if the determined watermark type is the copyright watermark type, encrypting the second hash value by using a preset second encryption algorithm and the preset private key to obtain a copyright watermark; wherein the encryption complexity of the second encryption algorithm is greater than the encryption complexity of the first encryption algorithm, such that the decryption complexity of the copyright watermark is greater than the decryption complexity of the tamper-resistant watermark.
- 6. A method according to claim 3, wherein the size of the copyright watermark in the target image is larger than the size of the tamper-resistant watermark in the target image; and/or the number of the copyright watermarks in the target image is greater than the number of the tamper-proof watermarks in the target image; And/or adding the copyright watermark to a specific position in the target image, wherein the specific position comprises the position of a foreground target in the target image.
- 7. The method of claim 1, the adding the watermark to the image to be processed comprising: setting the color of the watermark to be transparent, and adding the set watermark to a designated position in the image to be processed; or determining the color of the appointed position of the image to be processed, setting the color of the watermark to the color of the appointed position, and adding the set watermark to the appointed position of the image to be processed; or transforming the image to be processed from a time domain to a frequency domain to obtain spectrum information of the image to be processed, embedding the watermark in the spectrum information, and transforming the spectrum information embedded with the watermark from frequency to the time domain to obtain the target image.
- 8. A method of identifying an image of an object as claimed in any one of claims 1 to 7, comprising: determining the watermark type of the watermark added in the target image, and acquiring the content to be verified corresponding to the determined watermark type; Extracting a watermark from the target image, and decrypting the watermark by using a preset public key to obtain decrypted content, wherein the public key corresponds to the private key and is generated by hardware for generating the private key; And carrying out identification processing based on the content to be verified and the decrypted content to obtain an identification result aiming at the target image.
- 9. The method of claim 8, wherein the hardware comprises an SE chip.
- 10. The method of claim 8, wherein the extracting the watermark from the target image comprises: extracting a watermark from a specified location in the target image; Or alternatively Transforming the target image from the time domain to the frequency domain to obtain the spectrum information of the target image, and extracting the watermark from the spectrum information of the target image.
- 11. The method of claim 8, wherein the watermark type comprises a tamper resistant watermark type; the obtaining the content to be verified corresponding to the determined watermark type comprises the following steps: Performing hash operation on the image information of the target image to obtain a third hash value, and determining the third hash value as to-be-verified content corresponding to the tamper-resistant watermark type; The identifying processing is performed based on the content to be verified and the decrypted content to obtain an identifying result aiming at the target image, including: Comparing the content to be verified with the decrypted content; and if the two images are inconsistent, determining that the image content of the target image is tampered.
- 12. The method of claim 8, wherein the watermark type comprises a copyright watermark type; the obtaining the content to be verified corresponding to the determined watermark type comprises the following steps: Obtaining copyright owner information to be verified, carrying out hash operation on the copyright owner information to obtain a fourth hash value, and determining the fourth hash value as the content to be verified corresponding to the copyright watermark type; The identifying processing is performed based on the content to be verified and the decrypted content to obtain an identifying result aiming at the target image, including: Comparing the content to be verified with the decrypted content; and if the comparison is consistent, determining the copyright attribution of the target image.
- 13. An image processing apparatus, comprising: The image acquisition module is used for acquiring an image to be processed and determining a watermark type corresponding to the image to be processed; The system comprises a watermark generation module, a watermark processing module and a watermark processing module, wherein the watermark generation module is used for acquiring to-be-signed content corresponding to the determined watermark type, and signing the to-be-signed content by utilizing a preset private key to obtain watermarks, wherein the to-be-signed content corresponding to different watermark types is different; and the watermark adding module is used for adding the watermark into the image to be processed to generate a target image.
- 14. An apparatus for recognizing the target image according to any one of claims 1 to 7, comprising: The watermark type determining module is used for determining the watermark type of the watermark added in the target image and acquiring the content to be verified, which corresponds to the determined watermark type; The watermark decrypting module is used for extracting the watermark from the target image and decrypting the watermark by utilizing a preset public key to obtain decrypted content, wherein the public key corresponds to the private key and is generated by hardware for generating the private key; And the identification module is used for carrying out identification processing based on the content to be verified and the decrypted content to obtain an identification result aiming at the target image.
- 15. An electronic device, comprising: A processor; a memory for storing a computer program executable by the processor; wherein the processor, when executing the program, implements the steps of the method of any of claims 1-12.
- 16. A computer readable storage medium, on which a computer program is stored, characterized in that the program, when being executed by a processor, implements the steps of the method according to any of claims 1-12.
- 17. A computer program product comprising a computer program, characterized in that the computer program, when executed by a processor, implements the method of any of claims 1-12.
Description
Image processing method, identification method, device and electronic equipment Technical Field The disclosure relates to the technical field of image processing, and in particular relates to an image processing method, an image recognition device and electronic equipment. Background With the popularization of electronic devices and the development of the internet, individual users are increasingly inclined to use electronic devices for capturing and sharing images. However, with the widespread spread of images, there are more and more problems of illegal copying, forwarding, and hacking attacks. Conventional techniques typically rely on the way software watermarks to cope with the above problems, but watermarks added in this way are less secure and less reliable. Disclosure of Invention In order to overcome the problems in the related art, the present disclosure provides an image processing method, an image recognition device and an electronic device. According to a first aspect of an embodiment of the present disclosure, there is provided an image processing method including: acquiring an image to be processed, and determining a watermark type corresponding to the image to be processed; Obtaining content to be signed corresponding to the determined watermark type, and signing the content to be signed by using a preset private key to obtain watermarks, wherein the content to be signed corresponding to different watermark types is different; and adding the watermark to the image to be processed to generate a target image. According to a second aspect of embodiments of the present disclosure, there is provided a method for identifying a target image according to the first aspect, including: determining the watermark type of the watermark added in the target image, and acquiring the content to be verified corresponding to the determined watermark type; Extracting a watermark from the target image, and decrypting the watermark by using a preset public key to obtain decrypted content, wherein the public key corresponds to the private key and is generated by hardware for generating the private key; And carrying out identification processing based on the content to be verified and the decrypted content to obtain an identification result aiming at the target image. According to a third aspect of the embodiments of the present disclosure, there is provided an image processing apparatus including: The image acquisition module is used for acquiring an image to be processed and determining a watermark type corresponding to the image to be processed; The system comprises a watermark generation module, a watermark processing module and a watermark processing module, wherein the watermark generation module is used for acquiring to-be-signed content corresponding to the determined watermark type, and signing the to-be-signed content by utilizing a preset private key to obtain watermarks, wherein the to-be-signed content corresponding to different watermark types is different; and the watermark adding module is used for adding the watermark into the image to be processed to generate a target image. According to a fourth aspect of embodiments of the present disclosure, there is provided an apparatus for identifying a target image according to the first aspect, including: The watermark type determining module is used for determining the watermark type of the watermark added in the target image and acquiring the content to be verified, which corresponds to the determined watermark type; The watermark decrypting module is used for extracting the watermark from the target image and decrypting the watermark by utilizing a preset public key to obtain decrypted content, wherein the public key corresponds to the private key and is generated by hardware for generating the private key; And the identification module is used for carrying out identification processing based on the content to be verified and the decrypted content to obtain an identification result aiming at the target image. According to a fifth aspect of embodiments of the present disclosure, there is provided an electronic device comprising a processor, a memory for storing a computer program executable by the processor, wherein the processor implements the steps of the method of the first or second aspect when the processor executes the program. According to a sixth aspect of embodiments of the present disclosure, there is provided a computer readable storage medium having stored thereon a computer program which when executed by a processor implements the steps of the method of the first or second aspect. According to a seventh aspect of embodiments of the present disclosure, there is provided a computer program product comprising a computer program which, when executed by a processor, implements the method of the first or second aspect. The technical scheme provided by the embodiment of the disclosure can comprise the following beneficial effects: According to the em