Shooting method and electronic equipment
The shooting method addresses motor position changes during focus tracking by pushing the focus motor during non-exposure periods, improving focusing speed and image clarity for dynamic objects.
Patent Information
- Application Number
- CN202410042943.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-10
- Publication Date
- 2025-01-03
- Estimated Expiration
- 2044-01-10
AI Technical Summary
When capturing images of dynamic objects, the position of the motor changes during automatic focus tracking, leading to blurred images and poor shooting effects.
A shooting method that involves pushing the focus motor during non-exposure periods and intrusion exposure periods to improve focusing speed and ensure each frame is in focus, utilizing techniques such as phase focusing and distance measuring sensors to determine the target focus position accurately.
Enhances focusing speed and improves image capture quality by ensuring each frame is in focus, thereby enhancing the overall shooting effect.
Smart Images

Figure CN119255099A_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 a user uses an electronic device to shoot, in order to capture images of dynamic objects (moving objects), the electronic device can use automatic focus tracking to take pictures. However, during the exposure of a frame of image, the position of the motor will change during the automatic focus tracking process, which will cause the captured image to be blurred and the shooting effect is poor. Summary of the invention
[0003] The embodiments of the present application provide a shooting method and an electronic device for increasing the focusing 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; during the process of continuously exposing K frame images, the electronic device pushes a focus motor during a non-exposure period and an 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 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 a section of the exposure period starting at the start 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 opens 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 greater than the non-exposure time, the electronic device chooses to push the motor from the non-exposure period and invades 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, the speed of focus tracking is increased, and each frame of the image is ensured to be in focus, thereby improving the image shooting quality and focusing effect.
[0007] In a possible implementation, the method further includes: during the process of continuously exposing K frames of images, the electronic device pushes the focus motor to reach the target focus position during the non-exposure period of the second image; wherein the second image is an image in the K frames of images; and the second focus duration of the second image is less than or equal to the non-exposure duration of the second image. In this way, when the second focus duration is less than or equal to the non-exposure duration of the second image, the electronic device can complete the focus during the non-exposure period, and can ensure that the focus timing does not affect the exposure while focusing on each frame, ensuring a higher speed of tracking focus, and improving the focus effect and image capture quality.
[0008] In a possible implementation, the method further includes: when the electronic device continuously exposes K frames of images, the electronic device does not push the focus motor during the non-exposure period and the exposure period of the third image; wherein the third image is an image in the K frames of images; and the third focus duration of the third image is 0. In this way, when the third focus duration is 0, the electronic device can complete the focus without pushing the motor, and can focus on each frame, thereby ensuring a higher speed of tracking focus, and improving the focus effect and image capture quality.
[0009] In a possible implementation, 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 time is greater than the sum of the intrusion exposure time and the non-exposure time 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; stops driving the focus motor for the first image at the end of the intrusion exposure period; when the first focus time is less than or equal to the sum of the intrusion exposure time and the non-exposure time, the electronic device drives the focus motor to the target focus position during the non-exposure period and the intrusion exposure period of the first image; wherein the intrusion exposure time is the time length of the intrusion exposure period; and the non-exposure time is the time length of the non-exposure period. In this way, the electronic device can determine the corresponding intrusion exposure time based on the intrusion exposure factor and the exposure frame rate, and control the image result of the electronic device as much as possible within the intrusion exposure period without affecting the image, thereby ensuring the clarity of the image and improving the image shooting quality.
[0010] In a possible implementation, the intrusion exposure duration is the ratio of the intrusion exposure factor to the 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, and control the intrusion exposure period as much as possible without affecting the image result of the electronic device, thereby ensuring the clarity of the image and improving the image shooting quality.
[0011] In a possible implementation, before the electronic device pushes the focus motor in the non-exposure period and the intrusion exposure period of the first image, the method further includes: the electronic device calculates 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 moments of two consecutive frames of exposure; the electronic device determines 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 push time, avoids the overlap of the motor push time and the exposure time as much as possible, and improves the image shooting effect and the focus tracking speed.
[0012] In a possible implementation, the method further includes: during the process of the electronic device continuously exposing K frames of images, if there is a first time period in the current frame image, the electronic device calculates the target focus position of the next frame image in the first time period; wherein the first time period is a time period in 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 ends, the displacement of the motor required to be pushed for the focus of the current frame image and the first focus duration can be determined based on the current motor position and the target focus position, so as to ensure the timeliness and continuity of the focus tracking, improve the focus tracking speed, and ensure the focusing effect.
[0013] In a possible implementation, 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 corresponding relationship between the target focus position, the current focus position and the quasi-focus stable time.
[0014] In a possible implementation, the electronic device further includes a distance measuring sensor, and the electronic device calculates the target focus position of the next frame image in the first time period, specifically including: the electronic device obtains the distance information of the focus subject through the distance measuring sensor at the second frame rate; the electronic device determines the target focus position based on the distance information of the focus subject. In this way, the electronic device determines the target focus position through the distance measuring sensor, and the focusing effect is better than other automatic focusing methods.
[0015] The second frame rate is a frame rate of the ranging sensor.
[0016] In a possible implementation, the electronic device determines the target focus position based on the distance information of the focus subject, specifically including: the electronic device obtains a first phase through phase focusing; and obtains a first code based on the first phase; the electronic device obtains 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. In this way, the electronic device can assist phase focusing by laser focusing to ensure that the phase focusing result is more accurate.
[0017] In a possible implementation, the second frame rate is greater than or equal to the first frame rate. In this way, since the second frame rate of the ranging sensor is greater than the first exposure frame rate, during the focusing process, the electronic device can ensure the accuracy and focusing effect of the autofocus based on the fact that the distance information measured by the ranging sensor is relatively accurate and the high second frame rate is a prerequisite for assisting the focusing during continuous frame exposure.
[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, 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 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.
[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, enable 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 1It is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application;
[0023] Figure 2 It is a schematic diagram of the software structure of an electronic device proposed in an embodiment of the present application;
[0024] Figure 3 It 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] Figure 4A to Figure 4E is a set of user interface schematic diagrams proposed in the embodiments of the present application;
[0026] Figure 5A to Figure 5F 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] Figure 6A to Figure 6D is another set of user interface schematic diagrams proposed in the embodiments of the present application;
[0028] Figure 7 This is a schematic diagram of a shooting method provided by an embodiment of the present application;
[0029] Figure 8A to Figure 8C is a set of exposure and focus timing diagrams proposed in an embodiment of the present application;
[0030] Fig. 9 is a schematic diagram of an exposure scanning interface proposed in an embodiment of the present application;
[0031] Fig.10 It is a schematic diagram of another shooting method flow proposed in an embodiment of the present application;
[0032] Fig.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 embodiments of the present application are only for the purpose of describing specific embodiments, and are not intended to be used as limitations to the present application. As used in the specification and appended claims of the present application, the singular expressions "one", "a kind of", "said", "above", "the" and "this" are intended to also include plural expressions, unless there is a clear indication to the contrary in the context. It should also be understood that the term "and / or" used in the present application refers to and includes any or all possible combinations of one or more listed items.
[0034] The embodiments of the present application disclose an application jump method and an electronic device, which are used to accelerate the response speed of interface display and improve the user interaction experience.
[0035] In response to the user's operation, the user interface of the electronic device can jump from the user interface of one application to the user interface of another application. For example, the user is currently in the communication software interface, and a shared video link is displayed. The user can click on this video link to watch the video. In response to the user operation of clicking on this video link, the electronic device can display the user interface of this video, and the user interface can include a jump request window. The user can click on the control for jumping to the video application, and in response to the above jump operation, the electronic device can start the video application, so that the screen image jumps from the user interface of one application to the user interface of another application.
[0036] The electronic device in the embodiments of the present application can be a mobile phone, a tablet computer, a desktop, 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 is an introduction to 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 to be understood that the structure illustrated in the embodiments of the present application does not constitute a specific limitation on the electronic device. In other embodiments of the present application, the electronic device may include more or fewer components than shown in the figure, or combine certain components, or split certain components, or arrange the components differently. The components shown in the figure 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 processor (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), etc. Different processing units may be independent devices or integrated into one or more processors.
[0042] The processor 110 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or cyclically used. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.
[0043] It is understandable that the interface connection relationship between the modules illustrated in the embodiments of the present application is only a schematic illustration 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 in the above embodiments, or a combination of multiple interface connection methods.
[0044] The charging management module 140 is used to receive charging input from a charger. The charger may be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 may receive charging input from a wired charger through the USB interface 130. In some wireless charging embodiments, the charging management module 140 may receive wireless charging input through a wireless charging coil of the electronic device 100. While the charging management module 140 is charging the battery 142, it may also power the electronic device through 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 screen 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 number, battery health status (leakage, impedance), etc. 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 the display function through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs that execute program instructions to generate or change display information.
[0048] The display screen 194 is used to display images, videos, etc. The 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 or an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-oLed, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the electronic device 100 may include 1 or N display screens 194, where N is a positive integer greater than 1.
[0049] The electronic device 100 can realize the shooting function through ISP, camera 193, video codec, GPU, display screen 194 and 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 optical signal into an electrical signal, and then passes the electrical signal to the ISP to be converted 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] ISP is used to process data fed back by camera 193. For example, when taking a photo, the shutter is opened, and light is transmitted to the camera photosensitive element through the lens. The light signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to the ISP for processing and converts it into an image visible to the naked eye. ISP can also perform algorithm optimization on image noise, brightness, etc. ISP can also optimize parameters such as exposure and color temperature of the shooting scene. In some embodiments, ISP can be set in camera 193. 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. ISP can also be used to automatically focus on the focus information determined by the focus subject.
[0052] The touch sensor 180K is also called a "touch panel". The touch sensor 180K can be set on the display screen 194. The touch sensor 180K and the display screen 194 form a touch screen, also called a "touch screen". The touch sensor 180K is used to detect touch operations acting on or near it.
[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 also be an air operation, a voice operation instruction, 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 the present application may include an application layer, an application framework layer (framework, FWK), a hardware abstract 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 message, 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 a 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 a programming framework for camera applications.
[0060] The hardware abstraction layer is an interface layer located between the application framework layer and the driver layer, which provides 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. The final functions of the Android operating system are completed through the kernel layer. The kernel layer at least includes display drivers, etc. The display driver can obtain the rendered and synthesized image frames from the buffer cache and control the display to display them in sequence.
[0062] The hardware layer may include a display, a graphics processing unit (GPU), a touch sensor, an image sensor, a focus motor, and the like. The touch sensor can detect the jump event of the user's touch operation. The display can display the image frame of the startup window. The graphics processor can perform the rendering and synthesis process of the image. 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 division in 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 by this application can also be implemented based on other operating systems, and this application will not give examples one by one.
[0064] In combination with the above software structure, the following exemplarily illustrates the software and hardware workflow of the embodiment of the present application when taking photos by using an electronic device.
[0065] In response to a user opening a camera application, for example, clicking a camera application icon (in combination 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 the 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 the present 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 focusing mechanism to make the image of the object clear. Common focus types can be divided into three types: phase focus (phase detection autofocus, PDAF), contrast focus (contrast detection auto focus, CDAF) and laser focus (laser detection auto focus, LDAF).
[0070] Phase focusing is a focusing method that detects the amount of light entering the object in the scene with the left and right paired pixels in the image sensor, compares the phase values (PD) on the left and right sides, finds the focus point, and pushes the lens motor to the corresponding position.
[0071] Laser focus is achieved by using a distance sensor (such as a matrix laser sensor) next to the camera to emit a low-power laser to the object being photographed. After reflection, the sensor receives the laser and calculates the distance to the object. The inter-lens motor then directly pushes the lens to the corresponding position to complete the focus. For example, the distance sensor can measure the object distance at a certain frame rate, and based on the corresponding relationship between the object distance and the motor position, determine the motor target position (code value), and push the focus motor to the target position.
[0072] The auto focus of the mobile phone is based on the principle of light reflection from an object. The reflected light is received by the image sensor (CCD or CMOS) on the camera in the mobile phone to obtain the original image. The original image is processed and the electric focus device is driven to focus. This is called auto focus. It is essentially a set of data calculation methods integrated in the mobile phone ISP (image signal processor). When the viewfinder captures the most original image, the image data will be sent to the ISP as raw data. At this time, the ISP will analyze the image data and obtain the distance at which the lens needs to be adjusted, and then drive the focus motor to adjust it to make the image clear. This process is reflected in the eyes of the mobile phone user, which is the auto focus process. Among them, in the auto focus of the mobile phone, the lens is locked in the focus motor, and driving the focus motor can change the position of the lens.
[0073] During the focusing process, images are still being generated continuously. The frame of image when the lens is at a certain position is sent to the image processor (ISP) for processing, and the statistical information of the image is obtained. This information is then sent to the focus algorithm library (which can be executed on the ISP hardware or in the driver software). The focus algorithm library calculates the direction and distance the lens should move in the next step 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, and the lens position for the next step is calculated... The image clarity gradually changes, and after several cycles of convergence, the focus 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 movement adjustment accuracy of the focus distance. Among them, the code value of the motor represents a quantified current size, which can be converted into a corresponding motor thrust, thereby driving the camera motor to move. Generally, the camera motor is fixed on the lens assembly, so it can push 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 (code) and focus distances; the electronic device can use the motor to push the lens to the position indicated by the focus parameter (code). Among them, 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 electronic device uses line-by-line exposure during shooting. The following is a detailed introduction to "line-by-line exposure":
[0077] In the scanning process where 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 scan point also moves downward at a slower rate. When the scan point reaches the right edge of the image, the scan point 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 scan point scans a frame, it returns from the lower right corner of the image to the upper left corner of the image and starts 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] Since the exposure method is row-by-row exposure, the exposure time of different rows of pixels is different, and each row of pixels may correspond to an exposure time information, and the exposure time information may include the exposure start time and the exposure end time. Among them, the exposure time information corresponding to each row of pixels may be carried in the image, or may be stored corresponding to the image.
[0079] Figure 3 It 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, that is, the maximum height of the original image that can be generated (N rows).
[0081] like Figure 3 As shown, assuming that a frame of image has a total of N rows and M columns of pixels (N and M are both integers greater than 1), the sensor starts to expose the first frame of image from the first row, and after a row cycle, the second row starts to be exposed after the first row of pixels is exposed. By analogy, after N-1 rows, the Nth row starts to be exposed. The time corresponding to the left side of each row of pixels can represent the exposure start time when the row of pixels starts to be exposed, and the time corresponding to the right side can represent the exposure end time of the row of pixels. For example, in the first frame of image, the exposure start time corresponding to the first row of pixels is t1, and the exposure end time is t3; by analogy, the exposure start time corresponding to 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 of image, the exposure start time corresponding to the first row of pixels is t7, and the exposure end time is t9; by analogy, the exposure start time corresponding to 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. After the first row is exposed, data is read out. It takes a row cycle time (including row blanking time, i.e. H_Blank) to read out a row. After the first row is completely read out, the second row just starts to be read out. By analogy, when the N-1th row is read out, the Nth row starts to be read out until the entire image is completely read out. For example, the reading start time corresponding to the first row of pixels in the first frame of the image is t3 (which can be roughly considered as the moment when the exposure ends. In fact, there is a very small difference between the two, which can be ignored here), and the reading end time is t5; by analogy, the reading start time corresponding to the Nth row of pixels is t4, and the reading end time is 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 that the current distance measurement method is direct time of flight (DTOF) in matrix laser TOF distance measurement, the distance measurement sensor will emit a short laser pulse, and when the laser pulse encounters an object, it will be reflected back. The sensor receives the returned laser signal and then calculates the time difference between the laser pulse and the reflected laser signal, so as to obtain 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 60FPS synchronization). The frame rate can be the maximum frame rate of any ranging mode.
[0089] Among them, the frame rate (frame per second, FPS) is measured in frames and can represent the frequency of images exposed and output by the sensor per unit time.
[0090] 4. HDR mode
[0091] Dynamic range (DR): It is used to indicate the range of brightness that a camera can capture, that is, the camera's ability to record both brighter and darker areas at the same time. The dynamic range of a camera measures the image sensor's ability to capture exposure details under different lighting conditions.
[0092] The high dynamic range (HDR) mode may also be referred to as a dual-frame HDR mode. The HDR mode may include a dual conversion gain (DCG) mode, a dual analog gain (DAG) mode, a DXG mode, a staggered HDR mode, and the like.
[0093] The DCG mode can also be called the pixel-level dual gain mode, which includes high conversion gain (HCG) and low conversion gain (LCG). It can be understood that the conversion gain of HCG is higher, and a better signal-to-noise ratio can be achieved in dark areas. The conversion gain of LCG is lower, which can ensure better highlight details. The DCG mode can automatically switch between HCG and LCG according to light changes, thereby optimizing dynamic range and noise performance.
[0094] The DAG mode can also use one frame to capture two frames of images for simultaneous exposure. The DAG mode outputs images with a single conversion gain, that is, both frames of images are output using HCG, or both frames of images are output using LCG. In a possible implementation, the DAG mode can output two frames of images with different exposure amounts by configuring two amplifier circuits with different configuration gains, thereby achieving the shooting effect of long and short frames. In the DAG mode, the exposure time of the two frames of images is the same and both are output using HCG or LCG, so the exposure ratio is determined by the configuration gain ratio.
[0095] DXG mode can be understood as a combination of DCG mode and DAG mode. DXG mode can achieve dual conversion gain and configure different configuration gains. DXG mode can also use one frame to capture two frames of images for simultaneous exposure.
[0096] Stagger HDR mode can also be called SHDR mode. In SHDR mode, you can configure the exposure time of the long frame, the exposure time of the short frame, and the gain separately. In SHDR mode, the exposure ratio of 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 can also be called pixel merging mode or merging mode. Binning mode is a single-frame output mode, and the image sensor can capture one frame of image at a time. It can be understood that Binning mode is suitable for scenes with a relatively low dynamic range.
[0098] Figure 4A to Figure 4E It is a set of user interface schematic diagrams exemplarily disclosed in the embodiments of the present application.
[0099] Figure 4A to Figure 4E The schematic diagram of the user interface of the continuous shooting process of the electronic device is shown as an example. The user turns on his electronic device so that the display screen of the electronic device displays the desktop of the electronic device, that is, 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 shoots 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 conversion control 10C, and a setting menu 13 (including a flash switch, a filter switch, and a setting control, etc.). Among them:
[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 "photograph", indicating that the current camera is in the photo shooting mode. The album 10A is used for users to view the pictures and videos they have taken. The shooting control 10B responds to the user's operation to enable the electronic device to take pictures or videos. The switch camera control 10C is used to switch the camera for collecting images between the front camera and the rear camera.
[0102] like Figure 4C As shown, the user uses the continuous shooting function, for example, long presses the shooting control, lifts the finger, and stops the continuous shooting. (Continuous shooting can also be performed using the volume button) Continuously shoot the process of a person kicking a ball. As the number of continuous shooting photos changes, the number of photos taken will be displayed in the preview screen. The preview screen displays a count mark 14, and the count mark 14 in the user interface 430 is 1, indicating that 1 image has been taken in this continuous shooting. The count mark in the user interface 440 is 8, and 8 images have been taken in the continuous shooting. The count mark in the user interface 450 is 15, and 1 image has been taken in the continuous shooting. Figure 4B A person kicks a 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 this.
[0103] Optionally, the above Figure 4C to Figure 4E The preview image in the shooting process can also be not the exposure of the continuous shooting process, but Figure 4B Direct exposure in the interface is not restricted in this application.
[0104] Figure 5A to Figure 5F It is a schematic diagram of a user interface for screening a group of continuous-shot photos disclosed in an embodiment of the present application.
[0105] like Figure 5A As shown, in user interface 510 , the user can click on the control of album 10A to display the continuous-shot images displayed in user interfaces 430 to 450 .
[0106] like Figure 5B As shown, the user interface 520 includes the continuous shooting photos 17, the continuous shooting mark 15 and the album mark 16. The continuous shooting mark 15 can indicate that the current image is a plurality of photos obtained by continuous shooting. The user can click the continuous shooting mark 15, and in response to the above operation, the electronic device can display the user interface 530.
[0107] like Figure 5C As shown, in the 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 the user interface 540.
[0108] like Figure 5D As shown, the user interface 540 shows that one continuous shooting image has been selected, and the image is marked as selected, and the selected image in the thumbnail is marked by a shadow. After the user confirms the selected image, he can click the check mark control. In response to the above user operation, the electronic device can display the user interface 550.
[0109] like Figure 5E As shown, the user interface 550 includes a confirmation pop-up window: two options: "Keep only the selected 1 photo" and "Cancel". The user can click the "Keep only the selected 1 photo" option, and in response to the above operation, the electronic device displays a user interface 560.
[0110] like Fig. 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 photo, then click l2 to slide the photo list, check the photos to keep, and then click Save As.
[0112] It should be noted that the above is only a scene description 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 specific shooting scenes.
[0113] The specific contents of the operation and display in the above process are merely exemplary descriptions, and the present application does not limit this. In addition, the user's operation type is a click touch operation, and it can also be other methods, for example, the operation method can also be a user gesture, voice, etc., and the present application does not limit this.
[0114] like Figure 4A to Figure 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 a focusing method in a continuous shooting process exemplarily 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 …… Calculation of PD Calculation of PD …… Calculation of 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. Figure 4C , Figure 4D and Figure 4E As shown, during the process in which the electronic device can focus on the ball, the ball in the 1st frame and the 15th frame (odd-numbered frames) is blurry, while the ball in the 8th frame (even-numbered frame) is clear.
[0120] In the above implementation, since the electronic device focuses intermittently according to the exposure period, the focusing speed is too slow for tracking moving targets, and the focusing effect is poor for objects moving along the longitudinal exposure scanning direction. Furthermore, during the exposure process, only half of the frames have good image focus PD confidence, while the remaining half of the frames have poor image PD confidence, and the image focus effect is even worse.
[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 that the focus accuracy and tracking speed are higher, and improves the image effect of continuous exposure.
[0122] Figure 6A to Figure 6D This is another set of user interface schematic diagrams disclosed exemplarily in the embodiments of the present application.
[0123] like Fig. 6A As shown, the electronic device can display the user interface 610 of the camera shooting, and the user presses and holds the shooting control to perform continuous shooting. At this time, the counting mark 14 shows that the continuous shooting has taken 1 image. The specific description of the continuous shooting operation can be referred to Figure 4A to Figure 4E The relevant description is not repeated here.
[0124] like Figure 6B to Figure 6D As shown, as the continuous shooting long press time increases, the counting marks in the user interface 620, the user interface 630 and the user interface 640 are 05, 10 and 15 respectively. From the 4 frames of images from 01 to 15, the shooting subject "ball" is tracked, and it can be seen that the ball in all images is clear.
[0125] Figure 4C to Figure 4E In the images captured, the subject "ball" is intermittently clear, that is, half of the continuous images have blurred balls, and the other half are clear. In the embodiment of the present application, Figure 6A to Figure 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. Therefore, Figure 6A to Figure 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 Figure 6A to Figure 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 icon 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 a specific description, please refer to Figure 5A to Figure 5F The relevant description is not repeated here.
[0128] Figure 7 1 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 distance measurement method.
[0130] In the shooting scene, the camera can focus on the subject, that is, the focus will move with the subject during the shooting process. The electronic device can support automatic focus 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 focus frame by frame.
[0131] S701: The electronic device calculates the non-exposure time T non-exposure .
[0132] In the 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 the exposure of the previous frame image and the start of the exposure of the first row of the current frame image; the exposure period is the time period between the start of the exposure of the first row of the current frame image and the end of the exposure of the current frame image.
[0133] Figure 8A to Figure 8C It is a set of exposure and focus timing diagrams exemplarily disclosed in the embodiments of the present application.
[0134] like Fig. 8A As shown, T VBlank Non-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 number of codes pushed based on the subject of the image 1 to determine the motor push time, and calculate the focus time of the image 1 based on the motor push time and the stable time. The electronic device can store a mapping relationship between the number of codes and the motor push time, and when the target code is determined during the focusing process, the corresponding motor push time is determined as the focus time based on the above mapping relationship. The number of code pushes is positively correlated with the motor focus time. The more the number of code pushes, the longer the motor focus time.
[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 may 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 Figure 8A to Figure 8C According to the user's focus and exposure timing, 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 without driving the motor.
[0140] Based on the above correspondence, the corresponding stable time length is determined as the first focus time length 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, perform intrusion exposure, that is, perform S705; if the focus time is less than or equal to the non-exposure time, perform 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 can determine to continue focusing during the intrusion exposure period, that is, execute S705. focus ≤T non-exposureIn the case of, 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] In the above judgment process, the electronic device preferentially chooses to push the motor to focus during the non-exposure period, and tries not to focus during the exposure period. Ensuring that the exposure and the time of pushing the motor to focus are separate can ensure that the focus motor is stationary during the exposure process as much as possible, ensure better image focus effect, avoid image blur caused by motor movement during the exposure process, and ensure the image effect of each frame of image exposure as much as possible, and also ensure the confidence of each frame exposure PD value during the phase difference focusing process.
[0144] S704: The electronic device pushes 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] Figure 8A to Figure 8C 1 is a schematic diagram of a timing sequence for focusing based on exposure conditions proposed in an exemplary embodiment of the present application. Fig. 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 previous frame of image 1, exposure starts at time e1, ends at time e2, and reading ends at time e3. The electronic device calculates PD1 in the exposure period e1-e2 of the previous frame of image 1. The exposure start time e4 from e3 to the image 1 frame is a non-exposure period. Since the focus duration determined based on the calculation of PD1 is less than the non-exposure period, the electronic device can drive the motor in the non-exposure period from e3 to e4 to complete the focus.
[0148] Alternatively, if Figure 8C As shown, the non-exposure period can also be determined as from the end time e2 of the exposure of the previous frame of image 1 to the start time e4 of the exposure of image 1. So far, the period from e1 to e2 can be determined as the exposure period of the previous frame, and the PD1 of the focus of image 1 can be calculated during the exposure period. The period from e2 to e4 can be determined as the non-exposure period of image 1, and the period from e2 to e4 can drive the motor 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 not execute the push motor processing during the non-exposure period and may also complete the focus.
[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 time of the exposure of the previous frame to the start time of the exposure of this frame; the exposure period is from the start time of the exposure of this frame to the end time of the exposure of this frame. In another case, the non-exposure period is from the end time of the reading of the previous frame to the start time of the exposure of this frame; the exposure period is from the start time of the exposure of this frame to the end time of the exposure of this frame (or the end time of the reading). Since the exposure time that can be obtained by the hardware is different, different hardware and situations may have different meanings, which is not limited in the embodiments of the present application.
[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 a motor can push (the upper limit of the motor's pushing) for one autofocus, ensuring that pushing the motor during the intrusion exposure time and non-exposure time does not affect the focus of the next frame, thereby 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 is only an exemplary description and is 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 intrusion exposure factor a is determined by calculation, the electronic device may determine the intrusion exposure factor a based on the position of the focus subject in the image (the position of the focus frame). During the shooting process of the electronic device, the position of the focus frame can be obtained, and the ratio of the number of pixel rows of the upper border of the focus frame to the total number of pixel rows of the image can be determined as the intrusion exposure factor a.
[0159] For example, Fig. 9 Schematic diagram of an exposure scanning interface shown in an embodiment of the present application. Fig. 9 As shown, during the exposure process, a frame of image can be scanned line by line from top to bottom. Along the exposure line-by-line scanning direction, the number of lines first scanned by the focus frame in this frame of image is determined to be the Xth line. A frame of image has a total of N lines, and the intrusion exposure factor a=X / N can be determined. Where 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, execute S707; non-exposure +T invade ≤T focus In this case, execute S706.
[0162] In the above process, T non-exposure +T invade The threshold can relax the focus time limit and increase T invade The focusing time during this period is to ensure the completion of the focusing process as much as possible, to ensure better image exposure results, and to ensure the confidence of the PD value of each frame of exposure image. During the focusing process within the intrusion exposure period, laser information is used to assist the focusing, which can ensure faster image focusing and better results.
[0163] S707: The electronic device pushes 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 Fig. 8A As shown, the electronic device can calculate PD2 from the period e4 to e6. The calculation of PD2 can determine the target code to be focused and the focusing duration. At this time, it is necessary to focus on the image 2 during the non-exposure period and the intrusion exposure period. Therefore, during the period e6 to e8, the electronic device can drive the motor during this period to complete the focusing.
[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 (measured object distance) of the laser device can be used to assist AF focusing.
[0168] In a possible implementation, when the electronic device uses phase focusing, such as Figure 8A to Figure 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, from which the focus duration can be determined.
[0169] In another possible implementation, when the electronic device focuses by laser, the object distance (distance information) is acquired at a fixed frame rate, and 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 the 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, the first code is obtained by PD focus and the second code is obtained by 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] In the above two methods of determining the target code, the target code can be determined based on the confidence of PD. Since PD is not accurate, it is more inclined to use laser focusing to ensure the reliability of the focusing result.
[0173] It should be noted that, in the above-mentioned implementation, the exposure frame rate of the electronic device is a first frame rate, the frame rate of the distance information measured by the laser device (distance measuring sensor) is a second frame rate, and the first frame rate is less than or equal to the second frame rate. For example, the first frame rate is 30fps, and the second frame rate is 60fps. In this way, it can be ensured that the laser device can meet the focus tracking needs during continuous exposure, thereby ensuring the implementation conditions of the solution.
[0174] like Fig. 8A As shown, the time period for the ranging sensor to obtain distance information is the time period corresponding to the rectangular grid, and the first frame rate of the ranging sensor is twice the second frame rate of exposure. The electronic device can use the motor code value corresponding to the object distance obtained by the ranging sensor most recently to assist autofocus based on this motor code value. The code value is obtained during the e4-e5 period to radiate focus, and during the e6-e8 period, the motor is continued to be driven for focus.
[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 time (e11) of the intrusion exposure period.
[0178] In the above-mentioned implementation, the electronic device preferentially drives the motor to focus during the non-exposure period. When the non-exposure time is not long enough for focusing, the electronic device can invade the focusing time into part of the exposure period to focus. In this way, in most cases, the electronic device can complete the operation of driving the motor during the non-exposure period, avoiding the overlap of exposure and driving the motor, and ensuring better image exposure effect. In addition, each frame of the image can be focused by driving the motor during the non-exposure period, and each frame of the image can be focused, ensuring the timeliness and accuracy of the focus, thereby improving the focusing effect.
[0179] Fig.10 1 is a flow chart of another shooting method proposed in an embodiment of the present application. Figure 7 Embodiments of the method, such as Fig.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, perform intrusion exposure and execute S1005; if the focus time is less than or equal to the non-exposure time, execute S1004.
[0183] S1004: The electronic device pushes the motor to the target focus position during 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 pushes the motor to the target focus position during the non-exposure period and the intrusion exposure period.
[0186] like Fig.10 As shown, if the first focusing time is greater than the non-exposure time, the electronic device directly pushes the motor to the target focusing 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 time, and the focusing continues directly until the focusing is completed.
[0187] In the above implementation, the electronic device can start focusing from the non-exposure period, no matter how long it invades the exposure period, until the current focus (pushing the motor) is completed. Generally speaking, within an exposure time period, the focus, which takes the longest time, can basically be processed and completed. Most of the time, the motor pushing process can be completed during the non-exposure period, ensuring that in most cases, the timing of the motor pushing does not affect the exposure, ensuring the image effect and the focus tracking speed.
[0188] Fig.11 FIG. 2 is a flow chart of another shooting method proposed in the embodiment of the present application. Fig.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 such as S703, and immediately executes the push motor from the beginning of the non-exposure period. After the push motor is completed, it calculates the PD and the target code for the next focus, and waits until the next non-exposure period to continue the push motor. In the above implementation, the electronic device can perform the push motor processing from the non-exposure period, calculate the target code during the exposure period, and the timing of the specific execution of the focusing action can be specifically regulated to ensure the focusing effect and speed. Among them, in S1103, the electronic device can not perform the above S703 processing process, and can directly perform the focus.
[0193] In another possible implementation, the motor is driven 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 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 (the stated condition or event) is detected" may be interpreted to mean "if determining..." or "in response to determining..." or "upon detecting (the stated condition or event)" or "in response to detecting (the 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 devices. 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 a website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. 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 contains one or more available media integration. 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), etc.
[0197] Those skilled in the art can understand that to implement all or part of the processes in the above-mentioned embodiments, the processes can be completed by computer programs to instruct related hardware, and the programs can be stored in computer-readable storage media. When the programs are executed, they can include the processes of the above-mentioned method embodiments. The aforementioned storage media include: ROM or random access memory RAM, magnetic disk or optical disk and other media that can store program codes.
Claims
1. A shooting method, characterized in that: The method is applied to an electronic device, and the method comprises: In response to the first operation, the electronic device starts shooting and displays a first interface, on which a preview image captured by the camera is displayed; During the process of continuously exposing K frames of images, the electronic device drives the focus motor in 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 a period of exposure that starts at the start of exposure of the first row of the current frame image.
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 length of the second image is less than or equal to the non-exposure time length of the second image.
3. The method according to claim 1 or 2, 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 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; and stops driving the focus motor for the first image at the end of the intrusion 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 an 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 focusing time period is greater than the non-exposure time period.
6. The method according to any one of claims 1 to 5, characterized in that: The method further comprises: During the process of continuously exposing K frames of images, if the current frame of image has a first time period, the electronic device calculates the target focus position of the next frame of image in 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 in the first period of time, specifically including: The electronic device acquires distance information of a focused subject through the distance measuring 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 by 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 codes, the computer program codes include computer instructions, and when the one or more processors execute the computer instructions, the electronic device executes the method as described in 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 acquisition method and device
CN114946169A
Image processing method and electronic equipment
CN115967846A
Exposure parameter determination method and device
CN116074634A
Anti-shake method and device, electronic equipment and computer readable storage medium
CN116437206A
