CN106131415B - Two-dimensional code image scanning method and device and mobile terminal - Google Patents

Two-dimensional code image scanning method and device and mobile terminal Download PDF

Info

Publication number
CN106131415B
CN106131415B CN201610571434.6A CN201610571434A CN106131415B CN 106131415 B CN106131415 B CN 106131415B CN 201610571434 A CN201610571434 A CN 201610571434A CN 106131415 B CN106131415 B CN 106131415B
Authority
CN
China
Prior art keywords
lens
dimensional code
code image
focusing
focus
Prior art date
Legal status (The legal status 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 status listed.)
Active
Application number
CN201610571434.6A
Other languages
Chinese (zh)
Other versions
CN106131415A (en
Inventor
李小朋
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp Ltd
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 Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN201610571434.6A priority Critical patent/CN106131415B/en
Publication of CN106131415A publication Critical patent/CN106131415A/en
Application granted granted Critical
Publication of CN106131415B publication Critical patent/CN106131415B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules
    • H04N23/67Focus control based on electronic image sensor signals

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Automatic Focus Adjustment (AREA)
  • Studio Devices (AREA)
  • Lens Barrels (AREA)
  • Focusing (AREA)

Abstract

本发明公开了一种二维码图像扫描方法、装置及移动终端。所述二维码图像扫描方法包括以下步骤:获取自动对焦控制数据;根据所述自动对焦控制数据调整移动终端的镜头的自动对焦参数,以使所述镜头根据所述对焦参数对二维码图像进行自动对焦;控制所述镜头对所述二维码图像进行扫描。本发明能提高扫描二维码图像的速度。

Figure 201610571434

The present invention discloses a two-dimensional code image scanning method, device and mobile terminal. The two-dimensional code image scanning method comprises the following steps: obtaining automatic focus control data; adjusting the automatic focus parameters of the lens of the mobile terminal according to the automatic focus control data, so that the lens automatically focuses on the two-dimensional code image according to the focus parameters; and controlling the lens to scan the two-dimensional code image. The present invention can improve the speed of scanning the two-dimensional code image.

Figure 201610571434

Description

二维码图像扫描方法、装置及移动终端Two-dimensional code image scanning method, device and mobile terminal

技术领域technical field

本发明属于二维码图像扫描技术领域,尤其涉及一种二维码图像扫描方法、装置及移动终端。The invention belongs to the technical field of two-dimensional code image scanning, and in particular relates to a two-dimensional code image scanning method, device and mobile terminal.

背景技术Background technique

传统的移动终端(例如,手机)一般都具有二维码图像扫描功能。上述传统的移动终端是通过以下方式来实现二维码图像扫描功能的:移动终端的镜头对二维码图像进行自动对焦,然后再对二维码图像进行扫描。Traditional mobile terminals (eg, cell phones) generally have a two-dimensional code image scanning function. The above-mentioned traditional mobile terminal realizes the two-dimensional code image scanning function in the following manner: the lens of the mobile terminal automatically focuses on the two-dimensional code image, and then scans the two-dimensional code image.

在实践中,发明人发现现有技术至少存在以下技术问题:In practice, the inventor found that the prior art has at least the following technical problems:

扫描二维码图像的目的是为了获取二维码信息,在扫取的二维码图像相对地不太清晰的情况下,也能获取到二维码信息。The purpose of scanning the two-dimensional code image is to obtain the two-dimensional code information. In the case where the scanned two-dimensional code image is relatively unclear, the two-dimensional code information can also be obtained.

上述传统的移动终端的镜头一般都会扫取相对清晰的二维码图像,因此这会使得所述镜头的自动对焦速度较慢。The lens of the above-mentioned conventional mobile terminal generally scans a relatively clear two-dimensional code image, so the auto-focusing speed of the lens is relatively slow.

即,上述传统的移动终端扫描二维码图像的速度较慢。That is, the above-mentioned conventional mobile terminal scans the two-dimensional code image relatively slowly.

发明内容SUMMARY OF THE INVENTION

本发明的目的在于提供一种二维码图像扫描方法、装置及移动终端,其能提高扫描二维码图像的速度。The purpose of the present invention is to provide a two-dimensional code image scanning method, device and mobile terminal, which can improve the speed of scanning two-dimensional code images.

为了解决以上技术问题,本发明的技术方案如下:In order to solve the above technical problems, the technical scheme of the present invention is as follows:

一种二维码图像扫描方法,所述方法包括以下步骤:获取自动对焦控制数据;根据所述自动对焦控制数据调整移动终端的镜头的自动对焦参数,以使所述镜头根据所述对焦参数对二维码图像进行自动对焦;控制所述镜头对所述二维码图像进行扫描。A method for scanning a two-dimensional code image, the method comprising the steps of: acquiring auto-focus control data; adjusting auto-focus parameters of a lens of a mobile terminal according to the auto-focus control data, so that the lens can The two-dimensional code image is automatically focused; the lens is controlled to scan the two-dimensional code image.

在上述二维码图像扫描方法中,所述自动对焦参数包括自动对焦速度;所述根据所述自动对焦控制数据调整移动终端的镜头的自动对焦参数的步骤包括:根据所述对焦控制数据调整所述镜头的自动对焦速度,以使所述镜头根据预定对焦速度对二维码图像进行自动对焦。In the above two-dimensional code image scanning method, the auto-focus parameter includes an auto-focus speed; the step of adjusting the auto-focus parameter of the lens of the mobile terminal according to the auto-focus control data includes: adjusting the auto-focus parameter according to the focus control data The automatic focusing speed of the lens is set, so that the lens can automatically focus on the two-dimensional code image according to the predetermined focusing speed.

在上述二维码图像扫描方法中,所述根据所述对焦控制数据调整所述镜头的自动对焦速度的步骤包括:根据所述对焦控制数据控制所述镜头的马达以预定移动速度移动所述镜头的镜片,以使得所述镜头以所述预定对焦速度对所述二维码图像进行自动对焦;其中,所述预定对焦速度与所述预定移动速度对应。In the above two-dimensional code image scanning method, the step of adjusting the autofocus speed of the lens according to the focus control data includes: controlling the motor of the lens to move the lens at a predetermined moving speed according to the focus control data the lens, so that the lens can automatically focus on the two-dimensional code image at the predetermined focusing speed; wherein, the predetermined focusing speed corresponds to the predetermined moving speed.

在上述二维码图像扫描方法中,所述自动对焦参数还包括自动对焦起始位置;在所述根据所述对焦控制数据调整所述镜头的自动对焦速度的步骤之前,还包括步骤:根据所述对焦控制数据调整所述镜头的自动对焦起始位置,以使所述镜头从所述自动对焦起始位置开始对所述二维码图像进行自动对焦。In the above two-dimensional code image scanning method, the auto-focusing parameter further includes an auto-focusing start position; before the step of adjusting the auto-focusing speed of the lens according to the focus control data, it further includes the step of: according to the The focus control data adjusts the autofocus start position of the lens, so that the lens starts to automatically focus on the two-dimensional code image from the autofocus start position.

在上述二维码图像扫描方法中,所述根据所述对焦控制数据调整所述镜头的自动对焦起始位置的步骤包括:在所述镜头对所述二维码图像进行自动对焦前,根据所述对焦控制数据控制所述镜头的马达将所述镜头的镜片移动到所述预定位置,以使所述镜头从所述自动对焦起始位置开始对所述二维码图像进行对焦;其中,所述自动对焦起始位置与所述预定位置对应。In the above two-dimensional code image scanning method, the step of adjusting the automatic focusing starting position of the lens according to the focusing control data includes: before the lens automatically focuses on the two-dimensional code image, according to the The focus control data controls the motor of the lens to move the lens of the lens to the predetermined position, so that the lens starts to focus on the two-dimensional code image from the automatic focus starting position; wherein, the The autofocus starting position corresponds to the predetermined position.

一种二维码图像扫描装置,所述装置包括:获取模块,用于获取自动对焦控制数据;调整模块,用于根据所述自动对焦控制数据调整移动终端的镜头的自动对焦参数,以使所述镜头根据所述对焦参数对二维码图像进行自动对焦;控制模块,用于控制所述镜头对所述二维码图像进行扫描。A two-dimensional code image scanning device, the device comprises: an acquisition module for acquiring auto-focus control data; an adjustment module for adjusting auto-focus parameters of a lens of a mobile terminal according to the auto-focus control data, so that all The lens automatically focuses on the two-dimensional code image according to the focusing parameter; the control module is configured to control the lens to scan the two-dimensional code image.

在上述二维码图像扫描装置中,所述自动对焦参数包括自动对焦速度;所述调整模块用于根据所述对焦控制数据调整所述镜头的自动对焦速度,以使所述镜头根据预定对焦速度对二维码图像进行自动对焦。In the above-mentioned two-dimensional code image scanning device, the auto-focus parameter includes an auto-focus speed; the adjustment module is configured to adjust the auto-focus speed of the lens according to the focus control data, so that the lens can focus according to a predetermined focus speed Autofocus on QR code images.

在上述二维码图像扫描装置中,所述调整模块用于根据所述对焦控制数据控制所述镜头的马达以预定移动速度移动所述镜头的镜片,以使得所述镜头以所述预定对焦速度对所述二维码图像进行自动对焦;其中,所述预定对焦速度与所述预定移动速度对应。In the above two-dimensional code image scanning device, the adjustment module is configured to control the motor of the lens to move the lens of the lens at a predetermined moving speed according to the focus control data, so that the lens can move at the predetermined focusing speed The two-dimensional code image is automatically focused; wherein, the predetermined focusing speed corresponds to the predetermined moving speed.

在上述二维码图像扫描装置中,所述自动对焦参数还包括自动对焦起始位置;所述调整模块用于根据所述对焦控制数据调整所述镜头的自动对焦起始位置,以使所述镜头从所述自动对焦起始位置开始对所述二维码图像进行自动对焦。In the above two-dimensional code image scanning device, the auto-focusing parameters further include an auto-focusing start position; the adjustment module is configured to adjust the auto-focusing start position of the lens according to the focus control data, so that the The lens automatically focuses on the two-dimensional code image from the automatic focusing starting position.

在上述二维码图像扫描装置中,所述调整模块用于在所述镜头对所述二维码图像进行自动对焦前,根据所述对焦控制数据控制所述镜头的马达将所述镜头的镜片移动到预定位置,以使所述镜头从所述自动对焦起始位置开始对所述二维码图像进行对焦;其中,所述自动对焦起始位置与所述预定位置对应。In the above two-dimensional code image scanning device, the adjustment module is configured to control the motor of the lens to adjust the lens of the lens according to the focus control data before the lens automatically focuses on the two-dimensional code image. moving to a predetermined position, so that the lens starts to focus on the two-dimensional code image from the automatic focusing starting position; wherein, the automatic focusing starting position corresponds to the predetermined position.

一种移动终端,所述移动终端包括上述二维码图像扫描装置。A mobile terminal comprising the above-mentioned two-dimensional code image scanning device.

相对于现有技术,本发明能在实现获取到二维码信息的目的的前提下,通过控制所述镜头从所述自动对焦起始位置开始对所述二维码图像进行自动对焦,并且通过控制所述镜头以预定对焦速度对所述二维码图像进行自动对焦,因此可以节省所述镜头在扫描所述二维码图像时从远端焦点开始至近端焦点的扫描过程,同时可以加快所述镜头的镜片的移动速度,即,使得所述镜头以高于默认自动对焦速度的速度来对所述二维码图像进行对焦,因此可以有效地提高扫描所述二维码图像的速度。Compared with the prior art, the present invention can automatically focus on the two-dimensional code image by controlling the lens to start from the automatic focusing starting position on the premise of achieving the purpose of obtaining the two-dimensional code information, and The lens is controlled to automatically focus on the two-dimensional code image at a predetermined focusing speed, so the scanning process from the far-end focus to the near-end focus when the lens scans the two-dimensional code image can be saved, and at the same time, the scanning process can be accelerated. The moving speed of the lens of the lens, that is, the lens focuses the two-dimensional code image at a speed higher than the default auto-focus speed, so the speed of scanning the two-dimensional code image can be effectively improved.

附图说明Description of drawings

图1是本发明的移动终端的示意图;1 is a schematic diagram of a mobile terminal of the present invention;

图2为本发明的二维码图像扫描方法及装置的运行环境的示意图;2 is a schematic diagram of the operating environment of the two-dimensional code image scanning method and device of the present invention;

图3是本发明的二维码图像扫描装置的示意图;Fig. 3 is the schematic diagram of the two-dimensional code image scanning device of the present invention;

图4是本发明的二维码图像扫描方法的流程图;Fig. 4 is the flow chart of the two-dimensional code image scanning method of the present invention;

图5是图4中根据自动对焦控制数据调整移动终端的镜头的自动对焦参数,以使镜头根据对焦参数对二维码图像进行自动对焦的步骤的流程图。FIG. 5 is a flowchart of the steps of adjusting the auto-focus parameters of the lens of the mobile terminal according to the auto-focus control data in FIG. 4 so that the lens automatically focuses on the two-dimensional code image according to the focus parameters.

具体实施方式Detailed ways

请参照图式,其中相同的组件符号代表相同的组件。以下的说明是基于所例示的本发明具体实施例,其不应被视为限制本发明未在此详述的其它具体实施例。Please refer to the drawings, wherein the same reference numerals represent the same components. The following description is based on illustrated embodiments of the invention and should not be construed as limiting other embodiments of the invention not detailed herein.

图1示出了本发明所提供的一个或多个实施例的移动终端的示意图,其中,本发明的二维码图像扫描方法及装置可以应用于所述移动终端中。1 shows a schematic diagram of a mobile terminal according to one or more embodiments of the present invention, wherein the method and apparatus for scanning a two-dimensional code image of the present invention can be applied to the mobile terminal.

参考图2,本发明的二维码图像扫描方法及装置所应用或运行的客户端设备(例如,所述移动终端101)可以是智能手机、随身听、数码相机、平板电脑等电子设备。所述移动终端包括处理器201、存储器202、传感器204、时钟信号生成器206、通信接口205、输入输出设备203等中的任意组合,所述处理器201与所述存储器202、所述输入设备203、所述输出设备204、所述通信接口205、所述总线接口206连接,所述移动终端中的处理器201、存储器202、传感器204、输入输出设备203、通信接口205、时钟信号生成器206等中的任意组合用于实现本发明的二维码图像扫描方法中的步骤及二维码图像扫描装置中的功能。其中,所述输入设备203包括触摸屏、按键、用于扫描二维码图像的镜头、麦克风,所述输出设备204包括所述触摸屏、扬声器,所述存储器202用于存储本发明的二维码图像扫描方法及装置所对应的功能执行代码以及自动对焦控制数据,所述处理器用于根据所述功能执行代码和所述自动对焦控制数据控制所述移动终端的所述镜头对所述二维码图像进行扫描。Referring to FIG. 2 , the client device (eg, the mobile terminal 101 ) to which the method and apparatus for scanning a two-dimensional code image of the present invention is applied or executed may be an electronic device such as a smart phone, a walkman, a digital camera, or a tablet computer. The mobile terminal includes any combination of a processor 201, a memory 202, a sensor 204, a clock signal generator 206, a communication interface 205, an input and output device 203, etc., the processor 201 and the memory 202, the input device 203, the output device 204, the communication interface 205, the bus interface 206 are connected, the processor 201, the memory 202, the sensor 204, the input and output device 203, the communication interface 205, the clock signal generator in the mobile terminal Any combination of 206 and the like is used to realize the steps in the two-dimensional code image scanning method and the functions in the two-dimensional code image scanning device of the present invention. The input device 203 includes a touch screen, keys, a lens for scanning a two-dimensional code image, and a microphone, the output device 204 includes the touch screen and a speaker, and the memory 202 is used to store the two-dimensional code image of the present invention The function execution code and autofocus control data corresponding to the scanning method and device, the processor is configured to control the lens of the mobile terminal to perform the two-dimensional code image according to the function execution code and the autofocus control data to scan.

下面详细说明在上述移动终端101的运行环境中,本发明的二维码图像扫描方法及装置的技术方案。The technical solutions of the two-dimensional code image scanning method and device of the present invention in the operating environment of the mobile terminal 101 are described in detail below.

参考图3,图3是本发明的二维码图像扫描装置的示意图。Referring to FIG. 3 , FIG. 3 is a schematic diagram of a two-dimensional code image scanning device of the present invention.

本发明的二维码图像扫描装置的第一实施例包括获取模块301、调整模块302、控制模块303。The first embodiment of the two-dimensional code image scanning device of the present invention includes an acquisition module 301 , an adjustment module 302 , and a control module 303 .

所述获取模块301用于获取自动对焦控制数据。所述自动对焦控制数据是预先设定并存储在预定存储空间中的。当所述移动终端需要对二维码图像进行扫描时,所述获取模块301从所述预定存储空间获取所述自动对焦控制数据。The acquisition module 301 is used to acquire autofocus control data. The AF control data is preset and stored in a predetermined storage space. When the mobile terminal needs to scan the two-dimensional code image, the acquiring module 301 acquires the autofocus control data from the predetermined storage space.

所述调整模块302用于根据所述自动对焦控制数据调整移动终端的镜头的自动对焦参数,以使所述镜头根据所述对焦参数对二维码图像进行自动对焦。其中,所述镜头包括马达、镜片和芯片。所述调整模块302用于通过在所述镜头对所述二维码图像进行扫描之前,将所述自动对焦控制数据输入到所述镜头的所述芯片中来实现对所述镜头的自动对焦参数的调整。The adjusting module 302 is configured to adjust the auto-focusing parameters of the lens of the mobile terminal according to the auto-focusing control data, so that the lens can automatically focus on the two-dimensional code image according to the focusing parameters. Wherein, the lens includes a motor, a lens and a chip. The adjustment module 302 is configured to input the autofocus control data into the chip of the lens before the lens scans the two-dimensional code image to realize the autofocus parameters of the lens adjustment.

所述控制模块303用于控制所述镜头对所述二维码图像进行扫描。The control module 303 is configured to control the lens to scan the two-dimensional code image.

在本实施例的二维码图像扫描装置中,所述自动对焦参数包括自动对焦速度。In the two-dimensional code image scanning device of this embodiment, the auto-focusing parameter includes an auto-focusing speed.

所述调整模块302用于根据所述对焦控制数据调整所述镜头的自动对焦速度,以使所述镜头根据预定对焦速度(调整后的自动对焦速度)对所述二维码图像进行自动对焦。The adjustment module 302 is configured to adjust the autofocus speed of the lens according to the focus control data, so that the lens can automatically focus on the two-dimensional code image according to a predetermined focus speed (adjusted autofocus speed).

具体地,所述调整模块302用于根据所述对焦控制数据提高所述镜头的自动对焦速度至所述预定对焦速度(调整后的自动对焦速度),以使所述镜头根据所述预定对焦速度对二维码图像进行自动对焦。Specifically, the adjustment module 302 is configured to increase the autofocus speed of the lens to the predetermined focus speed (adjusted autofocus speed) according to the focus control data, so that the lens can focus according to the predetermined focus speed Autofocus on QR code images.

在本实施例的二维码图像扫描装置中,所述调整模块302用于根据所述对焦控制数据控制所述镜头的马达以所述预定移动速度移动所述镜头的镜片(透镜),从而使得所述镜头以所述预定对焦速度对所述二维码图像进行自动对焦。In the two-dimensional code image scanning device of this embodiment, the adjustment module 302 is configured to control the motor of the lens to move the lens (lens) of the lens at the predetermined moving speed according to the focus control data, so as to make The lens automatically focuses on the two-dimensional code image at the predetermined focusing speed.

其中,所述预定对焦速度与所述预定移动速度对应。The predetermined focusing speed corresponds to the predetermined moving speed.

具体地,所述调整模块302用于根据所述对焦控制数据控制所述马达,以使所述镜片在所述马达的驱动下沿所述镜片的主光轴以所述预定移动速度(预定步幅)移动,从而使得所述镜头以所述预定对焦速度对所述二维码图像进行自动对焦。Specifically, the adjustment module 302 is configured to control the motor according to the focus control data, so that the lens moves at the predetermined speed (predetermined step) along the main optical axis of the lens under the driving of the motor. frame), so that the lens automatically focuses on the two-dimensional code image at the predetermined focusing speed.

其中,所述预定移动速度(所述预定步幅)大于所述镜片的默认移动速度(默认步幅)。Wherein, the predetermined moving speed (the predetermined stride) is greater than the default moving speed (default stride) of the lens.

本发明的二维码图像扫描装置的第二实施例与上述第一实施例相似,不同之处在于:The second embodiment of the two-dimensional code image scanning device of the present invention is similar to the above-mentioned first embodiment, except that:

所述自动对焦参数还包括自动对焦起始位置。The autofocus parameter further includes an autofocus start position.

所述调整模块302用于根据所述对焦控制数据调整所述镜头的自动对焦起始位置,以使所述镜头从所述自动对焦起始位置开始对所述二维码图像进行自动对焦。The adjustment module 302 is configured to adjust the auto-focusing starting position of the lens according to the focusing control data, so that the lens starts to automatically focus on the two-dimensional code image from the auto-focusing starting position.

由于用户在使用所述移动终端对所述二维码图像进行扫描时,一般都会将所述移动终端的所述镜头靠近所述二维码图像,因此,在这种情况下,从远端焦点开始对所述二维码图像进行对焦会使得所述镜头的自动对焦操作的效率十分低下。Since the user generally uses the mobile terminal to scan the two-dimensional code image, the lens of the mobile terminal is generally close to the two-dimensional code image. Therefore, in this case, from the far-end focus Starting to focus on the QR code image can make the autofocus operation of the lens very inefficient.

因此,在本实施例中,所述自动对焦起始位置可例如为近端焦点,即,所述调整模块302用于根据所述对焦控制数据将所述镜头的自动对焦起始位置调整为近端焦点,以使所述镜头从所述近端焦点开始对所述二维码图像进行自动对焦。这样可以使得所述镜头更快地完成自动对焦。Therefore, in this embodiment, the AF start position may be, for example, the near-end focus, that is, the adjustment module 302 is configured to adjust the AF start position of the lens to a near-end focus according to the focus control data end focus, so that the lens starts to automatically focus on the two-dimensional code image from the near end focus. This allows the lens to autofocus faster.

在本实施例的二维码图像扫描装置中,所述调整模块302用于在所述镜头对所述二维码图像进行自动对焦前,根据所述对焦控制数据控制所述镜头的马达将所述镜头的镜片移动到预定位置,以使所述镜头从所述自动对焦起始位置开始对所述二维码图像进行对焦。In the two-dimensional code image scanning device of this embodiment, the adjustment module 302 is configured to control the motor of the lens to adjust the focus according to the focus control data before the lens automatically focuses on the two-dimensional code image. The lens of the lens is moved to a predetermined position, so that the lens starts to focus on the two-dimensional code image from the automatic focusing starting position.

其中,所述自动对焦起始位置与所述预定位置对应。Wherein, the auto focus starting position corresponds to the predetermined position.

具体地,在所述镜头对所述二维码图像进行自动对焦前,所述调整模块302用于根据所述对焦控制数据控制所述镜头的马达,以使所述镜片在所述马达的驱动下沿所述镜片的主光轴移动到所述近端焦点所对应的位置,从而使得所述镜头从所述近端焦点所对应的位置开始对所述二维码图像进行对焦。Specifically, before the lens automatically focuses on the two-dimensional code image, the adjustment module 302 is configured to control the motor of the lens according to the focus control data, so that the lens is driven by the motor. The lower part moves to the position corresponding to the near-end focus along the main optical axis of the lens, so that the lens starts to focus on the two-dimensional code image from the position corresponding to the near-end focus.

也就是说,在本实施例中,所述调整模块302用于根据所述对焦控制数据控制所述马达,以使所述镜片在所述马达的驱动下沿所述镜片的主光轴移动到所述预定位置,并使得所述镜片在所述马达的驱动下从所述预定位置开始沿所述镜片的主光轴以所述预定移动速度(预定步幅)移动,从而使得所述镜头从所述预定位置开始以所述预设对焦速度对所述二维码图像进行自动对焦。That is, in this embodiment, the adjustment module 302 is configured to control the motor according to the focus control data, so that the lens is driven by the motor to move along the main optical axis of the lens to the predetermined position, and the lens is driven from the predetermined position to move at the predetermined moving speed (predetermined step) along the main optical axis of the lens from the predetermined position, so that the lens is moved from The predetermined position starts to automatically focus on the two-dimensional code image at the preset focusing speed.

通过上述技术方案,本发明能在实现获取到二维码信息的目的的前提下,通过控制所述镜头从所述自动对焦起始位置开始对所述二维码图像进行自动对焦,并且通过控制所述镜头以预定对焦速度对所述二维码图像进行自动对焦,因此可以节省所述镜头在扫描所述二维码图像时从远端焦点开始至近端焦点的扫描过程,同时可以加快所述镜头的镜片的移动速度,即,使得所述镜头以高于默认自动对焦速度的速度来对所述二维码图像进行对焦,因此可以有效地提高扫描所述二维码图像的速度。Through the above technical solutions, the present invention can automatically focus on the two-dimensional code image by controlling the lens to start from the auto-focusing starting position on the premise of achieving the purpose of acquiring the two-dimensional code information, and by controlling The lens automatically focuses on the two-dimensional code image at a predetermined focusing speed, so the scanning process from the far-end focus to the near-end focus when the lens scans the two-dimensional code image can be saved, and at the same time, all the The moving speed of the lens of the lens, that is, the lens focuses the two-dimensional code image at a speed higher than the default auto-focus speed, so the speed of scanning the two-dimensional code image can be effectively improved.

参考图4和图5,图4是本发明的二维码图像扫描方法的流程图,图5是图4中根据自动对焦控制数据调整移动终端的镜头的自动对焦参数,以使镜头根据对焦参数对二维码图像进行自动对焦的步骤的流程图。Referring to Figure 4 and Figure 5, Figure 4 is a flow chart of the two-dimensional code image scanning method of the present invention, Figure 5 is the autofocus parameter of the lens of the mobile terminal adjusted according to the autofocus control data in Figure 4, so that the lens is based on the focus parameter. Flow chart of the steps to autofocus on a QR code image.

本发明的二维码图像扫描方法的第一实施例包括以下步骤:The first embodiment of the two-dimensional code image scanning method of the present invention includes the following steps:

S401、所述获取模块301获取自动对焦控制数据。所述自动对焦控制数据是预先设定并存储在预定存储空间中的。当所述移动终端需要对二维码图像进行扫描时,所述获取模块301从所述预定存储空间获取所述自动对焦控制数据。S401. The acquisition module 301 acquires autofocus control data. The AF control data is preset and stored in a predetermined storage space. When the mobile terminal needs to scan the two-dimensional code image, the acquiring module 301 acquires the autofocus control data from the predetermined storage space.

S402、所述调整模块302根据所述自动对焦控制数据调整移动终端的镜头的自动对焦参数,以使所述镜头根据所述对焦参数对二维码图像进行自动对焦。其中,所述镜头包括马达、镜片和芯片。所述调整模块302通过在所述镜头对所述二维码图像进行扫描之前,将所述自动对焦控制数据输入到所述镜头的所述芯片中来实现对所述镜头的自动对焦参数的调整。S402. The adjustment module 302 adjusts the auto-focusing parameters of the lens of the mobile terminal according to the auto-focusing control data, so that the lens can automatically focus on the two-dimensional code image according to the focusing parameters. Wherein, the lens includes a motor, a lens and a chip. The adjustment module 302 adjusts the autofocus parameters of the lens by inputting the autofocus control data into the chip of the lens before the lens scans the two-dimensional code image. .

S403、所述控制模块303控制所述镜头对所述二维码图像进行扫描。S403, the control module 303 controls the lens to scan the two-dimensional code image.

在本实施例的二维码图像扫描方法中,所述自动对焦参数包括自动对焦速度。In the two-dimensional code image scanning method of this embodiment, the auto-focusing parameter includes an auto-focusing speed.

所述步骤S402包括:The step S402 includes:

S502、所述调整模块302根据所述对焦控制数据调整所述镜头的自动对焦速度,以使所述镜头根据预定对焦速度(调整后的自动对焦速度)对二维码图像进行自动对焦。S502. The adjustment module 302 adjusts the autofocus speed of the lens according to the focus control data, so that the lens automatically focuses on the two-dimensional code image according to a predetermined focus speed (adjusted autofocus speed).

具体地,所述调整模块302根据所述对焦控制数据提高所述镜头的自动对焦速度至预定对焦速度(调整后的自动对焦速度),以使所述镜头根据所述预定对焦速度对二维码图像进行自动对焦。Specifically, the adjustment module 302 increases the autofocus speed of the lens to a predetermined focus speed (adjusted autofocus speed) according to the focus control data, so that the lens can scan the QR code according to the predetermined focus speed The image is automatically focused.

在本实施例的二维码图像扫描方法中,所述步骤S502为:In the two-dimensional code image scanning method of this embodiment, the step S502 is:

所述调整模块302根据所述对焦控制数据控制所述镜头的马达以预定移动速度移动所述镜头的镜片,从而使得所述镜头以所述预定对焦速度对所述二维码图像进行自动对焦。The adjustment module 302 controls the motor of the lens to move the lens of the lens at a predetermined moving speed according to the focus control data, so that the lens can automatically focus on the two-dimensional code image at the predetermined focusing speed.

其中,所述预定对焦速度与所述预定移动速度对应。The predetermined focusing speed corresponds to the predetermined moving speed.

具体地,所述调整模块302根据所述对焦控制数据控制所述马达,以使所述镜片在所述马达的驱动下沿所述镜片的主光轴以所述预定移动速度(预定步幅)移动,从而使得所述镜头以所述预定对焦速度对所述二维码图像进行自动对焦。Specifically, the adjustment module 302 controls the motor according to the focus control data, so that the lens moves at the predetermined speed (predetermined step) along the main optical axis of the lens under the driving of the motor. moving, so that the lens automatically focuses on the two-dimensional code image at the predetermined focusing speed.

其中,所述预定移动速度(所述预定步幅)大于所述镜片的默认移动速度(默认步幅)。Wherein, the predetermined moving speed (the predetermined stride) is greater than the default moving speed (default stride) of the lens.

本发明的二维码图像扫描方法的第二实施例与上述第一实施例相似,不同之处在于:The second embodiment of the two-dimensional code image scanning method of the present invention is similar to the above-mentioned first embodiment, except that:

所述自动对焦参数还包括自动对焦起始位置。The autofocus parameter further includes an autofocus start position.

在所述步骤S502之前,所述S402包括:Before the step S502, the S402 includes:

S501、所述调整模块302根据所述对焦控制数据调整所述镜头的自动对焦起始位置,以使所述镜头从所述自动对焦起始位置开始对所述二维码图像进行自动对焦。S501. The adjustment module 302 adjusts the auto-focusing start position of the lens according to the focus control data, so that the lens starts to automatically focus on the two-dimensional code image from the auto-focusing start position.

由于用户在使用所述移动终端对所述二维码图像进行扫描时,一般都会将所述移动终端的所述镜头靠近所述二维码图像,因此,在这种情况下,从远端焦点开始对所述二维码图像进行对焦会使得所述镜头的自动对焦操作的效率十分低下。Since the user generally uses the mobile terminal to scan the two-dimensional code image, the lens of the mobile terminal is generally close to the two-dimensional code image. Therefore, in this case, from the far-end focus Starting to focus on the QR code image can make the autofocus operation of the lens very inefficient.

因此,在本实施例中,所述自动对焦起始位置可例如为近端焦点,即,所述调整模块302根据所述对焦控制数据将所述镜头的自动对焦起始位置调整为近端焦点,以使所述镜头从所述近端焦点开始对所述二维码图像进行自动对焦。这样可以使得所述镜头更快地完成自动对焦。Therefore, in this embodiment, the AF start position may be, for example, the near-end focus, that is, the adjustment module 302 adjusts the AF start position of the lens to the near-end focus according to the focus control data , so that the lens starts to automatically focus on the two-dimensional code image from the near-end focus. This allows the lens to autofocus faster.

在本实施例的二维码图像扫描方法中,所述步骤S502为:In the two-dimensional code image scanning method of this embodiment, the step S502 is:

在所述镜头对所述二维码图像进行自动对焦前,所述调整模块302根据所述对焦控制数据控制所述镜头的马达将所述镜头的镜片移动到所述预定位置,以使所述镜头从所述自动对焦起始位置开始对所述二维码图像进行对焦。Before the lens automatically focuses on the two-dimensional code image, the adjustment module 302 controls the motor of the lens according to the focus control data to move the lens of the lens to the predetermined position, so that the The lens starts to focus on the two-dimensional code image from the automatic focusing starting position.

其中,所述自动对焦起始位置与所述预定位置对应。Wherein, the auto focus starting position corresponds to the predetermined position.

具体地,在所述镜头对所述二维码图像进行自动对焦前,所述调整模块302根据所述对焦控制数据控制所述镜头的马达,以使所述镜片在所述马达的驱动下沿所述镜片的主光轴移动到所述近端焦点所对应的位置,从而使得所述镜头从所述近端焦点所对应的位置开始对所述二维码图像进行对焦。Specifically, before the lens automatically focuses on the two-dimensional code image, the adjustment module 302 controls the motor of the lens according to the focus control data, so that the lens is driven at the lower edge of the motor. The main optical axis of the lens is moved to the position corresponding to the near-end focus, so that the lens starts to focus on the two-dimensional code image from the position corresponding to the near-end focus.

也就是说,在本实施例中,所述调整模块302根据所述对焦控制数据控制所述马达,以使所述镜片在所述马达的驱动下沿所述镜片的主光轴移动到所述预定位置,并使得所述镜片在所述马达的驱动下从所述预定位置开始沿所述镜片的主光轴以所述预定移动速度(预定步幅)移动,从而使得所述镜头从所述预定位置开始以所述预设对焦速度对所述二维码图像进行自动对焦。That is to say, in this embodiment, the adjustment module 302 controls the motor according to the focus control data, so that the lens is driven by the motor to move along the main optical axis of the lens to the A predetermined position, and the lens is driven from the predetermined position to move along the main optical axis of the lens at the predetermined moving speed (predetermined step), so that the lens is moved from the predetermined position The predetermined position starts to automatically focus on the two-dimensional code image at the preset focusing speed.

通过上述技术方案,本发明能在实现获取到二维码信息的目的的前提下,通过控制所述镜头从所述自动对焦起始位置开始对所述二维码图像进行自动对焦,并且通过控制所述镜头以预定对焦速度对所述二维码图像进行自动对焦,因此可以节省所述镜头在扫描所述二维码图像时从远端焦点开始至近端焦点的扫描过程,同时可以加快所述镜头的镜片的移动速度,即,使得所述镜头以高于默认自动对焦速度的速度来对所述二维码图像进行对焦,因此可以有效地提高扫描所述二维码图像的速度。Through the above technical solutions, the present invention can automatically focus on the two-dimensional code image by controlling the lens to start from the auto-focusing starting position on the premise of achieving the purpose of acquiring the two-dimensional code information, and by controlling The lens automatically focuses on the two-dimensional code image at a predetermined focusing speed, so the scanning process from the far-end focus to the near-end focus when the lens scans the two-dimensional code image can be saved, and at the same time, all the The moving speed of the lens of the lens, that is, the lens focuses the two-dimensional code image at a speed higher than the default auto-focus speed, so the speed of scanning the two-dimensional code image can be effectively improved.

综上所述,虽然本发明实施例揭露如上,但上述实施例并非用以限制本发明,本领域的普通技术人员,在不脱离本发明的精神和范围内,均可作各种改动与润饰,因此本发明的保护范围以权利要求界定的范围为准。To sum up, although the embodiments of the present invention are disclosed as above, the above-mentioned embodiments are not intended to limit the present invention. Those of ordinary skill in the art can make various changes and modifications without departing from the spirit and scope of the present invention. Therefore, the protection scope of the present invention is subject to the scope defined by the claims.

Claims (5)

1. A two-dimensional code image scanning method is applied to a mobile terminal, and is characterized by comprising the following steps:
when the two-dimensional code image is scanned, automatic focusing control data are obtained;
adjusting automatic focusing parameters of a lens of the mobile terminal according to the automatic focusing control data, wherein the automatic focusing parameters comprise an automatic focusing initial position and an automatic focusing speed, and the automatic focusing initial position is a near-end focus so that the lens automatically focuses the two-dimensional code image from the automatic focusing initial position according to the automatic focusing parameters and according to a preset focusing speed;
controlling a motor of the lens to move a lens of the lens at a preset moving speed according to the preset focusing speed so that the lens automatically focuses the two-dimensional code image at the preset focusing speed, wherein the preset focusing speed corresponds to the preset moving speed, the preset moving speed is greater than the default moving speed of the lens, and the image definition obtained by focusing at the preset moving speed is less than the image obtained by focusing at the default moving speed;
and controlling the lens to scan the two-dimensional code image.
2. The two-dimensional code image scanning method according to claim 1, wherein the step of adjusting the auto-focus start position of the lens according to the focus control data comprises:
before the lens automatically focuses the two-dimensional code image, controlling a motor of the lens to move a lens of the lens to a preset position according to the focusing control data so that the lens starts to focus the two-dimensional code image from the automatic focusing initial position;
wherein the auto-focus starting position corresponds to the predetermined position.
3. A two-dimensional code image scanning device is applied to a mobile terminal, and is characterized by comprising:
the acquisition module is used for acquiring automatic focusing control data when the two-dimensional code image is scanned;
an adjusting module for adjusting the auto-focusing parameters of the lens of the mobile terminal according to the auto-focusing control data, the automatic focusing parameters comprise an automatic focusing initial position and an automatic focusing speed, the automatic focusing initial position is a near-end focus, so that the lens carries out automatic focusing on the two-dimensional code image according to the automatic focusing parameters from the automatic focusing initial position and the preset focusing speed, and is also used for controlling a motor of the lens to move a lens of the lens at the preset moving speed according to the preset focusing speed, so that the lens automatically focuses the two-dimensional code image at the predetermined focusing speed, wherein the predetermined focusing speed corresponds to the predetermined moving speed, the predetermined moving speed is greater than a default moving speed of the lens, focusing the acquired image definition at the preset moving speed to be smaller than focusing the acquired image at the default moving speed;
and the control module is used for controlling the lens to scan the two-dimensional code image.
4. The two-dimensional code image scanning device according to claim 3, wherein the adjusting module is configured to control a motor of the lens to move a lens of the lens to a predetermined position according to the focusing control data before the lens automatically focuses the two-dimensional code image, so that the lens starts to focus the two-dimensional code image from the automatic focusing start position;
wherein the auto-focus starting position corresponds to the predetermined position.
5. A mobile terminal characterized in that it comprises the two-dimensional code image scanning apparatus according to claim 3 or 4.
CN201610571434.6A 2016-07-19 2016-07-19 Two-dimensional code image scanning method and device and mobile terminal Active CN106131415B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610571434.6A CN106131415B (en) 2016-07-19 2016-07-19 Two-dimensional code image scanning method and device and mobile terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610571434.6A CN106131415B (en) 2016-07-19 2016-07-19 Two-dimensional code image scanning method and device and mobile terminal

Publications (2)

Publication Number Publication Date
CN106131415A CN106131415A (en) 2016-11-16
CN106131415B true CN106131415B (en) 2020-02-11

Family

ID=57289068

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610571434.6A Active CN106131415B (en) 2016-07-19 2016-07-19 Two-dimensional code image scanning method and device and mobile terminal

Country Status (1)

Country Link
CN (1) CN106131415B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106657799A (en) * 2017-03-02 2017-05-10 苏州摩比力特电子科技有限公司 Bar code scanning device and method based on phase detection
CN107358234A (en) * 2017-07-17 2017-11-17 上海青橙实业有限公司 The recognition methods of identification code and device
CN109670362A (en) * 2017-10-16 2019-04-23 上海商米科技有限公司 Bar code scanning method and device
CN108763998B (en) * 2018-04-17 2021-05-07 维沃移动通信有限公司 Bar code identification method and terminal equipment
CN109271890B (en) * 2018-08-29 2021-07-13 墨奇科技(北京)有限公司 Method and apparatus for automatic fingerprint image extraction
CN110248097B (en) * 2019-06-28 2021-02-23 Oppo广东移动通信有限公司 Focus tracking method and device, terminal equipment and computer readable storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1738362A (en) * 2005-09-09 2006-02-22 沈阳敏像科技有限公司 Camera module and control method for mobile phone capable of identifying authenticity of goods
CN1788270A (en) * 2003-02-13 2006-06-14 讯宝科技公司 Optical code reader with autofocus and interface unit
CN2857361Y (en) * 2005-09-09 2007-01-10 沈阳敏像科技有限公司 Pick-up module on cell phone able to identify false or real goods
CN101145194A (en) * 2006-09-15 2008-03-19 福建新大陆自动识别技术有限公司 Bar code recognizing apparatus focusing method

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3923866B2 (en) * 2002-07-19 2007-06-06 株式会社キーエンス Two-dimensional code reading device setting method, two-dimensional code reading setting device, two-dimensional code reading device setting program, and computer-readable recording medium
JP2008015274A (en) * 2006-07-06 2008-01-24 Olympus Imaging Corp Digital camera
JP5564996B2 (en) * 2009-07-23 2014-08-06 株式会社リコー Imaging apparatus and imaging method
JP2011138103A (en) * 2009-12-02 2011-07-14 Ricoh Co Ltd Imaging apparatus and method
CN102902132A (en) * 2012-10-30 2013-01-30 广东欧珀移动通信有限公司 Automatic focusing method and device
CN104503189A (en) * 2014-12-31 2015-04-08 信利光电股份有限公司 Automatic focusing method
CN105100605A (en) * 2015-06-18 2015-11-25 惠州Tcl移动通信有限公司 Mobile terminal and quick focusing method for photographing with the same

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1788270A (en) * 2003-02-13 2006-06-14 讯宝科技公司 Optical code reader with autofocus and interface unit
CN1738362A (en) * 2005-09-09 2006-02-22 沈阳敏像科技有限公司 Camera module and control method for mobile phone capable of identifying authenticity of goods
CN2857361Y (en) * 2005-09-09 2007-01-10 沈阳敏像科技有限公司 Pick-up module on cell phone able to identify false or real goods
CN101145194A (en) * 2006-09-15 2008-03-19 福建新大陆自动识别技术有限公司 Bar code recognizing apparatus focusing method

Also Published As

Publication number Publication date
CN106131415A (en) 2016-11-16

Similar Documents

Publication Publication Date Title
CN106131415B (en) Two-dimensional code image scanning method and device and mobile terminal
CN109981965B (en) Focusing method and electronic equipment
KR20140072114A (en) Method and apparatus with depth map generation
US10516819B2 (en) Electronic device with multiple lenses and lens switching method
JP2011508268A5 (en)
CN110557547A (en) Lens position adjusting method and device
US20170150045A1 (en) Device and method for generating a panoramic image
US20160277656A1 (en) Device having camera function and method of image capture
US20110115947A1 (en) Digital photographing apparatus, method of controlling digital photographing apparatus, and recording medium for storing program to execute method of controlling digital photographing apparatus
CN103685905A (en) Photographing method and electronic equipment
CN107942463A (en) Focusing method, device, computer equipment and readable storage medium
CN105827961A (en) Mobile terminal and focusing method
CN105376487A (en) A focusing method and device
JP6785395B2 (en) Imaging control device, imaging device, imaging control method, and imaging control program
CN104767937A (en) Photographing method
CN104243791A (en) Information processing method and electronic device
KR20210101009A (en) Method for Recording Video using a plurality of Cameras and Device thereof
CN105323491A (en) Image shooting method and device
US11792518B2 (en) Method and apparatus for processing image
US7684688B2 (en) Adjustable depth of field
EP2760197A1 (en) Apparatus and method for processing image in mobile terminal having camera
CN103179349A (en) Automatic photographing method and device
CN104601883B (en) A kind of method and device of image taking
US20150130966A1 (en) Image forming method and apparatus, and electronic device
CN110419210A (en) Photographic device, image capture method and imaging program

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information
CB02 Change of applicant information

Address after: Changan town in Guangdong province Dongguan 523860 usha Beach Road No. 18

Applicant after: OPPO Guangdong Mobile Communications Co., Ltd.

Address before: Changan town in Guangdong province Dongguan 523860 usha Beach Road No. 18

Applicant before: Guangdong Opel Mobile Communications Co., Ltd.

GR01 Patent grant
GR01 Patent grant