A label, label detection method and system
By detecting whether the four corner units of the grid in the image data are connected by multiple first grayscale units, the problem of failure of label detection in harsh environments in the prior art is solved, and the robustness and coding space of the label detection system are improved.
Patent Information
- Application Number
- CN202010164837.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-03-11
- Publication Date
- 2025-05-27
- Estimated Expiration
- 2040-03-11
AI Technical Summary
When used in harsh environments, the detection failure is easily caused by distortion, bending or wrinkling of the label, and the square black boundary occupies a large amount of marking space, limiting the encoding space.
A label detection method is adopted to detect the tag by determining whether the four corner units arranged in the grid in the image data are connected to each other through a path formed by a plurality of first gray value units, thereby improving the robustness of the detection and coding space.
Tags can still be effectively detected and decoded on twisted, curved or wrinkled surfaces, improving the robustness of the tag detection system and increasing the encoding space of tags.
Smart Images

Figure CN113392668B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of label detection, and in particular, to a label, a label detection method and a device. Background Art
[0002] A fiducial marker (also known as a label) is used to be set on the surface of an object as a reference point or a measure. A label detection system includes a label set on the surface of an object, an image acquisition device for acquiring image data including the label, and a detection module for detecting and / or identifying these labels. The label detection system is widely used in applications such as augmented reality, simultaneous localization and mapping (SLAM), human-computer interaction, packaging and human detection and tracking, and factory and warehouse management. The existing label usually has a two-dimensional ("2D") barcode set on its surface. When in use, the label with the 2D barcode is attached or printed on the surface of the object. The detection module of the label detection system can calculate the accurate three-dimensional ("3D") position, orientation and identity of the label relative to the image acquisition device according to the image data transmitted by the image acquisition device.
[0003] In the prior art, the label usually adopts a square 2D barcode formed by an array arrangement of black or white color blocks. The square 2D barcode includes a square black boundary formed by the color blocks and a payload located within the black boundary. The label detection system performs label detection by detecting the square black boundary in the image data. Once the black boundary is detected, it means that the label is detected, and the payload within the black boundary will be decoded against a database of known labels. However, this design has many disadvantages. First, the label is usually attached or printed on a surface that may often be distorted, bent or wrinkled. In this way, the square black boundary of the label is easily deformed and is no longer square, resulting in the failure of label detection. This defect greatly limits the application of the fiducial marker in the prior art in harsh or difficult environments (such as applications where humans wear labels). Second, if any part of the boundary of the label in the prior art is blocked or covered (such as by a person's finger) to make the square black boundary become an open loop, the detection system will not be able to detect the label, reducing the robustness of the label detection system. Moreover, the square black boundary of the label in the prior art occupies a large amount of marking space, thus limiting the encoding space of the marking payload. Therefore, if a large amount of encoding space is required, it is difficult to reduce the size of the label. Summary of the Invention
[0004] An object of the present invention is to provide a label detection method to improve the accuracy of label detection and increase the encoding space of the label. Another object of the present invention is to provide a label. Still another object of the present invention is to provide a label detection system. Yet another object of the present invention is to provide a computer device. Yet another object of the present invention is to provide a readable medium.
[0005] To achieve the above object, on the one hand, the present invention discloses a label detection method, including:
[0006] Determine four corner units of the first gray value located at the four corners of the grid respectively among all the units arranged in a grid in the image data to be detected;
[0007] Determine whether the four corner units are connected to each other through a path formed by connecting multiple units of the first gray value according to the gray values of all the units;
[0008] If so, there is a label in the image data.
[0009] Preferably, the step of determining whether the four corner units are connected to each other through a path formed by connecting multiple units of the first gray value according to the gray values of all the units specifically includes:
[0010] Determine whether there are a first region and a second region respectively located at opposite first and second edges of the grid, and the first region and the second region are respectively formed by connecting two corner units through at least one unit of the first gray value located at the corresponding edge;
[0011] If so, determine whether the first region and the second region are connected to each other through a path formed by connecting multiple units of the first gray value.
[0012] Preferably, the path formed by connecting multiple units of the first gray value is a straight path.
[0013] Preferably, it further includes:
[0014] If there is a label, perform label decoding according to the gray values of all the units arranged in a grid.
[0015] Preferably, it further includes:
[0016] If there is a label, perform label decoding according to the gray values of the remaining units among all the units arranged in a grid, and the remaining units are the units except the four corner units or except the four corner units and the units in the path.
[0017] Preferably, the gray values of the units except the four corner units and the path formed by connecting multiple units of the first gray value among all the units arranged in a grid are the first gray value or the second gray value.
[0018] Preferably, it further includes:
[0019] Determine whether there is code in the image data to be detected that coincides with the cell portions located at the edges of the grid. The code includes one or more elements, where each element is a number or a letter. The portion of the code that coincides with the cell is the third gray value, and the portion of the code that does not coincide with the cell is the fourth gray value.
[0020] Preferably, it further includes:
[0021] If there is a label, perform label decoding according to the gray values of all the cells arranged in a grid and the code.
[0022] Preferably, the periphery of all the cells arranged in a grid further includes a boundary region surrounding the cells, and the gray value of the boundary region is the second gray value.
[0023] Preferably, before including the four corner cells with the first gray value respectively located at the four corners of the grid among all the cells arranged in a grid in the image data to be detected:
[0024] Collect the image data by an image acquisition device to obtain an image of an object with a label on its surface.
[0025] The present invention also discloses a label, including a plurality of cells arranged in a grid. The gray values of the four corner cells respectively located at the four corners of the grid are the first gray value;
[0026] The four corner cells are connected to each other through a path formed by connecting a plurality of cells with the first gray value.
[0027] Preferably, the grid includes a first region and a second region respectively located at the opposite first edge and second edge of the grid. The first region and the second region are respectively formed by connecting two corner cells through at least one cell with the first gray value located at the corresponding edge;
[0028] The first region and the second region are connected to each other through a path formed by connecting a plurality of cells with the first gray value.
[0029] Preferably, the path formed by connecting a plurality of cells with the first gray value is a straight path.
[0030] Preferably, the gray values of the cells among all the cells arranged in a grid except for the four corner cells and the path formed by connecting a plurality of cells with the first gray value are the first gray value or the second gray value.
[0031] Preferably, it further includes a code that coincides with the unit parts located at the edges of the grid. The code includes one or more elements, where each element is a number or a letter. The part of the code that coincides with the unit has a third gray value, and the part of the code that does not coincide with the unit has a fourth gray value.
[0032] Preferably, it further includes a boundary area surrounding the peripheries of all the units arranged in a grid. The gray value of the boundary area is the second gray value.
[0033] The present invention also discloses a label detection system, including a processing unit, and the processing unit includes:
[0034] An image data processing unit, configured to determine four corner units with the first gray value located at the four corners of the grid among all the units arranged in a grid in the image data to be detected;
[0035] A label detection determination unit, configured to determine whether the four corner units are interconnected through a path formed by connecting multiple units with the first gray value according to the gray values of all the units. If so, there is a label in the image data.
[0036] Preferably, the label detection determination unit is specifically configured to determine whether there are a first area and a second area located on the opposite first edge and second edge of the grid respectively. The first area and the second area are respectively formed by connecting two corner units through at least one unit with the first gray value located on the corresponding edge; if so, determine whether the first area and the second area are interconnected through a path formed by connecting multiple units with the first gray value.
[0037] Preferably, the path formed by connecting multiple units with the first gray value is a straight path.
[0038] Preferably, it further includes a first label decoding unit, configured to perform label decoding according to the gray values of all the units arranged in a grid if there is a label.
[0039] Preferably, it further includes a second label decoding unit, configured to perform label decoding according to the gray values of the remaining units among all the units arranged in a grid if there is a label. The remaining units are the units other than the four corner units or the units other than the four corner units and the units in the path.
[0040] Preferably, the gray values of the units other than the four corner units and the path formed by connecting multiple units with the first gray value among all the units arranged in a grid are the first gray value or the second gray value.
[0041] Preferably, it further includes a code detection unit for determining whether there is a code that coincides with a unit part located at the edge of the grid in the image data to be detected. The code includes one or more elements, where each element is a number or a letter. The part of the code that coincides with the unit is a third gray value, and the part of the code that does not coincide with the unit is a fourth gray value.
[0042] Preferably, it further includes a third label decoding unit for, if there is a label, performing label decoding according to the gray values of all the units arranged in a grid and the code.
[0043] Preferably, the periphery of all the units arranged in a grid further includes a boundary area surrounding the units, and the gray value of the boundary area is a second gray value.
[0044] Preferably, it further includes an image acquisition device for acquiring an image of an object with a label on its surface to obtain the image data.
[0045] The present invention also discloses a computer device, including a memory, a processor, and a computer program stored on the memory and executable on the processor.
[0046] When the processor executes the program, the above-mentioned method is implemented.
[0047] The present invention also discloses a computer-readable medium, on which a computer program is stored.
[0048] When the program is executed by the processor, the above-mentioned method is implemented.
[0049] The label of the present invention includes a plurality of units arranged in a grid. The gray values of the four corner units located at the four corners of the grid among the plurality of units are the first gray value, and the four corner units are connected to each other through a path formed by connecting a plurality of units with the first gray value. By detecting the four corner units with the first gray value, and then determining whether the four corner units are connected to each other through a path formed by connecting a plurality of units with the first gray value to determine whether the acquired image data includes a label. Compared with the prior art that requires detecting a complete square black boundary to determine detection and decoding, the label of the present invention can still be detected and decoded on a distorted, bent or wrinkled surface, improving the robustness of the label detection system. Moreover, the label of the present invention does not need to use a square black boundary for label detection, can provide more units for encoding, improves the encoding space of the label, and in a label of the same size, the label of the present invention can provide more encoding space for carrying payload. Description of the Drawings
[0050] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art. Obviously, the drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.
[0051] Figure 1A A design drawing showing a label in the prior art.
[0052] Figure 1B Show a specific example of a label in the prior art.
[0053] Figure 1C Show in Figure 1A The problems of the prior art label design shown in.
[0054] Figure 1D Show in Figure 1A Another problem of the prior art label design shown in.
[0055] Figure 2 Show one of the flowcharts of a specific embodiment of a label detection method of the present invention;
[0056] Figure 3A Show the design drawing of a label in a specific embodiment of a label detection method of the present invention;
[0057] Figure 3B Show according to Figure 3A The schematic diagram of a label obtained;
[0058] Figure 4 Show the second flowchart of a specific embodiment of a label detection method of the present invention;
[0059] Figure 5 Show the third flowchart of a specific embodiment of a label detection method of the present invention;
[0060] Figure 6A Show the design drawing of another label in a specific embodiment of a label detection method of the present invention;
[0061] Figure 6B Show according to Figure 6A The schematic diagram of another label obtained;
[0062] Figure 7A Show the design drawing of yet another label in a specific embodiment of a label detection method of the present invention;
[0063] Figure 7B Show according to Figure 7A The schematic diagram of yet another label obtained;
[0064] Figure 7C shows a schematic diagram when the Figure 7A problem occurs; Figure 1C
[0065] Figure 7D shows a schematic diagram when the Figure 7A problem occurs; Figure 1D
[0066] Figure 8 shows the fourth flowchart of a specific embodiment of a label detection method of the present invention;
[0067] Figure 9 shows a schematic diagram of another label in a specific embodiment of a label detection method of the present invention;
[0068] Figure 10 shows the fifth flowchart of a specific embodiment of a label detection method of the present invention;
[0069] Figure 11 shows a schematic diagram of a label including a boundary region in a specific embodiment of a label detection method of the present invention;
[0070] Figure 12 shows a schematic diagram of a reference mark including a boundary region in a specific embodiment of a label detection method of the present invention;
[0071] Figure 13 shows the sixth flowchart of a specific embodiment of a label detection method of the present invention;
[0072] Figure 14 shows the first structural diagram of a specific embodiment of a label detection system of the present invention;
[0073] Figure 15 shows the second structural diagram of a specific embodiment of a label detection system of the present invention;
[0074] Figure 16 shows the third structural diagram of a specific embodiment of a label detection system of the present invention;
[0075] Figure 17 shows the fourth structural diagram of a specific embodiment of a label detection system of the present invention;
[0076] Figure 18 shows the fifth structural diagram of a specific embodiment of a label detection system of the present invention;
[0077] Figure 19 shows the sixth structural diagram of a specific embodiment of a label detection system of the present invention;
[0078] Figure 20 The structural schematic diagram of a computer device suitable for implementing the embodiments of the present invention is shown. Detailed implementation manners
[0079] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.
[0080] Figure 1A An example of a label in the prior art is shown. As Figure 1A shown, the label in the prior art is a square 8×8 grid, and the grid has a total of 64 cells (also known as units). Each cell is black or white. The boundary part 101 ( Figure 1A the shaded part shown in) is always black for label detection. If the detection software cannot detect the square black boundary in the image containing the label, the label will not be detected. Usually, computer vision algorithms (for example, union-find for boundary detection and principal component analysis (PCA) for corner detection) are used to detect the square black boundary. The dashed part 102 is used for encoding. For example, by assigning black or white to each cell of the dashed part 102. Therefore, although the label has a total of 64 cells, in fact only 36 cells are used for encoding, and its maximum encoding space is 236. The ratio of the encoding area to the total label area is 9:16, which is only slightly higher than 50%. Figure 1B An example of a label designed according to this prior art is shown.
[0081] However, Figure 1A the label in the prior art shown in has many defects. Figure 1C A problem of the label in the prior art is shown, where Figure 1B the label shown in is distorted, so that the square black boundary captured in the image is no longer square. Moreover, the square boundary cannot be reconstructed by simply adjusting the viewing point because the label itself has been distorted. This may occur when the label is printed or attached to a soft or uneven surface that may often be distorted, stretched, deformed, or wrinkled. For example, in factory and warehouse management applications, some labels are printed or pasted on the uniforms or clothes of workers. When the worker moves around, the label on his / her uniform is prone to being distorted, stretched, or deformed. As a result, the detection software will not be able to detect the label. If this kind of failure occurs too frequently and widely, the entire system may stop working properly.
[0082] Figure 1D showsFigure 1A Another problem with the label design in the prior art shown. As Figure 1D shown, the square black border of the label is partially covered by a person's thumb. The thumb will break the closed loop of the border, and if any part of the square black border is blocked or covered, the label detection system will not be able to detect the label. Since (shown in Figure 1A ) the border part 101 occupies 7 / 16 of the total label area, the probability that the border part of the label is blocked or covered is 7 to 9 compared to the probability that the coding part 102 (shown in Figure 1A ) is blocked or covered. In fact, this ratio should be higher because when the coding part 102 is blocked or covered by an object (such as a hand), the border part may also be blocked or covered by the same object or any extension of the object (such as the forearm). Thus, Figure 1A the label design in the prior art shown in
[0083] is prone to detection failure. Figure 2 shown, the method includes:
[0084] S100: Determine the four corner units with the first gray value located at the four corners of the grid among all the units arranged in a grid in the image data to be detected.
[0085] S200: Determine whether the four corner units are connected to each other through a path formed by connecting multiple units with the first gray value according to the gray values of all the units.
[0086] S300: If so, there is a label in the image data.
[0087] The tag of the present invention includes a plurality of cells arranged in a grid. The gray values of four corner cells located at the four corners of the grid among the plurality of cells are the first gray value, and the four corner cells are interconnected through a path formed by connecting a plurality of cells with the first gray value. By detecting the four corner cells with the first gray value, and then determining whether the four corner cells are interconnected through a path formed by connecting a plurality of cells with the first gray value to determine whether the acquired image data includes a tag. Compared with the prior art where it is necessary to detect a complete square black boundary to determine detection and decoding, the tag of the present invention can still be detected and decoded on a distorted, bent or wrinkled surface, improving the robustness of the tag detection system. Moreover, the tag of the present invention does not need to use a square black boundary for tag detection, and can provide more cells for encoding, increasing the encoding space of the tag. In a tag of the same size, the tag of the present invention can provide more encoding space for carrying a payload.
[0088] Figure 3A A schematic diagram showing a specific example of the tag is shown. The tag includes four corner cells 801, 802, 803, and 804, and the gray values of the four corner cells are the first gray value. In this embodiment, the first gray value is black and the second gray value is white. In addition, the four corner cells 801 - 804 are interconnected through other black cells in the tag. For example, Figure 3B is shown according to Figure 3A a valid tag of the design shown. The four corner cells of this tag are black, and the four corner cells are interconnected through a path formed by other connected black cells in the tag. This design increases the encoding space of the tag. In addition, this tag design also improves the robustness of detection because it does not depend on whether a specific detection area can be recognized from the image. In this way, distorted or uneven surfaces can be better processed.
[0089] In a preferred embodiment, as Figure 4 shown, the method further includes:
[0090] S400: If there is a tag, perform tag decoding according to the gray values of all cells arranged in a grid.
[0091] It can be understood that the four corner units in the tag are units with the first gray value. However, other units in the tag except the four corner units can form an encoding area to set the payload of the tag. The gray value of the units in the encoding area can be set to the first gray value or the second gray value. Different array arrangements of the first gray value and the second gray value can be pre-corresponded to the corresponding tag information. When the array arrangement mode of the encoding area units corresponding to the tag information is detected, the corresponding tag information can be decoded, thus realizing the decoding of the tag. The tag detection method in this embodiment only needs to ensure that the four corner units are of the first gray value, and other units can be used for encoding. It is only necessary to ensure that there is a path formed by units of the first gray value in the encoding area that connects the four corner units. Since this path can be selected in various shapes, the path can also be a part of the encoding. It should be noted that in this embodiment, the gray value of the units in all the units arranged in a grid except the four corner units and the path formed by connecting multiple units of the first gray value is the first gray value or the second gray value. Encoding with the first gray value and the second gray value can improve the decoding efficiency.
[0092] In a specific example of the tag detection system detecting a tag, the tag detection system may include the tag, an image acquisition device, and a processing unit, and the processing unit contains instructions for detecting and decoding the tag.
[0093] First, attach the tag to the target object. The image acquisition device acquires the image data of the target object with the tag set, and the processing unit receives the image data of the tag captured by the image acquisition device. This system is also applicable when the tag is distorted or blocked.
[0094] In step S100, the processing unit scans the image to find the four corner units of the tag, and these four corner units should be black. Various computer vision algorithms can be used to find these four corner units. For example, the Harris corner detector can be used to detect the four corner units of the tag (such as the outermost four corners of all the corners detected from the tag image). If these four corner units are detected, the process proceeds to step S200. Otherwise, the tag detection fails and the process reports a failure.
[0095] In step S200, the processing unit scans the image data to determine whether the four corner units are connected to each other through a path formed by connecting multiple units of the first gray value. That is, at least one detection area including the four corner units and multiple units connecting the four corner units to each other can be determined, and the gray value of all the units in this detection area is the first gray value. For example, for Figure 3BFor the label, it is necessary to detect that the four black corner units are connected to each other through multiple other black units to determine the existence of the label. It should be noted that if two units have the same gray value and have a shared common boundary, these two units are connected.
[0096] In a preferred embodiment, as Figure 5 shown, the S200 may specifically include:
[0097] S210: Determine whether there are a first region and a second region on the grid that are respectively located on the opposite first edge and second edge, and the first region and the second region are respectively formed by connecting two corner units through at least one unit with a first gray value located on the corresponding edge.
[0098] S220: If so, determine whether the first region and the second region are connected to each other through a path formed by connecting multiple units with a first gray value.
[0099] Specifically, in one or more embodiments of the present invention, the grid of the label includes a first region and a second region respectively located on the opposite first edge and second edge of the grid, and the first region and the second region are respectively formed by connecting two corner units through at least one unit with a first gray value located on the corresponding edge. The first region and the second region are connected to each other through a path formed by connecting multiple units with a first gray value.
[0100] Figure 6A The figure shows a schematic diagram of a specific example of the label in this preferred embodiment. As Figure 6A shown, in this new label, all the unit arrays are arranged as a rectangular 8×7 grid, and the grid includes 56 units. Segment 501 (the shaded area) is the entire row of units (including the first region of the two corner units) along the top edge (the first edge) of the label, and it contains 7 units. Segment 502 (the cross-hatched area) is the entire row of units (including the second region of the other two corner units) along the bottom edge (the second edge) of the label, and segment 502 contains 7 units. The top edge is opposite to the bottom edge.
[0101] Segment 501 and segment 502 are connected by a path through intermediate segment 503 (the dashed area), which contains seven connected units and has a zigzag shape. Segments 501, 502, and 503 (collectively referred to as the "detection area") are always black. This detection area is used for label detection. Specifically, when detecting a label, it is checked whether the detection area is interconnected, that is, all the units in the detection area are black, to determine whether a label exists. This design is more effective and has better robustness when dealing with harsh or difficult-to-control environments. The remaining segments in the grid except for the detection area contain 35 units that can be used for encoding. These remaining 35 units are either black or white, and different arrangements of black and white units can be used to represent different label payloads.
[0102] Figure 6B Shows an example of a label according to Figure 6A the design shown. The top and bottom rows of the label are black. The label also includes an intermediate zigzag path that is also black and is used to connect the first area and the second area. Thus, two of the four corner units, the two top corner units, are interconnected by the black units in the top row, and the two bottom corner units are interconnected by the black units in the bottom row. The top row and the bottom row are interconnected by the black units of the intermediate zigzag path. A pattern formed by black and white units is configured in the encoding area. In applications, the label can be placed with different orientation settings and sometimes rotated. For example, if the Figure 6B label shown in
[0103] is rotated counterclockwise by 90 degrees, the top and bottom rows will become the left and right columns, and this middle column will become the middle row. This change in orientation does not affect the detection of the mark because the viewing point may be adjusted by the processing unit. Figure 3A Compared with the design shown in Figure 6A the design in
[0104] is more reliable, with high detection accuracy and efficiency. Figure 6AWhen detecting the label formed by the shown design method, S100 still scans the image data to identify these four corner units. Then, in S200, it is determined whether two of the corner units are interconnected along the path of these units of segment 501, whether the other two corner units are interconnected along the path of these units of segment 502, and whether there is at least one path of connected units that interconnects segment 501 and 502. If any of the above steps fails, the detection process can report a failed label detection and abort the detection process.
[0105] When the label detection system detects the label, in step S200, the processing unit scans the image data to determine whether the first region, the second region, and the bending path are all black units. Specifically, S200 determines whether two of these four corner units are interconnected along these units of segment 501 of the label. Here, the interconnection does not require all 7 units of segment 501 to be completely aligned or to be recognized in the form of a square in the image, but can be achieved when these units (all 7 or a part of them) of segment 501 of the label recognized from the image are interconnected in black with these two label corner units. Similarly, S200 determines whether the other two label corners are interconnected along the path of these units of segment 502 of the detection region, and whether the two segments 501 and 502 are interconnected along the path of these units of segment 503, that is, the first region, the second region, and the bending path are all black units. If the detection region is not interconnected, that is, there are units in the first region, the second region, and the bending path that are not black units, the process reports a failure. Otherwise, the label is detected and the label can be further decoded.
[0106] In a preferred embodiment, the path formed by connecting units with multiple first gray values is a straight line path. As Figure 7A shown, in a specific example, this new label design is embodied as a rectangular 8×7 grid, which includes 56 units. Segment 201 (the shaded area) is the entire row of units (including the first region of two corner units) along the top edge (the first edge) of the label. It contains 7 units. Segment 202 (the cross-hatched area) is the entire row of units (including the second region of the other two corner units) along the bottom edge (the second edge) of the label. Segment 202 contains 7 units. The top edge is opposite to the bottom edge. The middle column of straight line paths, that is, segment 203 (the dotted area) contains 6 units. Segments 201, 202, and 203 (collectively referred to as the "detection region") are always black. The detection region is used for label detection. Specifically, when detecting the label, it is checked whether the detection region is interconnected, that is, whether it is continuously black. This design is more effective and robust in dealing with harsh or difficult-to-control environments. The remaining segments contain 36 units and are used for encoding. These remaining 36 units are black or white.
[0107] Figure 7B shows an example of a label according to the Figure 7A design shown. The top and bottom rows are black, and there is also a middle column that is also black. Thus, these two top corner units are interconnected by the black units in the top row. These two bottom corner units are interconnected by the black units in the bottom row. The top and bottom rows are interconnected by the black units in this middle column. A pattern formed by black and white units is configured in the coding area. In an application, the label can be set to have different orientation settings and sometimes be rotated. For example, if the Figure 6B label shown in Figure 7B is rotated counterclockwise by 90 degrees, the top and bottom rows will become the left and right columns, and this middle column will become the middle row. This change in orientation does not affect the detection of the label because the viewing point may be adjusted by the processing unit. For the Figure 6B label, the label detection method is similar to that of the
[0108] label, and will not be elaborated here. Figure 7B The label of Figure 7C and its detection process illustrate that the present invention has many advantages over the label design and detection methods in the prior art. For example, Figure 7B shows how the design in Figure 1C solves the problem shown in Figure 7C . As shown in the figure, the label in Figure 1C is distorted, similar to the example shown in Figure 7B . However, according to the Figure 7B label detection process, the detection areas of this label are still interconnected. In this way, the label in Figure 1C can still be detected, while the label in
[0109] cannot be detected by the methods in the prior art. Figure 7D As another example, Figure 7B shows how the label in Figure 1D alleviates the problem shown in Figure 1D . Similar to the example in Figure 7D , the right edge of the label in Figure 7B is covered by a person's thumb. However, this does not affect the detection of the label in
[0110] because the detection areas of this label are still interconnected. Figure 7B In addition, even if part of the coding area in is covered, the detection software can still perform partial decoding and narrow down the results to a smaller range or number of codes. Based on other available information, such as the current position of this label and the historical position data of other labels, the system can further narrow down the range or number of codes.
[0111] Figure 7B Another advantage of the label design shown is that the ratio of its coding area to the total label area is 9:14, which is better than the designs in the prior art. When the coding areas are the same, the overall size of this new design is smaller than that of the designs in the prior art.
[0112] In a preferred embodiment, as Figure 8 shown, the method further includes:
[0113] S500: Determine whether there is a code in the image data to be detected that coincides with the unit part located at the edge of the grid. The code includes one or more elements, where each element is a number or a letter. The part of the code that coincides with the unit is the third gray value, and the part of the code that does not coincide with the unit is the fourth gray value. Among them, the third gray value can be selected as the second gray value different from the gray value of the grid edge unit, or other gray values can be selected. The fourth gray value can be selected to be the same as the first gray value, or other gray values can be selected. The present invention does not limit this.
[0114] Figure 9 shows a specific example of the label in this preferred embodiment. As Figure 9 shown, a five-digit code (each digit can be a number or a letter) is added to the bottom of the label, and some digits overlap with these units in the segment 202. Therefore, the bottom row of the label is used to present a part of the image of the code. Alternatively, the top row of the label can also be used to present a part of the image. In addition, the top row and the bottom row can be used to present two codes of the label.
[0115] In a preferred embodiment, the dimension of the number / letter is about 1×1 of the unit 1 / 3 , so in the best case, the recognition range of this number / letter is equivalent to 1 / 2 of the mark. The five-digit code can be recognized by deep learning algorithms, and these algorithms can provide robust error correction when the recognition confidence of traditional computer vision based on mark recognition is low. Of course, according to the application, the code can also be four or other numbers of digits. For example, the code can include one or more elements. These elements can include numbers, letters, characters, or symbols.
[0116] In a preferred embodiment, as Figure 10 shown, the step of decoding the label in the S400 can be modified to:
[0117] S430: If there is a label, decode the label according to the grayscale values of all the cells arranged in a grid and the said code. This code provides another way for error correction of the label code. It also provides a convenient way for human eye recognition. For example, if the label cannot be fully recognized due to, for example, partial coverage of the coding area, if the code can be detected and recognized, the code can help further identify the label.
[0118] In a preferred embodiment, as Figure 11 shown, the periphery of all the cells arranged in a grid further includes a boundary area surrounding the cells, and the grayscale value of the boundary area is the second grayscale value. In another embodiment of the present invention, as Figure 11 shown, a boundary area is added around the label, for example Figure 11 the thin white boundary 601 in. Preferably, the width of the white boundary 601 is about 1 / 3 of the width of the square. This white boundary forms a sharp contrast with the designated detection area 602 of the label and makes it easier to detect. Figure 12 shows an example of a fiducial mark formed by a label according to an embodiment of the present invention, and the fiducial mark can fix the label on the target object. As Figure 12 shown, the background 603 can have a color very close to that of the designated detection area 602. Adding the thin white boundary 601 will create a sharp contrast between the designated detection area 602 and the thin white boundary 601, making it easier to detect the designated detection area 602.
[0119] In a preferred embodiment, as Figure 13 shown, it further includes four corner cells with the first grayscale value respectively located at the four corners of the grid among all the cells arranged in a grid in the image data to be detected, before:
[0120] S000: Obtain the said image data by collecting an image of an object with a label on its surface through an image acquisition device. Among them, the image acquisition device can adopt devices such as cameras or webcams that can acquire image data, and the acquired image data can be in formats such as images or videos.
[0121] In the embodiments discussed above, the first grayscale value is black and the second grayscale value is white as an example for illustration. In other embodiments, the first grayscale value and the second grayscale value can also adopt colors with other grayscale values, or can also adopt colors such as RGB colors. When decoding, it is only necessary to be able to recognize that the grayscale value of the cell is the first grayscale value or the second grayscale value for decoding, and the present invention does not limit this.
[0122] In the embodiments discussed above, the grid size and orientation of the tags (such as an 8×7 grid). Those of ordinary skill in the art will understand that the shape of the tags can be square or rectangular, and these tags can have various numbers of rows, columns, and cells. Technical solutions in which specific embodiments, grid sizes, and orientations can be changed without departing from the spirit and scope of the present invention are also within the protection scope of the present invention.
[0123] It should be noted that the tag in this embodiment is an identification member and includes a plurality of cells. One or more of these cells can be formed individually or spliced by at least one strip or block-shaped cell, or can be cells with different gray values formed by spraying or pasting. The tag can be a raised structure formed on a plane, such as a layer structure formed by spraying or pasting, or a splicing structure formed by splicing strips or blocks, and can also be any device capable of displaying multiple cells of the tag, such as an electronic tag capable of displaying a two-dimensional code.
[0124] Based on the same principle, this embodiment also discloses a tag. The tag includes a plurality of cells arranged in a grid, and the gray values of four corner cells respectively located at the four corners of the grid among the plurality of cells are the first gray value. The four corner cells are connected to each other through a path formed by connecting a plurality of cells with the first gray value.
[0125] In a preferred embodiment, the grid includes a first region and a second region respectively located on opposite first and second edges of the grid, and the first region and the second region are respectively formed by connecting two corner cells through at least one cell with the first gray value located on the corresponding edge;
[0126] The first region and the second region are connected to each other through a path formed by connecting a plurality of cells with the first gray value.
[0127] In a preferred embodiment, the path formed by connecting a plurality of cells with the first gray value is a straight path.
[0128] In a preferred embodiment, the gray values of the cells in all the cells arranged in a grid except for the four corner cells and the path formed by connecting a plurality of cells with the first gray value are the first gray value or the second gray value.
[0129] In a preferred embodiment, it further includes a code that partially coincides with the cells located at the edge of the grid. The code includes one or more elements, and each element is a number or a letter. The part of the code that coincides with the cells is the third gray value, and the part of the code that does not coincide with the cells is the fourth gray value.
[0130] In a preferred embodiment, it further includes a boundary region surrounding the periphery of all the cells arranged in a grid, and the gray value of the boundary region is a second gray value.
[0131] Since the principle of this tag for solving problems is similar to the above method, the implementation of this tag can refer to the implementation of the method and will not be elaborated here.
[0132] The present invention also discloses a tag detection system. As Figure 14 shown, in this embodiment, the system includes a processing unit 1, and the processing unit includes an image data processing unit 11 and a tag detection and determination unit 12.
[0133] Among them, the image data processing unit 11 is used to determine the four corner units with the first gray value located at the four corners of the grid among all the cells arranged in a grid in the image data to be detected;
[0134] The tag detection and determination unit 12 is used to determine whether the four corner units are connected to each other through a path formed by connecting a plurality of cells with the first gray value according to the gray values of all the cells. If so, there is a tag in the image data.
[0135] In a preferred embodiment, the tag detection and determination unit 12 is specifically used to determine whether there are a first region and a second region respectively located on the opposite first edge and second edge of the grid, and the first region and the second region are respectively formed by connecting two corner units through at least one cell with the first gray value located on the corresponding edge; if so, determine whether the first region and the second region are connected to each other through a path formed by connecting a plurality of cells with the first gray value.
[0136] In a preferred embodiment, the path formed by connecting a plurality of cells with the first gray value is a straight path.
[0137] In a preferred embodiment, as Figure 15 shown, the system further includes a first tag decoding unit 131. The first tag decoding unit 131 is used to perform tag decoding according to the gray values of all the cells arranged in a grid if there is a tag.
[0138] In a preferred embodiment, as Figure 16 shown, the system further includes a second tag decoding unit 132. The second tag decoding unit 132 is used to perform tag decoding according to the gray values of the remaining cells among all the cells arranged in a grid if there is a tag, and the remaining cells are the cells except the four corner units or except the four corner units and the cells in the path.
[0139] In a preferred embodiment, the gray value of the cells other than the four corner cells and the path formed by connecting the cells with a plurality of first gray values among all the cells arranged in a grid is the first gray value or the second gray value.
[0140] In a preferred embodiment, as Figure 17 shown, the system further includes a code detection unit 14, which is used to determine whether there is a code that partially coincides with the cells located at the edge of the grid in the image data to be detected. The code includes one or more elements, where each element is a number or a letter. The part of the code that coincides with the cell is the third gray value, and the part of the code that does not coincide with the cell is the fourth gray value.
[0141] In a preferred embodiment, as Figure 18 shown, the system further includes a third label decoding unit 133. The third label decoding unit 133 is used to perform label decoding according to the gray values of all the cells arranged in a grid and the code if there is a label.
[0142] In a preferred embodiment, the periphery of all the cells arranged in a grid further includes a boundary region surrounding the cells, and the gray value of the boundary region is the second gray value.
[0143] In a preferred embodiment, as Figure 19 shown, the system further includes an image acquisition device 2. The image acquisition device 2 is used to acquire an image of an object with a label on its surface to obtain the image data.
[0144] Since the principle of the label detection system for solving problems is similar to the above method, the implementation of this label detection system can refer to the implementation of the method and will not be elaborated here.
[0145] The systems, devices, modules or units illustrated in the above embodiments can be specifically implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer device. Specifically, the computer device can be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or any combination of these devices.
[0146] In a typical example, the computer device specifically includes a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the program, it implements the method executed by the client as described above, or when the processor executes the program, it implements the method executed by the server as described above.
[0147] Next, refer toFigure 20 , which shows a schematic structural diagram of a computer device 600 suitable for implementing the embodiments of the present application.
[0148] As Figure 20 shown, the computer device 600 includes a central processing unit (CPU) 601, which can perform various appropriate operations and processes according to the program stored in the read-only memory (ROM) 602 or the program loaded from the storage section 608 into the random access memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the system 600 are also stored. The CPU 601, ROM 602, and RAM 603 are connected to each other via a bus 604. The input / output (I / O) interface 605 is also connected to the bus 604.
[0149] The following components are connected to the I / O interface 605: an input section 606 including a keyboard, a mouse, etc.; an output section 607 including, for example, a cathode ray tube (CRT), a liquid crystal display (LCD), etc. and a speaker, etc.; a storage section 608 including a hard disk, etc.; and a communication section 609 including a network interface card such as a LAN card, a modem, etc. The communication section 609 performs communication processing via a network such as the Internet. A drive 610 is also connected to the I / O interface 605 as required. A removable medium 611, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 610 as required, so that a computer program read from it can be installed in the storage section 608 as required.
[0150] Specifically, according to the embodiments of the present invention, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, the embodiments of the present invention include a computer program product, which includes a computer program tangibly contained on a machine-readable medium, and the computer program includes program codes for performing the methods shown in the flowcharts. In such an embodiment, the computer program can be downloaded and installed from a network via the communication section 609, and / or installed from the removable medium 611.
[0151] A computer-readable medium includes permanent and non-permanent, removable and non-removable media that can implement information storage by any method or technology. The information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassette tapes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transitory medium that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include transitory computer-readable media, such as modulated data signals and carrier waves.
[0152] For the convenience of description, when describing the above devices, they are divided into various units according to their functions and described separately. Of course, when implementing the present application, the functions of each unit can be implemented in the same or multiple software and / or hardware.
[0153] The present invention is described with reference to the flowcharts and / or block diagrams of methods, apparatuses (systems), and computer program products according to embodiments of the present invention. It should be understood that each flow and / or block in the flowcharts and / or block diagrams, and the combination of flows and / or blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing devices to generate a machine, such that the instructions executed by the processor of the computer or other programmable data processing devices generate a device for implementing the functions specified in one or more flows in the flowchart and / or one or more blocks in the block diagram.
[0154] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, such that the instructions stored in the computer-readable memory generate a manufactured article including an instruction device that implements the functions specified in one or more flows in the flowchart and / or one or more blocks in the block diagram.
[0155] These computer program instructions can also be loaded onto a computer or other programmable data processing apparatus, so that a series of operation steps are performed on the computer or other programmable apparatus to produce a computer-implemented process, and thus the instructions executed on the computer or other programmable apparatus provide steps for implementing the functions specified in one process or multiple processes of the flowchart and / or one block or multiple blocks of the block diagram.
[0156] It should also be noted that the term "comprising", "including" or any other variation thereof is intended to cover non-exclusive inclusion, so that a process, method, commodity or device comprising a series of elements includes not only those elements but also other elements not expressly listed, or also includes elements inherent in such process, method, commodity or device. Without further limitation, an element defined by the statement "comprising an..." does not exclude the presence of additional identical elements in the process, method, commodity or device comprising said element.
[0157] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, a system or a computer program product. Therefore, the present application can take the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware aspects. Moreover, the present application can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0158] The present application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present application can also be practiced in a distributed computing environment where tasks are performed by remote processing devices connected through a communication grid. In a distributed computing environment, program modules can be located in local and remote computer storage media including storage devices.
[0159] Each embodiment in this specification is described in a progressive manner, and the same or similar parts among the embodiments can be referred to each other. Each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the description of the method embodiment.
[0160] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, various changes and modifications can be made to the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included within the scope of the claims of the present application.
Claims
1. A label detection method, characterized in that, comprising: determining four corner units with first gray values respectively located at four corners of the grid among all units arranged in a grid in the image data to be detected; determining whether the four corner units are interconnected through a path formed by connecting multiple units with first gray values according to the gray values of all units; if so, there is a label in the image data; further comprising: determining whether there is a code in the image data to be detected that partially overlaps with units located at the edge of the grid, the code includes one or more elements, each element being a number or a letter, the part of the code overlapping with the unit being the third gray value, and the part of the code not overlapping with the unit being the fourth gray value.
2. The label detection method according to claim 1, characterized in that, the step of determining whether the four corner units are interconnected through a path formed by connecting multiple units with first gray values according to the gray values of all units specifically includes: determining whether there are a first area and a second area respectively located at opposite first edge and second edge of the grid, the first area and the second area are respectively formed by connecting two corner units through at least one unit with first gray value located at the corresponding edge; if so, determining whether the first area and the second area are interconnected through a path formed by connecting multiple units with first gray values.
3. The label detection method according to claim 2, characterized in that, the path formed by connecting multiple units with first gray values is a straight path.
4. The label detection method according to claim 1, characterized in that, further comprising: if there is a label, performing label decoding according to the gray values of all units arranged in a grid.
5. The label detection method according to claim 1, characterized in that, further comprising: if there is a label, performing label decoding according to the gray values of the remaining units among all units arranged in a grid, the remaining units being units other than the four corner units or units other than the four corner units and the units in the path.
6. The label detection method according to claim 1 or 5, characterized in that, the gray values of units other than the four corner units and the path formed by connecting multiple units with first gray values among all units arranged in a grid are the first gray value or the second gray value.
7. The label detection method according to claim 1, characterized in that, further comprising: if there is a label, performing label decoding according to the gray values of all units arranged in a grid and the code.
8. The label detection method according to claim 1, characterized in that, the periphery of all units arranged in a grid further includes a boundary area surrounding the units, and the gray value of the boundary area is the second gray value.
9. The label detection method according to claim 1, characterized in that, further comprising, before determining four corner units with first gray values respectively located at four corners of the grid among all units arranged in a grid in the image data to be detected: The image data is obtained by collecting an image of an object with a tag on its surface through an image acquisition device.
10. A tag, characterized in that, it includes a plurality of cells arranged in a grid, and the gray values of four corner cells respectively located at the four corners of the grid among the plurality of cells are the first gray value; the four corner cells are connected to each other through a path formed by connecting a plurality of cells with the first gray value; it further includes a code that partially coincides with the cells located at the edge of the grid, the code includes one or more elements, each element being a number or a letter, the part of the code that coincides with the cells is the third gray value, and the part of the code that does not coincide with the cells is the fourth gray value.
11. The tag according to claim 10, characterized in that, the grid includes a first area and a second area respectively located at the opposite first edge and second edge of the grid, and the first area and the second area are respectively formed by connecting two corner cells through at least one cell with the first gray value located at the corresponding edge; the first area and the second area are connected to each other through a path formed by connecting a plurality of cells with the first gray value.
12. The tag according to claim 11, characterized in that, the path formed by connecting a plurality of cells with the first gray value is a straight path.
13. The tag according to claim 10, characterized in that, the gray values of the cells in all the cells arranged in the grid, except for the four corner cells and the path formed by connecting a plurality of cells with the first gray value, are the first gray value or the second gray value.
14. The tag according to claim 10, characterized in that, it further includes a boundary area surrounding the periphery of all the cells arranged in the grid, and the gray value of the boundary area is the second gray value.
15. A tag detection system, characterized in that, it includes a processing unit, and the processing unit includes: an image data processing unit for determining four corner cells with the first gray value respectively located at the four corners of all the cells arranged in the grid in the image data to be detected; a tag detection determination unit for determining whether the four corner cells are connected to each other through a path formed by connecting a plurality of cells with the first gray value according to the gray values of all the cells, and if so, there is a tag in the image data; it further includes a code detection unit for determining whether there is a code that partially coincides with the cells located at the edge of the grid in the image data to be detected, the code includes one or more elements, each element being a number or a letter, the part of the code that coincides with the cells is the third gray value, and the part of the code that does not coincide with the cells is the fourth gray value.
16. The tag detection system according to claim 15, characterized in that, The label detection determination unit is specifically configured to determine whether there are a first region and a second region on opposite first and second edges of the grid, where the first region and the second region are respectively formed by connecting two corner units through at least one unit with a first grayscale value on the corresponding edge; if so, determine whether the first region and the second region are connected to each other through a path formed by connecting multiple units with the first grayscale value.
17. The label detection system according to claim 16, wherein, the path formed by connecting multiple units with the first grayscale value is a straight path.
18. The label detection system according to claim 15, wherein, it further includes a first label decoding unit, configured to, if there is a label, perform label decoding according to the grayscale values of all the units arranged in a grid.
19. The label detection system according to claim 15, wherein, it further includes a second label decoding unit, configured to, if there is a label, perform label decoding according to the grayscale values of the remaining units among all the units arranged in a grid, and the remaining units are the units except the four corner units or except the four corner units and the units in the path.
20. The label detection system according to claim 15 or 19, wherein, the grayscale values of the units among all the units arranged in a grid except the four corner units and the path formed by connecting multiple units with the first grayscale value are the first grayscale value or the second grayscale value.
21. The label detection system according to claim 17, wherein, it further includes a third label decoding unit, configured to, if there is a label, perform label decoding according to the grayscale values of all the units arranged in a grid and the code.
22. The label detection system according to claim 15, wherein, a boundary region surrounding the units is further included on the periphery of all the units arranged in a grid, and the grayscale value of the boundary region is the second grayscale value.
23. The label detection system according to claim 15, wherein, it further includes an image acquisition device, configured to acquire an image of an object with a label provided on its surface to obtain the image data.
24. A computer device, including a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein, when the processor executes the program, the method according to any one of claims 1-9 is implemented.
25. A computer-readable medium, on which a computer program is stored, wherein, when the program is executed by a processor, the method according to any one of claims 1-9 is implemented.
Citation Information
Patent Citations
Method and device for recognizing qr code
CN109522768A