Three-dimensional graphic code, three-dimensional graphic code recognition method, device, medium, and equipment
By introducing a three-dimensional structure into the two-dimensional graphic code and using depth information to identify multiple levels of the three-dimensional graphic code, the problem of information capacity and recognition accuracy is solved, and efficient recognition in various environments is achieved.
Patent Information
- Application Number
- CN202110426963.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-04-20
- Publication Date
- 2024-10-01
- Estimated Expiration
- 2041-04-20
AI Technical Summary
Existing two-dimensional graphic codes have limited information storage capacity, and have poor recognition accuracy in poor ambient light conditions, making it difficult to accurately recognize indoors or in low-light environments.
Using three-dimensional graphics codes, by setting at least three graphics layers in parallel, each graphics layer has a different projection position in the normal direction, depth information is used for recognition, and a binary image is generated to simplify the recognition process and improve accuracy.
It breaks the limit of graphic code information capacity in two-dimensional space, improves information capacity and recognition accuracy, and is not affected by ambient light. It is suitable for rapid and accurate recognition at night or in environments with weak light.
Smart Images

Figure CN113204982B_ABST
Abstract
Description
Background Art
[0002] With the rapid development of Internet technology, in order to improve the convenience of obtaining information and information security, people have proposed to encode information through specific geometric figures to store or represent various types of data, such as QR codes or barcodes. The prior art usually prints black and white paint on a substrate to present a binary graphic code such as a QR code or barcode on a two-dimensional plane. In practical applications, users need to capture the image of the two-dimensional graphic code through a camera for recognition in order to obtain the information contained in the graphic code. However, due to space limitations, this two-dimensional graphic code cannot include too much information, and the method of obtaining graphic code information through image recognition often has high requirements for the environment. When indoors or in an environment with poor light, the recognition of the graphic code based on the captured image may be difficult to recognize or misrecognized, affecting the accuracy of information acquisition. Summary of the invention
[0003] The present disclosure provides a three-dimensional graphic code, a three-dimensional graphic code recognition method, a three-dimensional graphic code recognition device, a computer-readable storage medium and an electronic device, thereby at least to a certain extent improving the problems in the prior art that the graphic code information storage is limited, the recognition process has high environmental requirements, and the recognition accuracy is poor.
[0004] Other features and advantages of the present disclosure will become apparent from the following detailed description, or may be learned in part by the practice of the present disclosure.
[0005] According to a first aspect of the present disclosure, a three-dimensional graphic code is provided, comprising: at least three graphic layers arranged in parallel, wherein the projection positions of the at least three graphic layers in the normal direction of any graphic layer are different, so that the depth information of the three graphic layers collected along the normal direction is different.
[0006] According to the second aspect of the present disclosure, a method for identifying a three-dimensional graphic code is provided, comprising: obtaining depth information of the three-dimensional graphic code described in the first aspect; identifying at least three graphic layers in the three-dimensional graphic code according to the depth information; and obtaining at least one binary image according to the at least three graphic layers.
[0007] According to the third aspect of the present disclosure, a three-dimensional graphic code recognition device is provided, including: a depth information acquisition module, used to obtain the depth information of the three-dimensional graphic code described in the first aspect; a graphic layer recognition module, used to identify at least three graphic layers in the three-dimensional graphic code according to the depth information; a binary image acquisition module, used to obtain at least one binary image according to the at least three graphic layers.
[0008] According to a fourth aspect of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the three-dimensional graphic code recognition method and possible implementation methods thereof of the second aspect are implemented.
[0009] According to a fifth aspect of the present disclosure, an electronic device is provided, comprising: a processor; and a memory for storing executable instructions of the processor, wherein the processor is configured to execute the above-mentioned three-dimensional graphic code recognition method of the second aspect and possible implementation thereof by executing the executable instructions.
[0010] The technical solution disclosed in this disclosure has the following beneficial effects:
[0011] In the three-dimensional graphic code of the exemplary embodiment, at least three graphic layers are arranged in parallel, and the projection positions of at least three graphic layers in the normal direction of any graphic layer are all different, so that the depth information of the three graphic layers collected along the normal direction is all different. On the one hand, the three-dimensional graphic code described in the exemplary embodiment breaks the limitation of the information capacity of the graphic code in the two-dimensional space. By setting at least three graphic layers whose projection positions in the normal direction of any graphic layer are all different, each graphic layer has a different depth, and the three-dimensional graphic code is constructed based on graphic layers of different depths from the three-dimensional space, which enriches the diversity of the three-dimensional graphic code and improves the information capacity contained in the three-dimensional graphic code; on the other hand, since different graphic layers have different depth information, different graphic layers can be identified based on the depth information. Compared with the method of collecting graphic code images for identification, the identification process is simple and the identification accuracy is high; on the other hand, considering that the three-dimensional graphic code of the exemplary embodiment can be identified based on the depth information, the identification process is not affected by the ambient light, and the graphic layer can still be accurately and quickly identified at night or in an indoor environment with weak light, and the application range is wide.
[0012] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] The accompanying drawings herein are incorporated into the specification and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the specification are used to explain the principles of the present disclosure. Obviously, the accompanying drawings described below are only some embodiments of the present disclosure, and for ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without creative work.
[0014] Figure 1 A schematic diagram showing a system architecture of a three-dimensional graphic code recognition method in this exemplary embodiment;
[0015] Figure 2 A structural diagram of an electronic device showing a method for recognizing a three-dimensional graphic code in this exemplary embodiment;
[0016] Figure 3 A schematic diagram showing a three-dimensional graphic code in this exemplary embodiment;
[0017] Figure 4 Another schematic diagram showing a three-dimensional graphic code in this exemplary embodiment;
[0018] Figure 5 A flow chart showing a method for recognizing a three-dimensional graphic code in this exemplary embodiment is shown;
[0019] Figure 6 A schematic diagram showing a graphic layer in this exemplary embodiment;
[0020] Figure 7 A sub-flow chart of a three-dimensional graphic code recognition method in this exemplary embodiment is shown;
[0021] Figure 8 A sub-flow chart showing another three-dimensional graphic code recognition method in this exemplary embodiment;
[0022] Fig. 9 A schematic diagram showing another graphic layer in this exemplary embodiment;
[0023] Fig.10 A schematic diagram showing a method of generating a binary image based on a graphic layer in this exemplary embodiment is shown;
[0024] Fig.11 Another schematic diagram of generating a binary image based on a graphic layer in this exemplary embodiment is shown;
[0025] Fig.12 A sub-flow chart of another three-dimensional graphic code recognition method in this exemplary embodiment is shown;
[0026] Fig.13 A structural block diagram of a three-dimensional graphic code recognition device in this exemplary embodiment is shown. DETAILED DESCRIPTION
[0027] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as being limited to the examples set forth herein; on the contrary, these embodiments are provided so that the present disclosure will be more comprehensive and complete, and the concepts of the example embodiments are fully conveyed to those skilled in the art. The described features, structures, or characteristics may be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present disclosure. However, those skilled in the art will appreciate that the technical solutions of the present disclosure may be practiced while omitting one or more of the specific details, or other methods, components, devices, steps, etc. may be adopted. In other cases, known technical solutions are not shown or described in detail to avoid obscuring various aspects of the present disclosure.
[0028] In addition, the accompanying drawings are only schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the figures represent the same or similar parts, and their repeated description will be omitted. Some of the block diagrams shown in the accompanying drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or implemented in one or more hardware modules or integrated circuits, or implemented in different networks and / or processor devices and / or microcontroller devices.
[0029] An exemplary embodiment of the present disclosure provides a three-dimensional graphic code recognition method. Figure 1 1 shows a system architecture diagram of the operating environment of this exemplary embodiment. Figure 1 As shown, the system architecture 100 may include a server 110 and a terminal 120, which communicate with each other through a network, for example, the server 110 sends the generated binary image to the terminal 120. The server 110 refers to a backend server that provides Internet services; the terminal 120 includes but is not limited to smart phones, tablet computers, game consoles, wearable devices, etc.
[0030] It should be understood that Figure 1 The number of each device is only exemplary. According to the implementation requirements, any number of clients can be set, or the server can be a cluster formed by multiple servers.
[0031] The three-dimensional graphic code recognition method provided in the embodiment of the present disclosure can be executed by the terminal 120, for example, the depth sensor configured by the terminal 120 transmits a depth detection signal to the three-dimensional graphic code, receives a reflection signal, and recognizes the graphic layer according to the reflection signal to generate a binary image; it can also be executed by the server 110, for example, after receiving the reflection signal, the terminal 120 uploads it to the server 110, so that the server 110 recognizes the graphic layer according to the reflection signal to generate a binary image, etc., and the present disclosure does not limit this.
[0032] An exemplary embodiment of the present disclosure provides an electronic device for implementing a three-dimensional graphic code recognition method, which may be Figure 1 The server 110 and the terminal 120 in the electronic device at least include a processor and a memory, the memory is used to store executable instructions of the processor, and the processor is configured to execute the three-dimensional graphic code recognition method by executing the executable instructions.
[0033] Below Figure 2 Taking the mobile terminal 200 in the example, the structure of the above electronic device is exemplarily described. It should be understood by those skilled in the art that, in addition to the components specifically used for mobile purposes, Figure 2 The construction in can also be applied to fixed type equipment.
[0034] like Figure 2 As shown, the mobile terminal 200 may specifically include: a processor 210, an internal memory 221, an external memory interface 222, a USB (Universal Serial Bus) interface 230, a charging management module 240, a power management module 241, a battery 242, an antenna 1, an antenna 2, a mobile communication module 250, a wireless communication module 260, an audio module 270, a speaker 271, a receiver 272, a microphone 273, an earphone interface 274, a sensor module 280, a display screen 290, a camera module 291, an indicator 292, a motor 293, a button 294 and a SIM (Subscriber Identification Module) card interface 295, etc.
[0035] The processor 210 may include one or more processing units, for example, the processor 210 may include an AP (Application Processor), a modem processor, a GPU (Graphics Processing Unit), an ISP (Image Signal Processor), a controller, an encoder, a decoder, a DSP (Digital Signal Processor), a baseband processor and / or an NPU (Neural-Network Processing Unit), etc. The encoder may encode (i.e., compress) the image or video data; the decoder may decode (i.e., decompress) the bitstream data of the image or video to restore the image or video data.
[0036] In some implementations, the processor 210 may include one or more interfaces, and may be connected to other components of the mobile terminal 200 via different interfaces.
[0037] The internal memory 221 may be used to store computer executable program codes, which may include instructions. The internal memory 221 may include volatile memory, non-volatile memory, etc. The processor 210 executes various functional applications and data processing of the mobile terminal 200 by running instructions stored in the internal memory 221 and / or instructions stored in a memory provided in the processor.
[0038] The external memory interface 222 can be used to connect an external memory, such as a Micro SD card, to expand the storage capacity of the mobile terminal 200. The external memory communicates with the processor 210 through the external memory interface 222 to implement a data storage function, such as storing music, video and other files.
[0039] The USB interface 230 is an interface that complies with USB standard specifications and can be used to connect a charger to charge the mobile terminal 200, or to connect headphones or other electronic devices.
[0040] The charging management module 240 is used to receive charging input from a charger. While the charging management module 240 is charging the battery 242, it can also power the device through the power management module 241; the power management module 241 can also monitor the status of the battery.
[0041] The wireless communication function of the mobile terminal 200 can be implemented by antenna 1, antenna 2, mobile communication module 250, wireless communication module 260, modulation and demodulation processor and baseband processor. Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. The mobile communication module 250 can provide solutions for wireless communication including 2G / 3G / 4G / 5G applied to the mobile terminal 200. The wireless communication module 260 can provide wireless communication solutions including WLAN (Wireless Local Area Networks) (such as Wi-Fi (Wireless Fidelity) network), BT (Bluetooth), GNSS (Global Navigation Satellite System), FM (Frequency Modulation), NFC (Near Field Communication), IR (Infrared) and the like applied to the mobile terminal 200. The mobile terminal 200 can realize the display function and display the user interface through GPU, display screen 290 and AP.
[0042] The mobile terminal 200 can realize the shooting function through the ISP, camera module 291, encoder, decoder, GPU, display screen 290 and AP, and can also realize the audio function through the audio module 270, speaker 271, receiver 272, microphone 273, headphone interface 274 and AP.
[0043] The sensor module 280 may include a depth sensor 2801 , a pressure sensor 2802 , a gyroscope sensor 2803 , an air pressure sensor 2804 , etc., to implement different sensing detection functions.
[0044] Indicator 292 may be an indicator light, which may be used to indicate charging status, power changes, messages, missed calls, notifications, etc. Motor 293 may generate vibration prompts, and may also be used for touch vibration feedback, etc. Buttons 294 include a power button, a volume button, etc.
[0045] The mobile terminal 200 may support one or more SIM card interfaces 295 for connecting a SIM card to implement functions such as calls and data communications.
[0046] First, this exemplary embodiment provides a three-dimensional graphic code, Figure 3A schematic diagram of a 3D graphic code in this exemplary embodiment is shown. The 3D graphic code 300 may include: at least three graphic layers arranged in parallel, and the projection positions of the at least three graphic layers in the normal direction of any graphic layer are different, so that the depth information of the three graphic layers collected along the normal direction is different. The user can scan the 3D graphic code 300 through a depth sensor to identify each graphic layer, thereby obtaining the information contained in the 3D graphic code.
[0047] In this exemplary embodiment, the above-mentioned three-dimensional graphic code 300 can represent various types of graphic codes, such as a two-dimensional code, a barcode, or other graphic codes that can obtain information by scanning the three-dimensional graphic code, etc., then each graphic layer is a sub-graphic that constitutes a graphic code such as a two-dimensional code or a barcode, and different graphic layers can be combined to form a complete two-dimensional code or barcode. The above-mentioned three-dimensional graphic code can be set on materials in any scene, such as fixed on the window glass, wall or table of a shopping mall, so that the user can scan to obtain the information contained in the three-dimensional graphic code, or used to decorate the wall, etc.
[0048] The above-mentioned three-dimensional graphic code 300 may include at least three graphic layers, and the projection positions of the at least three graphic layers in the normal direction of any graphic layer are different, which means that in the at least three graphic layers, the depth of each graphic layer is different. Assuming that the three-dimensional graphic code 300 includes three parallel graphic layers, the projection positions of the three graphic layers in the normal direction of any graphic layer are, for example, Figure 4 As shown, the projection positions of the graphic layer 410, the graphic layer 420 and the graphic layer 430 correspond to each other. It can be seen that the three graphic layers have different depths, and the depth of the graphic layer 410 is less than that of the graphic layer 420 and less than that of the graphic layer 430. Therefore, no matter which graphic layer's normal direction is used as the reference for projection, the projection positions of the three graphic layers are different. It should be noted that Figure 4 The projection diagram of three graphic layers at different depths is only for schematic illustration. In actual applications, when the three-dimensional graphic code of each graphic layer is more complex, the projection position of each graphic layer will also be complex. In addition, the depth difference between two adjacent graphic layers and the depth of each graphic layer itself can be customized as needed, and the present disclosure does not make specific limitations on this. For example, a smaller depth can be set for the graphic layer at the bottom layer. In this exemplary embodiment, considering the actual resolution of the depth sensor, the total size of the three-dimensional graphic code can be set in the range of 10cm (centimeter) to 1m (meter), the spacing between each graphic layer can be set in the range of 1cm to 1m, and so on.
[0049] In an exemplary embodiment, the at least three graphic layers may include m graphic layer groups, each graphic layer group may include at least two graphic layers, and each graphic layer group may form a two-dimensional code in a three-dimensional graphic code. For example, a three-dimensional graphic code may be a graphic code including multiple two-dimensional codes. Assume that the three-dimensional graphic code includes four graphic layers, wherein two graphic layer groups may be included, each graphic layer group includes two graphic layers, and the two graphic layers may represent a black area and a white area of a two-dimensional code, respectively. Based on this, two graphic layer groups may determine two two-dimensional codes.
[0050] In an exemplary embodiment, in order to improve the recognition accuracy of the three-dimensional graphic code, the color of each graphic layer can be set to be the same, and the colors of at least three graphic layers can be different. In this way, the final recognition result of the three-dimensional graphic code can be jointly determined by the color recognition result and the depth recognition result of the three-dimensional graphic code to improve the recognition accuracy.
[0051] In summary, the three-dimensional graphic code in this exemplary embodiment has at least three graphic layers arranged in parallel, and the projection positions of at least three graphic layers in the normal direction of any graphic layer are all different, so that the depth information of the three graphic layers collected along the normal direction is all different. On the one hand, the three-dimensional graphic code described in this exemplary embodiment breaks the limitation of the information capacity of the graphic code in the two-dimensional space. By setting at least three graphic layers with different projection positions in the normal direction of any graphic layer, each graphic layer has a different depth, and constructs a three-dimensional graphic code based on graphic layers of different depths from the three-dimensional space, enriching the diversity of the three-dimensional graphic code and improving the capacity of the information contained in the three-dimensional graphic code; on the other hand, since different graphic layers have different depth information, different graphic layers can be identified based on the depth information. Compared with the method of collecting graphic code images for identification, the identification process is simple and the identification accuracy is high; on the other hand, considering that the three-dimensional graphic code of this exemplary embodiment can be identified based on the depth information, the identification process is not affected by the ambient light, and the graphic layer can still be accurately and quickly identified at night or in an indoor environment with weak light, and the application range is wide.
[0052] In addition, this exemplary embodiment also provides a three-dimensional graphic code recognition method, the application scenarios of which may include but are not limited to: in a navigation and positioning scenario, a user scans a three-dimensional graphic code in a shopping mall through a smart phone to obtain current positioning information or shopping mall information, etc.; in a VR (Virtual Reality) / AR (Augmented Reality) game scenario, a user scans a three-dimensional graphic code to identify different graphic layers to obtain game information or trigger a game task; or a user scans a three-dimensional graphic code in a payment scenario to identify the corresponding payment code to complete payment, etc., wherein the three-dimensional graphic code is the three-dimensional graphic code described above.
[0053] Figure 5 An exemplary process of a three-dimensional graphic code recognition method is shown, which can be executed by the above-mentioned server 110 or terminal 120, including the following steps S510 to S530:
[0054] Step S510, obtaining depth information of the above-mentioned 3D graphic code.
[0055] Among them, the three-dimensional graphic code refers to the three-dimensional graphic code with at least three graphic layers, and the three-dimensional graphic code may include a two-dimensional code, a barcode or a graphic code of other information. This exemplary embodiment can be applied to electronic devices equipped with depth sensors such as smart phones, laptops, tablets, VR or AR, and the depth information of the three-dimensional graphic code can be obtained through the depth sensor. Among them, the depth sensor may include a depth detection signal transmitting component and a reflection signal receiving component. In particular, the above-mentioned depth sensor may include a TOF (Time of Flight) sensor, such as an ITOF (Indirect TOF, indirect measurement of flight time) sensor or a DTOF (Direct TOF, direct measurement of flight time) sensor.
[0056] In this exemplary embodiment, the depth sensor can transmit a depth detection signal to the environment and receive a reflection signal reflected by the three-dimensional graphic code in the environment, wherein the depth detection signal can be an infrared pulse signal. For example, the TOF sensor can transmit an infrared pulse signal to the forward environment through the depth detection signal transmitting component. After the infrared pulse signal reaches the graphic layer in the environment, part of it will be reflected back, i.e., the reflection signal; the reflection signal receiving component can receive the reflection signal reflected back from the environment, and further, the graphic layer can be identified based on the reflection signal. When a TOF sensor is used, a VCSEL (Vertical-Cavity Surface-Emitting Laser) with an emission wavelength of 940nm can be used as a light source. Of course, other wavelengths, such as 845nm, 1350nm, etc. lasers, etc., can also be used, and the present disclosure does not specifically limit this.
[0057] Step S520: Identify at least three graphic layers in the 3D graphic code according to the depth information.
[0058] In this exemplary embodiment, since the three-dimensional graphic code includes at least three graphic layers, and the graphic layers have different depths, when each graphic layer in the three-dimensional graphic code receives a depth detection signal, the reflected signals returned by the graphic layers of different depths are different. This exemplary embodiment can solve the flight time information of the depth detection signal based on the underlying algorithm according to the reflection signal, thereby determining the distance of each graphic layer from the depth sensor. Depending on the type of depth sensor, the flight time information can be calculated in different ways. For example, the ITOF sensor can use the method of measuring phase offset to measure the flight time information by the phase difference between the transmitted sine wave / square wave and the received sine wave / square wave; while the DTOF sensor can measure the flight time information by measuring the time interval between the transmitted infrared pulse signal and the received infrared pulse signal. The depth information of any graphic layer from the depth sensor is determined by the flight time, thereby restoring each graphic layer.
[0059] Since the 3D graphic code is composed of at least three graphic layers with different depths, each graphic layer can be used as an independent sub-graphic, such as Figure 6 As shown, taking three graphic layers as an example, a top view of three graphic layers in a three-dimensional graphic code is shown. Figure 6 In the middle left, the white area is the first graphic layer 610, and the black area is the second graphic layer 620. Figure 6 In the middle right, the black area is the third graphic layer 630. It can be seen that each graphic layer can be regarded as a sub-graphic extracted from the three-dimensional graphic code. The graphic layers of different depths are superimposed to form a three-dimensional graphic code in this exemplary embodiment.
[0060] Step S530: obtaining at least one binary image according to at least three graphic layers.
[0061] In this exemplary embodiment, a new graphic code can be determined by performing different combinations of at least three graphic layers in the identified three-dimensional graphic code, for example Figure 6 In the three-dimensional graphic code shown, the graphic layer 610 is used as the background graphic layer, and the graphic layer 620 and the graphic layer 630 are superimposed as the foreground graphic layer, so that a two-dimensional code composed of the graphic layer 620 and the graphic layer 630 can be obtained. It should be noted that Figure 6 The black and white areas in the figure are only for schematic illustration. In practical applications, the color of each graphic layer can be the same or different. This exemplary embodiment does not limit the color of the graphic layer. Each graphic layer only needs to have a different depth. This exemplary embodiment can obtain at least one binary image based on the recognition results of each graphic layer. A binary image refers to an image in which each pixel contains only two coded values. It can be used to describe a character image or a digital image, for example Figure 6 In the embodiment, the foreground graphic layer and the background graphic layer are encoded, and a binary image capable of representing the logic of “0” and “1” of the two-dimensional code can be generated based on the graphic layer 610 , the graphic layer 620 and the graphic layer 630 .
[0062] It should be noted that this exemplary embodiment can identify a three-dimensional graphic code to obtain a corresponding binary image, such as restoring a three-dimensional graphic code to a two-dimensional code; it can also identify a three-dimensional graphic code and parse the generated binary image, such as restoring a three-dimensional graphic code to a two-dimensional code, and parsing the information of the two-dimensional code, etc., that is, this exemplary embodiment can be used only to restore the graphic code contained in the three-dimensional graphic code, and can also be used in application scenarios to restore the three-dimensional graphic code and parse to obtain the information contained therein, and the present disclosure does not make specific limitations on this.
[0063] In summary, in this exemplary embodiment, the depth information of the three-dimensional graphic code is obtained; at least three graphic layers in the three-dimensional graphic code are identified according to the depth information; and at least one binary image is obtained according to the at least three graphic layers. On the one hand, since the three-dimensional graphic code in this exemplary embodiment has graphic layers with different depth information, the at least three graphic layers can be accurately identified according to the depth information, and a binary image can be generated according to the graphic layers. Compared with the method of collecting the three-dimensional graphic code image for identification, the process is simple and the accuracy of the generated binary image is guaranteed; on the other hand, considering that the three-dimensional graphic code of this exemplary embodiment is based on depth information identification, the identification process is not affected by ambient light, and therefore, the graphic layers can be accurately and quickly identified at night or in a weak light indoor environment, and then an accurate binary image can be determined, which has a wide range of applications.
[0064] In an exemplary embodiment, the depth information includes depth values at different positions in the three-dimensional graphic code; the step S520 may include the following steps:
[0065] Positions with the same depth value in the depth information form a graphic layer to identify at least three graphic layers in the three-dimensional graphic code.
[0066] This exemplary embodiment can obtain depth information of different positions in the three-dimensional graphic code through a depth sensor, wherein the depth sensor can include multiple elements at different positions for receiving reflection signals reflected from the three-dimensional graphic code, and determining the depth information of different pixels in the depth image by calculating the flight time, such as SPAD (Single Photon Avalanche Diode), and the depth information can be the depth values of different positions in the three-dimensional graphic code. Graphic layers with different depth values are at different distances from the depth sensor, so this exemplary embodiment can identify at least three graphic layers based on the depth value of each graphic layer determined by the reflection signal. When the depth values of the positions to be determined are the same or similar, it can be considered that the positions to be determined belong to the same graphic layer. When the depth values of the positions to be determined differ by more than a certain degree, it can be considered that the positions to be determined belong to different graphic layers, that is, positions with the same depth values can be classified to form a graphic layer.
[0067] In an exemplary embodiment, if Figure 7 As shown, the above step S530 may include the following steps:
[0068] Step S710, extracting at least one foreground graphic layer and at least one background graphic layer from at least three graphic layers;
[0069] Step S720, filling the first pixel value in the image area corresponding to the foreground graphic layer, and filling the second pixel value in the image area corresponding to the background graphic layer, to generate a binary image.
[0070] The foreground graphic layer refers to the area in the binary image to be generated that can reflect the graphic information, such as the black area of the QR code, and the background graphic layer refers to the graphic layer that can be used as the background, such as the white area of the QR code. The foreground graphic layer and the background graphic layer are encoded separately to generate a binary image. This exemplary embodiment can extract at least one foreground graphic layer and at least one background graphic layer from at least three graphic layers, fill the first pixel value in the image area corresponding to the foreground graphic layer, and fill the second pixel value in the image area corresponding to the background graphic layer to generate a binary image. For example, in Figure 6 Among the three graphic layers shown, graphic layer 610 can be used as the background graphic layer, and graphic layer 620 and graphic layer 630 can be used as the foreground graphic layer, and the image area corresponding to the foreground graphic layer is set to be filled with the first pixel value "1", and the image area corresponding to the background graphic layer is set to be filled with the second pixel value "0". Then, the foreground graphic layer and the background graphic layer are superimposed to generate a binary image with "1" and "0" logic, that is, an image of a two-dimensional code. It should be noted that the above-mentioned "1" and "0" encoding using the black area as the foreground graphic layer and the white area as the background graphic layer is only for schematic illustration. In actual applications, the white area can also be used as the foreground graphic layer and the black area can be used as the background graphic layer, and the like. The present disclosure does not make specific limitations on this.
[0071] In an exemplary embodiment, if Figure 8 As shown, the above step S710 may include the following steps:
[0072] Step S810, extracting n different graphic layer groups from at least three graphic layers, each graphic layer group including at least one foreground graphic layer and at least one background graphic layer, where n is a positive integer not less than 2;
[0073] Further, step S720 may include:
[0074] Step S820, for each graphic layer group, fill the first pixel value in the image area corresponding to the foreground graphic layer, and fill the second pixel value in the image area corresponding to the background graphic layer, to generate a binary image corresponding to the graphic layer group, so as to finally obtain n two-dimensional images corresponding to n graphic layer groups.
[0075] This exemplary embodiment can generate binary images corresponding to different graphic layer groups through different graphic layer group extraction strategies. Take a three-dimensional graphic code including four graphic layers P1, P2, P3, and P4 from bottom to top as an example. When the depth sensor transmits a depth detection signal to the surface of the three-dimensional graphic code, it can identify the following based on the returned reflection signal: Fig. 9 Further, different extraction strategies of graphic layer groups can be used as needed to generate corresponding binary images. Here, the black area is encoded as "1" and the white area is encoded as "0". For example, Fig.10 As shown, the graphic layers P1 and P2 can be extracted as foreground graphic layers, and the graphic layers P3 and P4 can be extracted as background graphic layers. The regions of the graphic layers P1 and P2 are encoded as "1", and the regions of the graphic layers P3 and P4 are encoded as "0", thereby obtaining a binary image 1010; or as shown in FIG. Fig.11 As shown, the graphic layer P3 and the graphic layer P4 can also be extracted as the foreground graphic layer, and the graphic layer P1 and the graphic layer P2 can be used as the background graphic layer. The area of the graphic layer P3 and the graphic layer P4 is encoded as "1", and the area of the graphic layer P1 and the graphic layer P2 is encoded as "0", and another binary image 1110 is obtained, wherein the binary image 1010 and the binary image 1110 are binary images corresponding to the two different graphic layer groups extracted from the above four graphic layers. It should be noted that the above encoding of the area as "1" or "0" is only for schematic illustration. In actual applications, it can be customized according to the encoding method or encoding requirements.
[0076] In addition, the above-mentioned embodiment shows two binary images determined by two graphic layer groups. In other embodiments, there may be other multiple graphic layer groups to determine other binary images. For example, graphic layer P1 and graphic layer P3 are used as foreground graphic layers, and graphic layer P2 and graphic layer P4 are used as background graphic layers; or graphic layer P1 is used as the foreground graphic layer, and graphic layer P2, graphic layer P3 and graphic layer P4 are used as background graphic layers; or graphic layer P1 is used as the background graphic layer, and graphic layer P2, graphic layer P3 and graphic layer P4 are used as foreground graphic layers, etc., and then the foreground graphic layers and background graphic layers are encoded to generate binary images, etc. The present disclosure does not make specific limitations on this.
[0077] In this exemplary embodiment, the same three-dimensional graphic code can be identified by a depth sensor, and a variety of binary images can be determined by extracting different graphic layer groups. In various application scenarios, it can have different functions. For example, in real-life games, players can trigger game content corresponding to different binary images by scanning the same three-dimensional graphic code; in payment scenarios, merchants can integrate the payment codes of two platforms into one three-dimensional graphic code, and users can identify the two-dimensional code in which payment information can be scanned by scanning the three-dimensional graphic code, thereby avoiding abnormal scanning or mis-scanning of the code; in other application scenarios, the three-dimensional graphic code can also be scanned to obtain binary images of different patterns and present them to the user to increase the fun of scanning, and the application scenarios are diversified. Since the three-dimensional graphic code can be identified based on the depth information, the exemplary embodiment can also be a three-dimensional graphic code with a variety of patterns arranged to improve the user's sensory experience.
[0078] In particular, in order to improve the diversity and complexity of binary image generation and to ensure the security of image information contained in the binary image, in an exemplary embodiment, the number of foreground graphic layers is not less than 2, or the number of background graphic layers is not less than 2, that is, different binary images can be generated by extracting at least 2 foreground graphic layers or at least 2 background graphic layers from the three-dimensional graphic code and combining them.
[0079] In an exemplary embodiment, the above-mentioned three-dimensional graphic code recognition method may further include:
[0080] Parse the binary image and output the QR code information corresponding to the binary image.
[0081] This exemplary embodiment can be particularly applied to the scenario of recognizing a QR code. The binary image can correspond to the QR code. By parsing the binary image, the QR code information corresponding to the binary image can be output. For example, the position detection area, the positioning area and the correction area can be determined from the binary image to perform positioning and correction on the QR code. Further, the coding area of the QR code is determined from the binary image. By processing the coding characters corresponding to the coding area, the corresponding QR code information can be obtained. The QR code information can include the positioning information of the scene, the recommendation information of the store or the hot-selling product information, etc. The user can locate the current position by scanning the three-dimensional graphic code in the shopping mall; the QR code information can also include payment information, which is used to complete payment by scanning the three-dimensional graphic code, etc.
[0082] In this exemplary embodiment, since the three-dimensional graphic code can include multiple two-dimensional codes, when the user scans the three-dimensional graphic code, it can locate the user's current location and recommend shops or goods to the user at the same time; or provide the user with shop information while the user scans the code to pay, etc. The present disclosure does not make specific limitations on this.
[0083] In an exemplary embodiment, if Fig.12 As shown, the above step S520 may include the following steps:
[0084] Step S1210, identifying the graphic layer in the three-dimensional graphic code based on the depth information to obtain a first identification result;
[0085] The above-mentioned three-dimensional graphic code recognition method may also include:
[0086] Step S1220, obtaining an image collected for the three-dimensional graphic code, and using the image to identify the graphic layer in the three-dimensional graphic code to obtain a second identification result;
[0087] Step S1230, identifying at least three graphic layers in the 3D graphic code according to the first recognition result and the second recognition result.
[0088] In practical applications, if the graphic layer is identified only by depth information, the depth information may be lost, resulting in inaccurate depth identification, which affects the accurate identification of each graphic layer. In order to improve the accuracy of stereographic code recognition, this exemplary embodiment can comprehensively determine the recognition result of the stereographic code from two aspects: depth recognition and image recognition. Among them, the first recognition result refers to the recognition result of each graphic layer in the stereographic code determined according to the depth information, and the second recognition result refers to the recognition result of each graphic layer in the stereographic code determined according to the image information.
[0089] Specifically, in an exemplary embodiment, the color of each graphic layer may be set to be the same, and the colors of at least three graphic layers are different; further, the above step S1220 may include the following steps:
[0090] Regions with the same color in the image are taken as a graphic layer to identify at least three graphic layers in the graphic, thereby obtaining a second recognition result.
[0091] That is, different colors can be set for different graphic layers. When identifying a three-dimensional graphic code, since the color of each graphic layer is the same, and the colors of at least three graphic layers are different, it is possible to determine which graphic layer each area belongs to by identifying the color of each area. Specifically, areas with the same color can be regarded as a graphic layer, and then areas of different colors in the image can be divided into corresponding graphic layers.
[0092] On the one hand, this exemplary embodiment uses a depth sensor to emit a depth detection signal and receive a reflection signal to determine which graphic layer each position belongs to, and determines each graphic layer based on the depth information, i.e., the first recognition result. On the other hand, since each graphic layer has a different color, each graphic layer can be determined by identifying the color. For example, a three-dimensional graphic code can be imaged, and each graphic layer can be determined based on the color information by identifying the image collected, i.e., the second recognition result. Finally, at least three graphic layers in the graphic are determined together through the first recognition result and the second recognition result.
[0093] Specifically, when the first recognition result of a certain position is consistent with the second recognition result, it means that the recognition result of which graphic layer the position currently belongs to is more accurate. When the first recognition result of a certain position is inconsistent with the second recognition result, it means that there is a difference in the recognition results of the position. It can be further determined by other means to which graphic layer the position belongs. For example, when collecting the depth information of the position, the confidence corresponding to the depth information can be obtained. If the confidence is low, it means that the depth information of the position is inaccurate, and the second recognition result can be used as the standard; if the confidence is high, the first recognition result can be used as the standard, etc. In addition, it can also be determined by judging the difference in color value between the position and the surrounding positions. If the difference in color value between the position and the surrounding positions is large, it does not belong to the same graphic layer as the surrounding positions. Otherwise, it belongs to the same graphic layer. Therefore, it can also be determined whether the second recognition result is accurate, etc. The present disclosure does not make specific restrictions on this. Based on this, the accuracy and flexibility of the stereographic code recognition in various application scenarios of this exemplary embodiment are further improved.
[0094] The exemplary embodiment of the present disclosure also provides a three-dimensional graphic code recognition device. Fig.13 As shown, the graphic recognition device 1300 may include: a depth information acquisition module 1310, used to acquire depth information of a three-dimensional graphic code; a graphic layer recognition module 1320, used to identify at least three graphic layers in the three-dimensional graphic code according to the depth information; and a binary image acquisition module 1330, used to obtain at least one binary image according to at least three graphic layers.
[0095] In an exemplary embodiment, the depth information includes depth values at different positions in the three-dimensional graphic code; the graphic layer identification module includes: a graphic layer identification unit, which is used to form a graphic layer for positions with the same depth value in the depth information to identify at least three graphic layers in the three-dimensional graphic code.
[0096] In an exemplary embodiment, the binary image acquisition module includes: a graphic layer extraction unit, used to extract at least one foreground graphic layer and at least one background graphic layer from at least three graphic layers; a binary image generation unit, used to fill the image area corresponding to the foreground graphic layer with a first pixel value, and fill the image area corresponding to the background graphic layer with a second pixel value, to generate a binary image.
[0097] In an exemplary embodiment, the graphic layer extraction unit includes: an extraction subunit, used to extract n different graphic layer groups from at least three graphic layers, each graphic layer group includes at least one foreground graphic layer and at least one background graphic layer, and n is a positive integer not less than 2; the binary image generation unit includes: a generation subunit, used to fill the image area corresponding to the foreground graphic layer with a first pixel value and the image area corresponding to the background graphic layer with a second pixel value for each graphic layer group, to generate a binary image corresponding to the graphic layer group, so as to finally obtain n two-dimensional images corresponding to the n graphic layer groups.
[0098] In an exemplary embodiment, the number of foreground graphic layers is not less than 2, or the number of background graphic layers is not less than 2.
[0099] In an exemplary embodiment, the graphic layer recognition module includes: a first recognition unit, used to identify the graphic layer in the three-dimensional graphic code based on depth information to obtain a first recognition result; the graphic recognition device also includes: a second recognition unit, used to obtain an image collected for the three-dimensional graphic code, and use the image to identify the graphic layer in the three-dimensional graphic code to obtain a second recognition result; the recognition unit is used to identify at least three graphic layers in the three-dimensional graphic code based on the first recognition result and the second recognition result.
[0100] In an exemplary embodiment, each of the above-mentioned graphic layers has the same color, and the colors of at least three graphic layers are different. The second recognition unit is used to treat the area with the same color in the image as a graphic layer to identify at least three graphic layers in the graphic and obtain a second recognition result.
[0101] The specific details of each part of the above device have been described in detail in the implementation method part, so they will not be repeated here.
[0102] The exemplary embodiments of the present disclosure further provide a computer-readable storage medium, which can be implemented in the form of a program product, including program code. When the program product is run on a terminal device, the program code is used to enable the terminal device to execute the steps according to various exemplary embodiments of the present disclosure described in the above “Exemplary Method” section of this specification, for example, to execute Figure 5 , Figure 7 , Figure 8 or Fig.12The program product may be in the form of a portable compact disk read-only memory (CD-ROM) and include program code, and may be run on a terminal device, such as a personal computer. However, the program product of the present disclosure is not limited thereto, and in this document, a readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, apparatus, or device.
[0103] The program product may use any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of readable storage media (a non-exhaustive list) include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory, a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
[0104] Computer readable signal media may include data signals propagated in baseband or as part of a carrier wave, in which readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Readable signal media may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0105] The program code embodied on the readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the foregoing.
[0106] Program code for performing the operations of the present disclosure may be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, etc., and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., through the Internet using an Internet service provider).
[0107] It will be appreciated by those skilled in the art that various aspects of the present disclosure may be implemented as systems, methods or program products. Therefore, various aspects of the present disclosure may be specifically implemented in the following forms, namely: complete hardware implementation, complete software implementation (including firmware, microcode, etc.), or implementations combining hardware and software aspects, which may be collectively referred to herein as "circuit", "module" or "system". Those skilled in the art will readily think of other implementations of the present disclosure after considering the specification and practicing the invention disclosed herein. The present disclosure is intended to cover any variations, uses or adaptive changes of the present disclosure, which follow the general principles of the present disclosure and include common knowledge or customary technical means in the art that are not disclosed in the present disclosure. The specification and implementation are intended to be exemplary only, and the true scope and spirit of the present disclosure are indicated by the claims.
[0108] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
Claims
1. A three-dimensional graphic code, characterized in that: include: At least three graphic layers are arranged in parallel, and the projection positions of the at least three graphic layers in the normal direction of any graphic layer are different, so that the depth information of the three graphic layers collected along the normal direction is different; the at least three graphic layers are used to obtain at least one binary image; the depth information includes depth values at different positions in the three-dimensional graphic code; positions with the same depth value in the depth information form a graphic layer; the depth information is obtained by a depth sensor.
2. The method according to claim 1, characterized in that The at least three graphic layers include m graphic layer groups, each graphic layer group includes at least two graphic layers, and each graphic layer group forms a two-dimensional code in the three-dimensional graphic code.
3. The method according to claim 1, characterized in that Each graphic layer has the same color, and the at least three graphic layers have different colors.
4. A three-dimensional graphic code recognition method, characterized in that: include: Acquiring depth information of the three-dimensional graphic code according to claim 1 through a depth sensor; identifying at least three graphic layers in the three-dimensional graphic code according to the depth information; Obtaining at least one binary image according to the at least three graphic layers; The depth information includes depth values at different positions in the three-dimensional graphic code; The step of identifying at least three graphic layers in the three-dimensional graphic code according to the depth information comprises: Positions with the same depth value in the depth information form a graphic layer to identify at least three graphic layers in the three-dimensional graphic code.
5. The method according to claim 4, characterized in that The step of obtaining at least one binary image according to the at least three graphic layers comprises: Extracting at least one foreground graphic layer and at least one background graphic layer from the at least three graphic layers; The first pixel value is filled in the image area corresponding to the foreground graphic layer, and the second pixel value is filled in the image area corresponding to the background graphic layer to generate the binary image.
6. The method according to claim 5, characterized in that Extracting at least one foreground graphic layer and at least one background graphic layer from the graphic layer comprises: Extracting n different graphic layer groups from the at least three graphic layers, each graphic layer group includes at least one foreground graphic layer and at least one background graphic layer, and n is a positive integer not less than 2; Filling the first pixel value in the image area corresponding to the foreground graphic layer and filling the second pixel value in the image area corresponding to the background graphic layer to generate the binary image includes: For each graphic layer group, the first pixel value is filled in the image area corresponding to the foreground graphic layer, and the second pixel value is filled in the image area corresponding to the background graphic layer, so as to generate a binary image corresponding to the graphic layer group, so as to finally obtain n two-dimensional images corresponding to the n graphic layer groups.
7. The method according to claim 5, characterized in that The number of the foreground graphic layers is not less than 2, or the number of the background graphic layers is not less than 2.
8. The method according to claim 4, characterized in that The step of identifying at least three graphic layers in the three-dimensional graphic code according to the depth information comprises: Based on the depth information, identifying the graphic layer in the three-dimensional graphic code to obtain a first identification result; The method further comprises: Acquire an image collected for the three-dimensional graphic code, and use the image to identify a graphic layer in the three-dimensional graphic code to obtain a second identification result; At least three graphic layers in the three-dimensional graphic code are identified according to the first recognition result and the second recognition result.
9. The method according to claim 8, characterized in that Each graphic layer has the same color, and the colors of the at least three graphic layers are all different; The step of using the image to identify the graphic layer in the three-dimensional graphic code to obtain a second identification result includes: Regions with the same color in the image are taken as a graphic layer to identify at least three graphic layers in the graphic, thereby obtaining a second recognition result.
10. A three-dimensional graphic code recognition device, characterized in that: include: A depth information acquisition module, used to acquire the depth information of the three-dimensional graphic code according to claim 1; A graphic layer identification module, used for identifying at least three graphic layers in the three-dimensional graphic code according to the depth information; A binary image acquisition module, used for obtaining at least one binary image according to the at least three graphic layers; The depth information includes depth values at different positions in the three-dimensional graphic code; The graphic layer identification module is configured as follows: Positions with the same depth value in the depth information form a graphic layer to identify at least three graphic layers in the three-dimensional graphic code.
11. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 4 to 9 is implemented.
12. An electronic device, characterized in that: include: processor; A memory, configured to store executable instructions of the processor; The processor is configured to perform the method of any one of claims 4 to 9 by executing the executable instructions.
