Shooting method and electronic equipment
By driving the focus motor during the non-exposure and intrusion exposure periods of the electronic device, the focus time is optimized, the image blur problem caused by automatic focus tracking is solved, and higher focus tracking speed and image clarity are achieved.
Patent Information
- Application Number
- CN202410042943.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-10
- Publication Date
- 2025-09-19
- Estimated Expiration
- 2044-01-10
AI Technical Summary
During the automatic focusing process of electronic devices, changes in motor position cause the captured image to become blurred, affecting the shooting effect.
By driving the focus motor during the non-exposure period and the intrusion exposure period during the continuous exposure of K frames of images, the electronic device optimizes the focus time and exposure period, and improves the focus tracking speed and focus effect.
Ensure that every frame of the image is in focus, improve image shooting quality and focusing effect, reduce blur and enhance image clarity.
Smart Images

Figure CN119255099B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of terminal devices, and in particular to a shooting method and electronic equipment. Background Art
[0002] When using electronic devices to shoot, users often use autofocus to capture images of dynamic objects (moving subjects). However, during the exposure of a single frame, the position of the motor changes during autofocus, resulting in blurred images and poor quality. Summary of the Invention
[0003] The embodiments of the present application provide a shooting method and an electronic device for increasing the focus tracking speed of a motor and improving the focusing effect.
[0004] In a first aspect, an embodiment of the present application provides a shooting method, the method comprising: in response to a first operation, the electronic device starts shooting, displays a first interface, and displays a preview image captured by a camera on the first interface; in the process of continuously exposing K frame images, the electronic device pushes the focus motor during the non-exposure period and the intrusion exposure period of the first image; wherein, the first image is an image in the K frame images; the first focus time of the first image is greater than the non-exposure time; the first focus time is the length of time required to push the focus motor when the first image is focused; the non-exposure period is the time period between the end time of exposure of the previous frame image and the start time of exposure of the first row of the current frame image; the exposure period is the time period between the start time of exposure of the first row of the current frame image and the end time of exposure of the current frame image; the intrusion exposure period is a section of the exposure period starting at the start time of exposure of the first row of the current frame image.
[0005] Among them, the non-exposure time is the length of the non-exposure period; the exposure time is the length of the exposure period; the intrusion exposure time is less than or equal to the exposure time; K is an integer greater than 1. The electronic device starts shooting and displays the first interface. Figure 4A The user's operation of opening the camera, and Figure 4B The shooting preview screen appears.
[0006] In an embodiment of the present application, when the electronic device is exposing K consecutive frames and the first focus time of the first image of the electronic device is longer than the non-exposure time, the electronic device chooses to push the motor from the non-exposure period and invade the exposure period to perform focus tracking. If the motor cannot be pushed during the non-exposure period, the focus is completed as much as possible to increase the speed of focus tracking, ensure that each frame of the image can be in focus, and improve the image shooting quality and focusing effect.
[0007] In one possible embodiment, the method further includes: while the electronic device continuously exposes K frames of images, the electronic device drives the focus motor to a target focus position during a non-exposure period of a second image; wherein the second image is an image within the K frames of images; and a second focus duration of the second image is less than or equal to the non-exposure period of the second image. Thus, if the second focus duration is less than or equal to the non-exposure period of the second image, the electronic device can complete focus within the non-exposure period, ensuring that the timing of focus does not affect exposure while focusing is performed on each frame, ensuring a higher speed of focus tracking and improving focusing effects and image capture quality.
[0008] In one possible implementation, the method further includes: while the electronic device is continuously exposing K frames of images, not driving the focus motor during the non-exposure period and exposure period of a third image; wherein the third image is an image within the K frames of images; and a third focus duration of the third image is 0. Thus, when the third focus duration is 0, the electronic device can complete focus without driving the motor, and can focus on each frame, ensuring a higher tracking speed and improving focusing effects and image capture quality.
[0009] In one possible embodiment, the electronic device drives the focus motor during the non-exposure period and the intrusion exposure period of the first image, specifically including: when the first focus duration is greater than the sum of the intrusion exposure duration and the non-exposure duration of the first image, the electronic device drives the focus motor during the non-exposure period and the intrusion exposure period of the first image; at the end of the intrusion exposure period, the electronic device stops driving the focus motor for the first image; when the first focus duration is less than or equal to the sum of the intrusion exposure duration and the non-exposure duration, the electronic device drives the focus motor to a target focus position during the non-exposure period and the intrusion exposure period of the first image; wherein the intrusion exposure duration is the duration of the intrusion exposure period, and the non-exposure duration is the duration of the non-exposure period. In this way, the electronic device can determine the corresponding intrusion exposure duration based on the intrusion exposure factor and the exposure frame rate, and control the intrusion exposure duration as much as possible without affecting the image result of the electronic device, thereby ensuring image clarity and improving image capture quality.
[0010] In one possible implementation, the intrusion exposure duration is the ratio of an intrusion exposure factor to a first frame rate; the first frame rate is the exposure frame rate of the image sensor. In this way, the electronic device can determine the corresponding intrusion exposure duration based on the intrusion exposure factor and the exposure frame rate, minimizing the intrusion exposure period from affecting the electronic device's image output, ensuring image clarity, and improving image capture quality.
[0011] In one possible implementation, before the electronic device drives the focus motor during the non-exposure period and the intrusion exposure period of the first image, the method further includes: the electronic device calculating the first focus duration and the non-exposure period; the non-exposure duration is the difference between the vertical effect duration and the exposure duration; the vertical effect duration is the time difference between the end of two consecutive frame exposures; and the electronic device determining whether the first focus duration is greater than the non-exposure duration. In this way, the electronic device determines the focus duration of the image, ensures the accuracy of the motor drive time, minimizes overlap between the motor drive time and the exposure time, and improves image capture quality and focus tracking speed.
[0012] In a possible implementation, the method further includes: during the process of continuously exposing K frames of images, if the current frame image has a first time period, the electronic device calculates the target focus position of the next frame image during the first time period; wherein, the first time period is a time period during which the electronic device does not push the focus motor. In this way. Within an exposure cycle, it can be divided into two time periods: pushing the motor and not pushing the motor. When the motor push of the previous frame is completed, the displacement of the motor that needs to be pushed for focusing the current frame image, as well as the first focus duration, can be determined based on the current motor position and the target focus position, to ensure the timeliness and continuity of the focus tracking, improve the focus tracking speed, and ensure the focus effect.
[0013] In a possible embodiment, after the electronic device calculates the target focus position of the next frame image in the first time period, the electronic device calculates the first focus duration, including: within the first time period, the electronic device determines the first focus duration based on the target focus position, the current focus position and a first corresponding relationship; wherein the first corresponding relationship is the correspondence between the target focus position, the current focus position and the in-focus stabilization time.
[0014] In one possible implementation, the electronic device further includes a ranging sensor. The electronic device calculates the target focus position for the next frame of image during the first time period, specifically including: obtaining distance information of a focus subject via the ranging sensor at a second frame rate; and determining the target focus position based on the distance information of the focus subject. Thus, the electronic device determines the target focus position via the ranging sensor, resulting in better focusing performance compared to other autofocus methods.
[0015] The second frame rate is a frame rate of the ranging sensor.
[0016] In one possible implementation, the electronic device determines a target focus position based on the distance information of the focus subject, specifically including: obtaining a first phase through phase focusing; obtaining a first code based on the first phase; obtaining a second code based on the distance information; and obtaining the target focus position based on the first and second codes; the target focus position being a code value between the first and second codes. In this way, the electronic device can assist phase focus with laser focusing, ensuring more accurate phase focus results.
[0017] In one possible implementation, the second frame rate is greater than or equal to the first frame rate. Thus, because the second frame rate of the ranging sensor is greater than the first exposure frame rate, during the focusing process, the electronic device can utilize the more accurate distance information measured by the ranging sensor. The high second frame rate is a prerequisite for assisting focusing during continuous frame exposure, thereby ensuring the accuracy and effectiveness of autofocus.
[0018] In a second aspect, an embodiment of the present application provides an electronic device, comprising one or more processors and one or more memories; the one or more processors are coupled to the one or more memories, the one or more memories are used to store computer program code, and the computer program code comprises computer instructions, and when the one or more processors execute the computer instructions, the electronic device executes an interface processing method described in the first aspect or any possible implementation method of the first aspect.
[0019] In a third aspect, an embodiment of the present application provides a computer program product comprising instructions, which, when run on an electronic device, enables the electronic device to execute an interface processing method as described in the first aspect or any possible implementation of the first aspect.
[0020] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium comprising instructions, which, when executed on an electronic device, enables the electronic device to execute an interface processing method as described in the first aspect or any possible implementation of the first aspect.
[0021] In the fifth aspect, an embodiment of the present application provides a chip system, which is applied to an electronic device, and the chip system includes one or more processors, which are used to call computer instructions to enable the electronic device to execute an interface processing method as described in the first aspect or any possible implementation method of the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] Figure 1This is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application;
[0023] Figure 2 This is a schematic diagram of the software structure of an electronic device proposed in an embodiment of the present application;
[0024] Figure 3 This is a schematic diagram of the time and space relationship of a line-by-line exposure process proposed in an embodiment of the present application;
[0025] Figures 4A to 4E This is a set of user interface schematic diagrams proposed in the embodiments of the present application;
[0026] Figures 5A to 5F 1 is a schematic diagram of a user interface for filtering a group of continuous-shot photos proposed in an embodiment of the present application;
[0027] Figures 6A to 6D This is another set of user interface schematic diagrams proposed in the embodiment of the present application;
[0028] Figure 7 This is a flowchart of a shooting method provided by an embodiment of the present application;
[0029] Figures 8A to 8C 1 is a set of exposure and focus timing diagrams proposed in an embodiment of the present application;
[0030] Figure 9 This is a schematic diagram of an exposure scanning interface proposed in an embodiment of the present application;
[0031] Figure 10 This is a flowchart of another shooting method proposed in an embodiment of the present application;
[0032] Figure 11 This is a flowchart of another shooting method proposed in an embodiment of the present application. DETAILED DESCRIPTION
[0033] The terms used in the following examples of the present application are for the purpose of describing specific embodiments only and are not intended to limit the present application. As used in the specification and appended claims of the present application, the singular expressions "a," "an," "said," "above," "the," and "this" are intended to include plural expressions as well, unless the context clearly indicates otherwise. It should also be understood that the term "and / or" used in the present application refers to and encompasses any or all possible combinations of one or more of the listed items.
[0034] The embodiments of the present application disclose an application jump method and an electronic device for accelerating the response speed of interface display and improving the user interaction experience.
[0035] In response to a user operation, the user interface of an electronic device may jump from one application's user interface to another application's user interface. For example, a user may be viewing a shared video link in a communication app. The user may click on the video link to view the video. In response to the user clicking on the video link, the electronic device may display the user interface for the video, which may include a jump request window. The user may click on a control for jumping to the video application. In response to the jump operation, the electronic device may launch the video application, thereby jumping the display screen from one application's user interface to another application's user interface.
[0036] The electronic device in the embodiments of the present application can be a mobile phone, a tablet computer, a desktop computer, a laptop computer, a handheld computer, a smart bracelet, a super mobile personal computer, a netbook, a personal phone, a personal data assistant, an augmented reality (AR) / virtual reality (VR) and other touch screen devices. The present application does not limit the specific form of the electronic device.
[0037] The following describes the device involved in the embodiments of the present application.
[0038] Figure 1 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application.
[0039] The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.
[0040] It is understood that the structures illustrated in the embodiments of the present application do not constitute specific limitations on the electronic device. In other embodiments of the present application, the electronic device 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.
[0041] The processor 110 may include one or more processing units. For example, the processor 110 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a memory, 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 devices or integrated into one or more processors.
[0042] Processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in processor 110 is a cache memory. This memory can store instructions or data that have just been used or are being recycled by processor 110. If processor 110 needs to use the same instruction or data again, it can directly access the memory. This avoids duplicate accesses, reduces processor 110 latency, and thus improves system efficiency.
[0043] It is understood that the interface connection relationship between the modules illustrated in the embodiments of the present application is only for illustrative purposes and does not constitute a structural limitation on the electronic device. In other embodiments of the present application, the electronic device may also adopt different interface connection methods from the above embodiments, or a combination of multiple interface connection methods.
[0044] The charging management module 140 is configured to receive charging input from a charger. The charger can be either a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 can receive charging input from the wired charger via the USB interface 130. In some wireless charging embodiments, the charging management module 140 can receive wireless charging input via the wireless charging coil of the electronic device 100. While charging the battery 142, the charging management module 140 can also provide power to the electronic device via the power management module 141.
[0045] The power management module 141 is used to connect the battery 142, the charging management module 140, and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140 and provides power to the processor 110, the internal memory 121, the external memory, the display 194, and the wireless communication module 160. The power management module 141 can also be used to monitor parameters such as battery capacity, battery cycle count, and battery health status (leakage, impedance). In some other embodiments, the power management module 141 can also be set in the processor 110. In other embodiments, the power management module 141 and the charging management module 140 can also be set in the same device.
[0046] The wireless communication function of the electronic device can be implemented through antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, modem processor and baseband processor.
[0047] The electronic device implements display functionality through a GPU, display screen 194, and an application processor. A GPU is a microprocessor for image processing that connects display screen 194 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.
[0048] Display screen 194 is used to display images, videos, and the like. Display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a MiniLED, a MicroLED, a Micro-oLed, or a quantum dot light-emitting diode (QLED). In some embodiments, electronic device 100 may include one or N display screens 194, where N is a positive integer greater than one.
[0049] The electronic device 100 can implement a shooting function through an ISP, a camera 193, a video codec, a GPU, a display screen 194, and an application processor.
[0050] The camera 193 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 RGB, YUV or other format. In some embodiments, the electronic device 100 may include 1 or N cameras 193, where N is a positive integer greater than 1.
[0051] The ISP is used to process data fed back by the camera 193. For example, when taking a picture, the shutter is opened, and light is transmitted to the camera's photosensitive element through the lens. The light signal is converted into an electrical signal, and the camera's photosensitive element transmits the electrical signal to the ISP for processing and converts it into an image visible to the naked eye. The ISP can also perform algorithm optimization on the noise, brightness, etc. of the image. The ISP can also optimize parameters such as exposure and color temperature of the shooting scene. In some embodiments, the ISP can be set in the camera 193. The digital signal processor is used to process digital signals. In addition to processing digital image signals, it can also process other digital signals. For example, when the electronic device 100 is selecting a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy, etc. The ISP can also be used to automatically focus on the focus information determined by the focus subject.
[0052] The touch sensor 180K, also known as a "touch panel," can be mounted on the display screen 194. The touch sensor 180K and the display screen 194 form a touch screen, also known as a "touch screen." The touch sensor 180K is used to detect touch operations applied to or near the touch sensor.
[0053] In the embodiment of the present application, the electronic device 100 can detect user operations through the touch sensor 180K. The user operation may include a touch event from the user touching the display 194, for example, the user long presses the shooting control of the camera to take continuous shots.
[0054] Optionally, the user operation may be an air operation, a voice operation command, etc. For example, a gesture sensing sensor is installed in the electronic device, and the gesture sensing sensor can detect the user's air operation. The electronic device can determine the air operation through the gesture sensing sensor.
[0055] Figure 2 A schematic diagram of the software structure of an electronic device provided in an embodiment of the present application.
[0056] like Figure 2 As shown, the software framework of the electronic device involved in this application may include an application layer, an application framework layer (framework, FWK), a hardware abstraction layer (hardware abstract layer, HAL) hardware layer and a kernel layer (kernel).
[0057] The application layer may include a series of application packages, such as gallery, email, text messages, camera, call and other applications (also referred to as applications, some of which are not shown). In the embodiment of the present application, the application may be any application in the application layer, and the user may open or close the application, or perform operations in the application.
[0058] The application framework layer provides an application programming interface (API) and programming framework for the applications in the application layer. The application framework layer includes some predefined functions.
[0059] The application framework layer includes some predefined functions. In an embodiment of the present application, the application framework layer may include a camera access interface, wherein the camera access interface may include camera management and camera devices. The camera access interface is used to provide an application programming interface and programming framework for camera applications.
[0060] The hardware abstraction layer is an interface layer located between the application framework layer and the driver layer, providing a virtual hardware platform for the operating system. In an embodiment of the present application, the hardware abstraction layer may include a camera hardware abstraction layer (camera HAL) and a camera algorithm library. The camera algorithm library may include algorithms such as automatic focus (AF) and automatic exposure (AE). The camera algorithm library may also include algorithms such as noise reduction, color correction, contrast adjustment, etc., which are not limited in this application.
[0061] The kernel layer is the foundation of the Android operating system, and all of the Android operating system's ultimate functionality is implemented through the kernel layer. The kernel layer includes at least the display driver. The display driver retrieves rendered and synthesized image frames from the buffer and controls the display to display them sequentially.
[0062] The hardware layer may include a display, graphics processing unit (GPU), touch sensor, image sensor, and focus motor. The touch sensor can detect jump events caused by user touch operations. The display can display the image frame of the startup window. The graphics processor can perform image rendering and compositing. The central processing unit (CPU) can draw the image.
[0063] It should be noted that the application provides Figure 2 The software structure diagram of the electronic device shown is only an example and does not limit the specific module divisions within the different layers of the Android operating system. For details, please refer to the introduction of the Android operating system software structure in conventional technology. In addition, the shooting method provided in this application can also be implemented based on other operating systems, and this application will not cite them one by one.
[0064] In combination with the above software structure, the following exemplarily illustrates the software and hardware workflow of an embodiment of the present application when taking photos by using an electronic device.
[0065] In response to the user's operation of opening the camera application, for example, clicking the camera application icon (combined with Figure 4A (user operation), the camera application calls the camera access interface of the application framework layer, starts the camera application, and then sends an instruction to start the camera by calling the camera device in the camera HAL. The camera HAL sends the instruction to the camera device driver of the kernel layer. The camera device driver can start the image sensor of the corresponding camera and collect image light signals through the image sensor. A camera device in the camera hardware abstraction layer corresponds to an image sensor in the hardware layer. The image sensor can transmit the collected image light signal to the image signal processor for preprocessing, obtain an image electrical signal, and transmit the above-mentioned original image to the camera HAL through the camera device driver. The camera HAL can send the original image to the camera algorithm library. The camera algorithm library stores the program code for implementing the method for focusing based on exposure timing provided in the embodiment of the present application. The camera algorithm library can send the processed image to the camera HAL, and the camera HAL can display the processed image.
[0066] During the shooting process, the electronic device can calculate the focus position of the focus motor through the AF algorithm, and then the camera driver can control the focus motor to adjust the position to complete the focus. When the size and / or position of the focus frame needs to be adjusted, the camera driver can drive the focus motor, and the focus motor can push the lens to the corresponding position.
[0067] The following introduces the terms involved in the embodiments of this application during the photo-taking process.
[0068] 1. Focus:
[0069] Focusing is the process of changing the distance between the lens and the imaging surface (image sensor) through the camera's focus mechanism to achieve a clear image of the subject. Common focus types can be divided into three types: phase detection autofocus (PDAF), contrast detection autofocus (CDAF), and laser detection autofocus (LDAF).
[0070] Phase detection autofocus is a focusing method that detects the amount of light entering the scene from paired left and right pixels in the image sensor, compares the phase values (PD) on the left and right sides, finds the focus point, and then moves the lens motor to the corresponding position.
[0071] Laser focus uses a rangefinder sensor (such as a matrix laser sensor) next to the camera to emit a low-power laser toward the object being photographed. After reflection, the laser is received by the sensor and the distance to the object is calculated. The lens motor then directly moves the lens to the corresponding position to achieve focus. For example, the rangefinder can measure the object distance at a certain frame rate and, based on the correspondence between the object distance and the motor position, determine the motor's target position (code value) and move the focus motor to the target position.
[0072] Mobile phone autofocus utilizes the principle of light reflection from an object. The reflected light is received by the image sensor (CCD or CMOS) on the phone's camera, generating a raw image. This raw image is then processed to drive the electric focus mechanism for focus. This is essentially a data calculation method integrated into the phone's image signal processor (ISP). After the viewfinder captures the original image, the image data is transmitted to the ISP as raw data. The ISP then analyzes the image data, determines the distance at which the lens needs to be adjusted, and then drives the focus motor to adjust the distance for a clear image. This process, as seen by the phone user, is known as autofocus. In a mobile phone's autofocus system, the lens is locked in the focus motor, and driving the focus motor changes the lens' position.
[0073] During the focusing process, images are continuously generated. The frame of image when the lens is in a certain position is sent to the image processor (ISP) for processing, which obtains statistical information about the image. This information is then sent to the focusing algorithm library (which can be executed on the ISP hardware or in the driver software). The focusing algorithm library calculates the direction and distance for the next lens movement based on the hardware specifications and the above statistical information, and drives the lens to that position. A new image is obtained at this position, and the statistical information is calculated again to calculate the next lens position. The image clarity gradually changes. After several cycles of convergence, focusing is successful.
[0074] The mobile phone can determine the target focus distance by using the focus parameter (code) of the motor in the target camera as the focus distance movement adjustment accuracy. The motor code value represents a quantized current magnitude, which can be converted into a corresponding motor thrust, thereby driving the camera motor to move. Generally, the camera motor is fixed to the lens assembly, so it can drive the lens to move, thereby changing the image distance. The code value of the camera motor corresponds to the image distance. The electronic device stores multiple sets of relationships between focus parameters (codes) and focus distances; the electronic device can use the motor to push the lens to the position indicated by the focus parameter (code). There are many types of camera motors, and there are also many principles and mechanisms for converting them into motor position changes, which are not limited here.
[0075] 2. Exposure:
[0076] Sensor exposure is divided into line-by-line exposure and global exposure. This application uses the line-by-line exposure method during the shooting process of the electronic device. The following is a detailed introduction to "line-by-line exposure":
[0077] During the scanning process, when the sensor converts optical signals into electrical signals, the scan always starts from the upper left corner of the image and moves forward horizontally, while the scanning point also moves downward at a slower rate. When the scanning point reaches the right edge of the image, it quickly returns to the left and restarts scanning the second line below the starting point of the first line. The return process between lines is called horizontal blanking. It is also called line blanking (HBlank). A complete image scan signal is composed of a sequence of line signals separated by horizontal blanking intervals, which is called a frame. After the scanning point scans a frame, it returns from the lower right corner of the image to the upper left corner of the image to start scanning a new frame. There will be an interval of time. This time interval is called the vertical blanking interval (VBlank). The function of VBlank is usually used to adjust the frame rate.
[0078] Because the exposure method is row-by-row, the exposure time of different rows of pixels is different. Each row of pixels can be associated with exposure time information, which can include the exposure start time and exposure end time. The exposure time information corresponding to each row of pixels can be carried in the image or stored corresponding to the image.
[0079] Figure 3 This is a schematic diagram of the time and space relationship of a line-by-line exposure process exemplarily disclosed in an embodiment of the present application.
[0080] like Figure 3 As shown, the electronic device performs exposure from left to right, the row direction is the horizontal direction, the coordinate axis along the row direction is the time axis, and the coordinate axis along the column direction is the sensor height, which is the maximum height of the original image that can be generated (N rows).
[0081] like Figure 3 As shown in the figure, assuming that a frame of image consists of N rows and M columns of pixels (both N and M are integers greater than 1), the sensor starts exposing the first row of pixels in the first frame. After one row period, the first row of pixels is exposed before the second row begins to be exposed. Similarly, after N-1 rows, the Nth row begins to be exposed. The time corresponding to the left of each row of pixels can represent the exposure start time of the row of pixels, and the time corresponding to the right can represent the exposure end time of the row of pixels. For example, in the first frame, the exposure start time of the first row of pixels is t1 and the exposure end time is t3. Similarly, the exposure start time of the Nth row of pixels is t2 and the exposure end time is t4. The exposure time of the first frame is T1 = t4 - t1. In the second frame, the exposure start time of the first row of pixels is t7 and the exposure end time is t9. Similarly, the exposure start time of the Nth row of pixels is t8 and the exposure end time is t10. The exposure time of the second frame is T2 = t10 - t7.
[0082] like Figure 3 As shown, after each row of the image is exposed, it can be read out row by row. Data readout begins after the first row is exposed, and reading out a row requires a row cycle (including the row blanking time, H_Blank). Once the first row is completely read out, the second row begins to be read out. Similarly, after the N-1th row is read out, the Nth row begins to be read out, until the entire image is completely read out. For example, the first row of pixels in the first frame starts reading at time t3 (which can be roughly considered the end of exposure; there is actually a very small difference between the two, which can be ignored here), and ends reading at time t5. Similarly, the Nth row of pixels starts reading at time t4 and ends reading at time t6.
[0083] like Figure 3 As shown, VBlank duration (TVBlank ) can be understood as the time period from the end of reading the last line of the first frame to the end of reading the first line of the second frame, T VBlank =t11-t6. Camera module manufacturers usually provide the corresponding T VBlank Time, the Vblank time corresponding to different models of camera modules may be different, and this application does not limit this.
[0084] 3. TOF Technology
[0085] TOF technology is the abbreviation of Time of Flight technology. That is, the sensor emits modulated near-infrared light, which is reflected after encountering an object. The sensor calculates the time difference or phase difference between the emission and reflection of the light to convert the distance of the photographed scene to generate depth information. In addition, combined with traditional camera shooting, the three-dimensional outline of the object can be presented in the form of a topographic map with different colors representing different distances.
[0086] Assuming the current ranging method is Direct Time of Flight (DTOF), a type of matrix laser TOF ranging, the ranging sensor emits a brief laser pulse. When the laser pulse hits an object, it is reflected back. The sensor receives the returned laser signal and calculates the time difference between the laser pulse and the reflected laser signal. This determines the distance of the measured object from the sensor, that is, the object distance.
[0087] It should be noted that the ranging sensor can also be a ranging sensor implemented by various ranging methods such as structured light ranging, binocular ranging, laser ranging, etc., and this application is not limited to this.
[0088] The ranging frame rate of the matrix laser TOF sensor (for example, the frame rate is set to 60 FPS synchronization). This frame rate can be the maximum frame rate of any ranging mode.
[0089] The frame rate (FPS) is measured in frames and represents the frequency of images exposed and output by the sensor per unit time.
[0090] 4. HDR mode
[0091] Dynamic range (DR): This refers to the range of brightness that a camera can capture, or its ability to simultaneously record both brighter and darker areas. A camera's dynamic range measures the image sensor's ability to capture exposure details under varying lighting conditions.
[0092] High dynamic range (HDR) mode is also called dual-frame HDR mode. HDR modes include dual conversion gain (DCG) mode, dual analog gain (DAG) mode, DXG mode, and staggered HDR mode.
[0093] DCG mode can also be called pixel-level dual-gain mode. This dual-gain mode includes high conversion gain (HCG) and low conversion gain (LCG). It can be understood that HCG has a higher conversion gain, which can achieve a better signal-to-noise ratio in dark areas. LCG has a lower conversion gain, which can ensure better highlight details. DCG mode can automatically switch between HCG and LCG according to changes in light, thereby optimizing dynamic range and noise performance.
[0094] DAG mode also allows for simultaneous exposure of two frames captured within a single frame. DAG mode uses a single conversion gain output, meaning both frames use HCG output or LCG output. In a possible implementation, DAG mode can output two frames with different exposures by configuring the two amplifier circuits with different gain settings, thereby achieving the effect of long and short frames. In DAG mode, both frames have the same exposure time and both use HCG or LCG output, so the exposure ratio is determined by the gain ratio.
[0095] DXG mode can be understood as a combination of DCG and DAG modes. DXG mode can achieve dual conversion gain or configure different gain settings. DXG mode can also capture two frames of image data in one frame for simultaneous exposure.
[0096] Stagger HDR mode is also known as SHDR mode. In SHDR mode, you can configure the long frame exposure time, short frame exposure time, and gain independently. In SHDR mode, the exposure ratio between the two frames is positively correlated with the conversion gain ratio of the two frames, the exposure time, and the configured gain.
[0097] Binning mode, also known as pixel binning or merging mode, is a single-frame output mode, where the image sensor captures a single frame at a time. It's understandable that binning mode is suitable for scenes with a relatively low dynamic range.
[0098] Figures 4A to 4E This is a set of user interface schematic diagrams exemplarily disclosed in the embodiments of this application.
[0099] Figures 4A to 4E The following is an example of a user interface diagram of a continuous shooting process of an electronic device. The user turns on his or her electronic device so that the display screen of the electronic device displays the desktop of the electronic device, i.e., the user interface 410. Figure 4A As shown, the user can click on the camera control 4101 in the user interface 410, and after the electronic device receives the operation acting on the camera control 4101, it can display Figure 4B The user interface shown. Figure 4B FIG. 1 is an exemplary user interface for shooting.
[0100] like Figure 4B As shown, the electronic device captures a scene of a person playing football. The user interface 420 includes a preview image 11, a shooting mode menu 12, an album 10A, a shooting control 10B, a camera switch control 10C, and a settings menu 13 (including a flash switch, a filter switch, and settings controls, etc.).
[0101] The preview image 11 is an image of the shooting scene captured by the electronic device 1 through the camera in real time. The preview image shows the image of the person and the ball captured by the electronic device through the camera. The shooting mode menu 12 may include options for various camera modes such as aperture, night scene, photo, portrait, video, professional, and more. Different camera modes can achieve different shooting functions. The camera mode pointed to by the "triangle" in the shooting mode menu 12 is used to indicate the initial or user-selected camera mode, such as Figure 4B As shown, the "triangle" points to "Photo," indicating that the camera is currently in photo shooting mode. Album 10A allows users to view captured images and videos. Shooting control 10B, in response to user operation, causes the electronic device to capture images or videos. Switch camera control 10C is used to switch the camera used to capture images between the front and rear cameras.
[0102] like Figure 4C As shown, a user uses the continuous shooting function, for example, by long-pressing the shooting control and lifting their finger to stop the continuous shooting. (Continuous shooting can also be performed using the volume button) to continuously capture the process of a person kicking a ball. As the number of photos in the continuous shooting changes, the number of photos taken will be displayed in the preview screen. The preview screen displays a count indicator 14. The count indicator 14 in the user interface 430 is 1, indicating that one image has been captured in this continuous shooting. The count indicator in the user interface 440 is 8, indicating that eight images have been captured in the continuous shooting. The count indicator in the user interface 450 is 15, indicating that one image has been captured in the continuous shooting. Figure 4B The player kicks the ball, and then the electronic device can capture the movement of the ball. Figure 4C 、 Figure 4D and Figure 4EThe ball changes from far to near. In the above process, the user operation method of continuous shooting is only an exemplary description, and this application does not limit it.
[0103] Optionally, the above Figure 4C to Figure 4E The preview image in the shooting process may not be the exposure of the continuous shooting process, but Figure 4B Direct exposure in the interface is not restricted in this application.
[0104] Figures 5A to 5F This is a schematic diagram of a user interface for filtering a group of continuous photos disclosed in an embodiment of the present application.
[0105] like Figure 5A As shown, in the user interface 510 , the user can click on the control of the album 10A to display the continuous shooting images displayed in the user interfaces 430 to 450 .
[0106] like Figure 5B As shown, user interface 520 includes continuously shot photos 17, a continuous shooting indicator 15, and an album indicator 16. The continuous shooting indicator 15 can indicate that the current image is a plurality of photos obtained by continuous shooting. The user can click on the continuous shooting indicator 15, and in response to the above operation, the electronic device can display user interface 530.
[0107] like Figure 5C As shown, in user interface 530, the user can select the photos to be saved from the continuous photos (multiple images). The user clicks to select one of the images, and in response to the above operation, the electronic device can display user interface 540.
[0108] like Figure 5D As shown, user interface 540 shows that one continuous-shot image has been selected and marked as selected. The selected image in the thumbnail is marked with a shadow. After the user confirms the selected image, they can click the check mark control. In response to the above user operation, the electronic device can display user interface 550.
[0109] like Figure 5E As shown, the user interface 550 includes a confirmation pop-up window: "Only keep the selected 1 photo" and "Cancel" two options. The user can click the "Only keep the selected 1 photo" option, and in response to the above operation, the electronic device displays a user interface 560.
[0110] like Figure 5F As shown, the user interface 560 displays a photo retained in the continuous shooting.
[0111] Of course, users can also click to enter the gallery, click on the marked continuous photos, then click l2 to slide the photo list, check the photos to keep, and then click Save.
[0112] It should be noted that the above is only a description of the scene of automatic focus tracking during continuous shooting. It can also be automatic focus tracking in video shooting scenes. In this application, the exposure of the image during automatic focus tracking is continuous and is not limited to the specific shooting scene.
[0113] The specific contents of the operations and displays in the above process are merely exemplary descriptions and are not limited in this application. In addition, the user's operation type may be a click touch operation or other methods, such as user gestures, voice, etc., which are not limited in this application.
[0114] like Figures 4A to 5F As shown, when the electronic device is in the process of autofocusing, the exposure during the process of pushing the motor to zoom will cause the focus area to become blurred, resulting in a decrease in the confidence of the phase value PD.
[0115] In order to solve the above problem, focusing can be performed intermittently during the image exposure process.
[0116] Table 1 is an exemplary focusing method during continuous shooting proposed in an embodiment of the present application.
[0117] Table 1
[0118] Frame 1 Frame 2 Frame 3 Frame 4 …… Frame 29 Frame 30 Push motor Push motor …… Calculate PD Calculate PD …… Calculate PD
[0119] As shown in Table 1, if the exposure frame rate is 30fps, the electronic device generally focuses on a maximum of 15 frames, that is, during the exposure of 30 consecutive frames, from the 1st frame to the 30th frame, the zoom is performed (the focus motor is pushed) during the exposure time of the 1st, 3rd, 5th, 7th, 9th, ..., 27th and 29th frames; the zoom is not performed (the focus motor is not pushed) during the exposure time of the 2nd, 4th, 6th, 8th, ..., 28th and 30th frames, and the PD value of the frame image is calculated to determine the moving position of the motor for the next focus. At this point, it can be guaranteed that for at least 50% of the images, the confidence of the PD is calculated as accurately as possible. For the 1st, 3rd, 5th, 7th, 9th, ..., 27th and 29th frames, the confidence of the PD is poor. Combined with Figure 4C 、 Figure 4D and Figure 4E As shown, during the process of the electronic device tracking the ball, the ball in the 1st frame and the 15th frame (odd-numbered frames) is blurry, and the ball in the 8th frame (even-numbered frame) is clear.
[0120] In the above-described embodiment, because the electronic device performs focus intermittently during the exposure cycle, the tracking speed is too slow for tracking moving targets, and the tracking effect is poor for objects moving along the longitudinal exposure scan direction. Furthermore, during the exposure process, only half of the frames have a good PD confidence level, while the remaining half have a poor PD confidence level, resulting in even worse image focus.
[0121] To solve the above technical problems, an embodiment of the present application proposes a shooting method, which is applied to an electronic device. During the process of automatic tracking focus of the electronic device, the electronic device can determine the time period of tracking focus based on the timing of continuous exposure. When the electronic device determines that the required focus time is less than or equal to the non-exposure time, the electronic device can push the motor to focus within the non-exposure time. When the focus time is greater than the non-exposure time, the electronic device can push the motor to focus within the non-exposure time and the intrusion exposure time. The focusing process within the non-exposure time and the intrusion exposure time can be based on laser focus assisted tracking, which ensures higher focus accuracy and follow-up speed, and improves the image effect of continuous exposure.
[0122] Figures 6A to 6D This is another set of user interface schematic diagrams disclosed exemplarily in the embodiments of the present application.
[0123] like Figure 6A As shown, the electronic device can display the user interface 610 of the camera shooting, and the user long presses the shooting control to shoot continuously. At this time, the counting mark 14 shows that 1 image has been shot in the continuous shooting. The specific description of the continuous shooting operation can be referred to Figures 4A to 4E The relevant description is omitted here.
[0124] like Figures 6B to 6D As shown, as the continuous shooting long press time increases, the count marks in user interface 620, user interface 630, and user interface 640 are 05, 10, and 15, respectively. From the four frames 01 to 15, the focus is tracked on the shooting subject "ball", and it can be seen that the ball is clear in all images.
[0125] Figure 4C to Figure 4E In the images captured, the subject "ball" is intermittently clear, that is, half of the balls in the continuous shooting images are blurred, and the other half are clear. In the embodiment of the present application, Figures 6A to 6D The subject "ball" is clear in all the images taken. That is, the subject in focus is clearly visible in every frame of the image. Figures 6A to 6D In the implementation manner, the electronic device has a faster focus speed, a better image shooting effect, and a better image focus effect and quality.
[0126] It should be noted that the above Figures 6A to 6D The image can also be in Figure 4B During the shooting process in the shooting preview screen (the user does not need to click on the continuous shooting) (at this time, the counting mark is not displayed), this application does not limit the shooting scene.
[0127] Of course, the embodiments of the present application can also filter and delete the images continuously shot during the automatic focus tracking process. For detailed description, please refer to Figures 5A to 5F The relevant description is omitted here.
[0128] Figure 7 This is a flow chart of a shooting method disclosed in an embodiment of the present application. Figure 7 As shown, the shooting method may include but is not limited to the following steps:
[0129] The strategy in phase detection (PD) can be a follow autofocus strategy (Follow AF) strategy, and matrix laser TOF is used as a ranging method.
[0130] During a shooting scene, the camera can track the subject, meaning the focus moves with the subject during the shooting process. The electronic device can support automatic tracking of K frames. For example, K is 30 frames. K is an integer greater than 1. In the embodiment of the present application, the electronic device can drive the motor for each frame to perform frame-by-frame focusing.
[0131] S701: The electronic device calculates the non-exposure time T non-exposure .
[0132] In this embodiment of the present application, the duration corresponding to the exposure period is the exposure duration, and the duration corresponding to the non-exposure period is the non-exposure duration. The non-exposure period is the time period between the end of exposure of the previous frame and the start of exposure of the first row of the current frame; the exposure period is the time period between the start of exposure of the first row of the current frame and the end of exposure of the current frame.
[0133] Figures 8A to 8C This is a set of exposure and focus timing diagrams exemplarily disclosed in an embodiment of the present application.
[0134] like Figure 8A As shown, T in electronic equipment VBlank Yes / No exposure time T non-exposure With exposure time T exposure The vertical blanking interval is T VBlank The duration from the end of reading the last line of the previous frame to the end of reading the first line of the current frame. The electronic device can calculate the non-exposure time T non-exposure =T VBlank -T exposure .
[0135] Among them, T VBlank Related to HDR mode, the current working mode of the electronic device can be determined as T VBlank .
[0136] For example, when the sensor works in binning, T VBlank When the sensor is working in S HDR mode, it can be determined that T VBlankWhen the sensor is working in DXG mode, it can be determined that T VBlank It is 18.8ms.
[0137] S702: The electronic device obtains a first focusing time T of the image 1 focus .
[0138] During the autofocus process, the electronic device can determine the motor push duration based on the number of codes pushed based on the subject of Image 1, and calculate the focus duration of Image 1 based on the motor push duration and the stabilization time. The electronic device can store a mapping relationship between the number of codes and the motor push duration. When a target code is determined during the focusing process, the corresponding motor push duration is determined as the focus duration based on this mapping relationship. The number of codes pushed and the motor focus duration are positively correlated; the greater the number of codes pushed, the longer the motor focus duration.
[0139] Exemplarily, the electronic device may store the corresponding relationship between the current focus position, the target focus position (and the focus push displacement), and the quasi-focus stable time. The electronic device knows the current focus position, obtains the target focus position of the current frame through the autofocus algorithm, and determines the motor push position (i.e., the code push amount) based on the current motor position and the target motor position. After that, the electronic device can determine the corresponding quasi-focus stable time as the first focus time based on the above corresponding relationship. It should be noted that, in combination with Figures 8A to 8C The electronic device should calculate the first focus duration within the period of calculating PD, that is, calculate the first focus duration within the period of not driving the motor.
[0140] Based on the above correspondence, the corresponding stable time is determined as the first focus time T focus .
[0141] S703: The electronic device determines whether the first focus time is greater than the non-exposure time. If the focus time is greater than the non-exposure time, the electronic device performs intrusion exposure, i.e., executes S705; if the focus time is less than or equal to the non-exposure time, the electronic device executes S704.
[0142] Electronic devices can compare T focus With T non-exposure The size relationship of T focus >T non-exposure In the case of T, the electronic device may determine to continue focusing during the intrusion exposure period, that is, execute S705. focus ≤T non-exposureIn this case, the electronic device can determine that the focus can be completed within the non-exposure period and execute S704. The intrusion exposure period is an exposure period starting from the exposure start time of the first row of the current frame image.
[0143] During the above determination process, the electronic device prioritizes driving the motor for focus during non-exposure periods, and tries not to focus during exposure periods. By separating the exposure and motor-driven focus times, the focus motor is kept stationary during exposure, ensuring better image focus and avoiding image blur caused by motor movement. This ensures the best possible image quality for each frame, while also ensuring the confidence level of the exposure PD value for each frame during phase-difference focusing.
[0144] S704: The electronic device drives the motor to the target focus position during the non-exposure period.
[0145] The target focus position is a target code calculated by the electronic device during the exposure period, for example, a code value calculated by the most recent phase focus or laser focus.
[0146] Figures 8A to 8C This is a set of timing diagrams for focusing based on exposure conditions proposed in an exemplary embodiment of the present application. Figure 8A As shown, during the shooting process, the focus frame of the focused subject is displayed as a black parallelogram, and the position of the focused subject may change in the image.
[0147] In the frame preceding Image 1, exposure begins at time e1, ends at time e2, and reading ends at time e3. The electronic device calculates PD1 during the exposure period e1-e2 of the frame preceding Image 1. The non-exposure period from e3 to the start of exposure e4 of Image 1 is a non-exposure period. Because the focus duration determined based on PD1 is shorter than this non-exposure period, the electronic device can drive the motor during the non-exposure period from e3 to e4 to complete focusing.
[0148] Alternatively, as Figure 8C As shown, the non-exposure period can also be determined as the period from the end of exposure time e2 of the previous frame of image 1 to the start of exposure time e4 of image 1. Thus, the period from e1 to e2 can be determined as the exposure period of the previous frame, during which the PD1 of image 1 in focus can be calculated. The period from e2 to e4 can be determined as the non-exposure period of image 1, during which the motor can be driven for exposure.
[0149] Optionally, the focus duration calculated by the electronic device may be 0, that is, the target code is the same as the current focus code, and the electronic device may complete the focus without executing the motor push process during the non-exposure period.
[0150] In the above two embodiments, the definitions of the non-exposure period and the exposure period are different. In one case, the non-exposure period is from the end of the exposure of the previous frame to the start of the exposure of this frame; the exposure period is from the start of the exposure of this frame to the end of the exposure of this frame. In another case, the non-exposure period is from the end of the reading of the previous frame to the start of the exposure of this frame; the exposure period is from the start of the exposure of this frame to the end of the exposure of this frame (or the end of the reading). Since the exposure time that can be obtained by the hardware is different, different hardware and situations may have different meanings, and the embodiments of the present application are not limited to this.
[0151] In the process of S705 to S708, the intrusion method is exposed:
[0152] S705: The electronic device calculates the intrusion exposure time T based on the intrusion exposure factor a invade .
[0153] Among them, the intrusion exposure time T invade is the ratio of the intrusion exposure factor a to the sensor frame rate, that is, T invade =a / sensor frame rate, where a ranges from 0 to 1 and is an intrinsic parameter of the electronic device camera. invade The unit is ms.
[0154] Among them, the electronic device sets a maximum code that the motor can push (the upper limit of the motor's push) for one autofocus, ensuring that pushing the motor during the exposure time and non-exposure time does not affect the focus of the next frame, ensuring the stability of each focus.
[0155] For example, when the sensor frame rate (camera exposure frame rate) is 30fps and a is 0.3, T can be calculated as invade =0.3*1000 / 30=10ms. The above description is merely an example and not limiting.
[0156] Among them, the intrusion exposure time T invade It is part or all of the exposure time of the first frame image. During the exposure time corresponding to the intrusion exposure time, the electronic device allows the motor to be driven to focus.
[0157] The intrusion exposure factor a may be a fixed value (preset value) set in advance, or may be a result determined through calculation.
[0158] Optionally, when the intrusive exposure factor a is determined by calculation, the electronic device may determine the intrusive exposure factor a based on the position of the focused subject in the image (the position of the focus frame). During the electronic device's shooting process, the position of the focus frame can be obtained, and the ratio of the number of pixel rows in the upper border of the focus frame to the total number of pixel rows in the image can be determined as the intrusive exposure factor a.
[0159] For example, Figure 9 This is a schematic diagram of an exposure scanning interface shown in an embodiment of the present application. Figure 9 As shown, during the exposure process, an image frame can be scanned row by row from top to bottom. Along the row-by-row scanning direction, the row first scanned by the focus frame in the image frame is determined to be row X. A frame has a total of N rows, and the intrusion exposure factor a = X / N can be determined. Here, X is an integer between 1 and N.
[0160] S706: The electronic device determines whether the sum of the intrusion exposure time and the non-exposure time is greater than the first focus time. If the sum of the intrusion exposure time and the non-exposure time is greater than the focus time, S707 is executed; if the sum of the intrusion exposure time and the non-exposure time is less than or equal to the focus time, S706 is executed.
[0161] In T non-exposure +T invade >T focus In the case of T non-exposure +T invade ≤T focus In this case, execute S706.
[0162] In the above process, T non-exposure +T invade The threshold value can relax the focus time limit and increase T invade The focus duration during this period is designed to ensure that the focus process is completed as much as possible, ensuring better image exposure results while maintaining the confidence level of the PD value for each frame. During the focus process within the intrusion exposure period, laser information is used to assist focus, ensuring faster image focus and better results.
[0163] S707: The electronic device drives the motor to the target focus position during the non-exposure period and the intrusion exposure period.
[0164] The electronic device drives the motor to the target focus position during the non-exposure period and the intrusion exposure period.
[0165] When the exposure of the previous frame of image 1 ends, the motor can be pushed to the target focus position during the non-exposure period and the intrusion exposure period to complete the focus.
[0166] like Figure 8A As shown, the electronic device can calculate PD2 from time e4 to e6. Calculating PD2 can determine the target code to focus on and the focus duration. In this case, it is necessary to focus on Image 2 during the non-exposure period and the intrusion exposure period. Therefore, during time e6 to e8, the electronic device can drive the motor to complete the focus.
[0167] It should be noted that, since the exposure frame rate in the embodiment of the present application is lower than the acquisition frame rate of the laser information, during the intrusion exposure period, due to the decrease in the reliability of the PD, the distance information of the laser device (measured object distance) can be used to assist AF focusing.
[0168] In a possible implementation, when the electronic device uses phase focusing, such as Figures 8A to 8C As shown, during the period when the motor is not driven, the electronic device can calculate the PD value and determine the focus code value (the target focus position of the next frame) based on the PD value, thereby determining the focus duration.
[0169] In another possible implementation, when the electronic device uses laser focusing, the object distance (distance information) is obtained at a fixed frame rate. The electronic device stores a mapping relationship between the distance and the code, so that the corresponding focus code can be determined based on the measured distance information.
[0170] In another possible implementation, when an electronic device combines phase focus and laser focus, the electronic device can obtain two code values based on PD focus and laser focus, that is, a first code is obtained in PD focus and a second code is obtained in laser focus. The method of obtaining the first code and the second code can refer to the relevant descriptions of the above two implementations based on phase focus and laser focus, which are not repeated here. The electronic device can determine the target code based on the first code and the second code, and the target code is used for subsequent focusing. Among them, the target code should be a code value between the first code and the second code.
[0171] Exemplarily, when the confidence of the PD is low, the confidence of the PD is less than or equal to (less than) the first confidence, the electronic device can select the second code as the target code; when the confidence of the PD is high, the confidence of the PD is greater than or equal to (greater than) the second confidence, (the first confidence is less than the second confidence), the electronic device can select the first code as the target code; when the confidence of the PD is greater than (greater than or equal to) and the first confidence is less than (less than or equal to) the second confidence, the target code can be the average of the first code and the second code.
[0172] Of the two methods mentioned above for determining the target code, the target code can be determined based on the confidence level of PD. Since PD is not accurate, it is more preferable to use laser focusing to ensure the reliability of the focusing result.
[0173] It should be noted that in the above-described embodiment, the exposure frame rate of the electronic device is a first frame rate, and the frame rate of the distance measurement information of the laser device (ranging sensor) is a second frame rate, where the first frame rate is less than or equal to the second frame rate. For example, the first frame rate is 30 fps and the second frame rate is 60 fps. This ensures that the laser device can meet the focus tracking requirements during continuous exposure, thus ensuring the implementation conditions of the solution.
[0174] like Figure 8A As shown, the time period during which the ranging sensor acquires distance information corresponds to the rectangular grid. The first frame rate of the ranging sensor is twice the second frame rate of exposure. The electronic device uses the motor code value corresponding to the most recent object distance acquired by the ranging sensor to assist autofocus. The code value acquired during the e4-e5 period is used for radiation focus, and the motor continues to focus during the e6-e8 period.
[0175] In the above process, the ability of the ranging sensor to obtain code values at a higher frame rate can ensure that AF focusing is assisted during the intrusion exposure period and ensure the reliability of the focusing result.
[0176] S708: The electronic device drives the motor during the non-exposure period and the intrusion exposure period of image 1, and continues to drive the motor during the non-exposure period of image 2 until the motor reaches the target focus position.
[0177] like Figure 8B As shown, in the process of the electronic device focusing on image 3, it is not enough to focus during the non-exposure period (e9~e10) and the intrusion exposure period (e10~e11). The electronic device can continue to push the motor for exposure during the non-exposure period (e12~e13) of the next frame (the fourth image), and stop pushing the focus motor for image 3 at the end of the intrusion exposure period (e11).
[0178] In the above-described embodiment, the electronic device prioritizes focusing by driving the motor during the non-exposure period. If the non-exposure period is insufficient for focusing, the electronic device can incorporate focusing time into a portion of the exposure period to achieve focusing. This allows the electronic device to complete motor driving during the non-exposure period in most cases, avoiding overlap between exposure and motor driving, ensuring better image exposure. Furthermore, each frame can be focused by driving the motor during the non-exposure period, ensuring consistent focus for each frame, ensuring timely and accurate focusing and improving focusing effectiveness.
[0179] Figure 10 This is a flow chart of another shooting method proposed in the embodiment of the present application. Figure 7 Example of the method, such as Figure 10 As shown, the shooting method may include but is not limited to the following steps:
[0180] S1001: The electronic device calculates the non-exposure time T non-exposure .
[0181] S1002: The electronic device obtains a first focusing time T of the image 1 focus .
[0182] S1003: The electronic device determines whether the first focus time is greater than the non-exposure time. If the focus time is greater than the non-exposure time, the electronic device performs intrusion exposure and executes S1005; if the focus time is less than or equal to the non-exposure time, the electronic device executes S1004.
[0183] S1004: The electronic device drives the motor to the target focus position within the non-exposure time.
[0184] Among them, the relevant descriptions of S1001 to S1004 can refer to the relevant contents of S701 to S704, which are not repeated here.
[0185] S1005: The electronic device drives the motor to the target focus position during the non-exposure period and the intrusion exposure period.
[0186] like Figure 10 As shown, if the first focus duration is greater than the non-exposure duration, the electronic device directly drives the motor to the target focus position (target code position) during the non-exposure period and the intrusion exposure period. In this way, during the intrusion exposure period, there is no need to consider the intrusion duration and focusing continues until focusing is completed.
[0187] In the above-described embodiment, the electronic device can start focusing during the non-exposure period, regardless of how long it intrudes into the exposure period, until the current focus (motor push) is completed, thus completing the current focus. Generally speaking, within an exposure time cycle, focusing, which takes the longest time, can be completed. Most motor pushes can be completed during the non-exposure period, ensuring that in most cases, the timing of motor push does not affect exposure, maintaining image quality and focus tracking speed.
[0188] Figure 11 This is another flow chart of a shooting method proposed in the embodiment of the present application. Figure 11 As shown, the shooting method may include but is not limited to the following steps:
[0189] S1101: The electronic device calculates the non-exposure time Tnon-exposure .
[0190] S1102: The electronic device obtains a first focusing time T of the image 1 focus .
[0191] S1103: The electronic device starts driving the motor from the non-exposure period of image 1 to perform focusing.
[0192] In one possible implementation, the electronic device does not perform the judgment process in S703. Instead, it immediately executes the motor push process from the beginning of the non-exposure period. After the motor push process ends, it calculates the PD and the target code for the next focus, and then continues the motor push process at the beginning of the next non-exposure period. In the above implementation, the electronic device can perform the motor push process from the non-exposure period and calculate the target code during the exposure period. The timing of the specific focus execution action can be specifically standardized to ensure the focus effect and speed. In S1103, the electronic device can skip the processing process in S703 and directly perform the focus.
[0193] In another possible implementation, the motor is driven starting from the non-exposure period of image 1, and the target focus position is calculated during the exposure period. The electronic device may specifically perform the processing steps S703 to S708.
[0194] In another possible implementation, the motor is driven starting from the non-exposure period of image 1 , and the target focus position is calculated during the exposure period. The electronic device may specifically perform the processing steps S1003 to S1005 .
[0195] As used in the above embodiments, the term “when…” may be interpreted to mean “if…” or “after…” or “in response to determining…” or “in response to detecting…”, depending on the context. Similarly, the phrases “upon determining…” or “if (stated condition or event) is detected” may be interpreted to mean “if determining…” or “in response to determining…” or “upon detecting (stated condition or event)” or “in response to detecting (stated condition or event)”, depending on the context.
[0196] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from one website, computer, server or data center to another website, computer, server or data center via a wired (e.g., coaxial cable, optical fiber, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) method. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrations. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk).
[0197] Those skilled in the art will appreciate that all or part of the process steps in the above-described method embodiments can be implemented by a computer program instructing the relevant hardware. The program can be stored in a computer-readable storage medium, and when executed, the program can include the process steps in the above-described method embodiments. The aforementioned storage medium includes various media capable of storing program code, such as ROM or random access memory (RAM), magnetic disks, or optical disks.
Claims
1. A shooting method, characterized in that: The method is applied to an electronic device, and includes: In response to the first operation, the electronic device starts shooting and displays a first interface, wherein a preview image captured by the camera is displayed on the first interface; During the process of continuously exposing K frames of images, the electronic device drives the focus motor during the non-exposure period and the intrusion exposure period of the first image; Among them, the first image is the image in the K frame image; the first focus time of the first image is greater than the non-exposure time; the first focus time is the length of time required to push the focus motor when the first image is focused; the non-exposure period is the time period between the end of exposure of the previous frame image and the start of exposure of the first row of the current frame image; the exposure period is the time period between the start of exposure of the first row of the current frame image and the end of exposure of the current frame image; the intrusion exposure period is the exposure period that starts at the start of exposure of the first row of the current frame image and ends at the start of exposure of the first row of the focused subject in the current image frame.
2. The method according to claim 1, characterized in that The method further comprises: During the process of continuously exposing K frames of images, the electronic device drives the focus motor to reach a target focus position during a non-exposure period of the second image; The second image is an image in the K-frame image; and the second focus time of the second image is less than or equal to the non-exposure time of the second image.
3. The method according to claim 1, characterized in that The electronic device drives the focus motor during the non-exposure period and the intrusion exposure period of the first image, specifically including: When the first focus duration is greater than the sum of the intrusive exposure duration and the non-exposure duration of the first image, the electronic device drives the focus motor during the non-exposure period and the intrusive exposure period of the first image; and stops driving the focus motor for the first image at the end of the intrusive exposure period. When the first focus duration is less than or equal to the sum of the intrusion exposure duration and the non-exposure duration, the electronic device drives the focus motor to a target focus position during the non-exposure period and the intrusion exposure period of the first image; The intrusion exposure duration is the duration of the intrusion exposure period; and the non-exposure duration is the duration of the non-exposure period.
4. The method according to claim 3, characterized in that The intrusion exposure duration is a ratio of the intrusion exposure factor to a first frame rate; the first frame rate is an exposure frame rate of the image sensor.
5. The method according to any one of claims 1 to 4, characterized in that Before the electronic device drives the focus motor during the non-exposure period and the intrusion exposure period of the first image, the method further includes: The electronic device calculates the first focus time and the non-exposure period; the non-exposure time is the difference between the vertical effect time and the exposure time; the vertical effect time is the time difference between the end moments of exposure of two consecutive frames; The electronic device determines whether the first focus time is greater than the non-exposure time.
6. The method according to any one of claims 1 to 4, characterized in that The method further comprises: During the process of continuously exposing K frames of images, if the current frame image has a first time period, the electronic device calculates the target focus position of the next frame image during the first time period; The first time period is a time period during which the electronic device does not drive the focus motor.
7. The method according to claim 6, characterized in that The electronic device further includes a distance measuring sensor, and the electronic device calculates a target focus position of a next frame image during the first time period, specifically including: The electronic device acquires distance information of a focused subject through the ranging sensor at a second frame rate; The electronic device determines a target focus position based on distance information of the focus subject.
8. The method according to claim 7, characterized in that The electronic device determines a target focus position based on the distance information of the focus subject, specifically including: The electronic device acquires a first phase through phase focusing; and acquires a first code based on the first phase; The electronic device acquires a second code based on the distance information; The electronic device obtains the target focus position based on the first code and the second code; the target focus position is a code value between the first code and the second code.
9. The method according to claim 7 or 8, characterized in that The second frame rate is greater than or equal to the first frame rate.
10. An electronic device, characterized in that: include: One or more processors and one or more memories; the one or more processors are coupled to the one or more memories, the one or more memories are used to store computer program code, the computer program code includes computer instructions, and when the one or more processors execute the computer instructions, the electronic device executes the method according to any one of claims 1 to 9.
11. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 9 is implemented.
Citation Information
Patent Citations
Electronic equipment, information synchronization method and computer readable storage medium
CN113489878A
Image processing method and electronic equipment
CN115967846A