CN112884859B - Anti-fake image generation and identification method and device and computer storage medium - Google Patents

Anti-fake image generation and identification method and device and computer storage medium Download PDF

Info

Publication number
CN112884859B
CN112884859B CN202110194516.4A CN202110194516A CN112884859B CN 112884859 B CN112884859 B CN 112884859B CN 202110194516 A CN202110194516 A CN 202110194516A CN 112884859 B CN112884859 B CN 112884859B
Authority
CN
China
Prior art keywords
image
graphic code
frequency domain
target image
counterfeiting
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110194516.4A
Other languages
Chinese (zh)
Other versions
CN112884859A (en
Inventor
丁伟伟
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Advanced New Technologies Co Ltd
Original Assignee
Advanced New Technologies 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 Advanced New Technologies Co Ltd filed Critical Advanced New Technologies Co Ltd
Priority to CN202110194516.4A priority Critical patent/CN112884859B/en
Publication of CN112884859A publication Critical patent/CN112884859A/en
Application granted granted Critical
Publication of CN112884859B publication Critical patent/CN112884859B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T1/00General purpose image data processing
    • G06T1/0021Image watermarking
    • 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
    • G06T11/002D [Two Dimensional] image generation
    • G06T11/001Texturing; Colouring; Generation of texture or colour
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T19/00Manipulating 3D models or images for computer graphics
    • G06T19/006Mixed reality
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T9/00Image coding
    • G06T9/007Transform coding, e.g. discrete cosine transform

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • General Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Discrete Mathematics (AREA)
  • Computer Graphics (AREA)
  • Multimedia (AREA)
  • Health & Medical Sciences (AREA)
  • Bioethics (AREA)
  • General Health & Medical Sciences (AREA)
  • Computer Security & Cryptography (AREA)
  • Editing Of Facsimile Originals (AREA)
  • Image Analysis (AREA)

Abstract

The embodiment of the application provides a method and a device for generating an anti-counterfeiting image, wherein the method comprises the following steps: acquiring an original image to be processed; generating a graphic code according to a graphic code algorithm; performing space domain to frequency domain transformation on the original image, and calculating amplitude coding of gray level variation degree in the original image on the frequency domain; performing spectrum superposition on the amplitude code and the graphic code; and carrying out frequency domain-to-space domain transformation on the result after the frequency spectrum superposition to generate an anti-counterfeiting image containing the graphic code. By applying the embodiment, graphic code codes for anti-counterfeiting are added in the frequency domain of the original image by utilizing space domain to frequency domain transformation; the anti-counterfeiting image generated by the transformation from the frequency domain to the space domain contains the graphic code, but the graphic code is invisible to naked eyes; therefore, the anti-counterfeiting degree of the image can be better improved, and the difficulty and cost of cracking the anti-counterfeiting image are improved.

Description

Anti-fake image generation and identification method and device and computer storage medium
Technical Field
The embodiment of the application relates to the technical field of computers, in particular to a method and a device for generating and identifying an anti-counterfeiting image and a computer storage medium.
Background
With the continuous development of image processing technology, more and more means for processing images are provided, and the image processing functions are more and more powerful.
Image processing may provide many benefits to people, for example, people may beautify photographs using image processing software. However, some people may use image processing techniques to do some of the illicit violations.
Taking AR (Augmented Reality, augmented reality technology) red envelope as an example, a user can put an electronic greeting card, gift, etc. into the "red envelope" and then store the "red envelope" in a designated location for other users to find. When other users find the 'red package', the positions indicated by the 'red package' can be found according to the cue image provided by the 'red package', and the 'red package' can be obtained after taking a picture identical to the image in the cue image.
In the prior art, in order to prevent some users from directly taking a photograph of a thread map to obtain a virtual object, some anti-counterfeiting marks, such as watermarking (Watermark), are generally added to the thread map. However, the thread map thus subjected to the anti-counterfeit processing still has a risk of being deciphered, for example, the anti-counterfeit mark added in the thread map may be removed by PS.
Disclosure of Invention
The generation and identification methods, the identification devices and the computer storage medium of the anti-counterfeiting image solve the problems that the anti-counterfeiting image is easy to be deciphered and the security is low in the prior art.
According to a first aspect of embodiments of the present application, a method for generating an anti-counterfeit image is provided, the method including:
acquiring an original image to be processed;
generating a graphic code according to a graphic code algorithm;
performing space domain to frequency domain transformation on the original image, and calculating amplitude coding of gray level variation degree in the original image on the frequency domain;
performing spectrum superposition on the amplitude code and the graphic code;
and carrying out frequency domain-to-space domain transformation on the result after the frequency spectrum superposition to generate an anti-counterfeiting image containing the graphic code.
According to a second aspect of embodiments of the present application, there is provided a method for identifying an anti-counterfeit image, the method including:
receiving a request for identifying whether the target image is an anti-counterfeiting image;
acquiring an original image corresponding to the anti-counterfeiting image;
performing space domain to frequency domain transformation on the target image, and calculating a first type of amplitude coding of gray level variation degree in the target image on the frequency domain;
Performing space domain to frequency domain transformation on the original image, and calculating second-class amplitude codes of gray level variation degree in the original image on the frequency domain;
performing spectrum superposition inverse operation on the first type of amplitude codes and the second type of amplitude codes;
performing frequency domain-to-spatial domain transformation on the frequency spectrum superposition inverse operation result to generate detection images with different contents between the target image and the original image;
performing noise detection of the graphic code on the detection image;
and determining whether the target image is an anti-counterfeiting image according to the noise detection result of the graphic code.
According to a third aspect of embodiments of the present application, there is provided an apparatus for generating an anti-counterfeit image, the apparatus including:
an acquisition unit that acquires an original image to be processed;
the first generation unit generates graphic code codes according to a graphic code algorithm;
the computing unit is used for carrying out space domain to frequency domain transformation on the original image and computing amplitude codes of gray level variation degree in the original image on the frequency domain;
the frequency spectrum superposition unit is used for performing frequency spectrum superposition on the amplitude codes and the graphic code codes;
and the second generation unit is used for carrying out frequency domain to space domain transformation on the result of the frequency spectrum superposition to generate an anti-counterfeiting image containing the graphic code.
According to a fourth aspect of embodiments of the present application, there is provided an apparatus for identifying an anti-counterfeit image, the apparatus including:
a receiving unit that receives a request for identifying whether the target image is an anti-counterfeit image;
the acquisition unit acquires an original image corresponding to the anti-counterfeiting image;
the first computing unit is used for performing space domain to frequency domain transformation on the target image and computing first-class amplitude codes of gray level variation degree in the target image on the frequency domain;
the second calculating unit is used for carrying out space domain to frequency domain transformation on the original image and calculating second-class amplitude codes of gray level variation degree in the original image on the frequency domain;
a third calculation unit for performing spectrum superposition inverse operation on the first-class amplitude codes and the second-class amplitude codes;
the generation unit is used for carrying out frequency domain-to-space domain transformation on the frequency spectrum superposition inverse operation result to generate detection images with different contents between the target image and the original image;
the detection unit is used for detecting the noise of the graphic code on the detection image;
and the identification unit is used for determining whether the target image is an anti-counterfeiting image according to the noise detection result of the graphic code.
According to a fifth aspect of embodiments of the present application, there is provided a computer storage medium, comprising:
A processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to:
acquiring an original image to be processed;
generating a graphic code according to a graphic code algorithm;
performing space domain to frequency domain transformation on the original image, and calculating amplitude coding of gray level variation degree in the original image on the frequency domain;
performing spectrum superposition on the amplitude code and the graphic code;
and carrying out frequency domain-to-space domain transformation on the result after the frequency spectrum superposition to generate an anti-counterfeiting image containing the graphic code.
According to a sixth aspect of embodiments of the present application, there is provided a computer storage medium, comprising:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to:
receiving a request for identifying whether the target image is an anti-counterfeiting image;
acquiring an original image corresponding to the anti-counterfeiting image;
performing space domain to frequency domain transformation on the target image, and calculating a first type of amplitude coding of gray level variation degree in the target image on the frequency domain;
performing space domain to frequency domain transformation on the original image, and calculating second-class amplitude codes of gray level variation degree in the original image on the frequency domain;
Performing spectrum superposition inverse operation on the first type of amplitude codes and the second type of amplitude codes;
performing frequency domain-to-spatial domain transformation on the frequency spectrum superposition inverse operation result to generate detection images with different contents between the target image and the original image;
performing noise detection of the graphic code on the detection image;
and determining whether the target image is an anti-counterfeiting image according to the noise detection result of the graphic code.
In the embodiment of the application, graphic code codes for anti-counterfeiting are added in the frequency domain of the original image by utilizing space domain to frequency domain conversion; the anti-counterfeiting image generated by the transformation from the frequency domain to the space domain contains the graphic code, but the graphic code is invisible to naked eyes; therefore, the anti-counterfeiting degree of the image can be better improved, and the difficulty and cost of cracking the anti-counterfeiting image are improved. And when the target image is identified as the anti-counterfeiting image, the detection image of different contents of the target image and the anti-counterfeiting image is obtained by utilizing the frequency domain-to-spatial domain conversion, and then whether the graphic code exists can be judged by utilizing the noise detection of the graphic code.
Drawings
FIG. 1 is a schematic flow chart of a method for generating an anti-counterfeit image according to an embodiment of the present application;
FIG. 2 is a schematic diagram of an interface of an AR red packet according to an embodiment of the present application;
FIG. 3 is an interface schematic diagram of a saffron in an AR red packet according to an embodiment of the present disclosure;
FIG. 4a is a schematic diagram of an original image according to an embodiment of the present application;
FIG. 4b is a schematic diagram of a frequency domain image of the original image of FIG. 4a after Fourier transform according to an embodiment of the present application;
FIG. 5 is a schematic diagram of a bar code and corresponding frequency domain image according to an embodiment of the present application;
FIGS. 6a-6c are schematic diagrams of adding a random number sequence in a graphic code encoding according to an embodiment of the present application;
FIG. 7 is a schematic flow chart diagram of a method for identifying an anti-counterfeit image according to an embodiment of the present application;
FIG. 8 is a hardware configuration diagram of a device where the anti-counterfeit image generation apparatus provided in the present application is located;
FIG. 9 is a schematic block diagram of an apparatus for generating an anti-counterfeit image according to an embodiment of the present application;
FIG. 10 is a hardware block diagram of a device in which an identification device for an anti-counterfeit image provided in the present application is located;
fig. 11 is a schematic block diagram of an identification device for an anti-counterfeit image according to an embodiment of the present application.
Detailed Description
Reference will now be made in detail to exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, the same numbers in different drawings refer to the same or similar elements, unless otherwise indicated. The implementations described in the following exemplary examples are not representative of all implementations consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with some aspects of the present application as detailed in the accompanying claims.
The terminology used in the embodiments of the application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in this application and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used herein refers to and encompasses any or all possible combinations of one or more of the associated listed items.
It should be understood that although the terms first, second, third, etc. may be used herein to describe various information, these information should not be limited by these terms. These terms are only used to distinguish one type of information from another. For example, a first message may also be referred to as a second message, and similarly, a second message may also be referred to as a first message, without departing from the scope of the present application. The word "if" as used herein may be interpreted as "at … …" or "at … …" or "responsive to a determination", depending on the context.
Referring to fig. 1, a schematic flowchart of a method for generating an anti-counterfeit image according to an embodiment of the present application may be applied to a server, where the method includes the following steps:
Step 110: and acquiring an original image to be processed.
Step 120: and generating the graphic code according to the graphic code algorithm.
Generally, the graphic code algorithm may output a graphic code after calculating any input data.
In one implementation:
the data of the input graphic code algorithm can be the geographic position carried by the original image; the step 120 may specifically include:
and calculating the graphic code codes corresponding to the geographic positions of the original images according to a graphic code algorithm.
In another implementation:
the data of the input graphic code algorithm can be a user identification for uploading the original image; the step 120 may specifically include:
and calculating the graphic code corresponding to the user identification uploading the original image according to a graphic code algorithm.
The user identification may be, for example, a user ID, a user-bound phone number, etc.
In another implementation:
the data of the input graphic code algorithm can also be a random number which is randomly generated; the step 120 may specifically include:
and calculating the graphic code codes corresponding to the random numbers according to the graphic code algorithm.
In this embodiment, taking the geographical location carried by the original image as an example, the graphic code algorithm may convert the geographical location into graphic code. Typically, the same geographic location is calculated to yield a unique graphic code.
It should be noted that the graphic code may include a bar code, a two-dimensional code, and the like. Correspondingly, if the bar code is the graphic code algorithm, the graphic code algorithm can be a preset bar code algorithm; if the two-dimensional code is the two-dimensional code, the graphic code algorithm can be a preset two-dimensional code algorithm.
The bar code will be described below as an example.
The graphic code algorithm may be a code128 coding algorithm. The code128 encoding algorithm may generate a variable length, continuous, alphanumeric bar code. The code has three different coding types of code128a, code128b and code128c, and can provide the coding use of 128 characters in standard ASCII (American Standard Code for Information Interchange ); two-way scanning can be allowed, so that the identification of the bar code is facilitated; optionally, a check bit is added; the bar code length is adjustable but cannot exceed 232 characters including a start bit and an end bit.
In this embodiment, in general, the geographic location may be a longitude and latitude coordinate point, for example, (x, y), where x represents a longitude value and y represents a latitude value.
The geographical position carried by the original image can be the current geographical position when the client uploads the original image or the current geographical position when the original image is shot.
The current geographic location may be a location where the client is located, and the coordinate information representing the location is recorded by a positioning device in the client. Common positioning devices may employ the U.S. GPS satellite navigation system, the european "galileo" satellite navigation system, the russian GLONASS satellite navigation system, the chinese "beidou" satellite navigation system, etc., or similar combinations. The coordinate information of such a positioning is also called mobile positioning.
The current geographic position can also be converted based on the characteristics of the client signal, for example, the position information obtained by the network operator through the signal of the client through the base station positioning calculation by utilizing the base station coverage principle. In the latter positioning calculation, the client measures the downlink pilot signals of different base stations, so as to obtain the Arrival Time (TOA) or the Arrival Time difference (Time Difference of Arrival, TDOA) of the downlink pilot signals of different base stations, and based on the measurement result and combining the coordinates of the base stations, a trigonometric formula estimation algorithm is generally adopted to calculate the position of the mobile terminal. The actual position estimation algorithm needs to consider the situation of positioning of multiple base stations (3 or more than 3), and various algorithms exist in the prior art, so that the method is complex. In general, the greater the number of base stations measured by a mobile station, the higher the measurement accuracy, and the more significant the improvement in positioning performance.
In addition, the current geographic position can also be a more accurate position obtained by assisting in positioning through a base station and combining with a positioning device in the client.
An AR (Augmented Reality ) red packet scene will be described below as an example. The image based on the geographic position may refer to a live-action photo based on the geographic position, which is uploaded by the AR red packet setter. Referring to fig. 2, fig. 2 is a schematic diagram of an AR red packet home page of an AR client according to the present embodiment.
As shown in fig. 2, in the "AR red package front page", a "hidden red package" function button (corresponding to the second entry option) and a "find red package" function button (corresponding to the first entry option) may be provided. The user can enter the 'Tibetan red package' interface shown in fig. 3 by triggering the 'Tibetan red package' function button, at this time, the above-mentioned AR client can call the camera carried on the AR terminal equipment (such as a smart phone or AR glasses, etc.), execute real-time image scanning on the offline environment of the user, and combine with the current geographic position, and 'hide' a certain amount of red packages on the current geographic position.
Of course, in practical applications, a certain error may exist in the geographic position obtained by the positioning of the AR client to the user, or the position range is not accurate enough, and in this case, the user may also correct the current geographic address in the red packet binding page.
After the AR client locates the current geographic position, the scanned image can be uploaded to an AR server, so that the process of storing the red packet is completed.
For the AR server, the original image based on the geographic position uploaded by the AR client can be obtained. And then, the AR server needs to perform anti-counterfeiting processing on the original image based on the geographic position, so as to obtain a clue image (anti-counterfeiting image) of the AR red packet, wherein the clue image is used for providing the geographic position and the live-action photo of the user looking for the red packet to go to the saffron packet.
Step 130: and carrying out space domain to frequency domain transformation on the original image, and calculating amplitude coding of gray level variation degree in the original image on the frequency domain.
In this embodiment, the spatial to frequency domain transform may be a fourier transform (Fourier Transform, FT).
The specific implementation method of the above-mentioned spatial domain to frequency domain transformation is not particularly limited in this example, and those skilled in the art can refer to the descriptions in the related art when the technical scheme of the present application is put into practice. For example, discrete fourier transform (Discrete Fourier transform, DFT), fast fourier transform (Fast Fourier Transform, FFT), etc. are employed.
In general, the fourier transform (Fourier Transform, FT) may represent a function that can represent a certain condition as a trigonometric function (sine and/or cosine function) or a linear combination of their integrals.
In the field of image processing, an original image can be converted from a Spatial Domain (Spatial Domain) to a Frequency Domain (Frequency Domain) by fourier transformation, so that a Frequency Domain image can be drawn. The frequency domain image may represent the magnitude of the gray level variation in the original image in the frequency domain.
A schematic representation of the original image as shown in fig. 4a, and a schematic representation of the frequency domain image of the original image after fourier transformation as shown in fig. 4 b.
In the frequency domain image, the abscissa may represent the frequency f, and the unit may be Hertz (HZ); the ordinate representation may be an amplitude representing the degree of gray scale variation in the original image.
Generally, the more intense the gray level change in the original image, the larger the amplitude value reflected on the frequency domain image; the flatter the gray level variation in the original image, the smaller the amplitude that appears on the frequency domain image.
And after the amplitude values are arranged according to the frequency, the amplitude value code can be obtained. For example, a 50hz amplitude of 3, a 100hz amplitude of 2, and a 150hz amplitude of 5; the amplitude coding is {3,2,5}.
Typically, each pixel in the image may be represented by an RGB color pattern, i.e. using three components R (red), G (green), B (blue). In a computer, the size of RGB may refer to brightness, and may be generally expressed by integers, and R, G, B may each have 256 levels of brightness, and numbers 0, 1, 2, 3 … …, 255 are generally used, that is, R, G, B each have a range of values from 0 to 255. Thus, 256×256=16777216 different colors can be displayed by using the RGB color mode.
In the RGB color mode, when r=g=b, the color may be expressed as one gray color. In general, the value of r=g=b may be referred to as a gradation value, and the range of gradation values is 0 to 255. Therefore, for an original image, RGB values in the original image first need to be converted into gray values, and the conversion by the gray values can be achieved as follows:
in a first implementation, a component method may be employed:
and (3) selecting one component value as a gray value at will from three components of RGB in the color image. That is, the user may select only the value of the R component as the gray value according to the needs of the actual application; only the value of the G component may be selected as the gray value; it is also possible to select only the value of the B component as the gradation value.
In a second implementation, a maximum method may be employed:
the maximum value of the RGB three components in the color image is taken as a gray value. The formula for calculating the gray value may be: max (R, G, B). For example, if a certain RGB three component is (r=122, g=90, b=200), the maximum value b=200 may be regarded as a gray value, that is, the gray value is 200.
In a third implementation, an average method may be used:
the RGB three components in the color image are summed to calculate an average value, and the average value is used as a gray value. Thus, the formula for calculating the gray value may be: (R+G+B)/3.
In a fourth implementation, a weighted average may be employed:
in this implementation, a weight may be set for each component in advance, and a weighted average may be performed on the RGB three components during calculation, and the weighted average may be used as the gray value. Generally, the set weight can be the highest for green sensitivity and the lowest for blue sensitivity according to practical application requirements, for example, the human eye can set a high weight such as 0.59 for G, a low weight such as 0.11 for B, and an intermediate weight such as 0.3 for R; thus, the formula for calculating the gray value may be: (0.3 R+0.59G+0.11B)/3.
Step 140: and carrying out frequency spectrum superposition on the amplitude codes and the graphic codes.
In this embodiment, the amplitude obtained after fourier transform is subjected to spectrum superposition with the coded value of the graphic code, so that the graphic code information based on the geographic position is added in the frequency domain of the original image.
The specific implementation method of the above-mentioned spectrum superposition is not particularly limited in this example, and those skilled in the art can refer to the descriptions in the related art when the technical scheme of the present application is put into practice. Such as spectral summation, etc.
Step 150: and carrying out frequency domain-to-space domain transformation on the result after the frequency spectrum superposition to generate an anti-counterfeiting image containing the graphic code.
The frequency domain to spatial domain transformation is the inverse implementation of the spatial domain to frequency domain transformation with respect to the aforementioned spatial domain to frequency domain transformation.
Taking the space-to-frequency domain transform as an example, the frequency-to-space domain transform is an inverse fourier transform. The inverse fourier transform may transform the frequency domain into the spatial domain, thereby recovering a two-dimensional image.
As described above, the graphic code information is added to the frequency domain of the original image by spectral superposition. And performing frequency domain-to-space domain transformation on the result of the spectrum superposition to generate an anti-counterfeiting image containing the graphic code.
Since the graphic code is added to the frequency domain of the original image, the generated anti-counterfeit image contains the graphic code, but the graphic code is invisible to the naked eye.
As shown in fig. 5, the bar code and the frequency domain image corresponding to the bar code are shown, and it can be seen that the frequency domain image of the bar code is relatively simple; therefore, after the bar code and the amplitude code are subjected to spectrum superposition, the influence of the bar code on the original image is small, and in the anti-counterfeiting image generated after the inverse Fourier transform, the added bar code cannot be seen by naked eyes.
By the embodiment, graphic code codes for anti-counterfeiting are added in the frequency domain of the original image by utilizing space domain to frequency domain transformation; the anti-counterfeiting image generated by the transformation from the frequency domain to the space domain contains the graphic code, but the graphic code is invisible to naked eyes; therefore, the anti-counterfeiting degree of the image can be better improved, and the difficulty and cost of cracking the anti-counterfeiting image are improved.
In the scene of the AR red packet, after the anti-counterfeiting treatment is carried out on the original image uploaded by the AR red packet setting side by the method, a graphic code can be added into the frequency domain of the original image as an anti-counterfeiting watermark in a mode of space domain to frequency domain conversion and frequency spectrum superposition, and the anti-counterfeiting image containing the graphic code is generated through the frequency domain to space domain conversion; thus, such an anti-counterfeit image is used as a clue map of the AR red packet. Since the invisible graphic code is added in the cue map, when the AR red packet is taken by using the forged cue map, noise generated by the graphic code can be identified, so that the AR red packet is not allowed to be taken.
In the practical application process, as the invisible graphic code for anti-counterfeiting is added in the anti-counterfeiting picture, the graphic code is not usually displayed.
However, based on the embodiment shown in fig. 1, in a specific embodiment, after the step 150, the method may further include:
generating a corresponding graphic code according to the graphic code;
and adding the visible graphic code in a set area of the anti-counterfeiting image.
In this embodiment, a visible graphic code is added to the generated anti-counterfeit image. In this way, an additional interaction mode can be provided, namely, when other users scan the anti-counterfeiting image, the visible graphic code can be identified, so that other information corresponding to the graphic code can be obtained. And the user experience is improved.
For example, if the graphic code is generated based on the geographical location carried by the original image, the graphic code may be identified by scanning the anti-counterfeit image, so as to obtain the geographical location. In the scene of the AR red packet, by adding the visible graphic code, a user searching for the AR red packet can acquire the geographic position corresponding to the visible graphic code through scanning the cue image (namely the anti-fake image), and the geographic position is the hidden place of the AR red packet. And the user experience is improved.
Of course, if the graphic code is displayed, a certain risk may exist, and the anti-counterfeiting image is easily decoded by a person. To solve this problem, based on the embodiment shown in fig. 1, in a specific embodiment, after the step 120, the method may further include:
generating a random number sequence with a set length according to a random sequence algorithm;
and adding the random number sequence into the graphic code to obtain the graphic code containing the random number sequence.
In this embodiment, the random sequence algorithm may randomly generate a random number sequence, where the length of the random number sequence may be preset; and adding the generated random number sequence to the encoded value of the graphic code.
As shown in fig. 6a, the generated random number sequence may be added before the encoding of the graphic code.
As described in fig. 6b, the generated random number sequence may be added after the encoding of the graphic code.
As described in fig. 6c, the generated random number sequence may be added anywhere between the graphic code encodings.
According to the embodiment, the random number sequence is added on the basis of the graphic code coding, so that the difficulty and cost for decoding the graphic code coding are improved, and the security of the generated anti-counterfeiting image is higher.
Of course, the present embodiment may be implemented in an embodiment in which adding visible graphic codes is not performed.
To solve the security problem after the graphic code is displayed, in a specific embodiment, after the step 120, the method may further include, based on the embodiment shown in fig. 1:
encrypting the graphic code;
and determining the encrypted graphic code as a new graphic code.
In this embodiment, the encryption mode generally adopts a symmetric encryption algorithm that can be decrypted. Such as DEA (Data Encryption Algorithm ), DES (Data Encryption Standard, data encryption standard), etc.
Specifically, the encrypting the graphic code may include:
encrypting the graphic code by utilizing the geographic position carried by the original image;
and/or the number of the groups of groups,
and encrypting the graphic code by using the user identification of the original image.
The geographical location and the user identification have been described in the foregoing embodiments, and are not described in detail herein.
By the embodiment, the graphic code coding value is encrypted, so that the difficulty and cost for decoding the graphic code coding are improved, and the security of the generated anti-counterfeiting image is higher. Of course, the present embodiment may be implemented in an embodiment in which adding visible graphic codes is not performed.
It should be noted that, in the practical application process, if an anti-counterfeit image is generated, the corresponding identification process for the anti-counterfeit image generated by using the above embodiment should also be provided:
i.e. on the basis of the embodiment shown in fig. 1, the method may further comprise the following steps:
a1: receiving a request for identifying whether a target image is the anti-counterfeiting image;
a2: performing space domain to frequency domain transformation on the target image, and calculating amplitude coding of gray level variation degree in the target image on the frequency domain;
a3: performing spectrum superposition inverse operation on the amplitude coding of the target image and the amplitude coding of the original image;
a4: performing frequency domain-to-spatial domain transformation on the frequency spectrum superposition inverse operation result to generate detection images with different contents between the target image and the original image;
a5: performing noise detection of the graphic code on the detection image;
a6: and determining whether the target image is an anti-counterfeiting image according to the noise detection result of the graphic code.
The step A6 may specifically include:
under the condition that the noise value obtained by noise detection of the graphic code is larger than the set noise value, determining that the target image is an anti-counterfeiting image;
And under the condition that the noise value obtained by noise detection of the graphic code is not larger than the set noise value, determining that the target image is not an anti-counterfeiting image.
In a specific embodiment, after the step A1, the method may further include:
calculating the similarity of the target image and the original image;
and (3) executing the step A2 when the similarity is larger than a set threshold value.
In a specific embodiment, after the step A1, the method may further include:
performing noise detection of graphic codes on the target image;
executing step A2 under the condition that the noise value detected by the noise of the graphic code is larger than the set noise value;
and under the condition that the noise value detected by the noise of the graphic code is not larger than the set noise value, determining that the target image is not an anti-counterfeiting image.
In a specific embodiment, after the step A3, the method may further include:
acquiring a random number sequence used in the process of generating the anti-counterfeiting image;
and deleting the random number sequence from the frequency spectrum superposition inverse operation result.
In a specific embodiment, after the step A3, the method may further include:
Acquiring an encryption algorithm used in the process of generating the anti-counterfeiting image;
and decrypting the result of the spectrum superposition inverse operation.
In a specific embodiment, the graphic code comprises a bar code or a two-dimensional code.
In a specific embodiment, the target image is a live-action photo uploaded by a capturing party of the AR red packet;
the anti-counterfeiting image is a clue diagram of the AR red packet;
and the original image is a live-action photo uploaded by the AR red packet setting party.
Specifically, the steps of the above anti-counterfeiting image identification process may be shown in fig. 7, which is a schematic flowchart of an anti-counterfeiting image identification method provided in an embodiment of the present application, and may be applied to a server, where the method includes the following steps:
step 210: a request is received to identify whether the target image is a security image.
Step 220: and obtaining an original image corresponding to the anti-counterfeiting image.
As previously described, the security image is generated on the basis of the original image. Therefore, the corresponding relation between the anti-counterfeiting image and the original image is stored in the server.
For the request in step 210, since whether the target object a is the anti-counterfeit image B needs to be identified, a corresponding original image C may be obtained according to the anti-counterfeit image B.
The AR red packet scenario is still illustrated as an example. The target image is a live-action photo uploaded by a capturing party of the AR red packet;
the anti-counterfeiting image is a clue diagram of the AR red packet;
and the original image is a real-scene photo based on the geographic position, which is uploaded by the AR red packet setter.
Step 230: and carrying out space domain to frequency domain transformation on the target image, and calculating first-class amplitude codes of gray level variation degree in the target image on the frequency domain.
This step is similar to step 130 in the above embodiment, and will not be repeated here.
Step 240: and carrying out space domain to frequency domain transformation on the original image, and calculating second-type amplitude codes of gray level variation degree in the original image on the frequency domain.
This step is similar to step 130 in the above embodiment, and will not be repeated here.
Step 250: and performing spectrum superposition inverse operation on the first type of amplitude codes and the second type of amplitude codes.
In this embodiment, the second-type amplitude code S2 and the first-type amplitude code S1 are subjected to spectrum superposition inverse operation, so that different contents Sx between the original image and the target image can be obtained.
The formula of the inverse operation of the spectrum superposition is as follows:
S X =S 2 -S 1
Step 260: and carrying out frequency domain to space domain transformation on the frequency spectrum superposition inverse operation result to generate detection images with different contents between the target image and the original image.
The frequency domain to spatial domain transformation is already described in the foregoing step 150, and will not be described here again.
After the spectrum superposition inverse operation in the step 250, the obtained result mainly represents different contents between the target image and the original image; therefore, the generated detection image is the image with different contents between the target image and the original image through the frequency domain to spatial domain operation of the step.
The detection image is described in various cases:
if the target image is the anti-counterfeiting image, the result of spectrum superposition inverse operation is different contents between the anti-counterfeiting image and the original image, namely, the graphic code added in the frequency domain in the process of generating the anti-counterfeiting image is coded, and the graphic code is converted from an invisible frequency domain to a visible space domain through frequency domain-space domain conversion, namely, the generated detection image can comprise the visible graphic code.
Assuming that the target image is a fake image (certain image processing is performed on the fake image so as to be not identical to the fake image), the result after the spectrum superposition inverse operation contains graphic code codes added in a frequency domain (under the condition of not being destroyed) or residual graphic code codes (under the condition of being destroyed), and thus the generated detection image can contain visible graphic codes or partial graphic codes through frequency domain-to-space domain transformation.
If the target image is not the anti-fake image, the result after the spectrum superposition inverse operation does not contain the graphic code added on the frequency domain in the process of generating the anti-fake image, so that the graphic code does not exist in the detection image after the frequency domain is transformed into the space domain.
Step 270: and detecting the noise of the graphic code on the detected image.
Step 280: and determining whether the target image is an anti-counterfeiting image according to the noise detection result of the graphic code.
The noise detection of the graphics code may be used to determine whether the graphics code is present in the image, which may generate noise of a certain magnitude because the graphics code is an abrupt content with respect to other content in the image.
Specifically, the step 280 may include:
when the noise value obtained by noise detection of the graphic code is larger than the set noise value, the residual graphic code is indicated, and the image is obviously a processed image (for example, a photo photographed in reality does not have the graphic code), so that the target image can be determined to be an anti-counterfeiting image;
or,
and under the condition that the noise value obtained by noise detection of the graphic code is not larger than the set noise value, determining that the target image is not an anti-counterfeiting image.
The present embodiment may be compatible with the foregoing embodiment of the generation of the security image, that is, the present embodiment mainly identifies the security image generated by the foregoing method of generating the security image.
According to the embodiment, when whether the target image is the anti-counterfeiting image or not is identified, the detection images of different contents of the target image and the anti-counterfeiting image are obtained through frequency domain-to-spatial domain conversion, and further whether the graphic code exists or not can be judged through noise detection of the graphic code. Therefore, whether the graphic code is specifically the graphic code added in the anti-counterfeiting image or not is not required to be identified, and the target object can be determined to be the anti-counterfeiting image only by detecting the graphic code in the image, so that the identification complexity is reduced, and the identification cost is reduced.
In the AR red packet scene, by utilizing the identification method of the anti-counterfeiting image, whether the real image is a clue image (namely the anti-counterfeiting image) of the AR red packet can be judged aiming at the real image (namely the target image) uploaded by the capturing party of the AR red packet. If the cue image directly forged by the retriever serves as a live-action image (namely a target image), the invisible graphic code is necessarily contained in the result obtained by the spectrum superposition inverse operation because the invisible graphic code exists in the cue image; thus, a residual graphic code appears in the detected image after the inverse fourier transform, and can be detected.
Based on the embodiment shown in fig. 7, in a specific implementation of the present application, after the step 220, the method may further include:
calculating the similarity of the target image and the original image;
in case the similarity is greater than a set threshold, performing the step 230;
and under the condition that the similarity is not larger than a set threshold value, determining that the target image is not a false proof image and the target object is different from the original object.
In this embodiment, the similarity is calculated based on an image recognition algorithm. The image recognition algorithm may be a scale invariant feature transform algorithm (Scale Invariant Feature Transform, SIFT), although the image recognition algorithm may be other, such as SURF (Speeded Up Robust Features), ORB (ORiented Brief), LIOP (Local Intensity Order Pattern), etc., which is not limited in this application. Because the image recognition algorithm is a general algorithm in the field of image recognition, a detailed image recognition process thereof is not described in this embodiment.
In this embodiment, the set threshold may be an empirical value set manually in advance.
If the calculated similarity between the target image and the original image is greater than the set threshold, it is determined that the target image and the original image are relatively similar, but it cannot be determined whether the target image is a counterfeit-proof image, and thus further verification is required, the following step 230 is performed.
If the similarity between the target image and the original image is calculated to be not greater than the set threshold value, the target image and the original image are not similar, and it can be determined that the target image is not a false proof image and the target image and the original image are not the same.
Still taking the AR red packet scenario as an example. The target image is a live-action photo uploaded by a capturing party of the AR red packet; the anti-counterfeiting image is a clue diagram of the AR red packet; and the original image is a real-scene photo based on the geographic position, which is uploaded by the AR red packet setter.
If the similarity between the target image and the original image is greater than the set threshold, it indicates that the live-action image uploaded by the AR red packet capturing party is similar to the live-action image uploaded by the AR red packet setting party, but it cannot be determined whether the target image is a cue image, so that further verification is performed, and then the subsequent step 230 is executed;
if the similarity between the target image and the original image is not greater than the set threshold value, the fact that the live-action image uploaded by the AR red packet capturing party is different from the live-action image uploaded by the AR red packet setting party is indicated, and the AR red packet cannot be captured by the capturing party.
In the generation mode of the anti-counterfeiting image, the visible graphic code is added to the set area of the anti-counterfeiting image. Based on the embodiment shown in fig. 7, in a specific implementation of the present application, after the step 220, the method may further include:
Performing noise detection of graphic codes on the target image;
in case that the noise value detected by the noise of the graphic code is greater than the set noise value, performing the step 230;
and under the condition that the noise value detected by the noise of the graphic code is not larger than the set noise value, determining that the target image is not an anti-counterfeiting image.
In this embodiment, the graphic code may include a bar code or a two-dimensional code. Generally, if a bar code is used in the generation of the anti-counterfeit image, noise detection of the bar code may also be used in this embodiment;
if two-dimensional codes are adopted in the generation of the anti-counterfeiting image, noise detection of the two-dimensional codes can be adopted in the embodiment.
In the generation mode of the anti-counterfeiting image, the embodiment of the graphic code coding comprising the random number sequence is generated on the basis of the graphic code coding according to the random sequence algorithm. Based on the embodiment shown in fig. 7, in one specific implementation of the present application, after the step 250, the method may further include:
acquiring a random number sequence used in the process of generating the anti-counterfeiting image;
and deleting the random number sequence from the frequency spectrum superposition inverse operation result.
In practical application, if invisible graphic codes exist, the original graphic codes are restored by deleting the random number sequences added in the process of generating the graphic codes.
In the generation mode of the anti-counterfeiting image, the embodiment of encrypting the graphic code is described. Based on the embodiment shown in fig. 7, in one specific implementation of the present application, after the step 250, the method may further include:
acquiring an encryption algorithm used in the process of generating the anti-counterfeiting image;
and decrypting the result of the spectrum superposition inverse operation.
In this embodiment, corresponding to the encryption process, if the graphic code is encrypted by using the geographic location carried by the original image, the amplitude value is still decrypted by using the geographic location;
if the graphic code is encrypted by using the user identification uploading the image, the amplitude value is still decrypted by using the user identification.
Corresponding to the foregoing embodiment of the method for generating an anti-counterfeiting image shown in fig. 1, the present application further provides an embodiment of an apparatus for generating an anti-counterfeiting image. The embodiment of the device can be implemented by software, or can be implemented by hardware or a combination of hardware and software. Taking a software implementation as an example, the device in a logic sense is formed by reading corresponding computer program instructions in a nonvolatile memory into a memory by a processor of a device where the device is located for operation. In terms of hardware, as shown in fig. 8, a hardware structure diagram of a device where the security device of the present application is located is shown in fig. 8, and in addition to the processor, the network interface, the memory and the nonvolatile memory shown in fig. 8, the device where the device is located in the embodiment generally may include other hardware according to the actual function of improving security, which is not described herein again.
Referring to fig. 9, a block diagram of an apparatus for generating an anti-counterfeit image according to an embodiment of the present application is applied to a server, where the apparatus may include:
an acquisition unit 310 that acquires an original image to be processed;
a first generation unit 320 for generating a graphic code according to a graphic code algorithm;
a calculating unit 330, configured to perform spatial domain to frequency domain transformation on the original image, and calculate an amplitude code of a gray level variation degree in the original image on a frequency domain;
a spectrum superimposing unit 340 that performs spectrum superimposition on the amplitude code and the graphic code;
the second generating unit 350 performs frequency domain to spatial domain transformation on the result of the spectrum superposition, and generates an anti-counterfeit image including the graphic code.
In an alternative embodiment:
after the second generating unit 350, the apparatus further comprises:
a generating subunit, configured to generate a corresponding graphic code according to the graphic code;
and an adding subunit for adding the visible graphic code in the setting area of the anti-counterfeiting image.
In an alternative embodiment:
after the first generation unit 320, the apparatus further comprises:
a generation subunit, for generating a random number sequence with a set length according to a random sequence algorithm;
An adding subunit, configured to add the random number sequence to the graphic code to obtain a graphic code containing a random number sequence;
and a determining subunit for determining the graphic code containing the random number sequence as a new graphic code.
In an alternative embodiment:
after the first generation subunit 320, the apparatus further comprises:
an encryption subunit, configured to encrypt the graphic code;
and the determining subunit is used for determining the encrypted graphic code as a new graphic code.
In an alternative embodiment:
the encryption subunit specifically comprises:
and encrypting the graphic code by using the geographic position.
In an alternative embodiment:
the encryption subunit specifically comprises:
and encrypting the graphic code by using the user identification of the original image.
In an alternative embodiment:
the graphic code comprises a bar code or a two-dimensional code.
In an alternative embodiment:
the original image is a live-action photo uploaded by an AR red packet setting party;
the anti-counterfeiting image containing the graphic code is a clue diagram of the AR red packet.
In an alternative embodiment:
The apparatus further comprises:
a receiving subunit that receives a request for identifying whether the target image is an anti-counterfeit image;
a first calculating subunit, configured to perform spatial domain-to-frequency domain transformation on the target image, and calculate an amplitude code of a gray level variation degree in the target image on a frequency domain;
the second calculating subunit performs spectrum superposition inverse operation on the amplitude coding of the target image and the amplitude coding of the original image;
a generation subunit, which performs frequency domain to space domain transformation on the result of the spectrum superposition inverse operation to generate detection images with different contents between the target image and the original image;
a detection subunit, for detecting the noise of the graphic code for the detected image;
and the identification subunit is used for determining whether the target image is an anti-counterfeiting image according to the noise detection result of the graphic code.
In an alternative embodiment:
the identification subunit specifically comprises:
the first identification subunit determines that the target image is an anti-counterfeiting image under the condition that the noise value obtained by noise detection of the graphic code is larger than the set noise value;
or,
and the second identification subunit determines that the target image is not an anti-counterfeiting image under the condition that the noise value obtained by noise detection of the graphic code is not larger than the set noise value.
In an alternative embodiment:
after the receiving subunit, the apparatus further comprises:
a similarity calculation subunit for calculating the similarity between the target image and the original image;
the first computing subunit specifically includes:
and under the condition that the similarity is larger than a set threshold value, performing space domain to frequency domain transformation on the target image, and calculating amplitude coding of gray level variation degree in the target image on the frequency domain.
In an alternative embodiment:
after the receiving subunit, the apparatus further comprises:
a detection subunit, configured to perform noise detection of a graphics code on the target image;
a third recognition subunit, configured to determine that the target image is not an anti-counterfeit image when the noise value detected by the noise of the graphics code is not greater than the set noise value;
the first computing subunit specifically includes:
and under the condition that the noise value detected by the noise of the graphic code is larger than the set noise value, performing space domain to frequency domain transformation on the target image, and calculating amplitude coding of gray level variation degree in the target image on the frequency domain.
In an alternative embodiment:
after the second computing subunit, the apparatus further comprises:
An acquisition subunit, for acquiring a random number sequence used in the process of generating the anti-counterfeiting image;
and the deleting subunit deletes the random number sequence from the frequency spectrum superposition inverse operation result.
In an alternative embodiment:
after the second computing subunit, the apparatus further comprises:
an acquisition subunit, configured to acquire an encryption algorithm used in the process of generating the anti-counterfeit image;
and the decryption subunit decrypts the result of the spectrum superposition inverse operation.
In an alternative embodiment:
the graphic code comprises a bar code or a two-dimensional code.
In an alternative embodiment:
the target image is a live-action photo uploaded by a capturing party of the AR red packet;
the anti-counterfeiting image is a clue diagram of the AR red packet;
and the original image is a live-action photo uploaded by the AR red packet setting party.
Corresponding to the foregoing embodiment of the method for identifying an anti-counterfeiting image shown in fig. 7, the present application further provides an embodiment of an apparatus for identifying an anti-counterfeiting image. The embodiment of the device can be implemented by software, or can be implemented by hardware or a combination of hardware and software. Taking a software implementation as an example, the device in a logic sense is formed by reading corresponding computer program instructions in a nonvolatile memory into a memory by a processor of a device where the device is located for operation. In terms of hardware, as shown in fig. 10, a hardware structure diagram of a device where a device for improving security of the present application is located is shown in fig. 10, and in addition to a processor, a network interface, a memory, and a nonvolatile memory shown in fig. 10, the device where the device is located in the embodiment generally may include other hardware according to the actual function for improving security, which is not described herein again.
Referring to fig. 11, a block diagram of an apparatus for identifying an anti-counterfeit image according to an embodiment of the present application is applied to a server, where the apparatus may include:
a receiving unit 410 that receives a request for identifying whether the target image is an anti-counterfeit image;
an obtaining unit 420, configured to obtain an original image corresponding to the anti-counterfeit image;
a first calculating unit 430, configured to perform spatial domain to frequency domain transformation on the target image, and calculate a first type of amplitude coding of a gray level variation degree in the target image on a frequency domain;
a second calculating unit 440, configured to perform spatial domain to frequency domain transformation on the original image, and calculate a second type of amplitude encoding of the gray level variation degree in the original image on the frequency domain;
a third calculation unit 450, performing spectrum superposition inverse operation on the first-type amplitude codes and the second-type amplitude codes;
a generating unit 460, configured to perform frequency domain to spatial domain transformation on the result of the spectrum stacking inverse operation, and generate a detection image of different contents between the target image and the original image;
a detection unit 470 for detecting noise of the graphic code on the detected image;
and an identification unit 480 for determining whether the target image is an anti-counterfeit image according to the noise detection result of the graphic code.
In an alternative embodiment:
the identifying unit 480 specifically includes:
the first identification subunit determines that the target image is an anti-counterfeiting image under the condition that the noise value obtained by noise detection of the graphic code is larger than the set noise value;
or,
and the second identification subunit determines that the target image is not an anti-counterfeiting image under the condition that the noise value obtained by noise detection of the graphic code is not larger than the set noise value.
In an alternative embodiment:
after the acquisition unit 420, the apparatus further comprises:
a calculation subunit for calculating the similarity between the target image and the original image;
the first computing unit 430 specifically includes:
and under the condition that the similarity is larger than a set threshold value, performing space domain to frequency domain transformation on the target image, and calculating first-class amplitude codes of gray level variation degree in the target image on the frequency domain.
In an alternative embodiment:
after the acquisition unit 420, the apparatus further comprises:
a detection subunit, configured to perform noise detection of a graphics code on the target image;
the identification subunit is used for determining that the target image is not an anti-counterfeiting image under the condition that the noise value detected by the noise of the graphic code is not larger than the set noise value;
The first computing unit 430 specifically includes:
and under the condition that the noise value detected by the noise of the graphic code is larger than the set noise value, performing space domain to frequency domain transformation on the target image, and calculating first-class amplitude codes of gray level variation degree in the target image on the frequency domain.
In an alternative embodiment:
after the third computing unit 450, the apparatus further comprises:
an acquisition subunit, for acquiring a random number sequence used in the process of generating the anti-counterfeiting image;
and the deleting subunit deletes the random number sequence from the frequency spectrum superposition inverse operation result.
In an alternative embodiment:
after the third computing unit 450, the apparatus further comprises:
an acquisition subunit, configured to acquire an encryption algorithm used in the process of generating the anti-counterfeit image;
and the decryption subunit decrypts the result of the spectrum superposition inverse operation.
In an alternative embodiment:
the graphic code comprises a bar code or a two-dimensional code.
In an alternative embodiment:
the target image is a live-action photo uploaded by a capturing party of the AR red packet;
the anti-counterfeiting image is a clue diagram of the AR red packet;
And the original image is a live-action photo uploaded by the AR red packet setting party.
The system, apparatus, module or unit set forth in the above embodiments may be implemented in particular by a computer chip or entity, or by a product having a certain function. A typical implementation device is a computer, which may be in the form of a personal computer, laptop computer, cellular telephone, camera phone, smart phone, personal digital assistant, media player, navigation device, email device, game console, tablet computer, wearable device, or a combination of any of these devices.
The implementation process of the functions and roles of each unit in the above device is specifically shown in the implementation process of the corresponding steps in the above method, and will not be described herein again.
For the device embodiments, reference is made to the description of the method embodiments for the relevant points, since they essentially correspond to the method embodiments. The apparatus embodiments described above are merely illustrative, wherein the elements illustrated as separate elements may or may not be physically separate, and the elements shown as elements may or may not be physical elements, may be located in one place, or may be distributed over a plurality of network elements. Some or all of the modules may be selected according to actual needs to achieve the purposes of the present application. Those of ordinary skill in the art will understand and implement the present invention without undue burden.
The above describes the internal functional modules and the structural schematic of the apparatus for generating an anti-counterfeit image, and the substantial execution subject thereof may be a computer storage medium, including:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to:
acquiring an original image to be processed;
generating a graphic code according to a graphic code algorithm;
performing space domain to frequency domain transformation on the original image, and calculating amplitude coding of gray level variation degree in the original image on the frequency domain;
performing spectrum superposition on the amplitude code and the graphic code;
and carrying out frequency domain-to-space domain transformation on the result after the frequency spectrum superposition to generate an anti-counterfeiting image containing the graphic code.
Similarly, the above describes the internal functional modules and the structural schematic of the identification device of the security image, the substantial execution subject of which may be a computer storage medium comprising:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to:
receiving a request for identifying whether the target image is an anti-counterfeiting image;
acquiring an original image corresponding to the anti-counterfeiting image;
Performing space domain to frequency domain transformation on the target image, and calculating a first type of amplitude coding of gray level variation degree in the target image on the frequency domain;
performing space domain to frequency domain transformation on the original image, and calculating second-class amplitude codes of gray level variation degree in the original image on the frequency domain;
performing spectrum superposition inverse operation on the first type of amplitude codes and the second type of amplitude codes;
performing frequency domain-to-spatial domain transformation on the frequency spectrum superposition inverse operation result to generate detection images with different contents between the target image and the original image;
performing noise detection of the graphic code on the detection image;
and determining whether the target image is an anti-counterfeiting image according to the noise detection result of the graphic code.
In the above embodiment of the computer storage medium, it should be understood that the processor may be a central processing unit (english: central Processing Unit, abbreviated as CPU), or may be another general purpose processor, a digital signal processor (english: digital Signal Processor, abbreviated as DSP), an application specific integrated circuit (english: application Specific Integrated Circuit, abbreviated as ASIC), or the like. A general-purpose processor may be a microprocessor or the processor may be any conventional processor, etc., and the aforementioned memory may be a read-only memory (ROM), a random access memory (random access memory, RAM), a flash memory, a hard disk, or a solid state disk. The steps of a method disclosed in connection with the embodiments of the present invention may be embodied directly in a hardware processor for execution, or in a combination of hardware and software modules in the processor for execution.
Other embodiments of the present application will be apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the application following, in general, the principles of the application and including such departures from the present disclosure as come within known or customary practice within the art to which the application pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the application being indicated by the following claims.
It is to be understood that the present application is not limited to the precise arrangements and instrumentalities shown in the drawings, which have been described above, and that various modifications and changes may be effected without departing from the scope thereof. The scope of the application is limited only by the appended claims.

Claims (25)

1. A method of generating an anti-counterfeit image, the method comprising:
acquiring an original image uploaded by a virtual object setting party to be processed;
calculating a graphic code corresponding to the geographic position of the original image;
performing space domain to frequency domain transformation on the original image, and calculating amplitude coding of gray level variation degree in the original image on the frequency domain;
performing spectrum superposition on the amplitude code and the graphic code;
Performing frequency domain-to-space domain transformation on the result of the spectrum superposition to generate an anti-counterfeiting image containing the graphic code codes; adding the visible graphic code corresponding to the graphic code in a set area of the anti-counterfeiting image; wherein the graphic code is used for a user seeking the virtual object to scan to obtain a geographic position representing the hidden place of the virtual object.
2. The method of claim 1, after said computing a graphic code encoding corresponding to a geographic location of the original image, the method further comprising:
generating a random number sequence with a set length according to a random sequence algorithm;
adding the random number sequence into the graphic code to obtain the graphic code containing the random number sequence;
and determining the graphic code containing the random number sequence as a new graphic code.
3. The method of claim 1, after said computing a graphic code encoding corresponding to a geographic location of the original image, the method further comprising:
encrypting the graphic code;
and determining the encrypted graphic code as a new graphic code.
4. A method according to claim 3, said encrypting said graphic code encoding, comprising in particular:
And encrypting the graphic code by using the geographical position carried by the original image.
5. A method according to claim 3, said encrypting said graphic code encoding, comprising in particular:
and encrypting the graphic code by using the user identification of the original image.
6. The method of claim 1, the virtual object comprising an AR red packet; the original image comprises a live-action photo uploaded by an AR red packet setting party; the anti-counterfeiting image comprises a clue diagram of the AR red packet.
7. The method of claim 1, the method further comprising:
receiving a request for identifying whether a target image is the anti-counterfeiting image;
performing space domain to frequency domain transformation on the target image, and calculating amplitude coding of gray level variation degree in the target image on the frequency domain;
performing spectrum superposition inverse operation on the amplitude coding of the target image and the amplitude coding of the original image;
performing frequency domain-to-spatial domain transformation on the frequency spectrum superposition inverse operation result to generate detection images with different contents between the target image and the original image;
performing noise detection of the graphic code on the detection image;
and determining whether the target image is the anti-counterfeiting image according to the noise detection result of the graphic code.
8. The method according to claim 7, wherein the determining whether the target image is the anti-counterfeit image according to the result of the noise detection of the graphic code specifically comprises:
under the condition that the noise value obtained by noise detection of the graphic code is larger than the set noise value, determining the target image as the anti-counterfeiting image;
or,
and under the condition that the noise value obtained by noise detection of the graphic code is not larger than the set noise value, determining that the target image is not the anti-counterfeiting image.
9. The method of claim 7, after the receiving a request to identify whether a target image is the security image, the method further comprising:
calculating the similarity of the target image and the anti-counterfeiting image;
and executing spatial domain to frequency domain transformation on the target image under the condition that the similarity is larger than a set threshold value, and calculating amplitude coding of gray level variation degree in the target image on the frequency domain.
10. The method of claim 7, after the receiving a request to identify whether a target image is the security image, the method further comprising:
performing noise detection of graphic codes on the target image;
Executing spatial domain to frequency domain transformation on the target image under the condition that the noise value detected by the noise of the graphic code is larger than the set noise value, and calculating the amplitude coding of the gray level variation degree in the target image on the frequency domain;
and under the condition that the noise value detected by the noise of the graphic code is not larger than the set noise value, determining that the target image is not an anti-counterfeiting image.
11. The method of claim 7, after said spectrally superimposed inverse operation of said magnitude coding of said target image and said magnitude coding of said original image, said method further comprising:
acquiring a random number sequence used in the process of generating the anti-counterfeiting image;
and deleting the random number sequence from the frequency spectrum superposition inverse operation result.
12. The method of claim 7, after said spectrally superimposed inverse operation of said magnitude coding of said target image and said magnitude coding of said original image, said method further comprising:
acquiring an encryption algorithm used in the process of generating the anti-counterfeiting image;
and decrypting the result of the spectrum superposition inverse operation.
13. The method of claim 1 or 7, the graphical code comprising a bar code or a two-dimensional code.
14. The method of claim 7, the virtual object comprising an AR red packet; the target image comprises a live-action photo uploaded by a collar of the AR red packet; the anti-counterfeiting image comprises a clue diagram of the AR red packet; the original image comprises a live-action photo uploaded by the AR red packet setter.
15. A method of identifying an anti-counterfeit image, the method comprising:
receiving a request for identifying whether the target image is an anti-counterfeiting image; wherein, the anti-fake image is added with visible graphic codes; the graphic code is generated according to the geographic position of the original image uploaded by the virtual object setting party; the graphic code is used for a user searching for the virtual object to scan so as to acquire the geographic position representing the hiding place of the virtual object;
acquiring an original image uploaded by a virtual object setting party corresponding to the anti-counterfeiting image;
performing space domain to frequency domain transformation on the target image, and calculating a first type of amplitude coding of gray level variation degree in the target image on the frequency domain;
performing space domain to frequency domain transformation on the original image, and calculating second-class amplitude codes of gray level variation degree in the original image on the frequency domain;
performing spectrum superposition inverse operation on the first type of amplitude codes and the second type of amplitude codes;
Performing frequency domain-to-spatial domain transformation on the frequency spectrum superposition inverse operation result to generate detection images with different contents between the target image and the original image;
performing noise detection of the graphic code on the detection image;
and determining whether the target image is an anti-counterfeiting image according to the noise detection result of the graphic code.
16. The method according to claim 15, wherein the determining whether the target image is a security image according to the result of the noise detection of the graphic code specifically includes:
under the condition that the noise value obtained by noise detection of the graphic code is larger than the set noise value, determining that the target image is an anti-counterfeiting image;
or,
and under the condition that the noise value obtained by noise detection of the graphic code is not larger than the set noise value, determining that the target image is not an anti-counterfeiting image.
17. The method of claim 15, after the obtaining the original image uploaded by the virtual object setter corresponding to the anti-counterfeit image, the method further comprising:
calculating the similarity of the target image and the original image;
and under the condition that the similarity is larger than a set threshold value, executing spatial domain to frequency domain transformation on the target image, and calculating first-class amplitude coding of gray level variation degree in the target image on the frequency domain.
18. The method of claim 15, after the obtaining the original image uploaded by the virtual object setter corresponding to the anti-counterfeit image, the method further comprising:
performing noise detection of graphic codes on the target image;
executing the step of performing spatial domain to frequency domain transformation on the target image and calculating a first type of amplitude coding of gray level variation degree in the target image on the frequency domain under the condition that the noise value detected by the noise of the graphic code is larger than the set noise value;
and under the condition that the noise value detected by the noise of the graphic code is not larger than the set noise value, determining that the target image is not an anti-counterfeiting image.
19. The method of claim 15, after said spectrally stacking inverse operation of said first and second types of amplitude codes, said method further comprising:
acquiring a random number sequence used in the process of generating the anti-counterfeiting image;
and deleting the random number sequence from the frequency spectrum superposition inverse operation result.
20. The method of claim 15, after said spectrally stacking inverse operation of said first and second types of amplitude codes, said method further comprising:
Acquiring an encryption algorithm used in the process of generating the anti-counterfeiting image;
and decrypting the result of the spectrum superposition inverse operation.
21. The method of claim 15, the graphical code comprising a bar code or a two-dimensional code.
22. The method of claim 15, the target image being a live-action photo uploaded by a leader of an AR red packet;
the anti-counterfeiting image is a clue diagram of the AR red packet;
and the original image is a live-action photo uploaded by the AR red packet setting party.
23. An apparatus for generating an anti-counterfeit image, the apparatus comprising:
the acquisition unit acquires an original image uploaded by a virtual object setting party to be processed;
the first generation unit is used for calculating a graphic code corresponding to the geographic position of the original image;
the computing unit is used for carrying out space domain to frequency domain transformation on the original image and computing amplitude codes of gray level variation degree in the original image on the frequency domain;
the frequency spectrum superposition unit is used for performing frequency spectrum superposition on the amplitude codes and the graphic code codes;
the second generation unit is used for carrying out frequency domain to space domain transformation on the result after the frequency spectrum superposition to generate an anti-counterfeiting image containing the graphic code codes;
An adding subunit, configured to add the visible graphic code corresponding to the graphic code in a set area of the anti-counterfeit image; wherein the graphic code is used for a user seeking the virtual object to scan to obtain a geographic position representing the hidden place of the virtual object.
24. An apparatus for identifying an anti-counterfeit image, the apparatus comprising:
a receiving unit that receives a request for identifying whether the target image is an anti-counterfeit image; wherein, the anti-fake image is added with visible graphic codes; the graphic code is generated according to the geographic position of the original image uploaded by the virtual object setting party; the graphic code is used for a user searching for the virtual object to scan so as to acquire the geographic position representing the hiding place of the virtual object;
the acquisition unit acquires an original image uploaded by a virtual object setting party corresponding to the anti-counterfeiting image;
the first computing unit is used for performing space domain to frequency domain transformation on the target image and computing first-class amplitude codes of gray level variation degree in the target image on the frequency domain;
the second calculating unit is used for carrying out space domain to frequency domain transformation on the original image and calculating second-class amplitude codes of gray level variation degree in the original image on the frequency domain;
A third calculation unit for performing spectrum superposition inverse operation on the first-class amplitude codes and the second-class amplitude codes;
the generation unit is used for carrying out frequency domain-to-space domain transformation on the frequency spectrum superposition inverse operation result to generate detection images with different contents between the target image and the original image;
the detection unit is used for detecting the noise of the graphic code on the detection image;
and the identification unit is used for determining whether the target image is an anti-counterfeiting image according to the noise detection result of the graphic code.
25. A computer storage medium, comprising:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to the method of any of the preceding claims 1-22.
CN202110194516.4A 2017-04-26 2017-04-26 Anti-fake image generation and identification method and device and computer storage medium Active CN112884859B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110194516.4A CN112884859B (en) 2017-04-26 2017-04-26 Anti-fake image generation and identification method and device and computer storage medium

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201710281412.0A CN107248135B (en) 2017-04-26 2017-04-26 Anti-counterfeiting image generation and identification method and device and computer storage medium
CN202110194516.4A CN112884859B (en) 2017-04-26 2017-04-26 Anti-fake image generation and identification method and device and computer storage medium

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
CN201710281412.0A Division CN107248135B (en) 2017-04-26 2017-04-26 Anti-counterfeiting image generation and identification method and device and computer storage medium

Publications (2)

Publication Number Publication Date
CN112884859A CN112884859A (en) 2021-06-01
CN112884859B true CN112884859B (en) 2023-12-26

Family

ID=60016901

Family Applications (2)

Application Number Title Priority Date Filing Date
CN201710281412.0A Active CN107248135B (en) 2017-04-26 2017-04-26 Anti-counterfeiting image generation and identification method and device and computer storage medium
CN202110194516.4A Active CN112884859B (en) 2017-04-26 2017-04-26 Anti-fake image generation and identification method and device and computer storage medium

Family Applications Before (1)

Application Number Title Priority Date Filing Date
CN201710281412.0A Active CN107248135B (en) 2017-04-26 2017-04-26 Anti-counterfeiting image generation and identification method and device and computer storage medium

Country Status (1)

Country Link
CN (2) CN107248135B (en)

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108009616B (en) * 2017-12-12 2021-06-25 陈洪 Novel bar graph code with anti-counterfeiting function and application method
CN110633773B (en) * 2018-06-22 2022-04-12 北京京东尚科信息技术有限公司 Two-dimensional code generation method and device for terminal equipment
US11335214B2 (en) 2019-02-11 2022-05-17 Andrea G. FORTE Content encryption and in-place decryption using visually encoded ciphertext
CN110362700B (en) * 2019-06-17 2023-09-22 中国平安财产保险股份有限公司 Data processing method, device, computer equipment and storage medium
CN112488137A (en) * 2019-09-11 2021-03-12 广州虎牙科技有限公司 Sample acquisition method and device, electronic equipment and machine-readable storage medium
CN111538968A (en) * 2020-05-27 2020-08-14 支付宝(杭州)信息技术有限公司 Identity verification method, device and equipment based on privacy protection
CN113469708B (en) * 2021-06-30 2023-05-02 平安科技(深圳)有限公司 Product anti-counterfeiting processing method and device, computer equipment and storage medium
CN114548140B (en) * 2022-04-26 2022-08-12 成都普什信息自动化有限公司 Two-dimensional code decoding method, data association method, association device and use method
CN118214813B (en) * 2024-05-16 2024-08-23 中电科大数据研究院有限公司 Data security transmission method and system based on intelligent pipe network

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101739699A (en) * 2009-11-30 2010-06-16 刘弘 Anti-counterfeiting pattern manufacturing method for synthesizing fractal graphs
CN102073838A (en) * 2010-12-24 2011-05-25 兆日科技(深圳)有限公司 Method and system for preventing counterfeit by using differentiation of electromagnetic signals of RFID
CN102800043A (en) * 2012-06-19 2012-11-28 邝君 Anti-counterfeiting information overlaying method and identifying method for printed matter and inspection device
CN103886545A (en) * 2014-04-17 2014-06-25 上海理工大学 Transformation domain printing-scanning resistant digital watermarking method based on computer-generated holography
CN105701758A (en) * 2016-01-13 2016-06-22 华南理工大学 Digital watermarking image generation method based on graphic code and apparatus thereof
CN105701757A (en) * 2016-01-13 2016-06-22 华南理工大学 Product antifake method based on digital watermarking and graphic code and apparatus thereof

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100374665B1 (en) * 2001-04-13 2003-03-04 주식회사 마크애니 Method of inserting/detecting digital watermarks and apparatus for using thereof
CN1209730C (en) * 2001-11-30 2005-07-06 温天 Digital anti-fake method
US20150169928A1 (en) * 2012-03-01 2015-06-18 Sys-Tech Solutions, Inc. Methods and a system for verifying the identity of a printed item
CN108809659B (en) * 2015-12-01 2022-01-18 神州融安科技(北京)有限公司 Dynamic password generation method, dynamic password verification method, dynamic password system and dynamic password verification system
CN106230920A (en) * 2016-07-27 2016-12-14 吴东辉 A kind of method and system of AR
CN106447003A (en) * 2016-11-01 2017-02-22 安徽拾穗谷生态科技有限公司 Method for manufacturing and identifying two-dimensional code anti-counterfeit label of agricultural product

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101739699A (en) * 2009-11-30 2010-06-16 刘弘 Anti-counterfeiting pattern manufacturing method for synthesizing fractal graphs
CN102073838A (en) * 2010-12-24 2011-05-25 兆日科技(深圳)有限公司 Method and system for preventing counterfeit by using differentiation of electromagnetic signals of RFID
CN102800043A (en) * 2012-06-19 2012-11-28 邝君 Anti-counterfeiting information overlaying method and identifying method for printed matter and inspection device
CN103886545A (en) * 2014-04-17 2014-06-25 上海理工大学 Transformation domain printing-scanning resistant digital watermarking method based on computer-generated holography
CN105701758A (en) * 2016-01-13 2016-06-22 华南理工大学 Digital watermarking image generation method based on graphic code and apparatus thereof
CN105701757A (en) * 2016-01-13 2016-06-22 华南理工大学 Product antifake method based on digital watermarking and graphic code and apparatus thereof

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
一种基于二维DCT变换的图像信息隐藏方法;孟宪浩等;《光电技术应用》;全文 *
基于二维条形码的数字图像水印算法研究;李明建;《中国优秀硕士学位论文全文数据库》;全文 *
用于证件防伪的数字水印算法研究;冯清枝, 王志群;警察技术(06);全文 *

Also Published As

Publication number Publication date
CN107248135A (en) 2017-10-13
CN107248135B (en) 2021-01-12
CN112884859A (en) 2021-06-01

Similar Documents

Publication Publication Date Title
CN112884859B (en) Anti-fake image generation and identification method and device and computer storage medium
US9805296B2 (en) Method and apparatus for decoding or generating multi-layer color QR code, method for recommending setting parameters in generation of multi-layer QR code, and product comprising multi-layer color QR code
US11010855B2 (en) Method and apparatus for protecting digital photos from alteration
KR101542756B1 (en) Hidden image signaling
US11263441B1 (en) Systems and methods for passive-subject liveness verification in digital media
CN110084013A (en) Biometric templates safety and key generate
EP3234904B1 (en) Method and apparatus for publishing locational copyrighted watermarking video
AU2017266477B2 (en) Method of augmented authentification of a material subject
KR20150110429A (en) Method for enrolling data in a base to protect said data
US11373449B1 (en) Systems and methods for passive-subject liveness verification in digital media
Yahya et al. Steganography techniques
CN109816543B (en) Image searching method and device
CN111259792B (en) DWT-LBP-DCT feature-based human face living body detection method
CN118644780A (en) Object identification method, device, equipment and medium
CN110634096B (en) Self-adaptive multi-mode information hiding method and device
JP2017021603A (en) Validity confirmation device, method, medium issuing device, method, and program
Liu et al. Face liveness detection based on enhanced local binary patterns
CN106373079A (en) Android photo position and time digital watermark embedding and extraction method
Li et al. An image copy move forgery detection method using QDCT
CN113177876A (en) Picture processing method and device and electronic equipment
CN115114557B (en) Page data acquisition method and device based on block chain
Singh et al. Robust and efficient hashing framework for industrial surveillance
Rakesh et al. An Adequate Image Stegnography Method based on Bit Reversed Technique
Bharti et al. Comparison of LSB methods and pattern
Spagnolo et al. Painting authentication by means of a biometric-like approach

Legal Events

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