An electronic decoding method for optical watermark anti-counterfeiting seal
The optical watermark seal is automatically decoded by an electronic decoding method, which solves the problem of complex decoding operation in the existing technology, realizes an efficient and flexible decoding process, and adapts to the increase in business volume and flexibility requirements.
Patent Information
- Application Number
- CN202110191252.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-02-19
- Publication Date
- 2025-09-23
- Estimated Expiration
- 2041-02-19
AI Technical Summary
The existing optical watermark seal decoding method requires batch customization of decoding chips and manual operation, which makes the operation complex and inflexible, and difficult to adapt to the increase in business volume and flexibility requirements.
An electronic decoding method is adopted to segment the five-pointed star area from the official seal image, calculate the center coordinates and the maximum inscribed square area, calculate the mean of wavelength, angle and superimposed image, and use affine transformation to minimize the objective function to achieve automatic decoding.
It eliminates the need for producing and preserving physical decoding films, and achieves efficient, flexible and convenient optical watermark seal decoding, adapting to the needs of real business scenarios.
Smart Images

Figure CN113012014B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of optical watermark decoding, in particular to an electronic decoding method of an optical watermark anti-counterfeiting seal. Background Art
[0002] Currently, optical watermark seal decoding on the market all uses physical grating decoding chips, which have the following problems: 1. The decoding chips need to be customized in batches and then distributed to specific groups of people, and the physical decoding chips need to be stored; 2. The physical decoding chips need to be manually operated for decoding, which is complex and inefficient. With the increasing business volume of application industries and the demand for business flexibility, a more flexible and convenient decoding technology is needed.
[0003] To this end, the present invention provides an electronic decoding method for an optical watermark anti-counterfeiting seal, which effectively solves the problems of the above-mentioned traditional optical watermark decoding method. Summary of the Invention
[0004] In order to achieve the purpose of the present invention, the following technical solutions are adopted:
[0005] An electronic decoding method for an optical watermark anti-counterfeiting seal comprises the following steps: step 1. segmenting the five corner areas of a five-pointed star from an official seal image; step 2. calculating the center coordinates of a five-pointed star grayscale image and a decoding slice image, as well as the maximum inscribed square area of the five corner areas of the five-pointed star; step 3. calculating the wavelength, angle and mean value of the superimposed image of the decoding slice image and the five-pointed star grayscale image; step 4. calculating the wavelength difference and the angle difference to obtain a target function; step 5. performing an affine transformation of the five-pointed star grayscale image with different scaling ratios, translation distances and rotation angles, and then performing steps 2, 3 and 4, and repeating the above operations until the value of the target function is minimized.
[0006] The decoding method, wherein step 1 comprises: first, segmenting a five-pointed star image from the complete image of the official seal; then calculating the maximum inscribed circle of the entire five-pointed star; then removing the inscribed circle area to obtain the areas of five non-connected corners; the complete image of the official seal is extracted from an image file obtained by scanning or photographing a paper document printed with the official seal pattern, wherein the official seal pattern contains an optical watermark.
[0007] The decoding method, wherein step 2 includes: using the center coordinates of the maximum inscribed circle in step 1 as the center coordinates of the five-pointed star image, and using the coordinates of the center of the rectangular decoding slice image as the center coordinates of the decoding slice image; calculating the maximum inscribed circles of the five corner areas of the five-pointed star respectively, assuming that the center coordinates of the five maximum inscribed circles are C1(x1, y1), C2(x2, y2), C3(x3, y3), C4(x4, y4), and C5(x5, y5), and the radii are r1, r2, r3, r4, and r5 respectively; and obtaining the coordinate positions of the maximum inscribed square areas of the five corners respectively:
[0008]
[0009]
[0010]
[0011]
[0012]
[0013] Where Rect i The four elements in (i∈{1,2,3,4,5}) represent: the horizontal coordinate of the upper left corner of the largest inscribed square area, the vertical coordinate of the upper left corner of the area, the width of the area, and the height of the area.
[0014] The decoding method, wherein step 3 comprises: aligning the centers of the decoded slice image and the five-pointed star grayscale image, and then respectively creating five largest inscribed squares Rect in the five-pointed star grayscale image and the decoded slice image. i The square images are cropped from the region (i∈{1,2,3,4,5}) and windowed Fourier transform is performed on each of them to obtain five spectrograms. The center of each square image is taken as the coordinate origin, and the angle value A is represented by the angle between the center of the brightest point in the square image spectrogram and the line connecting the center of the square image spectrogram and the horizontal axis of the coordinate system. Assuming that the length of the spectrum image is L1 and the distance between the brightest point and the image center is L2, the wavelength is:
[0015]
[0016] Assuming the coordinates of the brightest point's center pixel are (x', y') and the coordinates of the square spectrum center are (L1 / 2, L1 / 2), the angle value A is:
[0017]
[0018] The calculated angle values of the decoded slice spectrum graph are A1, A2, A3, A4, and A5, and the wavelength values are W1, W2, W3, W4, and W5 respectively; the angle values corresponding to the brightest points in the five-pointed star spectrum graph and the decoded slice spectrum graph in the same quadrant are A1', A2', A3', A4', and A5', and the wavelength values are W1', W2', W3', W4', and W5' respectively; after the five-pointed star grayscale image is aligned with the center of the decoded slice image, the overlay operation is performed according to the overlay rule to obtain the result image; and the average pixel value of the result image in the five corners of the five-pointed star is denoted as M.
[0019] The decoding method, wherein: there are two brighter points in the whole picture of the decoded chip spectrum diagram, and they are centrally symmetrical. It is only necessary to find any one of them as the brightest point, and record its quadrant and position, which is recorded as position (a, b). The five-pointed star spectrum diagram also finds the brightest point in the corresponding quadrant. Assume that the brightest point position is (a' i ,b' i ), i represents the number of the brightest point,
[0020]
[0021] Find the value of i when the s value is minimum, and use the corresponding brightest point as the brightest point of the five-pointed star spectrum graph.
[0022] In the decoding method, step 4 is calculated according to the following formula:
[0023] A * =A1+A2+A3+A4+A5-A′1-A′2-A′3-A′4-A′5 (Formula 4)
[0024] W * =W1+W2+W3+W4+W5-W1'-W′2-W′3-W′4-W′5 (Formula 5)
[0025] Among them A * is the angle difference between the five-pointed star grayscale image and the electronic decoding image, W * It is the wavelength difference between the five-pointed star grayscale image and the electronic decoding film image.
[0026] Get the objective function: V = A * +W * +M (Formula 6).
[0027] In the decoding method, step 5 includes: when the objective function value V is minimum, aligning the five-pointed star grayscale image with the center of the decoded slice image to obtain a result image in which the middle area of the five-pointed star displays the hidden optical watermark character. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] Figure 1 This is a flow chart of the electronic decoding method of the present invention;
[0029] Figure 2 is the grayscale image of the input complete image;
[0030] Figure 3 The image of the segmented five-pointed star;
[0031] Figure 4 The five corner images of the five-pointed star are segmented;
[0032] Figure 5 is the decoded slice image;
[0033] Figure 6 An image that marks the largest inscribed circles of the five corners of a five-pointed star;
[0034] Figure 7 To mark the image of the largest inscribed square of the five corners of the pentagram;
[0035] Figure 8 For the five-pointed star grayscale image in Rect i The image of (i∈{1,2,3,4,5});
[0036] Figure 9 To decode the slice image in Rect i The image of (i∈{1,2,3,4,5});
[0037] Figure 10 For Figure 8 The image after the windowed Fourier transform of the image;
[0038] Figure 11 For Figure 9 The image after the windowed Fourier transform of the image;
[0039] Figure 12 It is the image obtained by superimposing the decoded slice image and the five-pointed star grayscale image;
[0040] Figure 13 This is an example of successful decoding. DETAILED DESCRIPTION
[0041] The following is combined with Figure 1-13 Specific embodiments of the present invention are described in detail.
[0042] The electronic decoding sheet and optical watermark stamp of the present invention are composed of multiple nonlinear stripes. When the electronic decoding sheet is used to generate the optical watermark five-pointed star stamp, the center of the five-pointed star coincides with the center of the electronic decoding sheet, requiring center alignment during the electronic decoding process. Furthermore, the hidden information is placed within the center of the five-pointed star, and the optical watermark stripes of the hidden information are completely opposite to those of the electronic decoding sheet. The portion without hidden information is located at the five corners of the five-pointed star, and within these corners, the optical watermark stripes are identical to those of the electronic decoding sheet.
[0043] Therefore, the conditions for electronic decoding are as follows: after the electronic decoding image is aligned with the center of the five-pointed star grayscale image, the wavelength and angle of the stripes in the five-pointed star area where the hidden information is located are the same as the wavelength and angle of the stripes in the corresponding position of the electronic decoding image. The wavelength corresponds to the pixel width of each stripe, and the angle corresponds to the direction of each stripe.
[0044] like Figure 1 As shown, the electronic decoding method of the optical watermark anti-counterfeiting seal includes the following steps:
[0045] Step 1: Segment the five corners of the five-pointed star. First, convert the official seal into a complete grayscale image (such as Figure 2 As shown) Figure 3 Calculate the maximum inscribed circle of the entire five-pointed star, which is a circle whose five inner corner vertices are all on its circumference. Then remove the inscribed circle area and remove the pixels within the inscribed circle area to make it pure white, and obtain the area of the five non-adherent corners (as shown in the figure). Figure 4 The inscribed circle has a certain width, and the width standard is to ensure that the areas of the five corners of the five-pointed star left after the inscribed circle area is removed are not connected to each other.
[0046] The complete image of the official seal is directly obtained from an image file obtained by scanning or photographing a paper document printed with the official seal pattern. Only the five-pointed star pattern in the official seal pattern contains an optical watermark. The optical watermark and electronic decoding chip can be generated by existing technologies, such as Chinese patent application CN 111476703 A.
[0047] Step 2: Calculate the five-pointed star grayscale image and decoded slice image (such as Figure 5 The decoded slice image is a grayscale image with black and white stripes, which can be generated by existing technology, such as the center coordinates of Chinese patent application CN 111476703 A) and the maximum inscribed square area of the five corners of the five-pointed star. The center coordinates of the maximum inscribed circle in step 1 are used as the center coordinates of the five-pointed star image, and the coordinates of the center of the rectangular decoded slice image are used as the center coordinates of the decoded slice image. Calculate the maximum inscribed circles of the five corners of the five-pointed star (such as Figure 6Assume that the coordinates of the centers of the five largest inscribed circles are C1(x1,y1), C2(x2,y2), C3(x3,y3), C4(x4,y4), and C5(x5,y5), and their radii are r1, r2, r3, r4, and r5 respectively. The largest inscribed circle is the largest inscribed circle of each corner left after removing the largest inscribed circle area of the five-pointed star. The largest inscribed circle is the circle with the largest radius among the inscribed circles. The largest inscribed square area of the five corners can be obtained (as shown in the figure). Figure 7 The white square inside the white circle is the largest inscribed square of the largest inscribed circle. The horizontal and vertical sides of the largest inscribed square are parallel to the horizontal and vertical axes respectively. Coordinate position:
[0048]
[0049]
[0050]
[0051]
[0052]
[0053] Where Rect i The four elements in (i∈{1,2,3,4,5}) represent: the horizontal coordinate of the upper left corner of the largest inscribed square area, the vertical coordinate of the upper left corner of the area, the width of the area, and the height of the area. The largest inscribed square is the largest inscribed square of the largest inscribed circle mentioned above.
[0054] Step 3: Calculate the wavelength, angle and mean of the superimposed image of the decoded image and the five-pointed star grayscale image. Align the centers of the decoded image and the five-pointed star grayscale image, and then create the five largest inscribed squares Rect in the five-pointed star grayscale image and the decoded image respectively. i (i∈{1,2,3,4,5}) area to crop the square image (e.g. Figure 8 and Figure 9 ), and perform windowed Fourier transform to obtain the five square spectra (as shown in Figure 10 and Figure 11 ).
[0055] Taking the center of each square image as the coordinate origin, let the angle value A represent the angle between the center of the brightest point in the square image spectrum and the line connecting the center of the square image spectrum and the positive direction of the horizontal axis of the coordinate system, where the brightest point in the spectrum refers to the point with the largest pixel value.
[0056] For the brightest point, there will be two relatively bright points in the entire decoded slice spectrum diagram, and they are centrally symmetrical. You only need to find any one of them as the brightest point and record its quadrant and position, which is recorded as position (a, b). The five-pointed star spectrum diagram also looks for the brightest point in the corresponding quadrant. If there is only one brightest point in the quadrant, you can directly select it.
[0057] If there are multiple brightest points in this quadrant, assume that the brightest point is (a' i ,b' i ), i represents the serial number of the brightest point, and the brightest point is selected according to formula 1.
[0058]
[0059] Assuming that the s value obtained when i=n is the smallest, the nth brightest point is selected as the brightest point, and is used to calculate the wavelength and angle of the five-pointed star square spectrum diagram below.
[0060] Assuming that the pixel side length of the square spectrum image is L1 and the pixel distance between the center of the brightest point and the center of the image is L2, the wavelength is:
[0061]
[0062] Assuming the coordinates of the brightest point's center pixel are (x', y') and the coordinates of the square spectrum center are (L1 / 2, L1 / 2), the angle value A is:
[0063]
[0064] The angle values of the decoded slice spectrum obtained by design are A1, A2, A3, A4, A5, and the wavelength values are W1, W2, W3, W4, W5. The angle values corresponding to the brightest points in the five-pointed star spectrum in the same quadrant as the decoded slice spectrum are A1', A2', A3', A4', A5', and the wavelength values are W1', W2', W3', W4', W5'. After the five-pointed star grayscale image is aligned with the center of the decoded slice image, the superposition operation is performed according to the superposition rules to obtain the result image ( Figure 12 ). Calculate the sum of the pixel values in the five corners of the five-pointed star in the result image, then divide it by the number of pixels to get the average pixel value of the area, and then plot the result image in the five corners of the five-pointed star ( Figure 5 The average pixel value of the five corners of the five-pointed star is denoted as M. The superposition rule is as follows: the decoded slice is an image composed of black and white stripes. When superimposing, if the decoded slice image is black, the superimposed image will display the color of the decoded slice image; if the decoded slice image is white, the superimposed image will display the color of the five-pointed star image.
[0065] Step 4: Calculate the wavelength difference and angle difference to obtain the objective function.
[0066] A * =A1+A2+A3+A4+A5-A′1-A′2-A′3-A′4-A′5 (Formula 4)
[0067] W * =W1+W2+W3+W4+W5-W1'-W′2-W′3-W′4-W′5 (Formula 5)
[0068] Among them A * is the angle difference between the five-pointed star grayscale image and the electronic decoding image, W * It is the wavelength difference between the five-pointed star grayscale image and the electronic decoding film image.
[0069] The objective function can be obtained:
[0070] V=A * +W * +M (Formula 6)
[0071] Step 5: Perform affine transformation of the five-pointed star grayscale image with different scaling ratios, translation distances, and rotation angles, and then perform steps 2, 3, and 4 repeatedly until the value of V in formula 6 is minimized. When the value of V is minimized, the decoding is successful. At this time, the center of the five-pointed star grayscale image is aligned with the center of the decoded image to obtain the result. The middle area of the five-pointed star in the result image shows the hidden optical watermark character (such as Figure 13 ).
[0072] Through the present invention, after decoding, the Figure 5 The center area of the star clearly displays the hidden optical watermark information, which can be used to verify the authenticity of the seal. This electronic decoding technology eliminates the numerous steps involved in producing and storing physical grating decoding sheets, eliminating the need for manual decoding of physical decoding sheets. Automatic decoding replaces the complex manual decoding of physical decoding sheets, making optical watermark seal decoding and authenticity verification more efficient, flexible, and convenient, better suited to the needs of real-world business scenarios.
Claims
1. An electronic decoding method for an optical watermark anti-counterfeiting seal, characterized in that The following steps are involved: Step 1. Segment the five corners of a five-pointed star from the official seal image. First, segment the five-pointed star image from the complete seal image; then calculate the maximum inscribed circle of the entire five-pointed star; then remove the inscribed circle region to obtain five non-connected corner regions; the official seal image contains an optical watermark; Step 2. Calculate the center coordinates of the five-pointed star grayscale image and the decoded chip image, and align the centers of the decoded chip image and the five-pointed star grayscale image; Step 3. Calculate the wavelength, angle, and mean of the superimposed image of the decoded chip image and the five-pointed star grayscale image. Calculating the mean of the superimposed image includes aligning the centers of the five-pointed star grayscale image and the decoded chip image, then superimposing them according to the superposition rule to obtain a result image. The average value of the pixels in the five corners of the five-pointed star in the result image is used as the mean of the superimposed image; Step 4. Calculate the wavelength and angle differences between the five-pointed star grayscale image and the electronic decoded chip image, and derive the objective function based on the wavelength and angle differences and the mean of the superimposed image; Step 5. Perform affine transformation of the five-pointed star grayscale image with different scaling ratios, translation distances, and rotation angles, and then perform steps 2, 3, and 4 repeatedly until the objective function value is minimized. When the objective function value is minimized, align the five-pointed star grayscale image with the center of the decoded image to obtain the result image in which the hidden optical watermark characters are displayed in the middle area of the five-pointed star.
2. The decoding method according to claim 1, characterized in that Step 1 includes: extracting the complete image of the official seal from an image file obtained by scanning or photographing a paper document printed with the official seal pattern.
Citation Information
Patent Citations
Manufacturing method of optical watermark
CN111476703A
Electronic device, physical seal identification method and computer readable storage medium
CN108491870A
Encryption and decryption method for anti-counterfeit image-text information of halftone region of image
CN108510427A