Imaging method, device and storage medium

By storing the current identifiers for near-range and long-range focusing in the color imaging module, the processor drives the motor to adjust the lens focal length, solving the problem that the 3D structured light module cannot support both long-range and near-range payments at the same time, realizing the integration of multiple payment methods and reducing merchant equipment costs.

CN114140100BActive Publication Date: 2025-09-05SHENZHEN ANSIJIANG TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202111426689.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-27
Publication Date
2025-09-05
Estimated Expiration
2041-11-27

AI Technical Summary

Technical Problem

Due to the limited processing power of the processor, the existing 3D structured light module cannot support both long-distance face-scanning payment and close-range code scanning payment in fixed focal length mode. As a result, merchants need two payment devices, which increases costs.

Method used

By storing the current identifiers for close-range and long-range focusing in the color imaging module, the processor determines the imaging mode based on the payment method and drives the motor to adjust the lens focal length to achieve clear imaging at close and long distances.

Benefits of technology

The 3D structured light module supports both face-scanning payment and QR code scanning payment on one device, reducing the equipment costs for merchants.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114140100B_ABST
    Figure CN114140100B_ABST
Patent Text Reader

Abstract

The present application discloses an imaging method, device and storage medium, which belong to the field of imaging. The method is applied to a 3D structured light module including a processor and a color imaging module, including: the processor determines the imaging mode, and sends an imaging instruction corresponding to the imaging mode to the color imaging module. If the color imaging module receives an imaging instruction corresponding to the close-range imaging mode, it obtains a first current identifier, performs close-range focusing according to the first current identifier, and obtains a first color image of the close-range object. If the color imaging module receives an imaging instruction corresponding to the long-range imaging mode, it obtains a second current identifier, performs long-range focusing according to the second current identifier, and obtains a second color image of the long-range object. In this way, the color imaging module can achieve clear imaging of close-range objects and long-range objects, so that the 3D structured light module can simultaneously realize face-swiping payment and code scanning payment, expand payment methods, and reduce the cost of merchant payment equipment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of imaging, and in particular to an imaging method, device, and storage medium. Background Art

[0002] From cash payments to card payments to QR code payments, people are increasingly demanding more secure and convenient payment methods. With technological advancements, facial payment, centered around 3D (three-dimensional) facial recognition, has emerged as a new payment method, offering advantages such as increased security and convenience. 3D structured light imaging, which enables 3D facial recognition, is widely used in applications such as facial payment.

[0003] In the prior art, 3D structured light imaging can be achieved using a 3D structured light module. The 3D structured light module comprises a processor, a color imaging module, an infrared transmitter module, and an infrared receiver module. The infrared transmitter module is used to emit modulated infrared light toward a target object. The color imaging module is used to image the visible light reflected by the target object, generating a color image of the target object. The infrared receiver module is used to image the infrared light reflected by the target object, generating an infrared speckle image of the target object. The processor is used to acquire a color image and an infrared speckle image of the target object, generate a depth image of the target object based on the infrared speckle image, and then generate a color image with 3D information based on the color image and depth image. This allows for facial recognition based on the generated color image with 3D information, enabling facial payment. Due to the limited processing power of the processor, the color imaging module uses a fixed focal length mode to focus on a target object at a preset distance to achieve a clear image of the target object at the preset distance. Focusing refers to positioning the lens to a position where a clear image of the target object is obtained. The clear image position varies depending on the distance between the lens and the target object.

[0004] However, the facial recognition distance of face-swiping payment is approximately 30cm-100cm (long distance), while the recognition distance of other payment methods may not be within the facial recognition distance range. For example, the recognition distance of code scanning payment is approximately 5cm-30cm (close distance). When the color imaging module adopts a fixed focal length mode and focuses on distant target objects to realize face-swiping payment, the ability to realize other payment methods such as scanning payment that require close-range focusing is limited, thereby limiting the payment methods supported by the 3D structured light module. In this way, merchants will need two payment devices to realize face-swiping payment and payment method respectively, which increases the cost of merchant payment devices. Summary of the Invention

[0005] This application provides an imaging method, device, and storage medium that can enable 3D structured light modules to simultaneously implement face-scanning payment and code scanning payment, expand the payment methods supported by 3D structured light modules, and reduce the cost of merchant payment equipment. The technical solution is as follows:

[0006] In a first aspect, an imaging method is provided, which is applied to a 3D structured light module, wherein the 3D structured light module includes at least a processor and a color imaging module, and the method includes:

[0007] The processor determines a currently required imaging mode and sends an imaging instruction corresponding to the imaging mode to the color imaging module, where the imaging mode includes a close-range imaging mode and a long-range imaging mode. The imaging instruction corresponding to the close-range imaging mode is a first imaging instruction, and the imaging instruction corresponding to the long-range imaging mode is a second imaging instruction.

[0008] If the color imaging module receives the first imaging instruction sent by the processor, it obtains the stored first current identifier, performs close-range focusing according to the first current identifier, so as to clearly image the close-range object and obtain a first color image of the close-range object;

[0009] If the color imaging module receives the second imaging instruction sent by the processor, it obtains the stored second current identifier, performs long-distance focusing according to the second current identifier, so as to clearly image the distant object and obtain a second color image of the distant object.

[0010] In one embodiment, the color imaging module includes a motor driver chip, a motor, and a lens, wherein the motor driver chip is used to set a driving current of the motor, and the motor is used to drive the lens to move;

[0011] The performing close-range focusing according to the first current identifier includes:

[0012] The motor driving chip sets the driving current of the motor to the first current indicated by the first current identifier, so that the motor drives the lens to move to a position where a close-up object can be imaged clearly;

[0013] The performing long-distance focusing according to the second current identifier includes:

[0014] The motor driving chip sets the driving current of the motor to the second current indicated by the second current identifier, so that the motor drives the lens to move to a position where a distant object can be imaged clearly.

[0015] In one embodiment, the color imaging module includes a motor and a lens, the motor includes a motor body and a spring, and the motor body is used to drive the spring to push the lens to move according to an input driving current;

[0016] The second current indicated by the second current identifier is located in a nonlinear region of the motor posture curve, where the nonlinear region refers to a driving current interval in which the deformation of the spring is not affected by the posture of the lens.

[0017] In one embodiment, before the processor determines the currently required imaging mode, the process further includes:

[0018] determining a third current, wherein the third current is located in the nonlinear region;

[0019] determining a fourth current based on the gravity of the lens and the third current, wherein the fourth current is a driving current capable of enabling the motor to drive the lens to move to a position where a distant object can be clearly imaged under the influence of the gravity of the lens;

[0020] When the input current to the motor is equal to the driving current of the fourth current, the motor and the lens are assembled to obtain the color imaging module;

[0021] determining, as the second current, a driving current capable of causing the motor to drive the lens to move to a position where a distant object can be clearly imaged when the assembled color imaging module is placed horizontally;

[0022] The second current identifier corresponding to the second current is stored in the color imaging module.

[0023] In one embodiment, after assembling the motor and the lens to obtain the color imaging module, the method further includes:

[0024] determining, as the first current, a driving current capable of causing the motor to drive the lens to move to a position where a close-range object can be clearly imaged when the assembled color imaging module is placed horizontally;

[0025] The first current identifier corresponding to the first current is stored in the color imaging module.

[0026] In one embodiment, obtaining the stored second current identifier includes:

[0027] The color imaging module obtains the tilt angle of the color imaging module, and obtains the driving current identifier corresponding to the tilt angle of the color imaging module from the stored second correspondence as the second current identifier. The second correspondence stores different tilt angles of the color imaging module and the corresponding driving current identifiers for achieving long-distance focusing.

[0028] In one embodiment, obtaining the stored first current identifier includes:

[0029] The color imaging module obtains the tilt angle of the color imaging module, and obtains the driving current identifier corresponding to the tilt angle of the color imaging module from the stored first correspondence as the first current identifier. The first correspondence stores different tilt angles of the color imaging module and corresponding driving current identifiers for achieving close-range focusing.

[0030] In one embodiment, the 3D structured light module further includes an angle detection module;

[0031] The angle detection module is used to detect the tilt angle of the color imaging module and send the tilt angle of the color imaging module to the color imaging module.

[0032] In one embodiment, the first current identifier and the second current identifier are burned into a memory of the color imaging module or burned into a memory of an imaging chip of the color imaging module.

[0033] In one embodiment, the processor determines the currently required imaging mode, including:

[0034] The processor determines a payment method corresponding to the payment instruction;

[0035] If the processor determines that the payment method is code scanning payment, then determining that the currently required imaging mode is the close-range imaging mode;

[0036] If the processor determines that the payment method is face recognition payment, it determines that the currently required imaging mode is the long-distance imaging mode.

[0037] In a second aspect, a computer device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program implements the above-mentioned imaging method when executed by the processor.

[0038] According to a third aspect, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the above-mentioned imaging method is implemented.

[0039] The beneficial effects of the technical solution provided by the embodiments of the present application are:

[0040] In an embodiment of the present application, the 3D structured light module includes at least a processor and a color imaging module. The processor determines the currently required imaging mode and sends an imaging instruction corresponding to the imaging mode to the color imaging module. If the color imaging module receives an imaging instruction corresponding to the close-range imaging mode, it obtains the stored first current identifier, performs close-range focusing according to the first current identifier, and obtains a first color image of the close-range object. If the color imaging module receives an imaging instruction corresponding to the long-range imaging mode, it obtains the stored second current identifier, performs long-range focusing according to the second current identifier, and obtains a second color image of the long-range object. That is, the 3D structured light module supports both close-range imaging mode and long-range imaging mode. The color imaging module in the 3D structured light module stores a first current identifier corresponding to the close-range imaging mode and a second current identifier corresponding to the long-range imaging mode. Clear imaging of close-range objects can be achieved according to the first current identifier in the close-range imaging mode, and clear imaging of long-range objects can be achieved according to the second current identifier in the long-range imaging mode. In this way, the 3D structured light module can support both face-scanning payment that requires long-distance recognition and code scanning payment that requires close-range recognition, thereby expanding the payment methods that the 3D structured light module can support and reducing the cost of merchant payment equipment. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0042] Figure 1 This is a schematic structural diagram of a 3D structured light module provided in an embodiment of the present application;

[0043] Figure 2 This is a flow chart of a method for storing current identification provided by an embodiment of the present application;

[0044] Figure 3 This is a flowchart of another method for storing current identification provided by an embodiment of the present application;

[0045] Figure 4 is a posture curve diagram of the motor provided in an embodiment of the present application;

[0046] Figure 5 is a flow chart of an imaging method provided in an embodiment of the present application;

[0047] Figure 6 Schematic diagram of the color imaging module structure provided in an embodiment of the present application;

[0048] Figure 7 A schematic diagram of the structure of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0049] In order to make the objectives, technical solutions and advantages of this application clearer, the implementation methods of this application will be further described in detail below with reference to the accompanying drawings.

[0050] It should be understood that the “multiple” mentioned in this application refers to two or more. In the description of this application, unless otherwise specified, “ / ” means or, for example, A / B can mean A or B; “and / or” in this article is merely a description of the association relationship of associated objects, indicating that there can be three relationships, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, in order to facilitate the clear description of the technical solution of this application, words such as “first” and “second” are used to distinguish between identical or similar items with basically the same functions and effects. Those skilled in the art can understand that words such as “first” and “second” do not limit the quantity and execution order, and words such as “first” and “second” do not necessarily limit them to be different.

[0051] Before explaining the embodiments of the present application in detail, the application scenarios of the embodiments of the present application are first explained.

[0052] Nowadays, people carry less and less cash, and non-cash payment methods have become the mainstream of market transactions. Among them, one of the most widely used non-cash payment methods is QR code payment. With the advancement of technology, facial recognition payment has emerged as a more convenient and secure payment method.

[0053] Among them, code scanning payment first uses 2D imaging to identify the target object, generates a 2D color image of the target object, and then realizes the code scanning payment based on the association between the 2D color image and the payment account. Among them, 2D imaging can be achieved through the color imaging module.

[0054] Face payment is a new payment method based on 3D facial recognition. It uses 3D structured light imaging to generate a 3D facial image of the consumer, and then uses the association between the 3D facial image and the payment account to enable payment. 3D structured light imaging is achieved through a 3D structured light module, which includes a color imaging module, an infrared transmitter module, an infrared receiver module, and a processor.

[0055] For face-swiping payment, due to the limited processing power of the processor of the 3D structured light module, it is unable to support the autofocus algorithm to achieve autofocus, so the color imaging module in the 3D structured light module adopts a fixed focal length mode. The fixed focal length mode means that the distance between the imaging chip and the lens in the color imaging module is fixed, that is, the target object at the preset distance is clearly imaged. Therefore, for face-swiping payment, the color imaging module adopts a fixed focal length mode to clearly image the target object at a distance of about 30cm-100cm (the recognition distance of face payment). Based on this, due to the different distances from the target object and the different positions of the clear imaging, the color imaging module of the 3D structured light module cannot clearly image the target object at a close distance of about 5cm-30cm (the recognition distance of the scan code payment) when using a fixed focal length mode to clearly image the target object at a distance.

[0056] That is, while the color imaging module of a 3D structured light module uses a fixed focal length mode to support long-range focusing for long-range recognition for face-scanning payment, it may not be able to focus at close range, meaning it cannot clearly image close-up objects. Consequently, it cannot accurately perform close-range recognition for code scanning payment, thus limiting the payment methods supported by the 3D structured light module. Consequently, merchants will need two payment devices to support face-scanning payment and code scanning payment, respectively, increasing the cost of merchant payment devices.

[0057] Based on this, the present application provides an imaging method, device and storage medium, which are applied to a 3D structured light module that can support both short-range imaging mode and long-range imaging mode. The 3D structured light module can realize payment methods such as face-swiping payment that require long-range recognition, while also realizing payment methods such as code scanning payment that require short-range recognition, thereby expanding the payment methods supported by the 3D structured light module and reducing the cost of merchant payment equipment.

[0058] The imaging method provided in the embodiment of the present application can be applied to payment scenarios that simultaneously realize face-swiping payment and code scanning payment, and can also be applied to other scenarios that require simultaneous long-distance recognition and close-range recognition. The embodiment of the present application does not limit the application scenarios of the imaging method.

[0059] Please refer to Figure 1 , Figure 1 This is a schematic diagram of the structure of a 3D structured light module provided in an embodiment of the present application. Figure 1 As shown, the 3D structured light module includes a processor 101 , a color imaging module 102 , an infrared transmitting module 103 and an infrared receiving module 104 .

[0060] The processor 101 is used to determine the currently required imaging mode and, based on the determined imaging mode, sends corresponding control instructions to the color imaging module 102, infrared emission module 103, or infrared reception module 104 to enable the 3D structured light module to operate in different imaging modes. The imaging modes include short-range imaging mode and long-range imaging mode.

[0061] For example, based on the determined imaging mode, the processor 101 may send an imaging instruction corresponding to the imaging mode to the color imaging module 102. For example, if the processor 101 determines that the imaging mode is the short-range imaging mode, the processor 101 may send a first imaging instruction corresponding to the short-range imaging mode to the color imaging module 102. If the processor 101 determines that the imaging mode is the long-range imaging mode, the processor 101 may send a second imaging instruction corresponding to the long-range imaging mode to the color imaging module 102.

[0062] In addition, if the processor 101 determines that the imaging mode is the long-distance imaging mode, it may also send a transmission instruction to the infrared transmitting module 103 and a third imaging instruction to the infrared receiving module 104. The transmission instruction is used to instruct the infrared transmitting module 103 to transmit infrared light, and the third imaging instruction is used to instruct the infrared receiving module 104 to obtain a current identifier corresponding to the long-distance imaging mode, perform long-distance focusing based on the obtained current identifier, so as to clearly image the long-distance object based on the infrared light reflected by the long-distance object, and generate an infrared speckle image of the long-distance object.

[0063] For example, if the processor 101 determines that the imaging mode is the long-distance imaging mode, it controls the infrared transmitting module 103 and the infrared receiving module 104 to start, and sends a transmitting instruction to the infrared transmitting module 103 and sends a third imaging instruction to the infrared receiving module 104.

[0064] As an example, the processor 101 may be a device or apparatus having a processing function. For example, the processor 101 may include one or more processing cores, such as a quad-core processor, an octa-core processor, and the like.

[0065] Among them, if the color imaging module 102 receives the first imaging instruction sent by the processor 101, it is used to obtain the stored first current identifier, perform close-range focusing according to the first current identifier, so as to clearly image the close-range object and obtain a first color image of the close-range object.

[0066] Among them, the color imaging module 102 is also used to obtain the stored second current identifier if it receives the second imaging instruction sent by the processor 101, and perform long-distance focusing according to the second current identifier to clearly image the distant object and obtain a second color image of the distant object.

[0067] As an example, the color imaging module 102 may be a color camera, and may include a motor driving chip, a motor, and a lens, wherein the lens is connected to the motor.

[0068] The motor driver chip is used to set the driving current of the motor, and the motor is used to drive the lens to move so that the lens moves to a position where the image is clear.

[0069] For example, the motor driver chip sets different drive currents for the motor based on the current identifiers corresponding to different imaging modes. The motor can drive the lens to move according to the input drive current, enabling the color imaging module 102 to clearly image objects at different distances. The motor includes a motor body and a spring. The motor body is used to drive the spring to push the lens to move according to the input drive current.

[0070] Color imaging module 102 also includes an imaging chip and a circuit board. The imaging chip converts visible light signals reflected by the target object into electrical signals to output a color image. The circuit board secures the imaging chip and motor driver chip and provides power to them.

[0071] As an example, the color imaging module 102 is further configured to send the first color image to the processor 101. The processor 101 can obtain the first color image of the close-up object so as to implement other payment methods such as code scanning payment that require close-up recognition based on the obtained color image.

[0072] In addition, the color imaging module 102 is further configured to send the second color image to the processor 101. The processor 101 can obtain the second color image and infrared speckle image of a distant object, generate a depth image of the distant object based on the infrared speckle image, and generate a 3D color image containing 3D information based on the second color image and the depth image. This allows for subsequent remote recognition-based face-swiping payment and other payment methods based on the generated 3D color image. For example, face recognition based on the second color image and the depth image can enable face-swiping payment.

[0073] For example, a 3D structured light module can be integrated into a payment device, which includes a 3D structured light module and a payment module. The processor 101 of the 3D structured light module sends a first color image to the payment module, which receives the first color image sent by the processor 101 and implements scan code payment based on the association between the first color image and the payment account. Alternatively, the processor 101 of the 3D structured light module sends a 3D color image to the payment module, which receives the 3D color image sent by the processor 101 and implements face-scanning payment based on the association between the 3D color image and the payment account.

[0074] It should be noted that by setting different imaging modes of the color module 102 and pre-storing current identifiers corresponding to different imaging modes in the color imaging module 102, the color imaging module 102 can achieve clear imaging of close-range objects according to the first current identifier in the close-range imaging mode, and achieve clear imaging of long-range objects according to the second current identifier in the long-range imaging mode, thereby avoiding the problem that when the color imaging module 102 supports long-range focus to achieve long-range recognition of face-swiping payment, other payment methods such as code scanning payment that require close-range recognition may not be quickly realized or cannot be realized. The 3D structured light module can support payment methods such as face-swiping payment that require long-range recognition while also supporting payment methods such as code scanning payment that require close-range recognition, expanding the payment methods supported by the 3D structured light module. A variety of payment paradigms can be realized through a payment collection device that integrates the 3D structured light module, reducing the cost of merchant payment collection equipment.

[0075] The infrared transmitting module 103 is used to transmit modulated infrared light to a distant object. For example, the infrared transmitting module 103 projects a light spot with a specific code onto the distant object.

[0076] As an example, after receiving the transmission instruction, the infrared transmission module 103 transmits modulated infrared light to a distant object, wherein the transmission instruction can be sent by the processor 101 or by other devices or equipment, and the embodiments of the present application do not limit this.

[0077] As an example, the infrared emission module 103 may be an invisible infrared light emission source, such as a laser or a light emitting diode.

[0078] The infrared receiving module 104 is used to perform imaging based on infrared light reflected from a distant object, thereby generating an infrared speckle image of the distant object.

[0079] In addition, the infrared receiving module 104 can also send the infrared speckle image to the processor 101. The processor 101 receives the infrared speckle image, generates a depth image of the distant object based on the infrared speckle image, and generates a 3D color image of the distant object based on the second color image and the depth image.

[0080] For example, the processor 101 receives an infrared speckle image of a distant object sent by the infrared receiving module 104, calculates the distance between each point of the distant object and the infrared receiving module 104 based on the offset or distortion of the light spots in the infrared speckle image, and obtains a depth image of the distant object based on the calculated distance.

[0081] As an example, the infrared receiving module 104 is further configured to obtain a current identifier corresponding to the long-distance imaging mode after receiving the third imaging instruction, and perform long-distance focusing according to the current identifier.

[0082] As an example, the infrared receiving module 104 may be an infrared camera, and the infrared receiving module 104 may include a motor and a lens.

[0083] As an example, the 3D structured light module can also include an infrared fill light module 105. The external fill light module 105 is used to perform fill light according to the fill light strategy in a dark environment, and emit uniform infrared light so that the infrared receiving module 104 generates a uniform infrared image, so that the processor 101 generates a 3D infrared image of a distant object based on the infrared image and the depth image.

[0084] It should be noted that the 3D structured light module can include Figure 1 More or less components are shown, for example, the 3D structured light module includes a processor 101 and a color imaging module 102. In addition, the imaging method proposed in this application can be applied to Figure 1 In the 3D structured light module shown.

[0085] It should be noted that before the color imaging module responds to the imaging instruction of the processor, the first current identifier and the second current identifier need to be stored in advance. For example, the first current identifier and the second current identifier can be stored by burning the first current identifier and the second current identifier in the color imaging module. Figure 2 The embodiment shown and Figure 3 The embodiment shown provides a detailed description of the method for storing the first current identifier and the second current identifier.

[0086] Please refer to Figure 2 , Figure 2 This is a flow chart of a method for storing a current identifier provided by an embodiment of the present application, the method comprising the following steps:

[0087] Step 201: Determine a third current, and determine a fourth current based on the gravity of the lens and the third current.

[0088] The third current lies within the nonlinear region of the motor attitude curve. This region represents the driving current range in which the motor's spring deformation is unaffected by the lens's attitude. The fourth current is the driving current required to enable the motor to move the lens to a position that provides clear imaging of distant objects under the influence of the lens's gravity. The lens's attitude refers to the different tilt angles at which the lens is positioned.

[0089] As an example, the motor is a voice coil motor. The motor includes a motor body and a spring. The motor body includes a carrier, a coil, and a magnet. The motor body is used to drive the spring to push the lens to move according to the input drive current. The carrier is used to fix the lens, and the lens is connected to the spring. The deformation of the spring changes the position of the lens fixed on the carrier. When different drive currents are input to the motor, the coil and magnet generate different magnetic forces. The magnetic force changes the deformation of the spring, thereby pushing the lens to move, changing the distance between the lens and the imaging chip, and therefore the distance between the lens and the target object, thereby changing the distance between the lens and the target object, thereby imaging the target object clearly.

[0090] The relationship between the motor's drive current and the motor's spring deformation can be found in Figure 4 . Figure 4 The graph is a graph of the motor posture provided by the embodiment of the present application, which is used to indicate the corresponding relationship between the motor driving current and the motor spring deformation under different lens postures. Figure 4 As shown, the horizontal axis represents the motor driving current, and the vertical axis represents the motor spring deformation, that is, the displacement of the lens pushed by the motor. Curve 401 represents the spring deformation of the motor when the lens is placed vertically downward, that is, when the lens posture is -90°, and different driving currents are input to the motor. Curve 402 represents the spring deformation of the motor when the lens is placed horizontally, that is, when the lens posture is 0°, and different driving currents are input to the motor. Curve 403 represents the spring deformation of the motor when the lens is placed vertically upward, that is, when the lens posture is 90°, and different driving currents are input to the motor.

[0091] For example, regarding curve 402, when the lens is positioned horizontally, the motor's spring may deform differently depending on the drive current applied. Because the distance between the lens and the target object varies, the position of a clear image varies. Therefore, by applying different drive currents to the motor, the spring's deformation can be varied. This spring's deformation can then move the lens to a clear image position, achieving focus.

[0092] from Figure 4It can be concluded that the deformation of the spring is not only affected by the driving current, but also by the area where the driving current is located and the posture of the lens. If the area where the driving current is located is a nonlinear area (the first nonlinear area or the second nonlinear area), the deformation of the motor spring is only affected by the driving current, and is not affected by the posture of the lens. If the area where the driving current is located is a linear area, the deformation of the motor spring is not only affected by the driving current, but also by the posture of the lens. For example, for curve 401, curve 402 and curve 403, when the same driving current is input to the motor and the driving current is in the linear area, the deformation of the corresponding motor spring is different, with a difference of about 50um. This is because the posture of the lens is different, and the magnitude of the gravity of the lens on the spring is different, which leads to different deformation of the spring.

[0093] However, when the processing capability of the processor of the 3D structured light module is limited, the color imaging module usually adopts a fixed focus mode to clearly image the target object at a preset distance.

[0094] For example, the color imaging module uses a fixed focal length mode to clearly image a target object at a preset distance. In this case, the color imaging module does not include a motor, the lens is placed in a fixed position and remains unchanged, and the position of the lens allows the color imaging module to clearly image a target object at a preset distance. However, this situation allows the color imaging module to only clearly image a target object at a long distance or a target object at a close distance, and it is impossible to achieve two imaging modes. Therefore, the embodiment of the present application adopts the burning current method used in autofocus to enable the color imaging module to achieve two imaging modes.

[0095] In one embodiment of the present application, a motor is used to burn in a current to enable the color imaging module to achieve two imaging modes. For example, a fixed current identifier corresponding to the long-distance imaging mode is pre-burned into the color imaging module. For example, the driving current that enables the motor to drive the lens to a position where a clear image of a distant object is obtained when the color imaging module is placed horizontally is first determined. This driving current corresponds to the horizontal coordinate of curve 402, and then the current identifier corresponding to the driving current is obtained and stored. Since the color imaging module has been assembled, this driving current has already been determined.

[0096] However, if the driving current is in the linear region, when the color imaging module is tilted in an arbitrary posture, it will be affected by the gravity of the lens. On the basis of the deformation of the spring caused by the driving current, the deformation of the spring caused by gravity will be superimposed. That is, a displacement will be superimposed on the original position of the lens when a target object at a certain distance is clearly imaged, such as curve 401 or curve 403. As a result, under this driving current, a target object at a certain distance cannot be clearly imaged, resulting in a blurred color image obtained by the color imaging module, which reduces the payment efficiency and payment success rate.

[0097] That is, if the driving current is in the linear region, the driving current can enable the color imaging module to clearly image the target object at a preset distance when it is placed in a preset posture. However, if the color imaging module is in other postures, due to the influence of the gravity of the lens, under this driving current, the color imaging module cannot clearly image the target object at the preset distance, and the color image obtained by the color imaging module is relatively blurred, reducing the payment efficiency and payment success rate.

[0098] To address the aforementioned issues, embodiments of the present application assemble a color imaging module such that the drive current for the assembled color imaging module, when achieving clear long-distance imaging, is within a nonlinear region, thereby preventing the spring deformation from varying with the lens's posture. For example, for curves 401, 402, and 403, when the same drive current is input to the motors and that drive current is within the nonlinear region, the spring deformations of the corresponding motors are substantially the same.

[0099] As an example, the current identifier is used to uniquely indicate the driving current. The current identifier can be a digital code or an alphabetic code, etc., which is not limited in the embodiments of the present application.

[0100] For example, the current identifier is an integer digital code, and the current identifier indicates the driving current with a decimal point. For example, if the current identifier is an integer code in the range of 0 to 1024, the driving current range is a driving current with a decimal point in the range of -120mA to 120mA. Among them, the current identifier 0 indicates a driving current of -120mA, and the current identifier 1024 indicates a driving current of 120mA. Of course, the current identifier interval can also be other, such as the range of 0 to 2048, and the embodiment of the present application is not limited to this.

[0101] As an example, the current value of the driving current indicated by the coded value of the current identifier can be obtained by a large number of measurements and statistics in advance, for example, by measuring and counting the current identifier and driving current corresponding to clear imaging of a color imaging module.

[0102] As an example, the third current may be located at Figure 4 The first nonlinear region shown can also be located at Figure 4 The second nonlinear zone is shown. The first nonlinear zone and the second nonlinear zone are different from the linear zone. The linear zone refers to the driving current interval in which the deformation of the motor spring is affected by the driving current and the lens posture. The first nonlinear zone and the second nonlinear zone refer to the driving current interval in which the deformation of the motor spring is not affected by the lens posture. The driving current in the first nonlinear zone is smaller than the driving current in the linear zone, and the driving current value in the second nonlinear zone is greater than the driving current in the linear zone. And since the driving current interval of the first nonlinear zone is larger than that of the second nonlinear zone, the embodiment of the present application preferably selects the drive current interval located in the following manner: Figure 4The current in the first nonlinear region is shown as the third current. For example, -70 μm is selected from the first nonlinear region as the third current.

[0103] Step 202 : When the motor input current is equal to the driving current of the fourth current, the motor and the lens are assembled to obtain a color imaging module.

[0104] The spring deformation corresponding to the fourth current is equal to the sum of the spring deformation corresponding to the third current and the spring deformation corresponding to the lens gravity.

[0105] For example, the lens is fixed vertically to the motor, a fourth current is input to the motor, and the motor and lens are assembled through the AA (Active Alignment) process to obtain a color imaging module. When the fourth current is input to the motor during the active alignment process, the lens and imaging chip can clearly image distant objects.

[0106] In addition, the color imaging module further includes a motor driving chip, and the motor driving current is set to the fourth current through the motor driving chip.

[0107] Step 203 : determining as a second current a driving current that enables the motor-driven lens to move to a position where a distant object can be clearly imaged when the assembled color imaging module is placed horizontally, and storing a second current identifier corresponding to the second current in the color imaging module.

[0108] The long-distance object refers to a target object whose distance from the color imaging module is in a long-distance range, for example, the long-distance range is between 30 cm and 100 cm.

[0109] For example, the assembled color imaging module is first placed horizontally. A specific drive current is input to the motor, causing the spring to deform in response to the drive current, pushing the lens to a position where a clear image of a distant object can be obtained. This specific drive current is used as the second current. A current identifier corresponding to the second current is then obtained and stored in the color imaging module as the second current identifier, which is used to indicate the second current. In this way, when the color imaging module is used to image a distant object, the second current identifier is obtained, and based on the second current identifier, the color imaging module can clearly image the distant object.

[0110] The current value of the second current is close to the current value of the third current. Since the spring deformation corresponding to the fourth current is equal to the sum of the spring deformation corresponding to the third current and the spring deformation corresponding to the lens's gravity, and when the assembled color imaging module is placed horizontally, the lens's gravity has no effect on the motor's spring deformation, in this case, the spring deformation corresponding to the second current is not significantly different from the spring deformation corresponding to the third current. Therefore, the current value of the second current is close to the current value of the third current. Furthermore, since the third current is located in the nonlinear region of the motor attitude curve, the second current indicated by the second current indicator is also located in the nonlinear region of the motor attitude curve.

[0111] As an example, the driving current identifier that enables the motor-driven lens to move to a position where distant objects can be clearly imaged after the assembled color imaging module is placed horizontally can also be directly determined, and the driving circuit identifier can be stored as a second current identifier in the color imaging module.

[0112] It should be noted that, because the spring's deformation within the nonlinear region is unaffected by the lens's posture, the second current indicated by the second current indicator enables the color imaging module to clearly image distant objects regardless of its posture, thus preventing the spring's deformation from being affected by the lens's posture. In other words, regardless of the color imaging module's posture, as long as the motor input drive current is the second current indicated by the second current indicator, the color imaging module can consistently capture clear images of distant objects.

[0113] As an example, the second current identifier may be burned into the memory of the color imaging module or burned into the memory of the imaging chip of the color imaging module. The embodiment of the present application does not limit the storage space of the second current identifier.

[0114] As an example, the imaging mode of the color imaging module when clearly imaging a distant object may be called a long-distance imaging mode, and the second current identifier corresponds to the long-distance imaging mode.

[0115] Step 204 : determining as a first current a driving current that enables the motor-driven lens to move to a position where close-range objects can be clearly imaged when the assembled color imaging module is placed horizontally, and storing a first current identifier corresponding to the first current in the color imaging module.

[0116] A close-range object refers to an object that is within a close-range interval from the color imaging module. The distances in the close-range interval are smaller than those in the long-range interval. For example, the close-range interval is between 5cm and 30cm, and the long-range interval is between 30cm and 100cm.

[0117] For example, the assembled color imaging module is first placed horizontally. A certain driving current is input into the motor so that the deformation of the spring corresponding to the driving current pushes the lens to a position where a clear image of a close-up object is obtained. This certain driving current is used as the first current. A current identifier corresponding to the first current is then obtained and stored in the color imaging module as the first current identifier. The first current identifier is used to indicate the first current. In this way, when using the color imaging module to image a close-up object, the first current identifier is obtained, and based on the first current identifier, the color imaging module can clearly image the close-up object.

[0118] As an example, the first current identifier may be burned into the memory of the color imaging module or burned into the memory of the imaging chip of the color imaging module. The embodiment of the present application does not limit the storage space of the first current identifier.

[0119] If the second current is in the first nonlinear region, the current of the first current is greater than the maximum value of the first nonlinear region, that is, the first current is in the linear region. Figure 4 As shown, the first current is in the linear region and near the first nonlinear region. That is, when the color imaging module is in different postures, the deformation of the spring is affected by the posture of the color imaging module. However, in the region near the first nonlinear region, the change in the spring deformation corresponding to the same drive current when the color imaging module is in different postures is small. In other words, the influence of the color imaging module's posture on the spring deformation is small. Therefore, when the drive current input to the motor is the first current, the color imaging module can still clearly image close objects when placed in different postures.

[0120] As an example, the driving current identifier that enables the motor-driven lens to move to a position where close-range objects can be clearly imaged after the assembled color imaging module is placed horizontally can also be directly determined, and the driving circuit identifier can be stored as the first current identifier in the color imaging module.

[0121] Alternatively, referring to the principle of assembling the motor and lens by inputting a driving current in a nonlinear region into the motor in steps 201 and 202, an infrared receiving module can be assembled, and a driving current that enables the motor to drive the lens to a position where a distant object can be clearly imaged when the assembled infrared receiving module is placed horizontally can be determined as a fifth current, and a fifth current identifier corresponding to the fifth current can be stored in the infrared receiving module. The fifth current is located in the nonlinear region of the motor attitude curve. Furthermore, a driving current that enables the motor to drive the lens to a position where a close-up object can be clearly imaged when the assembled infrared receiving module is placed horizontally can be determined as a sixth current, and a sixth current identifier corresponding to the sixth current can be stored in the infrared receiving module.

[0122] As an example, in face recognition mode, the infrared receiving module operates when the processor determines that the imaging mode is long-distance imaging mode. In this case, the infrared receiving module can be configured to store the sixth current identifier corresponding to the long-distance imaging mode through the aforementioned method. Based on this, when in operation, the infrared receiving module obtains the fifth current identifier corresponding to the long-distance imaging mode, performs long-distance focusing based on the fifth current identifier, and generates an infrared speckle image of the long-distance object using infrared light reflected from the long-distance object.

[0123] As an example, the imaging mode of the color imaging module when clearly imaging a close-range object may be referred to as a close-range imaging mode, and the first current identifier corresponds to the close-range imaging mode.

[0124] In an embodiment of the present application, a color imaging module is first assembled so that the driving current corresponding to the assembled color imaging module when the image of a distant object is clear is located in the nonlinear region of the motor attitude curve. Then, a second current identifier corresponding to the second current when the motor drives the lens to move to a position where the image of a distant object is clear is stored, and a first current identifier corresponding to the first current when the motor drives the lens to move to a position where the image of a close object is clear is stored. That is, the first current identifier for close-range focusing and the second current identifier for long-range focusing are stored in the assembled color imaging module. Afterwards, the color imaging module can perform close-range focusing according to the first current identifier and perform long-range focusing according to the second current identifier.

[0125] Next, another method for storing the current identifier is described in detail.

[0126] Please refer to Figure 3 , Figure 3 This is a flowchart of another method for storing a current identifier provided by an embodiment of the present application, the method comprising the following steps:

[0127] Step 301 : determining driving current identifiers for achieving close-range focusing when the color imaging module is placed at different tilt angles, and storing the different tilt angles and the driving current identifiers for achieving close-range focusing as a first correspondence in the color imaging module.

[0128] The tilt angle indicates the placement posture of the color module. For example, the tilt angle indicates the posture of the lens of the color module.

[0129] Close-range focusing refers to the motor driving the lens to enable the color imaging module to clearly image close-range objects. A first correspondence stores different tilt angles of the color imaging module and corresponding drive current identifiers for achieving close-range focusing. Specifically, the first correspondence stores multiple sets of different tilt angles and corresponding drive current identifiers, which indicate the drive current of the drive motor.

[0130] For example, when the color imaging model is placed at different tilt angles, the driving current identifier when the color imaging module clearly images a close-range target object is determined, and the different tilt angles and the corresponding driving current identifiers are stored in the color imaging module as a first correspondence.

[0131] As an example, the color imaging module can be placed at an inclination angle of -90°, -45°, 0°, 45°, and 90°. A -90° inclination angle indicates that the color imaging module is placed vertically downward, a 0° inclination angle indicates that the color imaging module is placed horizontally, and a 90° inclination angle indicates that the color imaging module is placed vertically upward. Of course, any inclination angle between -90° and 90° can be selected based on actual needs. The embodiments of the present application do not limit the inclination angle at which the color imaging module is placed.

[0132] For example, the color imaging model is placed at an inclination angle of 90°, and the driving current identifier when the color imaging module clearly images a close-range target object is determined, and the inclination angle of 90° and the driving current identifier are stored as one of the first corresponding relationships in the color imaging module.

[0133] The color imaging module can be a color imaging module assembled before, or it can be a color imaging module assembled by the above method. Figure 2 The color imaging module assembled in the embodiment is not limited to the color imaging module in the embodiment of the present application.

[0134] In addition, the first correspondence relationship can be stored in the memory of the color imaging module or in the memory of the imaging chip of the color imaging module. The embodiment of the present application does not limit the storage space of the first correspondence relationship.

[0135] As an example, the imaging mode of the color imaging module when clearly imaging a close-range object may be referred to as a close-range imaging mode, and the first corresponding relationship corresponds to the close-range imaging mode.

[0136] Step 302 : determining driving current identifiers for achieving long-distance focusing when the color imaging module is placed at different tilt angles, and storing the different tilt angles and driving current identifiers for achieving long-distance focusing as a second correspondence in the color imaging module.

[0137] Long-distance focusing refers to the motor driving the lens to enable the color imaging module to clearly image distant objects. The second correspondence stores different tilt angles of the color imaging module and corresponding drive current identifiers for achieving long-distance focusing. In other words, the second correspondence stores multiple sets of different tilt angles and corresponding drive current identifiers.

[0138] For example, when the color imaging model is placed at different tilt angles, the driving current identifier when the color imaging module clearly images a distant target object is determined, and the different tilt angles and the corresponding driving current identifiers are stored in the color imaging module as a second correspondence.

[0139] The second correspondence relationship may be stored in a memory of the color imaging module or in a memory of an imaging chip of the color imaging module. The embodiment of the present application does not limit the storage space of the second correspondence relationship.

[0140] As an example, the imaging mode of the color imaging module when clearly imaging a distant object may be called a long-distance imaging mode, and the second corresponding relationship corresponds to the long-distance imaging mode.

[0141] Alternatively, the same method as steps 301 and 302 may be performed to determine the driving current identifiers for achieving close-range focusing when the infrared receiving module is placed at different tilt angles, and store the different tilt angles and the driving current identifiers for achieving close-range focusing as a third correspondence in the color imaging module. Furthermore, the driving current identifiers for achieving long-range focusing when the infrared receiving module is placed at different tilt angles may be determined, and the different tilt angles and the driving current identifiers for achieving long-range focusing may be stored as a fourth correspondence in the infrared receiving module.

[0142] As an example, in face recognition mode, the infrared receiving module operates when the processor determines that the imaging mode is long-distance imaging mode. In this case, the infrared receiving module can be configured to store the fourth correspondence corresponding to the long-distance imaging mode in the aforementioned manner. Based on this, when the infrared receiving module is operating, based on the infrared receiving module's tilt angle and the fourth correspondence, it retrieves the driving current identifier corresponding to the infrared receiving module's tilt angle from the stored fourth correspondence as the fifth current identifier, performs long-distance focusing based on the fifth current identifier, and generates an infrared speckle image of the distant object using infrared light reflected from the distant object.

[0143] It should be noted that the embodiment of the present application obtains and stores different tilt angles of the color imaging module and the corresponding driving current identifiers for achieving close-range focusing, as well as obtains and stores different tilt angles of the color imaging module and the corresponding driving current identifiers for achieving long-range focusing. In this way, when the tilt angle of the color imaging module is different, clear imaging of close-range objects or clear imaging of long-range objects can be achieved by obtaining the corresponding driving current identifier based on the tilt angle, thereby avoiding the influence of the posture of the lens on the deformation of the spring. That is, no matter what posture the color imaging module is in, the driving current identifier of the posture corresponding to the imaging mode is first obtained, and then the driving current indicated by the driving current identifier is input to the motor, so that the color imaging module can clearly image the target object.

[0144] In the embodiment of the present application, a color imaging module stores a first correspondence and a second correspondence. The first correspondence stores different tilt angles of the color imaging module and corresponding drive current identifiers for achieving close-range focusing, while the second correspondence stores different tilt angles of the color imaging module and corresponding drive current identifiers for achieving long-range focusing. Subsequently, the color imaging module can perform close-range focusing for color imaging modules with different tilt angles based on the first correspondence, and perform long-range focusing for color imaging modules with different tilt angles based on the second correspondence.

[0145] It should be noted that through the above Figure 2 Examples and the above Figure 3 Combinations of the embodiments can implement another method for storing current identifiers. For example, a color imaging module is first assembled through steps 201 and 202, and then a second current identifier for when a distant object is clearly imaged is stored in the color imaging module according to step 203. Then, a first correspondence is stored according to step 301, in which the first correspondence stores different tilt angles of the color imaging module and corresponding drive current identifiers for achieving close-range focusing. Of course, the method for storing current identifiers can also be implemented through other combinations, and the embodiments of the present application are not limited to this.

[0146] Next, an imaging method provided in an embodiment of the present application is described in detail.

[0147] Please refer to Figure 5 , Figure 5 This is a flowchart of an imaging method provided in an embodiment of the present application, which is applied to the above Figure 1 In the 3D structured light module shown, the 3D structured light module includes at least a processor and a color imaging module. The method includes the following steps:

[0148] Step 501: The processor determines the currently required imaging mode.

[0149] The imaging modes include short-range imaging mode and long-range imaging mode. Short-range imaging mode refers to the imaging mode when the color imaging module clearly images close objects, while long-range imaging mode refers to the imaging mode when the color imaging module clearly images distant objects.

[0150] As an example, the processor can determine the currently required imaging mode based on the payment method. For example, the processor first determines the payment method corresponding to the payment instruction. If the processor determines that the payment method is a payment method that requires close-range recognition (such as scanning a code to pay), the processor determines that the currently required imaging mode is a close-range imaging mode. If the processor determines that the payment method is a payment method that requires long-range recognition (such as face-scanning payment), the processor determines that the currently required imaging mode is a long-range imaging mode.

[0151] As an example, the recognition distance for QR code payment is approximately between 5cm and 30cm. That is, the color imaging module in QR code payment can recognize a target object within a range of approximately 5cm-30cm. Since this distance exceeds the facial recognition distance of face-scanning payment (30cm-100cm), the imaging mode of the color imaging module corresponding to QR code payment can be called the short-range imaging mode. Similarly, the imaging mode of the color imaging module corresponding to face-scanning payment can be called the long-range imaging mode.

[0152] In addition, the payment instruction may carry a payment identifier of the payment method, and the payment method corresponding to the payment instruction may be determined by the payment identifier. The payment identifier may be a payment method name or a payment method code. Of course, the processor may also determine the payment method by other means, and this embodiment of the application is not limited to this.

[0153] In addition, the payment instruction can be actively triggered by the user through the payment device, or it can be automatically triggered by the payment device. For example, the payment device includes a 3D structured light module, a payment module and a display screen. The payment device detects the payment operation based on the display screen. If the payment device detects the payment operation, it triggers the payment instruction and sends the payment instruction to the processor of the 3D structured light module. Among them, the payment operation can include face-swiping payment operation and code scanning payment operation. The operation type of the payment operation can be a click operation, a press operation, a language operation or a gesture operation, etc., which is not limited in the embodiments of the present application.

[0154] Of course, the processor may also determine the currently required imaging mode in other ways, and the embodiments of the present application do not limit this.

[0155] Step 502: The processor sends an imaging instruction corresponding to the imaging mode to the color imaging module.

[0156] The imaging instruction corresponding to the close-range imaging mode is a first imaging instruction, and the imaging instruction corresponding to the long-range imaging mode is a second imaging instruction. The first imaging instruction is used to instruct the color module to obtain a first current identifier, which corresponds to the close-range imaging mode. The first imaging instruction is used to instruct the color module to obtain a second current identifier, which corresponds to the long-range imaging mode.

[0157] The color imaging module may include a motor driver chip, a motor, and a lens, wherein the lens is connected to the motor. The motor driver chip is used to set the driving current of the motor, and the motor is used to drive the lens to move so that the lens moves to a position where the image is clear.

[0158] For example, the motor driver chip sets different driving currents for the motor according to different imaging modes.

[0159] The color imaging module may also include an imaging chip and a circuit board. The imaging chip converts visible light reflected from the target object into electrical signals, outputting a color image. The circuit board secures the imaging chip and motor driver chip and provides power to them.

[0160] Please refer to Figure 6 , Figure 6 6 is a schematic diagram of the structure of a color imaging module provided in an embodiment of the present application. The color imaging module includes a motor driving chip 601, a motor 602, a lens 603, an imaging chip 604 and a circuit board 605. Figure 6 The color imaging module includes a motor driver chip, a motor, a lens, an imaging chip and a circuit board. Figure 6 More or fewer components may be shown.

[0161] In step 503 , if the color imaging module receives the first imaging instruction sent by the processor, it obtains the stored first current identifier, performs close-range focusing according to the first current identifier, and clearly images the close-range object to obtain a first color image of the close-range object.

[0162] As an example, the color imaging module receives an imaging instruction sent by the processor and determines whether the imaging instruction is a first imaging instruction. If the color imaging module determines that the imaging instruction is the first imaging instruction, it obtains a first current identifier. If the color imaging module determines that the imaging instruction is not the first imaging instruction, it determines that the received imaging instruction is a second imaging instruction and obtains a second current identifier.

[0163] For example, the color imaging module obtains the first current identifier corresponding to the close-range imaging mode pre-stored in the color imaging module according to the first imaging instruction. Figure 2 The color imaging module assembled in the embodiment.

[0164] Alternatively, the color imaging module obtains the tilt angle of the color imaging module, and obtains the driving current identifier corresponding to the tilt angle of the color imaging module from a first corresponding relationship pre-stored in the color imaging module as the first current identifier.

[0165] For example, the color imaging module determines a first correspondence relationship corresponding to the close-range imaging mode pre-stored in the color imaging module according to the first imaging instruction, determines a driving current identifier corresponding to the tilt angle of the color imaging module from the first correspondence relationship, and uses the driving current identifier as the first current identifier.

[0166] As an example, the 3D structured light module also includes an angle detection module, so that the tilt angle of the color imaging module can be obtained by the angle detection module. Of course, the tilt angle of the color imaging module can also be obtained by other means, and the present embodiment does not limit this.

[0167] The angle detection module is used to detect the tilt angle of the color imaging module and transmit the tilt angle of the color imaging module to the color imaging module. The angle detection module can be an angle sensor, such as a Hall-effect angle sensor or a grating angle sensor. The angle detection module can be integrated into the color imaging module or integrated into the 3D structured light module as a standalone module. The embodiments of this application do not limit the angle detection module.

[0168] As an example, the motor driving chip of the color imaging module can set the driving current of the motor to the first current indicated by the first current identifier, so that the motor drives the lens to move to a position where close objects can be imaged clearly.

[0169] For example, the motor driver chip obtains a first current identifier and sets the motor drive current to the first current indicated by the first current identifier. The motor spring deforms in response to the first current. This deformation propels the lens to a position where a close-up image can be clearly captured. This allows the color imaging module to clearly capture the close-up image, producing a first color image of the close-up object.

[0170] As an example, if the color imaging module identifies a nearby object as a payment identifier, the color imaging module transmits a first color image of the nearby object to the processor. The processor transmits the first color image of the nearby object to the payment module of the payment device. The payment module receives the first color image from the processor and implements scan-to-pay based on the association between the first color image and the payment account. Of course, the first color image can also be used in other scenarios, and this embodiment of the application is not limited to this.

[0171] In step 504 , if the color imaging module receives the second imaging instruction sent by the processor, it obtains the stored second current identifier, performs long-distance focusing according to the second current identifier, and clearly images the distant object to obtain a second color image of the distant object.

[0172] For example, the color imaging module obtains the second current identifier corresponding to the long-distance imaging mode pre-stored in the color imaging module according to the second imaging instruction. Figure 2 The color imaging module assembled in the embodiment.

[0173] Alternatively, the color imaging module obtains the tilt angle of the color imaging module, and obtains the driving current identifier corresponding to the tilt angle of the color imaging module from a second corresponding relationship pre-stored in the color imaging module as the second current identifier.

[0174] For example, the color imaging module determines a second correspondence pre-stored in the color imaging module corresponding to the long-distance imaging mode according to the second imaging instruction, determines a driving current identifier corresponding to the tilt angle of the color imaging module from the second correspondence, and uses the driving current identifier as the second current identifier.

[0175] As an example, the motor driving chip of the color imaging module can set the driving current of the motor to the second current indicated by the second current identifier, so that the motor drives the lens to move to a position where distant objects can be imaged clearly.

[0176] For example, the motor driver chip obtains a second current identifier and sets the motor drive current to a second current indicated by the second current identifier. The motor spring deforms in response to the second current, and this deformation propels the lens to a position where a clear image of a distant object is obtained. This allows the color imaging module to clearly image the distant object, producing a second color image of the distant object.

[0177] In addition, the color imaging module can also send a second color image to the processor.

[0178] As an example, the 3D structured light module also includes an infrared transmitting module and an infrared receiving module. If the processor determines that the currently required imaging mode is the long-distance imaging mode, it sends a transmitting instruction to the infrared transmitting module and a third imaging instruction to the infrared receiving module. The infrared transmitting module receives the transmitting instruction sent by the processor and transmits modulated infrared light toward the distant object. The infrared receiving module receives the third imaging instruction sent by the processor, obtains a fifth current identifier corresponding to the long-distance imaging mode, performs long-distance focusing based on the fifth current identifier to clearly image the distant object, obtains an infrared speckle image of the distant object, and sends the infrared speckle image to the processor. The processor can then receive the second color image of the distant object and the infrared speckle image of the distant object, generate a depth image of the distant object based on the infrared speckle image, generate a 3D color image based on the second color image and the depth image, and send the 3D color image to the payment module of the payment device. The payment module receives the 3D color image sent by the processor and implements face-swiping payment based on the association between the 3D color image and the payment account. Of course, the second color image can also be applied to other scenarios, and this embodiment of the present application does not limit this.

[0179] In an embodiment of the present application, the 3D structured light module includes at least a processor and a color imaging module. The processor determines the currently required imaging mode and sends an imaging instruction corresponding to the imaging mode to the color imaging module. If the color imaging module receives an imaging instruction corresponding to the close-range imaging mode, it obtains the stored first current identifier, performs close-range focusing according to the first current identifier, and obtains a first color image of the close-range object. If the color imaging module receives an imaging instruction corresponding to the long-range imaging mode, it obtains the stored second current identifier, performs long-range focusing according to the second current identifier, and obtains a second color image of the long-range object. That is, the 3D structured light module supports both close-range imaging mode and long-range imaging mode. The color imaging module in the 3D structured light module stores a first current identifier corresponding to the close-range imaging mode and a second current identifier corresponding to the long-range imaging mode. Clear imaging of close-range objects can be achieved according to the first current identifier in the close-range imaging mode, and clear imaging of long-range objects can be achieved according to the second current identifier in the long-range imaging mode. In this way, the 3D structured light module can support both face-scanning payment that requires long-distance recognition and code scanning payment that requires close-range recognition, thereby expanding the payment methods that the 3D structured light module can support and reducing the cost of merchant payment equipment.

[0180] Figure 7 This is a schematic diagram of the structure of a computer device provided in an embodiment of the present application. Figure 7 As shown, the computer device includes: a processor 700, a memory 701, and a computer program 702 stored in the memory 701 and executable on the processor 700. When the processor 700 executes the computer program 702, the steps of the method for storing current identification and the imaging method in the above-mentioned embodiment are implemented.

[0181] The computer device can be a general-purpose computer device or a dedicated computer device. For example, the computer device is a dedicated computer device that integrates the 3D structured light module of the above-mentioned embodiment 1. In a specific implementation, the computer device can be a desktop computer, a portable computer, a handheld computer, a mobile phone or a tablet computer, etc. The embodiment of this application does not limit the type of computer device. Those skilled in the art will understand that Figure 7 This is merely an example of a computer device and does not constitute a limitation on the computer device. The computer device may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, it may also include input and output devices, network access devices, display screens, etc.

[0182] The processor 700 may be a central processing unit (CPU), or may be another general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. A general-purpose processor may be a microprocessor or any conventional processor.

[0183] In some embodiments, the memory 701 may be an internal storage unit of a computer device, such as a hard disk or memory of the computer device. In other embodiments, the memory 701 may also be an external storage device of the computer device, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) card, a flash memory card, etc. equipped on the computer device. Furthermore, the memory 701 may also include both an internal storage unit of the computer device and an external storage device. The memory 701 is used to store an operating system, application programs, a boot loader, data, and other programs. The memory 701 may also be used to temporarily store data that has been output or is about to be output.

[0184] An embodiment of the present application also provides a computer device, which includes a memory, a processor, and a computer program stored in the memory and run on the processor. When the computer program is executed by the processor, the steps in the method for storing current identification and the imaging method in the above-mentioned embodiment can be implemented.

[0185] An embodiment of the present application further provides a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, the steps in the method for storing current identification and the imaging method in the above-mentioned embodiment can be implemented.

[0186] An embodiment of the present application provides a computer program product, which, when executed on a computer, enables the computer to execute the steps in the above-mentioned various method embodiments.

[0187] If the integrated unit is implemented as a software functional unit and sold or used as a standalone product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application can implement all or part of the processes in the above-mentioned method embodiments by using a computer program to instruct the relevant hardware. The computer program can be stored in a computer-readable storage medium. When executed by a processor, the computer program can implement the steps of each of the above-mentioned method embodiments. The computer program includes computer program code, which can be in source code form, object code form, executable file, or some intermediate form. The computer-readable medium can at least include: any entity or device capable of carrying the computer program code to the camera / terminal device, recording medium, computer memory, ROM (Read-Only Memory), RAM (Random Access Memory), CD-ROM (Compact Disc Read-Only Memory), magnetic tape, floppy disk, and optical data storage device. The computer-readable storage medium mentioned in the present application can be a non-volatile storage medium, in other words, a non-transitory storage medium.

[0188] It should be understood that all or part of the steps for implementing the above embodiments may be implemented using software, hardware, firmware, or any combination thereof. When implemented using software, all or part of the steps may be implemented in the form of a computer program product. The computer program product may include one or more computer instructions. The computer instructions may be stored in the above-mentioned computer-readable storage medium.

[0189] In the above embodiments, the description of each embodiment has its own focus. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant description of other embodiments.

[0190] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0191] In the embodiments provided in this application, it should be understood that the disclosed apparatus / computer equipment and methods can be implemented in other ways. For example, the apparatus / computer equipment embodiments described above are merely schematic. For example, the division of modules or units is merely a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of the apparatus or unit, which can be electrical, mechanical or other forms.

[0192] Units described as separate components may or may not be physically separate, and components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.

[0193] The above-described embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present application, and should all be included in the scope of protection of the present application.

Claims

1. An imaging method, characterized in that: Applied to a 3D structured light module, the 3D structured light module includes at least a processor and a color imaging module, and the method includes: The processor determines a currently required imaging mode and sends an imaging instruction corresponding to the imaging mode to the color imaging module, where the imaging mode includes a close-range imaging mode and a long-range imaging mode. The imaging instruction corresponding to the close-range imaging mode is a first imaging instruction, and the imaging instruction corresponding to the long-range imaging mode is a second imaging instruction. If the color imaging module receives the first imaging instruction sent by the processor, it obtains the stored first current identifier, performs close-range focusing according to the first current identifier, so as to clearly image the close-range object and obtain a first color image of the close-range object; If the color imaging module receives the second imaging instruction sent by the processor, it obtains the stored second current identifier, performs long-distance focusing according to the second current identifier, so as to clearly image the distant object and obtain a second color image of the distant object; The color imaging module includes a motor and a lens. The motor includes a motor body and a spring. The motor body is used to drive the spring to push the lens to move according to an input driving current. The second current indicated by the second current marker is located in a nonlinear region of the motor posture curve, wherein the nonlinear region refers to a driving current interval in which deformation of the spring is not affected by the posture of the lens; the second current indicated by the second current marker enables the color imaging module to clearly image distant objects in different postures; Before the processor determines the currently required imaging mode, the method further includes: determining a third current, wherein the third current is in the nonlinear region; wherein the nonlinear region refers to a driving current interval in which deformation of the motor spring is not affected by the posture of the lens; determining a fourth current based on the gravity of the lens and the third current, wherein the fourth current is a driving current capable of enabling the motor to drive the lens to move to a position where a distant object can be clearly imaged under the influence of the gravity of the lens; When the input current to the motor is equal to the driving current of the fourth current, the motor and the lens are assembled to obtain the color imaging module; wherein the motor and the lens are assembled through an active alignment process; determining, as the second current, a driving current capable of causing the motor to drive the lens to move to a position where a distant object can be clearly imaged when the assembled color imaging module is placed horizontally; The second current identifier corresponding to the second current is stored in the color imaging module.

2. The method according to claim 1, wherein The color imaging module includes a motor driving chip, a motor, and a lens. The motor driving chip is used to set the driving current of the motor, and the motor is used to drive the lens to move. The performing close-range focusing according to the first current identifier includes: The motor driving chip sets the driving current of the motor to the first current indicated by the first current identifier, so that the motor drives the lens to move to a position where a close-up object can be imaged clearly; The performing long-distance focusing according to the second current identifier includes: The motor driving chip sets the driving current of the motor to the second current indicated by the second current identifier, so that the motor drives the lens to move to a position where a distant object can be imaged clearly.

3. The method according to claim 1, wherein After assembling the motor and the lens to obtain the color imaging module, the method further includes: determining, as the first current, a driving current capable of causing the motor to drive the lens to move to a position where a close-range object can be clearly imaged when the assembled color imaging module is placed horizontally; The first current identifier corresponding to the first current is stored in the color imaging module.

4. The method according to claim 1, wherein The acquiring the stored first current identifier includes: The color imaging module obtains the tilt angle of the color imaging module, and obtains the driving current identifier corresponding to the tilt angle of the color imaging module from the stored first correspondence as the first current identifier. The first correspondence stores different tilt angles of the color imaging module and corresponding driving current identifiers for achieving close-range focusing.

5. The method according to claim 3 or 4, wherein: The 3D structured light module also includes an angle detection module; The angle detection module is used to detect the tilt angle of the color imaging module and send the tilt angle of the color imaging module to the color imaging module.

6. The method according to claim 1, wherein The first current identifier and the second current identifier are burned into the memory of the color imaging module or burned into the memory of the imaging chip of the color imaging module.

7. The method according to claim 1, wherein The processor determines a currently required imaging mode, including: The processor determines a payment method corresponding to the payment instruction; If the processor determines that the payment method is code scanning payment, then determining that the currently required imaging mode is the close-range imaging mode; If the processor determines that the payment method is face recognition payment, it determines that the currently required imaging mode is the long-distance imaging mode.

8. A computer device, characterized in that: The computer device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program implements the method according to any one of claims 1 to 7 when executed by the processor.

9. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Code scanning and photographing compatible method and electronic terminal

    CN111064893A

  • Focusing method, device and equipment of lens module

    CN111158107A

  • PDAF optimization method and device

    CN111263070A

  • Focusing method and payment equipment

    CN112468723A