CN115604562A - Method and device for controlling camera module and readable storage medium - Google Patents

Method and device for controlling camera module and readable storage medium Download PDF

Info

Publication number
CN115604562A
CN115604562A CN202110720287.5A CN202110720287A CN115604562A CN 115604562 A CN115604562 A CN 115604562A CN 202110720287 A CN202110720287 A CN 202110720287A CN 115604562 A CN115604562 A CN 115604562A
Authority
CN
China
Prior art keywords
camera module
actuator
thread
target
controlling
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110720287.5A
Other languages
Chinese (zh)
Inventor
田博显
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Xiaomi Mobile Software Co Ltd
Original Assignee
Beijing Xiaomi Mobile Software Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Xiaomi Mobile Software Co Ltd filed Critical Beijing Xiaomi Mobile Software Co Ltd
Priority to CN202110720287.5A priority Critical patent/CN115604562A/en
Publication of CN115604562A publication Critical patent/CN115604562A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M1/00Substation equipment, e.g. for use by subscribers
    • H04M1/02Constructional features of telephone sets
    • H04M1/0202Portable telephone sets, e.g. cordless phones, mobile phones or bar type handsets
    • H04M1/026Details of the structure or mounting of specific components
    • H04M1/0264Details of the structure or mounting of specific components for a camera module assembly

Landscapes

  • Engineering & Computer Science (AREA)
  • Signal Processing (AREA)
  • Studio Devices (AREA)

Abstract

The disclosure provides a method and a device for controlling a camera module and a readable storage medium, which are applied to the technical field of electronic equipment, wherein the method comprises the following steps: the camera module determines to receive an instruction for closing the first camera module; closing the first camera module through the first thread; and controlling an actuator of the first camera module to drive a movable assembly 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 non-anti-shake processing state. In this disclosure, carry out different functions respectively by two threads, compare in using same process to close control behind the first camera module the actuator of first camera module carries out the mode of drive operation, can prevent that the drive process of actuator from blocking the problem that follow-up operation after closing the first camera module can't in time go on, improves the control efficiency to the camera module, improves user experience.

Description

Method and device for controlling camera module and readable storage medium
Technical Field
The present disclosure relates to the field of electronic devices, and in particular, to a method and an apparatus for controlling a camera module, and a readable storage medium.
Background
With the development of the manufacturing process of electronic equipment, the number of camera modules that can be supported in electronic equipment such as a mobile phone is increasing, and the size of the camera modules is also increasing.
In one processing scheme shown in fig. 1, when the camera module is closed and the lens of the current camera module does not start to move to the base, the motor is controlled to be powered off, so that the lens directly impacts the base under the influence of gravity and spring tension to generate impact sound.
In another processing scheme as shown in fig. 2: when closing the camera module, push away the camera lens to the module bottom through the drive process many times, the condition that also can appear taking place the striking sound in some use situations in this scheme can block the processing of main thread moreover.
Disclosure of Invention
In view of the above, the present disclosure provides a method and an apparatus for controlling a camera module, and a readable storage medium.
According to a first aspect of the embodiments of the present disclosure, a method for controlling a camera module is provided, which is applied to a mobile terminal, and includes:
the camera module determines to receive an instruction for closing the first camera module;
closing the first camera module through the first thread; and controlling an actuator of the first camera module to drive a movable assembly 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 non-anti-shake processing state.
In one embodiment, after controlling an actuator of the first camera module to drive a movable component by a second thread to restore the focal length of the first camera module to a target focal length or to restore the first camera module to a no-shake processing state, the method further includes:
powering down an actuator of the first camera module by a second thread.
In an embodiment, after the first camera module is turned off by the first thread, the method further includes:
and starting the second camera module through the first thread.
In one embodiment, the controlling, by a second thread, an actuator of the first camera module to drive a movable assembly 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 no-shake processing state includes:
controlling an actuator of the first camera module to drive a movable assembly through the second thread, and moving a target assembly 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 a set distance from a target mount of the first camera module.
In one embodiment, the method further comprises:
determining the attitude of the mobile terminal according to an inertial sensor;
determining an orientation of the lens according to the pose;
determining a 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.
In one embodiment, the controlling the actuator of the first camera module to drive the movable component by the second thread to move the target component of the first camera module to a desired position includes: controlling an actuator of the first camera module to circularly execute N times of driving processes through the second thread until a target component of the first camera module moves to a desired position;
wherein, N is an integer larger than 0, and each driving process in the N pushing processes corresponds to a moving step length.
In one embodiment, the movement step size is inversely related to the number of times the actuator is driven in the second thread.
In one embodiment, the loop performs N driving processes, including:
calculating the position of the actuator at the next time according to the low-pass filter and the current position of the actuator; wherein the position of the actuator is a distance of the actuator from a target mount of the first camera module.
According to a second aspect of the embodiments of the present disclosure, there is provided an apparatus for controlling a camera module, which is applied to a mobile terminal, including:
the first determining module is used for determining and receiving an instruction for closing the first camera module;
the first control module is used for closing the first camera module through a first thread;
and the second control module is used for controlling the actuator of the first camera module to drive the movable assembly through a second thread so as to restore the focal length of the first camera module to the target focal length or restore the first camera module to a non-anti-shake processing state.
In an embodiment, the second control module is further configured to control, by a second thread, the actuator of the first camera module to drive the movable assembly, 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 no-shake processing state, and then power off the actuator of the first camera module by a second thread.
In an embodiment, 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.
In one embodiment, the second control module comprises:
the control unit is used for controlling 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 a desired position; wherein the target component is a lens and/or an image sensor, and the desired position is a position a set distance from a target mount of the first camera module.
In one embodiment, the apparatus further comprises:
the second determination module is used for determining the attitude of the mobile terminal according to the inertial sensor;
a third determining module, configured to determine an orientation of the lens according to the gesture;
the fourth determining module is used for determining a 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.
In an embodiment, the control unit is further configured to control the actuator of the first camera module to drive the movable component by the second thread to move the target component of the first camera module to a desired position by using the following method:
controlling an actuator of the first camera module to circularly execute N times of driving processes through the second thread until a target component of the first camera module moves to a desired position; wherein, N is an integer larger than 0, and each driving process in the N pushing processes corresponds to a moving step length.
In one embodiment, the movement step size is inversely related to the number of times the actuator is driven in the second thread.
In one embodiment, the control unit comprises:
a calculation unit for calculating the position of the actuator at the next time based on the low-pass filter and the current position of the actuator; wherein the position of the actuator is a distance of the actuator from a target mount of the first camera module.
According to a third aspect of the embodiments of the present disclosure, there is provided an apparatus for controlling a camera module, which is applied to a terminal, including:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to execute executable instructions in the memory to implement the steps of the method.
According to a third aspect of embodiments of the present disclosure, there is provided a non-transitory computer readable storage medium having stored thereon executable instructions that, when executed by a processor, implement the steps of the method.
The technical scheme provided by the embodiment of the disclosure can have the following beneficial effects: after receiving the instruction of closing first camera module, carry out different functions respectively by two threads, wherein, by first line Cheng Guanbi first camera module, by second thread control the actuator of first camera module carries out drive operation, make first camera module resume the original state before using, through the difference processing of two threads, compare in using same process to close behind the first camera module control the mode that the actuator of first camera module carries out drive operation, can prevent that the drive process of actuator from blocking the problem that follow-up operation after closing first camera module can't in time go on, improve the control efficiency to camera module, improve user experience.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the disclosure.
Fig. 1 is a schematic diagram of a method for controlling a camera module in the prior art;
fig. 2 is a schematic diagram of a method for controlling a camera module in the prior art;
FIG. 3 is a flow chart illustrating a method of controlling a camera module according to an exemplary embodiment;
FIG. 4 is a flow chart illustrating a method of controlling a camera module in accordance with an exemplary embodiment;
fig. 5 is a block diagram illustrating an apparatus for controlling a camera module according to an exemplary embodiment;
fig. 6 is a block diagram illustrating an apparatus for controlling a camera module according to an exemplary embodiment.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the embodiments in this disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the embodiments in the present disclosure, as detailed in the appended claims.
The terminology used in the embodiments of the present disclosure is for the purpose of describing particular embodiments only and is not intended to be limiting of the embodiments of the present disclosure. As used in the disclosed embodiments and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.
The embodiment of the disclosure provides a method for controlling a camera assembly, which is applied to a mobile terminal. The mobile terminal is a mobile phone, a tablet computer, an intelligent device and the like.
Referring to fig. 3, fig. 3 is a flow chart illustrating a method of controlling a camera assembly according to an exemplary embodiment. As shown in fig. 3, the method may include:
step S11, determining to receive an instruction for closing the first camera module;
step S12, closing the first camera module through the first thread; and controlling an actuator of the first camera module to drive a movable assembly 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 non-anti-shake processing state.
The architecture of the operating system (e.g., android) of a mobile terminal includes an Application (APP) layer and a Hardware Abstraction Layer (HAL). The application layer manages various applications (e.g., camera applications), and the HAL layer manages the camera modules and actuators. The application layer and the HAL layer interact with control information related to the camera module, so that the camera module is controlled to realize various functions of the camera application. The thread is the smallest unit of operation scheduling that the operating system can perform, is included in the process, and is the actual operation unit in the process. One thread refers to a single sequential control flow in a process, multiple threads can be concurrently executed in one process, each thread executes different tasks in parallel, or one thread triggers the start of another thread. A thread may relate to both the processing content in the application layer and the HAL layer, may relate to only the processing content in the application layer, or relate to only the processing content in the HAL layer. The address of an instance can be interacted among different threads, so that the control right of the corresponding control object of the instance is transferred. For example, addresses of actuator instances may be exchanged between different threads, thereby transferring control of the actuators.
In one embodiment, step S11 is preceded by starting a first thread and a second thread, the first thread and the second thread Cheng Binghang executing.
In another embodiment, the first thread is started before step S11. In step S11, an instruction to close the first camera module is received through the first thread, and the second thread is started through the first thread, and after the second thread is started, the second thread is executed in parallel with the first thread.
In one embodiment, step S12 may further include: sending an address of an actuator instance to a second thread through a first thread so that the second thread controls an actuator of the first camera module to drive a movable component according to the address of the actuator instance, wherein the actuator instance is an instance corresponding to the actuator of the first camera module.
In an embodiment, the closing the first camera module by the first thread in step S12 may further include: and releasing the resources of the first camera module.
In an embodiment, the closing the first camera module by the first thread in step S12 may further include: and destroying the corresponding example of the first camera module.
In one embodiment, the actuator may be a motor in the zoom process, and may be an Optical Image Stabilizer (OIS) in the anti-shake process.
In one embodiment, the target focal length refers to a focal length when the first camera module does not start the zoom function. The zooming refers to increasing or decreasing the focal length.
In one embodiment, the anti-shake processing is to avoid or reduce camera shake phenomenon occurring in the process of capturing optical signals through the arrangement of optical components in the camera, so as to improve the imaging quality. The anti-shake processing may be realized by driving the movable element by the actuator to move the lens, or may be realized by driving the movable element by the actuator to move the image sensor. The state of no anti-shake processing in step S12 refers to a state when anti-shake processing is not performed, that is, a state when the movable element is not driven by the actuator to move the lens, or a state when the movable element is not driven by the actuator to move the image sensor.
Wherein the lens barrel may include a plurality of lenses. An image sensor, which may also be referred to as a photosensitive element, is a device that converts an optical image into an electronic signal.
In the embodiment of the disclosure, after an instruction for closing the first camera module is received, the two threads execute different functions respectively, wherein the first camera module is controlled by the first line Cheng Guanbi and the second thread to drive the actuator of the first camera module, so that the first camera module recovers the original state before use, and through the respective processing of the two threads, compared with a mode of controlling the actuator of the first camera module to drive and operate after the first camera module is closed by using the same process, the problem that the subsequent operation after the first camera module is closed by the driving process of the actuator cannot be performed in time can be prevented, the control efficiency of the camera module is improved, and the user experience is improved.
The embodiment of the disclosure provides a method for controlling a camera assembly, which is applied to a mobile terminal. This method includes the method shown in fig. 3, and may further include, for example, after step S12:
powering down an actuator of the first camera module by a second thread.
In the embodiment of the disclosure, after the actuator of the first camera module is driven through the second thread, the focal length of the first camera module is restored to the target focal length or the first camera module is restored to the state without anti-shake processing, the actuator of the first camera module is powered off, so that the power failure in the process of moving the actuator is effectively prevented, and the actuator is prevented from impacting a target base to generate impact sound after being out of control.
The embodiment of the disclosure provides a method for controlling a camera assembly, which is applied to a mobile terminal. The method includes the method shown in fig. 3, and for example, after the first camera module is turned off by the first thread in step S12, the method may further include:
and starting the second camera module through the first thread.
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 includes: feeding back a result of successful closing of the first camera module through the first thread; therefore, under the application scene of switching the camera modules, the successful result of closing the first camera module is fed back in time, so that after the successful closing of the first camera module is confirmed, the HAL layer sends the successful closing result to the application layer, and the application layer is triggered to send a command of opening the second camera module.
In the embodiment of the present disclosure, in an application scenario of switching camera modules, the first camera module continues to be started by the first line Cheng Guanbi, and the second line controls the actuator of the first camera module to perform driving operation, so that the first camera module recovers to an original state before use. Through the processing respectively of two threads, compare in using same process to close behind the first camera module and control the mode that restarts the second camera module after the actuator of first camera module drives the operation and accomplishes, thereby can prevent that the process that the drive process of actuator retards the camera module and switches makes the switching of camera module long time, it is long when reducing camera module switching, improves camera module switching efficiency, improves user's use and experiences.
The embodiment of the disclosure provides a method for controlling a camera assembly, which is applied to a mobile terminal. This method includes the method shown in fig. 3, illustratively:
controlling the actuator of the first camera module to drive the movable assembly through the second thread in step S12, 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 no-shake processing state, which may include:
controlling an actuator of the first camera module to drive a movable assembly through the second thread, and moving a target assembly 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 a set distance from a target mount of the first camera module.
In this embodiment, the actuator of the first camera module is controlled by the second thread to drive the movable member, and after the target member of the first camera module is moved to a desired position, the focal length of the first camera module is returned to the target focal length or the first camera module is returned to the state without anti-shake processing.
Considering that for the spring plate type motor applied to the zooming process shown in fig. 1 and 2, after the motor is powered off, the lens is influenced by the spring tension and the lens gravity, when the lens is upward (shown in fig. 1), the lens can strike the bottom base of the module due to the spring tension and the lens gravity; when the lens faces downwards, the gravity action direction of the lens is opposite to the tension direction of the spring, when the gravity of the lens is larger, the lens can strike the top base of the module, and when the gravity of the lens is smaller, the lens still can strike the bottom base. For the ball type motor, only influenced by gravity after the power failure, the lens can fall to the module base on the side close to the ground and make impact sound, so that the lens can impact the top or bottom base, the orientation of the head needs to be judged according to the posture of the mobile terminal, and the head is finally judged to move to the top or bottom base.
The embodiment of the disclosure provides a method for controlling a camera assembly, which is applied to a mobile terminal. This method includes the method shown in fig. 3, illustratively:
the method between step S11 and step S12 may further include:
determining the attitude of the mobile terminal according to an inertial sensor;
determining an orientation of the head from the pose;
determining a target mount for the first camera module based on the orientation of the head, wherein the target mount is a top mount or a bottom mount.
Controlling the actuator of the first camera module to drive the movable assembly through the second wire in the step S12, 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 anti-shake processing, which may include:
controlling an actuator of the first camera module to drive a movable assembly through the second thread, and moving a target assembly 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 a set distance from a target mount of the first camera module.
The embodiment of the disclosure provides a method for controlling a camera assembly, which is applied to a mobile terminal. This method includes the method shown in fig. 3, illustratively:
controlling the actuator of the first camera module to drive the movable assembly through the second thread in step S12, 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 no-shake processing state, which may include:
controlling an actuator of the first camera module to drive a movable assembly through the second thread, and moving a target assembly 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 a set distance from a target mount of the first camera module
In an embodiment, the controlling the actuator of the first camera module to drive the movable assembly to move the lens of the first camera module to a desired position may include: circularly executing the driving process for N times until the target component of the first camera module moves to the expected position; wherein, N is an integer larger than 0, and each driving process in the N pushing processes corresponds to a moving step length.
In this embodiment, can prevent that the target subassembly in the first camera module from directly moving to the target base, cause the striking and send striking sound, influence user experience. The target assembly in the first camera module is gradually moved to the set position on the target base in the mode of moving for N times, so that the moving safety of the target assembly in the first camera module is ensured, and the target assembly is prevented from colliding with the base and making sound.
In an embodiment, the movement step size is inversely related to the number of drives of the actuator in the second thread.
In this embodiment, the moving step of the target component in the first camera module is inversely related to the driving times of the actuator in the second thread, that is, the more the driving times in the second thread, the smaller the moving step of the target component in the first camera module is, so as to ensure that the closer the target component in the first camera module is to the target base of the first camera module, the smaller the moving step is, and prevent the collision.
In one embodiment, the loop performs N driving processes, which may include:
calculating the position of the actuator at the next time according to the low-pass filter and the current position of the actuator; wherein the position of the actuator is a distance of the actuator from a target mount of the first camera module.
In some possible implementations, the low pass filter may be a first order digital low pass filter.
In some possible embodiments, the first order digital low pass filter may be designed as follows:
Y(n+1)=αX(n)+(1-α)Y(n)
wherein Y (n + 1) is the stop position of the motor in the next moving process after the nth moving process of the motor;
x (n) is the expected position of the motor (a fixed position close to the base of the first camera module), and when the value of n is different, the value of X (n) is the same value;
y (n) is the stop position of the motor in the nth movement process of the motor;
alpha is a filter coefficient and can be set by engineering personnel according to the motor characteristics.
For example, the mobile terminal brings the obtained initial position Y (1) of the motor and the expected position X (1) of the motor into the iterative formula, so as to obtain the stop position Y (2) of the motor in the first moving process of the motor, moves the motor to the position of Y (2), circularly executes the iterative formula, and gradually moves the lens in the first camera module to the position of the module base through calculation of the position of the motor.
In an example, α is set to be 0.1, the initial position Y (1) of the motor obtained by the mobile terminal is 100, the expected position X (1) of the motor is 10, and the above iterative formula is substituted to obtain the stopping position Y (2) =0.1 × 10+0.9 × 100 of the motor in the first moving process of the motor, that is, the stopping position Y (2) of the motor in the second moving process of the motor is 91; by continuously substituting Y (2) and X (2) into the above iterative formula, the stop position Y (3) =0.1 × 10+0.9 × 91 of the motor during the second movement of the motor can be obtained, i.e., the stop position Y (2) of the motor during the second movement of the motor is 82.9, and so on until the motor moves to the desired position.
In some possible embodiments, 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 moved to the desired position. Where Δ may be a filter parameter set by an engineer.
In the embodiment 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. Wherein, the first-order digital low pass filter who sets up can be applicable to the camera module of multiple different characteristics to for the engineer provides data reference, make things convenient for the engineer to debug, the engineer only need adjust the filter coefficient can, the debugging is convenient, the suitability is strong.
The following is a detailed description of an exemplary embodiment.
As shown in fig. 4, this exemplary embodiment, in which a main thread (i.e., a first thread) and a motor control thread (i.e., a second thread, which may be named parklens _ pthread herein), are run is applied to the zoom process. The two threads run in parallel.
The processing procedure of the main thread may include the following steps:
step S201, the APP layer sends an instruction for closing the first camera module to the HAL layer, and waits for the HAL layer to return a closing result.
In step S202, after receiving the instruction to close the first camera module, the HAL layer creates a motor control thread (parklens _ pthread), notifies the address (pActuator _ handle) of the motor (actor) instance to the motor control thread (parklens _ pthread), and takes over the motor instance by the motor control thread (parklens _ pthread), thereby taking over the control right of the motor.
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.
In step S204, the APP layer receives the result that the HAL layer has successfully closed the first camera module.
Step S205, the APP layer issues an instruction for opening the second camera module to the HAL layer, and the HAL layer opens the second camera module.
The processing procedure of the motor control thread (parklens _ pthread) may include the following steps:
in step S301, parameters of a first-order digital low-pass filter are loaded.
Step S302, according to the current position of the motor and the first-order digital low-pass filter, the moving step length in the current pushing process is generated.
Step S303, sending an instruction to the motor to push the lens to move by using the motor instance, where the distance pushed is the moving step length.
Step S304, judging whether the lens reaches the expected position, if so, continuing to execute the step S305; if not, the process returns to step S302 and is repeated.
S305, power-off processing is performed on the motor, the motor resource is released, and the motor control thread (parklens _ pthread) is destroyed.
Wherein the motor control thread is executed in parallel with the main thread. When the main thread processes the camera module switching task, the motor can control the thread to process the instruction for closing the first camera module, so that the main thread is prevented from being blocked.
The embodiment of the disclosure provides a device for controlling a camera assembly, which is applied to a mobile terminal. The mobile terminal is a mobile phone, a tablet computer, an intelligent device and the like.
Referring to fig. 5, fig. 5 is a flowchart illustrating an apparatus for controlling a camera assembly according to an exemplary embodiment. As shown in fig. 5, the apparatus may include:
a first determining module 51, configured to determine to receive an instruction to close the first camera module;
the first control module 52 is configured to close the first camera module through the first thread;
and a second control module 53, configured to control, through a second thread, an 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 a state without anti-shake processing.
The embodiment of the disclosure provides a device for controlling a camera assembly, which is applied to a mobile terminal. This apparatus includes the modules shown in fig. 5, illustratively:
the second control module 52 is further 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 the target focal length or restore the first camera module to the no-shake processing state, and then power off the actuator of the first camera module through the second thread.
The embodiment of the disclosure provides a device for controlling a camera assembly, which is applied to a mobile terminal. This apparatus includes the modules shown in fig. 5, illustratively:
the first control module 51 is further configured to start the second camera module through the first thread after the first camera module is closed through the first thread.
The embodiment of the disclosure provides a device for controlling a camera assembly, which is applied to a mobile terminal. This apparatus includes the modules shown in fig. 5, illustratively:
the second control module 52 includes:
the control unit is used for controlling the actuator of the first camera module to drive the movable component through the second wire so as to move 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 a set distance from a target mount of the first camera module.
In one embodiment, the apparatus further comprises:
the second determination module is used for determining the attitude of the mobile terminal according to the inertial sensor;
a third determination module for determining an orientation of the target component from the pose;
the fourth determining module is used for determining a target base of the first camera module according to the orientation of the target assembly; wherein the target base is a top base or a bottom base.
In an embodiment, the control unit is further configured to control 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 using the following method:
circularly executing the driving process for N times until the target component of the first camera module moves to the expected position; wherein, N is an integer larger than 0, and each driving process in the N pushing processes corresponds to a moving step length.
In an embodiment, the movement step size is inversely related to the number of drives of the actuator in the second thread.
In one embodiment, the control unit comprises:
a calculation unit for calculating the position of the actuator at the next time based on the low-pass filter and the current position of the actuator; wherein the position of the actuator is a distance of the actuator from a target mount of the first camera module.
The embodiment of the present disclosure provides a device for controlling a camera module, which is applied to a terminal and includes:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to execute executable instructions in the memory to implement the steps of the method.
The disclosed embodiments 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.
Fig. 6 is a block diagram illustrating an apparatus 600 for controlling a camera module according to an exemplary embodiment. For example, the apparatus 600 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, an exercise device, a personal digital assistant, and the like.
Referring to fig. 6, the apparatus 600 may include one or more of the following components: processing component 602, memory 604, power component 606, multimedia component 608, audio component 610, input/output (I/O) interface 612, sensor component 614, and communication component 616.
The processing component 602 generally controls overall operation of the device 600, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations. The processing component 602 may include one or more processors 620 to execute instructions to perform all or a portion of the steps of the methods described above. Further, the processing component 602 can include one or more modules that facilitate interaction between the processing component 602 and other components. For example, the processing component 602 can include a multimedia module to facilitate interaction between the multimedia component 608 and the processing component 602.
The memory 604 is configured to store various types of data to support operation at the device 600. Examples of such data include instructions for any application or method operating on device 600, contact data, phonebook data, messages, pictures, videos, and so forth. The memory 604 may be implemented by any type or combination of volatile or non-volatile memory devices 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 or optical disks.
Power supply component 606 provides power to the various components of device 600. The power components 606 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the apparatus 600.
The multimedia component 608 includes a screen that provides an output interface between the device 600 and a user. In some embodiments, the screen may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive an input signal from a user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundary of a touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 608 includes a front lens and/or a rear lens. The front lens and/or the rear lens may receive external multimedia data when the device 600 is in an operation mode, such as a photographing mode or a video mode. Each of the front lens and the rear lens may be a fixed optical lens system or have a focal length and optical zoom capability.
The audio component 610 is configured to output and/or input audio signals. For example, audio component 610 includes a Microphone (MIC) configured to receive external audio signals when apparatus 600 is in an operational mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signal may further be stored in the memory 604 or transmitted via the communication component 616. In some embodiments, audio component 610 further includes a speaker for outputting audio signals.
The I/O interface 612 provides an interface between the processing component 602 and peripheral interface modules, which may be keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to: a home button, a volume button, a start button, and a lock button.
The sensor component 614 includes one or more sensors for providing status assessment of various aspects of the apparatus 600. For example, the sensor component 614 may detect an open/closed state of the device 600, the relative positioning of components, such as a display and keypad of the apparatus 600, the sensor component 614 may also detect a change in position of the apparatus 600 or a component of the apparatus 600, the presence or absence of user contact with the apparatus 600, orientation or acceleration/deceleration of the apparatus 600, and a change in temperature of the apparatus 600. The sensor assembly 614 may include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 614 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 614 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
The communication component 616 is configured to facilitate communications between the apparatus 600 and other devices in a wired or wireless manner. The apparatus 600 may access a wireless network based on a communication standard, such as WiFi,2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 616 receives broadcast signals 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 communications. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, ultra Wideband (UWB) technology, bluetooth (BT) technology, and other technologies.
In an exemplary embodiment, the apparatus 600 may be implemented by 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 components for performing the above-described methods.
In an exemplary embodiment, a non-transitory computer readable storage medium comprising instructions, such as the memory 604 comprising instructions, executable by the processor 620 of the apparatus 600 to perform the above-described method is also provided. For example, the non-transitory computer readable storage medium may be a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the embodiments of the disclosure following, in general, the principles of the embodiments of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the embodiments pertain. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosed embodiments being indicated by the following claims.
It is to be understood that the embodiments of the present disclosure are not limited to the precise arrangements described above and shown in the drawings, and that various combinations, substitutions, modifications, and changes of the method steps or terminal assemblies disclosed in the present disclosure may be made without departing from the scope thereof, and are intended to be included within the scope of the present disclosure. The scope of the disclosure as claimed is limited by the claims appended hereto.
It should be noted that, in the present disclosure, the terms "comprises," "comprising," or any other variation 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 may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising a … …" does not exclude the presence of another identical element in a process, method, article, or apparatus that comprises the element.

Claims (18)

1. A method for controlling a camera module is applied to a mobile terminal, and is characterized by comprising the following steps:
determining to receive an instruction for closing the first camera module;
closing the first camera module through the first thread; and controlling an actuator of the first camera module to drive the movable assembly 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 non-anti-shake processing state.
2. The method of claim 1,
after controlling an actuator of the first camera module to drive a movable assembly through a second thread to restore the focal length of the first camera module to a target focal length or to restore the first camera module to a no-shake processing state, the method further includes:
powering down an actuator of the first camera module by a second thread.
3. The method of claim 1,
after the first camera module is closed through the first thread, the method further includes:
and starting the second camera module through the first thread.
4. The method of claim 1,
the actuator drive movable assembly of first camera module through second thread control to make the focus of first camera module resume to the target focus or make first camera module resume to no anti-shake processing state includes:
controlling an actuator of the first camera module to drive a movable assembly through the second thread, and moving a target assembly 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 a set distance from a target mount of the first camera module.
5. The method of claim 4,
the method further comprises the following steps:
determining the attitude of the mobile terminal according to an inertial sensor;
determining an orientation of the target component from the pose;
determining a target base of the first camera module according to the orientation of the target assembly; wherein the target base is a top base or a bottom base.
6. The method of claim 4,
the controlling of the actuator of the first camera module by the second thread to drive the movable assembly to move the target assembly of the first camera module to a desired position includes: controlling an actuator of the first camera module to circularly execute N times of driving processes through the second thread until a target component of the first camera module moves to a desired position;
wherein, N is an integer larger than 0, and each driving process in the N pushing processes corresponds to a moving step length.
7. The method of claim 6,
the movement step size is inversely related to a number of drives of the actuator in the second thread.
8. The method of claim 6,
the loop executes N driving processes, including:
calculating the position of the actuator at the next time according to the low-pass filter and the current position of the actuator; wherein the position of the actuator is a distance of the actuator from a target mount of the first camera module.
9. The utility model provides a device of control camera module, is applied to mobile terminal, its characterized in that includes:
the first determining module is used for determining and receiving an instruction for closing the first camera module;
the first control module is used for closing the first camera module through a first thread;
and the second control module is used for controlling the actuator of the first camera module to drive the movable assembly through a second thread so as to restore the focal length of the first camera module to the target focal length or restore the first camera module to a non-anti-shake processing state.
10. The apparatus of claim 9,
the second control module is further used for controlling the actuator of the first camera module to drive the movable assembly through a second thread so as to enable the focal length of the first camera module to be recovered to a target focal length or enable the first camera module to be recovered to a non-shake-prevention processing state, and then powering off the actuator of the first camera module through a second thread.
11. The apparatus of claim 9,
the first control module is also used for starting the second camera module through the first thread after the first camera module is closed through the first thread.
12. The apparatus of claim 9,
the second control module includes:
the control unit is used for controlling 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 a desired position; wherein the target component is a lens and/or an image sensor, and the desired position is a position a set distance from a target mount of the first camera module.
13. The apparatus of claim 12,
the device further comprises:
the second determination module is used for determining the attitude of the mobile terminal according to the inertial sensor;
a third determination module for determining an orientation of the target component from the pose;
the fourth determining module is used for determining a target base of the first camera module according to the orientation of the target assembly; wherein the target base is a top base or a bottom base.
14. The apparatus of claim 12,
the control unit is further used for controlling the actuator of the first camera module to drive the movable component through the second line by using the following method to move the target component of the first camera module to a desired position:
controlling an actuator of the first camera module to circularly execute N times of driving processes through the second thread until a target component of the first camera module moves to a desired position; wherein, N is an integer larger than 0, and each driving process in the N pushing processes corresponds to a moving step length.
15. The apparatus of claim 14,
the movement step size is inversely related to a number of drives of the actuator in the second thread.
16. The apparatus of claim 14,
the control unit includes:
a calculation unit for calculating the position of the actuator at the next time based on the low-pass filter and the current position of the actuator; wherein the position of the actuator is a distance of the actuator from a target mount of the first camera module.
17. The utility model provides a device of control camera module, is applied to the terminal, its characterized in that includes:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to execute executable instructions in the memory to implement the steps of the method of any one of claims 1 to 8.
18. A non-transitory computer readable storage medium having stored thereon executable instructions, wherein the executable instructions, when executed by a processor, implement the steps of the method of any one of claims 1 to 8.
CN202110720287.5A 2021-06-28 2021-06-28 Method and device for controlling camera module and readable storage medium Pending CN115604562A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110720287.5A CN115604562A (en) 2021-06-28 2021-06-28 Method and device for controlling camera module and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110720287.5A CN115604562A (en) 2021-06-28 2021-06-28 Method and device for controlling camera module and readable storage medium

Publications (1)

Publication Number Publication Date
CN115604562A true CN115604562A (en) 2023-01-13

Family

ID=84840629

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110720287.5A Pending CN115604562A (en) 2021-06-28 2021-06-28 Method and device for controlling camera module and readable storage medium

Country Status (1)

Country Link
CN (1) CN115604562A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117149294A (en) * 2023-02-27 2023-12-01 荣耀终端有限公司 Camera application configuration method, device and storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117149294A (en) * 2023-02-27 2023-12-01 荣耀终端有限公司 Camera application configuration method, device and storage medium

Similar Documents

Publication Publication Date Title
CN105955766B (en) Using preloading method and device
CN106572299B (en) Camera opening method and device
US11158447B2 (en) Functional component, method for controlling functional component, and terminal
CN109766954B (en) Target object processing method and device, electronic equipment and storage medium
EP3244396A1 (en) Split-screen display method and apparatus
CN111314768A (en) Screen projection method, screen projection device, electronic equipment and computer readable storage medium
EP3176776A1 (en) Luminance adjusting method and apparatus, computer program and recording medium
CN107943347B (en) Touch screen control method and device
CN105930213B (en) Using operation method and device
CN106357721B (en) Timing method and device
CN109842755B (en) Motor control method, control circuit and electronic equipment
CN109471596B (en) Data writing method, device, equipment and storage medium
EP3249505A1 (en) Method and device for controlling state of touch screen, electronic device
JP2017510920A (en) Power consumption control method, apparatus, program, and recording medium
CN106547462B (en) Photographing control method and device and mobile terminal
US20210126474A1 (en) Charging control method, device and storage medium
CN112217990A (en) Task scheduling method, task scheduling device, and storage medium
KR20110131468A (en) Mobile terminal and method for controlling recording thereof
CN115604562A (en) Method and device for controlling camera module and readable storage medium
US11510253B2 (en) Random access control method and random access control apparatus
CN106325508A (en) Method and device for processing application
CN114721108A (en) Driving device, method, apparatus and medium for eliminating lens impact noise
CN105227426B (en) Application interface switching method and device and terminal equipment
CN114430453A (en) Camera anti-shake system, control method, equipment and medium
CN114339019A (en) Focusing method, focusing device and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination