A method, device and readable storage medium for controlling a camera module
By combining dual-thread control and inertial sensors, the problem of the lens hitting the base during the closing process was solved, achieving efficient switching of the camera module and eliminating impact noise, thus improving the user experience.
Patent Information
- Application Number
- CN202110720287.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-06-28
- Publication Date
- 2025-12-23
- Estimated Expiration
- 2041-06-28
AI Technical Summary
In existing technologies, when the camera module is turned off, the lens is prone to impacting the base due to gravity and spring tension, resulting in impact noise, or blocking the main thread during multiple drive processes, affecting the control efficiency of the camera module and the user experience.
A dual-thread control method is adopted. The first thread turns off the camera module, and the second thread controls the actuator to drive the active components to restore focus or the state without image stabilization. The attitude and orientation are determined by the inertial sensor. The cyclic driving process gradually moves the lens to the target position to prevent collision.
It effectively prevents the actuator driving process from stalling, improves the control efficiency and user experience of the camera module, reduces the switching time of the camera module, avoids impact noise, and enhances the user experience.
Smart Images

Figure CN115604562B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of electronic equipment technology, and in particular to a method, apparatus and readable storage medium for controlling a camera module. Background Technology
[0002] With the development of electronic device manufacturing processes, the number of camera modules that can be supported in existing mobile phones and other electronic devices is increasing, and the size of camera modules is also getting larger.
[0003] like Figure 1 In one of the processing solutions shown, when the camera module is turned off, the motor is powered off before the lens of the current camera module begins to move towards the base. This causes the lens to directly hit the base due to gravity and spring tension, producing an impact sound.
[0004] like Figure 2 In another solution shown, when the camera module is turned off, the lens is pushed to the bottom of the module through multiple driving processes. In some usage scenarios, this solution may also produce a knocking sound and block the main thread's processing. Summary of the Invention
[0005] In view of this, the present disclosure provides a method, apparatus and readable storage medium for controlling a camera module.
[0006] According to a first aspect of the present disclosure, a method for controlling a camera module is provided, applied to a mobile terminal, comprising:
[0007] The camera module confirms that it has received the instruction to shut down the first camera module;
[0008] The first camera module is shut down via a first thread; and the actuator of the first camera module is controlled via a second thread to drive the active component, so that the focal length of the first camera module is restored to the target focal length or the first camera module is restored to a state without image stabilization.
[0009] In one embodiment, after controlling the actuator of the first camera module to drive the active component via the second thread to restore the focal length of the first camera module to the target focal length or to restore the first camera module to a state without image stabilization, the method further includes:
[0010] The actuator of the first camera module is powered off via the second thread.
[0011] In one embodiment, after shutting down the first camera module via the first thread, the method further includes:
[0012] The second camera module is activated via the first thread.
[0013] In an embodiment, the driving the actuator of the first camera module to move the target component of the first camera module to the desired position through the second thread comprises:
[0014] driving the actuator of the first camera module to move the target component of the first camera module to the desired position through the second thread, wherein the target component is a lens and / or an image sensor, and the desired position is a position with a set distance from a target base of the first camera module.
[0015] In an embodiment, the method further comprises:
[0016] determining the posture of the mobile terminal according to an inertial sensor;
[0017] determining the orientation of the lens according to the posture;
[0018] determining the target base of the first camera module according to the orientation of the lens, wherein the target base is a top base or a bottom base.
[0019] In an embodiment, the driving the actuator of the first camera module to move the target component of the first camera module to the desired position through the second thread comprises: driving the actuator of the first camera module to execute a driving process N times through the second thread until the target component of the first camera module moves to the desired position.
[0020] wherein N is an integer greater than 0, and each driving process in the N driving processes corresponds to a moving step.
[0021] In an embodiment, the moving step is negatively correlated with the number of times of driving the actuator in the second thread.
[0022] In an embodiment, the executing the driving process N times comprises:
[0023] calculating the position of the actuator in the next time according to a low-pass filter and the current position of the actuator, wherein the position of the actuator is the distance between the actuator and the target base of the first camera module.
[0024] According to a second aspect of the embodiments of the present disclosure, an apparatus for controlling a camera module is provided, applied to a mobile terminal, comprising:
[0025] a first determining module configured to determine receiving an instruction of closing a first camera module;
[0026] The first control module is configured to close the first camera module through the first thread.
[0027] The second control module is configured to control the actuator of the first camera module to drive the movable component through the second thread, so as to restore the focal length of the first camera module to the target focal length or to restore the first camera module to the state without the anti-shake processing.
[0028] In an embodiment, the second control module is further configured to, after controlling the actuator of the first camera module to drive the movable component through the second thread, so as to restore the focal length of the first camera module to the target focal length or to restore the first camera module to the state without the anti-shake processing, power off the actuator of the first camera module through the second thread.
[0029] In an embodiment, the first control module is further configured to, after closing the first camera module through the first thread, start the second camera module through the first thread.
[0030] In an embodiment, the second control module comprises:
[0031] The control unit is configured to control the actuator of the first camera module to drive the movable component through the second thread, so as to move the target component of the first camera module to the desired position; wherein the target component is the lens and / or the image sensor, and the desired position is a position at a set distance from the target base of the first camera module.
[0032] In an embodiment, the device further comprises:
[0033] The second determination module is configured to determine the posture of the mobile terminal according to the inertial sensor.
[0034] The third determination module is configured to determine the orientation of the lens according to the posture.
[0035] The fourth determination module is configured to determine the target base of the first camera module according to the orientation of the lens; wherein the target base is the top base or the bottom base.
[0036] In an embodiment, the control unit is further configured to control the actuator of the first camera module to drive the movable component through the second thread, so as to move the target component of the first camera module to the desired position, by using the following method:
[0037] The actuator of the first camera module is controlled through the second thread to perform the driving process for N times in a loop until the target component of the first camera module is moved to the desired position; wherein N is an integer greater than 0, and each driving process in the N driving processes corresponds to a moving step.
[0038] In an embodiment, the moving step is negatively correlated with the number of times of driving the actuator in the second thread.
[0039] In an embodiment, the control unit comprises:
[0040] a calculation unit configured to calculate the next position of the actuator according to the low-pass filter and the current position of the actuator, wherein the position of the actuator is the distance between the actuator and the target base of the first camera module.
[0041] According to a third aspect of embodiments of the present disclosure, an apparatus for controlling a camera module is provided, applied to a terminal, comprising:
[0042] a processor;
[0043] a memory for storing processor-executable instructions;
[0044] The processor is configured to execute the executable instructions in the memory to implement the steps of the method.
[0045] According to a third aspect of embodiments of the present disclosure, a non-transitory computer-readable storage medium is provided, having stored thereon executable instructions that, when executed by a processor, implement the steps of the method.
[0046] The technical solutions provided by the embodiments of the present disclosure can have the following beneficial effects: after receiving an instruction to close the first camera module, two threads are used to perform different functions, wherein the first thread is used to close the first camera module, and the second thread is used to control the actuator of the first camera module to perform a driving operation, so that the first camera module returns to the original state before use. By using two threads to perform processing respectively, compared with the way of using the same process to close the first camera module and then controlling the actuator of the first camera module to perform a driving operation, the driving process of the actuator can be prevented from blocking the subsequent operation after the first camera module is closed, so that the control efficiency of the camera module is improved, and the user experience is improved.
[0047] It should be understood that the above general description and the following detailed description are only exemplary and explanatory, and cannot limit the present disclosure. BRIEF DESCRIPTION OF DRAWINGS
[0048] The accompanying drawings, which are incorporated into and form part of the specification, illustrate embodiments consistent with the present disclosure and, together with the specification, serve to explain the principles of the present disclosure.
[0049] Figure 1 is a schematic diagram of a prior art method for controlling a camera module;
[0050] Figure 2 is a schematic diagram of a method for controlling a camera module in the prior art;
[0051] Figure 3 is a flow chart of a method for controlling a camera module according to an example embodiment;
[0052] Figure 4 is a flow chart of a method for controlling a camera module according to an example embodiment;
[0053] Figure 5 is a structural diagram of an apparatus for controlling a camera module according to an example embodiment;
[0054] Figure 6 is a block diagram of an apparatus for controlling a camera module according to an example embodiment. DETAILED DESCRIPTION
[0055] The example embodiments will be described in detail herein with reference to the attached drawings. In the following description, the same numbers are used to designate the same elements, unless otherwise indicated. The embodiments described in the following example embodiments are not representative of all embodiments consistent with the embodiments of the present disclosure. Rather, they are merely examples of devices and methods consistent with some aspects of the embodiments of the present disclosure as detailed in the appended claims.
[0056] The terms used in the embodiments of the present disclosure are merely used to describe particular embodiments, and are not intended to limit the embodiments of the present disclosure. The singular forms "a," "an," and "the" used in the embodiments of the present disclosure and the appended claims are intended to include plural forms, unless the context clearly indicates otherwise. It should also be understood that the term "and / or" used herein refers to and includes any or all possible combinations of one or more associated listed items.
[0057] A method for controlling a camera assembly is provided in the embodiments of the present disclosure, which is applied to a mobile terminal. The mobile terminal is a mobile phone, a tablet computer, a smart device, etc.
[0058] Referring to Figure 3 , Figure 3 is a flow chart of a method for controlling a camera assembly according to an example embodiment. As Figure 3 shown, the method can include:
[0059] Step S11, determining to receive an instruction to close the first camera module;
[0060] Step S12, closing the first camera module by the first thread; and driving the active component of the first camera module by the second thread to make the focal length of the first camera module return to the target focal length or make the first camera module return to the state without the anti-shake processing.
[0061] The architecture of the operating system (e.g. Android) of the mobile terminal includes an application (APP) layer and a hardware abstraction layer (HAL). The application layer manages various applications (e.g. a camera application), and the HAL layer manages the camera module and the actuator. The application layer and the HAL layer interact with each other to control the camera module to realize various functions of the camera application. A thread is the smallest unit of operation scheduling of the operating system, which is contained in a process and is the actual operation unit in the process. A thread refers to a single sequential control flow in a process, and multiple threads can be concurrent in a process. Each thread executes different tasks in parallel, and one thread can trigger the start of another thread. One thread can involve the processing content in the application layer and the HAL layer, or only the processing content in the application layer or only the processing content in the HAL layer. Different threads can interact with the address of an instance to transfer the control right of the corresponding control object of the instance. For example, different threads can interact with the address of an actuator instance to transfer the control right of the actuator.
[0062] In an embodiment, the first thread and the second thread are started before step S11, and the first thread and the second thread are executed in parallel.
[0063] In another embodiment, the first thread is started before step S11. In step S11, the instruction of closing the first camera module is received by the first thread, and the second thread is started by the first thread. After the second thread is started, the second thread is executed in parallel with the first thread.
[0064] In an embodiment, step S12 can further include: sending the address of the actuator instance to the second thread by the first thread, so that the second thread controls the actuator to drive the active component of the first camera module according to the address of the actuator instance, wherein the actuator instance is the instance corresponding to the actuator of the first camera module.
[0065] In an embodiment, step S12 of closing the first camera module by the first thread can further include: releasing the resources of the first camera module.
[0066] In an embodiment, step S12 of closing the first camera module by the first thread can further include: destroying the instance corresponding to the first camera module.
[0067] In an embodiment, the actuator can be a motor in the zooming process, and can be an Optical Image Stabilizer (OIS) in the anti-shake process.
[0068] In an embodiment, the target focal length refers to the focal length of the first camera module when the zooming function is not activated. The zooming refers to increasing the focal length or reducing the focal length.
[0069] In an embodiment, the anti-shake process refers to avoiding or reducing the camera shake phenomenon in the process of capturing optical signals by the camera through the setting of optical components, thereby improving the imaging quality. The anti-shake process can be realized by driving the moving assembly to move the lens through the actuator, or by driving the moving assembly to move the image sensor through the actuator. The state without anti-shake process in step S12 refers to the state when the anti-shake process is not performed, i.e., the state when the lens is not moved through the driving of the moving assembly by the actuator, or the state when the image sensor is not moved through the driving of the moving assembly by the actuator.
[0070] In the embodiment, the lens can include a plurality of lenses. The image sensor can also be referred to as a photosensitive element, which is a device for converting an optical image into an electronic signal.
[0071] In the embodiment, after receiving the instruction to close the first camera module, two threads are used to perform different functions, in which the first thread is used to close the first camera module, and the second thread is used to control the actuator of the first camera module to perform the driving operation, so as to restore the first camera module to the original state before use. By using two threads to perform the functions respectively, compared with the method of using the same process to close the first camera module and then controlling the actuator of the first camera module to perform the driving operation, the driving process of the actuator can be prevented from blocking the subsequent operation after the first camera module is closed, the control efficiency of the camera module is improved, and the user experience is improved.
[0072] In the embodiment, a method for controlling a camera assembly is provided, which is applied to a mobile terminal. The method includes Figure 3 In the method, after step S12, the following steps can be further included:
[0073] The power supply of the actuator of the first camera module is cut off through the second thread.
[0074] In the embodiments of the present disclosure, after the actuator of the first camera module is driven by the second thread to restore the focal length of the first camera module to the target focal length or to restore the first camera module to the state without the anti-shake processing, the power supply to the actuator of the first camera module is cut off, which effectively prevents the power supply from being cut off during the movement of the actuator, thereby preventing the actuator from losing control and colliding with the target base to generate a collision sound.
[0075] In the embodiments of the present disclosure, a method for controlling a camera assembly is provided and applied to a mobile terminal. The method comprises Figure 3 In the method, after the first camera module is closed by the first thread in step S12, the method can further comprise:
[0076] The second camera module is started by the first thread.
[0077] In an embodiment, after the first camera module is closed by the first thread, and before the second camera module is started by the first thread, the method further comprises: feeding back, by the first thread, a result of successfully closing the first camera module; thereby in the application scenario of switching the camera modules, the result of successfully closing the first camera module is fed back in time, so that after confirming that the first camera module is successfully closed, the HAL layer sends the result of successfully closing to the application layer, and triggers the application layer to send a command for opening the second camera module.
[0078] In the embodiments of the present disclosure, in the application scenario of switching the camera modules, after the first camera module is closed by the first thread and the second camera module is started, the actuator of the first camera module is controlled by the second thread to drive the operation, so as to restore the first camera module to the original state before use. By the processing of the two threads respectively, compared with the way of closing the first camera module by using the same process, controlling the actuator of the first camera module to drive the operation, and then starting the second camera module, the driving process of the actuator can be prevented from blocking the process of switching the camera modules, so as to reduce the switching time of the camera modules, improve the switching efficiency of the camera modules, and improve the user experience.
[0079] In the embodiments of the present disclosure, a method for controlling a camera assembly is provided and applied to a mobile terminal. The method comprises Figure 3 In the method, for example:
[0080] In step S12, the actuator of the first camera module is driven by the second thread to drive the active assembly, so as to restore the focal length of the first camera module to the target focal length or to restore the first camera module to the state without the anti-shake processing, which can comprise:
[0081] The second thread controls the actuator of the first camera module to drive the active component, moving the target component of the first camera module to a desired position; wherein, the target component is a lens and / or an image sensor, and the desired position is a position at a set distance from the target base of the first camera module.
[0082] In this embodiment, the actuator of the first camera module is controlled by the second thread to drive the active component. After the target component of the first camera module is moved to the desired position, the focal length of the first camera module is restored to the target focal length or the first camera module is restored to a state without image stabilization.
[0083] Considering for Figure 1 and Figure 2 The spring-loaded motor shown is used for zoom processing. After the motor is powered off, the lens is affected by the spring tension and the lens's weight. When the lens is facing upwards ( Figure 1 As shown, due to the spring tension and the lens's gravity, the lens will impact the bottom base of the module. When the lens is facing down, the direction of the lens's gravity is opposite to the direction of the spring tension. When the lens's gravity is greater, it will impact the top base of the module; when the lens's gravity is less, it will still impact the bottom base. For ball-bearing motors, after power failure, only gravity matters, and the lens will fall to the module base closest to the ground, making an impact sound. Therefore, the lens may impact either the top or bottom base, and the orientation of the head needs to be determined based on the mobile terminal's posture to determine whether the head ultimately moves to the top or bottom base.
[0084] This disclosure provides a method for controlling a camera component, applied to a mobile terminal. This method includes... Figure 3 The method shown, for example:
[0085] The following may also be included between steps S11 and S12:
[0086] The attitude of the mobile terminal is determined based on inertial sensors;
[0087] The orientation of the head is determined based on the posture;
[0088] The target base of the first camera module is determined based on the orientation of the head, wherein the target base is a top base or a bottom base.
[0089] Step S12, which uses a second thread to control the actuator of the first camera module to drive the active components, so that the focal length of the first camera module is restored to the target focal length or the first camera module is restored to a state without image stabilization, may include:
[0090] The second thread controls the actuator of the first camera module to drive the movable component, so as to move the target component of the first camera module to a desired position.
[0091] The method for controlling a camera module is provided in the embodiments of the present disclosure, and is applied to a mobile terminal. Figure 3 The method shown in the embodiments of the present disclosure can be used to control a camera module, and is applied to a mobile terminal.
[0092] In step S12, the second thread controls the actuator of the first camera module to drive the movable component, so as to restore the focal length of the first camera module to the target focal length or restore the first camera module to the state without the anti-shake processing.
[0093] The second thread controls the actuator of the first camera module to drive the movable component, so as to move the target component of the first camera module to a desired position.
[0094] In an embodiment, the control of the actuator of the first camera module to drive the movable component to move the lens of the first camera module to a desired position can include: performing a driving process for N times in a loop until the target component of the first camera module is moved to the desired position; wherein N is an integer greater than 0, and each driving process in the N driving processes corresponds to a movement step.
[0095] In this embodiment, the target component in the first camera module can be prevented from being directly moved to the target base, causing impact and impact sound, and affecting the user experience. By moving the target component in the first camera module to the set position on the target base for N times, the movement safety of the target component in the first camera module is ensured, and the target component is prevented from colliding with the base and emitting sound.
[0096] In an embodiment, the movement step is negatively correlated with the number of driving times of the actuator in the second thread.
[0097] In this embodiment, the movement step of the target component in the first camera module is negatively correlated with the number of driving times of the actuator in the second thread, that is, the more the number of driving times in the second thread, the smaller the movement step of the target component in the first camera module, so that the movement step of the target component in the first camera module is smaller when the target component is closer to the target base of the first camera module, and impact is prevented.
[0098] In an embodiment, the cycle performing the driving process N times can comprise:
[0099] calculating the position of the actuator next time according to the low-pass filter and the current position of the actuator; wherein the position of the actuator is the distance between the actuator and the target base of the first camera module.
[0100] In some possible embodiments, the low-pass filter can be a first-order digital low-pass filter.
[0101] In some possible embodiments, the first-order digital low-pass filter can be designed in the following way:
[0102] Y(n+1) = aX(n) + (1-a)Y(n)
[0103] wherein Y(n+1) is the stop position of the motor in the next movement process after the n th movement process of the motor;
[0104] X(n) is the desired position of the motor (a fixed position close to the base of the first camera module), and the value of X(n) is the same when the value of n is different;
[0105] Y(n) is the stop position of the motor in the n th movement process of the motor;
[0106] a is the filter coefficient, which can be set by engineers according to the characteristics of the motor.
[0107] For example, the mobile terminal can obtain the initial position Y(1) of the motor and the desired position X(1) of the motor, and then bring them into the above iterative formula to obtain the stop position Y(2) of the motor in the first movement process of the motor, and then move the motor to Y(2). The above iterative formula is cycled to gradually move the lens in the first camera module to the position of the base of the module through the calculation of the position of the motor.
[0108] In an example, a is set to be 0.1, the mobile terminal obtains the initial position Y(1) of the motor as 100 and the desired position X(1) of the motor as 10, and then brings them into the above iterative formula to obtain the stop position Y(2) of the motor in the first movement process of the motor, i.e. the stop position Y(2) of the motor in the second movement process of the motor is 91; continue to bring Y(2) and X(2) into the above iterative formula to obtain the stop position Y(3) of the motor in the second movement process of the motor, i.e. the stop position Y(2) of the motor in the second movement process of the motor is 82.9, and so on until the motor moves to the desired position.
[0109] In some possible implementation manners, when the absolute value of X(n)-Y(n) is less than a certain set value Δ, it can be considered that the lens in the first camera module has been moved to the desired position. The Δ can be a filter parameter set by an engineer.
[0110] In the embodiments of the present disclosure, the next motor position is calculated according to the low-pass filter and the current motor position, so as to realize the step-by-step movement of the lens in the first camera module. The first-order digital low-pass filter set can be suitable for camera modules with different characteristics, thereby providing data reference for engineers, facilitating engineers to debug, and engineers only need to adjust the filter coefficient, which is convenient for debugging and has strong applicability.
[0111] The embodiments will be described in detail below with reference to an exemplary embodiment.
[0112] As shown in FIG. 1, the exemplary embodiment is applied to zoom processing, and the main thread (i.e., the first thread) and the motor control thread (i.e., the second thread, which can be named as parklens_pthread) are run in the exemplary embodiment. The two threads run in parallel. Figure 4 The processing procedure of the main thread can include the following steps.
[0113] In step S201, the APP layer sends an instruction to close the first camera module to the HAL layer, and waits for the HAL layer to return the closing result.
[0114] In step S202, after receiving the instruction to close the first camera module, the HAL layer creates the motor control thread (parklens_pthread), and notifies the address (pActuator_handle) of the motor (Actuator) instance to the motor control thread (parklens_pthread), so as to take over the motor instance and the control right of the motor by the motor control thread (parklens_pthread).
[0115] In step S203, the HAL layer releases the resource of the first camera module, destroys the instance of the first camera module, and returns the result that the first camera module has been successfully closed to the APP layer.
[0116] In step S204, the APP layer receives the result that the first camera module has been successfully closed by the HAL layer.
[0117] In step S205, the APP layer sends an instruction to open the second camera module to the HAL layer, and the HAL layer opens the second camera module.
[0118]
[0119] The processing procedure of the motor control thread (parklens_pthread) can include the following steps:
[0120] In step S301, parameters of the first-order digital low-pass filter are loaded.
[0121] In step S302, a movement step in the current pushing process is generated according to the current position of the motor and the first-order digital low-pass filter.
[0122] In step S303, an instruction of pushing the lens movement is sent to the motor by using the motor instance, and the pushing distance is the movement step.
[0123] In step S304, it is determined whether the lens reaches the expected position. If yes, step S305 is executed; if not, step S302 is repeated.
[0124] In S305, the motor is powered off, the motor resource is released, and the motor control thread (parklens_pthread) is destroyed.
[0125] The motor control thread is executed in parallel with the main thread. When the main thread processes the camera module switching task, the motor control thread can process the instruction of closing the first camera module, so as to prevent the main thread from being blocked.
[0126] In the embodiments of the present disclosure, a device for controlling a camera assembly is provided, which is applied to a mobile terminal. The mobile terminal can be a mobile phone, a tablet computer, a smart device, etc.
[0127] Referring to Figure 5 , Figure 5 is a flowchart of a device for controlling a camera assembly according to an example embodiment. As shown in Figure 5 , the device can include:
[0128] A first determination module 51 is configured to determine that an instruction of closing a first camera module is received.
[0129] A first control module 52 is configured to close the first camera module through a first thread.
[0130] A second control module 53 is configured to control an actuator of the first camera module to drive a movable assembly of the first camera module through a second thread, so as to restore the focal length of the first camera module to a target focal length or restore the first camera module to a state without anti-shake processing.
[0131] In the embodiments of the present disclosure, a device for controlling a camera assembly is provided, which is applied to a mobile terminal. The device includes Figure 5 modules shown in the figure, for example:
[0132] The second control module 52 is further configured to, after driving the movable component of the first camera module by the second thread to restore the focal length of the first camera module to the target focal length or to restore the first camera module to the state without the anti-shake processing, power off the actuator of the first camera module by the second thread.
[0133] The present disclosure provides a device for controlling a camera assembly, applied to a mobile terminal. The device comprises Figure 5 The modules shown in the figure are exemplarily:
[0134] The first control module 51 is further configured to, after closing the first camera module by the first thread, start the second camera module by the first thread.
[0135] The present disclosure provides a device for controlling a camera assembly, applied to a mobile terminal. The device comprises Figure 5 The modules shown in the figure are exemplarily:
[0136] The second control module 52 comprises:
[0137] The control unit is configured to control the actuator of the first camera module to drive the movable component of the first camera module to move the target component of the first camera module to the desired position by the second thread; wherein the target component is a lens and / or an image sensor, and the desired position is a position with a set distance from a target base of the first camera module.
[0138] In an embodiment, the device further comprises:
[0139] The second determination module is configured to determine the posture of the mobile terminal according to the inertial sensor.
[0140] The third determination module is configured to determine the orientation of the target component according to the posture.
[0141] The fourth determination module is configured to determine the target base of the first camera module according to the orientation of the target component; wherein the target base is a top base or a bottom base.
[0142] In an embodiment, the control unit is further configured to control the actuator of the first camera module to drive the movable component of the first camera module to move the target component of the first camera module to the desired position by using the following method:
[0143] The driving process is performed cyclically for N times until the target component of the first camera module moves to the desired position; wherein N is an integer greater than 0, and each driving process in the N driving processes corresponds to a moving step.
[0144] In an embodiment, the moving step is negatively correlated with the number of times of driving the actuator in the second thread.
[0145] In an embodiment, the control unit comprises:
[0146] a calculation unit configured to calculate the next position of the actuator according to the low-pass filter and the current position of the actuator, wherein the position of the actuator is the distance between the actuator and a target base of the first camera module.
[0147] Embodiments of the present disclosure provide an apparatus for controlling a camera module, applied to a terminal, comprising:
[0148] a processor;
[0149] a memory for storing processor-executable instructions;
[0150] The processor is configured to execute the executable instructions in the memory to implement the steps of the method.
[0151] Embodiments of the present disclosure provide a non-transitory computer-readable storage medium having stored thereon executable instructions that, when executed by a processor, implement the steps of the method.
[0152] Figure 6 is a block diagram of an apparatus 600 for controlling a camera module according to an exemplary embodiment. For example, the apparatus 600 can be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, and the like.
[0153] Referring to Figure 6 , the apparatus 600 can include one or more of the following components: a processing component 602, a memory 604, a power supply component 606, a multimedia component 608, an audio component 610, an input / output (I / O) interface 612, a sensor component 614, and a communication component 616.
[0154] The processing component 602 usually controls overall operations of the apparatus 600, such as operations associated with displaying, making phone calls, data communications, camera operations, and recording operations. The processing component 602 can include one or more processors 620 to execute instructions to complete all or part of steps of the methods described above. In addition, the processing component 602 can include one or more modules to facilitate interaction between the processing component 602 and other components. For example, the processing component 602 can include a multimedia module to facilitate the interaction between the multimedia component 608 and the processing component 602.
[0155] The memory 604 is configured to store various types of data to support the operation of the device 600. Examples of such data include instructions for any application or method operating on the device 600, contact data, phonebook data, messages, pictures, videos, and the like. The memory 604 can be implemented by any type of volatile or nonvolatile storage devices or a combination thereof such as static random access memory (SRAM), electrically erasable programmable read only memory (EEPROM), erasable programmable read only memory (EPROM), programmable read only memory (PROM), read only memory (ROM), magnetic memory, flash memory, magnetic disk, or optical disk.
[0156] The power supply component 606 supplies electrical power for the various components of the device 600. The power supply component 606 can include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing electrical power for the device 600.
[0157] The multimedia component 608 includes a screen providing an output interface between the device 600 and a user. In some embodiments, the screen can include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen can be implemented as a touch screen to receive input signals from a user. The touch panel includes one or more touch sensors to sense touch, swiping, and gestures on the touch panel. The touch sensors can not only sense a boundary of a touch or swiping action, but also detect duration and pressure related to the touch or swiping action. In some embodiments, the multimedia component 608 includes a front-facing camera and / or a rear-facing camera. The front-facing camera and / or the rear-facing camera can receive external multimedia data when the device 600 is in an operation mode, such as a shooting mode or a video mode. Each of the front-facing camera and the rear-facing camera can be a fixed optical lens system or have focal length and optical zoom capabilities.
[0158] The audio component 610 is configured to output and / or input audio signals. For example, the audio component 610 includes a microphone (MIC) that is configured to receive external audio signals when the device 600 is in an operation mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signals can be further stored in the memory 604 or transmitted via the communication component 616. In some embodiments, the audio component 610 also includes a speaker for outputting audio signals.
[0159] The I / O interface 612 provides an interface between the processing component 602 and peripheral interface modules, which can be a keyboard, a click wheel, a button, and the like. The buttons can include, but are not limited to, a home button, a volume button, a start button, and a lock button.
[0160] The sensor component 614 includes one or more sensors for providing status assessments for various aspects of the device 600. For example, the sensor component 614 can detect an open / closed position of the device 600, relative positioning of components, such as a display and keypad of the device 600, a change in position of the device 600 or a component of the device 600, presence or absence of user contact with the device 600, orientation or acceleration / deceleration of the device 600, and temperature changes of the device 600. The sensor component 614 can include proximity sensor(s) configured to detect presence of nearby objects without any physical contact. The sensor component 614 can further include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor component 614 can further include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
[0161] The communication component 616 is configured to facilitate wired or wireless communication between the device 600 and another device. The device 600 can access a wireless network based on a corresponding communication standard, such as WiFi, 2G, or 3G, or a combination thereof. In an exemplary embodiment, the communication component 616 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 616 further includes a Near Field Communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on Radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technology.
[0162] In an exemplary embodiment, the device 600 can be implemented using one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, micro-controllers, microprocessors or other electronic elements, to perform the above-described methods.
[0163] In an exemplary embodiment, a non-transitory computer-readable storage medium, such as the memory 604 including instructions, is also provided, which can be executed by the processor 620 of the device 600 to perform the above-described methods. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disc, and an optical data storage device, etc.
[0164] Those skilled in the art will readily understand that the present disclosure is well amenable to a wide variety of modifications and / or alterations of the embodiments described herein without departing from the central inventive concept of the embodiments disclosed in the present disclosure. The present application is intended to cover any and all variations of the embodiments disclosed in the present disclosure that are within the scope of the present disclosure. The specification and drawings should be regarded as illustrative only and should not be considered as restrictive in any way.
[0165] It should be understood that the embodiments disclosed in the present disclosure are not limited to the precise structures herein described and illustrated in the drawings and that various modifications, substitutions, changes and alterations can be made thereto without departing from the scope of the present disclosure as disclosed in the present application. The scope of the present disclosure is limited only by the claims appended hereto.
[0166] It should be noted that, in the present disclosure, the terms "comprises", "comprising", or any other variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but can also include other elements not expressly listed or inherent to such process, method, article, or apparatus. An element proceeded by "comprises a... " does not, without more constraints, exclude the existence of additional identical elements in the process, method, article, or apparatus that comprises the element.
Claims
1. A method for controlling a camera module, applied to a mobile terminal, characterized in that, comprising: determining receiving an instruction to close a first camera module; closing the first camera module by a first thread; and, controlling an actuator of the first camera module to drive a movable component to move a target component of the first camera module to a desired position by a second thread, comprising: controlling the actuator of the first camera module to cyclically execute a driving process at least once to drive the movable component, wherein each driving process corresponds to a movement step; wherein the first thread and the second thread are executed in parallel to prevent the driving process of the actuator from blocking the subsequent operation after the first camera module is closed; the movement step is negatively correlated to the number of driving times of the actuator in the second thread, so that the closer the target component of the first camera module is to the desired position, the smaller the movement step is. 2.The method of claim 1, wherein, after the controlling the actuator of the first camera module to drive the movable component to move the target component of the first camera module to the desired position by the second thread, the method further comprises: powering off the actuator of the first camera module by the second thread. 3.The method of claim 1, wherein, after the closing the first camera module by the first thread, the method further comprises: starting a second camera module by the first thread. 4.The method of claim 1, wherein, the target component is a lens and / or an image sensor, and the desired position is a position that is a set distance away from a target base of the first camera module. 5.The method of claim 4, wherein, the method further comprises: determining an attitude of the mobile terminal according to an inertial sensor; determining an orientation of the target component according to the attitude; and determining a target base of the first camera module according to the orientation of the target component, wherein the target base is a top base or a bottom base. 6.The method of claim 4, wherein, the controlling the actuator of the first camera module to drive the movable component to move the target component of the first camera module to the desired position by the second thread, comprises: controlling the actuator of the first camera module to cyclically execute N driving processes to drive the movable component, wherein N is an integer greater than 0, and each driving process corresponds to a movement step. 7.The method of claim 6, wherein, the cyclically executing N driving processes, comprises: calculating a next position of the actuator according to a low-pass filter and a current position of the actuator, wherein the position of the actuator is a distance of the actuator to the target base of the first camera module. comprising: a first determining module configured to determine receiving an instruction to close a first camera module; 8. An apparatus for controlling a camera module, applied to a mobile terminal, characterized in that, The first control module is configured to close the first camera module through a first thread. The second control module is configured to control the actuator of the first camera module to drive the movable component through a second thread, so as to restore the focal length of the first camera module to a target focal length or to restore the first camera module to a state without anti-shake processing. The first thread and the second thread are executed in parallel, so as to prevent the driving process of the actuator from blocking the subsequent operation after the first camera module is closed. The second control module comprises a control unit configured to control the actuator of the first camera module to cyclically execute at least one driving process to drive the movable component through the second thread, until the target component of the first camera module moves to the desired position, and each driving process corresponds to a movement step. The movement step is negatively correlated with the number of driving times of the actuator in the second thread, so that the movement step is smaller when the target component of the first camera module is closer to the desired position.
9. The apparatus of claim 8, wherein The second control module is further configured to power off the actuator of the first camera module through the second thread after the actuator of the first camera module is controlled to drive the movable component through the second thread, so as to restore the focal length of the first camera module to a target focal length or to restore the first camera module to a state without anti-shake processing.
10. The apparatus of claim 8, wherein The first control module is further configured to start the second camera module through the first thread after the first camera module is closed through the first thread.
11. The apparatus of claim 8, wherein The target component is a lens and / or an image sensor, and the desired position is a position at a set distance from a target base of the first camera module.
12. The apparatus of claim 11, wherein The apparatus further comprises: A second determination module configured to determine the posture of the mobile terminal according to the inertial sensor; A third determination module configured to determine the orientation of the target component according to the posture; A fourth determination module configured to determine the target base of the first camera module according to the orientation of the target component, wherein the target base is a top base or a bottom base.
13. The apparatus of claim 11, wherein The control unit is further configured to move the target component of the first camera module to the desired position through the second thread by using the following method: The control unit is further configured to control the actuator of the first camera module to cyclically execute N driving processes through the second thread until the target component of the first camera module moves to the desired position, wherein N is an integer greater than 0, and each driving process in the N driving processes corresponds to a movement step.
14. The apparatus of claim 8, wherein The control unit comprises: A computing unit is configured to calculate the next position of the actuator according to the low-pass filter and the current position of the actuator; wherein the position of the actuator is the distance between the actuator and the target base of the first camera module.
15. An apparatus for controlling a camera module, applied to a terminal, comprising: Comprise: a processor; a memory for storing processor-executable instructions; wherein the processor is configured to execute the executable instructions in the memory to implement the steps of the method of any one of claims 1 to 7.
16. A non-transitory computer-readable storage medium having stored thereon executable instructions that, as a result of being executed by a computer, adapt the computer to at least: The executable instructions, when executed by the processor, implement the steps of the method of any one of claims 1 to 7.
Citation Information
Patent Citations
Method and device for controlling motor in zoom camera module
CN105657258A