WO2019179233A1 - 一种二维码识读方法、装置及设备 - Google Patents

一种二维码识读方法、装置及设备 Download PDF

Info

Publication number
WO2019179233A1
WO2019179233A1 PCT/CN2019/072911 CN2019072911W WO2019179233A1 WO 2019179233 A1 WO2019179233 A1 WO 2019179233A1 CN 2019072911 W CN2019072911 W CN 2019072911W WO 2019179233 A1 WO2019179233 A1 WO 2019179233A1
Authority
WO
WIPO (PCT)
Prior art keywords
dimensional code
camera
frame image
focus
coordinate system
Prior art date
Application number
PCT/CN2019/072911
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 WO2019179233A1 publication Critical patent/WO2019179233A1/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/10544Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation by scanning of the records by radiation in the optical part of the electromagnetic spectrum
    • G06K7/10821Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation by scanning of the records by radiation in the optical part of the electromagnetic spectrum further details of bar or optical code scanning devices
    • 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/10544Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation by scanning of the records by radiation in the optical part of the electromagnetic spectrum
    • G06K7/10792Special measures in relation to the object to be scanned
    • G06K7/10801Multidistance reading
    • G06K7/10811Focalisation
    • 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/1439Methods for optical code recognition including a method step for retrieval of the optical code
    • G06K7/1456Methods for optical code recognition including a method step for retrieval of the optical code determining the orientation of the optical code with respect to the reader and correcting therefore
    • 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

Definitions

  • the present specification relates to the field of computer technology, and in particular, to a two-dimensional code reading method, device and device.
  • autofocus when a two-dimensional code is read by a camera-enabled device such as a mobile phone, autofocus can usually be realized, so that the image to be read is more clear, so that the two-dimensional code can be successfully read.
  • autofocus uses a central focus. If the QR code is not at the center of the image captured by the camera, or the plane where the QR code is located is at an angle to the plane of the camera lens, the use of center focus may cause the QR code to fail to read. The user needs to adjust the position and angle of the camera. Or distance, in order to be able to get a clear QR code image and be able to read it successfully.
  • the embodiment of the present specification provides a two-dimensional code reading method, device, and device for solving the following technical problems: a solution capable of quickly and accurately reading a two-dimensional code is required.
  • a location determining module if it is determined that the frame image includes a two-dimensional code, determining a two-dimensional code position in the frame image
  • the reading module attempts to read the two-dimensional code. If the two-dimensional code position cannot be successfully read, the focus position of the camera is adjusted according to the two-dimensional code position, so that the camera focuses on the area where the two-dimensional code is located.
  • At least one processor and,
  • the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to:
  • the readable and readable two-dimensional code can be accurately and quickly scanned, which can effectively improve the reading efficiency of the two-dimensional code.
  • FIG. 1 is a schematic diagram of a two-dimensional code reading system involved in the actual application scenario of the solution of the present specification
  • FIG. 2 is a schematic flowchart diagram of a two-dimensional code reading method according to an embodiment of the present disclosure
  • FIG. 3 is a schematic flowchart diagram of a method for determining a correspondence relationship according to an embodiment of the present disclosure
  • FIG. 4 is a flow chart for illustrating a mobile phone reading a two-dimensional code according to an embodiment of the present specification
  • FIG. 5 is a schematic diagram of a two-dimensional code reading device according to an embodiment of the present disclosure.
  • FIG. 1 is a schematic diagram of a two-dimensional code reading system involved in a practical application scenario.
  • Obtaining a frame image by using a camera for example, a camera of a camera, a camera of a mobile phone, etc.
  • identifying whether the frame image includes a two-dimensional code to be read if the frame image does not include a two-dimensional code.
  • the user adjusts the positional relationship between the camera and the two-dimensional code to be read (including: angle, distance, etc.).
  • the frame image includes a two-dimensional code
  • the position of the two-dimensional code is determined based on the position detection map of the two-dimensional code, and the two-dimensional code is read based on the two-dimensional code position and the frame image.
  • the focus position of the camera is adjusted based on the position of the two-dimensional code in the image of the previous frame until the reading is successful.
  • the adjustment of the focus position of the camera based on the position of the two-dimensional code to be read can effectively improve the success rate and efficiency of the two-dimensional code reading.
  • the camera referred to herein can be understood as a collection device capable of acquiring image information, including a mobile phone camera, a camera camera or a dedicated reading device.
  • the networked background QR code reading server may be needed to assist in reading the content in the two-dimensional code.
  • other planar images for example, barcodes, etc.
  • stereoscopic objects for example, stereoscopic two-dimensional codes
  • FIG. 2 is a schematic flowchart of a two-dimensional code reading method according to an embodiment of the present disclosure. The method may specifically include the following steps:
  • Step S202 Obtain a frame image by using a camera scan code.
  • the camera for acquiring a frame image may be, for example, a device having a two-dimensional code reading function such as a mobile phone or a dedicated device.
  • a QR code identification frame is set in the display screen of the mobile phone to guide the user to adjust the position of the camera so that the device can successfully focus and read.
  • the QR code because only the QR code in the QR code recognition box can be recognized by the camera.
  • the size of the frame image acquired based on the two-dimensional code recognition frame matches the two-dimensional code identification frame.
  • the two-dimensional code recognition frame mentioned here is an effective framing and recognition range of the camera.
  • the frame image includes a two-dimensional code, and the acquisition position of the frame image acquisition device may be improper, so that the acquired frame image does not include or contain a part of the two-dimensional code, thereby causing the recognition of the two-dimensional code to fail.
  • Step S204 If it is determined that the frame image includes a two-dimensional code, determine a two-dimensional code position in the frame image.
  • the frame image is a frame image acquired by the camera. During the actual recognition process, the camera can continuously adjust the distance to obtain a clear frame image. Therefore, the frame image is one frame in consecutive multi-frame images.
  • the two-dimensional code position is determined based on the frame image, and the frame image is acquired by the camera. According to the correspondence between the camera and the frame image, the camera (for example, the camera of the mobile phone) can be accurately adjusted based on the position of the two-dimensional code. Focus position.
  • Step S206 Try to read the two-dimensional code. If the two-dimensional code position cannot be successfully read, adjust the focus position of the camera according to the two-dimensional code position, so that the camera focuses on the area where the two-dimensional code is located.
  • the image containing the two-dimensional code is generally collected by the camera or the image capturing device, and the image information of the two-dimensional code is sent to the server, and the content in the two-dimensional code is read by the server.
  • the frame image is obtained by scanning the camera to determine whether the frame image contains a two-dimensional code, and if there is a two-dimensional code, the position of the two-dimensional code is determined; further, according to the frame image and the two-dimensional code position If you can't read the QR code, you need to continue to adjust the focus position of the camera according to the position of the QR code. You can accurately and quickly scan the code to get the readable two-dimensional code, which can effectively improve the reading efficiency of the QR code. .
  • the determining the location of the two-dimensional code in the frame image may specifically include: detecting a location detection map in the two-dimensional code; based on the three detected locations The probing map determines the position of the two-dimensional code in the frame image.
  • the two-dimensional code When the two-dimensional code is recognized based on the frame image, it may be identified based on a position detection map recognition in a two-dimensional code or a preset image recognition algorithm (for example, a machine learning model algorithm).
  • the position detection map of the two-dimensional code mentioned here is three graphics for positioning in the two-dimensional code.
  • the user can also select other features of the two-dimensional code for the identification of the two-dimensional code according to actual needs.
  • the recognition result mentioned here includes two results of identifying or not recognizing the two-dimensional code in the frame image.
  • the reason that the two-dimensional code in the frame image is not recognized includes: the two-dimensional code is not included in the frame image, or a part of the two-dimensional code is included, or the two-dimensional code image is relatively blurred to cause unrecognizable.
  • the position of the two-dimensional code is further determined.
  • the upper left corner of the frame image may be set as a coordinate origin, and the position of the two-dimensional code in the frame image may be further determined.
  • the two-dimensional code position may include: a position coordinate of the two-dimensional code, a two-dimensional code size, and the like. It should be noted that the position coordinates and the two-dimensional code size of the two-dimensional code herein are determined based on the frame image. For example, suppose that based on the top left corner of the frame image as the coordinate origin, the horizontal and vertical coordinates are set, the center point of the two-dimensional code is taken as the two-dimensional code coordinate, and the two-dimensional code size of the two-dimensional code is determined based on the horizontal and vertical coordinates, so that the camera can More accurate focus on the QR code and quick reading.
  • the focus parameter is adjusted based on the two-dimensional code identification frame; as described above, the frame image and the size of the two-dimensional code recognition frame are matched, and therefore, the frame image is determined based on the frame image.
  • the position information can be sent to the camera to adjust the focus parameter of the two-dimensional code recognition frame.
  • the adjusting the focus position of the camera to focus the camera to the area where the two-dimensional code is located may specifically include: according to a frame image coordinate system and a camera coordinate system.
  • the camera adjusts the focus parameter, which may include focus parameters such as the focus point or the size of the focus area; of course, some devices may also automatically adjust the angle of the image acquisition, or the distance between the device and the object distance to be read. .
  • the two-dimensional code position is determined based on the frame image. Therefore, to determine the focus parameter, it is necessary to convert the two-dimensional code position into a corresponding focus parameter based on the frame image coordinate system. In practical applications, since the image acquisition frequency is about 30 ms, and during the reading process, the user can keep the position of the handheld camera within a few seconds. Therefore, the position of the two-dimensional code can be determined based on the frame image and used as a basis for adjusting the focus parameter. .
  • Adjusting the focus position of the camera can be to adjust the distance between the camera for image acquisition. For a better camera, it can also adjust the angle of image acquisition. For example, the camera lens in the mobile phone can adjust the distance and adjust the angle.
  • the focus range In order to obtain a clear image of the two-dimensional code, it is necessary to adjust the focus range according to the size of the two-dimensional code.
  • the adjustment of the focus range can be based on multi-point focus, which ensures the best definition of the image within this range.
  • the next frame image is continuously acquired, and the content information of the two-dimensional code contained therein is read.
  • FIG. 3 is a schematic flowchart of a method for determining a correspondence relationship provided in real time in the present specification.
  • the correspondence between the frame image coordinate system and the camera coordinate system is obtained as follows: Step S302: According to a frame image resolution, establishing a frame image coordinate system; step S304: establishing a camera coordinate system according to the camera resolution; step S306: determining the frame image coordinate system according to a proportional relationship between the frame image resolution and the camera resolution The correspondence between camera coordinate systems.
  • the frame image coordinate system referred to herein can be understood as a coordinate system established based on the resolution of the frame image;
  • the camera coordinate system can be understood as the resolution based on the effective frame of the camera (for example, the two-dimensional code recognition frame).
  • the established coordinate system can be understood as the coordinate system established based on the resolution of the frame image;
  • the frame image and the camera respectively have corresponding resolutions.
  • a corresponding coordinate system needs to be established for the frame image and the camera respectively.
  • the frame image coordinate system can be two-dimensional.
  • the code position is converted into a focus parameter so that the camera can accurately adjust the focus position so that the camera focuses on the area where the two-dimensional code is located, and obtains a clear two-dimensional code.
  • step numbers mentioned herein are not limited to the order in which the steps are executed.
  • step S302 and step S304 can be performed simultaneously.
  • the focusing of the camera to the area where the two-dimensional code is located may specifically include: the camera focusing on a two-dimensional code boundary determined based on a position detection map in the two-dimensional code. At least one coordinate point in the enclosed area.
  • the area where the two-dimensional code is located is generally a rectangular area determined based on the position detection map in the two-dimensional code, and the area contains all the images of the two-dimensional code.
  • focus can be performed on at least one point, generally focusing on the center point of the two-dimensional code, or focusing on the center point of the two-dimensional code and the four vertices of the rectangle; , the entire QR code is used as the focus area.
  • the method further includes: if it is determined that the frame image does not include the two-dimensional code, issuing a prompt message, prompting the user to manually adjust the two-dimensional code identification frame and the two-dimensional code The positional relationship.
  • the two-dimensional code is not clear enough or the two-dimensional code is not in the frame image, or the two-dimensional code portion is in the frame image.
  • the prompt information can be displayed in the form of a pop-up window or prompted by sound so that the user can adjust the position of the camera.
  • the position to be adjusted here includes the distance, angle, and the like between the camera and the two-dimensional code, so that the two-dimensional code can enter the image capturing range of the camera, and a clear image can be obtained.
  • FIG. 4 is a flow chart for illustrating the use of a mobile phone to read a two-dimensional code.
  • the code position module For the frame image acquired by using the mobile phone (mobile phone with camera function), the code position module is used to pre-determine whether the frame image has a two-dimensional code, and if present, the position of the two-dimensional code is given, and then the position of the two-dimensional code is given.
  • the information is sent to the code reading module together with the original frame image for reading the information of the two-dimensional code.
  • the two-dimensional code position information is sent to the position conversion module.
  • the mobile phone Converting the QR code position information to the focus position (including the focus point and focus range) of the camera carried by the mobile phone, the mobile phone automatically changes the focus parameter of the camera according to the information, so that the camera can accurately focus on the position area of the two-dimensional code, thereby making the camera
  • the position of the QR code after focusing is clearer than other areas, which is more conducive to reading the reading operation of the module.
  • FIG. 5 is a two-dimensional code reading device according to an embodiment of the present disclosure, and the device mainly includes:
  • the obtaining module 501 is configured to obtain a frame image by using a camera scan code
  • a location determining module 502 if it is determined that the frame image includes a two-dimensional code, determining a two-dimensional code position in the frame image;
  • the reading module 503 attempts to read the two-dimensional code. If the reading is not successful, the focus position of the camera is adjusted according to the two-dimensional code position, so that the camera focuses on the area where the two-dimensional code is located. .
  • the location determining module 502 detects a location detection map in the two-dimensional code
  • a two-dimensional code position in the frame image based on the three detected position detection maps.
  • the reading module 503 converts the two-dimensional code position according to the correspondence between the frame image coordinate system and the camera coordinate system to obtain a focus parameter, wherein the focus parameter includes at least one of a focus area size and a focus point. ;
  • the method further includes: a correspondence determining module 504, establishing a frame image coordinate system according to the frame image resolution;
  • Corresponding relationship between the frame image coordinate system and the camera coordinate system is determined according to a proportional relationship between the frame image resolution and the camera resolution.
  • the location determining module 502 the location determining module, the camera is focused to the area where the two-dimensional code is located, and specifically includes:
  • the camera focuses on at least one coordinate point in a region enclosed by a two-dimensional code boundary determined based on a position detection map in the two-dimensional code.
  • a prompt message is sent to prompt the user to manually adjust the positional relationship between the camera and the two-dimensional code.
  • an electronic device including:
  • At least one processor and,
  • the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to:
  • the device, the electronic device, the non-volatile computer storage medium and the method provided by the embodiments of the present specification are corresponding, and therefore, the device, the electronic device, the non-volatile computer storage medium also have a beneficial technical effect similar to the corresponding method,
  • the beneficial technical effects of the method have been described in detail above, and therefore, the beneficial technical effects of the corresponding device, the electronic device, and the non-volatile computer storage medium will not be described herein.
  • PLD Programmable Logic Device
  • FPGA Field Programmable Gate Array
  • HDL Hardware Description Language
  • the controller can be implemented in any suitable manner, for example, the controller can take the form of, for example, a microprocessor or processor and computer readable storage storing computer readable program code (eg, software or firmware) executable by the (micro)processor.
  • computer readable program code eg, software or firmware
  • examples of controllers include, but are not limited to, the following microcontrollers: ARC 625D, Atmel AT91SAM The Microchip PIC18F26K20 and the Silicone Labs C8051F320, the memory controller can also be implemented as part of the memory's control logic.
  • the controller can be logically programmed by means of logic gates, switches, ASICs, programmable logic controllers, and embedding.
  • Such a controller can therefore be considered a hardware component, and the means for implementing various functions included therein can also be considered as a structure within the hardware component.
  • a device for implementing various functions can be considered as a software module that can be both a method of implementation and a structure within a hardware component.
  • the system, device, module or unit illustrated in the above embodiments may be implemented by a computer chip or an entity, or by a product having a certain function.
  • a typical implementation device is a computer.
  • the computer can be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or A combination of any of these devices.
  • embodiments of the specification can be provided as a method, system, or computer program product.
  • embodiments of the present specification can take the form of an entirely hardware embodiment, an entirely software embodiment, or a combination of software and hardware.
  • embodiments of the present specification can take the form of a computer program product embodied on one or more computer usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) including computer usable program code.
  • the computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing device to operate in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture comprising the instruction device.
  • the apparatus implements the functions specified in one or more blocks of a flow or a flow and/or block diagram of the flowchart.
  • These computer program instructions can also be loaded onto a computer or other programmable data processing device such that a series of operational steps are performed on a computer or other programmable device to produce computer-implemented processing for execution on a computer or other programmable device.
  • the instructions provide steps for implementing the functions specified in one or more of the flow or in a block or blocks of a flow diagram.
  • a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and computer readable storage media.
  • processors CPUs
  • input/output interfaces network interfaces
  • computer readable storage media computer readable storage media
  • Computer readable storage media including both permanent and non-persistent, removable and non-removable media may be implemented by any method or technology.
  • the information can be computer readable instructions, data structures, modules of programs, or other data.
  • Examples of computer readable 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
  • 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
  • Computer-readable storage media does not include temporary storage computer readable media, such as modulated data signals and carrier waves.
  • program modules include routines, programs, objects, components, data structures, and the like that perform particular tasks or implement particular abstract data types. It is also possible to practice the description in a distributed computing environment in which tasks are performed by remote processing devices that are connected through a communication network. In a distributed computing environment, program modules can be located in both local and remote computer storage media including storage devices.

Landscapes

  • Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Electromagnetism (AREA)
  • Artificial Intelligence (AREA)
  • Toxicology (AREA)
  • General Health & Medical Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Quality & Reliability (AREA)
  • Telephone Function (AREA)
  • Studio Devices (AREA)

Abstract

一种二维码识读方法、装置以及设备。所述方法包括:利用摄像头扫码得到帧图像,基于该帧图像识别其中是否包含二维码,若包含二维码,确定该二维码的二维码位置,并尝试读取二维码;若读取失败,则基于二维码位置调整摄像头的对焦位置,对焦到二维码所在区域,以便能够获取清晰的包含二维码的图像,成功读取二维码中的信息。

Description

一种二维码识读方法、装置及设备
相关申请的交叉引用
本专利申请要求于2018年3月23日提交的、申请号为201810247331.3、发明名称为“一种二维码识读方法、装置及设备”的中国专利申请的优先权,该申请的全文以引用的方式并入本文中。
技术领域
本说明书涉及计算机技术领域,尤其涉及一种二维码识读方法、装置以及设备。
背景技术
随着扫码识读技术的推广,在越来越多的场景中得到应用,例如,利用手机携带的相机识读二维码,以便进行账单支付、订餐、获取联系方式等等操作。
现有技术中,利用手机等具有相机功能的设备识读二维码时,通常可以实现自动对焦,使得待识读的图像更加清晰,以便能够成功读取二维码。一般来说,自动对焦采用中心对焦的方式。如果二维码不在相机获取的图像的中心位置,或者二维码所在平面与相机镜头所在平面呈一定角度时,采用中心对焦可能会导致二维码读取失败,需要用户调整相机的位置、角度或者距离,以便能够获取清晰的二维码图像,并能够成功读取。
基于现有技术,需要能够快速、准确读取二维码的方案。
发明内容
本说明书实施例提供一种二维码识读方法、装置以及设备,用于解决以下技术问题:需要能够快速、准确读取二维码的方案。
为解决上述技术问题,本说明书实施例是这样实现的:
本说明书实施例提供的一种二维码识读方法,包括:
利用摄像头扫码得到帧图像;
若确定所述帧图像中包含二维码,则确定所述帧图像中的二维码位置;
尝试识读所述二维码,若无法成功识读则根据所述二维码位置,调整所述摄像头的 对焦位置,以使所述摄像头对焦至所述二维码所在区域。
本说明书实施例提供的一种二维码识读装置,包括:
获取模块,利用摄像头扫码得到帧图像;
位置确定模块,若确定所述帧图像中包含二维码,则确定所述帧图像中的二维码位置;
识读模块,尝试识读所述二维码,若无法成功识读则根据所述二维码位置,调整所述摄像头的对焦位置,以使所述摄像头对焦至所述二维码所在区域。
本说明书实施例提供的一种电子设备,包括:
至少一个处理器;以及,
与所述至少一个处理器通信连接的存储器;其中,
所述存储器存储有可被所述至少一个处理器执行的指令,所述指令被所述至少一个处理器执行,以使所述至少一个处理器能够:
利用摄像头扫码得到帧图像;
若确定所述帧图像中包含二维码,则确定所述帧图像中的二维码位置;
尝试识读所述二维码,若无法成功识读则根据所述二维码位置,调整所述摄像头的对焦位置,以使所述摄像头对焦至所述二维码所在区域。
本说明书实施例采用的上述至少一个技术方案能够达到以下有益效果:
通过摄像头扫码得到帧图像,判断帧图像中是否包含有二维码,若包含有二维码则确定二维码的位置;进一步地,根据帧图像和二维码位置识读二维码,若无法成功识读,则根据二维码位置继续调整摄像头的对焦位置,以便摄像头能够对焦至二维码所在区域。基于本方案,能够准确、快速扫码得到可识读的二维码,可以有效提高二维码的识读效率。
附图说明
为了更清楚地说明本说明书实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本说明书中记载的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的 前提下,还可以根据这些附图获得其他的附图。
图1为本说明书的方案在实际应用场景下涉及的二维码识读系统的示意图;
图2为本说明书实施例提供的一种二维码识读方法的流程示意图;
图3为本说明书实施例提供的对应关系确定方法的流程示意图;
图4为本说明书实施例提供的举例说明手机识读二维码的流程图;
图5为本说明书实施例提供的一种二维码识读装置的示意图。
具体实施方式
为了使本技术领域的人员更好地理解本说明书中的技术方案,下面将结合本说明书实施例中的附图,对本说明书实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本说明书实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都应当属于本申请保护的范围。
图1为本说明书的方案在一种实际应用场景下涉及的二维码识读系统的示意图。利用摄像头(例如,相机的摄像头、手机的摄像头等)获取帧图像;进一步地,识别该帧图像中是否包含待识读的二维码;若该帧图像中未包含二维码,则可以提示用户调整摄像头与待识读二维码的位置关系(包括:角度、距离等)。若该帧图像中包含二维码,则基于二维码的位置探测图确定二维码的位置,并基于二维码位置和帧图像对该二维码进行识读,若读取未成功,进一步地,基于前一帧图像中二维码的位置调整摄像头的对焦位置,直到读取成功。基于待识读二维码位置,进行摄像头的对焦位置的调整,能够有效提高二维码识读的成功率和效率。
这里所说的摄像头可以理解为能够获取图像信息的采集设备,包括手机摄像头、相机摄像头或者专用的读码设备等。一般来说,通过摄像头识读二维码内容时,可能需要联网后台二维码识读服务器,用来辅助识读出二维码中的内容。基于上述方法,除了可以用来提高二维码的识读成功率,也可以基于此对其他平面图像(例如,条形码等)或者立体物体(例如,立体二维码)进行识读。
基于上述场景,下面对本说明书的方案进行详细说明。
图2为本说明书实施例提供的一种二维码识读方法的流程示意图,该方法具体可以 包括以下步骤:
步骤S202:利用摄像头扫码得到帧图像。
用于获取帧图像的摄像头,比如,可以是手机或专用设备等具有二维码识读功能的设备。
一般情况下,通过摄像头(例如,手机的摄像头)识别二维码时,会在手机的显示屏幕中设定一个二维码识别框,以便引导用户调整摄像头的位置使得该设备能够成功对焦并读取二维码,因为只有在二维码识别框中的二维码才可能被摄像头识别。在实际应用中,基于二维码识别框获取的帧图像的大小与二维码识别框相匹配。这里所说的二维码识别框是摄像头有效的取景和识别范围。
帧图像中包含二维码,也可能出现因帧图像的获取设备拍摄位置不当,导致获取的帧图像中不包含或者包含部分二维码,从而导致对二维码的识读失败。
步骤S204:若确定所述帧图像中包含二维码,则确定所述帧图像中的二维码位置。
帧图像是通过摄像头获取的一帧图像,在实际识别过程中,该摄像头可以通过持续调整相距以便获得清晰的帧图像,因此,该帧图像是在连续多帧图像中的一帧。
二维码位置是基于帧图像确定的,并且该帧图像是利用摄像头采集到的,根据摄像头与帧图像的对应关系,可以使得摄像头(例如,手机的摄像头)基于二维码位置准确地调整其对焦点位置。
步骤S206:尝试识读所述二维码,若无法成功识读则根据所述二维码位置,调整所述摄像头的对焦位置,以使所述摄像头对焦至所述二维码所在区域。
在实际应用中,确定帧图像中的二维码位置之后,首先尝试识读该二维码,若成功识读,则不需要摄像头再调整对焦位置。若无法成功识读,需要将当前的二维码位置信息转换为对焦参数,以便摄像头可以根据对焦参数准确地调整对焦位置。
识读所述二维码时,一般是由摄像头或者图像采集设备采集包含二维码的图像,将该二维码图像信息发送给服务器,由服务器识读出二维码中的内容。
通过上述实施例可知,通过摄像头扫码得到帧图像,判断帧图像中是否包含有二维码,若有二维码则确定二维码的位置;进一步地,根据帧图像和二维码位置识读二维码,若无法成功识读,则需要根据二维码位置继续调整摄像头的对焦位置,能够准确、快速扫码得到可识读的二维码,可以有效提高二维码的识读效率。
在本说明书一个或者多个实施例中,所述确定所述帧图像中的二维码位置,具体可以包括:检测所述二维码中的位置探测图;基于检测到的三个所述位置探测图,确定二维码在所述帧图像中的位置。
在基于帧图像识别二维码时,可以采用基于二维码中的位置探测图识别或者预设图像识别算法(例如,机器学习模型算法)识别。其中,这里所说的二维码的位置探测图是二维码中的三个用于定位的图形。此外,用户也可以根据实际需求,选择二维码的其他特征用于对二维码的识别。
这里所说的识别结果,包括识别到或未识别到帧图像中的二维码两种结果。其中,未识别到帧图像中二维码的原因包括:帧图像中未包含二维码,或者包含部分二维码,或者二维码图像比较模糊导致无法识别等。
若该帧图像中包含二维码,则进一步确定该二维码的位置,例如,可以设定帧图像的左上角为坐标原点,进一步确定二维码在帧图像中的位置。
二维码位置可以包括:二维码的位置坐标和二维码尺寸等。需要说明的是,这里的二维码的位置坐标以及二维码尺寸均是基于帧图像确定的。例如,假设基于帧图像左上角顶点为坐标原点,设定横纵坐标,将二维码的中心点作为二维码坐标,并基于横纵坐标确定二维码的二维码尺寸,以便摄像头可以更加准确的对二维码进行对焦并快速识读。
进一步地,在确定二维码的位置之后,基于二维码识别框调整对焦参数;如前文所述可知,帧图像与二维码识别框的尺寸是相匹配的,因此,基于帧图像确定二维码的位置之后,可以将该位置信息发送给摄像头调整二维码识别框的对焦参数。
在本说明书一个或者多个实施例中,所述调整所述摄像头的对焦位置,以使所述摄像头对焦至所述二维码所在区域,具体可以包括:根据帧图像坐标系与摄像头坐标系的对应关系,转换所述二维码位置得到对焦参数,其中,所述对焦参数包括对焦区域大小、对焦点中至少一个;根据所述对焦参数调整摄像头的对焦位置,以使所述摄像头对焦至所述二维码所在区域。
需要说明的是,摄像头调整对焦参数,可以包括对焦点或者对焦区域大小等对焦参数;当然,有的设备也可以自动调整图像采集的角度、或设备与待识读二维码的物距等参数。
由前述实施例可知,二维码位置是基于帧图像确定的,因此,若要确定对焦参数, 需要基于帧图像坐标系将二维码位置转换为对应的对焦参数。在实际应用中,由于图像采集频率大约30ms,并且在识读过程中,用户可以手持摄像头在数秒内保持位置不变,因此,可以基于帧图像确定二维码位置,并作为对焦参数调整的依据。
摄像头调整对焦位置可以是调整该摄像头进行图像采集时的相距,对于更好的摄像头也可以是调整图像采集的角度等,例如,手机中的相机镜头既可以调整相距,又可以调整角度。
为了能够获得清晰的二维码的图像,需要根据二维码尺寸调整对焦范围。对焦范围的调整,可以是基于多点对焦实现的,可以确保该范围内图像的清晰度最佳。
在完成对焦点和对焦范围的调整之后,继续采集下一帧图像,识读其中包含的二维码的内容信息。
在本说明书一个或者多个实施例中,如图3为本说明书实时提供的对应关系确定方法的流程示意图,所述帧图像坐标系与摄像头坐标系的对应关系按照如下方式得到:步骤S302:根据帧图像分辨率,建立帧图像坐标系;步骤S304:根据摄像头分辨率,建立摄像头坐标系;步骤S306:根据帧图像分辨率和摄像头分辨率的比例关系,确定所述帧图像坐标系与所述摄像头坐标系的对应关系。
需要说明的是,这里所说的帧图像坐标系可以理解为基于帧图像的分辨率建立的坐标系;摄像头坐标系可以理解为基于摄像头有效取景框(例如,二维码识别框)的分辨率建立的坐标系。
在实际应用中,帧图像和摄像头分别具有对应的分辨率,为了能够建立帧图像中各像素点与摄像头采集图像时像素点的对应关系,需要针对帧图像和摄像头分别建立对应的坐标系。
在基于坐标系之间对应关系(例如,帧图像坐标系与摄像头坐标系之间的比例关系是:横坐标为100:1,纵坐标为200:1),可以将帧图像坐标系中二维码位置转换为对焦参数,以便可以使得摄像头准确的调整对焦位置,以使所述摄像头对焦至所述二维码所在区域,获取清晰的二维码。
需要说明的是,这里所说的步骤序号并不是对步骤执行顺序的限制,例如,步骤S302和步骤S304可以同时执行。
在本说明书一个或者多个实施例中,所述摄像头对焦至所述二维码所在区域,具体可以包括:所述摄像头对焦至基于所述二维码中的位置探测图确定的二维码边界包围的 区域中的至少一个坐标点。
这里所说的二维码所在区域,一般是基于二维码中的位置探测图确定的矩形区域,该区域中包含二维码的所有图像。在摄像头对焦过程中,可以针对至少一个点进行对焦,一般是对二维码的中心点进行对焦,或者对二维码的中心点以及矩形的四个顶点进行对焦;也可以采用区域对焦,比如,将整个二维码作为对焦区域。
在本说明书一个或者多个实施例中,所述方法还包括:若确定所述帧图像中不包含二维码,则发出提示信息,提示用户手动调整所述二维码识别框与二维码的位置关系。
在实际应用中,识别失败的原因可能有多种,例如,二维码不够清晰或者二维码没有在帧图像中,或者二维码部分在帧图像中。提示信息可以通过弹窗的形式显示,或者通过声音进行提示,以便用户可以调整摄像头的位置。这里所需要调整的位置包括:摄像头与二维码之间的距离、角度等,以便使得二维码可以进入摄像头的图像采集范围中,并且可以获得清晰的图像。
为了便于理解上述二维码识读方法,下面结合图4进行举例说明,图4为本说明书实施例提供的举例说明利用手机识读二维码的流程图。
针对利用手机(具有相机功能的手机)获取到的帧图像,利用码位置模块,预先判断帧图像是否存在二维码,如果存在则给出二维码的位置,然后再将二维码的位置信息和原始的帧图像一同交给码读取模块进行二维码的信息读取,当读取模块无法读取该二维码的内容时,则将二维码位置信息发送给位置转换模块,将二维码位置信息转换为手机所携带相机的对焦位置(包括对焦点和对焦范围),手机根据这些信息自动改变相机的对焦参数,从而使得相机能够准确对焦二维码位置区域,从而使得相机对焦后二维码位置比其他区域更加清晰,更利于读取模块的读取操作。
基于同样的思路,本说明书实施例提供了一种二维码识读装置,如图5为本说明书实施例提供的一种二维码识读装置,该装置主要包括:
获取模块501,利用摄像头扫码得到帧图像;
位置确定模块502,若确定所述帧图像中包含二维码,则确定所述帧图像中的二维码位置;
识读模块503,尝试识读所述二维码,若无法成功识读则根据所述二维码位置,调整所述摄像头的对焦位置,以使所述摄像头对焦至所述二维码所在区域。
进一步地,所述位置确定模块502,检测所述二维码中的位置探测图;
基于检测到的三个所述位置探测图,所述帧图像中的二维码位置。
进一步地,所述识读模块503,根据帧图像坐标系与摄像头坐标系的对应关系,转换所述二维码位置得到对焦参数,其中,所述对焦参数包括对焦区域大小、对焦点中至少一个;
根据所述对焦参数调整所述摄像头的对焦位置,以使所述摄像头对焦至所述二维码所在区域。
进一步地,还包括:对应关系确定模块504,根据帧图像分辨率,建立帧图像坐标系;
根据摄像头分辨率,建立摄像头坐标系;
根据帧图像分辨率和摄像头分辨率的比例关系,确定所述帧图像坐标系与所述摄像头坐标系的对应关系。
进一步地,所述位置确定模块502,所述位置确定模块,所述摄像头对焦至所述二维码所在区域,具体包括:
所述摄像头对焦至基于所述二维码中的位置探测图确定的二维码边界包围的区域中的至少一个坐标点。
进一步地,若确定所述帧图像中不包含二维码,则发出提示信息,提示用户手动调整所述摄像头与所述二维码的位置关系。
基于同样的思路,本说明书实施例还提供一种电子设备,包括:
至少一个处理器;以及,
与所述至少一个处理器通信连接的存储器;其中,
所述存储器存储有可被所述至少一个处理器执行的指令,所述指令被所述至少一个处理器执行,以使所述至少一个处理器能够:
利用摄像头扫码得到帧图像;
若确定所述帧图像中包含二维码,则确定所述帧图像中的二维码位置;
尝试识读所述二维码,若无法成功识读则根据所述二维码位置,调整所述摄像头的对焦位置,以使所述摄像头对焦至所述二维码所在区域。
上述对本说明书特定实施例进行了描述。其它实施例在所附权利要求书的范围内。在一些情况下,在权利要求书中记载的动作或步骤可以按照不同于实施例中的顺序来执行并且仍然可以实现期望的结果。另外,在附图中描绘的过程不一定要求示出的特定顺序或者连续顺序才能实现期望的结果。在某些实施方式中,多任务处理和并行处理也是可以的或者可能是有利的。
本说明书中的各个实施例均采用递进的方式描述,各个实施例之间相同相似的部分互相参见即可,每个实施例重点说明的都是与其他实施例的不同之处。尤其,对于装置、电子设备、非易失性计算机存储介质实施例而言,由于其基本相似于方法实施例,所以描述的比较简单,相关之处参见方法实施例的部分说明即可。
本说明书实施例提供的装置、电子设备、非易失性计算机存储介质与方法是对应的,因此,装置、电子设备、非易失性计算机存储介质也具有与对应方法类似的有益技术效果,由于上面已经对方法的有益技术效果进行了详细说明,因此,这里不再赘述对应装置、电子设备、非易失性计算机存储介质的有益技术效果。
在20世纪90年代,对于一个技术的改进可以很明显地区分是硬件上的改进(例如,对二极管、晶体管、开关等电路结构的改进)还是软件上的改进(对于方法流程的改进)。然而,随着技术的发展,当今的很多方法流程的改进已经可以视为硬件电路结构的直接改进。设计人员几乎都通过将改进的方法流程编程到硬件电路中来得到相应的硬件电路结构。因此,不能说一个方法流程的改进就不能用硬件实体模块来实现。例如,可编程逻辑器件(Programmable Logic Device,PLD)(例如现场可编程门阵列(Field Programmable Gate Array,FPGA))就是这样一种集成电路,其逻辑功能由用户对器件编程来确定。由设计人员自行编程来把一个数字系统“集成”在一片PLD上,而不需要请芯片制造厂商来设计和制作专用的集成电路芯片。而且,如今,取代手工地制作集成电路芯片,这种编程也多半改用“逻辑编译器(logic compiler)”软件来实现,它与程序开发撰写时所用的软件编译器相类似,而要编译之前的原始代码也得用特定的编程语言来撰写,此称之为硬件描述语言(Hardware Description Language,HDL),而HDL也并非仅有一种,而是有许多种,如ABEL(Advanced Boolean Expression Language)、AHDL(Altera Hardware Description Language)、Confluence、CUPL(Cornell University Programming Language)、HDCal、JHDL(Java Hardware Description Language)、Lava、Lola、MyHDL、PALASM、RHDL(Ruby Hardware Description Language)等,目前最普遍使用的是VHDL(Very-High-Speed Integrated Circuit Hardware Description Language) 与Verilog。本领域技术人员也应该清楚,只需要将方法流程用上述几种硬件描述语言稍作逻辑编程并编程到集成电路中,就可以很容易得到实现该逻辑方法流程的硬件电路。
控制器可以按任何适当的方式实现,例如,控制器可以采取例如微处理器或处理器以及存储可由该(微)处理器执行的计算机可读程序代码(例如软件或固件)的计算机可读存储介质、逻辑门、开关、专用集成电路(Application Specific Integrated Circuit,ASIC)、可编程逻辑控制器和嵌入微控制器的形式,控制器的例子包括但不限于以下微控制器:ARC 625D、Atmel AT91SAM、Microchip PIC18F26K20以及Silicone Labs C8051F320,存储器控制器还可以被实现为存储器的控制逻辑的一部分。本领域技术人员也知道,除了以纯计算机可读程序代码方式实现控制器以外,完全可以通过将方法步骤进行逻辑编程来使得控制器以逻辑门、开关、专用集成电路、可编程逻辑控制器和嵌入微控制器等的形式来实现相同功能。因此这种控制器可以被认为是一种硬件部件,而对其内包括的用于实现各种功能的装置也可以视为硬件部件内的结构。或者甚至,可以将用于实现各种功能的装置视为既可以是实现方法的软件模块又可以是硬件部件内的结构。
上述实施例阐明的系统、装置、模块或单元,具体可以由计算机芯片或实体实现,或者由具有某种功能的产品来实现。一种典型的实现设备为计算机。具体的,计算机例如可以为个人计算机、膝上型计算机、蜂窝电话、相机电话、智能电话、个人数字助理、媒体播放器、导航设备、电子邮件设备、游戏控制台、平板计算机、可穿戴设备或者这些设备中的任何设备的组合。
为了描述的方便,描述以上装置时以功能分为各种单元分别描述。当然,在实施本说明书一个或多个实施例时可以把各单元的功能在同一个或多个软件和/或硬件中实现。
本领域内的技术人员应明白,本说明书实施例可提供为方法、系统、或计算机程序产品。因此,本说明书实施例可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本说明书实施例可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。
本说明书是参照根据本说明书实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供 这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。
在一个典型的配置中,计算设备包括一个或多个处理器(CPU)、输入/输出接口、网络接口和计算机可读存储介质。
计算机可读存储介质包括永久性和非永久性、可移动和非可移动媒体可以由任何方法或技术来实现信息存储。信息可以是计算机可读指令、数据结构、程序的模块或其他数据。计算机可读存储介质的例子包括,但不限于相变内存(PRAM)、静态随机存取存储器(SRAM)、动态随机存取存储器(DRAM)、其他类型的随机存取存储器(RAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、快闪记忆体或其他内存技术、只读光盘只读存储器(CD-ROM)、数字多功能光盘(DVD)或其他光学存储、磁盒式磁带,磁带磁磁盘存储或其他磁性存储设备或任何其他非传输介质,可用于存储可以被计算设备访问的信息。按照本文中的界定,计算机可读存储介质不包括暂存电脑可读媒体(transitory media),如调制的数据信号和载波。
还需要说明的是,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、商品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、商品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、商品或者设备中还存在另外的相同要素。
本说明书可以在由计算机执行的计算机可执行指令的一般上下文中描述,例如 程序模块。一般地,程序模块包括执行特定任务或实现特定抽象数据类型的例程、程序、对象、组件、数据结构等等。也可以在分布式计算环境中实践说明书,在这些分布式计算环境中,由通过通信网络而被连接的远程处理设备来执行任务。在分布式计算环境中,程序模块可以位于包括存储设备在内的本地和远程计算机存储介质中。
本说明书中的各个实施例均采用递进的方式描述,各个实施例之间相同相似的部分互相参见即可,每个实施例重点说明的都是与其他实施例的不同之处。尤其,对于系统实施例而言,由于其基本相似于方法实施例,所以描述的比较简单,相关之处参见方法实施例的部分说明即可。
以上所述仅为本说明书实施例而已,并不用于限制本申请。对于本领域技术人员来说,本申请可以有各种更改和变化。凡在本申请的精神和原理之内所作的任何修改、等同替换、改进等,均应包含在本申请的权利要求范围之内。

Claims (13)

  1. 一种二维码识读方法,包括:
    利用摄像头扫码得到帧图像;
    若确定所述帧图像中包含二维码,则确定所述帧图像中的二维码位置;
    尝试识读所述二维码,若无法成功识读则根据所述二维码位置,调整所述摄像头的对焦位置,以使所述摄像头对焦至所述二维码所在区域。
  2. 如权利要求1所述的方法,所述确定所述帧图像中的二维码位置,具体包括:
    检测所述二维码中的位置探测图;
    基于检测到的三个所述位置探测图,确定所述帧图像中的二维码位置。
  3. 如权利要求1所述的方法,所述调整所述摄像头的对焦位置,以使所述摄像头对焦至所述二维码所在区域,具体包括:
    根据帧图像坐标系与摄像头坐标系的对应关系,转换所述二维码位置得到对焦参数,其中,所述对焦参数包括对焦区域大小、对焦点中至少一个;
    根据所述对焦参数调整所述摄像头的对焦位置,以使所述摄像头对焦至所述二维码所在区域。
  4. 如权利要求3所述的方法,所述帧图像坐标系与摄像头坐标系的对应关系按照如下方式得到:
    根据帧图像分辨率,建立帧图像坐标系;
    根据摄像头分辨率,建立摄像头坐标系;
    根据所述帧图像分辨率与所述摄像头分辨率的比例关系,确定所述帧图像坐标系与所述摄像头坐标系的对应关系。
  5. 如权利要求4所述的方法,所述摄像头对焦至所述二维码所在区域,具体包括:
    所述摄像头对焦至基于所述二维码中的位置探测图确定的二维码边界包围的区域中的至少一个坐标点。
  6. 如权利要求1所述的方法,所述方法还包括:若确定所述帧图像中不包含二维码,则发出提示信息,提示用户手动调整所述摄像头与二维码的位置关系。
  7. 一种二维码识读装置,包括:
    获取模块,利用摄像头扫码得到帧图像;
    位置确定模块,若确定所述帧图像中包含二维码,则确定所述帧图像中的二维码位置;
    识读模块,尝试识读所述二维码,若无法成功识读则根据所述二维码位置,调整所 述摄像头的对焦位置,以使所述摄像头对焦至所述二维码所在区域。
  8. 如权利要求7所述的装置,所述位置确定模块,检测所述二维码中的位置探测图;
    基于检测到的三个所述位置探测图,确定所述帧图像中的二维码位置。
  9. 如权利要求7所述的装置,所述识读模块,根据帧图像坐标系与摄像头坐标系的对应关系,转换所述二维码位置得到对焦参数,其中,所述对焦参数包括对焦区域大小、对焦点中至少一个;
    根据所述对焦参数调整所述摄像头的对焦位置,以使所述摄像头对焦至所述二维码所在区域。
  10. 如权利要求9所述的装置,还包括:对应关系确定模块,根据帧图像分辨率,建立帧图像坐标系;
    根据摄像头分辨率,建立摄像头坐标系;
    根据帧图像分辨率和摄像头分辨率的比例关系,确定所述帧图像坐标系与所述摄像头坐标系的对应关系。
  11. 如权利要求10所述的装置,所述位置确定模块,所述摄像头对焦至所述二维码所在区域,具体包括:
    所述摄像头对焦至基于所述二维码中的位置探测图确定的二维码边界包围的区域中的至少一个坐标点。
  12. 如权利要求7所述的装置,若确定所述帧图像中不包含二维码,则发出提示信息,提示用户手动调整所述摄像头与所述二维码的位置关系。
  13. 一种电子设备,包括:
    至少一个处理器;以及,
    与所述至少一个处理器通信连接的存储器;其中,
    所述存储器存储有可被所述至少一个处理器执行的指令,所述指令被所述至少一个处理器执行,以使所述至少一个处理器能够:
    利用摄像头扫码得到帧图像;
    若确定所述帧图像中包含二维码,则确定所述帧图像中的二维码位置;
    尝试识读所述二维码,若无法成功识读则根据所述二维码位置,调整所述摄像头的对焦位置,以使所述摄像头对焦至所述二维码所在区域。
PCT/CN2019/072911 2018-03-23 2019-01-24 一种二维码识读方法、装置及设备 WO2019179233A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201810247331.3 2018-03-23
CN201810247331.3A CN108629220A (zh) 2018-03-23 2018-03-23 一种二维码识读方法、装置及设备

Publications (1)

Publication Number Publication Date
WO2019179233A1 true WO2019179233A1 (zh) 2019-09-26

Family

ID=63696292

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/072911 WO2019179233A1 (zh) 2018-03-23 2019-01-24 一种二维码识读方法、装置及设备

Country Status (3)

Country Link
CN (1) CN108629220A (zh)
TW (1) TWI740087B (zh)
WO (1) WO2019179233A1 (zh)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110738067A (zh) * 2019-09-30 2020-01-31 百富计算机技术(深圳)有限公司 提升扫码效率的方法及装置
CN112308899A (zh) * 2020-11-09 2021-02-02 北京经纬恒润科技股份有限公司 一种挂车角度识别方法及装置
CN112464681A (zh) * 2020-11-26 2021-03-09 苏州摩比信通智能系统有限公司 一种图形码扫描方法、装置、设备和介质
CN114266266A (zh) * 2021-11-12 2022-04-01 上海宾通智能科技有限公司 一种简单、快速的复合型二维码识别系统
CN115860033A (zh) * 2023-01-31 2023-03-28 北京微点科学技术有限公司 可分级鉴伪的彩色分区微点码标识的防伪方法和装置

Families Citing this family (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108629220A (zh) * 2018-03-23 2018-10-09 阿里巴巴集团控股有限公司 一种二维码识读方法、装置及设备
CN115456002A (zh) * 2019-05-31 2022-12-09 创新先进技术有限公司 二维码识别方法、二维码定位识别模型建立方法及其装置
CN110399761B (zh) * 2019-07-26 2023-02-17 北京慧眼智行科技有限公司 二维码提取方法、装置、可读存储介质及终端设备
CN110933771B (zh) * 2019-12-06 2024-03-01 江苏紫米电子技术有限公司 摄像机的网络连接方法、装置、存储介质及摄像机
CN111125798A (zh) * 2019-12-12 2020-05-08 维沃移动通信有限公司 一种凭证显示方法及电子设备
CN114663646A (zh) * 2020-06-02 2022-06-24 支付宝(杭州)信息技术有限公司 一种扫码过程中的提示方法、装置及设备
CN111767752B (zh) * 2020-06-11 2022-09-23 网易宝有限公司 一种二维码识别方法及装置
CN112749769B (zh) * 2020-08-19 2024-06-14 腾讯科技(深圳)有限公司 图形码检测方法、装置、计算机设备及存储介质
CN112492200B (zh) * 2020-11-24 2022-10-04 维沃移动通信有限公司 拍照方法、装置、电子设备和存储介质
CN112532884B (zh) * 2020-11-27 2022-10-14 维沃移动通信有限公司 识别方法、装置及电子设备
CN112733566B (zh) * 2021-01-14 2024-04-05 广东星云开物科技股份有限公司 基于位置引导的二维码识读方法和装置
CN112969023A (zh) * 2021-01-29 2021-06-15 北京骑胜科技有限公司 图像拍摄方法、设备、存储介质以及计算机程序产品
CN113065374B (zh) * 2021-04-01 2023-10-27 支付宝(杭州)信息技术有限公司 一种二维码识别方法、装置及设备
CN115696044B (zh) * 2023-01-04 2023-08-04 深圳思谋信息科技有限公司 成像控制方法、装置、计算机设备和存储介质

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN201467307U (zh) * 2009-05-26 2010-05-12 上海银晨智能识别科技有限公司 二代证人像采集专用摄像装置
CN106897648A (zh) * 2016-07-22 2017-06-27 阿里巴巴集团控股有限公司 识别二维码位置的方法及其系统
CN107220578A (zh) * 2017-05-31 2017-09-29 维沃移动通信有限公司 一种二维码扫描识别方法、装置、移动终端及存储介质
CN107633194A (zh) * 2017-09-15 2018-01-26 维沃移动通信有限公司 一种二维码的识别方法及终端
CN108629220A (zh) * 2018-03-23 2018-10-09 阿里巴巴集团控股有限公司 一种二维码识读方法、装置及设备

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4874668B2 (ja) * 2006-02-22 2012-02-15 Hoya株式会社 オートフォーカスユニット及びカメラ
CN103279730B (zh) * 2013-06-05 2016-09-28 北京奇虎科技有限公司 移动终端处理可视化图形编码的方法和装置
CN106570436B (zh) * 2016-11-14 2019-01-25 三峡大学 一种基于二维码的变电站设备抄表系统及其抄表方法
CN107122693A (zh) * 2017-05-15 2017-09-01 北京小米移动软件有限公司 二维码识别方法及装置

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN201467307U (zh) * 2009-05-26 2010-05-12 上海银晨智能识别科技有限公司 二代证人像采集专用摄像装置
CN106897648A (zh) * 2016-07-22 2017-06-27 阿里巴巴集团控股有限公司 识别二维码位置的方法及其系统
CN107220578A (zh) * 2017-05-31 2017-09-29 维沃移动通信有限公司 一种二维码扫描识别方法、装置、移动终端及存储介质
CN107633194A (zh) * 2017-09-15 2018-01-26 维沃移动通信有限公司 一种二维码的识别方法及终端
CN108629220A (zh) * 2018-03-23 2018-10-09 阿里巴巴集团控股有限公司 一种二维码识读方法、装置及设备

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110738067A (zh) * 2019-09-30 2020-01-31 百富计算机技术(深圳)有限公司 提升扫码效率的方法及装置
CN110738067B (zh) * 2019-09-30 2023-05-23 百富计算机技术(深圳)有限公司 提升扫码效率的方法及装置
CN112308899A (zh) * 2020-11-09 2021-02-02 北京经纬恒润科技股份有限公司 一种挂车角度识别方法及装置
CN112308899B (zh) * 2020-11-09 2024-05-07 北京经纬恒润科技股份有限公司 一种挂车角度识别方法及装置
CN112464681A (zh) * 2020-11-26 2021-03-09 苏州摩比信通智能系统有限公司 一种图形码扫描方法、装置、设备和介质
CN112464681B (zh) * 2020-11-26 2024-04-30 苏州摩比信通智能系统有限公司 一种图形码扫描方法、装置、设备和介质
CN114266266A (zh) * 2021-11-12 2022-04-01 上海宾通智能科技有限公司 一种简单、快速的复合型二维码识别系统
CN114266266B (zh) * 2021-11-12 2023-10-20 上海宾通智能科技有限公司 一种复合型二维码识别系统
CN115860033A (zh) * 2023-01-31 2023-03-28 北京微点科学技术有限公司 可分级鉴伪的彩色分区微点码标识的防伪方法和装置
CN115860033B (zh) * 2023-01-31 2023-05-16 北京微点科学技术有限公司 可分级鉴伪的彩色分区微点码标识的防伪方法和装置

Also Published As

Publication number Publication date
TW201941110A (zh) 2019-10-16
TWI740087B (zh) 2021-09-21
CN108629220A (zh) 2018-10-09

Similar Documents

Publication Publication Date Title
WO2019179233A1 (zh) 一种二维码识读方法、装置及设备
TWI698764B (zh) 一種身份驗證方法、系統、裝置及設備、伺服器與採集設備
JP7118244B2 (ja) グラフィックコード認識方法及び装置、並びに、端末及びプログラム
US9208579B2 (en) Object tracking device
CN109614983B (zh) 训练数据的生成方法、装置及系统
WO2019205761A1 (zh) 一种智能设备,商品盘点方法、装置以及设备
TWI690853B (zh) 一種影像識別的方法、裝置及設備
CN112333356B (zh) 一种证件图像采集方法、装置和设备
TWI754818B (zh) 支付方法、裝置及系統
KR20170061631A (ko) 영역 인식 방법 및 장치
WO2019119978A1 (zh) 一种载体物品,业务信息获取方法、装置以及设备
US10317777B2 (en) Automatic zooming method and apparatus
WO2019169965A1 (zh) 一种扫码图像识别方法、装置以及设备
CN114494487B (zh) 基于全景图语义拼接的户型图生成方法、设备及存储介质
TWI729675B (zh) 互動界面的顯示方法、裝置及設備
WO2018192531A1 (zh) 一种虹膜识别过程中的预览方法及装置
JP2019012546A (ja) 情報処理装置、画像処理方法とプログラム、ならびに、pos端末装置
CN108345812B (zh) 一种扫描定位方法、装置、设备及系统
CN114998347A (zh) 一种半导体面板角点定位方法及装置
JP2015180091A (ja) デジタルカメラ
CN116958135B (zh) 纹理检测处理方法及装置
CN114511909A (zh) 一种刷脸支付意愿识别方法、装置以及设备
CN116665316A (zh) 一种活体检测的方法、装置、存储介质及电子设备
KR101415718B1 (ko) 부분 이미지 생성 방법 및 그 단말 장치
CN116225270A (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: 19770884

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

Country of ref document: EP

Kind code of ref document: A1