Motor control method and electronic device
By returning the OIS motor to the initial position in the frame gap of the electronic device, the video tremor problem caused by user hand tremor is solved, and a more stable and clear image effect is achieved.
Patent Information
- Application Number
- PCT/CN2024/080647
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-05-26
- Filing Date
- 2024-03-07
- Publication Date
- 2025-02-06
AI Technical Summary
When a user uses an electronic device to photograph, the image becomes blurred due to the jitter caused by the user's grip or movement, resulting in tremor between video frames.
By returning the motor of the optical image stabilization (OIS) system to the initial position when powered up in the frame gap, each frame has a relatively balanced OIS compensation degree, reducing tremor between video frames.
It realizes reducing the tremor between frames during video recording, improving the processing effect of video frames, and making the image more stable and clear.
Smart Images

Figure CN2024080647_06022025_PF_FP_ABST
Abstract
Description
Motor control method and electronic device
[0001] This application claims priority to the Chinese patent application filed with the State Intellectual Property Office of China on May 26, 2023, with application number 202310609461.8 and application name “Motor Control Method and Electronic Device”, the entire contents of which are incorporated by reference into this application. Technical Field
[0002] The present application relates to the field of image processing, and in particular to a motor control method and electronic device. Background Art
[0003] When users use electronic devices to record videos, images may appear blurry due to shaking caused by the user's grip or movement. Generally speaking, shaking during grip or movement is irregular, and the degree of image blur is also irregular. Because video is composed of a series of consecutive frames, inconsistent blur levels between adjacent frames can cause a jarring sensation.
[0004] Summary of the Invention
[0005] The present application provides a motor control method and electronic device that return the motor of an optical image stabilization (OIS) system to its initial position at power-on between frames, ensuring a relatively balanced degree of OIS compensation for each frame, reducing judder between video frames, and improving video frame processing quality.
[0006] In a first aspect, the present application provides a motor control method for an electronic device. During exposure of a current image frame, the electronic device controls the motor to move to implement an anti-shake function. After the current image frame is exposed, the electronic device controls the motor to move back to its initial position upon power-up. During exposure of the next image frame, the electronic device controls the motor to move from the position after the return to the center position to implement an anti-shake function.
[0007] The motor control method provided in the present application can control the motor to move back to the direction of its initial position when it is powered on, thereby expanding the motor's motion range in the next image frame as much as possible, making the motor's motion range as similar as possible when performing OIS compensation in the current image frame and the next image frame, thereby ensuring that the current image frame and the next image frame have a relatively balanced degree of OIS compensation, thereby reducing the tremor between video frames.
[0008] In a possible implementation, the electronic device controls the motor to move back to the initial position when powered on during the frame interval between the last line of the current image frame being exposed and the first line of the next frame being exposed.
[0009] The motor control method provided in the present application can control the motor to move back to the direction of its initial position when it was powered on after the exposure of the current image frame is completed and before the exposure of the next image frame begins. It can prevent the motor from moving in the direction opposite to the anti-shake movement during the exposure of the image frame, and can avoid the interference and reduction of the image anti-shake effect caused by the motor centering.
[0010] In a possible implementation, the electronic device obtains spatial posture parameters and ambient brightness parameters, and then controls the motor to move back to the initial position direction when it is powered on based on the spatial posture parameters and ambient brightness parameters.
[0011] The motor control method provided in this application can control the motor to return to its original position when the electronic device is powered on, based on whether the electronic device is currently in a stable or moving state and the current ambient brightness. After comprehensively considering the motor's movement pattern in the current frame based on the electronic device's state and ambient brightness, the motor's return to centering pattern is further determined, thereby achieving a better motor return to centering effect.
[0012] In a possible implementation, when the device is in motion and in a dark scene, the electronic device shortens the exposure time and controls the motor to move in a circular motion during the frame interval.
[0013] When an electronic device is in a dimly lit scene, it takes a long time to expose, resulting in a relatively short interframe gap. When the device is in motion, the motor's travel for anti-shake is long, requiring ample time for the motor to return to center. This method shortens the exposure time, sacrificing exposure, and lengthens the interframe gap, ensuring ample time for the motor to return to center.
[0014] In one possible implementation, when in motion and in a dark scene, the electronic device can shorten the exposure time from a first exposure time to a second exposure time, and the second exposure time is greater than a third time, and the third time is the minimum time to ensure the image exposure quality in the dark scene.
[0015] In order to extend the frame interval, the electronic device shortens the exposure time from the first exposure time to the second exposure time. However, considering that dark scenes require a certain exposure time to ensure the imaging effect, the exposure time cannot be shortened indefinitely. Therefore, the second exposure time needs to be no less than the third exposure time to ensure the image exposure quality in dark scenes.
[0016] In one possible implementation, when in motion and in a dark scene, the electronic device can reduce the frame rate and further extend the frame duration from a first frame duration to a second frame duration, and the difference between the second frame duration and the first frame duration is greater than the difference between the second exposure time and the third exposure time.
[0017] To extend the inter-frame gap, the electronic device shortens the exposure time from the first exposure time to the second exposure time. However, considering that low-light scenes require a certain exposure time to ensure imaging quality, the exposure time cannot be shortened indefinitely. Therefore, this method further reduces the frame rate. When the exposure time cannot be further shortened, the inter-frame gap is extended by extending the frame length to allow the motor sufficient time to return to the center.
[0018] In a possible implementation, the third time is 10 ms.
[0019] To ensure image exposure quality in a dark scene, the electronic device may have an exposure time of 10ms, which is the minimum time required to ensure image exposure quality in a dark scene.
[0020] In a second aspect, the present application provides an electronic device comprising a processor, a memory and a camera module, wherein the memory stores computer instructions. When the processor executes the computer instructions, the electronic device executes any one of the motor control methods in the first aspect.
[0021] In one possible implementation, the camera module includes an image sensor and a driver chip connected to the image sensor. The image sensor sends a first level signal to the driver chip during the exposure time, and the driver chip further controls the motor to perform anti-shake movement. The image sensor sends a second level signal to the driver chip during the non-exposure time, and the driver chip further controls the motor to move back to the center.
[0022] In a third aspect, the present application provides a chip system, which includes a processor and a communication interface. When the processor runs a computer program, it executes any one of the motor control methods in the first aspect.
[0023] In a fourth aspect, the present application provides a computer-readable storage medium storing computer instructions. When the computer instructions are executed on an electronic device, the electronic device executes any one of the motor control methods in the first aspect.
[0024] In a fifth aspect, the present application provides a computer program product storing program code. When the computer program product runs on an electronic device, the electronic device executes any one of the motor control methods in the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] FIG1 is a schematic diagram of a hardware system applicable to the present application;
[0026] FIG2 is a schematic diagram of the process of exposing a moving object to an image sensor using a rolling shutter exposure method;
[0027] FIG3 is a schematic diagram of the process of exposing a moving object to an image sensor using a rolling shutter exposure method when an optical image stabilization system is present;
[0028] FIG4 is a schematic diagram of simultaneously exposing two rows of an image sensor in a rolling shutter exposure mode when an optical image stabilization system is present during exposure of a moving object;
[0029] FIG5 is a schematic diagram of the exposure time and readout time of two adjacent frames of an image sensor in a rolling shutter exposure mode;
[0030] FIG6 is a schematic structural diagram of a camera module applicable to the present application;
[0031] FIG7 is a schematic diagram showing the change in stroke of the OIS motor over time when the motor touches the boundary;
[0032] FIG8 is a flow chart of a motor control method according to an embodiment of the present application;
[0033] FIG9 is a schematic diagram showing the change in the stroke of the OIS motor over time after returning to the center position between frames;
[0034] FIG10 is a schematic diagram of exposure time and readout time of two adjacent frames of an image sensor in another rolling shutter exposure mode;
[0035] FIG11 is a module diagram of an image stabilization method provided in an embodiment of the present application;
[0036] FIG12 is a timing diagram of an image stabilization method provided in an embodiment of the present application;
[0037] FIG13 is a schematic diagram of the exposure time and readout time of two adjacent frames of an image sensor in a global shutter exposure mode. DETAILED DESCRIPTION
[0038] The terms used in the following embodiments are for the purpose of describing the embodiments and are not intended to limit the present application. As used in the specification of the present application and the appended claims, the singular expressions "a", "an", "said", "above", and "the" are intended to also include expressions such as "one or more", unless the context clearly indicates otherwise. It should also be understood that in the following embodiments of the present application, "one or more" refers to one, two, or more than two. The term "and / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist; for example, A and / or B may represent: A exists alone, A and B exist at the same time, and B exists alone, where A and B may be singular or plural. The character " / " generally indicates that the previous and subsequent associated objects are in an "or" relationship.
[0039] References to "some embodiments" and the like described in this specification mean that a particular feature, structure, or characteristic described in conjunction with that embodiment is included in one or more embodiments of the present application. Thus, phrases such as "in one embodiment," "in some embodiments," "in other embodiments," and "in other embodiments" appearing in various places in this specification do not necessarily refer to the same embodiment, but rather mean "one or more but not all embodiments," unless otherwise specifically emphasized. The terms "including," "comprising," "having," and variations thereof all mean "including but not limited to," unless otherwise specifically emphasized.
[0040] The following describes embodiments of electronic devices and motor control methods for such electronic devices. In some embodiments, the electronic device may be a portable electronic device that also includes other functions such as a personal digital assistant and / or a music player, such as a mobile phone, a tablet computer, a wearable electronic device with wireless communication functions (such as a smart watch), etc. Exemplary embodiments of portable electronic devices include but are not limited to those equipped with Or a portable electronic device with other operating systems. The portable electronic device may also be other portable electronic devices, such as a laptop computer. It should also be understood that in some other embodiments, the electronic device may not be a portable electronic device, but a desktop computer.
[0041] For example, FIG1 shows a schematic diagram of the structure of an electronic device 100. The electronic device 100 may include a processor 110, a display screen 120, a camera 130, an internal memory 140, a subscriber identification module (SIM) card interface 150, a universal serial bus (USB) interface 160, a charging management module 170, a power management module 171, a battery 172, a sensor module 180, a mobile communication module 190, a wireless communication module 200, an antenna 1, and an antenna 2. The sensor module 180 may include a pressure sensor 180A, a fingerprint sensor 180B, a touch sensor 180C, an ambient light sensor 180D, and the like.
[0042] It should be understood that the structures illustrated in the embodiments of the present application do not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown, or may combine or separate certain components, or arrange the components differently. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0043] The processor 110 may include one or more processing units. For example, the processor 110 may include a central processing unit (CPU), an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU). The different processing units may be independent components or integrated into one or more processors. A central processing unit is also referred to as a central processing unit (CPU), and a graphics processing unit is also referred to as a graphics processor (GPU). In some embodiments, the electronic device 100 may also include one or more processors 110. The controller may generate operation control signals based on instruction opcodes and timing signals to control instruction fetching and execution. In other embodiments, the processor 110 may also include a memory for storing instructions and data. Exemplarily, the memory in the processor 110 may be a cache memory. This memory may store instructions or data that have just been used or are being recycled by the processor 110. If the processor 110 needs to use the instruction or data again, it can be directly called from the memory, thus avoiding repeated access and reducing the waiting time of the processor 110, thereby improving the efficiency of the electronic device 100 in processing data or executing instructions.
[0044] In some embodiments, the processor 110 may include one or more interfaces. The interfaces may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a SIM card interface, and / or a USB interface. Among them, the USB interface 160 is an interface that complies with the USB standard specification, and specifically can be a Mini USB interface, a Micro USB interface, a USB Type C interface, etc. The USB interface 130 can be used to connect a charger to charge the electronic device 100, and can also be used to transmit data between the electronic device 100 and peripheral devices. The USB interface 160 can also be used to connect headphones to play audio through the headphones.
[0045] It is understood that the interface connection relationship between the modules illustrated in the embodiments of the present application is for illustrative purposes only and does not constitute a structural limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may also adopt different interface connection methods from the above embodiments, or a combination of multiple interface connection methods.
[0046] Electronic device 100 implements display functionality through a GPU, display screen 120, and an application processor. The GPU is a microprocessor for image processing that connects display screen 120 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. Processor 110 may include one or more GPUs that execute program instructions to generate or modify display information.
[0047] The camera 130 is used to capture still images or videos. The object generates an optical image through the lens and projects it onto the photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the light signal into an electrical signal, and then passes the electrical signal to the ISP for conversion into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard red, green, blue (RGB), YUV or other format. In some embodiments, the electronic device 100 may include 1 or N cameras 130, where N is a positive integer greater than 1.
[0048] The internal memory 140 can be used to store one or more computer programs, which include instructions. The processor 110 can execute the above instructions stored in the internal memory 140, thereby enabling the electronic device 100 to perform the display method provided in some embodiments of the present application, as well as various applications and data processing. The internal memory 140 may include a program storage area and a data storage area. The program storage area may store an operating system; the program storage area may also store one or more applications (such as a gallery, contacts, etc.). The data storage area may store data created during the use of the electronic device 100 (such as photos, contacts, etc.). In addition, the internal memory 140 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more disk storage components, a flash memory component, a universal flash storage (UFS), etc. In some embodiments, the processor 110 can execute the instructions stored in the internal memory 140 and / or the instructions stored in the memory provided in the processor 110, thereby enabling the electronic device 100 to execute the image stabilization method provided in the embodiments of the present application, as well as other applications and data processing.
[0049] The internal memory 140 can be used to store the relevant programs of the image stabilization method provided in the embodiment of the present application, and the processor 110 can be used to call the relevant programs of the image stabilization method stored in the internal memory 140 during image processing to execute the image stabilization method of the embodiment of the present application.
[0050] The sensor module 180 may include a gyro sensor 180B, an ambient light sensor 180D, and the like.
[0051] The gyroscope sensor 180B can be used to determine the motion posture of the electronic device 100. In some embodiments, the angular velocity of the electronic device 100 around three axes (i.e., x, y, and z axes) can be determined by the gyroscope sensor 180B. The gyroscope sensor 180B can be used for anti-shake shooting. For example, when the shutter is pressed, the gyroscope sensor 180B detects the angle of the electronic device 100 shaking, calculates the distance that the lens module needs to compensate based on the angle, and allows the lens to offset the shaking of the electronic device 100 through reverse movement to achieve anti-shake. The gyroscope sensor 180B can also be used for navigation and somatosensory game scenes.
[0052] Ambient light sensor 180D is used to sense ambient light brightness. Electronic device 100 can adaptively adjust the brightness of display screen 120 based on the sensed ambient light brightness. Ambient light sensor 180D can also be used to automatically adjust white balance during photography. Ambient light sensor 180D can also transmit information about the device's surroundings to the GPU.
[0053] Figure 2 is a schematic diagram of the exposure process of an image sensor using a rolling shutter exposure method. Figures 2(a) to 2(e) are arranged in chronological order. As shown by the black horizontal bars moving downward row by row, at the beginning of exposure, the image sensor scans the imaging unit row by row and exposes the image row by row. The shaded area in Figure 2(a) represents the object being photographed. The object moves from left to right, so its position on the sensor imaging unit will vary at different times. As shown in Figure 2(e), during the exposure time, the exposure result of the object in the imaging area is similar to the wedge in Figure 3. Similarly, when the user's hand is trembling, the effect of the object moving as shown in Figure 2 will also appear.
[0054] If the electronic device has an optical image stabilization system, it can detect lens module shake using spatial attitude parameters. The processor then calculates the displacement that needs to be compensated, further instructing the OIS motor to drive the OIS base in the XY plane to compensate for lens shake. Compensating based on lens movement can effectively overcome image blur caused by electronic device vibration. As shown in Figures 2(a) to 2(e), due to the compensation of the OIS system, the exposure of the object will still maintain its original rectangular shape.
[0055] The image sensor begins exposing the first row, and the next row begins exposure after a row cycle completes. Data readout also begins after the first row has finished exposing. Reading out a row requires a row cycle, meaning that after the first row has been completely read out, the second row begins reading out. Therefore, while row N (N > 3) is being exposed, row N-1 is reading out. At this point, the imaging units in the first row have already completed exposure and readout, allowing the next round of exposure to begin. As shown in Figure 4(e), the first and fourth rows are exposed simultaneously. Therefore, as shown in Figure 5, the exposure time of the next frame overlaps with that of the current frame.
[0056] Figure 6 shows a camera structure. As shown in Figure 6, the camera includes a lens support 61, an auto focus (AF) base 62, and an optical image stabilization (OIS) base 63. The electronic device detects the vibration of the lens module through spatial posture parameters, and then uses the processor to calculate the displacement that needs to be compensated. It further instructs the OIS motor to drive the OIS base to move in the XY plane, thereby compensating for the lens vibration. Compensating according to the movement of the lens can effectively overcome image blur caused by vibration of the electronic device. According to the instructions of the processor, the AF system drives the auto focus base to move in the z-axis direction, thereby changing the distance between the lens and the image sensor to improve focus clarity.
[0057] For electronic devices, using an OIS system can effectively improve lens stability during shooting, thereby extending exposure time and further enhancing low-light shooting effects. Therefore, when the image sensor is exposing, the OIS must be active to compensate for lens shake in real time. In other words, the OIS must be enabled during the exposure time. As shown in Figures 2(e) and 5, the exposure of the fourth row has not yet been completed in the current frame, while the first row has already been exposed in the next frame. Therefore, the OIS is always active, that is, it is always enabled.
[0058] However, the OIS motor has a limited range of motion and can only compensate for lens shake within a certain range. If lens shake in the same direction exceeds the OIS motor's range, the OIS motor will no longer be able to move the lens or sensor in the opposite direction, and the OIS system will fail. As shown in Figure 7, once the OIS motor reaches point A, the OIS system will no longer be able to compensate in that direction for the rest of the shot. As shown in segments AB, even if lens shake is detected in the previous direction, the OIS motor will not be able to move again due to reaching its maximum range. The OIS system will fail, and image clarity will be reduced.
[0059] When users record videos using electronic devices, if the blur levels of adjacent frames are inconsistent, a phenomenon called sharpness difference between frames may occur, causing image clarity to fluctuate and impacting the user experience. It should be understood that judder has nothing to do with whether the image is blurry or not, but rather with the difference in blur levels between adjacent frames. In other words, if adjacent frames are equally clear or equally blurry, there will be no judder. Therefore, when recording, if adjacent frames cannot be compensated for OIS identically, the blur levels of adjacent frames will differ, and the resulting video will have a juddering feel.
[0060] For ease of understanding, the following embodiments of the present application will take an electronic device having the structure shown in FIG1 as an example, and specifically illustrate the motor control method provided in the embodiments of the present application in conjunction with the accompanying drawings.
[0061] This embodiment provides a motor control method, as shown in FIG8 . The steps of the motor control method provided by this embodiment are described below.
[0062] Step 1: During the exposure of the current image frame, the electronic device controls the OIS motor to move for anti-shake.
[0063] When an electronic device is performing an exposure, it is necessary to overcome the user's hand shake or movement to keep the electronic device stable. This is achieved by controlling the OIS motor to move in the opposite direction of the electronic device within the plane to ensure the relative stability of the lens, thereby achieving the purpose of anti-shake.
[0064] Step 2: After the current image frame is exposed, the electronic device controls the OIS motor to move back to the initial position when it was powered on.
[0065] To ensure the OIS motor has a wide range of motion in all directions when exposing the next frame, thereby reducing vibration, the electronics must control the OIS motor's return to its initial position based on the exposure. When the camera module is not operating, the motor is de-energized, and the lens moves with the electronics within the housing. When the camera module is operating, the motor is powered on. To compensate for vibration in all directions, the initial position is set midway within the motor's range.
[0066] To eliminate judder and ensure the same degree of OIS compensation between the current and next frames, the OIS motor's range of motion must be kept as close as possible during each frame exposure. Therefore, the OIS motor can be returned (i.e., "re-centered") to its initial position (i.e., the middle of its travel range) when powered on after the current frame exposure ends and before the next frame exposure begins. In one implementation of this embodiment, the OIS motor does not need to return completely to its initial position; it only needs to return in the direction of its initial position.
[0067] For example, as shown in Figure 9, point C is the position of the OIS motor at the end of the current frame exposure, and point D is the position of the OIS motor at the beginning of the next frame exposure. The movement of the OIS motor from point C to point D is called OIS re-centering. Segment DE is the direction of movement of the OIS motor for the next frame. If point C is the maximum point of the OIS motor's travel and OIS re-centering is not performed in segment CD, OIS compensation will not be performed during the capture of the next frame.
[0068] However, if the exposure times of consecutive frames overlap, as shown in Figure 3, there will be no time for the OIS to center. Therefore, the motor control method provided in the embodiments of the present application requires a frame gap, that is, a period of time between the end of the current frame exposure and the beginning of the next frame exposure. In this case, even if the OIS motor reaches its maximum travel when capturing the current frame and centers during the frame gap, the OIS can still provide compensation and reduce judder, even if the OIS still needs to move in the same direction in the next frame.
[0069] Step 3: During the exposure of the next image frame, the electronic device controls the OIS motor to start anti-shake movement from the position after the return to the center.
[0070] Similar to step 1, to ensure a clear image, the electronics control the OIS motor to move the lens in the direction opposite to the shake. As shown in Figure 7, segments CD represent the OIS re-centering phase, with point D representing the OIS motor's re-centering position. During the next frame exposure, the electronics control the OIS motor to begin moving from point D.
[0071] In one implementation of this embodiment, step 2 further includes:
[0072] Step 21: The electronic device obtains spatial posture parameters and ambient brightness parameters.
[0073] Electronic devices can obtain the current ambient brightness parameter through devices such as ambient light sensors. The current ambient brightness parameter represents the brightness level of the currently captured image. The angular velocity of the electronic device around the x, y, and z axes, transmitted by the gyroscope, determines whether the electronic device is in a stable or moving state. The three-axis angular velocity parameters can also be divided into numerical ranges to further distinguish between stable, slightly moving, and significantly moving electronic devices.
[0074] Step 22: The electronic device determines the exposure parameters of the current image frame based on the ambient brightness parameters and the spatial posture parameters.
[0075] The exposure parameters are related to the ambient brightness parameters. Generally, when the environment is bright, a shorter exposure time can obtain a better imaging frame, while when the environment is dark, a longer exposure time is required to obtain as much detailed information as possible. The electronic device can obtain the exposure parameters based on a first comparison table of ambient brightness parameters and exposure parameters. For example, in a first exposure scenario, when the ambient brightness parameter is below a first threshold, the first exposure parameter is used, which may be 30ms; in a second exposure scenario, when the ambient brightness parameter is between the first and second thresholds, the second exposure parameter is used, which may be 20ms; in a third exposure scenario, when the ambient brightness parameter is above the second threshold, the third exposure parameter is used, which may be 10ms.
[0076] At the same time, if the electronic device is detected to be in motion, the exposure time can be reduced based on a second comparison table of ambient brightness parameters and exposure parameters in the motion state. For example, in a first exposure scenario, when the ambient brightness parameter is below a first threshold and the electronic device is in motion, a first correction exposure parameter is used, which may be 20ms. In a second exposure scenario, when the ambient brightness is between the first and second thresholds and the electronic device is in motion, a second correction exposure parameter is used, which may be 10ms.
[0077] Step 23: The electronic device controls the motor to return to the center based on the spatial posture parameter and the ambient brightness parameter.
[0078] Frame rate is a measure of the number of frames displayed per unit time. The unit of measurement is "frames per second" (FPS). The frame duration corresponds to the frame rate. The interframe gap is the time between the completion of the last line exposure of the current frame and the start of the first line exposure of the next frame.
[0079] In the first exposure scenario, if the ambient brightness parameter is lower than the first threshold and the electronic device is stable, the first exposure parameters are used, such as a 30ms exposure time. OIS is continuously enabled, and the OIS motion range is small, eliminating the need for OIS re-centering. If the electronic device is in motion, the first corrected exposure parameters are used, such as a 20ms exposure time. The frame rate is reduced, thereby extending the frame duration to create inter-frame gaps, allowing OIS re-centering during these gaps.
[0080] As shown in Figure 10(a), the frame rate can be reduced and the frame duration can be extended, so that the extended time can be used to create a frame gap. For example, when the frame rate is 30fps, the frame duration is 33ms. If the frame rate is reduced to 24fps, the frame duration becomes 40ms accordingly. Even if the exposure time and readout time remain unchanged, there can be 7ms of time for OIS to return to center. In one possible implementation, when the frame rate is 30fps and the frame duration is 33ms, the readout time is 7ms, the exposure time can be 20ms, and the OIS return time can be 4-7ms.
[0081] In the second exposure scenario, the ambient brightness parameter is higher than the first threshold and lower than the second threshold. If the electronic device is in a stable state, the second exposure parameter is used, such as an exposure time of 20ms. OIS is continuously enabled, and the OIS motion range is not large, so OIS re-centering is no longer required. If the electronic device is in motion, the second correction exposure parameter is used, such as an exposure time of 10ms, to obtain a frame gap, allowing OIS to re-center during the frame gap. As shown in Figure 10(b), when the frame rate remains unchanged, the frame duration remains unchanged, and the exposure time can be shortened to generate a frame gap.
[0082] In the third exposure scenario, the ambient brightness parameter is higher than the second threshold. Regardless of whether the electronic device is in a stable state or in motion, the third exposure parameter is used. For example, the exposure time is 10ms. The exposure time is very short, the shooting effect is better, and the OIS is continuously centered and not enabled, so there is no need to re-center.
[0083] In one possible implementation, the ambient brightness of the dark scene is lower than the second threshold, that is, the first exposure scene and the second exposure scene are both dark scenes. In the dark scene, to ensure image quality, the shortest exposure time can be 10ms.
[0084] In a possible implementation, the correspondence between the movement mode of the OIS and the state of the electronic device and the exposure scene is shown in Table 1.
[0085] Table 1. Correspondence between OIS motion mode, electronic device status, and exposure scene
[0086] FIG11 is a hardware structure diagram of the motor control method provided in this embodiment, and FIG12 is a timing diagram of the motor control method provided in this embodiment. The following describes the implementation of the above method flow in conjunction with the hardware structure shown in FIG10 .
[0087] Step 501: The Hall sensor sends Hall data to the OIS / AF driver chip.
[0088] Step 502: The OIS / AF driver chip sends Hall data to a sensing system in a system-on-chip (SoC).
[0089] Step 503: The gyroscope sends the spatial attitude parameters to the OIS / AF driver chip and the perception system.
[0090] Step 504: The perception system sends the spatial posture parameters to the motion detection module in the system-on-chip.
[0091] Step 505: The motion detection module determines the stability of the electronic device based on the spatial posture parameters. The motion detection module includes a motion detection algorithm that can determine whether the electronic device is in a stable state or in motion based on the spatial posture parameters.
[0092] Furthermore, the motion detection algorithm in the motion detection module can classify the current stability of the electronic device, such as classifying the stability into stable, small movement, large movement, etc.
[0093] Step 506: The motion detection module sends the stability level of the electronic device to the automatic exposure module and the electronic image stabilization module.
[0094] Step 507: The automatic exposure module performs exposure control of the image sensor according to the stability of the electronic device.
[0095] Generally, the original exposure time is related to the ambient brightness. For example, in bright environments, the original exposure time is short; in normal environments, the original exposure time is medium; in dim environments, the original exposure time is long. The automatic exposure module can adaptively adjust the original exposure time based on the stability of the electronic device, such as shortening the exposure time when the device is in motion.
[0096] Step 508: The perception system sends the spatial attitude parameters and Hall data to the electronic image stabilization (EIS) module.
[0097] Step 509: The electronic image stabilization module controls the OIS / AF driver chip to perform OIS compensation according to the spatial posture parameters, the Hall data, and the stability of the electronic device.
[0098] Step 510: The image sensor sends an OIS enable signal to the OIS / AF driver chip.
[0099] The image sensor is connected to the OIS / AF driver chip and sends different signals during exposure time and non-exposure time.
[0100] For example, the image sensor sends a high-level signal to the OIS / AF driver chip during the exposure time, and sends a low-level signal to the OIS / AF driver chip during the non-exposure time.
[0101] Alternatively, the image sensor sends a low-level signal to the OIS / AF driver chip during the exposure time, and sends a high-level signal to the OIS / AF driver chip during the non-exposure time.
[0102] It should be understood that the connection between the image sensor and the OIS driver chip can be achieved by changing the current, voltage or other methods so that the OIS / AF driver chip receives different signals.
[0103] Step 511: The OIS / AF driver chip drives the motor to move according to the instruction of the electronic image stabilization module and the signal of the image sensor.
[0104] The OIS / AF driver chip controls the motor to perform normal OIS compensation during exposure time based on the different signals it receives, and controls the motor to return to the center position during non-exposure time.
[0105] It should be understood that the method provided in the embodiment of the present application can be executed only when the electronic device is in motion, that is, only when the motion control module confirms that the electronic device is in motion, the EIS system will instruct the OIS system to return the motor to center.
[0106] The above is an introduction to the method provided in the embodiment of the present application applied to an image sensor using a rolling shutter exposure mode. The following will introduce the application of the method provided in the embodiment of the present application applied to an image sensor using a global shutter exposure mode.
[0107] FIG12 is a schematic diagram of the exposure time and readout time of a camera image sensor using a global shutter exposure method. It should be understood that the main difference between the global shutter exposure method and the rolling shutter exposure method is that the image sensor using the global shutter exposure method can expose each row simultaneously, so the exposure forms a rectangular area instead of a wedge-shaped area, and it is still read out row by row. Similar to the first embodiment, the OIS system only needs to work during exposure to achieve optical stabilization. Therefore, the OIS system only needs to be enabled during the exposure time and does not need to be enabled during the readout time. Therefore, the OIS can perform OIS return during the readout time without leaving a frame gap. Longer exposure times can be supported while the frame rate remains unchanged.
[0108] The above mainly describes the solution provided by the embodiment of the present application from the perspective of method steps. It is understandable that, in order to achieve the above functions, the electronic device implementing the method includes hardware structures and / or software modules corresponding to the execution of each function. Those skilled in the art should be aware that, in combination with the units and algorithm steps of each example described in the embodiments disclosed herein, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in a hardware or computer software driven hardware manner depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of protection of this application.
[0109] The present application also provides a chip, which is coupled to a memory and is used to read and execute computer programs or instructions stored in the memory to perform the methods in the above embodiments.
[0110] The present application also provides an electronic device, which includes a chip, and the chip is used to read and execute computer programs or instructions stored in a memory, so that the methods in each embodiment are executed.
[0111] This embodiment also provides a computer-readable storage medium, which stores computer instructions. When the computer instructions are executed on an electronic device, the electronic device executes the above-mentioned related method steps to implement the motor control method in the above-mentioned embodiment.
[0112] This embodiment further provides a computer program product, which stores program code. When the computer program product runs on an electronic device, it enables the electronic device to execute the above-mentioned related steps to implement the motor control method in the above-mentioned embodiment.
[0113] In addition, an embodiment of the present application also provides a device, which can specifically be a chip, component or module, and the device may include a connected processor and memory; wherein the memory is used to store computer-executable instructions, and when the device is running, the processor can execute the computer-executable instructions stored in the memory to enable the chip to execute the image capture method in the above-mentioned method embodiments.
[0114] Among them, the electronic device, computer-readable storage medium, computer program product or chip provided in this embodiment are all used to execute the corresponding methods provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding methods provided above, and will not be repeated here.
[0115] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of modules or units is only a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0116] The above description is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this application should be included in the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection of the claims.
Claims
1. A motor control method, the method being applied to an electronic device, the electronic device comprising an optical image stabilization motor, characterized in that: The method comprises: During the exposure of the current image frame, controlling the motor to perform anti-shake movement; After the current image frame is exposed, the motor is controlled to move back to the initial position when it is powered on; During the exposure of the next image frame, the motor is controlled to start the anti-shake movement from the position after the return movement.
2. The method according to claim 1, characterized in that: The controlling the motor to move back to the initial position direction when it is powered on, comprises: In the frame gap between the current image frame and the next image frame, the motor is controlled to move back to the initial position, and the frame gap is the time interval between the end of exposure of the last row of the current frame and the start of exposure of the first row of the next frame.
3. The method according to claim 1, characterized in that: After the current image frame is exposed, controlling the motor to move back to the initial position when it is powered on, comprises: Get space attitude parameters and environment brightness parameters; Based on the spatial posture parameter and the ambient brightness parameter, the motor is controlled to move back to the initial position direction when it is powered on.
4. The method according to claim 3, characterized in that The controlling the motor to move back to the initial position direction when it is powered on based on the spatial posture parameter and the ambient brightness parameter comprises: When the electronic device is in motion and in a dark scene, the exposure time is shortened and the motor is controlled to move back and forth during frame intervals.
5. The method according to claim 4, characterized in that The shortening of the exposure time includes shortening the exposure time from the first exposure time to the second exposure time, and the second exposure time is not less than the third exposure time, and the third exposure time is the minimum time to ensure the image exposure quality in the dark light scene.
6. The method according to claim 5, characterized in that The second exposure time is equal to the third exposure time, and the method further includes: Reduce the frame rate and extend the frame duration from the first frame duration to the second frame duration; The difference between the second frame duration and the first frame duration is greater than the difference between the second exposure time and the third exposure time.
7. The method according to claim 5, characterized in that The third exposure time is 10 ms.
8. An electronic device, characterized in that: The electronic device includes one or more processors, one or more memories, and a camera module; the one or more memories store computer instructions; When the one or more processors execute the computer instructions, the electronic device is caused to perform the method as claimed in any one of claims 1 to 7.
9. The electronic device according to claim 8, characterized in that: The camera module includes an image sensor and a driving chip connected to the image sensor; The image sensor is used to send a first level signal to the driving chip during the exposure time so that the driving chip controls the motor to perform anti-shake movement during the exposure time; The image sensor is used to send a second level signal to the driving chip during the non-exposure time so that The driving chip controls the motor to move in the center during the non-exposure time.
10. A chip system, characterized in that: The chip system includes a processor and a communication interface; the processor is used to call and run a computer program stored in a storage medium from the storage medium to execute the method as described in any one of claims 1-7.
11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and when the computer instructions are executed on an electronic device, the electronic device executes the method according to any one of claims 1 to 7.
12. A computer program product, characterized in that The computer program product stores program codes, and when the computer program product is run on an electronic device, the electronic device executes the method according to any one of claims 1 to 7.