WO2021109656A1 - 二维码尺寸确定方法、二维码显示方法、装置及设备 - Google Patents

二维码尺寸确定方法、二维码显示方法、装置及设备 Download PDF

Info

Publication number
WO2021109656A1
WO2021109656A1 PCT/CN2020/113532 CN2020113532W WO2021109656A1 WO 2021109656 A1 WO2021109656 A1 WO 2021109656A1 CN 2020113532 W CN2020113532 W CN 2020113532W WO 2021109656 A1 WO2021109656 A1 WO 2021109656A1
Authority
WO
WIPO (PCT)
Prior art keywords
size
dimensional code
code
determining
parameter set
Prior art date
Application number
PCT/CN2020/113532
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 WO2021109656A1 publication Critical patent/WO2021109656A1/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

Definitions

  • This specification relates to the field of computer technology, and in particular to a method for determining the size of a two-dimensional code, a method, device and equipment for displaying a two-dimensional code.
  • a two-dimensional code refers to a readable barcode with another dimension expanded on the basis of a one-dimensional barcode. It uses a black and white rectangular pattern to represent binary data. It can store more information and express more than traditional barcodes. Data type, the information contained in the QR code can be obtained after being scanned by the device.
  • two-dimensional codes have been widely used in daily life, such as using two-dimensional codes to complete payments, using two-dimensional codes to obtain personal account information, and using two-dimensional codes for product marketing and promotion.
  • the size of the two-dimensional code needs to be designed according to the use scene to determine an optimal size, which is convenient for users to quickly complete the code scanning.
  • the current size design of the two-dimensional code is done by manual trial and error, and after many attempts to determine an optimal size. Therefore, it is necessary to provide a method for determining the size of a two-dimensional code to automate the determination of the optimal size of the two-dimensional code.
  • this specification provides a two-dimensional code size determination method, two-dimensional code display method, device and computer equipment.
  • a method for determining the size of a two-dimensional code includes:
  • the target size of the two-dimensional code is determined based on the at least one size that can be identified to generate a two-dimensional code of the target size.
  • a method for displaying a two-dimensional code including:
  • an apparatus for determining the size of a two-dimensional code including:
  • An acquiring module configured to acquire a parameter set for determining the size of the two-dimensional code, the parameter set being determined based on the use scenario of the two-dimensional code;
  • a first calculation module configured to determine, according to the parameter set, at least one size that can be recognized by the two-dimensional code in the usage scenario
  • the second calculation module is configured to determine the target size of the two-dimensional code based on the at least one size that can be identified to generate a two-dimensional code of the target size.
  • an apparatus for displaying a two-dimensional code including:
  • An acquiring module configured to acquire a parameter set for determining the size of the two-dimensional code, the parameter set being determined based on the use scenario of the two-dimensional code;
  • a first calculation module configured to determine, according to the parameter set, at least one size that can be recognized by the two-dimensional code in the usage scenario
  • a second calculation module configured to determine the target size of the two-dimensional code based on the at least one size that can be identified
  • the display module generates and displays the two-dimensional code of the target ruler.
  • a computer device including a memory, a processor, and a computer program stored in the memory and capable of running on the processor.
  • the processor implements any implementation when the program is executed. The method described in the example.
  • the best size of the two-dimensional code in the usage scenario can be determined first, and then a two-dimensional code of that size is generated, so that the user does not need to adjust the position by himself.
  • the dimension code but the QR code automatically adjusts the size to fit the user, and the user can successfully scan the code without moving the position, making the scan code more intelligent.
  • Fig. 1 is a flowchart of a method for determining a two-dimensional size according to an embodiment of the present specification.
  • Fig. 2 is a schematic diagram of a human-computer interaction interface according to an embodiment of the present specification.
  • Fig. 3 is a schematic diagram of different sizes of a two-dimensional code according to an embodiment of this specification.
  • Fig. 4 is a schematic diagram of calculating the size of a two-dimensional code according to an embodiment of this specification.
  • Fig. 5 is a flowchart of a two-dimensional code display method according to an embodiment of the present specification.
  • Fig. 6 is a schematic diagram of the logical structure of a device for determining the size of a two-dimensional code according to an embodiment of the present specification.
  • FIG. 7 is a schematic diagram of a logical structure of a two-dimensional code display device according to an embodiment of the present specification.
  • Fig. 8 is a schematic structural diagram of a device for implementing the method of this specification according to an embodiment of this specification.
  • first, second, third, etc. may be used in this specification to describe various information, the information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other.
  • first information may also be referred to as second information, and similarly, the second information may also be referred to as first information.
  • word “if” as used herein can be interpreted as "when” or “when” or "in response to determination”.
  • a two-dimensional code refers to a readable barcode with another dimension expanded on the basis of a one-dimensional barcode. It uses a black and white rectangular pattern to represent binary data. It can store more information and express more than traditional barcodes. Data type, the information contained in the QR code can be obtained after being scanned by the device.
  • two-dimensional codes have been widely used in daily life, such as using two-dimensional codes to complete payments, using two-dimensional codes to obtain personal account information, and using two-dimensional codes for product marketing and promotion.
  • the size of the two-dimensional code needs to be designed according to the use scene to determine an optimal size, which is convenient for users to quickly complete the code scanning.
  • the optimal size of the two-dimensional code refers to a size that is compatible with the largest part of the angle and the crowd, and can be successfully scanned without the user's moving position under a certain usage scenario.
  • the driver needs to scan the QR code to make payment.
  • the optimal size of the QR code should be designed so that most drivers can Successfully complete the scan without moving the position.
  • the best size is through manual trial and error. After many attempts to determine the best size, in a specific usage scenario, what is the reasonable size? A unified scientific calculation method.
  • the size of the QR code is also fixed, and there is no way to automatically adjust the size of the QR code based on the positional relationship between the QR code display device and the scanning device.
  • the size of the dimension code is not smart enough. Therefore, it is necessary to improve the method for determining the size of the two-dimensional code and the method for displaying the two-dimensional code.
  • the embodiment of this specification provides a method for determining the size of a two-dimensional code, which can automatically determine the optimal size of a two-dimensional code in a certain usage scenario.
  • the method may include the following steps:
  • S104 Determine, according to the parameter set, at least one size that can be recognized by the two-dimensional code in the usage scenario.
  • S106 Determine a target size of the two-dimensional code based on the at least one size that can be identified to generate a two-dimensional code of the target size.
  • the target size of the embodiment of this specification may be an optimal size of the QR code in a specific use scene, and the two-dimensional code of this size is compatible with most scanning angles and most people in the specific use scene.
  • the size that can be successfully scanned without the user moving the position For example, in some application scenarios, after the location of the QR code is determined, the location where the user scans the code is relatively fixed. Most users scan the code within this location, so the size of the QR code can be designed as a user When scanning the code within this range, the size of the code can be successfully scanned without moving.
  • the method for determining the size of a QR code in the embodiments of this specification can be used for a device that specifically calculates the size of a QR code, such as a mobile phone, tablet, laptop, and other electronic devices.
  • the device can only be used for calculation.
  • the target size of the QR code does not have the function of generating and displaying the QR code.
  • An APP for calculating the two-dimensional size can be installed on the device. The APP can determine the target size of the two-dimensional code according to various parameters of the obtained two-dimensional code in a specific usage scenario, and feed it back to the user.
  • the method for determining the size of the QR code in the embodiments of this specification can be used for devices that can not only calculate the target size of the QR code, but also generate and display the QR code, such as mobile phones, tablets, and laptops.
  • these devices can pre-determine the target size of the QR code, and then display the QR code to other users according to the determined target size for users to scan. code.
  • the QR code can be designed according to its specific usage scenarios, such as the distance between the user and the QR code when scanning the code, and whether the QR code is printed on paper for the user to scan, or on the display for the user
  • the relevant hardware parameters of the code scanning camera for scanning and scanning the QR code, the information density of the QR code and other factors will affect the scanning result. Therefore, when designing the size of the QR code, these factors can be considered comprehensively.
  • the parameters in the parameter set determine at least one size that can be recognized by the QR code in the use scene, and use these one or more sizes as a reference to determine the target size of the QR code, where the one or more sizes can be It is the maximum size that can be recognized by the two-dimensional code in the use scene, or the minimum size, the average size of the maximum size, and the minimum size, or a set of a plurality of the foregoing sizes.
  • the parameters included in the parameter set may be the distance between the scanning camera and the QR code, the information density of the QR code, the resolution of the scanning camera, the horizontal viewing angle of the scanning camera, the focal length of the scanning camera, One or more of the pixel size of the scan code camera, the pixel size of the scan code recognition area, the recognizable pixels of a single module of the two-dimensional code, the material of the two-dimensional code carrier, and the color parameters of the two-dimensional code carrier.
  • the parameters involved in determining the target size of a QR code in a specific usage scenario include the following four categories: (1) Environmental factors, such as the distance between the code scanning camera and the QR code, the scanning camera and the second The distance of the QR code is an important factor that affects the size of the QR code.
  • the scan distance largely determines how large the size of the QR code should be designed to be more reasonable; the relative angle of the QR code and the scan camera, such as scanning When the code device is facing the two-dimensional code, it is easier to recognize when it is smaller in size. If it is taken diagonally, it is easier to recognize when it is larger in size.
  • the hardware factors of the code scanning camera such as the resolution of the code scanning camera, the horizontal viewing angle of the code scanning camera, the focal length of the code scanning camera, the pixel size of the code scanning camera, the pixel size of the scanning code recognition area, and the hardware of the code scanning camera
  • the parameters directly determine the clarity of the two-dimensional code image on the scanning camera. If the image resolution is high, the smaller the size can be recognized, and the lower the imaging resolution, the larger the size can be recognized.
  • the related parameters of the QR code itself Different versions of the QR code have different related parameters, such as the information density of the QR code.
  • the QR code is composed of many black and white modules, and each black and white module has a certain record.
  • the information density of the two-dimensional code is the display density of the black and white modules in the two-dimensional code; the identifiable pixels of a single module of the two-dimensional code, that is, how many pixels each module of the two-dimensional code contains can be clearly identified.
  • a single module of a two-dimensional code can recognize 3 pixels.
  • this parameter can be set according to the actual scene. For different scanning cameras and QR codes with different display densities, the value of this parameter is different.
  • the carrier of the two-dimensional code such as whether the two-dimensional code is scanned on the screen or printed on paper, the color of the two-dimensional code carrier, that is, the background color of the two-dimensional code. When displayed on the screen and the white screen, the size required for recognition is also different.
  • the method of obtaining is different for different parameters.
  • environmental parameters such as the distance between the scanning camera and the QR code
  • the device that determines the QR code size has a ranging function, it can also directly measure and scan the code camera.
  • distance For example, the device that determines the size of the two-dimensional code can also be used to generate and display the two-dimensional code. Before displaying the two-dimensional code, the distance to the scan code can be measured by the distance measuring device on the device.
  • This distance measuring device can be a laser distance measuring device, an infrared distance measuring device, an ultrasonic distance measuring device, a binocular camera, a TOF (Time Of Flight) camera, etc.
  • the distance can also be calculated by using two images of the QR code collected by the binocular camera, such as matching feature points of the two images. Then the distance is determined by parallax.
  • the hardware parameters of the scan code camera since the hardware parameters of each camera are not much different, these parameters can be set in advance according to the situation of the common scan code camera, and then stored, and directly obtained from the relevant storage path when needed.
  • the relevant parameters of the two-dimensional code and the relevant parameters of the carrier can also be set through user input or preset and stored in a designated location.
  • the parameters used to determine the target size of the two-dimensional code in a certain usage scenario may be input by the user, and the user may pre-determine various parameters according to the usage scenario.
  • the user can input part of the parameters in the parameter set, or input all the parameters, and can flexibly set which parameters need to be input by the user according to the actual scene.
  • the human-computer interaction interface can also display the default values of certain parameters in advance, and the user can modify the default values. If the user does not modify the default values, the default values are directly used.
  • the at least one size may be the maximum size, the minimum size, the average size of the maximum size, and the minimum size, or may be a set of the maximum size, the minimum size, and the average size.
  • the minimum size is the critical size that the QR code smaller than this size cannot be recognized under this usage scenario, and the maximum size is under this usage scenario, users who are larger than this size need to back up to allow the two
  • the dimension code completely falls into the critical size of the scanning code recognition area (that is, the central rectangle of the two-dimensional code frame selection when scanning the code).
  • a certain percentage can be appropriately reduced on the basis of the maximum size as the target size, for example, 80% of the maximum size is taken as the target size. It can also be that after the minimum size is determined, a certain proportion is appropriately increased on the basis of the minimum size, for example, 1.5 times the minimum size is taken as the target size.
  • the target size can be determined at the same time, and then determine the target size based on these two sizes, for example, take the average of the two as the target size, or randomly select one of the two sizes as the target size.
  • the specific calculation method of the target size can be flexibly set according to the actual scene.
  • the maximum size in the usage scenario may be determined by the distance between the code scanning camera and the two-dimensional code, the pixel size of the code scanning camera, the focal length of the code scanning camera, and the pixel size of the scanning code recognition area.
  • the specific calculation formula for the maximum size is:
  • D is the maximum size of the QR code that can be recognized under the usage scenario
  • s is the pixel size of the scan code recognition area
  • ps is the pixel size of the code scan camera
  • L is the distance between the code scan camera and the QR code
  • f Is the focal length of the scan code camera.
  • the minimum size in the usage scenario can be determined by the distance between the scanning camera and the QR code, the pixel size of the scanning camera, the focal length of the scanning camera, and the recognizable pixels of a single module of the QR code and the two The information density of the dimension code is determined.
  • the specific calculation formula for the minimum size is:
  • d is the minimum size of the QR code that can be recognized in the usage scenario
  • px is the recognizable pixel of a single module of the QR code
  • ps is the pixel size of the scan camera
  • m is the information density of the QR code
  • L is The distance between the code scanning camera and the QR code
  • f is the focal length of the code scanning camera.
  • the following uses a specific embodiment to introduce the method for determining the size of the two-dimensional code provided in the embodiment of this specification.
  • the imaging pixels of a single module of the QR code: 3 (can be adjusted according to the actual situation)
  • the size of the QR code can be larger.
  • the imaging size of the QR code can be calculated: The pixels meet the requirements within the range of the QR code scanning recognition area.
  • S508 Generate and display a two-dimensional code of the target size.
  • D is the maximum size of the QR code that can be recognized under the usage scenario
  • s is the pixel size of the scan code recognition area
  • ps is the pixel size of the code scan camera
  • L is the distance between the code scan camera and the QR code
  • f Is the focal length of the scan code camera.
  • d is the minimum size of the QR code that can be recognized in the usage scenario
  • px is the recognizable pixel of a single module of the QR code
  • ps is the pixel size of the scan camera
  • m is the information density of the QR code
  • L is The distance between the code scanning camera and the QR code
  • f is the focal length of the code scanning camera.
  • the user sitting in the car needs to use the mobile phone to show the QR code to the scanning device, but it is possible that the user is far away and the QR code is relatively small. It is convenient to scan codes, and it is not convenient for users to move.
  • the user's mobile phone can be used to measure the distance from the mobile phone to the code scanning device.
  • the mobile phone is equipped with a binocular camera, or the distance can be calculated by using two two-dimensional code images collected by the binocular camera, such as matching the feature points of the two images. , And then determine the distance by parallax.
  • the parameter set includes one or more of the following parameters: the distance between the scanning camera and the QR code, the information density of the QR code, the resolution of the scanning camera, the horizontal viewing angle of the scanning camera, The focal length of the scan code camera, the pixel size of the scan code camera, the pixel size of the scan code recognition area, the identifiable pixels of a single module of the QR code, the material of the QR code carrier, and the color of the QR code carrier.
  • the at least one size that can be identified includes:
  • the parameter set for determining the maximum size includes: the distance between the code scanning camera and the two-dimensional code, the pixel size of the code scanning camera, the focal length of the code scanning camera, and the pixel size of the scanning code recognition area.
  • the obtaining module 72 is configured to obtain a parameter set for determining the size of the two-dimensional code, the parameter set being determined based on the use scenario of the two-dimensional code;
  • the second calculation module 76 is configured to determine the target size of the two-dimensional code based on the at least one size that can be identified;
  • the display module 78 generates and displays the two-dimensional code of the target ruler.
  • the device for displaying the two-dimensional code includes a distance measuring device, and the distance between the code scanning camera and the two-dimensional code is obtained by the distance measuring device.
  • the parameter set for determining the maximum size includes: the distance between the code scanning camera and the two-dimensional code, the pixel size of the code scanning camera, the focal length of the code scanning camera, and the pixel size of the scanning code recognition area.
  • an embodiment of the present specification also provides a computer storage medium in which a program is stored, and the program is executed by a processor to implement the method in any of the foregoing embodiments.
  • the embodiments of this specification may adopt the form of a computer program product implemented on one or more storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing program codes.
  • Computer usable storage media include permanent and non-permanent, removable and non-removable media, and information storage can be realized by any method or technology.
  • the information can be computer-readable instructions, data structures, program modules, or other data.
  • Examples of computer storage media include, but are not limited to: phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, CD-ROM, digital versatile disc (DVD) or other optical storage, Magnetic cassettes, magnetic tape magnetic disk 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.
  • PRAM phase change memory
  • SRAM static random access memory
  • DRAM dynamic random access memory
  • RAM random access memory
  • ROM read-only memory
  • EEPROM electrically erasable programmable read-only memory
  • flash memory or other memory technology
  • CD-ROM compact disc
  • DVD digital versatile disc
  • Magnetic cassettes magnetic tape magnetic disk 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.

Landscapes

  • Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • Electromagnetism (AREA)
  • General Health & Medical Sciences (AREA)
  • Toxicology (AREA)
  • Artificial Intelligence (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

本说明书实施例提供一种二维码尺寸确定方法、二维码显示方法、装置及设备。获取在特定使用场景下用于确定二维码尺寸的各项参数后,根据各项参数确定一个或多个二维码在该使用场景可被识别的尺寸,然后根据一个或多个可被识别的尺寸确定二维码的目标尺寸,以生成目标尺寸的二维码。通过确定该使用场景下可被识别的二维码尺寸作为基准,可以自动地确定出二维码在该使用场景下的适合大多数用户成功扫码的最佳尺寸。

Description

二维码尺寸确定方法、二维码显示方法、装置及设备 技术领域
本说明书涉及计算机技术领域,尤其涉及一种二维码尺寸确定方法、二维码显示方法、装置及设备。
背景技术
二维码是指在一维条码的基础上扩展出另一维具有可读性的条码,使用黑白矩形图案表示二进制数据,它比传统的条形码能存更多的信息,也能表示更多的数据类型,二维码被设备扫描后即可获取其中所包含的信息。目前,二维码已在日常生活中广泛的应用,比如利用二维码完成支付、利用二维码获取个人账号信息,利用二维码进行产品营销推广等等。在扫描二维码时,为了能够成功完成扫码,需要根据使用场景对二维码的尺寸进行设计,以确定一个最佳的尺寸,方便用户快速完成扫码。但是,目前对于二维码的尺寸设计,都是通过手工试错的方式,经过多次尝试确定一个最佳的尺寸。因而,有必要提供一种二维码尺寸确定方法,使得二维码最佳尺寸的确定实现自动化。
发明内容
基于此,本说明书提供了一种二维码尺寸确定方法、二维码显示方法、装置及计算机设备。
根据本说明书实施例的第一方面,提供一种二维码尺寸确定方法,所述方法包括:
获取用于确定二维码尺寸的参数集,所述参数集基于所述二维码的使用场景确定;
根据所述参数集确定在所述使用场景所述二维码可被识别的至少一个尺寸;
基于所述可被识别的至少一个尺寸确定所述二维码的目标尺寸,以生成所述目标尺寸的二维码。
根据本说明书实施例的第二方面,提供一种显示二维码的方法,所述方法包括:
获取用于确定二维码尺寸的参数集,所述参数集基于所述二维码的使用场景确定;
根据所述参数集确定在所述使用场景所述二维码可被识别的至少一个尺寸;
基于所述可被识别的至少一个尺寸确定所述二维码的目标尺寸;
生成所述目标尺寸的二维码并显示。
根据本说明书实施例的第三方面,提供一种用于确定二维码尺寸的装置,所述装置包括:
获取模块,用于获取用于确定二维码尺寸的参数集,所述参数集基于所述二维码的使用场景确定;
第一计算模块,用于根据所述参数集确定在所述使用场景所述二维码可被识别的至少一个尺寸;
第二计算模块,用于基于所述可被识别的至少一个尺寸确定所述二维码的目标尺寸,以生成所述目标尺寸的二维码。
根据本说明书实施例的第四方面,提供一种显示二维码的装置,所述装置包括:
获取模块,用于获取用于确定二维码尺寸的参数集,所述参数集基于所述二维码的使用场景确定;
第一计算模块,用于根据所述参数集确定在所述使用场景所述二维码可被识别的至少一个尺寸;
第二计算模块,用于基于所述可被识别的至少一个尺寸确定所述二维码的目标尺寸;
显示模块,生成所述目标尺的二维码并显示。
根据本说明书实施例的第五方面,提供一种计算机设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述程序时实现任一实施例所述的方法。
应用本说明书实施例方案,一方面,获取在特定使用场景下用于确定二维码尺寸的各项参数后,根据各项参数确定一个或多个二维码在该使用场景可被识别的尺寸,然后根据一个或多个可被识别的尺寸确定二维码的目标尺寸,以生成目标尺寸的二维码。通过确定该使用场景下可被识别的二维码尺寸作为基准,可以自动地确定出二维码在该使用场景下的适合大多数用户成功扫码的最佳尺寸。另一方面,在显示二维码以便用户扫码时,可以先确定出二维码在该使用场景下的最佳尺寸,然后生成该尺寸的二维码,这样便无需用户自己调整位置适应二维码,而是二维码自动调节尺寸以适应用户,用户无需移动位置即可成功扫码,使得扫码更加智能。
应当理解的是,以上的一般描述和后文的细节描述仅是示例性和解释性的,并不能限制本说明书。
附图说明
此处的附图被并入说明书中并构成本说明书的一部分,示出了符合本说明书的实施例,并与说明书一起用于解释本说明书的原理。
图1是本说明书一个实施例的一种确定二维尺寸的方法流程图。
图2是本说明书一个实施例的一种人机交互界面的示意图。
图3是本说明书一个实施例的一种二维码不同尺寸的示意图。
图4是本说明书一个实施例的一种二维码尺寸计算示意图。
图5是本说明书一个实施例的一种二维码显示方法流程图。
图6是本说明书一个实施例的一种用于确定二维码尺寸的装置的逻辑结构示意图。
图7是本说明书一个实施例的一种用于二维码显示装置的逻辑结构示意图。
图8是本说明书一个实施例的用于实施本说明书方法的设备的结构示意图。
具体实施方式
这里将详细地对示例性实施例进行说明,其示例表示在附图中。下面的描述涉及附图时,除非另有表示,不同附图中的相同数字表示相同或相似的要素。以下示例性实施例中所描述的实施方式并不代表与本说明书相一致的所有实施方式。相反,它们仅是与如所附权利要求书中所详述的、本说明书的一些方面相一致的装置和方法的例子。
在本说明书使用的术语是仅仅出于描述特定实施例的目的,而非旨在限制本说明书。在本说明书和所附权利要求书中所使用的单数形式的“一种”、“所述”和“该”也旨在包括多数形式,除非上下文清楚地表示其他含义。还应当理解,本文中使用的术语“和/或”是指并包含一个或多个相关联的列出项目的任何或所有可能组合。
应当理解,尽管在本说明书可能采用术语第一、第二、第三等来描述各种信息,但这些信息不应限于这些术语。这些术语仅用来将同一类型的信息彼此区分开。例如,在不脱离本说明书范围的情况下,第一信息也可以被称为第二信息,类似地,第二信息也可以被称为第一信息。取决于语境,如在此所使用的词语“如果”可以被解释成为 “在……时”或“当……时”或“响应于确定”。
二维码是指在一维条码的基础上扩展出另一维具有可读性的条码,使用黑白矩形图案表示二进制数据,它比传统的条形码能存更多的信息,也能表示更多的数据类型,二维码被设备扫描后即可获取其中所包含的信息。目前,二维码已在日常生活中广泛的应用,比如利用二维码完成支付、利用二维码获取个人账号信息,利用二维码进行产品营销推广等等。在扫描二维码时,为了能够成功完成扫码,需要根据使用场景对二维码的尺寸进行设计,以确定一个最佳的尺寸,方便用户快速完成扫码。其中,二维码的最佳尺寸是指在某个使用场景下,一个兼容最大部分角度和人群的、无需用户移动位置即可实现成功扫码的尺寸。举个例子,在停车场出口司机需要扫描二维码实现付款,通常情况下司机所在的位置都是在一个固定范围内,因而设计的最佳二维码的尺寸应当让绝大部分司机都能成功的完成扫描,而不需要移动位置。目前在二维码的设计过程中,其最佳尺寸都是通过手工试错的方式,经过多次尝试确定一个最佳的尺寸,在某个具体的使用场景下,合理的尺寸为多少,没有一种统一的科学的计算方法。此外,目前二维码显示设备在显示二维码给其他用户扫码时,二维码的尺寸也是固定的,没有办法根据二维码显示设备和扫码设备之间的位置关系去自动调整二维码的尺寸,不够智能。因而,有必要对二维码尺寸的确定方法和二维码的显示方法加以改进。
首先,本说明书实施例提供一种二维码尺寸确定方法,可以自动确定某个使用场景下的二维码的最佳尺寸。如图1所示,所述方法可包括以下步骤:
S102、获取用于确定二维码尺寸的参数集,所述参数集基于所述二维码的使用场景确定;
S104、根据所述参数集确定在所述使用场景所述二维码可被识别的至少一个尺寸;
S106、基于所述可被识别的至少一个尺寸确定所述二维码的目标尺寸,以生成所述目标尺寸的二维码。
本说明书实施例的目标尺寸可以是二维码在某个特定使用场景的一个最佳的尺寸,该尺寸的二维码为在所述特定使用场景下可以兼容大部分扫码角度和大部分人群的、无需用户移动位置即可实现成功扫码的尺寸。比如,在某些应用场景,二维码的位置确定后,用户扫码的位置也相对固定了,大多数用户都是在该位置范围内进行扫码的,因而二维码尺寸可以设计成用户在这个位置范围内扫码时,不需要移动即可以成功扫码的尺寸。
在某些实施例中,本说明书实施例的二维码尺寸确定方法可以用于一个专门计算二维码尺寸的设备,比如、手机、平板、笔记本电脑等电子设备,该设备可以只用于计算二维码的目标尺寸,不具备生成并显示二维码的功能。该设备上可以安装一个用于计算二维尺寸的APP,该APP可以根据获取的二维码在特定的使用场景下的各项参数,然后确定出二维码的目标尺寸,并反馈给用户。
当然,在某些实施例中,本说明书实施例的二维码尺寸确定方法可以用于既可以计算二维码目标尺寸,又可以生成并显示二维码的设备,比如手机、平板、笔记本电脑等各类电子设备,这些设备在将二维码显示给其他用户扫描时,可以预先确定二维码的目标尺寸,然后再根据确定的目标尺寸将二维码显示给其他用户,以供用户扫码。
二维码在设计时可以根据其具体的使用场景来设计,比如,用户在扫码的时候与二维码的距离、二维码是打印在纸张上供用户扫描,还是在显示屏上供用户扫描、扫描二维码的扫码摄像头的相关的硬件参数、二维码的信息密度等因素,都会对扫码结果造成影响,因而,在设计二维码的尺寸时,可以综合考虑这些因素,使得二维码尺寸的设计更加准确。所以,在确定二维码之前,可以先获取用于确定二维码尺寸的参数集,这些参数集的参数是根据二维码的具体使用场景来确定。然后根据参数集中的参数确定在该使用场景二维码可被识别的至少一个尺寸,并以这一个或多个尺寸作为基准去确定二维码的目标尺寸,其中,这一个或多个尺寸可以是在该使用场景二维码可被识别的最大尺寸、或者是最小尺寸、最大尺寸和最小尺寸的平均尺寸、或者是多个上述尺寸的集合。通过确定一个或多个尺寸作为基准尺寸,再来确定二维码的目标尺寸,可以自动的确定出某个使用场景下的较为合理的二维码尺寸。
在某些实施例中,参数集包含的参数可以是扫码摄像头与二维码的距离、二维码的信息密度、扫码摄像头的分辨率、扫码摄像头水平视角、扫码摄像头的焦距、扫码摄像头的像素尺寸、扫码识别区域的像素尺寸、二维码单个模块的可识别像素、二维码载体的材质以及二维码载体的颜色参数的一个或多个。
总体来说,用于确定二维码在某个特定使用场景下的目标尺寸涉及的参数包括以下四类:(1)环境因素,比如扫码摄像头与二维码的距离,扫码摄像头与二维码的距离是影响二维码尺寸比较重要的一个因素,扫码距离的远近很大程度决定二维码的尺寸该设计成多大比较合理;二维码与扫码摄像头的相对角度,比如扫码装置正对二维码时,尺寸小一些也比较容易识别,如果是斜着拍摄时,则尺寸大一些才比较容易识别。(2)扫码摄像头的硬件因素,比如扫码摄像头的分辨率、扫码摄像头水平视角、扫码摄像头 的焦距、扫码摄像头的像素尺寸、扫码识别区域的像素尺寸,扫码摄像头的硬件参数直接决定二维码在扫码摄像头成像的清晰程度,成像清晰度高,则尺寸小一些也可识别,成像清晰度低,则尺寸大一些才能被识别。(3)二维码自身的相关参数,不同版本的二维码其相关的参数也不一样,比如二维码的信息密度,二维码由很多的黑白模块构成,每个黑白模块都记录一定的信息,二维码的信息密度即二维码中黑白模块的展示密度;二维码单个模块的可识别像素,即二维码的每个模块至少包含多少个像素才可以被清楚识别。一般而言,二维码的单个模块可识别像素为3,当然,这个参数是可以根据实际场景自行设置的。针对不同扫码摄像头和不同展示密度的二维码,这个参数的数值也不一样。(4)二维码的载体,比如二维码的是在屏幕上供用户扫码还是打印在纸上,二维码载体的颜色,即二维码的背景色,二维码在有颜色的屏幕和白色屏幕上显示,其被识别时所需的尺寸也是不一样的。
当然,在确定二维码尺寸时,考虑的参数越全面,最后得到的目标尺寸也越准确,但是,这些参数中有些参数对二维码尺寸的影响较大,有些影响较小,因而可以根据实际应用场景灵活地去选择用于确定二维码尺寸的参数。
在获取用于确定二维码在某个使用场景下的目标尺寸的参数时,针对不同参数,其获取的方式也不一样,对于环境类的参数,比如扫码摄像头和二维码的距离,则可以是用户根据使用场景先确定好,然后再通过一个人机交互界面输入,当然,在某些使用场景,如果确定二维码尺寸的设备具备测距功能,也可以直接测量与扫码摄像头的距离。举个例子,确定二维码尺寸的设备也可以用来生成和显示二维码,在显示二维码之前,可以通过设备上的测距装置来测量与扫码摄像的距离。这个测距装置可以是激光测距装置,红外测距装置、超声波测距装置、双目摄像头、TOF(Time Of Flight)摄像头等。比如,在某些实施例中,如果该确定二维码的设备安装有双目摄像头,也可以通过双目摄像头采集的两张二维码的图像来计算距离,比如对两张图像进行特征点匹配,然后通过视差确定距离。对于扫码摄像头的硬件参数,由于各摄像头的硬件参数相差不大,因而可以根据普遍的扫码摄像头的情况事先设置好这些参数,然后存储,需要使用时则直接从相关存储路径中获取。当然为了确定的二维码尺寸可以精确一些,也可以通过给用户提供一个人机交互界面,以便用户根据实际使用场景输入这些参数。同样的,二维码的相关参数、载体的相关参数也可以通过用户输入或者预设设置好并存储在指定位置。
在某些实施例,用于确定二维码在某个使用场景下的目标尺寸的参数可以是通过用户输入,用户可以根据使用场景预先确定各项参数。再获取参数之前,可以先提供一 个人机交互界面,如图2所示,用户可以通过这个人机交互界面输入预先确定该使用场景下的参数,然后获取用户输入的参数,根据这些参数确定在所述使用场景所述二维码可被识别的至少一个尺寸。当然,用户可以输入参数集中的一部分参数,也可以输入全部参数,具体可以根据实际场景灵活设置哪些参数需要用户自行输入。当然,人机交互界面也可以事先展示某些参数的默认值,用户可以对默认值进行修改,如果用户不修改,则直接使用默认值。
为了更加准确的确定出目标尺寸,可以先确定一个多个二维码在使用场景下可被识别的尺寸,作为基准,以此来确定目标尺寸。在某些实施例中,所述至少一个尺寸可以是最大尺寸、最小尺寸、最大尺寸和最小尺寸的平均尺寸,也可以是最大尺寸、最小尺寸以及平均尺寸的集合。如图3所示,其中,最小尺寸为在该使用场景下,小于该尺寸二维码即无法被识别的临界尺寸,最大尺寸为在该使用场景下,大于该尺寸用户则需要后退才能让二维码完全落入扫码识别区域(即扫码时框选二维码的中心矩形)的临界尺寸。比如在确定最大尺寸后,可以在最大尺寸基础上适当减小一定的比例,作为目标尺寸,比如取最大尺寸的80%作为目标尺寸。也可以是确定最小尺寸后,在最小尺寸的基础上适当增大一定的比例,比如取最小尺寸的1.5倍作为目标尺寸。当然,也可以同时确定出最大尺寸、最小尺寸,然后根据这两个尺寸确定出目标尺寸,比如取两者平均值作为目标尺寸,或者随机去两者中间的一个尺寸作为目标尺寸。当然,目标尺寸的具体计算方法可以根据实际场景进行灵活设置。
在某些实施例中,该使用场景下的最大尺寸可以通过扫码摄像头与二维码的距离、扫码摄像头的像素尺寸、扫码摄像头的焦距以及扫码识别区域的像素尺寸来确定。最大尺寸的具体计算公式为:
Figure PCTCN2020113532-appb-000001
其中,D为该使用场景下二维码可被识别的最大尺寸、s为扫码识别区域的像素尺寸、ps为扫码摄像头的像素尺寸,L为扫码摄像头与二维码的距离,f为扫码摄像头的焦距。
在某些实施例中,该使用场景下的最小尺寸可以通过扫码摄像头与二维码的距离、扫码摄像头的像素尺寸、扫码摄像头的焦距以及二维码单个模块的可识别像素以及二维码的信息密度来确定。最小尺寸的具体计算公式为:
Figure PCTCN2020113532-appb-000002
其中,d为该使用场景下二维码可被识别的最小尺寸,px为二维码单个模块的可识别像素,ps为扫码摄像头的像素尺寸,m为二维码的信息密度,L为扫码摄像头与二 维码的距离,f为扫码摄像头的焦距。
以下以一个具体的实施例来介绍本说明书实施例提供的二维码尺寸确定方法。
为了方便设计人员在设计不同使用场景下的二维码的最佳的尺寸时,本本实施例提供了一种用于确定二维码尺寸的APP,该APP可以安装于手机、平板、笔记本电脑等电子设备中。
设计人员在确定某个特定场景下的用于确定二维码的各项参数时,可以通过该APP提供的一人机交互界面输入该使用场景下的各项参数,如图2所示。用户可以输入各项参数,然后该APP可以根据用户输入的参数确定该使用场景下的二维码的最佳尺寸。
以下举个例子具体介绍下计算过程如下:
假设该二维码是贴在某个墙面上的供用户扫码付款的二维码,如图4所示,该使用场景下的各项参数如下:
二维码中心到地面的高度:H=1700mm
手机相机到地面的高度:h=1600mm
手机相机到二维码的垂直距离:l=1000mm
手机相机的水平视角:α=65°(目前主流手机相机后置摄像头扫码视角60-70)
手机相机的图像分辨率:Cx,Cy,1920×1080
手机相机的像素尺寸:ps=2.8μm。
在某些场景下,拍摄的二维码图像分辨率较高,但是给到二维码识别算法进行识别的二维码图像分辨率低一些也可行,所以可以对图像进行裁剪,比如,假设相机传感器的像素为1200万,像素尺寸为1.2μm,裁剪后得到1080P的图像,其像素尺寸变成2.8μm。
根据下面这些参数,
二维码的版本号:m=25(不同版本号二维码的信息密度不一样)
二维码单个模块的成像像素:3(可以根据实际情况调整)
手机扫一扫扫码识别区域像素尺寸:766像素×766像素
二维码版本号:m=25
可以得到:手机到二维码的拍摄距离(即扫码距离):
Figure PCTCN2020113532-appb-000003
手机相机的焦距:
Figure PCTCN2020113532-appb-000004
二维码最小尺寸:
Figure PCTCN2020113532-appb-000005
当然,如果扫码摄像头从正面扫描,效果好些,如果从侧面扫,则二维码尺寸可以大一些。此时,可以计算二维码成像大小:
Figure PCTCN2020113532-appb-000006
像素,在二维码扫描识别区范围内,符合要求。
二维码最大尺寸:
Figure PCTCN2020113532-appb-000007
在确定二维码的最大尺寸和最小尺寸后,即可以在最大尺寸和最小尺寸之间确定一个最佳尺寸,比如取最大尺寸的80%作为最佳尺寸,也可以去两者平均值最为最佳尺寸。如图2所示,然后将确定的最大尺寸、最小尺寸和最优尺寸通过人机交互界面展示给用户。
此外,目前,显示二维码的设备生成并显示二维码给其他用户扫描时,二维码的尺寸都是固定的,因而扫码时需要扫码用户去调整自己的位置以便适应二维码的尺寸,实现成功扫码。显然,这是不够智能的,如果显示二维码的设备可以根据与扫码设备的距离自动调整二维码的尺寸,以便用户可以无需移动自身的位置也可成功扫码,那将会给用户带来很好的体验。因此,本说明书实施例还提供了一种二维码显示方法,具体的,所述方法如图5所示,包括以下步骤:
S502、获取用于确定二维码尺寸的参数集,所述参数集基于所述二维码的使用场景确定;
S504、根据所述参数集确定在所述使用场景所述二维码可被识别的至少一个尺寸;
S506、基于所述可被识别的至少一个尺寸确定所述二维码的目标尺寸;
S508、生成所述目标尺寸的二维码并显示。
本说明书实施例提供的二维码显示方法可以用于各种可以生成并显示二维码的设备,该设备在确定二维码使用场景下的目标尺寸后,可以生成目标尺寸的二维码并显示,以便用户扫码。
在某些实施例中,参数集包含的参数可以是扫码摄像头与二维码的距离、二维码 的信息密度、扫码摄像头的分辨率、扫码摄像头水平视角、扫码摄像头的焦距、扫码摄像头的像素尺寸、扫码识别区域的像素尺寸、二维码单个模块的可识别像素、二维码载体的材质以及二维码载体的颜色参数的一个或多个。
在某些实施例,用于确定二维码在某个使用场景下的目标尺寸的参数可以通过用户输入得到,用户可以根据使用场景预先确定各项参数。再获取参数之前,可以先提供一个人机交互界面,如图2所示,用户可以通过这个人机交互界面输入预先确定该使用场景下的参数,然后获取用户输入的参数,根据这些参数确定在所述使用场景所述二维码可被识别的至少一个尺寸。当然,用户可以输入参数集中的一部分参数,也可以输入全部参数,具体可以根据实际场景灵活设置哪些参数需要用户自行输入。当然,人机交互界面也可以事先展示某些参数的默认值,用户可以对默认值进行修改,如果用户不修改,则直接使用默认值。
为了更加准确的确定出目标尺寸,可以先确定一个多个二维码在使用场景下可被识别的尺寸,作为基准,以此来确定目标尺寸。在某些实施例中,所述至少一个尺寸可以是最大尺寸、最小尺寸、最大尺寸和最小尺寸的平均尺寸,也可以是最大尺寸和最小尺寸的集合。
在某些实施例中,该使用场景下的最大尺寸可以通过扫码摄像头与二维码的距离、扫码摄像头的像素尺寸、扫码摄像头的焦距以及扫码识别区域的像素尺寸来确定。最大尺寸的具体计算公式为:
Figure PCTCN2020113532-appb-000008
其中,D为该使用场景下二维码可被识别的最大尺寸、s为扫码识别区域的像素尺寸、ps为扫码摄像头的像素尺寸,L为扫码摄像头与二维码的距离,f为扫码摄像头的焦距。
在某些实施例中,该使用场景下的最小尺寸可以通过扫码摄像头与二维码的距离、扫码摄像头的像素尺寸、扫码摄像头的焦距以及二维码单个模块的可识别像素以及二维码的信息密度来确定。最小尺寸的具体计算公式为:
Figure PCTCN2020113532-appb-000009
其中,d为该使用场景下二维码可被识别的最小尺寸,px为二维码单个模块的可识别像素,ps为扫码摄像头的像素尺寸,m为二维码的信息密度,L为扫码摄像头与二维码的距离,f为扫码摄像头的焦距。
为了使得二维码的显示更加智能,在某些实施例,该二维码显示设备可以包括一个测距装置,这个测距装置可以是激光测距装置,红外测距装置、超声波测距装置、双 目摄像头、TOF(Time Of Flight)摄像头等。比如,在某些实施例中,如果该二维码显示设备安装有双目摄像头,也可以通过双目摄像头采集的两张二维码的图像来计算距离,比如对两张图像进行特征点匹配,然后通过视差确定距离。当接收到用户输入的显示二维码的指令时,可以通过测量扫码摄像头与二维码显示设备的距离,然后基于测量的距离和预先存储的其他参数确定二维码在该距离下可被识别的至少一个尺寸,并根据该尺寸确定二维码的目标尺寸,然后根据目标尺寸生成并显示二维码。这样扫码用户只需站在原地,无需调整位置就可以实现自动扫码。
以下以几个具体例子解释本说明书实施例提供的二维码显示方法,假设用户A需要给用户B付款,用户B通过手机B显示付款码给用户A的手机A扫码付款。假设用户B的手机B具有红外测距装置,用户B在点击手机B界面的二维码图标时,手机B的测距装置可以测量自身与对准它进行扫描的手机A的距离,然后根据测量的距离以及预先存储的其他参数,比如扫码摄像头的像素尺寸、扫码摄像头的焦距、扫码识别区域的像素尺寸、扫码摄像头的像素尺寸、扫码摄像头的焦距、二维码单个模块的可识别像素以及二维码的信息密度,计算该距离下二维码被扫码摄像头识别的最大尺寸和最小尺寸,然后取最大尺寸最小尺寸的平均值,作为目标尺寸,然后生成目标尺寸的二维码并且显示给用户A扫描。通过在生成二维码时,根据扫码用户与二维码显示设备的距离自动调整二维码尺寸的大小,生成扫码设备可识别的二维码,用户无需调整位置即可实现成功扫码,使得二维码扫描更加智能。
此外,在某些场景中,比如高速或停车场扫码收费场景,坐在车上的用户需要用手机展示二维码给扫码机具,但是有可能用户距离比较远,二维码比较小不方便扫码,且用户不方便移动。这时候可以利用用户的手机测量手机到扫码机具的距离,比如手机安装有双目摄像头,也可以通过双目摄像头采集的两张二维码的图像来计算距离,比如对两张图像进行特征点匹配,然后通过视差确定距离。确定手机二维码的最佳尺寸,然后生成最佳尺寸的二维码显示给扫描机具扫描,从而方便用户扫码,无需移动位置。对于扫码机具比较近的情况,有可能距离很近,二维码比较大,超过了扫码机具摄像头的拍摄视角,这种场景下可以通过测量手机到扫码机具的距离,然后根据距离计算二维码最佳尺寸,并生成最佳尺寸的二维码,生成最佳尺寸的二维码并显示给扫码机具。
以上实施例中的各种技术特征可以任意进行组合,只要特征之间的组合不存在冲突或矛盾,但是限于篇幅,未进行一一描述,因此上述实施方式中的各种技术特征的任意进行组合也属于本说明书公开的范围。
如图6所示,是本说明书一个实施例的一种用于确定二维码尺寸的装置,所述装置60可包括:
获取模块62,用于获取用于确定二维码尺寸的参数集,所述参数集基于所述二维码的使用场景确定;
第一计算模块64,用于根据所述参数集确定在所述使用场景所述二维码可被识别的至少一个尺寸;
第二计算模块66,用于基于所述可被识别的至少一个尺寸确定所述二维码的目标尺寸,以生成所述目标尺寸的二维码。
在一个实施例中,所述参数集包括以下参数中的一个或多个:扫码摄像头与二维码的距离、二维码的信息密度、扫码摄像头的分辨率、扫码摄像头水平视角、扫码摄像头的焦距、扫码摄像头的像素尺寸、扫码识别区域的像素尺寸、二维码单个模块的可识别像素、二维码载体的材质以及二维码载体的颜色。
在一个实施例中,所述可被识别的至少一个尺寸包括:
所述二维码可被扫码摄像头识别的最小尺寸;和/或
所述二维码可被扫码摄像头识别的最大尺寸。
在一个实施例中,确定所述最大尺寸的参数集包括:所述扫码摄像头与二维码的距离、扫码摄像头的像素尺寸、扫码摄像头的焦距以及扫码识别区域的像素尺寸。
在一个实施例中,确定所述最小尺寸的参数集包括:所述扫码摄像头与二维码的距离、扫码摄像头的像素尺寸、扫码摄像头的焦距、二维码的信息密度以及二维码单个模块的可识别像素。
在一个实施例中,在获取用于确定二维码尺寸的参数集之前,还包括:
提供一人机交互界面,获取用户的输入参数,以确定所述参数集中一个
如图7所示,是本说明书一个实施例的一种显示二维码的装置,所述装置70可包括:
获取模块72,用于获取用于确定二维码尺寸的参数集,所述参数集基于所述二维码的使用场景确定;
第一计算模块74,用于根据所述参数集确定在所述使用场景所述二维码可被识别的至少一个尺寸;
第二计算模块76,用于基于所述可被识别的至少一个尺寸确定所述二维码的目标 尺寸;
显示模块78,生成所述目标尺的二维码并显示。
在一个实施例中,所述预先设置的参数包括:扫码摄像头与二维码的距离、二维码的信息密度、扫码摄像头的分辨率、扫码摄像头水平视角、扫码摄像头的焦距、扫码摄像头的像素尺寸、扫码识别区域的像素尺寸、二维码单个模块的可识别像素、二维码载体的材质以及二维码载体的颜色中的一个或多个。
在一个实施例中,用于显示所述二维码的设备包括测距装置,所述扫码摄像头与二维码的距离通过所述测距装置获取。
在一个实施例中,在获取用于确定二维码尺寸的参数集之前,还包括:
提供一个人机交互界面,获取用户的输入参数,以确定所述参数集中一个或多个参数。
在一个实施例中,所述可被识别的至少一个尺寸包括:
所述二维码可被扫码摄像头识别的最小尺寸;和/或
所述二维码可被扫码摄像头识别的最大尺寸。
在一个实施例中,确定所述最大尺寸的参数集包括:所述扫码摄像头与二维码的距离、扫码摄像头的像素尺寸、扫码摄像头的焦距以及扫码识别区域的像素尺寸。
在一个实施例中,确定所述最小尺寸的参数集包括:所述扫码摄像头与二维码的距离、扫码摄像头的像素尺寸、扫码摄像头的焦距、二维码的信息密度以及二维码单个模块的可识别像素。
上述装置中各个模块的功能和作用的实现过程具体详情见上述方法中对应步骤的实现过程,在此不再赘述。
对于装置实施例而言,由于其基本对应于方法实施例,所以相关之处参见方法实施例的部分说明即可。以上所描述的装置实施例仅仅是示意性的,其中所述作为分离部件说明的模块可以是或者也可以不是物理上分开的,作为模块显示的部件可以是或者也可以不是物理模块,即可以位于一个地方,或者也可以分布到多个网络模块上。可以根据实际的需要选择其中的部分或者全部模块来实现本说明书方案的目的。本领域普通技术人员在不付出创造性劳动的情况下,即可以理解并实施。
本说明书装置的实施例可以应用在计算机设备上,例如服务器或智能终端。装置实施例可以通过软件实现,也可以通过硬件或者软硬件结合的方式实现。以软件实现为例,作为一个逻辑意义上的装置,是通过其所在文件处理的处理器将非易失性存储器中 对应的计算机程序指令读取到内存中运行形成的。从硬件层面而言,如图8所示,为本说明书装置所在计算机设备的一种硬件结构图,除了图8所示的处理器802、内存804、网络接口806、以及非易失性存储器808之外,实施例中装置所在的服务器或电子设备,通常根据该计算机设备的实际功能,还可以包括其他硬件,对此不再赘述。所述非易失性存储器808上存储有计算机程序,所述处理器802执行所述计算机程序时实现上述任一实施例中的方法。
相应地,本说明书实施例还提供一种计算机存储介质,所述存储介质中存储有程序,所述程序被处理器执行时实现上述任一实施例中的方法。
本说明书实施例可采用在一个或多个其中包含有程序代码的存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。计算机可用存储介质包括永久性和非永久性、可移动和非可移动媒体,可以由任何方法或技术来实现信息存储。信息可以是计算机可读指令、数据结构、程序的模块或其他数据。计算机的存储介质的例子包括但不限于:相变内存(PRAM)、静态随机存取存储器(SRAM)、动态随机存取存储器(DRAM)、其他类型的随机存取存储器(RAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、快闪记忆体或其他内存技术、只读光盘只读存储器(CD-ROM)、数字多功能光盘(DVD)或其他光学存储、磁盒式磁带,磁带磁磁盘存储或其他磁性存储设备或任何其他非传输介质,可用于存储可以被计算设备访问的信息。
本领域技术人员在考虑说明书及实践这里公开的说明书后,将容易想到本说明书实施例的其它实施方案。本说明书实施例旨在涵盖本说明书实施例的任何变型、用途或者适应性变化,这些变型、用途或者适应性变化遵循本说明书实施例的一般性原理并包括本说明书实施例未公开的本技术领域中的公知常识或惯用技术手段。说明书和实施例仅被视为示例性的,本说明书实施例的真正范围和精神由下面的权利要求指出。
应当理解的是,本说明书实施例并不局限于上面已经描述并在附图中示出的精确结构,并且可以在不脱离其范围进行各种修改和改变。本说明书实施例的范围仅由所附的权利要求来限制。
以上所述仅为本说明书实施例的较佳实施例而已,并不用以限制本说明书实施例,凡在本说明书实施例的精神和原则之内,所做的任何修改、等同替换、改进等,均应包含在本说明书实施例保护的范围之内。

Claims (13)

  1. 一种二维码尺寸确定方法,所述方法包括:
    获取用于确定二维码尺寸的参数集,所述参数集基于所述二维码的使用场景确定;
    根据所述参数集确定在所述使用场景所述二维码可被识别的至少一个尺寸;
    基于所述可被识别的至少一个尺寸确定所述二维码的目标尺寸,以生成所述目标尺寸的二维码。
  2. 根据权利要求1所述的二维码尺寸确定方法,所述参数集包括以下参数中的一个或多个:扫码摄像头与二维码的距离、二维码的信息密度、扫码摄像头的分辨率、扫码摄像头水平视角、扫码摄像头的焦距、扫码摄像头的像素尺寸、扫码识别区域的像素尺寸、二维码单个模块的可识别像素、二维码载体的材质以及二维码载体的颜色。
  3. 根据权利要求1所述的二维码尺寸确定方法,所述可被识别的至少一个尺寸包括:
    所述二维码可被扫码摄像头识别的最小尺寸;和/或
    所述二维码可被扫码摄像头识别的最大尺寸。
  4. 根据权利要求3所述的二维码尺寸确定方法,确定所述最大尺寸的参数集包括:所述扫码摄像头与二维码的距离、扫码摄像头的像素尺寸、扫码摄像头的焦距以及扫码识别区域的像素尺寸。
  5. 根据权利要求3所述的二维码尺寸确定方法,确定所述最小尺寸的参数集包括:所述扫码摄像头与二维码的距离、扫码摄像头的像素尺寸、扫码摄像头的焦距、二维码的信息密度以及二维码单个模块的可识别像素。
  6. 根据权利要求1所述的二维码尺寸确定方法,在获取用于确定二维码尺寸的参数集之前,还包括:
    提供一个人机交互界面,获取用户的输入参数,以确定所述参数集中一个或多个参数。
  7. 一种显示二维码的方法,所述方法包括:
    获取用于确定二维码尺寸的参数集,所述参数集基于所述二维码的使用场景确定;
    根据所述参数集确定在所述使用场景所述二维码可被识别的至少一个尺寸;
    基于所述可被识别的至少一个尺寸确定所述二维码的目标尺寸;
    生成所述目标尺寸的二维码并显示。
  8. 根据权7所述的显示二维码的方法,所述预先设置的参数包括:扫码摄像头与二维码的距离、二维码的信息密度、扫码摄像头的分辨率、扫码摄像头水平视角、扫码 摄像头的焦距、扫码摄像头的像素尺寸、扫码识别区域的像素尺寸、二维码单个模块的可识别像素、二维码载体的材质以及二维码载体的颜色中的一个或多个。
  9. 根据权8所述的显示二维码的方法,用于显示所述二维码的设备包括测距装置,所述扫码摄像头与二维码的距离通过所述测距装置获取。
  10. 根据权7所述的显示二维码的方法,在获取用于确定二维码尺寸的参数集之前,还包括:
    提供一个人机交互界面,获取用户的输入参数,以确定所述参数集中一个或多个参数。
  11. 一种用于确定二维码尺寸的装置,所述装置包括:
    获取模块,用于获取用于确定二维码尺寸的参数集,所述参数集基于所述二维码的使用场景确定;
    第一计算模块,用于根据所述参数集确定在所述使用场景所述二维码可被识别的至少一个尺寸;
    第二计算模块,用于基于所述可被识别的至少一个尺寸确定所述二维码的目标尺寸,以生成所述目标尺寸的二维码。
  12. 一种显示二维码的装置,所述装置包括:
    获取模块,用于获取用于确定二维码尺寸的参数集,所述参数集基于所述二维码的使用场景确定;
    第一计算模块,用于根据所述参数集确定在所述使用场景所述二维码可被识别的至少一个尺寸;
    第二计算模块,用于基于所述可被识别的至少一个尺寸确定所述二维码的目标尺寸,以生成所述目标尺寸的二维码;
    显示模块,用于基于所述目标尺寸生成所述二维码并显示。
  13. 一种计算机设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述程序时实现权利要求1至10中任意一项所述的方法。
PCT/CN2020/113532 2019-12-06 2020-09-04 二维码尺寸确定方法、二维码显示方法、装置及设备 WO2021109656A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201911242933.0A CN111126096A (zh) 2019-12-06 2019-12-06 二维码尺寸确定方法、二维码显示方法、装置及设备
CN201911242933.0 2019-12-06

Publications (1)

Publication Number Publication Date
WO2021109656A1 true WO2021109656A1 (zh) 2021-06-10

Family

ID=70497702

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/113532 WO2021109656A1 (zh) 2019-12-06 2020-09-04 二维码尺寸确定方法、二维码显示方法、装置及设备

Country Status (2)

Country Link
CN (1) CN111126096A (zh)
WO (1) WO2021109656A1 (zh)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111126096A (zh) * 2019-12-06 2020-05-08 支付宝(杭州)信息技术有限公司 二维码尺寸确定方法、二维码显示方法、装置及设备
CN112528181B (zh) * 2020-12-18 2024-04-16 平安银行股份有限公司 二维码管理方法、装置、计算机设备及可读存储介质
CN115802345A (zh) * 2022-06-30 2023-03-14 先临三维科技股份有限公司 设备接入无线网络的方法、装置及存储介质

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105138942A (zh) * 2015-08-26 2015-12-09 小米科技有限责任公司 二维码的显示方法及装置
CN106778434A (zh) * 2016-11-25 2017-05-31 广州视源电子科技股份有限公司 一种在显示区域上动态调整二维码的方法及其装置
US20170168559A1 (en) * 2014-03-26 2017-06-15 A9.Com, Inc. Advertisement relevance
CN109409164A (zh) * 2018-11-20 2019-03-01 普联技术有限公司 扫描图像显示调整方法、装置及电子设备
CN110197457A (zh) * 2019-05-07 2019-09-03 平安科技(深圳)有限公司 图案码位置调整方法、装置及计算机可读存储介质
CN111126096A (zh) * 2019-12-06 2020-05-08 支付宝(杭州)信息技术有限公司 二维码尺寸确定方法、二维码显示方法、装置及设备

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103400174B (zh) * 2013-07-30 2016-08-10 人民搜索网络股份公司 一种二维码的编码方法、解码方法及系统
CN105138939B (zh) * 2015-07-31 2017-11-17 海信集团有限公司 一种显示二维码的方法、装置及系统
CN109145676A (zh) * 2018-07-27 2019-01-04 华勤通讯技术有限公司 地铁闸机扫码识别方法及移动终端
CN109598162A (zh) * 2018-08-20 2019-04-09 天津字节跳动科技有限公司 识别二维码的方法、装置、终端设备及存储介质
CN110287744B (zh) * 2019-06-17 2020-12-25 珠海格力电器股份有限公司 一种识别二维码的方法及装置

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170168559A1 (en) * 2014-03-26 2017-06-15 A9.Com, Inc. Advertisement relevance
CN105138942A (zh) * 2015-08-26 2015-12-09 小米科技有限责任公司 二维码的显示方法及装置
CN106778434A (zh) * 2016-11-25 2017-05-31 广州视源电子科技股份有限公司 一种在显示区域上动态调整二维码的方法及其装置
CN109409164A (zh) * 2018-11-20 2019-03-01 普联技术有限公司 扫描图像显示调整方法、装置及电子设备
CN110197457A (zh) * 2019-05-07 2019-09-03 平安科技(深圳)有限公司 图案码位置调整方法、装置及计算机可读存储介质
CN111126096A (zh) * 2019-12-06 2020-05-08 支付宝(杭州)信息技术有限公司 二维码尺寸确定方法、二维码显示方法、装置及设备

Also Published As

Publication number Publication date
CN111126096A (zh) 2020-05-08

Similar Documents

Publication Publication Date Title
WO2021109656A1 (zh) 二维码尺寸确定方法、二维码显示方法、装置及设备
CN108764091B (zh) 活体检测方法及装置、电子设备和存储介质
US10334151B2 (en) Phase detection autofocus using subaperture images
US20150381965A1 (en) Systems and methods for depth map extraction using a hybrid algorithm
WO2015180659A1 (zh) 图像处理方法和图像处理装置
TW201709718A (zh) 在使用者裝置上顯示光場為基影像之方法及裝置,及對應之電腦程式產品
CN110400337B (zh) 图像处理方法、装置、电子设备及存储介质
US11120536B2 (en) Apparatus and method for determining image sharpness
EP3093822B1 (en) Displaying a target object imaged in a moving picture
US10586308B2 (en) Digital media environment for removal of obstructions in a digital image scene
WO2018210318A1 (zh) 图像虚化处理方法、装置、存储介质及电子设备
JP2019505148A (ja) パノラマ画像を生成する装置及び方法
US10957021B2 (en) Method for rendering a final image from initial images acquired by a camera array, corresponding device, computer program product and computer-readable carrier medium
US9100563B2 (en) Apparatus, method and computer-readable medium imaging through at least one aperture of each pixel of display panel
CN105678736B (zh) 具有孔径改变深度估计的图像处理系统及其操作方法
KR102423295B1 (ko) 심도 맵을 이용하여 객체를 합성하기 위한 장치 및 그에 관한 방법
WO2020087729A1 (zh) 一种图像处理方法及装置、电子设备、存储介质
US20230328400A1 (en) Auxiliary focusing method, apparatus, and system
WO2018076172A1 (zh) 一种图像显示方法及终端
US8983227B2 (en) Perspective correction using a reflection
JP2011009986A (ja) 身分証明書撮影システム、身分証明書撮影方法およびプログラム
CN112529006B (zh) 全景图片的检测方法、装置、终端及存储介质
CN113988957B (zh) 基于元素识别的图像自动化评分方法与评分系统
JP6175583B1 (ja) 画像処理装置、実寸法表示方法、及び実寸法表示処理プログラム
JP6598402B1 (ja) レシート等帳票画像自動取得・読取方法、プログラム、及び携帯端末装置

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: 20895588

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: 20895588

Country of ref document: EP

Kind code of ref document: A1