CN113177876A - Picture processing method and device and electronic equipment - Google Patents

Picture processing method and device and electronic equipment Download PDF

Info

Publication number
CN113177876A
CN113177876A CN202110384912.3A CN202110384912A CN113177876A CN 113177876 A CN113177876 A CN 113177876A CN 202110384912 A CN202110384912 A CN 202110384912A CN 113177876 A CN113177876 A CN 113177876A
Authority
CN
China
Prior art keywords
picture
area
encrypted
preset
region
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110384912.3A
Other languages
Chinese (zh)
Inventor
黄鹤南
王岩
程童
王敏
颜聪
董金奎
张文翰
冉煜
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zuoyebang Education Technology Beijing Co Ltd
Original Assignee
Zuoyebang Education Technology Beijing Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zuoyebang Education Technology Beijing Co Ltd filed Critical Zuoyebang Education Technology Beijing Co Ltd
Priority to CN202110384912.3A priority Critical patent/CN113177876A/en
Publication of CN113177876A publication Critical patent/CN113177876A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T1/00General purpose image data processing
    • G06T1/0021Image watermarking
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/10Protecting distributed programs or content, e.g. vending or licensing of copyrighted material ; Digital rights management [DRM]
    • G06F21/16Program or content traceability, e.g. by watermarking
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/602Providing cryptographic facilities or services
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformation in the plane of the image
    • G06T3/40Scaling the whole image or part thereof
    • G06T3/4038Scaling the whole image or part thereof for image mosaicing, i.e. plane images composed of plane sub-images
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2200/00Indexing scheme for image data processing or generation, in general
    • G06T2200/32Indexing scheme for image data processing or generation, in general involving image mosaicing

Abstract

The invention relates to the technical field of network data security, and discloses a picture processing method, a picture processing device and electronic equipment, wherein the picture processing method comprises the following steps: intercepting at least one preset area in the original image to obtain an area picture; and carrying out digital watermark encryption on the regional picture to obtain a regional encrypted picture, and restoring the original picture in a splicing mode to generate the encrypted picture. According to the picture processing method, the preset area is encrypted, so that on one hand, the key area can be selected as the preset area to be encrypted according to the requirement, and the picture encryption has higher pertinence; on the other hand, the preset areas can be adjusted according to specific contents, so that the preset areas of the original images are not completely the same, the encryption areas of the original images are different, commonality does not exist, and the robustness of image encryption is high.

Description

Picture processing method and device and electronic equipment
Technical Field
The invention relates to the technical field of image processing, in particular to a picture processing method and device and electronic equipment.
Background
With the rapid development of network technologies, the public deployment of network information and the sharing of network resources bring great convenience to people and also bring problems.
Pictures are widely spread on the network as an information carrier, but some pictures with copyright ownership are often encrypted in order to prevent the pictures from being freely used without authorization.
Digital watermarking (Digital Watermark), a technique for embedding a particular Digital signal into a Digital product to protect the copyright or integrity of the Digital product, is commonly used for copyright protection of digitized images, video, audio or electronic documents. The method is characterized in that specific information representing the identity of a copyright owner, such as a section of characters, identification, a serial number and the like, is embedded into a digital product in a certain mode, and when copyright disputes occur, a digital watermark is extracted through a corresponding algorithm, so that the attribution of copyright is verified, the legal benefit of the copyright owner is ensured, and the threat of illegal piracy is avoided.
The existing digital watermark can be divided into a space domain watermark and a transform domain watermark according to different loading methods, wherein the space domain watermark is embedded by modifying original data of a picture, and the watermark is embedded in a space domain, so that the robustness is low, and the digital watermark is easy to decrypt; the watermark in the transform domain is to transform the space domain data into the frequency domain, so as to achieve the purpose of data compression, and meanwhile, the watermark is embedded in the transform domain, so that the watermark has higher robustness and better embedding effect, and certainly, the algorithm is somewhat complex to realize.
In addition, for some pictures with specific systems of contents, the existing digital watermark embedding mode does not consider the characteristics of the specific system of contents contained in the pictures, and the picture encryption effect is either insufficient in robustness or too complex in implementation algorithm.
Therefore, the invention aims to solve the problem of how to realize the encryption of the specific area (key area) of the picture content in a targeted manner, so that the encrypted picture with simplified encryption algorithm and high robustness can be obtained.
In view of the above, the present invention is particularly proposed.
Disclosure of Invention
The invention aims to: provided are a picture processing method and device and an electronic device, wherein the picture processing method and device can be used for realizing the purpose of encrypting a specific area (key area) of picture content.
In order to achieve the above purpose, the invention provides the following technical scheme:
a picture processing method comprises the following steps:
intercepting at least one preset area in the original image to obtain an area picture;
carrying out digital watermark encryption on the regional picture to obtain a regional encrypted picture;
and restoring the original image by a splicing mode to generate an encrypted picture.
As an optional embodiment of the present invention, the capturing at least one preset region in the original image to obtain the region picture includes:
the original image is a picture which is generated by a preset picture template and comprises a plurality of preset areas, and at least one preset area is selected as a picture encryption area;
determining the boundary of each preset area in the original image, and intercepting the area image along the boundary of the selected preset area according to the selected preset area;
optionally, the preset region includes a main region containing important information, and the main region is selected as a picture encryption region.
As an optional embodiment of the present invention, a region identification model is generated by labeling and training a preset image template, and the region identification model may identify and determine a boundary of each preset region in an original image.
Optionally, each preset region of the picture generated by the preset picture template has different boundary feature elements, and the boundary of each preset region in the original picture is determined by identifying and extracting the boundary feature elements corresponding to each preset region in the original picture.
As an optional embodiment of the present invention, the encrypting the area picture with the digital watermark to obtain an area encrypted picture, and restoring the original picture by splicing to generate the encrypted picture includes:
sequencing the area photos to be subjected to digital watermark encryption according to a first preset rule, and numbering a 1-an;
splitting the ciphertext of the digital watermark into digital watermark sub-ciphertexts with the same number as the regional photos to be encrypted by the digital watermark according to a second preset rule, and numbering b 1-bn;
correspondingly adding the digital watermark sub-ciphertexts b 1-bn to the regional photos a 1-an to be encrypted by the digital watermark respectively to obtain regional encrypted pictures;
splicing the photos in the encrypted area in the area, or restoring the original images of the encrypted photos in the spliced area and the photos in the unencrypted area to generate encrypted pictures;
optionally, the first preset rule is that the region photos to be encrypted by the digital watermark are arranged in descending/ascending order of length, width or area;
the second preset rule is that the digital watermark is averagely divided into n parts according to the length of the ciphertext.
As an optional embodiment of the present invention, the size of the minimum encryption region c is preset to w × h, and the minimum encryption regions c are selected from the set positions of the region photos a 1-an to be encrypted by the digital watermark, respectively, to serve as encryption regions;
the digital watermark sub-ciphertexts b 1-bn are respectively and correspondingly added to the encryption areas of the area photos a 1-an to be encrypted by the digital watermark;
optionally, the set position of the area photo is upper left, or upper right, or lower left, or lower right, or center.
As an optional embodiment of the present invention, a method for processing a picture includes:
acquiring an encrypted picture, identifying each preset area of the encrypted picture and intercepting the area picture;
and decrypting the pictures in each area according to a preset decryption rule to obtain decryption information.
As an optional embodiment of the present invention, the decrypting the pictures in the respective regions according to the preset decryption rule, and acquiring the decryption information includes:
sequencing the area photos according to a first preset rule, and numbering a 1-an;
selecting areas with the size of w x h from the set positions of the area photos as decryption areas;
and respectively decrypting the decryption areas of the photos in each area to obtain digital watermark sub-ciphertexts b 1-bn, and splicing the digital watermark sub-ciphertexts b 1-bn according to a second preset rule to obtain encrypted ciphertexts.
As an optional implementation manner of the present invention, the original image is a question answer picture including an answer region and an analysis region, and the answer region and/or the analysis region in the question answer picture are captured to obtain an answer region picture and/or an analysis region picture;
and carrying out digital encryption on the answer area picture and/or the analysis area picture to obtain an answer area encrypted picture and/or an analysis area encrypted picture, and splicing the answer area encrypted picture and/or the analysis area encrypted picture with the original question answer picture to generate an encrypted question answer picture.
Optionally, the picture processing method includes:
acquiring an encrypted question answer picture, identifying an answer area and an analysis area of the encrypted question answer picture, and intercepting to obtain an answer area picture and an analysis area picture;
and decrypting the answer area picture and the analysis area picture according to a preset decryption rule to obtain decryption information.
The embodiment also provides a device for processing pictures, which includes:
the screenshot module is used for intercepting at least one preset area in the original image to obtain an area picture;
the encryption module digitally encrypts the area picture to obtain an area encrypted picture;
and the picture splicing module restores the original picture in a splicing mode to generate the encrypted picture.
The invention also provides an electronic device comprising a processor and a memory, wherein the memory is used for storing a computer executable program, and when the computer program is executed by the processor, the processor executes the processing method of the picture.
Compared with the prior art, the invention has the beneficial effects that:
the picture processing method provided by the invention is characterized in that the preset area is intercepted out according to the characteristic that the original picture contains the preset area, and the digital watermark encryption is carried out, so that the picture is locally encrypted, and the algorithm of the digital watermark encryption is simplified.
According to the picture processing method, the preset area is encrypted, so that on one hand, the key area can be selected as the preset area to be encrypted according to the requirement, and the picture encryption has higher pertinence; on the other hand, the preset areas can be adjusted according to specific contents, so that the preset areas of the original images are not completely the same, the encryption areas of the original images are different, commonality does not exist, and the robustness of image encryption is high.
The picture processing method provided by the invention aims at the characteristics of the subject picture, and ensures the effectiveness of picture encryption by locally encrypting the picture in the answer area and/or the picture in the analysis area. And the answer area picture and the analysis area picture of each topic picture have differences, so that when the encryption strategy of the topic picture of the embodiment is not obtained, the traditional decryption mode cannot perform decryption or cannot automatically decrypt in large batch, and the problem that the strategy is easy to crack because the topic picture integrally adopts a conventional space domain or transform domain encryption mode is solved.
The picture processing method provides a corresponding decryption strategy aiming at the encryption strategy, can carry out targeted decryption on the subject picture, and has simple and rapid decryption process.
Description of the drawings:
FIG. 1 is a flow chart of picture encryption in a picture processing method according to the present invention;
FIG. 2 is a flowchart of step S100 of the method for processing pictures according to the present invention;
FIG. 3 is a flowchart of steps S200 and S300 in the method for processing pictures according to the present invention;
FIG. 4 is a flowchart of image decryption in the image processing method according to the present invention;
FIG. 5 is a flowchart of step S600 in the method for processing pictures according to the present invention
FIG. 6 is a flow chart of a preparation process in the method for processing a topic picture according to the present invention;
FIG. 7 is a flow chart of picture encryption in the method for processing a topic picture according to the present invention;
FIG. 8 is a flowchart of picture decryption in the method for processing a topic picture according to the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be described clearly and completely with reference to the accompanying drawings. It is to be understood that the embodiments described are only a few embodiments of the present invention, and not all embodiments.
Thus, the following detailed description of the embodiments of the invention is not intended to limit the scope of the invention as claimed, but is merely representative of some embodiments of the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that the embodiments of the present invention and the features and technical solutions thereof may be combined with each other without conflict.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined and explained in subsequent figures.
In the description of the present invention, it should be noted that the terms "upper", "lower", and the like refer to orientations or positional relationships based on those shown in the drawings, or orientations or positional relationships that are conventionally arranged when the products of the present invention are used, or orientations or positional relationships that are conventionally understood by those skilled in the art, and such terms are used for convenience of description and simplification of the description, and do not refer to or imply that the devices or elements referred to must have a specific orientation, be constructed and operated in a specific orientation, and thus, should not be construed as limiting the present invention. Furthermore, the terms "first," "second," and the like are used merely to distinguish one description from another, and are not to be construed as indicating or implying relative importance.
Referring to fig. 1, a method for processing a picture provided in this embodiment includes:
s100, intercepting at least one preset area in an original image to obtain an area picture;
step S200, carrying out digital watermark encryption on the regional picture to obtain a regional encrypted picture;
and step S300, restoring the original image by a splicing mode to generate an encrypted picture.
According to the picture processing method, the preset area is intercepted and the digital watermark encryption is carried out according to the characteristic that the original picture contains the preset area, so that the picture is locally encrypted, and the algorithm of the digital watermark encryption is simplified.
According to the picture processing method, the preset area is encrypted, so that on one hand, the key area can be selected as the preset area to be encrypted according to requirements, and the picture encryption has more pertinence; on the other hand, the preset areas can be adjusted according to specific contents, so that the preset areas of the original images are not completely the same, the encryption areas of the original images are different, commonality does not exist, and the robustness of image encryption is high.
Further, referring to fig. 2, in the method for processing a picture according to this embodiment, the step S100 includes:
step S101, the original image is a picture which is generated by a preset picture template and comprises a plurality of preset areas;
step S102, selecting at least one preset area as an image encryption area;
step S103, determining the boundary of each preset area in the original image;
and step S104, intercepting the selected preset area along the boundary thereof to obtain an area picture.
The original image of the embodiment is generated by a preset image template, and images generated by the same preset image template have the same page layout, but the same area has different boundaries on different images due to different display contents in each area.
Optionally, the preset region described in this embodiment includes a main region containing important information, and the main region is selected as the picture encryption region. The picture processing method of the embodiment can select the main area containing important information for encryption, thereby not only ensuring the effectiveness of picture encryption, but also simplifying the encryption algorithm.
As an optional implementation manner of this embodiment, in order to identify each area boundary in the original image, this embodiment generates an area identification model by labeling and training a preset image template, where the area identification model can identify and determine the boundary of each preset area in the original image.
The embodiment can respectively label information of each region of the preset picture template, and identify each label of the preset picture template by training the identification model to determine the region boundary, so as to generate the region identification model.
As an optional implementation manner of this embodiment, each preset region of the generated picture of the preset picture template has different boundary feature elements, and the boundary of each preset region in the original picture is determined by identifying and extracting the boundary feature elements corresponding to each preset region in the original picture. For example, each preset region has a keyword feature, the positioning of each region is realized by identifying the keyword feature, and then the boundary corresponding to the region is determined by identifying the boundary feature.
Referring to fig. 3, as an optional implementation manner of this embodiment, the method for processing a picture in this embodiment includes an encryption flow:
sequencing the area photos to be subjected to digital watermark encryption according to a first preset rule, and numbering a 1-an;
splitting the ciphertext of the digital watermark into digital watermark sub-ciphertexts with the same number as the regional photos to be encrypted by the digital watermark according to a second preset rule, and numbering b 1-bn;
correspondingly adding the digital watermark sub-ciphertexts b 1-bn to the regional photos a 1-an to be encrypted by the digital watermark respectively to obtain regional encrypted pictures;
splicing the photos in the encrypted area in the area, or restoring the original images of the encrypted photos in the spliced area and the photos in the unencrypted area to generate encrypted pictures;
optionally, the first preset rule is that the region photos to be encrypted by the digital watermark are arranged in descending/ascending order of length, width or area;
the second preset rule is that the digital watermark is averagely divided into n parts according to the length of the ciphertext.
Further, the size of a preset minimum encryption area c is w x h, and the minimum encryption area c is selected from the set positions of the area photos a 1-an to be encrypted by the digital watermark and is used as an encryption area;
the digital watermark sub-ciphertexts b 1-bn are respectively and correspondingly added to the encryption areas of the area photos a 1-an to be encrypted by the digital watermark;
optionally, the set position of the area photo is upper left, or upper right, or lower left, or lower right, or center.
As an optional implementation manner of this embodiment, referring to fig. 4, the picture processing method of this embodiment includes a decryption flow:
step S400, obtaining an encrypted picture;
step S500, identifying each preset area of the encrypted picture and intercepting the area picture;
and step S600, decrypting the pictures in each area according to a preset decryption rule to obtain decryption information.
Further, as shown in fig. 5, the decrypting the pictures in the respective regions according to the preset decryption rule to obtain the decryption information includes:
sequencing the area photos according to a first preset rule, and numbering a 1-an;
selecting areas with the size of w x h from the set positions of the area photos as decryption areas;
and respectively decrypting the decryption areas of the photos in each area to obtain digital watermark sub-ciphertexts b 1-bn, and splicing the digital watermark sub-ciphertexts b 1-bn according to a second preset rule to obtain encrypted ciphertexts.
As an optional implementation manner of this embodiment, referring to fig. 7, the method for processing a picture in this embodiment can implement targeted picture encryption processing on a title photo with a fixed system, and includes: the original image is a question answer picture comprising an answer area and an analysis area, and the answer area and/or the analysis area in the question answer picture are captured to obtain an answer area picture and/or an analysis area picture;
and carrying out digital encryption on the answer area picture and/or the analysis area picture to obtain an answer area encrypted picture and/or an analysis area encrypted picture, and splicing the answer area encrypted picture and/or the analysis area encrypted picture with the original question answer picture to generate an encrypted question answer picture.
Aiming at the online education industry, providing a question bank for users is the core competitiveness of the online education industry, and therefore, the data security of the question bank is particularly important. How to encrypt the digital watermark of each question photo in the question bank and ensure that the encryption strategy is not easy to crack, and avoiding the loss of the question data is the solution of the embodiment. Therefore, according to the characteristics of the theme picture, the effectiveness of picture encryption is ensured by partially encrypting the answer area picture and/or the analysis area picture. And the answer area picture and the analysis area picture of each topic picture have differences, so that when the encryption strategy of the topic picture of the embodiment is not obtained, the traditional decryption mode cannot perform decryption or cannot automatically decrypt in large batch, and the problem that the strategy is easy to crack because the topic picture integrally adopts a conventional space domain or transform domain encryption mode is solved.
Referring to fig. 6, in this embodiment, the area boundary is determined by labeling the preset question type picture template and recognizing each label of the question type picture template through the training recognition model, so as to generate a solution area recognition model, which can be used for area recognition of the question picture corresponding to the question type picture template, and the implementation manner is simple and accurate.
Further, referring to fig. 8, the processing method of this embodiment includes a decryption process:
acquiring an encrypted question answer picture, identifying an answer area and an analysis area of the encrypted question answer picture, and intercepting to obtain an answer area picture and an analysis area picture;
and decrypting the answer area picture and the analysis area picture according to a preset decryption rule to obtain decryption information.
The picture processing method of the embodiment provides a corresponding decryption strategy for the encryption strategy, can perform targeted decryption on the subject picture, and has a simple and quick decryption process.
In the decryption process of this embodiment, the specific identification manner for identifying the answer region and the parsing region of the encrypted topic answer picture may refer to the identification manner in the encryption process.
In addition, as for the digital watermarking encryption for the area picture in the original image in the embodiment, an encryption method such as spatial domain digital watermarking encryption or transform domain digital watermarking encryption (dwt transform or dct transform) can be adopted.
The embodiment also provides a device for processing pictures, which includes:
the screenshot module is used for intercepting at least one preset area in the original image to obtain an area picture;
the encryption module digitally encrypts the area picture to obtain an area encrypted picture;
and the picture splicing module restores the original picture in a splicing mode to generate the encrypted picture.
The picture processing device of the embodiment intercepts the preset area to perform digital watermark encryption according to the characteristic that the original picture contains the preset area, thereby realizing the local encryption of the picture and simplifying the algorithm of the digital watermark encryption.
The picture processing device of the embodiment encrypts the preset area through the encryption module, so that on one hand, the key area can be selected as the preset area to be encrypted according to requirements, and the picture encryption has more pertinence; on the other hand, the preset areas can be adjusted according to specific contents, so that the preset areas of the original images are not completely the same, the encryption areas of the original images are different, commonality does not exist, and the robustness of image encryption is high.
As an optional implementation manner of this embodiment, an encryption flow of the encryption module of this embodiment includes:
sequencing the area photos to be subjected to digital watermark encryption according to a first preset rule, and numbering a 1-an;
splitting the ciphertext of the digital watermark into digital watermark sub-ciphertexts with the same number as the regional photos to be encrypted by the digital watermark according to a second preset rule, and numbering b 1-bn;
correspondingly adding the digital watermark sub-ciphertexts b 1-bn to the regional photos a 1-an to be encrypted by the digital watermark respectively to obtain regional encrypted pictures;
splicing the photos in the encrypted area in the area, or restoring the original images of the encrypted photos in the spliced area and the photos in the unencrypted area to generate encrypted pictures;
optionally, the first preset rule is that the region photos to be encrypted by the digital watermark are arranged in descending/ascending order of length, width or area;
the second preset rule is that the digital watermark is averagely divided into n parts according to the length of the ciphertext.
Further, the encryption flow of the encryption module of this embodiment further includes:
presetting the size of a minimum encryption area c as w x h, and respectively selecting the minimum encryption area c from the set positions of area photos a 1-an to be encrypted by the digital watermark as encryption areas;
the digital watermark sub-ciphertexts b 1-bn are respectively and correspondingly added to the encryption areas of the area photos a 1-an to be encrypted by the digital watermark;
optionally, the set position of the area photo is upper left, or upper right, or lower left, or lower right, or center.
Further, the picture processing device of the embodiment includes an identification module, the original picture is a picture generated by a preset picture template and including a plurality of preset areas, and the screenshot module intercepts at least one preset area as a picture encryption area; the recognition module determines the boundary of each preset area in the original image, and the screenshot module captures an area picture along the boundary of the selected preset area according to the selected preset area.
The original image of the embodiment is generated by a preset image template, and images generated by the same preset image template have the same page layout, but the same area has different boundaries on different images due to different display contents in each area, and the image processing device of the embodiment can intercept an area image by determining the boundaries of each area.
Optionally, the preset region described in this embodiment includes a main region containing important information, and the main region is selected as the picture encryption region. The picture processing device of the embodiment can select the main area containing important information for encryption, thereby not only ensuring the effectiveness of picture encryption, but also simplifying the encryption algorithm.
As an optional implementation manner of this embodiment, in order to identify each area boundary in the original image, this embodiment generates an area identification module by labeling and training a preset image template, where the area identification module may identify and determine the boundary of each preset area in the original image.
The embodiment can respectively label information of each region of the preset image template, and identify each information label through the training identification module to determine the region boundary, so that the implementation mode is simple and accurate.
As an optional implementation manner of this embodiment, each preset region of the generated picture of the preset picture template has different boundary feature elements, and the boundary of each preset region in the original picture is determined by identifying and extracting the boundary feature elements corresponding to each preset region in the original picture. For example, each preset region has a keyword feature, the positioning of each region is realized by identifying the keyword feature, and then the boundary corresponding to the region is determined by identifying the boundary feature.
As an optional implementation manner of this embodiment, the picture processing apparatus of this embodiment includes:
the acquisition module acquires an encrypted picture;
the identification module is used for identifying each preset area of the encrypted picture and intercepting the area picture;
and the decryption module is used for decrypting the pictures in each area according to a preset decryption rule to obtain decryption information.
The decryption process of the decryption module of this embodiment includes:
sequencing the area photos according to a first preset rule, and numbering a 1-an;
selecting areas with the size of w x h from the set positions of the area photos as decryption areas;
and respectively decrypting the decryption areas of the photos in each area to obtain digital watermark sub-ciphertexts b 1-bn, and splicing the digital watermark sub-ciphertexts b 1-bn according to a second preset rule to obtain encrypted ciphertexts.
As an optional implementation manner of this embodiment, the picture processing apparatus of this embodiment can implement targeted picture encryption processing on a title photo with a fixed system, and includes: the original image is a question answer picture comprising an answer area and an analysis area, and the screenshot module intercepts the answer area and/or the analysis area in the question answer picture to obtain an answer area picture and/or an analysis area picture;
the encryption module carries out digital encryption on the answer area picture and/or the analysis area picture to obtain an answer area encrypted picture and/or an analysis area encrypted picture;
and the picture splicing module is used for splicing the encrypted picture of the answer area and/or the encrypted picture of the analysis area with the original question answer picture to generate an encrypted question answer picture.
Aiming at the online education industry, providing a question bank for users is the core competitiveness of the online education industry, and therefore, the data security of the question bank is particularly important. How to encrypt the digital watermark of each question photo in the question bank and ensure that the encryption strategy is not easy to crack, and avoiding the loss of the question data is the solution of the embodiment. Therefore, the picture processing device of the embodiment guarantees the effectiveness of picture encryption by partially encrypting the answer region picture and/or the analysis region picture according to the characteristics of the theme picture. And the answer area picture and the analysis area picture of each topic picture have differences, so that when the encryption strategy of the topic picture of the embodiment is not obtained, the traditional decryption mode cannot perform decryption or cannot automatically decrypt in large batch, and the problem that the strategy is easy to crack because the topic picture integrally adopts a conventional space domain or transform domain encryption mode is solved.
Further, in the processing device of this embodiment, the obtaining module obtains the encrypted question answer picture, and the identifying module identifies the answer region and the parsing region of the encrypted question answer picture and captures the encrypted question answer picture to obtain an answer region picture and a parsing region picture; and the decryption module decrypts the answer area picture and the analysis area picture according to a preset decryption rule to acquire decryption information.
The image processing device of the embodiment provides a corresponding decryption strategy for the encryption strategy, can perform targeted decryption on the subject image, and has a simple and quick decryption process.
In the decryption process of this embodiment, the specific identification manner for identifying the answer region and the parsing region of the encrypted topic answer picture may refer to the identification manner in the encryption process.
In addition, as for the digital watermarking encryption for the area picture in the original image in the embodiment, an encryption method such as spatial domain digital watermarking encryption or transform domain digital watermarking encryption (dwt transform or dct transform) can be adopted. Optionally, the embodiment uses a spatial LSB algorithm, and uses the last 4-bit value of the pixel in the picture of the directly changed region to embed the secret file. By the transmission process of the secret file, it can be divided into 3 stages accordingly: the embedding process, the propagation process, the extraction process, in terms of the overall design, can be summarized with a model.
Secret information extracted from a carrier Signal (Signal) to be detected is extracted, and the secret information refers to information to be hidden, such as sound, characters and the like, to be transmitted.
This is a typical spatial domain data hiding method, which is used by l.f. tumer and r.g. van schyndel, etc. to hide specific tags in digital audio and digital images. In terms of image data, each pixel of an image is structured in a multi-bit manner, and in a grayscale image, each pixel is typically 8 bits; in a true color image (RGB scheme), each pixel has 24 bits, wherein three RGB colors each have 8 bits, and each bit takes a value of 0 or 1. In a digital image, the contribution of the individual bits of each pixel to the image is different.
Thus, the entire image is decomposed into 8 bit planes, from LSB (least significant bit O) to MSB (most significant bit 7). From the distribution of bit planes, the features of the bit plane image become increasingly complex and the details increase as the bit plane goes from low to high (i.e., from bit plane 0 to bit plane 7). When the bit plane is lower, the information of the test image can not be seen from one bit plane. Since the lower bits represent little energy, changing the lower bits does not have much impact on the quality of the image. The LSB method uses this to hide the watermarking information in the lower bits of the image.
And (3) realizing a space domain LSB algorithm:
(1) the MATLAB language is used to hide a text file "gray 2. bmp" in a 400x 533-sized gray scale map "gray. It follows that the capacity of the hidden information is very large. The encryption algorithm is specifically as follows:
1) embedding secret information
Step 1: the carrier file is read in and displayed.
original_carrier-1mread(‘grayl.bmp’);
carner=original_carrier;
subpalot (2, 3, 1), image (carrier), title ('original carrier image')
Step 2: determining LSB of the carrier and the number of embedded bits, and adopting the last 4 bits of all pixels in the embedded image; preprocessing a carrier image, and setting the phase of the lower 4 bits of the carrier image as O;
carrierl=bitand(carner,254);
supbplot (2, 3, 2), imshow (carierl), title ('the lower 1 bit of the Carrier image is 0')
carrier2=bitand(carner,252);
Subplot (2, 3, 3), imshow (carner /), title ('2 bits in the lower part of the Carrier image are O')
camer3=bitand(carner,248);
subpalot (2, 3, 4), imshow (carrier3), title ('carrier image low 3 bits are O')
carrier4=bitand(carrier,240);
subpalot (2, 3, 5), imshow (carrier4), title ('carrier image low 4 bits are 0')
And 3, step 3: reading the secret image and storing the secret image; and pre-processes the secret image.
original_secret=imread(‘gray2.bmp’);
secret=original_secret;
subpalot (2, 3, 3), imshow (secret), title ('original secret image')
secret=bitand(secret,240);
subpalot (2, 3, 4), imshow (secret), title ('secret image with O in the lower 4 bits')
secret=bitshift(secret,-4);
And 4, step 4: embedding the processed secret image into the carrier and displaying the final result after hiding.
carrier=bitor(carrier,secret);
subpalot (2, 3, 5), image (carrier), title ('hidden carrier image')
imwrite(carrier,'d:\l_imagehide.bmp')。
(2) Reading secret information
Step 1: reading in an image containing a secret file;
carner=imread(‘d:\l_imagehide.bmp’);
step 2: outputting the hidden file and extracting a secret image; and shifting the image position of the secret image by 4 bits to the left, and displaying the extracted secret image.
A=bitand(carner,15);
A=bitshift(A,4);
Subplot (2, 3, 6)! imshow (A), title ('hidden image extracted').
2) The MATLAB language is utilized to realize that a text file "gray 2. bmp" is hidden in a color image "rgbl. JPG" with the size of 400x533, and secret information is hidden in the B layer of the JPG color image. And successfully extracting the hidden information to finish the information hiding.
Step 1 reads in the carrier file and displays it.
original_carrier=imread('rgbl.jpg')
original_secret-imread'gray2.bmp')
data=original_carrier;
carrier=original_carrier;
subpalot (3,3, 1), image (carrier), title ('original carrier image')
secret=originaLsecret;
And step 2, reading the B layer of the RGB image, displaying the carrier image of the B layer, setting the lower 4 bits of the carrier image as O, and displaying the O.
carner=carrier(:,:,3);
Subplot (3,3, 2), imshow (carner), title ('Carrier image of layer B')
carrier=bitand(carner,240);
Subplot (3,3, 3), image (carrier), title ('Place 4 vector image with O')
And 3, displaying the original secret image, setting the lower 4 bits of the secret image to be O, displaying the O, and shifting the upper 4 bits of the secret image to the right.
subpalot (3,3, 4), imshow (secret), title ('original secret image')
secret=bitand(secret,240);
subpalot (3,3, 5), image (secret), title (' secret image with 0 bit set 4)
secret=bitshift(secret,-4);
And step 4, hiding the secret information to the layer B of the carrier and displaying the hidden picture.
carrier=bitor(carrier,secret);
subpalot (3,3, 6), imshow (carner), title ('Carrier image hidden in layer B')
data(:,:,3)=carrier;
subpalot (3,3, 7), imshow (data), title ('hidden carrier image')
And 5, reading the hidden picture by the person, and extracting the secret information.
A=imread(‘d:\2_imagehide.bmp’);
supbplot (3,3, 8), imshow (A), title ('vector image after human reading hiding')
row,col,rgbl=size(A);
A=A(:,:,3);
A=bitand(A.15);
secret=bitshift(A,4);
subpalot (3,3, 9), image (secret), title ('hidden image after extraction')
figure, imshow (original _ carrier), title ('original carrier image')
Figure, image (data), title ('hidden carrier image').
The spatial LSB algorithm usually hides the information in the last few bits of the image pixel, and the information is usually text. The text is converted into binary codes, and then the binary codes are embedded into the last few bits of the image pixels, so that the method has the advantages of low loss of the image, almost no distinction by naked eyes, simple realization, good invisibility, strong shearing and JPEG compression resistance, low time complexity of the algorithm, good encryption effect and high safety.
The embodiment also provides an electronic device, which includes a processor and a memory, where the memory is used to store a computer executable program, and when the computer program is executed by the processor, the processor executes the processing method of the picture.
The embodiment also provides a computer readable medium, which stores a computer executable program, and when the computer executable program is executed, the method for processing the picture is realized.
From the above description of the embodiments, those skilled in the art will readily appreciate that the present invention can be implemented by hardware capable of executing a specific computer program, such as the system of the present invention, and electronic processing units, servers, clients, mobile phones, control units, processors, etc. included in the system. The invention may also be implemented by computer software for performing the method of the invention, e.g. control software executed by a microprocessor, an electronic control unit, a client, a server, etc. It should be noted that the computer software for executing the method of the present invention is not limited to be executed by one or a specific hardware entity, and can also be realized in a distributed manner by non-specific hardware. For computer software, the software product may be stored in a computer readable storage medium (which may be a CD-ROM, a usb disk, a removable hard disk, etc.) or may be distributed over a network, as long as it enables the electronic device to perform the method according to the present invention.
The above embodiments are only used for illustrating the invention and not for limiting the technical solutions described in the invention, and although the present invention has been described in detail in the present specification with reference to the above embodiments, the present invention is not limited to the above embodiments, and therefore, any modification or equivalent replacement of the present invention is made; all such modifications and variations are intended to be included herein within the scope of this disclosure and the appended claims.

Claims (10)

1. A picture processing method is characterized by comprising the following steps:
intercepting at least one preset area in the original image to obtain an area picture;
carrying out digital watermark encryption on the regional picture to obtain a regional encrypted picture;
and restoring the original image by a splicing mode to generate an encrypted picture.
2. The method as claimed in claim 1, wherein said capturing at least one preset region in the original image to obtain the region image comprises:
the original image is a picture which is generated by a preset picture template and comprises a plurality of preset areas, and at least one preset area is selected as a picture encryption area;
determining the boundary of each preset area in the original image, and intercepting the area image along the boundary of the selected preset area according to the selected preset area;
optionally, the preset region includes a main region containing important information, and the main region is selected as a picture encryption region.
3. The method as claimed in claim 2, wherein the region recognition model is generated by labeling and training a predetermined image template, and the region recognition model can identify and determine the boundary of each predetermined region in the original image;
optionally, each preset region of the picture generated by the preset picture template has different boundary feature elements, and the boundary of each preset region in the original picture is determined by identifying and extracting the boundary feature elements corresponding to each preset region in the original picture.
4. The method according to any one of claims 1 to 3, wherein the digital watermarking encryption is performed on the region picture to obtain a region encrypted picture, and the restoration of the original picture by the splicing method to generate the encrypted picture comprises:
sequencing the area photos to be subjected to digital watermark encryption according to a first preset rule, and numbering a 1-an;
splitting the ciphertext of the digital watermark into digital watermark sub-ciphertexts with the same number as the regional photos to be encrypted by the digital watermark according to a second preset rule, and numbering b 1-bn;
correspondingly adding the digital watermark sub-ciphertexts b 1-bn to the regional photos a 1-an to be encrypted by the digital watermark respectively to obtain regional encrypted pictures;
splicing the photos in the encrypted area in the area, or restoring the original images of the encrypted photos in the spliced area and the photos in the unencrypted area to generate encrypted pictures;
optionally, the first preset rule is that the region photos to be encrypted by the digital watermark are arranged in descending/ascending order of length, width or area;
the second preset rule is that the digital watermark is averagely divided into n parts according to the length of the ciphertext.
5. The picture processing method according to claim 4, wherein the size of the preset minimum encryption region c is w x h, and the minimum encryption region c is selected from the set positions of the region photos a 1-an to be encrypted with the digital watermark as the encryption region;
the digital watermark sub-ciphertexts b 1-bn are respectively and correspondingly added to the encryption areas of the area photos a 1-an to be encrypted by the digital watermark;
optionally, the set position of the area photo is upper left, or upper right, or lower left, or lower right, or center.
6. The method for processing the picture according to any one of claims 1 to 5, comprising:
acquiring an encrypted picture, identifying each preset area of the encrypted picture and intercepting the area picture;
and decrypting the pictures in each area according to a preset decryption rule to obtain decryption information.
7. The picture processing method according to claim 6, wherein the decrypting the pictures of the respective regions according to the preset decryption rule to obtain the decryption information comprises:
sequencing the area photos according to a first preset rule, and numbering a 1-an;
selecting areas with the size of w x h from the set positions of the area photos as decryption areas;
and respectively decrypting the decryption areas of the photos in each area to obtain digital watermark sub-ciphertexts b 1-bn, and splicing the digital watermark sub-ciphertexts b 1-bn according to a second preset rule to obtain encrypted ciphertexts.
8. The method according to any one of claims 1 to 5, wherein the original image is a topic answer image including an answer region and an analysis region, and the answer region and/or the analysis region in the topic answer image is captured to obtain an answer region image and/or an analysis region image;
the method comprises the steps of carrying out digital encryption on an answer area picture and/or an analysis area picture to obtain an answer area encrypted picture and/or an analysis area encrypted picture, and splicing the answer area encrypted picture and/or the analysis area encrypted picture with an original question answer picture to generate an encrypted question answer picture;
optionally, the picture processing method includes:
acquiring an encrypted question answer picture, identifying an answer area and an analysis area of the encrypted question answer picture, and intercepting to obtain an answer area picture and an analysis area picture;
and decrypting the answer area picture and the analysis area picture according to a preset decryption rule to obtain decryption information.
9. An apparatus for processing pictures, comprising:
the screenshot module is used for intercepting at least one preset area in the original image to obtain an area picture;
the encryption module digitally encrypts the area picture to obtain an area encrypted picture;
and the picture splicing module restores the original picture in a splicing mode to generate the encrypted picture.
10. An electronic device comprising a processor and a memory, the memory for storing a computer-executable program, characterized in that:
the computer program, when executed by the processor, performs the method of processing a picture according to any one of claims 1-7.
CN202110384912.3A 2021-04-09 2021-04-09 Picture processing method and device and electronic equipment Pending CN113177876A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110384912.3A CN113177876A (en) 2021-04-09 2021-04-09 Picture processing method and device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110384912.3A CN113177876A (en) 2021-04-09 2021-04-09 Picture processing method and device and electronic equipment

Publications (1)

Publication Number Publication Date
CN113177876A true CN113177876A (en) 2021-07-27

Family

ID=76924931

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110384912.3A Pending CN113177876A (en) 2021-04-09 2021-04-09 Picture processing method and device and electronic equipment

Country Status (1)

Country Link
CN (1) CN113177876A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116957893A (en) * 2023-06-26 2023-10-27 海易科技(北京)有限公司 Watermark generation method, watermark generation device, electronic device and computer readable medium

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2000315998A (en) * 1999-01-24 2000-11-14 Hiroichi Okano Method and system for encrypting image
AU2002301752B2 (en) * 2001-11-28 2004-02-12 Canon Kabushiki Kaisha Encrypting a Coded Representation of an Image to Prevent Unauthorised Access
US20090262931A1 (en) * 2006-10-31 2009-10-22 Fujitsu Limited Device, method, and program for image encryption/decryption
US20140016817A1 (en) * 2011-03-22 2014-01-16 Fujitsu Limited Position information adding apparatus, position information adding method, and computer program for adding position information and position detection apparatus
CN104680077A (en) * 2015-01-20 2015-06-03 中兴通讯股份有限公司 Picture encryption method and picture checking method, system and terminal
CN105405092A (en) * 2015-11-26 2016-03-16 熊桂荣 Secure digital image propagation method based on reversible watermark and mosaic technology
CN109784071A (en) * 2018-12-28 2019-05-21 易票联支付有限公司 A kind of encryption method of picture, decryption method and processing system
CN110458747A (en) * 2019-07-29 2019-11-15 淮阴工学院 The reversible watermarking algorithm of robust based on invariant features
US20200126176A1 (en) * 2018-10-23 2020-04-23 International Business Machines Corporation Watermarking a digital image
CN111400745A (en) * 2019-11-20 2020-07-10 杭州海康威视系统技术有限公司 Picture management method and device and electronic equipment

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2000315998A (en) * 1999-01-24 2000-11-14 Hiroichi Okano Method and system for encrypting image
AU2002301752B2 (en) * 2001-11-28 2004-02-12 Canon Kabushiki Kaisha Encrypting a Coded Representation of an Image to Prevent Unauthorised Access
US20090262931A1 (en) * 2006-10-31 2009-10-22 Fujitsu Limited Device, method, and program for image encryption/decryption
US20140016817A1 (en) * 2011-03-22 2014-01-16 Fujitsu Limited Position information adding apparatus, position information adding method, and computer program for adding position information and position detection apparatus
CN104680077A (en) * 2015-01-20 2015-06-03 中兴通讯股份有限公司 Picture encryption method and picture checking method, system and terminal
CN105405092A (en) * 2015-11-26 2016-03-16 熊桂荣 Secure digital image propagation method based on reversible watermark and mosaic technology
US20200126176A1 (en) * 2018-10-23 2020-04-23 International Business Machines Corporation Watermarking a digital image
CN109784071A (en) * 2018-12-28 2019-05-21 易票联支付有限公司 A kind of encryption method of picture, decryption method and processing system
CN110458747A (en) * 2019-07-29 2019-11-15 淮阴工学院 The reversible watermarking algorithm of robust based on invariant features
CN111400745A (en) * 2019-11-20 2020-07-10 杭州海康威视系统技术有限公司 Picture management method and device and electronic equipment

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116957893A (en) * 2023-06-26 2023-10-27 海易科技(北京)有限公司 Watermark generation method, watermark generation device, electronic device and computer readable medium
CN116957893B (en) * 2023-06-26 2024-04-16 海易科技(北京)有限公司 Watermark generation method, watermark generation device, electronic device and computer readable medium

Similar Documents

Publication Publication Date Title
Shih Digital watermarking and steganography: fundamentals and techniques
Thangadurai et al. An analysis of LSB based image steganography techniques
US7607017B2 (en) Embedding data in material
Hsu et al. Copyright protection scheme for digital images using visual cryptography and sampling methods
EP0898396B1 (en) Electronic watermark system, electronic information distribution system, and image filing apparatus
Al-Frajat et al. Hiding data in video file: An overview
US10979746B2 (en) Video stream display and protection method and device
JP2001518651A (en) Watermarking digital objects
Hamid et al. Robust image hashing scheme using Laplacian pyramids
Katariya Digital watermarking
Muyco et al. Least significant bit hash algorithm for digital image watermarking authentication
CN113177876A (en) Picture processing method and device and electronic equipment
KR101809086B1 (en) System for Suppling and Authenticating Digital Contents using Real Time Image Watermarking Technic
CN109672804B (en) Image encryption and decryption method and system
Arya et al. A review on different digital watermarking techniques
Yang Robust high-capacity watermarking scheme based on Euclidean norms and quick coefficient alignment
KR20150136320A (en) System and Method for Embedding and Extracting Digital Watermark Using QR Code
Kozina Discrete Fourier transform as a basis for steganographic method
Iacobici et al. Digital imaging processing and reconstruction for general applications
Lysenko et al. Applying of Kutter-Jordan-Bossen steganographic algorithm in video sequences
Rao et al. A novel information security scheme using cryptic steganography
Ur-Rehman et al. Digital watermarking for image authentication
Dadkhah et al. Efficient image authentication and tamper localization algorithm using active watermarking
Li et al. Protection of digital mammograms on PACSs using data hiding techniques
Singh Digital image steganography

Legal Events

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