A method for positioning a steganographic coded pattern
By introducing the design of location code points in both the hidden and non-hidden regions into the stealth coding pattern, and combining specific light rays and filtering algorithms, the problems of high computational load and accuracy loss in existing technologies are solved, and efficient and accurate stealth coding and decoding are achieved.
Patent Information
- Application Number
- CN202211122845.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-15
- Publication Date
- 2025-12-12
- Estimated Expiration
- 2042-09-15
AI Technical Summary
Existing methods for locating images using stealth coding are computationally intensive, slow in decoding, and suffer from accuracy loss due to geometric transformations.
The design employs positioning code points, including both hidden and non-hidden areas. The search direction is determined by utilizing the positional characteristics of the positioning code points. Combined with specific lighting and filtering algorithms, the image acquisition clarity and noise reduction are improved, while reducing computational load.
It improves the efficiency and accuracy of reading invisible coded images, reduces the accuracy loss caused by geometric transformations, and enhances decoding speed and accuracy.
Smart Images

Figure CN115374806B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to a kind of invisible coding pattern positioning method, belong to invisible coding pattern positioning field. BACKGROUND
[0002] Invisible coding pattern hides bar code information in packaging pattern, without destroying packaging pattern, without affecting bar code function, and can meet the need of anti-fake. Its main forms include: overlay invisible bar code, photochemical treatment invisible bar code, invisible ink printing invisible bar code, paper invisible bar code and metal invisible bar code, etc.
[0003] Invisible coding pattern is invisible to naked eye, in order to enable user to obtain image with invisible coding pattern for anti-fake authentication, invisible coding pattern is generally superimposed on other non-invisible coding pattern in prior art, such as patent CN104915702B "anti-fake code pattern with identification point, its generation method and generation device"; or the position of invisible coding pattern is directly marked out. But the above two methods are only for the convenience of user positioning invisible coding pattern, and have no influence on subsequent positioning and decoding of invisible coding pattern.
[0004] Therefore, a new invisible coding pattern positioning method is needed to improve the decoding speed of invisible coding pattern.
[0005] Patent CN110188582B "positioning point identification method in invisible pattern coding on commodity label" discloses the following steps: step 1: invisible pattern coding is carried out on label information, and positioning point is embedded in original invisible pattern coding image; step 2: invisible pattern coding image containing positioning point is printed on label printing medium; step 3: printed coding image is photographed; step 4: photographed image is binarized and black and white morphological processed; step 5: embedded positioning point is identified according to the area difference of data point and positioning point connected component in preprocessed image, and corresponding positioning point coordinates are calculated by using centroid method; step 6: corresponding relationship of positioning point is determined according to triangular positioning identification principle, image positioning and geometric transformation are carried out. The invention uses vector calculation method to judge the direction of positioning point, and the calculation amount is still large. SUMMARY
[0006] In order to overcome the problems in prior art, the present application designs an invisible coding pattern positioning method, positioning code point in invisible coding pattern includes invisible area and non-invisible area, non-invisible area is convenient for user to position invisible coding pattern, invisible area is convenient for decoding algorithm to position coding pattern, to support subsequent decoding; the search direction of code point is determined by using the position characteristics of positioning code point, multiple direction search of code point is avoided, search calculation amount is reduced, search efficiency is improved, recognition efficiency can be greatly improved; at the same time, precision loss caused by geometric transformation is reduced, recognition efficiency and accuracy are improved.
[0007] In order to achieve the above object, the present application adopts the following technical solutions:
[0008] Technical solution one
[0009] A method for positioning a steganographic code pattern, comprising the following steps:
[0010] Obtaining a to-be-processed image;
[0011] Searching for a positioning module in the to-be-processed image; the positioning module comprises a plurality of positioning code points, and each positioning code point comprises a steganographic area and a non-steganographic area;
[0012] Determining a code point searching direction according to a position feature of the positioning module;
[0013] Finding remaining code points according to the code point searching direction to obtain all code points.
[0014] Further, the method further comprises: converting the to-be-processed image into a gray-scale image; converting the gray-scale image into a binary image; and searching for the positioning code points in the binary image.
[0015] Further, the conversion of the to-be-processed image into the gray-scale image is expressed by a formula as follows:
[0016]
[0017] In the formula, r, g and b respectively represent three color components of a pixel point in the to-be-processed image. represents a gray-scale value of a pixel point in the gray-scale image.
[0018] Further, the method further comprises denoising processing of the gray-scale image, which is expressed by a formula as follows:
[0019]
[0020] In the formula, is a gray-scale value of a pixel point in the gray-scale image; is a local gray-scale mean value of the pixel point; is a local gray-scale variance of the pixel point; is a global noise variance of the gray-scale image; is a gray-scale value of a pixel point in the denoised gray-scale image.
[0021] Further, the searching for the positioning module is specifically as follows:
[0022] Searching for a steganographic area of the positioning code point; performing connected domain analysis on a searching result, and determining whether the searching result is the positioning code point according to an area of the connected domain.
[0023] Further, the determination of the code point searching direction is specifically as follows:
[0024] Two positioning code points are taken, a rectangular coordinate system is established according to the relative position relationship of the two positioning code points, and the code point searching direction is determined according to the rectangular coordinate system.
[0025] Further, the remaining code points are searched according to the code point searching direction, specifically:
[0026] The binary image is analyzed according to the code point searching direction to obtain a plurality of connected domains, and the plurality of connected domains are determined as data code points.
[0027] Further, it further comprises: setting an area value domain, and eliminating the connected domains whose areas are not within the area value domain.
[0028] Technical solution two
[0029] An invisible coded pattern comprises:
[0030] A positioning module, the positioning module comprises a plurality of positioning code points, the positioning code points comprise invisible areas and non-invisible areas;
[0031] A data module, the data module comprises a plurality of data code points;
[0032] The invisible areas of the positioning code points and the data module appear under specific light; the invisible areas of the positioning code points are used to indicate the positions of the plurality of data code points.
[0033] Compared with the prior art, the present application has the following characteristics and beneficial effects:
[0034] The positioning code points of the present application comprise invisible areas and non-invisible areas, the non-invisible areas are convenient for users to position the invisible coded pattern, and the invisible areas are convenient for decoding algorithms to position the coded pattern, so as to support subsequent decoding.
[0035] The present application uses the position characteristics of the positioning code points to determine the searching direction of the code points, avoids multi-directional searching of the code points, reduces the searching calculation amount, improves the searching efficiency, greatly improves the recognition efficiency, and reduces the precision loss caused by geometric transformation, improves the recognition efficiency and accuracy.
[0036] The present application can improve the clarity of the images collected by the image acquisition system by using the combination of the invisible ink of the specific wave band and the infrared filter, thereby improving the recognition accuracy;
[0037] The present application uses the filtering algorithm to perform denoising processing on the gray-scale image, which can improve the recognition efficiency and reduce the influence of image blur on recognition. BRIEF DESCRIPTION OF DRAWINGS
[0038] Figure 1 is the flowchart of the present application;
[0039] Figure 2 This is a schematic diagram of the invisible coding graphic on printed packaging;
[0040] Figure 3 This is a schematic diagram of image acquisition.
[0041] Figure 4 This is a schematic diagram of the positioning module;
[0042] Figure 5 This is a schematic diagram of the code point search direction. Detailed Implementation
[0043] The present invention will now be described in more detail with reference to the embodiments.
[0044] A stealth coded pattern includes a positioning module and a data module. Preferably, the stealth coded pattern is a dot matrix pattern.
[0045] The positioning module includes several positioning code points, which include hidden areas and non-hidden areas.
[0046] In this embodiment, as Figure 4 As shown, both the hidden and non-hidden areas of the positioning code points are semi-circular; the positioning module consists of five linearly arranged positioning code points located in the center of the hidden coding pattern. Of course, the hidden area of the positioning code points can also be circular, and the non-hidden area can be annular or other shapes.
[0047] The data module includes several data code points.
[0048] The data code points and the hidden area are printed with near-infrared ink and are visible under specific lighting conditions, but not to the naked eye. The hidden area of the positioning code point is used to indicate the position of the data code point for subsequent decoding algorithms, while the non-hidden area is used to indicate the position of the hidden coded pattern to the user.
[0049] A method for printing invisible coded graphics includes the following steps:
[0050] Obtain the product identifier, generate coding information based on the product identifier, and generate a data module based on the coding information;
[0051] By combining the data module and the positioning module, an coded pattern is obtained;
[0052] like Figure 2 As shown, the locations where dot matrix codes need to be printed are marked in the packaging design draft. To facilitate anti-counterfeiting and traceability, dot matrix codes can be added in multiple places in the design draft to form a variable data area.
[0053] The near-infrared ink printing data module and the invisible area of each positioning code point are used; in the embodiment, the near-infrared ink includes naphthalene phthalocyanine complex (SiNc); the near-infrared absorbing ink is weak in visible light absorption, is strong in infrared absorption and is stable in spectral properties, and is a better invisible dot array code printing material; because the dot array code is small in size, the invisible ink can be used to print on any position and any shape in the printing process, and the infrared absorbing ink is used to print in the dark area, so that a better invisible effect is achieved.
[0054] The non-invisible area of each positioning code point is printed by using common ink.
[0055] As shown in Figure 1 An invisible coded pattern positioning method, comprising the following steps:
[0056] As shown in Figure 3 The user uses a code reading device with an infrared light source to shoot the product packaging according to the indication of the non-invisible area of the positioning code point, and obtains a to-be-processed image.
[0057] The to-be-processed image is subjected to binaryzation processing, and a binaryzation image is obtained.
[0058] The invisible area of the positioning code point is searched in the binaryzation image, the search result is subjected to connected domain analysis, and whether the search result is the positioning code point is determined according to the area of the connected domain.
[0059] As shown in Figure 5 The search direction is determined according to the positioning code point: after one positioning code point is found, the remaining positioning code points are searched in a 45-degree oblique direction until the number of positioning symbols meets five. For the positioning code point that has been determined, the first point and the last point are selected in the order from top to bottom, a vertical line of the last point is drawn through the first point, and the vertical line is recorded as the Y axis; the vertical line of the Y axis is drawn with the first point as the origin, and is recorded as the X axis, so that a rectangular coordinate system is formed.
[0060] The positive axis direction of the rectangular coordinate system is taken as the search direction, the binaryzation image is subjected to connected domain analysis, and the area of the connected domain is calculated.
[0061] (1) The pixel points are analyzed one by one along the positive direction of the X axis, the eight-connected domain of the black pixel points is calculated, and the area of the calculated connected domain is calculated.
[0062] (2) The next half-invisible positioning symbol is found in the row along the positive direction of the Y axis (usually at a position that is more than 3 pixels away from the previous row), the pixel points are analyzed one by one along the positive direction of the X axis, the eight-connected domain of the black pixel points is calculated, and the area of the calculated connected domain is calculated.
[0063] (3) Repeat step (2) and (1) in turn until the line where the locator is located completes all scans and finds all connected domains, and the area thereof is calculated.
[0064] The mean value of the area is calculated by traversing the found connected domain. For a judgment of greater than or less than the mean value times, the interference point is removed; the remaining connected domain is the black data code point; the centroid of the connected domain meeting the condition is calculated; according to the position of the centroid and the area of the connected domain, the points between the two connected domains, i.e. the white data code point, are filled:
[0065] (1) The mean value of the area of the connected domain is denoted as S, and the standard distance between the connected domains is
[0066]
[0067] (2) The distance between the two adjacent connected domains is calculated as
[0068]
[0069] where (x1, y1) is the centroid coordinates of the first connected domain, and (x2, y2) is the centroid coordinates of the second connected domain.
[0070] (3) The value of d / D is calculated, if d / D is 0 or 1, no point is filled; if it is m, m-1 points are filled.
[0071] The black data code point is counted as 1, and the white data code point is counted as 0 to obtain binary data;
[0072] The binary data is decoded according to the coding rule to complete the reading of the invisible coded pattern; and the product on the package is tracked and traced according to the reading result.
[0073] In an embodiment, the image to be processed is converted into a gray-scale image, assuming that the color component of a pixel point in the image to be processed is (r, g, b), the following integer operation formula is used to convert it into a gray-scale image to improve the operation speed:
[0074]
[0075] The gray-scale image is removed by using a filtering algorithm, in order to achieve the best denoising effect and reduce the calculation complexity, an adaptive linear filtering algorithm in the spatial domain is used to filter the image:
[0076]
[0077] wherein, is the gray-scale value of the image containing noise, is the local gray-scale mean value of the pixel point, and The local gray scale variance of the pixel point is calculated, The noise variance of the global image is calculated.
[0078] The adaptive algorithm is used to binarize the gray scale image to obtain a binarized image.
[0079] In one embodiment, the code reading device comprises a light source, a lens, a decoding chip and an image sensor.
[0080] In one embodiment, the infrared light source close to the infrared absorption ink is selected, and a plurality of infrared light sources (usually LEDs) are combined and uniformly distributed at the bottom of the light source. After passing through the diffusion plate, the infrared light source becomes a surface light source, thereby avoiding the local uneven illumination and highlight reflection caused by the point light source. An infrared band-pass filter is installed behind the lens in front of the decoding chip, so that the light with the central wavelength of the infrared absorption ink can pass through, while the light on both sides of the central wavelength is filtered, so that the light received by the photosensitive element is purer, and the image formed on the photosensitive element is clearer.
[0081] The embodiment provides an electronic device, which comprises a memory, a processor, and a computer program stored in the memory and capable of running on the processor. When the processor executes the program, a method for positioning a hidden code pattern is realized, as described in any of the embodiments of the present application.
[0082] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, and are not intended to limit the protection scope of the present application. Although the present application has been described in detail with reference to the preferred embodiments, those skilled in the art should analyze and can modify or replace the technical solutions of the present application without departing from the essence and scope of the technical solutions of the present application.
Claims
1. A method for positioning a steganographic pattern, comprising: The method comprises the following steps: acquiring an image to be processed; searching for a positioning module in the image to be processed, specifically as follows: searching for a hidden area of a positioning code point; performing connected domain analysis on the search result, and determining whether the search result is a positioning code point according to the area of the connected domain; the positioning module comprises a plurality of positioning code points, and each positioning code point comprises a hidden area and a non-hidden area; determining a code point search direction according to the position characteristics of the positioning module, specifically as follows: taking two positioning code points, establishing a rectangular coordinate system according to the relative position relationship between the two positioning code points; and determining the code point search direction according to the rectangular coordinate system; finding the remaining code points according to the code point search direction to obtain all the code points, specifically as follows: performing connected domain analysis on the binary image according to the code point search direction to obtain a plurality of connected domains; and determining the plurality of connected domains as data code points.
2. The method of claim 1, wherein, Further comprising: converting the image to be processed into a gray-scale image; converting the gray-scale image into a binary image; searching for a positioning code point in the binary image.
3. The method for locating a hidden coded pattern according to claim 2, characterized in that, The conversion of the image to be processed into a gray-scale image is expressed by a formula as follows: In the formula, r, g, b respectively represent three color components of a pixel point in the image to be processed. represents a gray value of a pixel point in the gray image.
4. The method for locating a hidden coded pattern according to claim 2, characterized in that, Further comprising denoising processing of the gray-scale image, which is expressed by a formula as follows: In the formula, is the gray value of the pixel point in the gray image; is the local gray mean value of the pixel point; is the local gray variance of the pixel point; is the global noise variance of the gray image; is the gray value of the pixel point in the gray image after the denoising processing.
5. The method of claim 1, wherein, Further comprising: setting an area value range, and eliminating the connected domains whose areas are not within the area value range.
6. An electronic device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, The processor implements the positioning method of the hidden code pattern according to any one of claims 1 to 5 when executing the program.
Citation Information
Patent Citations
Anti-counterfeiting code image with identification points, its generation method and generation device
CN104915702B
A method for identifying positioning points in invisible graphic codes on product labels
CN110188582B
Dot matrix code encoding method, reading method, encoding device and reading device
CN111832680A