WO2020114375A1 - 一种用于生成和识别二维码的方法与设备 - Google Patents

一种用于生成和识别二维码的方法与设备 Download PDF

Info

Publication number
WO2020114375A1
WO2020114375A1 PCT/CN2019/122596 CN2019122596W WO2020114375A1 WO 2020114375 A1 WO2020114375 A1 WO 2020114375A1 CN 2019122596 W CN2019122596 W CN 2019122596W WO 2020114375 A1 WO2020114375 A1 WO 2020114375A1
Authority
WO
WIPO (PCT)
Prior art keywords
information
channel
point
positioning
convolution
Prior art date
Application number
PCT/CN2019/122596
Other languages
English (en)
French (fr)
Inventor
梁文昭
Original Assignee
连尚(新昌)网络科技有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 连尚(新昌)网络科技有限公司 filed Critical 连尚(新昌)网络科技有限公司
Publication of WO2020114375A1 publication Critical patent/WO2020114375A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06KGRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
    • G06K7/00Methods or arrangements for sensing record carriers, e.g. for reading patterns
    • G06K7/10Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation
    • G06K7/14Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation using light without selection of wavelength, e.g. sensing reflected white light
    • G06K7/1404Methods for optical code recognition
    • G06K7/1408Methods for optical code recognition the method being specifically adapted for the type of code
    • G06K7/14172D bar codes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06KGRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
    • G06K7/00Methods or arrangements for sensing record carriers, e.g. for reading patterns
    • G06K7/10Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation
    • G06K7/14Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation using light without selection of wavelength, e.g. sensing reflected white light
    • G06K7/1404Methods for optical code recognition
    • G06K7/1439Methods for optical code recognition including a method step for retrieval of the optical code
    • G06K7/1443Methods for optical code recognition including a method step for retrieval of the optical code locating of the code in an image
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06KGRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
    • G06K7/00Methods or arrangements for sensing record carriers, e.g. for reading patterns
    • G06K7/10Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation
    • G06K7/14Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation using light without selection of wavelength, e.g. sensing reflected white light
    • G06K7/1404Methods for optical code recognition
    • G06K7/146Methods for optical code recognition the method including quality enhancement steps
    • G06K7/1482Methods for optical code recognition the method including quality enhancement steps using fuzzy logic or natural solvers, such as neural networks, genetic algorithms and simulated annealing

Definitions

  • This application relates to the field of communications, and in particular to a technique for generating and identifying two-dimensional codes.
  • An object of this application is to provide a technique for generating and identifying a two-dimensional code.
  • a method for generating a two-dimensional code includes:
  • the multi-channel assignment includes the assignment of the first channel, and the assignment of information points in the other areas in the first channel satisfies the first distance correlation;
  • the two-dimensional code is generated according to multi-channel assignment of information points in the two-dimensional code.
  • a method for identifying a two-dimensional code includes:
  • the convolution kernel corresponding to the two-dimensional code is used to convolve the multiple channel information to obtain corresponding multiple channel convolution information, and the multiple channel convolution information includes the first channel convolution information , Where the convolution kernel is adapted to the positioning area in the two-dimensional code;
  • At least one information point with the largest or smallest value in the convolution information of the first channel is determined as at least one positioning point, wherein the convolution information of the first channel is accumulated in the convolution information of the multiple channels And the most information;
  • the identification area in the two-dimensional code is determined according to the at least one positioning point, and an identification process is performed on the identification area.
  • a method for generating an anchor point includes:
  • the multi-channel assignment includes the assignment of the first channel, and the assignment of information points in the other areas in the first channel satisfies the first distance correlation.
  • a method for identifying a positioning point includes:
  • the convolution kernel corresponding to the graphics code to perform convolution processing on the plurality of channel information to obtain corresponding plurality of channel convolution information, the plurality of channel convolution information including the first channel convolution information, wherein, the convolution kernel is adapted to the positioning area in the graphic code;
  • At least one information point with the largest or smallest value in the convolution information of the first channel is determined as at least one positioning point, wherein the convolution information of the first channel is accumulated in the convolution information of the multiple channels And the most information;
  • the identification area in the graphic code is determined according to the at least one anchor point, and an identification process is performed on the identification area.
  • a device for generating a two-dimensional code includes:
  • a first determining module configured to determine a plurality of positioning points in the two-dimensional code to be generated, wherein the two-dimensional code to be generated includes a positioning area;
  • the first according module is used to determine the multi-channel assignment of the information point in the positioning area where at least one of the plurality of positioning points is located, and the information point in the area other than the positioning area in the two-dimensional code Multi-channel assignment, wherein the multi-channel assignment includes the assignment of the first channel, and the assignment of the information points in the other areas in the first channel satisfies the first distance correlation;
  • the generating module is configured to generate the two-dimensional code according to multi-channel assignment of information points in the two-dimensional code.
  • a device for identifying a two-dimensional code includes:
  • a first extraction module configured to extract multiple channel information corresponding to the two-dimensional code from the two-dimensional code to be identified
  • the first obtaining module is configured to perform convolution processing on the multiple channel information by using the convolution kernel corresponding to the two-dimensional code to obtain corresponding multiple channel convolution information.
  • the multiple channel convolution information includes Convolution information of the first channel, wherein the convolution kernel is adapted to the positioning area in the two-dimensional code;
  • a first accumulation module configured to determine at least one information point with the largest or smallest value in the convolution information of the first channel as at least one positioning point, wherein the convolution information of the first channel is in the multiple The accumulation and information in the channel convolution information is the largest;
  • the first recognition module is configured to determine the recognition area in the two-dimensional code according to the at least one positioning point, and perform recognition processing on the recognition area.
  • a method for generating an anchor point includes:
  • the second determining module is used to determine multiple positioning points in the graphic code to be generated
  • the second according module is used to determine the multi-channel assignment of the information point in the positioning area where at least one of the plurality of positioning points is located, and the information point in the area other than the positioning area in the graphic code Multi-channel assignment, wherein the multi-channel assignment includes the assignment of the first channel, and the assignment of information points in the other areas in the first channel satisfies the first distance correlation.
  • a device for identifying an anchor point including:
  • a second extraction module configured to extract multiple channel information corresponding to the graphic code from the graphic code to be identified
  • the second obtaining module is configured to perform convolution processing on the plurality of channel information by using the convolution kernel corresponding to the graphics code to obtain corresponding multiple channel convolution information.
  • the multiple channel convolution information includes the first One channel of convolution information, wherein the convolution kernel is adapted to the positioning area in the graphic code;
  • a second accumulation module configured to determine at least one information point with the largest or smallest value in the convolution information of the first channel as at least one positioning point, wherein the convolution information of the first channel is in the multiple The accumulation and information in the channel convolution information is the largest;
  • the second recognition module is used to determine the recognition area in the graphic code according to the at least one anchor point, and perform recognition processing on the recognition area.
  • a device for generating a two-dimensional code includes:
  • a memory arranged to store computer-executable instructions, which when executed, causes the processor to execute:
  • the multi-channel assignment includes the assignment of the first channel, and the assignment of information points in the other areas in the first channel satisfies the first distance correlation;
  • the two-dimensional code is generated according to multi-channel assignment of information points in the two-dimensional code.
  • a computer readable medium including instructions which, when executed, cause the system to:
  • the multi-channel assignment includes the assignment of the first channel, and the assignment of information points in the other areas in the first channel satisfies the first distance correlation;
  • the two-dimensional code is generated according to multi-channel assignment of information points in the two-dimensional code.
  • a device for identifying a two-dimensional code including:
  • a memory arranged to store computer-executable instructions, which when executed, causes the processor to execute:
  • the convolution kernel corresponding to the two-dimensional code is used to convolve the multiple channel information to obtain corresponding multiple channel convolution information, and the multiple channel convolution information includes the first channel convolution information , Where the convolution kernel is adapted to the positioning area in the two-dimensional code;
  • At least one information point with the largest or smallest value in the convolution information of the first channel is determined as at least one positioning point, wherein the convolution information of the first channel is accumulated in the convolution information of the multiple channels And the most information;
  • the identification area in the two-dimensional code is determined according to the at least one positioning point, and an identification process is performed on the identification area.
  • a computer readable medium including instructions which, when executed, cause the system to:
  • the convolution kernel corresponding to the two-dimensional code is used to convolve the multiple channel information to obtain corresponding multiple channel convolution information, and the multiple channel convolution information includes the first channel convolution information , Where the convolution kernel is adapted to the positioning area in the two-dimensional code;
  • At least one information point with the largest or smallest value in the convolution information of the first channel is determined as at least one positioning point, wherein the convolution information of the first channel is accumulated in the convolution information of the multiple channels And the most information;
  • the identification area in the two-dimensional code is determined according to the at least one positioning point, and an identification process is performed on the identification area.
  • a device for generating an anchor point includes:
  • a memory arranged to store computer-executable instructions, which when executed, causes the processor to execute:
  • the multi-channel assignment includes the assignment of the first channel, and the assignment of information points in the other areas in the first channel satisfies the first distance correlation.
  • a computer readable medium including instructions which, when executed, cause the system to:
  • the multi-channel assignment includes the assignment of the first channel, and the assignment of information points in the other areas in the first channel satisfies the first distance correlation.
  • a device for identifying a positioning point includes:
  • a memory arranged to store computer-executable instructions, which when executed, causes the processor to execute:
  • the convolution kernel corresponding to the graphics code to perform convolution processing on the plurality of channel information to obtain corresponding plurality of channel convolution information, the plurality of channel convolution information including the first channel convolution information, wherein, the convolution kernel is adapted to the positioning area in the graphic code;
  • At least one information point with the largest or smallest value in the convolution information of the first channel is determined as at least one positioning point, wherein the convolution information of the first channel is accumulated in the convolution information of the multiple channels And the most information;
  • the identification area in the graphic code is determined according to the at least one anchor point, and an identification process is performed on the identification area.
  • a computer readable medium including instructions which, when executed, cause the system to:
  • the convolution kernel corresponding to the graphics code to perform convolution processing on the plurality of channel information to obtain corresponding plurality of channel convolution information, the plurality of channel convolution information including the first channel convolution information, wherein, the convolution kernel is adapted to the positioning area in the graphic code;
  • At least one information point with the largest or smallest value in the convolution information of the first channel is determined as at least one positioning point, wherein the convolution information of the first channel is accumulated in the convolution information of the multiple channels And the most information;
  • the identification area in the graphic code is determined according to the at least one anchor point, and an identification process is performed on the identification area.
  • the present application determines the at least one positioning point in the two-dimensional code by determining multiple positioning points in the two-dimensional code to be generated, and according to at least one positioning point among the multiple positioning points Multi-channel assignment of information points in the corresponding positioning area in the code, and multi-channel assignment of information points in the area other than the positioning area in the two-dimensional code, wherein the information points in the other areas are in the first channel
  • a QR code is generated according to the multi-channel assignment of the information points in the QR code.
  • the QR code generated based on this scheme contains invisible positioning point information.
  • the shape is flexible and diverse. Conducive to the stylized development of QR codes.
  • FIG. 1 shows a flowchart of a method for generating a two-dimensional code according to an embodiment of the present application
  • FIG. 2 shows a flowchart of a method for identifying a two-dimensional code according to another embodiment of the present application
  • FIG. 3 shows a flowchart of a method for generating positioning points according to another embodiment of the present application.
  • FIG. 4 shows a flowchart of a method for identifying a positioning point according to another embodiment of the present application
  • FIG. 5 shows a schematic diagram of a device for generating a two-dimensional code according to an embodiment of the present application
  • FIG. 6 shows a schematic diagram of a device for identifying a two-dimensional code according to another embodiment of the present application.
  • FIG. 7 shows a schematic diagram of a device for generating positioning points according to another embodiment of the present application.
  • FIG. 8 shows a schematic diagram of a device for identifying an anchor point according to another embodiment of the present application.
  • FIG. 9 shows an exemplary system that can be used to implement various embodiments described in the present invention.
  • the terminal, the device serving the network, and the trusted party all include one or more processors (such as a Central Processing Unit (CPU)), input/output interfaces, network interfaces, and memory .
  • processors such as a Central Processing Unit (CPU)
  • Memory may include non-permanent memory, random access memory (RAM) and/or non-volatile memory in computer-readable media, such as read-only memory (Read Only Memory, ROM) or flash memory ( flash RAM). Memory is an example of computer-readable media.
  • RAM random access memory
  • ROM read-only memory
  • flash RAM flash memory
  • Computer-readable media including permanent and non-permanent, removable and non-removable media, can store information by any method or technology.
  • the information may be computer readable instructions, data structures, modules of programs, or other data.
  • Examples of computer storage media include, but are not limited to, phase-change memory (PCM), programmable random access memory (Programmable Random Access Memory, PRAM), static random access memory (Static Random-Access Memory, SRAM), dynamic random access memory (Dynamic Random Access Memory, DRAM), other types of random access memory (RAM), read only memory (ROM), electrically erasable programmable read only memory (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 tape cassette, magnetic tape storage or other magnetic storage devices or any other non-transmission media, can be used to store information that can be accessed by computing devices.
  • PCM phase-change memory
  • PRAM
  • the equipment referred to in this application includes, but is not limited to, user equipment, network equipment, or equipment formed by integrating user equipment and network equipment through a network.
  • the user equipment includes, but is not limited to, any mobile electronic product that can perform human-computer interaction with the user (for example, human-computer interaction through a touchpad), such as a smart phone, a tablet computer, etc.
  • the mobile electronic product can adopt any operation System, such as android operating system, iOS operating system, etc.
  • the network device includes an electronic device that can automatically perform numerical calculation and information processing according to a preset or stored instruction
  • its hardware includes but is not limited to a microprocessor, an application specific integrated circuit (Application Specific Integrated Circuit, ASIC ), programmable logic device (Programmable Logic Device, PLD), field programmable gate array (Field Programmable Gate Array, FPGA), digital signal processor (Digital Signal Processor, DSP), embedded equipment, etc.
  • the network equipment includes but is not limited to a cloud composed of computers, network hosts, a single network server, multiple network server sets, or multiple servers; here, the cloud is composed of a large number of computers or network servers based on cloud computing (Cloud Computing), Among them, cloud computing is a type of distributed computing, a virtual supercomputer composed of a group of loosely coupled computers.
  • the network includes but is not limited to the Internet, wide area network, metropolitan area network, local area network, VPN network, wireless self-organizing network (Ad Hoc network), etc.
  • the device may also be a program running on the user device, the network device, or the user device and the network device, the network device, the touch terminal, or the network device and the touch terminal integrated by a network.
  • FIG. 1 shows a method for generating a two-dimensional code according to an embodiment of the present application, where the method includes step S11, step S12, and step S13.
  • step S11 the user equipment determines a plurality of positioning points in the two-dimensional code to be generated, wherein the two-dimensional code to be generated includes a positioning area; in step S12, at least one of the plurality of positioning points is determined Multi-channel assignment of information points in the positioning area where the positioning point is located, and multi-channel assignment of information points in the area other than the positioning area in the two-dimensional code, wherein the multi-channel assignment includes the first channel’s Assignment, the assignment of the information points in the other areas on the first channel meets the first distance correlation; in step S13, the user equipment generates the second channel according to the multi-channel assignment of the information points in the two-dimensional code Dimension code.
  • step S11 the user equipment determines a plurality of positioning points in the two-dimensional code to be generated, where the two-dimensional code to be generated includes a positioning area.
  • the positioning area includes an area containing positioning points.
  • mainstream two-dimensional codes include three positioning points, and the user equipment determines that all three positioning points in the two-dimensional code to be generated by this solution are non-visible positioning points, or The user equipment determines that there are two non-visible positioning points among the three positioning points in the two-dimensional code to be generated in this solution.
  • step S12 the user equipment determines multi-channel assignment of information points in a positioning area where at least one of the plurality of positioning points is located, and information points in areas other than the positioning area in the two-dimensional code Multi-channel assignment, wherein the multi-channel assignment includes the assignment of the first channel, and the assignment of the information points in the other areas in the first channel satisfies the first distance correlation.
  • the information point includes a pixel point
  • the positioning area includes a pixel area where the positioning point is located.
  • the user equipment selects one of the three positioning points of the two-dimensional code, and sets Multi-channel assignment of the anchor point, where multi-channel assignment includes component assignment of R, G, and B channels. The user equipment selects any of the three RGB channels as the first channel.
  • the R channel is selected as the first channel
  • the user equipment determines the values of the components of the three channels of R, G, and B in the area other than the positioning area in the two-dimensional code, wherein the pixels in the areas other than the positioning area are in the first channel
  • the value of the component satisfies the first distance correlation, where the first distance correlation includes that the distance between the pixel point and the positioning point in other regions is correlated with the value of the pixel component in the first channel.
  • step S13 the user equipment generates the two-dimensional code according to the multi-channel assignment of information points in the two-dimensional code. For example, the user equipment determines the multi-channel assignment of the positioning point in the positioning area, and generates the two-dimensional code according to the relationship between other information in the two-dimensional code and the positioning point information, where the other information includes but is not limited to data encoding and error correction encoding Wait for the content information of the QR code.
  • the user equipment first determines three positioning points x, y, and z in the two-dimensional code to be generated.
  • the user equipment uses the R, G, and B color spaces to assign pixels.
  • the user equipment selects the positioning point x and uses R as the main channel, and sets the R channel component of the pixel where the positioning point x is 119, the G channel component is 0, the B channel component is 0, and the positioning point x is around the center 3*
  • the G channel component of other pixel points in other areas at a distance of 3 is 119, and the B channel component is 119.
  • the R channel component is gradually reduced according to the distance from the positioning point x; the user equipment selects the positioning point y and uses R as the main channel.
  • the R channel component of the pixel where the fixed positioning point y is located is 119, the G channel component is 0, and the B channel component is 0, and the G channel component of other pixels in other areas with a distance of 3*3 around the center of the positioning point y is 119
  • the B channel component is 119, and the R channel component gradually decreases according to the distance from the positioning point y; the user equipment selects the positioning point z and uses R as the main channel, setting the R channel component of the pixel where the positioning point z is located to 119, G
  • the channel component is 0, the B channel component is 0, and the G channel component of other pixels in other areas with a distance of 3*3 around the center of the positioning point z is 119, the B channel component is 119, and the R channel component is based on the distance positioning point z
  • the distance gradually decreases; the user equipment determines to generate the corresponding two-dimensional code based on the assignment of the R, G, and B channels on the pixels in the two-dimensional code.
  • each information point in the positioning area has the same multi-channel assignment, or the difference between the multi-channel assignments of any two information points in the positioning area is less than or equal to the first assignment difference threshold.
  • each information point in the positioning area includes three positioning points in the two-dimensional code determined by the user equipment, the three positioning points are located in the positioning area, and the pixels on which the three positioning points are located R, The assigned components of the three channels G and B are the same, or, for any two of the three positioning points in the two-dimensional code determined by the user equipment, the R, G, and The difference between the assignment components of the three channels B is less than or equal to the first assignment difference threshold information, where the first assignment difference threshold is close to zero.
  • the user equipment first determines three positioning points x, y, and z in the two-dimensional code to be generated.
  • the user equipment selects the positioning point x and uses R as the main channel, and sets the R channel component of the pixel where the positioning point x is 119, the G channel component is 0, and the B channel component is 0;
  • the user equipment selects the positioning point y and uses R is the main channel, set the R channel component of the pixel where the positioning point y is 119, G channel component is 0, and B channel component is 0;
  • the user equipment selects the positioning point z and uses R as the main channel to set the positioning point
  • the R channel component of the pixel where z is located is 119, the G channel component is 0, and the B channel component is 0; or, the user equipment selects the positioning point x and uses R as the main channel to set the R channel of the pixel where the positioning point x is located
  • the component is 119, the G channel component is 0, and the B channel component is 0.
  • the first assignment difference threshold is 0.1.
  • the R, G, and B channel components of the pixel at point x locate the point y
  • the R channel component range of the pixel is 118.9 ⁇ 119.19
  • the G channel component range is -0.1 ⁇ 0.1
  • the B channel component range is -0.1 ⁇ 0.1
  • the R, G and B values are integers between 0 and 255, so
  • the channel components corresponding to R, G, and B of the pixel where the positioning point y is located are 119, 0, and 0, respectively.
  • the information points in the positioning area are assigned the same value in different channels, or the information points in the positioning area are assigned in the first channel and the information points are in addition to the first channel
  • the difference in the assignment of other channels is less than or equal to the second assignment difference threshold information.
  • each information point in the positioning area includes three positioning points in the two-dimensional code determined by the user equipment, the three positioning points are located in the positioning area, and the evaluation components of the three positioning points in the R channel are all
  • the assigned component in the G channel is K1
  • the assigned component in the B channel is K2
  • the user equipment selects the positioning point x, and selects any channel of RGB as the first channel
  • the assignment and the The difference of the assignment of other channels is less than or equal to the second assignment difference threshold information, wherein the second assignment difference is close to the assignment of the anchor point in the first channel.
  • the user equipment first determines the three positioning points x, y, and z in the two-dimensional code to be generated.
  • the user equipment selects the positioning point x and uses R as the main channel, setting the R channel component of the pixel where the positioning point x, y, z is 119, and setting the G channel component of the pixel where the positioning point x, y, z is 0, set the B channel component of the pixel where the positioning points x, y, z are located to 0; or, the user equipment selects the positioning point x and uses R as the main channel, such as the second assignment difference threshold is 119.1, and the positioning point x
  • the R channel component range of the pixel is 118.9 ⁇ 119.19
  • the G channel component range is -0.1 ⁇ 0.1
  • the B channel component range is -0.1 ⁇ 0.1
  • the R, G and B values are integers between 0 and 255, so
  • the first distance correlation includes any one of the following: the information point in the other area is assigned to the first channel and the distance information between the information point and the at least one positioning point Negative correlation; the value of the information point in the other area in the first channel is positively related to the distance information between the information point and the at least one positioning point. among them.
  • the information points include pixel points.
  • the user equipment determines three positioning points in the two-dimensional code, and selects any channel in RGB as the first channel, and sets the assignment component of the first channel in the positioning point area.
  • the assigned component of any pixel in the m*m area around the center area in the first channel is inversely proportional to the distance of the pixel from the positioning point, or the user equipment determines the three positioning points in the QR code and selects the RGB Any channel is the first channel, set the first-channel assignment component in the anchor point area, and use the anchor point as the center area around the m*m area.
  • the distance is proportional.
  • the user equipment first determines the three positioning points x, y, and z in the two-dimensional code to be generated.
  • the user equipment selects the positioning point x and uses R as the main channel, and sets the R channel component of the pixel where the positioning point x is to be 119.
  • the user equipment selects the area with the positioning point x as the center and 4*4 from the point.
  • the middle information point setting R channel component is inversely proportional to the distance of the information point from the anchor point. For example, if the A information point is farther from the anchor point x, the R channel component of point A is smaller.
  • the user equipment selects the positioning point x and uses R as the main channel, and sets the R channel component of the pixel where the positioning point x is 119.
  • the user equipment selects the area 4 ⁇ 4 from the point with the positioning point x as the center.
  • the component of the R channel of the information point in this area is proportional to the distance of the information point from the positioning point. For example, if the A information point is farther from the positioning point x, the R channel component of point A is larger.
  • the information points in the other areas are assigned a value of zero in channels other than the first channel, or the information points in the other areas are in channels other than the first channel Is less than or equal to the third assignment threshold.
  • the user equipment determines three positioning points in the two-dimensional code, and selects any channel in RGB as the first channel, sets the assignment component of the first channel in the positioning point area, and takes the positioning point as the center area around m*m
  • the assigned component of any pixel in the area other than the first channel is 0, or the user equipment determines three positioning points in the two-dimensional code, and selects any channel in RGB as the first channel, at the positioning point
  • the evaluation component of the first channel is set in the area, and the evaluation component of any pixel point in the m*m area around the center area in the other channels except the first channel is less than or equal to the third evaluation threshold information, wherein, the The third assignment threshold is close to zero.
  • the user equipment first determines the three positioning points x, y, and z in the two-dimensional code to be generated.
  • the user equipment selects the positioning point x and uses R as the main channel, and sets the R channel component of the pixel where the positioning point x is to be 119.
  • the user equipment selects the area with the positioning point x as the center and 4*4 from the point.
  • the middle information point sets the component of the G and B channels to 0, or the user equipment selects the positioning point x, and uses R as the main channel, sets the R channel component of the pixel where the positioning point x is 119, and the user equipment selects the positioning point x is the area where the center is 4*4 from the point, and the components of the G and B channels in the information point in this area are close to 0, for example, 0.0001.
  • Figure 1 above provides a method for generating a two-dimensional code. Based on this method, a plurality of positioning points in the two-dimensional code are first determined, wherein the plurality of positioning points select three channels of R, G, and B for assignment , When the assignment of each channel meets certain conditions, generate multiple invisible positioning points of the two-dimensional code, and then use the positioning points to combine with other information to generate two-dimensional code.
  • the two-dimensional code generated based on this scheme is flexible and diverse. The stylized development of the dimension code form has a great impetus.
  • FIG. 1 provides a method for generating a two-dimensional code, and a method for identifying a two-dimensional code will be described below in conjunction with FIG. 2.
  • FIG. 2 the content corresponding to FIG. 1 may refer to the detailed introduction in FIG. 1, and will not be described in detail later.
  • FIG. 2 shows a method for identifying a two-dimensional code according to an embodiment of the present application, characterized in that the method includes step S21, step S22, step S23, and step S24.
  • step S21 the user equipment extracts multiple channel information corresponding to the two-dimensional code from the two-dimensional code to be recognized; in step S22, the user equipment verifies the multiple channels using the convolution corresponding to the two-dimensional code
  • the channel information is separately subjected to convolution processing to obtain corresponding multiple channel convolution information, the multiple channel convolution information includes the first channel convolution information, wherein the convolution kernel and the two-dimensional code
  • the positioning area is adapted; in step S23, the user equipment determines at least one information point with the largest or smallest value in the convolution information of the first channel as at least one positioning point, wherein the convolution information of the first channel
  • the cumulative sum information among the multiple channel convolution information is the largest; in step S24, the user equipment determines the recognition area in the two-dimensional code according to the at least one
  • the user equipment extracts a plurality of channel information corresponding to the two-dimensional code from the two-dimensional code to be recognized.
  • the recognition operation includes but is not limited to scanning, shooting and other operations.
  • the user equipment captures or scans the picture information where the two-dimensional code is located, and decomposes the picture into R, G, and B channels. For example, you can use Opencv to extract three channels of an image.
  • the user equipment uses the convolution kernel corresponding to the two-dimensional code to perform convolution processing on the multiple channel information to obtain corresponding multiple channel convolution information.
  • the multiple channel convolution information Contains first-channel convolution information, where the convolution kernel is adapted to the positioning area in the two-dimensional code. For example, for a two-dimensional code corresponding to the size of the m*m area, the user equipment constructs an m*m convolution kernel. The center value of the convolution kernel is 1, and the smaller the value from the center of the convolution kernel.
  • the user equipment uses the m*m convolution kernel to perform convolution processing on the three channels R, G, and B to obtain the accumulated value of each channel after the convolution.
  • step S23 the user equipment determines at least one information point with the largest or smallest value in the convolution information of the first channel as at least one anchor point, where the convolution information of the first channel is in the multiple
  • the cumulative sum information in the channel convolution information is the largest.
  • the convolution information includes accumulated value information.
  • the user equipment constructs an m*m convolution kernel to perform convolution processing on the three channels of R, G, and B, obtains the accumulated value of each channel after convolution, and determines that the accumulated value is the largest Is the first channel, and the user equipment uses one or more points with the largest value in the multiple accumulated value information of the first channel as the positioning point.
  • step S24 the user equipment determines the recognition area in the two-dimensional code according to the at least one positioning point, and performs recognition processing on the recognition area. For example, the user equipment determines one or more positioning points of the two-dimensional code after scanning the picture, determines a scanning area according to the one or more positioning points, and obtains two-dimensional code information after scanning the two-dimensional code.
  • the user holds the user device to scan the QR code.
  • the picture with the QR code is obtained by taking a picture or scanning, and the Opencv split function is used to decompose the picture into R, G, and B channels.
  • the user device Construct an m*m convolution kernel.
  • a 3*3 convolution kernel can be used.
  • the center value of the convolution kernel is 1, and the other values are set to 0.
  • the user equipment uses the 3*3 convolution kernel to perform convolution processing to obtain the accumulated values of the R, G, and B channels.
  • the R channel at the center The assignment value is 119
  • the assignment values of the G and B channels are 0,
  • the assignment values of the R channels of the pixels other than the center are 0, and the assignment values of the G and B channels are arbitrary values.
  • the user equipment adopts a 3*3 convolution kernel to perform convolution processing to obtain the values of R, G, and B channels as 119, 0, and 0, respectively.
  • convolve the three channels R, G, and B in other regions and obtain the values of the three channels R, G, and B as 109, 0, 0, and so on, and obtain the three channels of R, G, and B in other regions.
  • the value is 109, 0, 0, and then the user equipment will accumulate the values obtained in the three channels of R, G, and B to determine that the accumulated value of the R channel is the largest, determine that R is the first channel, and from the value of the R channel
  • the three center points with the highest calculated value are selected as the positioning points of the QR code.
  • the assignment of the information points in the two-dimensional code except the positioning area in the first channel satisfies the first distance correlation; the assignment of the information points in the convolution kernel The second distance correlation is satisfied; the first distance correlation is adapted to the second distance correlation.
  • the information point includes a pixel point.
  • the first channel assignment for the pixel point in the area other than the positioning area is related to the distance from the pixel point to the positioning point. For example, the farther a pixel is from a positioning point, the smaller the first channel component of the point.
  • the convolution kernel constructed by the user equipment the farther the value in the convolution kernel is from the center, the smaller the assignment.
  • the user holds the user equipment, and the user selects a picture with two-dimensional code information to be scanned.
  • the value of the first channel component in the positioning area is set to 119, and other than the positioning area In the area, the pixels farther away from the positioning area have a smaller value in the first channel component, which satisfies the feature inversely proportional to the distance.
  • the convolution kernel selected by the user equipment for convolution processing the convolution The center value of the core is 1, and the farther away from the center, the smaller the value, which satisfies the feature inversely proportional to the distance.
  • the second distance correlation includes any one of the following: the distance information between the center point of the convolution kernel and the information point in the convolution kernel is negatively correlated with the value of the information point The distance information between the center point of the convolution kernel and the information point in the convolution kernel is positively correlated with the assignment of the information point.
  • the user equipment constructs an m*m convolution kernel, the center value of the convolution kernel is fixed, and the assignment of other information points of the convolution except the center point is set to be inversely proportional to the distance of the information point from the center, or the user equipment constructs m*m convolution kernel, the central value of the convolution kernel is fixed, and the value of other information points in the convolution except the center point is set to be proportional to the distance of the information point from the center.
  • the user holds the user device to scan the QR code.
  • the picture with the QR code is obtained by taking a picture or scanning, and the Opencv split function is used to decompose the picture into R, G, and B channels.
  • the user device Construct the m*m convolution kernel.
  • a 3*3 convolution kernel can be used.
  • the center value of the convolution kernel is 1, in other regions of the convolution kernel, the distance The farther the center is, the smaller the assigned value of the information point, or the user holds the user device to scan the QR code, first obtain the picture with the QR code by taking pictures or scanning, and use the Opencv split function to convert the picture It is decomposed into three channels of R, G, and B.
  • the user equipment constructs an m*m convolution kernel.
  • a 3*3 convolution kernel can be used. 1. In other regions of the convolution kernel, the farther away from the center, the larger the assignment of the information point where it is located.
  • the second distance correlation includes distance information between the center point of the convolution kernel and the information point in the convolution kernel, which is negatively correlated with the assignment of the information point; step S23 includes, At least one information point having the largest value in the convolution information of the first channel is determined as the at least one positioning point, wherein the convolution information of the first channel is accumulated in the convolution information of the plurality of channels And information is the biggest.
  • the user equipment constructs an m*m convolution kernel, and in addition to the central point assignment in the convolution kernel, the assignment of other information points is inversely proportional to the distance information between the central points of the convolution kernel.
  • the information includes accumulated value information.
  • the user equipment constructs an m*m convolution check to perform convolution processing on the three channels R, G, and B to obtain the accumulated value of each channel after convolution, and determines that the largest accumulated value is the first channel.
  • the user equipment uses one or more points with the largest value in the multiple accumulated value information of the first channel as the positioning point.
  • the user holds the user device to scan the QR code.
  • the picture with the QR code is obtained by taking a picture or scanning, and the Opencv split function is used to decompose the picture into R, G, and B channels.
  • the user device Construct an m*m convolution kernel.
  • a 3*3 convolution kernel can be used.
  • the center value of the convolution kernel is 1, and the other values are set to 0.
  • the user equipment uses the 3*3 convolution kernel to perform convolution processing to obtain the accumulated values of the R, G, and B channels.
  • the R channel at the center The assignment value is 119
  • the assignment values of the G and B channels are 0,
  • the assignment values of the R channels of the pixels other than the center are 0, and the assignment values of the G and B channels are arbitrary values.
  • the user equipment adopts a 3*3 convolution kernel to perform convolution processing to obtain the values of R, G, and B channels as 119, 0, and 0, respectively.
  • convolve the three channels R, G, and B in other regions and obtain the values of the three channels R, G, and B as 109, 0, 0, and so on, and obtain the three channels of R, G, and B in other regions.
  • the value is 109, 0, 0, and then the user equipment will accumulate the values obtained in the three channels of R, G, and B to determine that the accumulated value of the R channel is the largest, determine that R is the first channel, and from the value of the R channel
  • the three center points with the highest calculated value are selected as the positioning points of the QR code.
  • the second distance correlation includes distance information between the center point of the convolution kernel and the information point in the convolution kernel, which is positively correlated with the value of the information point; step S23 includes, Determining at least one information point with the smallest value in the convolution information of the first channel as the at least one positioning point, wherein the convolution information of the first channel is accumulated in the convolution information of the multiple channels And information is the biggest.
  • the user equipment constructs an m*m convolution kernel, and sets the assignment of information points other than the central point in the convolution kernel to be proportional to the distance information between the central points of the convolution kernel.
  • the convolution information Including the accumulated value information, the user equipment constructs an m*m convolution kernel to perform convolution processing on the three channels R, G, and B to obtain the accumulated value of each channel after convolution, and determines that the largest accumulated value is the first channel.
  • the user The device uses one or more points with the smallest value among the multiple accumulated value information of the first channel as the positioning point.
  • the user holds the user device to scan the QR code.
  • the picture with the QR code is obtained by taking a picture or scanning, and the Opencv split function is used to decompose the picture into R, G, and B channels.
  • the user device Construct an m*m convolution kernel.
  • a 3*3 convolution kernel can be used.
  • the center value of the convolution kernel is 0, and the other values are set to 1.
  • the user equipment uses the 3*3 convolution kernel to perform convolution processing to obtain the accumulated values of the R, G, and B channels.
  • the R channel at the center The assignment value is 1, the assignment values of the G and B channels are respectively 0, the assignment value of the R channel of the pixels other than the center is 1, and the assignment values of the G and B channels are arbitrary values, respectively.
  • the user equipment adopts 3*3 convolution kernels to perform convolution processing to obtain values of R, G, and B channels as 8, 0, and 0, respectively.
  • convolve the three channels R, G, and B in other regions get the values of the three channels R, G, and B as 9, 0, 0, and so on, and get the three channels R, G, and B in other regions.
  • the value is 10, 0, 0, and then the user equipment will accumulate the values obtained in the three channels of R, G, and B to determine that the accumulated value of the R channel is the largest, determine that R is the first channel, and from the value of the R channel
  • the three center points with the smallest calculated value are selected as the positioning points of the QR code.
  • the above Figure 2 provides a method for identifying a two-dimensional code. Based on this method, the assignment of the three channels R, G, and B in the two-dimensional code is first identified, and the three channels are respectively convolved using corresponding convolution kernels. Obtain the convolution information, and then determine the positioning point according to the convolution information, accurately identify the positioning point in the invisible two-dimensional code information, and successfully read the two-dimensional code information.
  • the above mainly describes the method for generating a two-dimensional code and the method for identifying a two-dimensional code provided by the present application.
  • the present application also provides a method for generating an anchor point and a method for identifying an anchor point The method is described below in conjunction with Figures 3 and 4. Among them, in FIGS. 3 and 4, the content similar to the method shown in FIG. 1 or FIG. 2 may refer to the detailed introduction in FIG. 1 or FIG. 2, and will not be described in detail later.
  • FIG. 3 shows a method for generating positioning points according to an embodiment of the present application, characterized in that the method includes step S31 and step S32.
  • step S31 the user equipment determines multiple positioning points in the graphic code to be generated, wherein the graphic code includes a positioning area; in step S32, the user equipment determines at least one of the multiple positioning points Multi-channel assignment of information points in the location area where they are located, and multi-channel assignment of information points in areas other than the positioning area in the graphic code, where the multi-channel assignment includes the assignment of the first channel, so The assignment of the information points in the other areas in the first channel satisfies the first distance correlation.
  • step S31 the user equipment determines a plurality of positioning points in the graphic code to be generated, where the graphic code includes a positioning area. For example, the user equipment determines that all three anchor points in the graphic code to be generated are non-visible anchor points, or the user equipment determines that there are two non-visible anchor points in the three anchor points in the graphic code to be generated in this solution .
  • step S32 the user equipment determines the multi-channel assignment of the information point in the positioning area where at least one of the plurality of positioning points is located, and the information point in the area other than the positioning area in the graphic code Multi-channel assignment, wherein the multi-channel assignment includes the assignment of the first channel, and the assignment of information points in the other areas in the first channel satisfies the first distance correlation.
  • the user equipment selects one of the three positioning points of the graphic code, and sets a multi-channel assignment on the positioning point in the positioning area where the positioning point is located, where the multi-channel assignment includes component assignment of the three channels of RGB , The user equipment selects any of the three RGB channels as the first channel.
  • the R channel is selected as the first channel, then it is necessary to determine the components of the R, G, and B channels of the pixel where the positioning point is located. value.
  • the user equipment determines the values of the components of the three channels R, G, and B in the area other than the positioning area in the code, where the pixels in the areas other than the positioning area are in the first channel.
  • the value of the component satisfies the first distance correlation, where the first distance correlation includes that the distance between the pixel point and the positioning point in other regions is correlated with the value of the pixel component in the first channel.
  • the user equipment first determines the three positioning points x, y, and z in the graphic code to be generated.
  • the user equipment uses the R, G, and B color spaces to assign pixels.
  • the user equipment selects the positioning point x and uses R as the main channel, and sets the R channel component of the pixel where the positioning point x is 119, the G channel component is 0, the B channel component is 0, and the positioning point x is around the center 3*
  • the G channel component of other pixel points in other areas at a distance of 3 is 119, and the B channel component is 119.
  • the R channel component is gradually reduced according to the distance from the positioning point x; the user equipment selects the positioning point y and uses R as the main channel.
  • the R channel component of the pixel where the fixed positioning point y is located is 119, the G channel component is 0, and the B channel component is 0, and the G channel component of other pixels in other areas with a distance of 3*3 around the center of the positioning point y is 119
  • the B channel component is 119, and the R channel component gradually decreases according to the distance from the positioning point y; the user equipment selects the positioning point z and uses R as the main channel, setting the R channel component of the pixel where the positioning point z is located to 119, G
  • the channel component is 0, the B channel component is 0, and the G channel component of other pixels in other areas with a distance of 3*3 around the center of the positioning point z is 119, the B channel component is 119, and the R channel component is based on the distance positioning point z
  • the distance gradually decreases.
  • Figure 3 above provides a method for generating anchor points. Based on this method, multiple anchor points in the graphic code are first determined. Among these anchor points, three channels R, G, and B are selected for assignment. When the assignment of each channel satisfies certain conditions, multiple invisible positioning points of the graphic code are generated.
  • the positioning point generated based on this scheme is flexible and diverse, and is not limited to the positioning points visible to the naked eye.
  • FIG. 3 provides a method for generating positioning points, and a corresponding method for identifying positioning points will be described below with reference to FIG. 4.
  • the content corresponding to FIG. 3 may refer to the detailed introduction in FIG. 3, and will not be described in detail later.
  • FIG. 4 shows a method for identifying positioning points according to an embodiment of the present application, characterized in that the method includes step S41, step S42, step S43, and step S44.
  • step S41 the user equipment extracts multiple channel information corresponding to the graphic code from the graphic code to be recognized;
  • step S42 the user equipment uses the convolution corresponding to the graphic code to check the multiple channel information respectively Performing convolution processing to obtain corresponding multiple channel convolution information, the multiple channel convolution information including the first channel convolution information, wherein the convolution kernel is adapted to the positioning area in the graphic code;
  • step S43 the user equipment determines at least one information point with the largest or smallest value in the convolution information of the first channel as at least one positioning point, where the convolution information of the first channel is in the multiple The cumulative sum information in the channel convolution information is the largest;
  • step S44 the user equipment determines the recognition area in the graphic code according to the at least one anchor point, and performs recognition processing on the recognition area.
  • step S41 the user equipment extracts a plurality of channel information corresponding to the graphic code from the graphic code to be recognized. For example, the user equipment captures or scans the picture information where the graphic code is located, and decomposes the picture into R, G, and B channels. For example, you can use Opencv to extract three channels of an image.
  • step S42 the user equipment performs convolution processing on the plurality of channel information by using the convolution kernel corresponding to the graphics code to obtain corresponding multiple channel convolution information.
  • the multiple channel convolution information includes the first One channel of convolution information, wherein the convolution kernel is adapted to the positioning area in the graphic code. For example, corresponding to the code of the size of the m*m area, the user equipment constructs an m*m convolution kernel. The center value of the convolution kernel is 1, and the smaller the value from the center of the convolution kernel, the farther away.
  • the user equipment uses the m*m convolution kernel to perform convolution processing on the three channels R, G, and B to obtain the accumulated value of each channel after the convolution.
  • step S43 the user equipment determines at least one information point with the largest or smallest value in the convolution information of the first channel as at least one positioning point, where the convolution information of the first channel is in the multiple
  • the cumulative sum information in the channel convolution information is the largest.
  • the convolution information includes accumulated value information.
  • the user equipment constructs an m*m convolution kernel to perform convolution processing on the three channels of R, G, and B, obtains the accumulated value of each channel after convolution, and determines that the accumulated value is the largest Is the first channel, and the user equipment uses one or more points with the largest value in the multiple accumulated value information of the first channel as the positioning point.
  • step S44 the user equipment determines the recognition area in the graphic code according to the at least one anchor point, and performs recognition processing on the recognition area. For example, the user equipment determines one or more positioning points of the code after scanning the picture, determines a scanning area according to the one or more positioning points, and obtains code information after scanning the code.
  • the user holds the user device to perform the scan code operation.
  • the picture with the code is obtained by taking a picture or scanning, and the Opencv split function is used to decompose the picture into R, G, and B channels.
  • the user device constructs m*m Convolution kernel, in order to be consistent with the positioning area in the code, a 3*3 convolution kernel can be used.
  • the center value of the convolution kernel is 1, and the other values are set to 0.
  • the user equipment uses the 3*3 convolution kernel to perform convolution processing to obtain the accumulated values of the R, G, and B channels.
  • the R channel at the center is assigned the value of 119, G, and B channels.
  • the values of are respectively 0, the values of R channels of pixels other than the center are 0, and the values of G and B channels are arbitrary values.
  • the user equipment adopts a 3*3 convolution kernel to perform convolution processing to obtain the values of R, G, and B channels as 119, 0, and 0, respectively. In turn, convolve the three channels R, G, and B in other regions, and obtain the values of the three channels R, G, and B as 109, 0, 0, and so on, and obtain the three channels of R, G, and B in other regions.
  • the value is 109, 0, 0, and then the user equipment will accumulate the values obtained in the three channels of R, G, and B to determine that the accumulated value of the R channel is the largest, determine that R is the first channel, and from the value of the R channel The three center points with the highest calculated value are selected as the anchor points of the code.
  • Figure 4 above provides a method for identifying anchor points. Based on this method, the assignment of the three channels R, G, and B in the graphic code is first identified, and the corresponding convolution kernel is used to convolve the three channels to obtain the convolution. Product information, and then determine the positioning point according to the convolution information, and accurately identify the positioning point in the invisible graphics code information, which provides a basis for the subsequent reading of the graphics code information.
  • FIG. 5 shows a user equipment for generating a two-dimensional code according to an embodiment of the present application.
  • the user equipment includes a large unit or module capable of performing various steps in the method shown in FIG. 1.
  • These units or modules can be implemented by hardware , Software or a combination of software and hardware, this application is not limited.
  • the content corresponding to the method shown in FIG. 1 can be referred to the detailed introduction in FIG. 1.
  • the device includes a first determination module 11, a first basis module 12, and a generation module 13.
  • the first determining module 11 is used to determine a plurality of positioning points in the two-dimensional code to be generated, wherein the two-dimensional code to be generated includes a positioning area; the first according to the module 12 is used to determine the plurality of positioning Multi-channel assignment of information points in the positioning area where at least one positioning point is located, and multi-channel assignment of information points in the area other than the positioning area in the two-dimensional code, wherein the multi-channel assignment includes The assignment of the first channel, the assignment of the information points in the other areas in the first channel meets the first distance correlation; the generation module 13 is used to generate the multi-channel assignment of the information points in the two-dimensional code The two-dimensional code.
  • the first determining module 11 is configured to determine a plurality of positioning points in the two-dimensional code to be generated, wherein the two-dimensional code to be generated includes a positioning area.
  • the positioning area includes an area containing positioning points.
  • mainstream two-dimensional codes include three positioning points, and the user equipment determines that all three positioning points in the two-dimensional code to be generated by this solution are non-visible positioning points, or The user equipment determines that there are two non-visible positioning points among the three positioning points in the two-dimensional code to be generated in this solution.
  • the first according to module 12 is used to determine the multi-channel assignment of the information point in the positioning area where at least one of the plurality of positioning points is located, and the information in the area other than the positioning area in the two-dimensional code Multi-channel assignment of points, wherein the multi-channel assignment includes the assignment of the first channel, and the assignment of information points in the other areas in the first channel satisfies the first distance correlation.
  • the information point includes a pixel point
  • the positioning area includes a pixel area where the positioning point is located.
  • the user equipment selects one of the three positioning points of the two-dimensional code, and sets The multi-channel assignment of the anchor point, where the multi-channel assignment includes the component assignment of the three channels R, G, and B.
  • the user equipment selects any of the three channels R, G, and B as the first channel. If the R channel is selected here It is the first channel, and then the values of the components of the three channels R, G, and B of the pixel where the positioning point is located must be determined.
  • the user equipment determines the values of the components of the three channels of R, G, and B in the area other than the positioning area in the two-dimensional code, wherein the pixels in the areas other than the positioning area are in the first channel
  • the value of the component satisfies the first distance correlation, where the first distance correlation includes that the distance between the pixel point and the positioning point in other regions is correlated with the value of the pixel component in the first channel.
  • the generating module 13 is configured to generate the two-dimensional code according to multi-channel assignment of information points in the two-dimensional code.
  • the user equipment determines the multi-channel assignment of the positioning point in the positioning area, and generates the two-dimensional code according to the relationship between other information in the two-dimensional code and the positioning point information, where the other information includes but is not limited to data encoding and error correction encoding Wait for the content information of the QR code.
  • the user equipment first determines three positioning points x, y, and z in the two-dimensional code to be generated.
  • the user equipment uses the R, G, and B color spaces to assign pixels.
  • the user equipment selects the positioning point x and uses R as the main channel, and sets the R channel component of the pixel where the positioning point x is 119, the G channel component is 0, the B channel component is 0, and the positioning point x is around the center 3*
  • the G channel component of other pixel points in other areas at a distance of 3 is 119, and the B channel component is 119.
  • the R channel component is gradually reduced according to the distance from the positioning point x; the user equipment selects the positioning point y and uses R as the main channel.
  • the R channel component of the pixel where the fixed positioning point y is located is 119, the G channel component is 0, and the B channel component is 0, and the G channel component of other pixels in other areas with a distance of 3*3 around the center of the positioning point y is 119
  • the B channel component is 119, and the R channel component gradually decreases according to the distance from the positioning point y; the user equipment selects the positioning point z and uses R as the main channel, setting the R channel component of the pixel where the positioning point z is located to 119, G
  • the channel component is 0, the B channel component is 0, and the G channel component of other pixels in other areas with a distance of 3*3 around the center of the positioning point z is 119, the B channel component is 119, and the R channel component is based on the distance positioning point z
  • the distance gradually decreases; the user equipment determines to generate the corresponding two-dimensional code based on the assignment of the R, G, and B channels on the pixels in the two-dimensional code.
  • each information point in the positioning area has the same multi-channel assignment, or the difference between the multi-channel assignments of any two information points in the positioning area is less than or equal to the first assignment difference threshold.
  • each information point in the positioning area includes three positioning points in the two-dimensional code determined by the user equipment, the three positioning points are located in the positioning area, and the pixels on which the three positioning points are located R, The assigned components of the three channels G and B are the same, or, for any two of the three positioning points in the two-dimensional code determined by the user equipment, the R, G, and The difference between the assignment components of the three channels B is less than or equal to the first assignment difference threshold information, where the first assignment difference threshold is close to zero.
  • the user equipment first determines the three positioning points x, y, and z in the two-dimensional code to be generated.
  • the user equipment selects the positioning point x and uses R as the main channel, and sets the R channel component of the pixel where the positioning point x is 119, the G channel component is 0, and the B channel component is 0;
  • the user equipment selects the positioning point y and uses R is the main channel, set the R channel component of the pixel where the positioning point y is 119, G channel component is 0, and B channel component is 0;
  • the user equipment selects the positioning point z and uses R as the main channel to set the positioning point
  • the R channel component of the pixel where z is located is 119, the G channel component is 0, and the B channel component is 0; or, the user equipment selects the positioning point x and uses R as the main channel to set the R channel of the pixel where the positioning point x is located
  • the component is 119, the G channel component is 0, and the B channel component is 0.
  • the first assignment difference threshold is 0.1.
  • the R, G, and B channel components of the pixel at point x locate the point y
  • the R channel component range of the pixel is 118.9 ⁇ 119.19
  • the G channel component range is -0.1 ⁇ 0.1
  • the B channel component range is -0.1 ⁇ 0.1
  • the R, G and B values are integers between 0 and 255, so
  • the channel components corresponding to R, G, and B of the pixel where the positioning point y is located are 119, 0, and 0, respectively.
  • the information points in the positioning area are assigned the same value in different channels, or the information points in the positioning area are assigned in the first channel and the information points are in addition to the first channel
  • the difference in the assignment of other channels is less than or equal to the second assignment difference threshold information.
  • each information point in the positioning area includes three positioning points in the two-dimensional code determined by the user equipment, the three positioning points are located in the positioning area, and the evaluation components of the three positioning points in the R channel are all
  • the assigned component in the G channel is K1
  • the assigned component in the B channel is K2
  • the user equipment selects the positioning point x, and selects any channel of RGB as the first channel
  • the assignment and the The difference of the assignment of other channels is less than or equal to the second assignment difference threshold information, wherein the second assignment difference is close to the assignment of the anchor point in the first channel.
  • the user equipment first determines three positioning points x, y, and z in the two-dimensional code to be generated.
  • the user equipment selects the positioning point x and uses R as the main channel, setting the R channel component of the pixel where the positioning point x, y, z is 119, and setting the G channel component of the pixel where the positioning point x, y, z is 0, set the B channel component of the pixel where the positioning points x, y, z are located to 0; or, the user equipment selects the positioning point x and uses R as the main channel, such as the second assignment difference threshold is 119.1, and the positioning point x
  • the R channel component range of the pixel is 118.9 ⁇ 119.19
  • the G channel component range is -0.1 ⁇ 0.1
  • the B channel component range is -0.1 ⁇ 0.1
  • the R, G and B values are integers between 0 and 255, so
  • the first distance correlation includes any one of the following: the information point in the other area is assigned to the first channel and the distance information between the information point and the at least one positioning point Negative correlation; the value of the information point in the other area in the first channel is positively related to the distance information between the information point and the at least one positioning point. among them.
  • the information points include pixel points.
  • the user equipment determines three positioning points in the two-dimensional code, and selects any channel in RGB as the first channel, and sets the assignment component of the first channel in the positioning point area.
  • the assigned component of any pixel in the m*m area around the center area in the first channel is inversely proportional to the distance of the pixel from the positioning point, or the user equipment determines the three positioning points in the QR code and selects the RGB Any channel is the first channel, set the first-channel assignment component in the anchor point area, and use the anchor point as the center area around the m*m area.
  • the distance is proportional.
  • the user equipment first determines three positioning points x, y, and z in the two-dimensional code to be generated.
  • the user equipment selects the positioning point x and uses R as the main channel, and sets the R channel component of the pixel where the positioning point x is to be 119.
  • the user equipment selects the area with the positioning point x as the center and 4*4 from the point.
  • the middle information point setting R channel component is inversely proportional to the distance of the information point from the anchor point. For example, if the A information point is farther from the anchor point x, the R channel component of point A is smaller.
  • the user equipment selects the positioning point x and uses R as the main channel, and sets the R channel component of the pixel where the positioning point x is 119.
  • the user equipment selects the area 4 ⁇ 4 from the point with the positioning point x as the center.
  • the component of the R channel of the information point in this area is proportional to the distance of the information point from the positioning point. For example, if the A information point is farther from the positioning point x, the R channel component of point A is larger.
  • the information points in the other areas are assigned a value of zero in channels other than the first channel, or the information points in the other areas are in channels other than the first channel Is less than or equal to the third assignment threshold.
  • the user equipment determines three positioning points in the two-dimensional code, and selects any channel in RGB as the first channel, sets the assignment component of the first channel in the positioning point area, and takes the positioning point as the center area around m*m
  • the assigned component of any pixel in the area other than the first channel is 0, or the user equipment determines three positioning points in the two-dimensional code, and selects any channel in RGB as the first channel, at the positioning point
  • the evaluation component of the first channel is set in the area, and the evaluation component of any pixel point in the m*m area around the center area in the other channels except the first channel is less than or equal to the third evaluation threshold information, wherein, the The third assignment threshold is close to zero.
  • the user equipment first determines the three positioning points x, y, and z in the two-dimensional code to be generated.
  • the user equipment selects the positioning point x and uses R as the main channel, and sets the R channel component of the pixel where the positioning point x is to be 119.
  • the user equipment selects the area with the positioning point x as the center and 4*4 from the point.
  • the middle information point sets the component of the G and B channels to 0, or the user equipment selects the positioning point x, and uses R as the main channel, sets the R channel component of the pixel where the positioning point x is 119, and the user equipment selects the positioning point x is the area where the center is 4*4 from the point, and the components of the G and B channels in the information point in this area are close to 0, for example, 0.0001.
  • FIG. 6 shows a user equipment for identifying a two-dimensional code according to an embodiment of the present application.
  • the user equipment includes a large unit or module capable of performing various steps in the method shown in FIG. 2.
  • These units or modules can be implemented by hardware , Software or a combination of software and hardware, this application is not limited.
  • the device includes a first extraction module 21, a first acquisition module 22, a first accumulation module 23, and a first recognition module 24.
  • the first extraction module 21 is used to extract multiple channel information corresponding to the two-dimensional code from the two-dimensional code to be identified; the first obtaining module 22 is used to check the convolution by using the convolution corresponding to the two-dimensional code
  • the multiple channel information is separately subjected to convolution processing to obtain corresponding multiple channel convolution information, the multiple channel convolution information includes the first channel convolution information, wherein the convolution kernel and the two-dimensional code
  • the localization area in the application is adapted;
  • the first accumulation module 23 is used to determine at least one information point with the largest or smallest value in the convolution information of the first channel as at least one positioning point, where the The cumulative sum information of the convolution information in the multiple channels of convolution information is the largest; the first identification module 24 is used to determine the identification area in the two-dimensional code according to the at least one positioning point, and to identify the The area performs recognition processing.
  • the first extraction module 21 is configured to extract multiple channel information corresponding to the two-dimensional code from the two-dimensional code to be recognized.
  • the recognition operation includes but is not limited to scanning, shooting and other operations.
  • the user equipment captures or scans the picture information where the two-dimensional code is located, and decomposes the picture into R, G, and B channels. For example, you can use Opencv to extract three channels of an image.
  • the first obtaining module 22 is configured to perform convolution processing on the plurality of channel information by using the convolution kernel corresponding to the two-dimensional code to obtain corresponding multiple channel convolution information.
  • the multiple channel convolution The information includes first-channel convolution information, where the convolution kernel is adapted to the positioning area in the two-dimensional code. For example, for a two-dimensional code corresponding to the size of the m*m area, the user equipment constructs an m*m convolution kernel. The center value of the convolution kernel is 1, and the smaller the value from the center of the convolution kernel. The user equipment uses the m*m convolution kernel to perform convolution processing on the three channels R, G, and B to obtain the accumulated value of each channel after the convolution.
  • the first accumulation module 23 is configured to determine at least one information point with the largest or smallest value in the convolution information of the first channel as at least one positioning point, where the convolution information of the first channel is in the multiple The accumulation and information in the convolution information of each channel is the largest.
  • the convolution information includes accumulated value information.
  • the user equipment constructs an m*m convolution kernel to perform convolution processing on the three channels of R, G, and B, obtains the accumulated value of each channel after convolution, and determines that the accumulated value is the largest Is the first channel, and the user equipment uses one or more points with the largest value in the multiple accumulated value information of the first channel as the positioning point.
  • the first recognition module 24 is configured to determine the recognition area in the two-dimensional code according to the at least one positioning point, and perform recognition processing on the recognition area. For example, the user equipment determines one or more positioning points of the two-dimensional code after scanning the picture, determines a scanning area according to the one or more positioning points, and obtains two-dimensional code information after scanning the two-dimensional code.
  • the user holds the user device to scan the QR code.
  • the picture with the QR code is obtained by taking a picture or scanning, and the Opencv split function is used to decompose the picture into R, G, and B channels.
  • the user device Construct an m*m convolution kernel.
  • a 3*3 convolution kernel can be used.
  • the center value of the convolution kernel is 1, and the other values are set to 0.
  • the user equipment uses the 3*3 convolution kernel to perform convolution processing to obtain the accumulated values of the R, G, and B channels.
  • the R channel at the center The assignment value is 119
  • the assignment values of the G and B channels are 0,
  • the assignment values of the R channels of the pixels other than the center are 0, and the assignment values of the G and B channels are arbitrary values.
  • the user equipment adopts a 3*3 convolution kernel to perform convolution processing to obtain the values of R, G, and B channels as 119, 0, and 0, respectively.
  • convolve the three channels R, G, and B in other regions and obtain the values of the three channels R, G, and B as 109, 0, 0, and so on, and obtain the three channels of R, G, and B in other regions.
  • the value is 109, 0, 0, and then the user equipment will accumulate the values obtained in the three channels of R, G, and B to determine that the accumulated value of the R channel is the largest, determine that R is the first channel, and from the value of the R channel
  • the three center points with the highest calculated value are selected as the positioning points of the QR code.
  • the assignment of the information points in the other regions of the two-dimensional code except the positioning area in the first channel satisfies the first distance correlation; the assignment of the information points in the convolution kernel meets the Two distance correlation; the first distance correlation is adapted to the second distance correlation.
  • the information point includes a pixel point.
  • the first channel assignment for the pixel point in the area other than the positioning area is related to the distance from the pixel point to the positioning point. For example, the farther a pixel is from a positioning point, the smaller the first channel component of the point.
  • the convolution kernel constructed by the user equipment the farther the value in the convolution kernel is from the center, the smaller the assignment.
  • the user holds the user equipment, and the user selects a picture with two-dimensional code information to be scanned.
  • the value of the first channel component in the positioning area is set to 119, and other than the positioning area In the area, the pixels farther away from the positioning area have a smaller value in the first channel component, which satisfies the feature inversely proportional to the distance.
  • the convolution kernel selected by the user equipment for convolution processing the convolution The center value of the core is 1, and the farther away from the center, the smaller the value, which satisfies the feature inversely proportional to the distance.
  • the second distance correlation includes any one of the following: the distance information between the center point of the convolution kernel and the information point in the convolution kernel is negatively correlated with the value of the information point The distance information between the center point of the convolution kernel and the information point in the convolution kernel is positively related to the assignment of the information point.
  • the user equipment constructs an m*m convolution kernel, the center value of the convolution kernel is fixed, and the assignment of other information points of the convolution except the center point is set to be inversely proportional to the distance of the information point from the center, or the user equipment constructs m*m convolution kernel, the central value of the convolution kernel is fixed, and the value of other information points in the convolution except the center point is set to be proportional to the distance of the information point from the center.
  • the user holds the user device to scan the QR code.
  • the picture with the QR code is obtained by taking a picture or scanning, and the Opencv split function is used to decompose the picture into R, G, and B channels.
  • the user device Construct the m*m convolution kernel.
  • a 3*3 convolution kernel can be used.
  • the center value of the convolution kernel is 1, in other regions of the convolution kernel, the distance The farther the center is, the smaller the assigned value of the information point, or the user holds the user device to scan the QR code, first obtain the picture with the QR code by taking pictures or scanning, and use the Opencv split function to convert the picture It is decomposed into three channels of R, G, and B.
  • the user equipment constructs an m*m convolution kernel.
  • a 3*3 convolution kernel can be used.
  • the center value of the convolution kernel is 1. In other regions of the convolution kernel, the farther away from the center, the larger the assignment of the information point where it is located.
  • the second distance correlation includes distance information between the center point of the convolution kernel and the information point in the convolution kernel, which is negatively correlated with the value of the information point; the first accumulation module 23. It is used to determine at least one information point with the largest value in the convolution information of the first channel as the at least one positioning point, where the convolution information of the first channel is convoluted in the multiple channels The accumulation and information in the information is the largest.
  • the user equipment constructs an m*m convolution kernel, and sets the value of other information points in the convolution kernel to be inversely proportional to the distance information between the center points of the convolution kernel.
  • the convolution information Including the accumulated value information, the user equipment constructs an m*m convolution kernel to perform convolution processing on the three channels R, G, and B to obtain the accumulated value of each channel after convolution, and determines that the largest accumulated value is the first channel.
  • the user The device uses one or more points with the largest value among the multiple accumulated value information of the first channel as the anchor point.
  • the user holds the user device to scan the QR code.
  • the picture with the QR code is obtained by taking a picture or scanning, and the Opencv split function is used to decompose the picture into R, G, and B channels.
  • the user device Construct an m*m convolution kernel.
  • a 3*3 convolution kernel can be used.
  • the center value of the convolution kernel is 1, and the other values are set to 0.
  • the user equipment uses the 3*3 convolution kernel to perform convolution processing to obtain the accumulated values of the R, G, and B channels.
  • the R channel at the center The assignment value is 119
  • the assignment values of the G and B channels are 0,
  • the assignment values of the R channels of the pixels other than the center are 0, and the assignment values of the G and B channels are arbitrary values.
  • the user equipment adopts a 3*3 convolution kernel to perform convolution processing to obtain the values of R, G, and B channels as 119, 0, and 0, respectively.
  • convolve the three channels R, G, and B in other regions and obtain the values of the three channels R, G, and B as 109, 0, 0, and so on, and obtain the three channels of R, G, and B in other regions.
  • the value is 109, 0, 0, and then the user equipment will accumulate the values obtained in the three channels of R, G, and B to determine that the accumulated value of the R channel is the largest, determine that R is the first channel, and from the value of the R channel
  • the three center points with the highest calculated value are selected as the positioning points of the QR code.
  • the second distance correlation includes distance information between the center point of the convolution kernel and the information point in the convolution kernel, which is positively correlated with the value of the information point; the first accumulation module 23. It is used to determine at least one information point with the smallest value in the convolution information of the first channel as the at least one positioning point, where the convolution information of the first channel is convoluted in the multiple channels The accumulation and information in the information is the largest.
  • the user equipment constructs an m*m convolution kernel, and sets the assignment of information points other than the central point in the convolution kernel to be proportional to the distance information between the central points of the convolution kernel.
  • the convolution information Including the accumulated value information, the user equipment constructs an m*m convolution kernel to perform convolution processing on the three channels R, G, and B to obtain the accumulated value of each channel after convolution, and determines that the largest accumulated value is the first channel.
  • the user The device uses one or more points with the smallest value among the multiple accumulated value information of the first channel as the positioning point.
  • the user For example, if the user holds the user device to scan the QR code, he first obtains the picture with the QR code by taking a picture or scanning, and uses the Opencv split function to decompose the picture into three channels: R, G, and B.
  • the user device Construct an m*m convolution kernel.
  • a 3*3 convolution kernel can be used.
  • the center value of the convolution kernel is 0, and the other values are set to 1.
  • the user equipment uses the 3*3 convolution kernel to perform convolution processing to obtain the accumulated values of the R, G, and B channels.
  • the R channel at the center The assignment value is 1, the assignment values of the G and B channels are respectively 0, the assignment value of the R channel of the pixels other than the center is 1, and the assignment values of the G and B channels are arbitrary values, respectively.
  • the user equipment adopts 3*3 convolution kernels to perform convolution processing to obtain values of R, G, and B channels as 8, 0, and 0, respectively.
  • convolve the three channels R, G, and B in other regions get the values of the three channels R, G, and B as 9, 0, 0, and so on, and get the three channels R, G, and B in other regions.
  • the value is 10, 0, 0, and then the user equipment will accumulate the values obtained in the three channels of R, G, and B to determine that the accumulated value of the R channel is the largest, determine that R is the first channel, and from the value of the R channel
  • the three center points with the smallest calculated value are selected as the positioning points of the QR code.
  • FIG. 7 shows a user equipment for generating positioning points according to an embodiment of the present application.
  • the user equipment includes a large unit or module capable of performing various steps in the method shown in FIG. 3, and these units or modules may be implemented by hardware or software. Or it can be implemented by a combination of software and hardware, which is not limited in this application.
  • the content corresponding to the method shown in FIG. 3 can be referred to the detailed introduction in FIG. 3.
  • the device includes a second determination module 31 and a second basis module 32.
  • the second determining module 31 is used to determine a plurality of positioning points in the graphic code to be generated, wherein the graphic code includes a positioning area; the second according to the module 32 is used to determine at least one of the plurality of positioning points Multi-channel assignment of information points in the positioning area where the positioning point is located, and multi-channel assignment of information points in areas other than the positioning area in the graphic code, wherein the multi-channel assignment includes the assignment of the first channel , The assignment of the information points in the other areas in the first channel satisfies the first distance correlation.
  • the second determining module 31 is configured to determine a plurality of positioning points in the graphic code to be generated, wherein the graphic code includes a positioning area. For example, the user equipment determines that all three anchor points in the graphic code to be generated are non-visible anchor points, or the user equipment determines that there are two non-visible anchor points in the three anchor points in the graphic code to be generated in this solution .
  • the second according to module 32 is used to determine the multi-channel assignment of the information point in the positioning area where at least one of the plurality of positioning points is located, and the information point in the area other than the positioning area in the graphic code Multi-channel assignment, wherein the multi-channel assignment includes the assignment of the first channel, and the assignment of the information points in the other areas in the first channel satisfies the first distance correlation.
  • the user equipment selects one of the three positioning points of the graphic code, and sets a multi-channel assignment on the positioning point in the positioning area where the positioning point is located, where the multi-channel assignment includes component assignment of the three channels of RGB , The user equipment selects any of the three RGB channels as the first channel.
  • the R channel is selected as the first channel, then it is necessary to determine the components of the R, G, and B channels of the pixel where the positioning point is located. value.
  • the user equipment determines the values of the components of the three channels R, G, and B in the area other than the positioning area in the code, where the pixels in the areas other than the positioning area are in the first channel.
  • the value of the component satisfies the first distance correlation, where the first distance correlation includes that the distance between the pixel point and the positioning point in other regions is correlated with the value of the pixel component in the first channel.
  • the user equipment first determines the three positioning points x, y, and z in the graphic code to be generated.
  • the user equipment uses the R, G, and B color spaces to assign pixels.
  • the user equipment selects the positioning point x and uses R as the main channel, and sets the R channel component of the pixel where the positioning point x is 119, the G channel component is 0, the B channel component is 0, and the positioning point x is around the center 3*
  • the G channel component of other pixel points in other areas at a distance of 3 is 119, and the B channel component is 119.
  • the R channel component is gradually reduced according to the distance from the positioning point x; the user equipment selects the positioning point y and uses R as the main channel.
  • the R channel component of the pixel where the fixed positioning point y is located is 119, the G channel component is 0, and the B channel component is 0, and the G channel component of other pixels in other areas with a distance of 3*3 around the center of the positioning point y is 119
  • the B channel component is 119, and the R channel component gradually decreases according to the distance from the positioning point y; the user equipment selects the positioning point z and uses R as the main channel, setting the R channel component of the pixel where the positioning point z is located to 119, G
  • the channel component is 0, the B channel component is 0, and the G channel component of other pixels in other areas with a distance of 3*3 around the center of the positioning point z is 119, the B channel component is 119, and the R channel component is based on the distance positioning point z
  • the distance gradually decreases.
  • FIG. 8 shows a user equipment for identifying a positioning point according to an embodiment of the present application.
  • the user equipment includes a large unit or module that can perform various steps in the method shown in FIG. 4. These units or modules can be implemented by hardware, The software or the combination of software and hardware is used for implementation, and this application is not limited. Among them, in FIG. 8, the content corresponding to the method shown in FIG. 4 can be referred to the detailed introduction in FIG. 4.
  • the device includes a second extraction module 41, a second acquisition module 42, a second accumulation module 43, and a second recognition module 44.
  • the second extraction module 41 is used to extract multiple channel information corresponding to the graphic code from the graphic code to be recognized; the second obtaining module 42 is used to check the multiple channels using the convolution corresponding to the graphic code The information is subjected to convolution processing to obtain corresponding multiple channel convolution information, the multiple channel convolution information includes the first channel convolution information, wherein the convolution kernel is relative to the positioning area in the graphics code Adapt; the second accumulation module 43 is used to determine at least one information point with the largest or smallest value in the convolution information of the first channel as at least one positioning point, wherein the convolution information of the first channel is in The cumulative sum information among the convolution information of the plurality of channels is the largest; the second recognition module 44 is configured to determine the recognition area in the graphic code according to the at least one positioning point, and perform recognition processing on the recognition area.
  • the second extraction module 41 is configured to extract multiple channel information corresponding to the graphic code from the graphic code to be recognized.
  • the user equipment captures or scans the picture information where the graphic code is located, and decomposes the picture into R, G, and B channels.
  • the second obtaining module 42 is configured to perform convolution processing on the plurality of channel information by using the convolution kernel corresponding to the graphic code to obtain corresponding multiple channel convolution information
  • the multiple channel convolution information includes The first channel of convolution information, wherein the convolution kernel is adapted to the positioning area in the graphic code. For example, corresponding to the code of the size of the m*m area, the user equipment constructs an m*m convolution kernel. The center value of the convolution kernel is 1, and the smaller the value from the center of the convolution kernel, the farther away. The user equipment uses the m*m convolution kernel to perform convolution processing on the three channels R, G, and B to obtain the accumulated value of each channel after the convolution.
  • the second accumulation module 43 is configured to determine at least one information point with the largest or smallest value in the convolution information of the first channel as at least one positioning point, where the convolution information of the first channel is in the multiple The accumulation and information in the convolution information of each channel is the largest.
  • the convolution information includes accumulated value information.
  • the user equipment constructs an m*m convolution kernel to perform convolution processing on the three channels of R, G, and B, obtains the accumulated value of each channel after convolution, and determines that the accumulated value is the largest Is the first channel, and the user equipment uses one or more points with the largest value in the multiple accumulated value information of the first channel as the positioning point.
  • the second recognition module 44 is configured to determine the recognition area in the graphic code according to the at least one anchor point, and perform recognition processing on the recognition area. For example, the user equipment determines one or more positioning points of the code after scanning the picture, determines a scanning area according to the one or more positioning points, and obtains code information after scanning the code.
  • the user holds the user device to perform the scan code operation.
  • the picture with the code is obtained by taking pictures or scanning, and the Opencv split function is used to decompose the picture into R, G, and B channels.
  • the user device constructs m*m Convolution kernel, in order to be consistent with the positioning area in the code, a 3*3 convolution kernel can be used.
  • the center value of the convolution kernel is 1, and the other values are set to 0.
  • the user equipment uses the 3*3 convolution kernel to perform convolution processing to obtain the accumulated values of the R, G, and B channels.
  • the R channel at the center is assigned the value of 119, G, and B channels.
  • the values of are respectively 0, the values of R channels of pixels other than the center are 0, and the values of G and B channels are arbitrary values.
  • the user equipment adopts a 3*3 convolution kernel to perform convolution processing to obtain the values of R, G, and B channels as 119, 0, and 0, respectively. In turn, convolve the three channels R, G, and B in other regions, and obtain the values of the three channels R, G, and B as 109, 0, 0, and so on, and obtain the three channels of R, G, and B in other regions.
  • the value is 109, 0, 0, and then the user equipment will accumulate the values obtained in the three channels of R, G, and B to determine that the accumulated value of the R channel is the largest, determine that R is the first channel, and from the value of the R channel The three center points with the highest calculated value are selected as the anchor points of the code.
  • system 300 can be used as a user equipment for generating and identifying a two-dimensional code in any of the embodiments.
  • system 300 may include one or more computer-readable media with instructions (eg, system memory or NVM/storage device 320) and coupled with the one or more computer-readable media and configured to execute One or more processors (eg, processor(s) 305) that instruct to implement the modules to perform the actions described in this application.
  • processors eg, processor(s) 305
  • system control module 310 may include any suitable interface controller to provide at least one of the processor(s) 305 and/or any suitable device or component in communication with the system control module 310 Any suitable interface.
  • the system control module 310 may include a memory controller module 330 to provide an interface to the system memory 315.
  • the memory controller module 330 may be a hardware module, a software module, and/or a firmware module.
  • the system memory 315 may be used, for example, to load and store data and/or instructions for the system 300.
  • the system memory 315 may include any suitable volatile memory, for example, a suitable DRAM.
  • the system memory 315 may include double data rate type four synchronous dynamic random access memory (DDR4 SDRAM).
  • system control module 310 may include one or more input/output (I/O) controllers to provide an interface to the NVM/storage device 320 and the communication interface(s) 325.
  • I/O input/output
  • NVM/storage device 320 may be used to store data and/or instructions.
  • the NVM/storage device 320 may include any suitable non-volatile memory (eg, flash memory) and/or may include any suitable non-volatile storage device(s) (eg, one or more hard disk drives) HDD), one or more compact disc (CD) drives and/or one or more digital versatile disc (DVD) drives).
  • suitable non-volatile memory eg, flash memory
  • HDD hard disk drives
  • CD compact disc
  • DVD digital versatile disc
  • the NVM/storage device 320 may include storage resources that are physically part of the device on which the system 300 is installed, or it may be accessed by the device without having to be part of the device.
  • the NVM/storage device 320 can be accessed via the communication interface(s) 325 through the network.
  • the communication interface(s) 325 may provide an interface for the system 300 to communicate through one or more networks and/or with any other suitable devices.
  • the system 300 can wirelessly communicate with one or more components of the wireless network according to any of the one or more wireless network standards and/or protocols.
  • At least one of the processor(s) 305 may be packaged with the logic of one or more controllers (eg, memory controller module 330) of the system control module 310.
  • at least one of the processor(s) 305 may be packaged with the logic of one or more controllers of the system control module 310 to form a system-in-package (SiP).
  • at least one of the processor(s) 305 may be integrated with the logic of one or more controllers of the system control module 310 on the same mold.
  • at least one of the processor(s) 305 may be integrated with the logic of one or more controllers of the system control module 310 on the same mold to form a system on chip (SoC).
  • SoC system on chip
  • the system 300 may be, but not limited to, a server, workstation, desktop computing device, or mobile computing device (eg, laptop computing device, handheld computing device, tablet computer, netbook, etc.). In various embodiments, the system 300 may have more or fewer components and/or different architectures.
  • the system 300 includes one or more cameras, keyboards, liquid crystal display (LCD) screens (including touch screen displays), non-volatile memory ports, multiple antennas, graphics chips, application specific integrated circuits ( ASIC) and speakers.
  • LCD liquid crystal display
  • ASIC application specific integrated circuits
  • the present application also provides a computer-readable storage medium that stores computer code, and when the computer code is executed, the method according to any one of the preceding items is executed.
  • the present application also provides a computer program product.
  • the computer program product is executed by a computer device, the method according to any one of the preceding items is executed.
  • This application also provides a computer device, the computer device includes:
  • One or more processors are One or more processors;
  • Memory used to store one or more computer programs
  • the one or more processors When the one or more computer programs are executed by the one or more processors, the one or more processors are caused to implement the method according to any one of the preceding items.
  • the present application may be implemented in software and/or a combination of software and hardware, for example, it may be implemented using an application specific integrated circuit (ASIC), a general purpose computer, or any other similar hardware device.
  • ASIC application specific integrated circuit
  • the software program of the present application may be executed by a processor to implement the steps or functions described above.
  • the software programs of the present application can be stored in computer-readable recording media, such as RAM memory, magnetic or optical drives or floppy disks, and similar devices.
  • some steps or functions of the present application may be implemented by hardware, for example, as a circuit that cooperates with a processor to perform various steps or functions.
  • a part of the application may be applied as a computer program product, for example, computer program instructions, and when it is executed by a computer, the method and/or technical solution according to the application may be invoked or provided through the operation of the computer.
  • the computer program instructions exist in a computer-readable medium including but not limited to source files, executable files, installation package files, etc.
  • the manner in which the computer program instructions are executed by the computer includes but not Limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installation program.
  • the computer-readable medium may be any available computer-readable storage medium or communication medium accessible to the computer.
  • Communication media includes media whereby communication signals containing, for example, computer-readable instructions, data structures, program modules, or other data are transmitted from one system to another.
  • Communication media may include guided transmission media (such as cables and wires (eg, fiber optics, coaxial, etc.)) and wireless (non-guided transmission) media that can propagate energy waves, such as sound, electromagnetic, RF, microwave, and infrared .
  • Computer readable instructions, data structures, program modules, or other data may be embodied as a modulated data signal in, for example, a wireless medium such as a carrier wave or a similar mechanism such as is embodied as part of spread spectrum technology.
  • modulated data signal refers to a signal that has one or more of its characteristics changed or set in such a manner as to encode information in the signal. The modulation can be analog, digital or mixed modulation techniques.
  • computer-readable storage media may include volatile and non-volatile, removable, and non-volatile, implementable by any method or technology for storing information such as computer-readable instructions, data structures, program modules, or other data. Removable and non-removable media.
  • computer-readable storage media include, but are not limited to, volatile memory, such as random access memory (RAM, DRAM, SRAM); and non-volatile memory, such as flash memory, various read-only memories (ROM, PROM, EPROM) , EEPROM), magnetic and ferromagnetic/ferroelectric memory (MRAM, FeRAM); and magnetic and optical storage devices (hard disks, magnetic tapes, CDs, DVDs); or other currently known media or future development can be stored for computer systems Computer-readable information/data used.
  • volatile memory such as random access memory (RAM, DRAM, SRAM
  • non-volatile memory such as flash memory, various read-only memories (ROM, PROM, EPROM) , EEPROM), magnetic and ferromagnetic/ferroelectric memory (MRAM, FeRAM); and magnetic and optical storage devices (hard disks, magnetic tapes, CDs, DVDs); or other currently known media or future development can be stored for computer systems Computer-readable information/data used.
  • volatile memory such as random access memory (RAM, DRAM,
  • an embodiment according to the present application includes an apparatus including a memory for storing computer program instructions and a processor for executing program instructions, wherein, when the computer program instructions are executed by the processor, trigger
  • the device operates based on the aforementioned method and/or technical solution according to various embodiments of the present application.

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Artificial Intelligence (AREA)
  • Health & Medical Sciences (AREA)
  • Electromagnetism (AREA)
  • General Health & Medical Sciences (AREA)
  • Toxicology (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Automation & Control Theory (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Evolutionary Biology (AREA)
  • Evolutionary Computation (AREA)
  • Fuzzy Systems (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Quality & Reliability (AREA)
  • Image Analysis (AREA)

Abstract

一种用于生成二维码的方法,该方法包括:确定待生成的二维码中的多个定位点(S11);确定所述多个定位点中至少一个定位点所在定位区域中的信息点的多通道赋值,以及所述二维码中除所述定位区域外其它区域中信息点的多通道赋值(S12);根据所述二维码中的信息点的多通道赋值生成所述二维码(S13)。所述方法生成的二维码包含不可见的定位点信息,无须将定位点固定在特定位置,用户通过扫描二维码即可获取二维码信息。

Description

一种用于生成和识别二维码的方法与设备 技术领域
本申请涉及通信领域,尤其涉及一种用于生成和识别二维码的技术。
背景技术
随着近几年移动支付的高速发展,以支付宝和微信为首的国内两大移动支付均结合二维码组成了新一代无线支付方案,使得支付体验变得更加快捷轻松。目前二维码除了成为我们日常中支付环节中密不可分的一环,它在之前就曾被广泛应用在零售、高科技、运输等行业。当前主流的二维码为了快速鲁棒的定位,设计出的定位点属于肉眼可以感知的信息,限制了二维码的形态,不利于二维码的风格化发展。
发明内容
本申请的一个目的是提供一种用于生成和识别二维码的技术。
根据本申请的一个方面,提供了一种用于生成二维码的方法,该方法包括:
确定待生成的二维码中的多个定位点,其中,所述待生成的二维码包括定位区域;
确定所述多个定位点中至少一个定位点所在定位区域中的信息点的多通道赋值,以及所述二维码中除所述定位区域外其它区域中的信息点的多通道赋值,其中,所述多通道赋值包括第一通道的赋值,所述其它区域中的信息点在所述第一通道的赋值满足第一距离相关性;
根据所述二维码中的信息点的多通道赋值生成所述二维码。
根据本申请的另一个方面,提供了一种用于识别二维码的方法,该方法包括:
从待识别的二维码中提取所述二维码对应的多个通道信息;
利用所述二维码对应的卷积核对所述多个通道信息分别进行卷积处理,以 获得对应的多个通道卷积信息,所述多个通道卷积信息包括第一通道的卷积信息,其中,所述卷积核与所述二维码中的定位区域相适应;
将所述第一通道的卷积信息中数值最大或最小的至少一个信息点确定为至少一个定位点,其中,所述第一通道的卷积信息在所述多个通道卷积信息中的累加和信息最大;
根据所述至少一个定位点确定所述二维码中的识别区域,并对所述识别区域执行识别处理。
根据本申请的一个方面,提供了一种用于生成定位点的方法,该方法包括:
确定待生成的图形码中的多个定位点;
确定所述多个定位点中至少一个定位点所在定位区域中的信息点的多通道赋值,以及所述图形码中除所述定位区域外其它区域中的信息点的多通道赋值,其中,所述多通道赋值包括第一通道的赋值,所述其它区域中的信息点在所述第一通道的赋值满足第一距离相关性。
根据本申请的一个方面,提供了一种用于识别定位点的方法,该方法包括:
从待识别的图形码中提取所述图形码对应的多个通道信息;
利用所述图形码对应的卷积核对所述多个通道信息分别进行卷积处理,以获得对应的多个通道卷积信息,所述多个通道卷积信息包括第一通道的卷积信息,其中,所述卷积核与所述图形码中定位区域相适应;
将所述第一通道的卷积信息中数值最大或最小的至少一个信息点确定为至少一个定位点,其中,所述第一通道的卷积信息在所述多个通道卷积信息中的累加和信息最大;
根据所述至少一个定位点确定所述图形码中的识别区域,并对所述识别区域执行识别处理。
根据本申请的一个方面,提供了一种用于生成二维码的设备,该设备包括:
第一确定模块,用于确定待生成的二维码中的多个定位点,其中,所述待生成的二维码包括定位区域;
第一根据模块,用于确定所述多个定位点中至少一个定位点所在定位区域中的信息点的多通道赋值,以及所述二维码中除所述定位区域外其它区域中的信息点的多通道赋值,其中,所述多通道赋值包括第一通道的赋值,所述其它 区域中的信息点在所述第一通道的赋值满足第一距离相关性;
生成模块,用于根据所述二维码中的信息点的多通道赋值生成所述二维码。
根据本申请的另一个方面,提供了一种用于识别二维码的设备,该设备包括:
第一提取模块,用于从待识别的二维码中提取所述二维码对应的多个通道信息;
第一获得模块,用于利用所述二维码对应的卷积核对所述多个通道信息分别进行卷积处理,以获得对应的多个通道卷积信息,所述多个通道卷积信息包括第一通道的卷积信息,其中,所述卷积核与所述二维码中的定位区域相适应;
第一累加模块,用于将所述第一通道的卷积信息中数值最大或最小的至少一个信息点确定为至少一个定位点,其中,所述第一通道的卷积信息在所述多个通道卷积信息中的累加和信息最大;
第一识别模块,用于根据所述至少一个定位点确定所述二维码中的识别区域,并对所述识别区域执行识别处理。
根据本申请的一个方面,提供了一种用于生成定位点的方法,该方法包括:
第二确定模块,用于确定待生成的图形码中的多个定位点;
第二根据模块,用于确定所述多个定位点中至少一个定位点所在定位区域中的信息点的多通道赋值,以及所述图形码中除所述定位区域外其它区域中的信息点的多通道赋值,其中,所述多通道赋值包括第一通道的赋值,所述其它区域中的信息点在所述第一通道的赋值满足第一距离相关性。
根据本申请的一个方面,提供了一种用于识别定位点的设备,该设备包括:
第二提取模块,用于从待识别的图形码中提取所述图形码对应的多个通道信息;
第二获得模块,用于利用所述图形码对应的卷积核对所述多个通道信息分别进行卷积处理,以获得对应的多个通道卷积信息,所述多个通道卷积信息包括第一通道的卷积信息,其中,所述卷积核与所述图形码中定位区域相适应;
第二累加模块,用于将所述第一通道的卷积信息中数值最大或最小的至少一个信息点确定为至少一个定位点,其中,所述第一通道的卷积信息在所述多个通道卷积信息中的累加和信息最大;
第二识别模块,用于根据所述至少一个定位点确定所述图形码中的识别区域,并对所述识别区域执行识别处理。
根据本申请的一个方面,提供了一种用于生成二维码的设备,该设备包括:
处理器;以及
被安排成存储计算机可执行指令的存储器,所述可执行指令在被执行时使所述处理器执行:
确定待生成的二维码中的多个定位点,其中,所述待生成的二维码包括定位区域;
确定所述多个定位点中至少一个定位点所在定位区域中的信息点的多通道赋值,以及所述二维码中除所述定位区域外其它区域中的信息点的多通道赋值,其中,所述多通道赋值包括第一通道的赋值,所述其它区域中的信息点在所述第一通道的赋值满足第一距离相关性;
根据所述二维码中的信息点的多通道赋值生成所述二维码。
根据本申请的一个方面,提供了一种包括指令的计算机可读介质,所述指令在被执行时使得***进行:
确定待生成的二维码中的多个定位点,其中,所述待生成的二维码包括定位区域;
确定所述多个定位点中至少一个定位点所在定位区域中的信息点的多通道赋值,以及所述二维码中除所述定位区域外其它区域中的信息点的多通道赋值,其中,所述多通道赋值包括第一通道的赋值,所述其它区域中的信息点在所述第一通道的赋值满足第一距离相关性;
根据所述二维码中的信息点的多通道赋值生成所述二维码。
根据本申请的一个方面,提供了一种用于识别二维码的设备,该设备包括:
处理器;以及
被安排成存储计算机可执行指令的存储器,所述可执行指令在被执行时使所述处理器执行:
从待识别的二维码中提取所述二维码对应的多个通道信息;
利用所述二维码对应的卷积核对所述多个通道信息分别进行卷积处理,以获得对应的多个通道卷积信息,所述多个通道卷积信息包括第一通道的卷积信 息,其中,所述卷积核与所述二维码中的定位区域相适应;
将所述第一通道的卷积信息中数值最大或最小的至少一个信息点确定为至少一个定位点,其中,所述第一通道的卷积信息在所述多个通道卷积信息中的累加和信息最大;
根据所述至少一个定位点确定所述二维码中的识别区域,并对所述识别区域执行识别处理。
根据本申请的一个方面,提供了一种包括指令的计算机可读介质,所述指令在被执行时使得***进行:
从待识别的二维码中提取所述二维码对应的多个通道信息;
利用所述二维码对应的卷积核对所述多个通道信息分别进行卷积处理,以获得对应的多个通道卷积信息,所述多个通道卷积信息包括第一通道的卷积信息,其中,所述卷积核与所述二维码中的定位区域相适应;
将所述第一通道的卷积信息中数值最大或最小的至少一个信息点确定为至少一个定位点,其中,所述第一通道的卷积信息在所述多个通道卷积信息中的累加和信息最大;
根据所述至少一个定位点确定所述二维码中的识别区域,并对所述识别区域执行识别处理。
根据本申请的一个方面,提供了一种生成定位点的设备,该设备包括:
处理器;以及
被安排成存储计算机可执行指令的存储器,所述可执行指令在被执行时使所述处理器执行:
确定待生成的图形码中的多个定位点;
确定所述多个定位点中至少一个定位点所在定位区域中的信息点的多通道赋值,以及所述图形码中除所述定位区域外其它区域中的信息点的多通道赋值,其中,所述多通道赋值包括第一通道的赋值,所述其它区域中的信息点在所述第一通道的赋值满足第一距离相关性。
根据本申请的一个方面,提供了一种包括指令的计算机可读介质,所述指令在被执行时使得***进行:
确定待生成的图形码中的多个定位点;
确定所述多个定位点中至少一个定位点所在定位区域中的信息点的多通道赋值,以及所述图形码中除所述定位区域外其它区域中的信息点的多通道赋值,其中,所述多通道赋值包括第一通道的赋值,所述其它区域中的信息点在所述第一通道的赋值满足第一距离相关性。
根据本申请的一个方面,提供了一种识别定位点的设备,该设备包括:
处理器;以及
被安排成存储计算机可执行指令的存储器,所述可执行指令在被执行时使所述处理器执行:
从待识别的图形码中提取所述图形码对应的多个通道信息;
利用所述图形码对应的卷积核对所述多个通道信息分别进行卷积处理,以获得对应的多个通道卷积信息,所述多个通道卷积信息包括第一通道的卷积信息,其中,所述卷积核与所述图形码中定位区域相适应;
将所述第一通道的卷积信息中数值最大或最小的至少一个信息点确定为至少一个定位点,其中,所述第一通道的卷积信息在所述多个通道卷积信息中的累加和信息最大;
根据所述至少一个定位点确定所述图形码中的识别区域,并对所述识别区域执行识别处理。
根据本申请的一个方面,提供了一种包括指令的计算机可读介质,所述指令在被执行时使得***进行:
从待识别的图形码中提取所述图形码对应的多个通道信息;
利用所述图形码对应的卷积核对所述多个通道信息分别进行卷积处理,以获得对应的多个通道卷积信息,所述多个通道卷积信息包括第一通道的卷积信息,其中,所述卷积核与所述图形码中定位区域相适应;
将所述第一通道的卷积信息中数值最大或最小的至少一个信息点确定为至少一个定位点,其中,所述第一通道的卷积信息在所述多个通道卷积信息中的累加和信息最大;
根据所述至少一个定位点确定所述图形码中的识别区域,并对所述识别区域执行识别处理。
与现有技术相比,本申请通过确定待生成的二维码中的多个定位点,并根 据所述多个定位点中至少一个定位点,确定所述至少一个定位点在所述二维码中对应的定位区域中信息点的多通道赋值,以及所述二维码中除所述定位区域外其它区域中信息点的多通道赋值,其中,所述其它区域中信息点在第一通道的赋值满足第一距离相关性,再根据所述二维码中信息点的多通道赋值生成二维码,基于本方案生成的二维码中包含不可见的定位点信息,形态灵活多样,有利于二维码风格化的发展。
附图说明
通过阅读参照以下附图所作的对非限制性实施例所作的详细描述,本申请的其它特征、目的和优点将会变得更明显:
图1示出根据本申请一个实施例的一种用于生成二维码的方法流程图;
图2示出根据本申请另一个实施例的一种用于识别二维码的方法流程图;
图3示出根据本申请另一个实施例的一种用于生成定位点的方法流程图;
图4示出根据本申请另一个实施例的一种用于识别定位点的方法流程图;
图5示出根据本申请一个实施例的一种用于生成二维码的设备示意图;
图6示出根据本申请另一个实施例的一种用于识别二维码的设备示意图;
图7示出根据本申请另一个实施例的一种用于生成定位点的设备示意图;
图8示出根据本申请另一个实施例的一种用于识别定位点的设备示意图;
图9示出可被用于实施本发明中所述的各个实施例的示例性***。
附图中相同或相似的附图标记代表相同或相似的部件。
具体实施方式
下面结合附图对本申请作进一步详细描述。
在本申请一个典型的配置中,终端、服务网络的设备和可信方均包括一个或多个处理器(例如中央处理器(Central Processing Unit,CPU))、输入/输出接口、网络接口和内存。
内存可能包括计算机可读介质中的非永久性存储器,随机存取存储器(Random Access Memory,RAM)和/或非易失性内存等形式,如只读存储器(Read Only Memory,ROM)或闪存(flash RAM)。内存是计算机可读介质的示例。
计算机可读介质包括永久性和非永久性、可移动和非可移动媒体可以由任何方法或技术来实现信息存储。信息可以是计算机可读指令、数据结构、程序的模块或其他数据。计算机的存储介质的例子包括,但不限于相变内存(Phase-Change Memory,PCM)、可编程随机存取存储器(Programmable Random Access Memory,PRAM)、静态随机存取存储器(Static Random-Access Memory,SRAM)、动态随机存取存储器(Dynamic Random Access Memory,DRAM)、其他类型的随机存取存储器(RAM)、只读存储器(ROM)、电可擦除可编程只读存储器(Electrically-Erasable Programmable Read-Only Memory,EEPROM)、快闪记忆体或其他内存技术、只读光盘只读存储器(Compact Disc Read-Only Memory,CD-ROM)、数字多功能光盘(Digital Versatile Disc,DVD)或其他光学存储、磁盒式磁带,磁带磁盘存储或其他磁性存储设备或任何其他非传输介质,可用于存储可以被计算设备访问的信息。
本申请所指设备包括但不限于用户设备、网络设备、或用户设备与网络设备通过网络相集成所构成的设备。所述用户设备包括但不限于任何一种可与用户进行人机交互(例如通过触摸板进行人机交互)的移动电子产品,例如智能手机、平板电脑等,所述移动电子产品可以采用任意操作***,如android操作***、iOS操作***等。其中,所述网络设备包括一种能够按照事先设定或存储的指令,自动进行数值计算和信息处理的电子设备,其硬件包括但不限于微处理器、专用集成电路(Application Specific Integrated Circuit,ASIC)、可编程逻辑器件(Programmable Logic Device,PLD)、现场可编程门阵列(Field Programmable Gate Array,FPGA)、数字信号处理器(Digital Signal Processor,DSP)、嵌入式设备等。所述网络设备包括但不限于计算机、网络主机、单个网络服务器、多个网络服务器集或多个服务器构成的云;在此,云由基于云计算(Cloud Computing)的大量计算机或网络服务器构成,其中,云计算是分布式计算的一种,由一群松散耦合的计算机集组成的一个虚拟超级计算机。所述网络包括但不限于互联网、广域网、城域网、局域网、VPN网络、无线自组织网络(Ad Hoc网络)等。优选地,所述设备还可以是运行于所述用户设备、网络设备、或用户设备与网络设备、网络设备、触摸终端或网络设备与触摸终端通过网络相集成所构成的设备上的程序。
当然,本领域技术人员应能理解上述设备仅为举例,其他现有的或今后可能出现的设备如可适用于本申请,也应包含在本申请保护范围以内,并在此以引用方式包含于此。
在本申请的描述中,“多个”的含义是两个或者更多,除非另有明确具体的限定。
图1示出了根据本申请一个实施例的一种用于生成二维码的方法,其中,该方法包括步骤S11、步骤S12和步骤S13。在步骤S11中,用户设备确定待生成的二维码中的多个定位点,其中,所述待生成的二维码包括定位区域;在步骤S12中,确定所述多个定位点中至少一个定位点所在定位区域中的信息点的多通道赋值,以及所述二维码中除所述定位区域外其它区域中的信息点的多通道赋值,其中,所述多通道赋值包括第一通道的赋值,所述其它区域中的信息点在所述第一通道的赋值满足第一距离相关性;在步骤S13中,用户设备根据所述二维码中的信息点的多通道赋值生成所述二维码。
具体地,在步骤S11中,用户设备确定待生成的二维码中的多个定位点,其中,所述待生成的二维码包括定位区域。例如,所述定位区域包括含有定位点的区域,如今主流二维码包含有三个定位点,用户设备确定本方案待生成的二维码中的三个定位点都为非可见的定位点,或者,用户设备确定本方案待生成的二维码中的三个定位点存在两个非可见的定位点。
在步骤S12中,用户设备确定所述多个定位点中至少一个定位点所在定位区域中的信息点的多通道赋值,以及所述二维码中除所述定位区域外其它区域中的信息点的多通道赋值,其中,所述多通道赋值包括第一通道的赋值,所述其它区域中的信息点在所述第一通道的赋值满足第一距离相关性。其中所述信息点包括像素点,所述定位区域包括定位点所在的像素区域,例如,用户设备选取二维码三个定位点中的其中一个定位点,在该定位点所在的定位区域设置关于该定位点的多通道赋值,其中,多通道赋值包括R、G、B三个通道的分量赋值,用户设备选取RGB三个通道任意通道为第一通道,此处若选取R通道为第一通道,随后需确定该定位点所在的像素点的R、G、B三个通道的分量分别的取值。用户设备确定在二维码中所述定位区域以外的其他区域的R、G、B三个通道的分量的取值,其中,在除所述定位区域以外的其他区域中像素点在 第一通道的分量取值满足第一距离相关性,所述第一距离相关性在此包括其他区域中像素点距离定位点的距离与该像素点在第一通道的分量取值呈现相关性。
在步骤S13中,用户设备根据所述二维码中的信息点的多通道赋值生成所述二维码。例如,用户设备确定了定位区域中定位点的多通道赋值,根据二维码中其他信息与定位点信息的关系生成所述二维码,其中,其他信息包括但不限于数据编码、纠错编码等二维码的内容信息。
例如,用户持有用户设备,先通过用户设备确定待生成的二维码中的三个定位点x、y、z。用户设备使用R、G、B颜色空间对像素点进行赋值。用户设备选取定位点x,并使用R为主通道,设定定位点x所在像素点的R通道分量为119、G通道分量为0、B通道分量为0,以定位点x为中心周围3*3距离的其他区域中其他像素点的G通道分量为119、B通道分量为119,R通道分量根据距离定位点x的距离逐步减少;用户设备选取定位点y,并使用R为主通道,设定定位点y所在像素点的R通道分量为119、G通道分量为0、B通道分量为0,以定位点y为中心周围3*3距离的其他区域中其他像素点的G通道分量为119、B通道分量为119,R通道分量根据距离定位点y的距离逐步减少;用户设备选取定位点z,并使用R为主通道,设定定位点z所在像素点的R通道分量为119、G通道分量为0、B通道分量为0,以定位点z为中心周围3*3距离的其他区域中其他像素点的G通道分量为119、B通道分量为119,R通道分量根据距离定位点z的距离逐步减少;用户设备基于二维码中的像素点上R、G、B通道的赋值确定生成对应的二维码。
在一些实施例中,所述定位区域中各信息点具有相同的多通道赋值,或者所述定位区域中任意两个信息点的多通道赋值的差值小于或等于第一赋值差值阈值。例如,所述定位区域中各信息点包括用户设备确定的二维码中的三个定位点,所述三个定位点位于所述定位区域,所述三个定位点所在的像素点上R、G、B三个通道的赋值分量一致,或者,对于用户设备确定的二维码中的三个定位点中的任意两个定位点,该任意两个定位点所在的像素点上R、G、B三个通道的各通道赋值分量的差值小于或等于第一赋值差值阈值信息,其中,所述第一赋值差值阈值接近于0。
例如,用户持有用户设备,先通过用户设备确定待生成的二维码中的三个定位点x、y、z。用户设备选取定位点x,并使用R为主通道,设定定位点x所在像素点的R通道分量为119、G通道分量为0、B通道分量为0;用户设备选取定位点y,并使用R为主通道,设定定位点y所在像素点的R通道分量为119、G通道分量为0、B通道分量为0;用户设备选取定位点z,并使用R为主通道,设定定位点z所在像素点的R通道分量为119、G通道分量为0、B通道分量为0;或者,用户设备选取定位点x,并使用R为主通道,设定定位点x所在像素点的R通道分量为119、G通道分量为0、B通道分量为0,如第一赋值差值阈值为0.1,根据第一赋值差值即点x的像素点的R、G、B通道分量,定位点y所在像素点的R通道分量范围为118.9~119.19、G通道分量范围为-0.1~0.1、B通道分量范围为-0.1~0.1,又R、G、B取值为0~255间的整数,所以定位点y所在像素点的R、G、B对应通道分量分别为119、0、0。
在一些实施例中,所述定位区域中的信息点在不同通道的赋值相同,或者所述定位区域中的信息点在所述第一通道的赋值与该信息点在除所述第一通道外的其它通道的赋值的差值小于或等于第二赋值差值阈值信息。例如,所述定位区域中各信息点包括用户设备确定的二维码中的三个定位点,所述三个定位点位于所述定位区域,所述三个定位点在R通道的赋值分量都为K、在G通道的赋值分量都为K1、在B通道的赋值分量都为K2,或者用户设备选取定位点x,并选取RGB任意通道为第一通道,在该第一通道的赋值与在其他通道的赋值的差值小于或等于第二赋值差值阈值信息,其中,所述第二赋值差值接近于该定位点在该第一通道的赋值。
例如,用户持有用户设备,先通过用户设备确定待生成的二维码中的三个定位点x、y、z。用户设备选取定位点x,并使用R为主通道,设定定位点x、y、z所在像素点的R通道分量为119,设定定位点x、y、z所在像素点的G通道分量为0,设定定位点x、y、z所在像素点的B通道分量为0;或者,用户设备选取定位点x,并使用R为主通道,如第二赋值差值阈值为119.1,定位点x所在像素点的R通道分量范围为118.9~119.19、G通道分量范围为-0.1~0.1、B通道分量范围为-0.1~0.1,又R、G、B取值为0~255间的整数,所以定位点x所在像素点的R、G、B对应通道分量分别为119、0、0。
在一些实施例中,所述第一距离相关性包括以下任一项:所述其它区域中的信息点在所述第一通道的赋值与该信息点和所述至少一个定位点间的距离信息负相关;所述其它区域中的信息点在所述第一通道的赋值与该信息点和所述至少一个定位点间的距离信息正相关。其中。信息点包括像素点,例如,用户设备确定二维码中的三个定位点,并选取RGB中的任意通道为第一通道,在定位点区域中设置第一通道的赋值分量,以定位点为中心区域周围m*m区域内任意像素点在第一通道的赋值分量与该像素点距离定位点的距离成反比,或者,用户设备确定二维码中的三个定位点,并选取RGB中的任意通道为第一通道,在定位点区域中设置第一通道的赋值分量,以定位点为中心区域周围m*m区域内任意像素点在第一通道的赋值分量与该像素点距离定位点的距离成正比。
例如,用户持有用户设备,先通过用户设备确定待生成的二维码中的三个定位点x、y、z。用户设备选取定位点x,并使用R为主通道,设定定位点x所在像素点的R通道分量为119,用户设备选取以定位点x为中心距离该点4*4的区域,对该区域中信息点设置R通道的分量与该信息点距离定位点的距离成反比,例如,若A信息点距离定位点x越远,A点的R通道分量越小。或者,用户设备选取定位点x,并使用R为主通道,设定定位点x所在像素点的R通道分量为119,用户设备选取以定位点x为中心距离该点4*4的区域,对该区域中信息点设置R通道的分量与该信息点距离定位点的距离成正比,例如,若A信息点距离定位点x越远,A点的R通道分量越大。
在一些实施例中,所述其它区域中的信息点在除所述第一通道外的其它通道的赋值为零,或者所述其它区域中的信息点在除所述第一通道外的其它通道的赋值小于或等于第三赋值阈值。例如,用户设备确定二维码中的三个定位点,并选取RGB中的任意通道为第一通道,在定位点区域中设置第一通道的赋值分量,以定位点为中心区域周围m*m区域内任意像素点在除第一通道外的其他通道的赋值分量为0,或者,用户设备确定二维码中的三个定位点,并选取RGB中的任意通道为第一通道,在定位点区域中设置第一通道的赋值分量,以定位点为中心区域周围m*m区域内任意像素点在除第一通道外的其他通道的赋值分量小于或等于第三赋值阈值信息,其中,所述第三赋值阈值接近0。
例如,用户持有用户设备,先通过用户设备确定待生成的二维码中的三个定位点x、y、z。用户设备选取定位点x,并使用R为主通道,设定定位点x所在像素点的R通道分量为119,用户设备选取以定位点x为中心距离该点4*4的区域,对该区域中信息点设置G、B通道的分量为0,或者,用户设备选取定位点x,并使用R为主通道,设定定位点x所在像素点的R通道分量为119,用户设备选取以定位点x为中心距离该点4*4的区域,对该区域中信息点设置G、B通道的分量接近于0,例如0.0001。
上述图1提供了一种用于生成二维码的方法,基于该方法先确定了二维码中的多个定位点,其中,该多个定位点选取了R、G、B三通道进行赋值,在各个通道赋值满足一定条件的情况下,生成二维码的多个不可见定位点,再利用定位点结合其他信息生成二维码,基于本方案生成的二维码形态灵活多样,对于二维码形式风格化的发展有极大的推动作用。
上述图1提供了一种用于生成二维码的方法,下面结合图2描述一种与之对应的用于识别二维码的方法。图2中,与图1相对应的内容可以参考图1中的详细介绍,后续不做赘述。
图2示出了根据本申请一个实施例的一种用于识别二维码的方法,其特征在于,所述方法包括步骤S21、步骤S22、步骤S23和步骤S24。在步骤S21中,用户设备从待识别的二维码中提取所述二维码对应的多个通道信息;在步骤S22中,用户设备利用所述二维码对应的卷积核对所述多个通道信息分别进行卷积处理,以获得对应的多个通道卷积信息,所述多个通道卷积信息包括第一通道卷积信息,其中,所述卷积核与所述二维码中的定位区域相适应;在步骤S23中,用户设备将所述第一通道的卷积信息中数值最大或最小的至少一个信息点确定为至少一个定位点,其中,所述第一通道的卷积信息在所述多个通道卷积信息中的累加和信息最大;在步骤S24中,用户设备根据所述至少一个定位点确定所述二维码中的识别区域,并对所述识别区域执行识别处理。
具体地,在步骤S21中,用户设备从待识别的二维码中提取所述二维码对应的多个通道信息。例如,所述识别操作包括但不限于扫描、拍摄等操作。用户设备拍摄或者扫描获取二维码所在的图片信息,并将该图片分解成R、G、B三个通道。例如,可以使用Opencv提取图像的三个通道。
在步骤S22中,用户设备利用所述二维码对应的卷积核对所述多个通道信息分别进行卷积处理,以获得对应的多个通道卷积信息,,所述多个通道卷积信息包括第一通道卷积信息,其中,所述卷积核与所述二维码中的定位区域相适应。例如,对应m*m区域大小的二维码,用户设备构建m*m的卷积核,该卷积核的中心值为1,距离卷积核中心越远数值越小。用户设备使用该m*m的卷积核对R、G、B三个通道进行卷积处理,获取卷积后的各个通道的累加数值。
在步骤S23中,用户设备将所述第一通道的卷积信息中数值最大或最小的至少一个信息点确定为至少一个定位点,其中,所述第一通道的卷积信息在所述多个通道卷积信息中的累加和信息最大。例如,所述卷积信息包括累加值信息,用户设备构建m*m的卷积核对R、G、B三个通道进行卷积处理,获取卷积后的各个通道的累加数值,确定累加数值最大的为第一通道,用户设备将第一通道的多个累加值信息中数值最大的一个或多个点作为定位点。
在步骤S24中,用户设备根据所述至少一个定位点确定所述二维码中的识别区域,并对所述识别区域执行识别处理。例如,用户设备扫描图片后确定所述二维码的一个或多个定位点,根据一个或多个定位点确定扫描区域,扫描二维码后获取二维码信息。
例如,用户持有用户设备进行扫描二维码的操作,首先通过拍照或者扫描方式获取带有二维码的图片,并采用Opencv split函数把图片分解成R、G、B三个通道,用户设备构建m*m卷积核,此处为了与二维码中的定位区域一致可采用3*3卷积核,该卷积核的中心值为1,其他值设定为0,对于R、G、B三个通道,用户设备采用该3*3卷积核分别进行卷积处理以获取R、G、B三个通道的累加值,例如,在该二维码中,中心处的R通道的赋值为119,G、B通道的赋值分别为0,除中心以外的其他像素点的R通道的赋值为0,G、B通道的赋值分别为任意值。用户设备采用3*3卷积核分别进行卷积处理获得R、G、B三个通道的值分别为119、0、0。依次在其他区域对R、G、B三个通道进行卷积,获取R、G、B三个通道的值为109、0、0,依次类推,在其他区域获取R、G、B三个通道的值为109、0、0,随后用户设备将在R、G、B三个通道获取的值进行累加,确定R通道的累加值最大,确定R为第一通道,并从R通道的 值中选取计算数值最大的三个的中心点作为二维码的定位点。
在一些实施例中,所述二维码中除所述定位区域外其它区域中的信息点在所述第一通道的赋值满足第一距离相关性;所述卷积核中的信息点的赋值满足第二距离相关性;所述第一距离相关性与所述第二距离相关性相适应。例如,所述信息点包括像素点,所述待扫描的二维码中,对于除定位区域外其它区域中的像素点的第一通道赋值和该像素点距离定位点的距离呈现第一距离相关性,例如,像素点距离定位点越远则该点的第一通道分量越小,对于用户设备构建的卷积核,该卷积核中的数值距离中心越远,赋值越小。
例如,用户持有用户设备,用户选取待扫描的具有二维码信息的图片,在该二维码信息中,设置定位区域中的第一通道分量的赋值为119,在除定位区域外的其他区域中,距离该定位区域越远的像素点,其在第一通道分量的取值越小,满足与距离成反比的特征,对于用户设备选取的进行卷积处理的卷积核,该卷积核的中心值为1,距离中心越远,取值越小,满足与距离成反比的特征。
在一些实施例中,所述第二距离相关性包括以下任一项:所述卷积核的中心点和所述卷积核中的信息点间的距离信息,与该信息点的赋值负相关;所述卷积核的中心点和所述卷积核中的信息点间的距离信息,与该信息点的赋值正相关正相关。例如,用户设备构建m*m卷积核,该卷积核中心值固定,设置该卷积除中心点处其他信息点的赋值与该信息点距离中心处的距离成反比,或者,用户设备构建m*m卷积核,该卷积核中心值固定,设置该卷积除中心点处其他信息点的赋值与该信息点距离中心处的距离成正比。
例如,用户持有用户设备进行扫描二维码的操作,首先通过拍照或者扫描方式获取带有二维码的图片,并采用Opencv split函数把图片分解成R、G、B三个通道,用户设备构建m*m卷积核,此处为了与二维码中的定位区域一致可采用3*3卷积核,该卷积核的中心值为1,在该卷积核的其他区域中,距离该中心越远,所在的信息点的赋值越小,或者用户持有用户设备进行扫描二维码的操作,首先通过拍照或者扫描方式获取带有二维码的图片,并采用Opencv split函数把图片分解成R、G、B三个通道,用户设备构建m*m卷积核,此处为了与二维码中的定位区域一致可采用3*3卷积核,该卷积核的中心值为1,在该卷积核的其他区域中,距离该中心越远,所在的信息点的赋值越大。
在一些实施例中,所述第二距离相关性包括所述卷积核的中心点和所述卷积核中的信息点间的距离信息,与该信息点的赋值负相关;步骤S23包括,将所述第一通道的卷积信息中数值最大的至少一个信息点确定为所述至少一个定位点,其中,所述第一通道的卷积信息在所述多个通道卷积信息中的累加和信息最大。例如,用户设备构建m*m卷积核,设定该卷积核中除中心点的赋值外,其他信息点的赋值与所述卷积核中心点间的距离信息成反比,所述卷积信息包括累加值信息,用户设备构建m*m的卷积核对R、G、B三个通道进行卷积处理,获取卷积后的各个通道的累加数值,确定累加数值最大的为第一通道,用户设备将第一通道的多个累加值信息中数值最大的一个或多个点作为定位点。
例如,用户持有用户设备进行扫描二维码的操作,首先通过拍照或者扫描方式获取带有二维码的图片,并采用Opencv split函数把图片分解成R、G、B三个通道,用户设备构建m*m卷积核,此处为了与二维码中的定位区域一致可采用3*3卷积核,该卷积核的中心值为1,其他值设定为0,对于R、G、B三个通道,用户设备采用该3*3卷积核分别进行卷积处理以获取R、G、B三个通道的累加值,例如,在该二维码中,中心处的R通道的赋值为119,G、B通道的赋值分别为0,除中心以外的其他像素点的R通道的赋值为0,G、B通道的赋值分别为任意值。用户设备采用3*3卷积核分别进行卷积处理获得R、G、B三个通道的值分别为119、0、0。依次在其他区域对R、G、B三个通道进行卷积,获取R、G、B三个通道的值为109、0、0,依次类推,在其他区域获取R、G、B三个通道的值为109、0、0,随后用户设备将在R、G、B三个通道获取的值进行累加,确定R通道的累加值最大,确定R为第一通道,并从R通道的值中选取计算数值最大的三个的中心点作为二维码的定位点。
在一些实施例中,所述第二距离相关性包括所述卷积核的中心点和所述卷积核中的信息点间的距离信息,与该信息点的赋值正相关;步骤S23包括,将所述第一通道的卷积信息中数值最小的至少一个信息点确定为所述至少一个定位点,其中,所述第一通道的卷积信息在所述多个通道卷积信息中的累加和信息最大。例如,用户设备构建m*m卷积核,设定该卷积核中除中心点的赋值外其他信息点的赋值与所述卷积核中心点间的距离信息成正比,所述卷积信息 包括累加值信息,用户设备构建m*m的卷积核对R、G、B三个通道进行卷积处理,获取卷积后的各个通道的累加数值,确定累加数值最大的为第一通道,用户设备将第一通道的多个累加值信息中数值最小的一个或多个点作为定位点。
例如,用户持有用户设备进行扫描二维码的操作,首先通过拍照或者扫描方式获取带有二维码的图片,并采用Opencv split函数把图片分解成R、G、B三个通道,用户设备构建m*m卷积核,此处为了与二维码中的定位区域一致可采用3*3卷积核,该卷积核的中心值为0,其他值设定为1,对于R、G、B三个通道,用户设备采用该3*3卷积核分别进行卷积处理以获取R、G、B三个通道的累加值,例如,在该二维码中,中心处的R通道的赋值为1,G、B通道的赋值分别为0,除中心以外的其他像素点的R通道的赋值为1,G、B通道的赋值分别为任意值。用户设备采用3*3卷积核分别进行卷积处理获得R、G、B三个通道的值分别为8、0、0。依次在其他区域对R、G、B三个通道进行卷积,获取R、G、B三个通道的值为9、0、0,依次类推,在其他区域获取R、G、B三个通道的值为10、0、0,随后用户设备将在R、G、B三个通道获取的值进行累加,确定R通道的累加值最大,确定R为第一通道,并从R通道的值中选取计算数值最小的三个的中心点作为二维码的定位点。
上述图2提供了一种用于识别二维码的方法,基于该方法先识别出二维码中的R、G、B三通道的赋值,并利用对应的卷积核对三通道分别进行卷积获取卷积信息,然后根据卷积信息确定定位点,对于不可见的二维码信息中的定位点精准识别,并成功读取二维码信息。上文主要描述了本申请提供的用于生成二维码的方法及用于识别二维码的方法,除此之外,本申请还提供用于生成定位点的方法和用于识别定位点的方法,下面结合图3和图4分别介绍。其中,图3和图4中,与图1或图2所示方法相类似的内容可以参考图1或图2中的详细介绍,后续不做赘述。
图3示出了根据本申请一个实施例的一种用于生成定位点的方法,其特征在于,所述方法包括步骤S31和步骤S32。在步骤S31中,用户设备确定待生成的图形码中的多个定位点,其中,所述图形码中包括定位区域;在步骤S32中,用户设备确定所述多个定位点中至少一个定位点所在定位区域中的信息点 的多通道赋值,以及所述图形码中除所述定位区域外其它区域中的信息点的多通道赋值,其中,所述多通道赋值包括第一通道的赋值,所述其它区域中的信息点在所述第一通道的赋值满足第一距离相关性。
具体地,在步骤S31中,用户设备确定待生成的图形码中的多个定位点,其中,所述图形码中包括定位区域。例如,用户设备确定待生成的图形码中的三个定位点都为非可见的定位点,或者,用户设备确定本方案待生成的图形码中的三个定位点存在两个非可见的定位点。
在步骤S32中,用户设备确定所述多个定位点中至少一个定位点所在定位区域中的信息点的多通道赋值,以及所述图形码中除所述定位区域外其它区域中的信息点的多通道赋值,其中,所述多通道赋值包括第一通道的赋值,所述其它区域中的信息点在所述第一通道的赋值满足第一距离相关性。例如,用户设备选取图形码的三个定位点中的其中一个定位点,在该定位点所在的定位区域设置关于该定位点的多通道赋值,其中,多通道赋值包括RGB三个通道的分量赋值,用户设备选取RGB三个通道任意通道为第一通道,此处若选取R通道为第一通道,随后需确定该定位点所在的像素点的R、G、B三个通道的分量分别的取值。用户设备确定在所述码中所述定位区域以外的其他区域的R、G、B三个通道的分量的取值,其中,在除所述定位区域以外的其他区域中像素点在第一通道的分量取值满足第一距离相关性,所述第一距离相关性在此包括其他区域中像素点距离定位点的距离与该像素点在第一通道的分量取值呈现相关性。
例如,用户持有用户设备,先通过用户设备确定待生成的图形码中的三个定位点x、y、z。用户设备使用R、G、B颜色空间对像素点进行赋值。用户设备选取定位点x,并使用R为主通道,设定定位点x所在像素点的R通道分量为119、G通道分量为0、B通道分量为0,以定位点x为中心周围3*3距离的其他区域中其他像素点的G通道分量为119、B通道分量为119,R通道分量根据距离定位点x的距离逐步减少;用户设备选取定位点y,并使用R为主通道,设定定位点y所在像素点的R通道分量为119、G通道分量为0、B通道分量为0,以定位点y为中心周围3*3距离的其他区域中其他像素点的G通道分量为119、B通道分量为119,R通道分量根据距离定位点y的距离逐步减 少;用户设备选取定位点z,并使用R为主通道,设定定位点z所在像素点的R通道分量为119、G通道分量为0、B通道分量为0,以定位点z为中心周围3*3距离的其他区域中其他像素点的G通道分量为119、B通道分量为119,R通道分量根据距离定位点z的距离逐步减少。
上述图3提供了一种用于生成定位点的方法,基于该方法先确定了图形码中的多个定位点,其中,该多个定位点选取了R、G、B三通道进行赋值,在各个通道赋值满足一定条件的情况下,生成图形码的多个不可见定位点,基于本方案生成的定位点形式灵活多样,并且不局限于肉眼可见的定位点。
上述图3提供了一种用于生成定位点的方法,下面结合图4描述一种与之对应的用于识别定位点的方法。图4中,与图3相对应的内容可以参考图3中的详细介绍,后续不做赘述。
图4示出了根据本申请一个实施例的一种用于识别定位点的方法,其特征在于,所述方法包括步骤S41、步骤S42、步骤S43和步骤S44。在步骤S41中,用户设备从待识别的图形码中提取所述图形码对应的多个通道信息;在步骤S42中,用户设备利用所述图形码对应的卷积核对所述多个通道信息分别进行卷积处理,以获得对应的多个通道卷积信息,所述多个通道卷积信息包括第一通道卷积信息,其中,所述卷积核与所述图形码中定位区域相适应;在步骤S43中,用户设备将所述第一通道的卷积信息中数值最大或最小的至少一个信息点确定为至少一个定位点,其中,所述第一通道的卷积信息在所述多个通道卷积信息中的累加和信息最大;在步骤S44中,用户设备根据所述至少一个定位点确定所述图形码中的识别区域,并对所述识别区域执行识别处理。
在步骤S41中,用户设备从待识别的图形码中提取所述图形码对应的多个通道信息。例如,用户设备拍摄或者扫描获取图形码所在的图片信息,并将该图片分解成R、G、B三个通道。例如,可以使用Opencv提取图像的三个通道。
在步骤S42中,用户设备利用所述图形码对应的卷积核对所述多个通道信息分别进行卷积处理,以获得对应的多个通道卷积信息,所述多个通道卷积信息包括第一通道卷积信息,其中,所述卷积核与所述图形码中定位区域相适应。例如,对应m*m区域大小的码,用户设备构建m*m的卷积核,该卷积核的中心值为1,距离卷积核中心越远数值越小。用户设备使用该m*m的卷积核对R、 G、B三个通道进行卷积处理,获取卷积后的各个通道的累加数值。
在步骤S43中,用户设备将所述第一通道的卷积信息中数值最大或最小的至少一个信息点确定为至少一个定位点,其中,所述第一通道的卷积信息在所述多个通道卷积信息中的累加和信息最大。例如,所述卷积信息包括累加值信息,用户设备构建m*m的卷积核对R、G、B三个通道进行卷积处理,获取卷积后的各个通道的累加数值,确定累加数值最大的为第一通道,用户设备将第一通道的多个累加值信息中数值最大的一个或多个点作为定位点。
在步骤S44中,用户设备根据所述至少一个定位点确定所述图形码中的识别区域,并对所述识别区域执行识别处理。例如,用户设备扫描图片后确定所述码的一个或多个定位点,根据一个或多个定位点确定扫描区域,扫描码后获取码信息。
例如,用户持有用户设备进行扫描码的操作,首先通过拍照或者扫描方式获取带***的图片,并采用Opencv split函数把图片分解成R、G、B三个通道,用户设备构建m*m卷积核,此处为了与码中的定位区域一致可采用3*3卷积核,该卷积核的中心值为1,其他值设定为0,对于R、G、B三个通道,用户设备采用该3*3卷积核分别进行卷积处理以获取R、G、B三个通道的累加值,例如,在该码中,中心处的R通道的赋值为119,G、B通道的赋值分别为0,除中心以外的其他像素点的R通道的赋值为0,G、B通道的赋值分别为任意值。用户设备采用3*3卷积核分别进行卷积处理获得R、G、B三个通道的值分别为119、0、0。依次在其他区域对R、G、B三个通道进行卷积,获取R、G、B三个通道的值为109、0、0,依次类推,在其他区域获取R、G、B三个通道的值为109、0、0,随后用户设备将在R、G、B三个通道获取的值进行累加,确定R通道的累加值最大,确定R为第一通道,并从R通道的值中选取计算数值最大的三个的中心点作为码的定位点。
上述图4提供了一种用于识别定位点的方法,基于该方法先识别出图形码中的R、G、B三通道的赋值,并利用对应的卷积核对三通道分别进行卷积获取卷积信息,然后根据卷积信息确定定位点,对于不可见的图形码信息中的定位点精准识别,为后续读取图形码信息提供基础。
上文主要对本申请提供的方法进行了介绍,下面结合图5至图8分别对本 申请提供的设备进行介绍。
图5示出了根据本申请一个实施例的一种用于生成二维码的用户设备,该用户设备包括能够执行图1所示方法中各个步骤大单元或模块,这些单元或模块可以通过硬件、软件或软硬结合的方式来实现,本申请并不限定。其中,图5中,与图1所示方法对应的内容,可以参考图1中的详细介绍。具体地,所述设备包括第一确定模块11、第一根据模块12和生成模块13。第一确定模块11,用于确定待生成的二维码中的多个定位点,其中,所述待生成的二维码包括定位区域;第一根据模块12,用于确定所述多个定位点中至少一个定位点所在定位区域中的信息点的多通道赋值,以及所述二维码中除所述定位区域外其它区域中的信息点的多通道赋值,其中,所述多通道赋值包括第一通道的赋值,所述其它区域中的信息点在所述第一通道的赋值满足第一距离相关性;生成模块13,用于根据所述二维码中的信息点的多通道赋值生成所述二维码。
具体地,第一确定模块11,用于确定待生成的二维码中的多个定位点,其中,所述待生成的二维码包括定位区域。例如,所述定位区域包括含有定位点的区域,如今主流二维码包含有三个定位点,用户设备确定本方案待生成的二维码中的三个定位点都为非可见的定位点,或者,用户设备确定本方案待生成的二维码中的三个定位点存在两个非可见的定位点。
第一根据模块12,用于确定所述多个定位点中至少一个定位点所在定位区域中的信息点的多通道赋值,以及所述二维码中除所述定位区域外其它区域中的信息点的多通道赋值,其中,所述多通道赋值包括第一通道的赋值,所述其它区域中的信息点在所述第一通道的赋值满足第一距离相关性。其中所述信息点包括像素点,所述定位区域包括定位点所在的像素区域,例如,用户设备选取二维码三个定位点中的其中一个定位点,在该定位点所在的定位区域设置关于该定位点的多通道赋值,其中,多通道赋值包括R、G、B三个通道的分量赋值,用户设备选取R、G、B三个通道任意通道为第一通道,此处若选取R通道为第一通道,随后需确定该定位点所在的像素点的R、G、B三个通道的分量分别的取值。用户设备确定在二维码中所述定位区域以外的其他区域的R、G、B三个通道的分量的取值,其中,在除所述定位区域以外的其他区域中像素点在第一通道的分量取值满足第一距离相关性,所述第一距离相关性在此包括其 他区域中像素点距离定位点的距离与该像素点在第一通道的分量取值呈现相关性。
生成模块13,用于根据所述二维码中的信息点的多通道赋值生成所述二维码。例如,用户设备确定了定位区域中定位点的多通道赋值,根据二维码中其他信息与定位点信息的关系生成所述二维码,其中,其他信息包括但不限于数据编码、纠错编码等二维码的内容信息。
例如,用户持有用户设备,先通过用户设备确定待生成的二维码中的三个定位点x、y、z。用户设备使用R、G、B颜色空间对像素点进行赋值。用户设备选取定位点x,并使用R为主通道,设定定位点x所在像素点的R通道分量为119、G通道分量为0、B通道分量为0,以定位点x为中心周围3*3距离的其他区域中其他像素点的G通道分量为119、B通道分量为119,R通道分量根据距离定位点x的距离逐步减少;用户设备选取定位点y,并使用R为主通道,设定定位点y所在像素点的R通道分量为119、G通道分量为0、B通道分量为0,以定位点y为中心周围3*3距离的其他区域中其他像素点的G通道分量为119、B通道分量为119,R通道分量根据距离定位点y的距离逐步减少;用户设备选取定位点z,并使用R为主通道,设定定位点z所在像素点的R通道分量为119、G通道分量为0、B通道分量为0,以定位点z为中心周围3*3距离的其他区域中其他像素点的G通道分量为119、B通道分量为119,R通道分量根据距离定位点z的距离逐步减少;用户设备基于二维码中的像素点上R、G、B通道的赋值确定生成对应的二维码。
在一些实施例中,所述定位区域中各信息点具有相同的多通道赋值,或者所述定位区域中任意两个信息点的多通道赋值的差值小于或等于第一赋值差值阈值。例如,所述定位区域中各信息点包括用户设备确定的二维码中的三个定位点,所述三个定位点位于所述定位区域,所述三个定位点所在的像素点上R、G、B三个通道的赋值分量一致,或者,对于用户设备确定的二维码中的三个定位点中的任意两个定位点,该任意两个定位点所在的像素点上R、G、B三个通道的各通道赋值分量的差值小于或等于第一赋值差值阈值信息,其中,所述第一赋值差值阈值接近于0。
例如,用户持有用户设备,先通过用户设备确定待生成的二维码中的三个 定位点x、y、z。用户设备选取定位点x,并使用R为主通道,设定定位点x所在像素点的R通道分量为119、G通道分量为0、B通道分量为0;用户设备选取定位点y,并使用R为主通道,设定定位点y所在像素点的R通道分量为119、G通道分量为0、B通道分量为0;用户设备选取定位点z,并使用R为主通道,设定定位点z所在像素点的R通道分量为119、G通道分量为0、B通道分量为0;或者,用户设备选取定位点x,并使用R为主通道,设定定位点x所在像素点的R通道分量为119、G通道分量为0、B通道分量为0,如第一赋值差值阈值为0.1,根据第一赋值差值即点x的像素点的R、G、B通道分量,定位点y所在像素点的R通道分量范围为118.9~119.19、G通道分量范围为-0.1~0.1、B通道分量范围为-0.1~0.1,又R、G、B取值为0~255间的整数,所以定位点y所在像素点的R、G、B对应通道分量分别为119、0、0。
在一些实施例中,所述定位区域中的信息点在不同通道的赋值相同,或者所述定位区域中的信息点在所述第一通道的赋值与该信息点在除所述第一通道外的其它通道的赋值的差值小于或等于第二赋值差值阈值信息。例如,所述定位区域中各信息点包括用户设备确定的二维码中的三个定位点,所述三个定位点位于所述定位区域,所述三个定位点在R通道的赋值分量都为K、在G通道的赋值分量都为K1、在B通道的赋值分量都为K2,或者用户设备选取定位点x,并选取RGB任意通道为第一通道,在该第一通道的赋值与在其他通道的赋值的差值小于或等于第二赋值差值阈值信息,其中,所述第二赋值差值接近于该定位点在该第一通道的赋值。
例如,用户持有用户设备,先通过用户设备确定待生成的二维码中的三个定位点x、y、z。用户设备选取定位点x,并使用R为主通道,设定定位点x、y、z所在像素点的R通道分量为119,设定定位点x、y、z所在像素点的G通道分量为0,设定定位点x、y、z所在像素点的B通道分量为0;或者,用户设备选取定位点x,并使用R为主通道,如第二赋值差值阈值为119.1,定位点x所在像素点的R通道分量范围为118.9~119.19、G通道分量范围为-0.1~0.1、B通道分量范围为-0.1~0.1,又R、G、B取值为0~255间的整数,所以定位点x所在像素点的R、G、B对应通道分量分别为119、0、0。
在一些实施例中,所述第一距离相关性包括以下任一项:所述其它区域中 的信息点在所述第一通道的赋值与该信息点和所述至少一个定位点间的距离信息负相关;所述其它区域中的信息点在所述第一通道的赋值与该信息点和所述至少一个定位点间的距离信息正相关。其中。信息点包括像素点,例如,用户设备确定二维码中的三个定位点,并选取RGB中的任意通道为第一通道,在定位点区域中设置第一通道的赋值分量,以定位点为中心区域周围m*m区域内任意像素点在第一通道的赋值分量与该像素点距离定位点的距离成反比,或者,用户设备确定二维码中的三个定位点,并选取RGB中的任意通道为第一通道,在定位点区域中设置第一通道的赋值分量,以定位点为中心区域周围m*m区域内任意像素点在第一通道的赋值分量与该像素点距离定位点的距离成正比。
例如,用户持有用户设备,先通过用户设备确定待生成的二维码中的三个定位点x、y、z。用户设备选取定位点x,并使用R为主通道,设定定位点x所在像素点的R通道分量为119,用户设备选取以定位点x为中心距离该点4*4的区域,对该区域中信息点设置R通道的分量与该信息点距离定位点的距离成反比,例如,若A信息点距离定位点x越远,A点的R通道分量越小。或者,用户设备选取定位点x,并使用R为主通道,设定定位点x所在像素点的R通道分量为119,用户设备选取以定位点x为中心距离该点4*4的区域,对该区域中信息点设置R通道的分量与该信息点距离定位点的距离成正比,例如,若A信息点距离定位点x越远,A点的R通道分量越大。
在一些实施例中,所述其它区域中的信息点在除所述第一通道外的其它通道的赋值为零,或者所述其它区域中的信息点在除所述第一通道外的其它通道的赋值小于或等于第三赋值阈值。例如,用户设备确定二维码中的三个定位点,并选取RGB中的任意通道为第一通道,在定位点区域中设置第一通道的赋值分量,以定位点为中心区域周围m*m区域内任意像素点在除第一通道外的其他通道的赋值分量为0,或者,用户设备确定二维码中的三个定位点,并选取RGB中的任意通道为第一通道,在定位点区域中设置第一通道的赋值分量,以定位点为中心区域周围m*m区域内任意像素点在除第一通道外的其他通道的赋值分量小于或等于第三赋值阈值信息,其中,所述第三赋值阈值接近0。
例如,用户持有用户设备,先通过用户设备确定待生成的二维码中的三个 定位点x、y、z。用户设备选取定位点x,并使用R为主通道,设定定位点x所在像素点的R通道分量为119,用户设备选取以定位点x为中心距离该点4*4的区域,对该区域中信息点设置G、B通道的分量为0,或者,用户设备选取定位点x,并使用R为主通道,设定定位点x所在像素点的R通道分量为119,用户设备选取以定位点x为中心距离该点4*4的区域,对该区域中信息点设置G、B通道的分量接近于0,例如0.0001。
图6示出了根据本申请一个实施例的一种用于识别二维码的用户设备,该用户设备包括能够执行图2所示方法中各个步骤大单元或模块,这些单元或模块可以通过硬件、软件或软硬结合的方式来实现,本申请并不限定。其中,图6中,与图2所示方法对应的内容,可以参考图2中的详细介绍。具体地,所述设备包括第一提取模块21、第一获得模块22、第一累加模块23和第一识别模块24。第一提取模块21,用于从待识别的二维码中提取所述二维码对应的多个通道信息;第一获得模块22,用于利用所述二维码对应的卷积核对所述多个通道信息分别进行卷积处理,以获得对应的多个通道卷积信息,所述多个通道卷积信息包括第一通道卷积信息,其中,所述卷积核与所述二维码中的定位区域相适应;第一累加模块23,用于将所述第一通道的卷积信息中数值最大或最小的至少一个信息点确定为至少一个定位点,其中,所述第一通道的卷积信息在所述多个通道卷积信息中的累加和信息最大;第一识别模块24,用于根据所述至少一个定位点确定所述二维码中的识别区域,并对所述识别区域执行识别处理。
具体地,第一提取模块21,用于从待识别的二维码中提取所述二维码对应的多个通道信息。例如,所述识别操作包括但不限于扫描、拍摄等操作。用户设备拍摄或者扫描获取二维码所在的图片信息,并将该图片分解成R、G、B三个通道。例如,可以使用Opencv提取图像的三个通道。
第一获得模块22,用于利用所述二维码对应的卷积核对所述多个通道信息分别进行卷积处理,以获得对应的多个通道卷积信息,,所述多个通道卷积信息包括第一通道卷积信息,其中,所述卷积核与所述二维码中的定位区域相适应。例如,对应m*m区域大小的二维码,用户设备构建m*m的卷积核,该卷积核的中心值为1,距离卷积核中心越远数值越小。用户设备使用该m*m的卷 积核对R、G、B三个通道进行卷积处理,获取卷积后的各个通道的累加数值。
第一累加模块23,用于将所述第一通道的卷积信息中数值最大或最小的至少一个信息点确定为至少一个定位点,其中,所述第一通道的卷积信息在所述多个通道卷积信息中的累加和信息最大。例如,所述卷积信息包括累加值信息,用户设备构建m*m的卷积核对R、G、B三个通道进行卷积处理,获取卷积后的各个通道的累加数值,确定累加数值最大的为第一通道,用户设备将第一通道的多个累加值信息中数值最大的一个或多个点作为定位点。
第一识别模块24,用于根据所述至少一个定位点确定所述二维码中的识别区域,并对所述识别区域执行识别处理。例如,用户设备扫描图片后确定所述二维码的一个或多个定位点,根据一个或多个定位点确定扫描区域,扫描二维码后获取二维码信息。
例如,用户持有用户设备进行扫描二维码的操作,首先通过拍照或者扫描方式获取带有二维码的图片,并采用Opencv split函数把图片分解成R、G、B三个通道,用户设备构建m*m卷积核,此处为了与二维码中的定位区域一致可采用3*3卷积核,该卷积核的中心值为1,其他值设定为0,对于R、G、B三个通道,用户设备采用该3*3卷积核分别进行卷积处理以获取R、G、B三个通道的累加值,例如,在该二维码中,中心处的R通道的赋值为119,G、B通道的赋值分别为0,除中心以外的其他像素点的R通道的赋值为0,G、B通道的赋值分别为任意值。用户设备采用3*3卷积核分别进行卷积处理获得R、G、B三个通道的值分别为119、0、0。依次在其他区域对R、G、B三个通道进行卷积,获取R、G、B三个通道的值为109、0、0,依次类推,在其他区域获取R、G、B三个通道的值为109、0、0,随后用户设备将在R、G、B三个通道获取的值进行累加,确定R通道的累加值最大,确定R为第一通道,并从R通道的值中选取计算数值最大的三个的中心点作为二维码的定位点。
在一些实施例中,所述二维码中除所述定位区域外其它区域中的信息点在第一通道的赋值满足第一距离相关性;所述卷积核中的信息点的赋值满足第二距离相关性;所述第一距离相关性与所述第二距离相关性相适应。例如,所述信息点包括像素点,所述待扫描的二维码中,对于除定位区域外其它区域中的像素点的第一通道赋值和该像素点距离定位点的距离呈现第一距离相关性,例 如,像素点距离定位点越远则该点的第一通道分量越小,对于用户设备构建的卷积核,该卷积核中的数值距离中心越远,赋值越小。
例如,用户持有用户设备,用户选取待扫描的具有二维码信息的图片,在该二维码信息中,设置定位区域中的第一通道分量的赋值为119,在除定位区域外的其他区域中,距离该定位区域越远的像素点,其在第一通道分量的取值越小,满足与距离成反比的特征,对于用户设备选取的进行卷积处理的卷积核,该卷积核的中心值为1,距离中心越远,取值越小,满足与距离成反比的特征。
在一些实施例中,所述第二距离相关性包括以下任一项:所述卷积核的中心点和所述卷积核中的信息点间的距离信息,与该信息点的赋值负相关;所述卷积核的中心点和所述卷积核中的信息点间的距离信息,与该信息点的赋值正相关。例如,用户设备构建m*m卷积核,该卷积核中心值固定,设置该卷积除中心点处其他信息点的赋值与该信息点距离中心处的距离成反比,或者,用户设备构建m*m卷积核,该卷积核中心值固定,设置该卷积除中心点处其他信息点的赋值与该信息点距离中心处的距离成正比。
例如,用户持有用户设备进行扫描二维码的操作,首先通过拍照或者扫描方式获取带有二维码的图片,并采用Opencv split函数把图片分解成R、G、B三个通道,用户设备构建m*m卷积核,此处为了与二维码中的定位区域一致可采用3*3卷积核,该卷积核的中心值为1,在该卷积核的其他区域中,距离该中心越远,所在的信息点的赋值越小,或者用户持有用户设备进行扫描二维码的操作,首先通过拍照或者扫描方式获取带有二维码的图片,并采用Opencv split函数把图片分解成R、G、B三个通道,用户设备构建m*m卷积核,此处为了与二维码中的定位区域一致可采用3*3卷积核,该卷积核的中心值为1,在该卷积核的其他区域中,距离该中心越远,所在的信息点的赋值越大。
在一些实施例中,所述第二距离相关性包括所述卷积核的中心点和所述卷积核中的信息点间的距离信息,与该信息点的赋值负相关;第一累加模块23,用于将所述第一通道的卷积信息中数值最大的至少一个信息点确定为所述至少一个定位点,其中,所述第一通道的卷积信息在所述多个通道卷积信息中的累加和信息最大。例如,用户设备构建m*m卷积核,设定该卷积核中除中心点的赋值外其他信息点的赋值与所述卷积核中心点间的距离信息成反比,所述卷 积信息包括累加值信息,用户设备构建m*m的卷积核对R、G、B三个通道进行卷积处理,获取卷积后的各个通道的累加数值,确定累加数值最大的为第一通道,用户设备将第一通道的多个累加值信息中数值最大的一个或多个点作为定位点。
例如,用户持有用户设备进行扫描二维码的操作,首先通过拍照或者扫描方式获取带有二维码的图片,并采用Opencv split函数把图片分解成R、G、B三个通道,用户设备构建m*m卷积核,此处为了与二维码中的定位区域一致可采用3*3卷积核,该卷积核的中心值为1,其他值设定为0,对于R、G、B三个通道,用户设备采用该3*3卷积核分别进行卷积处理以获取R、G、B三个通道的累加值,例如,在该二维码中,中心处的R通道的赋值为119,G、B通道的赋值分别为0,除中心以外的其他像素点的R通道的赋值为0,G、B通道的赋值分别为任意值。用户设备采用3*3卷积核分别进行卷积处理获得R、G、B三个通道的值分别为119、0、0。依次在其他区域对R、G、B三个通道进行卷积,获取R、G、B三个通道的值为109、0、0,依次类推,在其他区域获取R、G、B三个通道的值为109、0、0,随后用户设备将在R、G、B三个通道获取的值进行累加,确定R通道的累加值最大,确定R为第一通道,并从R通道的值中选取计算数值最大的三个的中心点作为二维码的定位点。
在一些实施例中,所述第二距离相关性包括所述卷积核的中心点和所述卷积核中的信息点间的距离信息,与该信息点的赋值正相关;第一累加模块23,用于将所述第一通道的卷积信息中数值最小的至少一个信息点确定为所述至少一个定位点,其中,所述第一通道的卷积信息在所述多个通道卷积信息中的累加和信息最大。例如,用户设备构建m*m卷积核,设定该卷积核中除中心点的赋值外其他信息点的赋值与所述卷积核中心点间的距离信息成正比,所述卷积信息包括累加值信息,用户设备构建m*m的卷积核对R、G、B三个通道进行卷积处理,获取卷积后的各个通道的累加数值,确定累加数值最大的为第一通道,用户设备将第一通道的多个累加值信息中数值最小的一个或多个点作为定位点。
例如,用户持有用户设备进行扫描二维码的操作,首先通过拍照或者扫描方式获取带有二维码的图片,并采用Opencv split函数把图片分解成R、G、B 三个通道,用户设备构建m*m卷积核,此处为了与二维码中的定位区域一致可采用3*3卷积核,该卷积核的中心值为0,其他值设定为1,对于R、G、B三个通道,用户设备采用该3*3卷积核分别进行卷积处理以获取R、G、B三个通道的累加值,例如,在该二维码中,中心处的R通道的赋值为1,G、B通道的赋值分别为0,除中心以外的其他像素点的R通道的赋值为1,G、B通道的赋值分别为任意值。用户设备采用3*3卷积核分别进行卷积处理获得R、G、B三个通道的值分别为8、0、0。依次在其他区域对R、G、B三个通道进行卷积,获取R、G、B三个通道的值为9、0、0,依次类推,在其他区域获取R、G、B三个通道的值为10、0、0,随后用户设备将在R、G、B三个通道获取的值进行累加,确定R通道的累加值最大,确定R为第一通道,并从R通道的值中选取计算数值最小的三个的中心点作为二维码的定位点。
图7示出了根据本申请一个实施例的一种用于生成定位点的用户设备该用户设备包括能够执行图3所示方法中各个步骤大单元或模块,这些单元或模块可以通过硬件、软件或软硬结合的方式来实现,本申请并不限定。其中,图7中,与图3所示方法对应的内容,可以参考图3中的详细介绍。具体地,所述设备包括第二确定模块31和第二根据模块32。第二确定模块31,用于确定待生成的图形码中的多个定位点,其中,所述图形码中包括定位区域;第二根据模块32,用于确定所述多个定位点中至少一个定位点所在定位区域中的信息点的多通道赋值,以及所述图形码中除所述定位区域外其它区域中的信息点的多通道赋值,其中,所述多通道赋值包括第一通道的赋值,所述其它区域中的信息点在所述第一通道的赋值满足第一距离相关性。
具体地,第二确定模块31,用于确定待生成的图形码中的多个定位点,其中,所述图形码中包括定位区域。例如,用户设备确定待生成的图形码中的三个定位点都为非可见的定位点,或者,用户设备确定本方案待生成的图形码中的三个定位点存在两个非可见的定位点。
第二根据模块32,用于确定所述多个定位点中至少一个定位点所在定位区域中的信息点的多通道赋值,以及所述图形码中除所述定位区域外其它区域中的信息点的多通道赋值,其中,所述多通道赋值包括第一通道的赋值,所述其它区域中的信息点在所述第一通道的赋值满足第一距离相关性。例如,用户设 备选取图形码的三个定位点中的其中一个定位点,在该定位点所在的定位区域设置关于该定位点的多通道赋值,其中,多通道赋值包括RGB三个通道的分量赋值,用户设备选取RGB三个通道任意通道为第一通道,此处若选取R通道为第一通道,随后需确定该定位点所在的像素点的R、G、B三个通道的分量分别的取值。用户设备确定在所述码中所述定位区域以外的其他区域的R、G、B三个通道的分量的取值,其中,在除所述定位区域以外的其他区域中像素点在第一通道的分量取值满足第一距离相关性,所述第一距离相关性在此包括其他区域中像素点距离定位点的距离与该像素点在第一通道的分量取值呈现相关性。
例如,用户持有用户设备,先通过用户设备确定待生成的图形码中的三个定位点x、y、z。用户设备使用R、G、B颜色空间对像素点进行赋值。用户设备选取定位点x,并使用R为主通道,设定定位点x所在像素点的R通道分量为119、G通道分量为0、B通道分量为0,以定位点x为中心周围3*3距离的其他区域中其他像素点的G通道分量为119、B通道分量为119,R通道分量根据距离定位点x的距离逐步减少;用户设备选取定位点y,并使用R为主通道,设定定位点y所在像素点的R通道分量为119、G通道分量为0、B通道分量为0,以定位点y为中心周围3*3距离的其他区域中其他像素点的G通道分量为119、B通道分量为119,R通道分量根据距离定位点y的距离逐步减少;用户设备选取定位点z,并使用R为主通道,设定定位点z所在像素点的R通道分量为119、G通道分量为0、B通道分量为0,以定位点z为中心周围3*3距离的其他区域中其他像素点的G通道分量为119、B通道分量为119,R通道分量根据距离定位点z的距离逐步减少。
图8示出了根据本申请一个实施例的一种用于识别定位点的用户设备,该用户设备包括能够执行图4所示方法中各个步骤大单元或模块,这些单元或模块可以通过硬件、软件或软硬结合的方式来实现,本申请并不限定。其中,图8中,与图4所示方法对应的内容,可以参考图4中的详细介绍。具体地,所述设备包括第二提取模块41、第二获得模块42、第二累加模块43和第二识别模块44。第二提取模块41,用于从待识别的图形码中提取所述图形码对应的多个通道信息;第二获得模块42,用于利用所述图形码对应的卷积核对所述多个 通道信息分别进行卷积处理,以获得对应的多个通道卷积信息,所述多个通道卷积信息包括第一通道卷积信息,其中,所述卷积核与所述图形码中定位区域相适应;第二累加模块43,用于将所述第一通道的卷积信息中数值最大或最小的至少一个信息点确定为至少一个定位点,其中,所述第一通道的卷积信息在所述多个通道卷积信息中的累加和信息最大;第二识别模块44,用于根据所述至少一个定位点确定所述图形码中的识别区域,并对所述识别区域执行识别处理。
第二提取模块41,用于从待识别的图形码中提取所述图形码对应的多个通道信息。例如,用户设备拍摄或者扫描获取图形码所在的图片信息,并将该图片分解成R、G、B三个通道。例如,可以使用Opencv提取图像的三个通道。
第二获得模块42,用于利用所述图形码对应的卷积核对所述多个通道信息分别进行卷积处理,以获得对应的多个通道卷积信息,所述多个通道卷积信息包括第一通道卷积信息,其中,所述卷积核与所述图形码中定位区域相适应。例如,对应m*m区域大小的码,用户设备构建m*m的卷积核,该卷积核的中心值为1,距离卷积核中心越远数值越小。用户设备使用该m*m的卷积核对R、G、B三个通道进行卷积处理,获取卷积后的各个通道的累加数值。
第二累加模块43,用于将所述第一通道的卷积信息中数值最大或最小的至少一个信息点确定为至少一个定位点,其中,所述第一通道的卷积信息在所述多个通道卷积信息中的累加和信息最大。例如,所述卷积信息包括累加值信息,用户设备构建m*m的卷积核对R、G、B三个通道进行卷积处理,获取卷积后的各个通道的累加数值,确定累加数值最大的为第一通道,用户设备将第一通道的多个累加值信息中数值最大的一个或多个点作为定位点。
第二识别模块44,用于根据所述至少一个定位点确定所述图形码中的识别区域,并对所述识别区域执行识别处理。例如,用户设备扫描图片后确定所述码的一个或多个定位点,根据一个或多个定位点确定扫描区域,扫描码后获取码信息。
例如,用户持有用户设备进行扫描码的操作,首先通过拍照或者扫描方式获取带***的图片,并采用Opencv split函数把图片分解成R、G、B三个通道,用户设备构建m*m卷积核,此处为了与码中的定位区域一致可采用3*3卷积 核,该卷积核的中心值为1,其他值设定为0,对于R、G、B三个通道,用户设备采用该3*3卷积核分别进行卷积处理以获取R、G、B三个通道的累加值,例如,在该码中,中心处的R通道的赋值为119,G、B通道的赋值分别为0,除中心以外的其他像素点的R通道的赋值为0,G、B通道的赋值分别为任意值。用户设备采用3*3卷积核分别进行卷积处理获得R、G、B三个通道的值分别为119、0、0。依次在其他区域对R、G、B三个通道进行卷积,获取R、G、B三个通道的值为109、0、0,依次类推,在其他区域获取R、G、B三个通道的值为109、0、0,随后用户设备将在R、G、B三个通道获取的值进行累加,确定R通道的累加值最大,确定R为第一通道,并从R通道的值中选取计算数值最大的三个的中心点作为码的定位点。
图9示出了可被用于实施本申请中所述的各个实施例的示例性***;
如图9所示在一些实施例中,***300能够作为各所述实施例中的任意一个用于生成和识别二维码的用户设备。在一些实施例中,***300可包括具有指令的一个或多个计算机可读介质(例如,***存储器或NVM/存储设备320)以及与该一个或多个计算机可读介质耦合并被配置为执行指令以实现模块从而执行本申请中所述的动作的一个或多个处理器(例如,(一个或多个)处理器305)。
对于一个实施例,***控制模块310可包括任意适当的接口控制器,以向(一个或多个)处理器305中的至少一个和/或与***控制模块310通信的任意适当的设备或组件提供任意适当的接口。
***控制模块310可包括存储器控制器模块330,以向***存储器315提供接口。存储器控制器模块330可以是硬件模块、软件模块和/或固件模块。
***存储器315可被用于例如为***300加载和存储数据和/或指令。对于一个实施例,***存储器315可包括任意适当的易失性存储器,例如,适当的DRAM。在一些实施例中,***存储器315可包括双倍数据速率类型四同步动态随机存取存储器(DDR4SDRAM)。
对于一个实施例,***控制模块310可包括一个或多个输入/输出(I/O)控制器,以向NVM/存储设备320及(一个或多个)通信接口325提供接口。
例如,NVM/存储设备320可被用于存储数据和/或指令。NVM/存储设备320可包括任意适当的非易失性存储器(例如,闪存)和/或可包括任意适当的(一 个或多个)非易失性存储设备(例如,一个或多个硬盘驱动器(HDD)、一个或多个光盘(CD)驱动器和/或一个或多个数字通用光盘(DVD)驱动器)。
NVM/存储设备320可包括在物理上作为***300被安装在其上的设备的一部分的存储资源,或者其可被该设备访问而不必作为该设备的一部分。例如,NVM/存储设备320可通过网络经由(一个或多个)通信接口325进行访问。
(一个或多个)通信接口325可为***300提供接口以通过一个或多个网络和/或与任意其他适当的设备通信。***300可根据一个或多个无线网络标准和/或协议中的任意标准和/或协议来与无线网络的一个或多个组件进行无线通信。
对于一个实施例,(一个或多个)处理器305中的至少一个可与***控制模块310的一个或多个控制器(例如,存储器控制器模块330)的逻辑封装在一起。对于一个实施例,(一个或多个)处理器305中的至少一个可与***控制模块310的一个或多个控制器的逻辑封装在一起以形成***级封装(SiP)。对于一个实施例,(一个或多个)处理器305中的至少一个可与***控制模块310的一个或多个控制器的逻辑集成在同一模具上。对于一个实施例,(一个或多个)处理器305中的至少一个可与***控制模块310的一个或多个控制器的逻辑集成在同一模具上以形成片上***(SoC)。
在各个实施例中,***300可以但不限于是:服务器、工作站、台式计算设备或移动计算设备(例如,膝上型计算设备、持有计算设备、平板电脑、上网本等)。在各个实施例中,***300可具有更多或更少的组件和/或不同的架构。例如,在一些实施例中,***300包括一个或多个摄像机、键盘、液晶显示器(LCD)屏幕(包括触屏显示器)、非易失性存储器端口、多个天线、图形芯片、专用集成电路(ASIC)和扬声器。
本申请还提供了一种计算机可读存储介质,所述计算机可读存储介质存储有计算机代码,当所述计算机代码被执行时,如前任一项所述的方法被执行。
本申请还提供了一种计算机程序产品,当所述计算机程序产品被计算机设备执行时,如前任一项所述的方法被执行。
本申请还提供了一种计算机设备,所述计算机设备包括:
一个或多个处理器;
存储器,用于存储一个或多个计算机程序;
当所述一个或多个计算机程序被所述一个或多个处理器执行时,使得所述一个或多个处理器实现如前任一项所述的方法。
需要注意的是,本申请可在软件和/或软件与硬件的组合体中被实施,例如,可采用专用集成电路(ASIC)、通用目的计算机或任何其他类似硬件设备来实现。在一个实施例中,本申请的软件程序可以通过处理器执行以实现上文所述步骤或功能。同样地,本申请的软件程序(包括相关的数据结构)可以被存储到计算机可读记录介质中,例如,RAM存储器,磁或光驱动器或软磁盘及类似设备。另外,本申请的一些步骤或功能可采用硬件来实现,例如,作为与处理器配合从而执行各个步骤或功能的电路。
另外,本申请的一部分可被应用为计算机程序产品,例如计算机程序指令,当其被计算机执行时,通过该计算机的操作,可以调用或提供根据本申请的方法和/或技术方案。本领域技术人员应能理解,计算机程序指令在计算机可读介质中的存在形式包括但不限于源文件、可执行文件、安装包文件等,相应地,计算机程序指令被计算机执行的方式包括但不限于:该计算机直接执行该指令,或者该计算机编译该指令后再执行对应的编译后程序,或者该计算机读取并执行该指令,或者该计算机读取并安装该指令后再执行对应的安装后程序。在此,计算机可读介质可以是可供计算机访问的任意可用的计算机可读存储介质或通信介质。
通信介质包括藉此包含例如计算机可读指令、数据结构、程序模块或其他数据的通信信号被从一个***传送到另一***的介质。通信介质可包括有导的传输介质(诸如电缆和线(例如,光纤、同轴等))和能传播能量波的无线(未有导的传输)介质,诸如声音、电磁、RF、微波和红外。计算机可读指令、数据结构、程序模块或其他数据可被体现为例如无线介质(诸如载波或诸如被体现为扩展频谱技术的一部分的类似机制)中的已调制数据信号。术语“已调制数据信号”指的是其一个或多个特征以在信号中编码信息的方式被更改或设定的信号。调制可以是模拟的、数字的或混合调制技术。
作为示例而非限制,计算机可读存储介质可包括以用于存储诸如计算机可读指令、数据结构、程序模块或其它数据的信息的任何方法或技术实现的易失性和非易失性、可移动和不可移动的介质。例如,计算机可读存储介质包括, 但不限于,易失性存储器,诸如随机存储器(RAM,DRAM,SRAM);以及非易失性存储器,诸如闪存、各种只读存储器(ROM,PROM,EPROM,EEPROM)、磁性和铁磁/铁电存储器(MRAM,FeRAM);以及磁性和光学存储设备(硬盘、磁带、CD、DVD);或其它现在已知的介质或今后开发的能够存储供计算机***使用的计算机可读信息/数据。
在此,根据本申请的一个实施例包括一个装置,该装置包括用于存储计算机程序指令的存储器和用于执行程序指令的处理器,其中,当该计算机程序指令被该处理器执行时,触发该装置运行基于前述根据本申请的多个实施例的方法和/或技术方案。
对于本领域技术人员而言,显然本申请不限于上述示范性实施例的细节,而且在不背离本申请的精神或基本特征的情况下,能够以其他的具体形式实现本申请。因此,无论从哪一点来看,均应将实施例看作是示范性的,而且是非限制性的,本申请的范围由所附权利要求而不是上述说明限定,因此旨在将落在权利要求的等同要件的含义和范围内的所有变化涵括在本申请内。不应将权利要求中的任何附图标记视为限制所涉及的权利要求。此外,显然“包括”一词不排除其他单元或步骤,单数不排除复数。装置权利要求中陈述的多个单元或装置也可以由一个单元或装置通过软件或者硬件来实现。第一,第二等词语用来表示名称,而并不表示任何特定的顺序。

Claims (17)

  1. 一种用于生成二维码的方法,其特征在于,所述方法包括:
    确定待生成的二维码中的多个定位点,其中,所述待生成的二维码包括定位区域;
    确定所述多个定位点中至少一个定位点所在定位区域中的信息点的多通道赋值,以及所述二维码中除所述定位区域外其它区域中的信息点的多通道赋值,其中,所述多通道赋值包括第一通道的赋值,所述其它区域中的信息点在所述第一通道的赋值满足第一距离相关性;
    根据所述二维码中的信息点的多通道赋值生成所述二维码。
  2. 根据权利要求1所述的方法,其特征在于,所述定位区域中各信息点具有相同的多通道赋值,或者所述定位区域中任意两个信息点的多通道赋值的差值小于或等于第一赋值差值阈值。
  3. 根据权利要求1所述的方法,其特征在于,所述定位区域中的信息点在不同通道的赋值相同,或者所述定位区域中的信息点在所述第一通道的赋值与该信息点在除所述第一通道外的其它通道的赋值的差值小于或等于第二赋值差值阈值。
  4. 根据权利要求1至3中任一项所述的方法,其特征在于,所述第一距离相关性包括以下任一项:
    所述其它区域中的信息点在所述第一通道的赋值与该信息点和所述至少一个定位点间的距离信息负相关;
    所述其它区域中的信息点在所述第一通道的赋值与该信息点和所述至少一个定位点间的距离信息正相关。
  5. 根据权利要求1至4中任一项所述的方法,其特征在于,所述其它区域中的信息点在除所述第一通道外的其它通道的赋值为零,或者所述其它区域中的信息点在除所述第一通道外的其它通道的赋值小于或等于第三赋值阈值。
  6. 一种用于识别二维码的方法,其特征在于,所述方法包括:
    从待识别的二维码中提取所述二维码对应的多个通道信息;
    利用所述二维码对应的卷积核对所述多个通道信息分别进行卷积处理,以获得对应的多个通道卷积信息,所述多个通道卷积信息包括第一通道的卷积信息,其 中,所述卷积核与所述二维码中的定位区域相适应;
    将所述第一通道的卷积信息中数值最大或最小的至少一个信息点确定为至少一个定位点,其中,所述第一通道的卷积信息在所述多个通道卷积信息中的累加和信息最大;
    根据所述至少一个定位点确定所述二维码中的识别区域,并对所述识别区域执行识别处理。
  7. 根据权利要求6所述的方法,其特征在于,所述二维码中除所述定位区域外其它区域中的信息点在所述第一通道的赋值满足第一距离相关性;所述卷积核中的信息点的赋值满足第二距离相关性;所述第一距离相关性与所述第二距离相关性相适应。
  8. 根据权利要求7所述的方法,其特征在于,所述第二距离相关性包括以下任一项:
    所述卷积核的中心点和所述卷积核中的信息点间的距离信息,与该信息点的赋值负相关;
    所述卷积核的中心点和所述卷积核中的信息点间的距离信息,与该信息点的赋值正相关。
  9. 根据权利要求8所述的方法,其特征在于,所述第二距离相关性包括所述卷积核的中心点和所述卷积核中的信息点间的距离信息,与该信息点的赋值负相关;
    其中,所述将所述第一通道的卷积信息中数值最大或最小的至少一个信息点确定为至少一个定位点,其中,所述第一通道的卷积信息在所述多个通道卷积信息中的累加和信息最大,包括:
    将所述第一通道的卷积信息中数值最大的至少一个信息点确定为所述至少一个定位点,其中,所述第一通道的卷积信息在所述多个通道卷积信息中的累加和信息最大。
  10. 根据权利要求8或9所述的方法,其特征在于,所述第二距离相关性包括所述卷积核的中心点和所述卷积核中的信息点间的距离信息,与该信息点的赋值正相关;
    其中,所述将所述第一通道的卷积信息中数值最大或最小的至少一个信息点确定为至少一个定位点,其中,所述第一通道的卷积信息在所述多个通道卷积信息 中的累加和信息最大,包括:
    将所述第一通道的卷积信息中数值最小的至少一个信息点确定为所述至少一个定位点,其中,所述第一通道的卷积信息在所述多个通道卷积信息中的累加和信息最大。
  11. 一种用于生成定位点的方法,其特征在于,所述方法包括:
    确定待生成的图形码中的多个定位点,其中,所述图形码中包括定位区域;
    确定所述多个定位点中至少一个定位点所在定位区域中的信息点的多通道赋值,以及所述图形码中除所述定位区域外其它区域中的信息点的多通道赋值,其中,所述多通道赋值包括第一通道的赋值,所述其它区域中的信息点在所述第一通道的赋值满足第一距离相关性。
  12. 一种用于识别定位点的方法,其特征在于,所述方法包括:
    从待识别的图形码中提取所述图形码对应的多个通道信息;
    利用所述图形码对应的卷积核对所述多个通道信息分别进行卷积处理,以获得对应的多个通道卷积信息,所述多个通道卷积信息包括第一通道的卷积信息,其中,所述卷积核与所述图形码中定位区域相适应;
    将所述第一通道的卷积信息中数值最大或最小的至少一个信息点确定为至少一个定位点,其中,所述第一通道的卷积信息在所述多个通道卷积信息中的累加和信息最大;
    根据所述至少一个定位点确定所述图形码中的识别区域,并对所述识别区域执行识别处理。
  13. 一种用于生成二维码的设备,其中,所述设备包括:
    处理器;以及
    被安排成存储计算机可执行指令的存储器,所述可执行指令在被执行时使所述处理器执行如权利要求1至5中任一项所述方法的操作。
  14. 一种用于识别二维码的设备,其中,所述设备包括:
    处理器;以及
    被安排成存储计算机可执行指令的存储器,所述可执行指令在被执行时使所述处理器执行如权利要求6至10中任一项所述方法的操作。
  15. 一种用于生成定位点的设备,其中,所述设备包括:
    处理器;以及
    被安排成存储计算机可执行指令的存储器,所述可执行指令在被执行时使所述处理器执行如权利要求11所述方法的操作。
  16. 一种用于识别定位点的设备,其中,所述设备包括:
    处理器;以及
    被安排成存储计算机可执行指令的存储器,所述可执行指令在被执行时使所述处理器执行如权利要求12所述方法的操作。
  17. 一种存储指令的计算机可读介质,所述指令在被执行时使得***进行如权利要求1至12中任一项所述方法的操作。
PCT/CN2019/122596 2018-12-04 2019-12-03 一种用于生成和识别二维码的方法与设备 WO2020114375A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201811472317.X 2018-12-04
CN201811472317.XA CN109657514B (zh) 2018-12-04 2018-12-04 一种用于生成和识别二维码的方法与设备

Publications (1)

Publication Number Publication Date
WO2020114375A1 true WO2020114375A1 (zh) 2020-06-11

Family

ID=66111743

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/122596 WO2020114375A1 (zh) 2018-12-04 2019-12-03 一种用于生成和识别二维码的方法与设备

Country Status (2)

Country Link
CN (1) CN109657514B (zh)
WO (1) WO2020114375A1 (zh)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109657514B (zh) * 2018-12-04 2020-09-08 连尚(新昌)网络科技有限公司 一种用于生成和识别二维码的方法与设备

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070114285A1 (en) * 2004-03-15 2007-05-24 Shenzhen Syscan Technology Co., Ltd. 2D coding and decoding barcode and its method thereof
CN104331729A (zh) * 2014-11-04 2015-02-04 山东泰宝防伪技术产品有限公司 彩色二维码
CN104657768A (zh) * 2015-03-20 2015-05-27 华中科技大学 一种彩色三维码结构及彩色三维码识读方法
CN105205520A (zh) * 2015-09-30 2015-12-30 立德高科(昆山)数码科技有限责任公司 具有颜色渐变效果的二维码、生成方法与生成***
CN108062781A (zh) * 2018-01-31 2018-05-22 深圳市裕同包装科技股份有限公司 一种视觉码批量生成的***及其方法
CN109657514A (zh) * 2018-12-04 2019-04-19 连尚(新昌)网络科技有限公司 一种用于生成和识别二维码的方法与设备

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107247984B (zh) * 2017-05-18 2020-01-24 中山大学 一种可视化二维码的编码方法
CN112861560B (zh) * 2017-09-27 2023-12-22 创新先进技术有限公司 二维码定位方法及装置
CN107862235B (zh) * 2017-11-08 2021-02-26 青岛海信移动通信技术股份有限公司 二维码的位置定位方法、装置及终端设备

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070114285A1 (en) * 2004-03-15 2007-05-24 Shenzhen Syscan Technology Co., Ltd. 2D coding and decoding barcode and its method thereof
CN104331729A (zh) * 2014-11-04 2015-02-04 山东泰宝防伪技术产品有限公司 彩色二维码
CN104657768A (zh) * 2015-03-20 2015-05-27 华中科技大学 一种彩色三维码结构及彩色三维码识读方法
CN105205520A (zh) * 2015-09-30 2015-12-30 立德高科(昆山)数码科技有限责任公司 具有颜色渐变效果的二维码、生成方法与生成***
CN108062781A (zh) * 2018-01-31 2018-05-22 深圳市裕同包装科技股份有限公司 一种视觉码批量生成的***及其方法
CN109657514A (zh) * 2018-12-04 2019-04-19 连尚(新昌)网络科技有限公司 一种用于生成和识别二维码的方法与设备

Also Published As

Publication number Publication date
CN109657514B (zh) 2020-09-08
CN109657514A (zh) 2019-04-19

Similar Documents

Publication Publication Date Title
CN110336735B (zh) 一种用于发送提醒消息的方法与设备
CN110780955B (zh) 一种用于处理表情消息的方法与设备
CN110765395B (zh) 一种用于提供小说信息的方法与设备
CN110321192B (zh) 一种呈现寄宿程序的方法与设备
CN110290557B (zh) 一种加载应用内页面标签的方法与设备
CN110321189B (zh) 一种在宿主程序中呈现寄宿程序的方法与设备
CN110827061A (zh) 一种用于在小说阅读过程中提供呈现信息的方法与设备
CN110837618A (zh) 一种用于提供阅读服务的方法与设备
CN111506232B (zh) 一种用于在阅读应用中控制菜单显示的方法与设备
CN111523039B (zh) 一种用于处理阅读应用中书籍催更请求的方法与设备
CN111162990B (zh) 一种呈现消息通知的方法与设备
WO2020114375A1 (zh) 一种用于生成和识别二维码的方法与设备
CN114666652A (zh) 一种用于播放视频的方法、设备、介质及程序产品
CN113438507A (zh) 一种用于确定视频侵权的方法、设备、介质及程序产品
CN110443641B (zh) 一种管理小说章节的阅读权限和评论信息的方法与设备
CN111177062B (zh) 一种用于提供阅读呈现信息的方法与设备
CN112686316A (zh) 一种用于确定标签的方法与设备
CN110765390A (zh) 一种用于在社交空间发布分享信息的方法与设备
CN110751003B (zh) 一种获取二维码的目标数据信息的方法与设备
CN113657245B (zh) 一种用于人脸活体检测的方法、设备、介质及程序产品
CN111680249B (zh) 一种推送呈现信息的方法与设备
CN110460642B (zh) 一种管理阅读模式的方法与设备
CN110311945B (zh) 一种用于在实时视频流中呈现资源推送信息的方法与设备
CN110781416A (zh) 一种提供风景信息的方法与设备
CN111078654A (zh) 一种分享信息的方法与设备

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 19892512

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19892512

Country of ref document: EP

Kind code of ref document: A1