Photographing method, electronic equipment and computer readable storage medium
By determining the blur state of long-exposure frames during HDR shooting, electronic devices select appropriate image frames to generate photos, solving the blur problem caused by unclear image frames and improving photo clarity and user experience.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- HONOR DEVICE CO LTD
- Filing Date
- 2024-10-17
- Publication Date
- 2026-04-28
AI Technical Summary
If the image frames captured by the electronic device are not clear enough, the resulting photos will be blurry, affecting the user's shooting experience.
When an electronic device is shooting in HDR, it acquires multiple image frames with different exposure times and determines whether the long exposure frame is blurry. If it is blurry, the long exposure frame is not used to generate the photo; if it is not blurry, the long exposure frame and other image frames are used to generate the photo.
It reduces the impact of blur on photo sharpness, providing clearer photos and improving the user's shooting experience.
Smart Images

Figure CN121940646A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the fields of terminal and communication technology, and in particular to photographing methods, electronic devices and computer-readable storage media. Background Technology
[0002] To meet users' needs for high-quality photos, electronic devices can acquire image frames with multiple exposure times after receiving a photo-taking instruction, and then generate a photo based on these multiple image frames. Image frames with different exposure times exhibit different effects in different brightness areas of the image. The electronic device can reconstruct different brightness areas of the image based on image frames with different exposure times, resulting in a photo where each brightness area has a good representation, thus providing users with clearer photos.
[0003] However, sometimes the image frames captured by electronic devices are not clear enough, causing the final generated photo to become blurry due to the blurry image frames, which affects the user's shooting experience. Summary of the Invention
[0004] This application provides a photographing method, an electronic device, and a computer-readable storage medium. In this method, the electronic device, when performing HDR shooting, can acquire multiple image frames with different exposure times, including short exposure frames, medium exposure frames, and long exposure frames. The electronic device can determine whether the long exposure frame is blurry based on one or more parameters. When the long exposure frame is blurry, the electronic device can generate a photo using only the short and medium exposure frames, thus avoiding the impact of long exposure frame blur on the photo's sharpness.
[0005] In a first aspect, embodiments of this application provide a photographing method applied to an electronic device. The method includes: the electronic device initiating high dynamic range (HDR) imaging to acquire multiple image frames with different exposure times, the multiple image frames including a first image frame and a second image frame, wherein the exposure time of the first image frame is longer than that of the second image frame; the electronic device determining whether the first image frame is blurred based on a first parameter; if the first image frame is blurred, the electronic device generating a photograph based on the second image frame; if the first image frame is not blurred, the electronic device generating a photograph based on the first image frame and the second image frame; the first parameter includes one or more of the following: the deviation of feature points between the first image frame and the second image frame, the difference in gradient values of matching feature points between the first image frame and the second image frame, and the displacement of the target being photographed during the shooting of the first image frame.
[0006] The electronic device can determine whether the first image frame is blurry based on some or all of the first parameters. The first image frame can be a long exposure frame, and the second image frame can be a medium exposure frame. Alternatively, the first image frame can also be a medium exposure frame, and the second image frame can be a short exposure frame. Or, the first image frame can also be a long exposure frame, and the second image frame can be a short exposure frame. When performing HDR shooting, the electronic device can determine whether the longer first image frame is blurry. When the first image frame is blurry, the electronic device can generate a photo based on the second image frame; when the first image frame is not blurry, the electronic device can generate a photo based on both the first and second image frames. It is understood that when the first image frame is blurry, the electronic device can also include other image frames in the photo generation process when generating a photo based on the second image frame. When the first image frame is not blurry, the electronic device can also add other image frames to the photo generation process when generating a photo based on the first and second image frames. For example, multiple image frames can also include a sixth image frame. When the first image frame is blurry, the electronic device can generate a photo based on the second and sixth image frames; when the first image frame is not blurry, the electronic device can generate a photo based on the first, second, and sixth image frames. The exposure time of the sixth image frame can be longer than that of the first image frame, shorter than that of the first image frame, or the same as that of the first image frame.
[0007] In other words, if the first image frame with a longer exposure time is not blurry, the photo generated by the electronic device based on multiple image frames will be clearer. However, if the first image frame is blurry, the electronic device will not use the first image frame, but will generate a photo based on other image frames. This can reduce the impact of the blurry first image frame on the clarity of the photo.
[0008] The greater the deviation between the feature points of the first image frame and the second image frame, the blurrier the first image frame becomes.
[0009] In conjunction with the first aspect, in some embodiments, the deviation of feature points between the first image frame and the second image frame includes the number of feature points that match between the first image frame and the second image frame.
[0010] The more blurred the first image frame is, the worse the clarity of its image boundaries and the fewer feature points can be identified. As a result, the number of feature points that match between the first and second image frames is also smaller.
[0011] In conjunction with the first aspect, in some embodiments, the multiple image frames include a third image frame, the exposure time of the first image frame is longer than the exposure time of the third image frame, and the deviation of feature points between the first image frame and the second image frame includes the difference between the first number of feature points matched in the first image frame and the third image frame and the second number of feature points matched in the second image frame and the third image frame.
[0012] The more blurred the first image frame, the greater the difference between the third image frame and the first image frame. The electronic device can determine the number of matching feature points between the first and third image frames, denoted as the first quantity. Then, the electronic device can determine the number of matching feature points between the second and third image frames, denoted as the second quantity. The more blurred the first image frame, the greater the difference between the first and second quantities. The electronic device can determine the difference between the first and second quantities based on the ratio of the first quantity to the second quantity, or it can determine the difference based on the absolute value of the difference between the first and second quantities, and so on. Furthermore, the electronic device can compare the absolute value of the above ratio or difference with a certain preset threshold to determine whether the first image frame is blurred. For example, when the ratio of the first quantity to the second quantity is less than a certain preset ratio, the electronic device can determine that the first image frame is blurred; or, when the absolute value of the difference between the first quantity and the second quantity is less than a certain preset value, the electronic device can determine that the first image frame is blurred.
[0013] In conjunction with the first aspect, in some embodiments, the multiple image frames include a fourth image frame and a fifth image frame, the exposure time of the fourth image frame and the fifth image frame is less than the exposure time of the first image frame, and before the electronic device determines whether the first image frame is blurred based on the first parameter, the method further includes: the electronic device determining the inter-frame displacement between the fourth image frame and the fifth image frame based on the displacement of matching feature points in the fourth image frame and the fifth image frame; the electronic device determining the displacement rate based on the inter-frame displacement and the inter-frame interval, the inter-frame interval being the time difference between the electronic device acquiring the fourth image frame and the fifth image frame; and the electronic device determining the displacement of the target being photographed during the shooting of the first image frame based on the displacement rate and the exposure time of the first image frame.
[0014] The inter-frame displacement reflects the magnitude of the camera's displacement relative to the target when the electronic device captures the fourth and fifth image frames, while the displacement rate reflects the camera's displacement rate during the same process. Thus, the electronic device can determine the target's displacement during the capture of the first image frame based on the displacement rate and the exposure time of the first image frame. This target displacement is a relative displacement, meaning the displacement of the camera relative to the target. The larger this displacement, the more blurred the first image frame. The electronic device can determine if this displacement exceeds a preset displacement threshold; if it does, the first image frame is blurred.
[0015] Optionally, the exposure time of the fourth and fifth image frames can be the same. For example, both can be medium exposure frames or both can be short exposure frames. Two image frames with the same exposure are more convenient for feature point matching, thereby more accurately calculating the inter-frame displacement between the fourth and fifth image frames.
[0016] In conjunction with the first aspect, in some embodiments, after the electronic device acquires multiple image frames with different exposure times, the method further includes: the electronic device dividing the first image frame and the second image frame into multiple regions respectively; and the electronic device determining feature points in each region of the first image frame and the second image frame.
[0017] In this process, the electronic device can divide an image frame into multiple regions and then identify feature points in each region, thus obtaining the feature points of the entire image. This ensures that the feature points detected by the electronic device are evenly distributed across the entire image, avoiding the situation where detected feature points are too locally located, failing to reflect the overall characteristics of the image and hindering feature point matching and comparison.
[0018] In conjunction with the first aspect, in some embodiments, the feature points matched in the first image frame and the second image frame are coplanar. The electronic device can perform homography calculations on the matched feature points to determine the coplanar feature points. This allows the electronic device to ensure greater accuracy in feature point matching.
[0019] In conjunction with the first aspect, in some embodiments, before the electronic device determines whether the first image frame is blurred based on the first parameter, the method further includes: the electronic device processing the pixel values of the pixels in the first image frame, such that the signal-to-noise ratio of the first image frame after processing is the same as that of the second image frame; and the electronic device determining the difference in gradient values of the matching feature points between the processed first image frame and the second image frame.
[0020] Before comparing the gradients of the first and second image frames, the electronic device can process the first image frame to make its signal-to-noise ratio (SNR) the same as that of the second image frame. This reduces the impact of noise on the image gradient and allows for a better comparison of their gradient differences. The greater the difference in gradient values between the matched feature points of the first and second image frames, the more blurred the first image frame becomes.
[0021] In conjunction with the first aspect, in some embodiments, before the electronic device initiates high dynamic range (HDR) imaging, the method further includes: the electronic device displaying a camera interface, the camera interface including a shutter button; the electronic device receiving a first operation to initiate HDR imaging; and the electronic device detecting a second operation applied to the shutter button.
[0022] In other words, HDR shooting can be turned on or off by the user, providing them with greater freedom when shooting. Users can choose to enable or disable the HDR function based on their own needs.
[0023] In a second aspect, this application provides an electronic device including a display screen, a memory, and a processor coupled to the memory; the display screen is used to display an interface, the memory stores a computer program, and when the processor executes the computer program, it causes the electronic device to implement the method described in any one of the first aspects.
[0024] Thirdly, this application provides a computer-readable storage medium storing a computer program or computer instructions, which are executed by a processor to implement the method described in any of the first aspects above.
[0025] Fourthly, embodiments of this application provide a computer program product, which, when executed by a processor, implements the method described in any of the first aspects above.
[0026] Fifthly, embodiments of this application provide a chip including a processor and a memory, wherein the memory is used to store computer programs or computer instructions, and the processor is used to execute the computer programs or computer instructions stored in the memory, causing the chip to perform the method described in any of the first aspects above.
[0027] The solutions provided in the second to fifth aspects above are used to implement or cooperate with the methods provided in the first aspect above, and therefore can achieve the same or corresponding beneficial effects as the methods in the first aspect, which will not be elaborated here. Attached Figure Description
[0028] Figures 1A-1D This is a schematic diagram of a scene captured by HDR according to an embodiment of this application;
[0029] Figures 2A-2C These are schematic diagrams of image frames with different exposure times provided in the embodiments of this application;
[0030] Figure 3 This is a schematic diagram of the architecture of the electronic device 100 provided in the embodiments of this application;
[0031] Figure 4 This is a schematic diagram illustrating the process by which the electronic device 100 provided in this application identifies whether a long exposure frame is blurry;
[0032] Figure 5 This is a schematic diagram showing the result of a method for identifying feature points in an electronic device according to an embodiment of this application;
[0033] Figure 6 This is a schematic diagram showing the result of another method for identifying feature points in an electronic device provided in an embodiment of this application;
[0034] Figure 7 This is a schematic diagram illustrating the effect of signal-to-noise ratio balancing on an image, provided by an embodiment of this application.
[0035] Figure 8A This is a schematic diagram of feature points generated by the electronic device provided in this application based on a clear long exposure frame;
[0036] Figure 8B This is a schematic diagram of feature points generated by an electronic device based on a blurred long exposure frame, as provided in an embodiment of this application.
[0037] Figure 9A This is a schematic diagram of a photograph generated by the electronic device provided in this application embodiment without using a blurred long exposure frame;
[0038] Figure 9B This is a schematic diagram of a photograph generated using a blurred long exposure frame by an electronic device provided in an embodiment of this application;
[0039] Figure 10 This is a flowchart illustrating the photographing method provided in the embodiments of this application;
[0040] Figure 11 This is a schematic diagram of the structure of a photographing device provided in an embodiment of this application;
[0041] Figure 12 This is a schematic diagram of the structure of a chip provided in an embodiment of this application. Detailed Implementation
[0042] The terminology used in the following embodiments of this application is for the purpose of describing particular embodiments only and is not intended to be limiting of this application. As used in the specification and appended claims of this application, the singular expressions “a,” “an,” “the,” “the,” “the,” and “this” are intended to include the plural expressions as well, unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used in this application refers to and includes any or all possible combinations of one or more of the listed items.
[0043] Hereinafter, the terms "first" and "second" are used for descriptive purposes only and should not be construed as implying or suggesting relative importance or implicitly indicating the number of indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature, and in the description of the embodiments of this application, unless otherwise stated, "multiple" means two or more.
[0044] Currently, users have increasingly higher demands for the quality of photos taken by electronic devices. After receiving a command to take a photo, the electronic device can acquire image frames with multiple exposure times via its camera, and then generate a photo based on these frames. This method of photography can also be called high dynamic range imaging (HDR) shooting. The photo generation process can include image noise reduction, inter-frame registration, and motion ghosting detection. Motion ghosting detection refers to detecting blurry images caused by the camera's displacement relative to the subject during HDR shooting. Inter-frame registration involves matching and superimposing multiple image frames to map the optimal or locally optimal image of one or more frames onto the target image (reference frame). For example, the electronic device can acquire raw image data (RAW) images with three exposure times via its camera, referred to as long exposure frames, short exposure frames, and medium exposure frames, respectively. Long exposure frames have the longest exposure time, such as 300 milliseconds, 400 milliseconds, etc. Short exposure frames have the shortest exposure time, such as 5 milliseconds, 6 milliseconds, etc. The exposure time of a medium exposure frame is between that of a long exposure frame and a short exposure frame, and its exposure time can be, for example, 20 milliseconds, 30 milliseconds, etc. The exposure durations of the long exposure frame, short exposure frame, and medium exposure frame mentioned above are only examples, and the exposure durations of the long exposure frame, short exposure frame, and medium exposure frame can also have other values, which are not limited in this application embodiment.
[0045] Figures 1A-1D This is a schematic diagram of a scene captured by HDR according to an embodiment of this application.
[0046] Figure 1AAn example is shown of the home screen interface 101 on the electronic device 100, such as... Figure 1A As shown, the home screen interface may include desktop icons for one or more applications, including desktop icon 102 for the camera application.
[0047] Electronic device 100 can detect user actions, such as clicks, applied to desktop icons 102. In response to this action, electronic device 100 can launch a camera application and display, for example... Figure 1B The camera interface 103 is shown. Simultaneously, the electronic device 100 can open the camera shutter to capture images.
[0048] like Figure 1B As shown, the camera interface 103 may include a preview window 104, a shutter button 105, and a playback control 106.
[0049] The preview window 104 can be used to display preview images generated by the electronic device 100 after processing image frames captured by the camera. The preview image displayed by the electronic device can be a preview image corresponding to a medium exposure frame. The electronic device 100 can continuously capture medium exposure frames, then perform downsampling and other processing on the medium exposure frames to generate preview images, which are then displayed in the preview window 104. For example, the electronic device sequentially captures medium exposure frames i-3, i-2, i-1, i, etc., at preset time intervals, where i is a positive integer greater than 3. The electronic device can sequentially perform downsampling and other processing on the medium exposure frames i-3, i-2, i-1, and i to obtain preview images, and then display the preview images corresponding to the aforementioned medium exposure frames sequentially. Figure 1B The preview image in preview window 104 shown can be obtained by the electronic device 100 after processing the intermediate exposure frame i. The electronic device can store the acquired intermediate exposure frame and the timestamp of the acquired intermediate exposure frame in the zero-delay buffer (ZSL buffer).
[0050] The shutter button 105 is used to take photos.
[0051] The Retrospective control 106 is used to open the Gallery application and view photos or videos stored on the electronic device. The Retrospective control 106 can display recently saved photos or videos on the electronic device.
[0052] like Figure 1CAs shown, as time progresses, the electronic device 100 continues to acquire image frames. After the intermediate exposure frame i, the electronic device 100 successively acquires intermediate exposure frames i+1, i+2, and i+3. The electronic device 100 can process the above intermediate exposure frames sequentially and then display the preview image corresponding to each intermediate exposure frame in the preview window 104. Figure 1B The preview image in the preview window 104 shown can be obtained by the electronic device 100 after processing the exposure frame i+3.
[0053] The electronic device 100 can receive the user's click of the shutter button 105. The electronic device 100 can record a timestamp when the operation is received. Furthermore, the electronic device 100 can acquire a series of image frames with different exposure times according to a preset pattern. This preset pattern can be, for example, medium exposure frames, short exposure frames, medium exposure frames, short exposure frames, long exposure frames, or medium exposure frames, medium exposure frames, medium exposure frames, short exposure frames, medium exposure frames, short exposure frames, long exposure frames, etc. This application embodiment does not limit the pattern for the electronic device to acquire multiple image frames with different exposure times after receiving a shooting command. Figure 1D As shown, a series of image frames with different exposure times can include medium exposure frame i+4, short exposure frame j, long exposure frame k, etc., where j and k are positive integers. After acquiring image frames based on the aforementioned preset rules, the electronic device can continue to acquire medium exposure frames and display the corresponding preview images until it receives another click on the shutter button 105, etc.
[0054] The electronic device can locate the image frame captured at the time stamp of the shutter button 105 click in the zero-delay buffer: medium exposure frame i+3. The electronic device 100 can then generate a photo based on the medium exposure frame i+3, short exposure frame j, long exposure frame k, etc., and save the generated photo to the gallery. Afterwards, the electronic device 100 can display a preview thumbnail of the photo in the playback control 106. Not limited to generating photos based on three frames, in HDR shooting, the electronic device can also generate photos based on more or fewer image frames. Furthermore, the electronic device 100 can also generate photos based on image frames before the user clicks the shutter button 105. This embodiment does not limit the number and type of image frames used by the electronic device when performing HDR shooting.
[0055] The reason for combining images from multiple exposure times is that images with different exposure times produce different effects in different brightness areas of the image. Electronic devices can reproduce these different brightness areas of the image based on the images with different exposure times, thus obtaining a clear photograph. Figures 2A-2C These are image frames with different exposure times provided in the embodiments of this application. Figure 2A , Figure 2B and Figure 2C It was obtained by capturing the same scene using an electronic device. Figure 2A For medium exposure frames, Figure 2B For short exposure frames, Figure 2C This is a long exposure frame. For example... Figure 2A As shown, most of the content in the medium-exposure frame is relatively clear, but there is overexposure in high-brightness areas and low signal-to-noise ratio in low-brightness areas, resulting in a loss of detail. The aforementioned high-brightness areas refer to the areas with higher brightness in the image, such as... Figure 2A The indoor area is circled in the middle. Low-brightness areas refer to regions in the image with lower brightness, such as... Figure 2A The area of buildings, sky, and trees in the distance, outlined by the solid circle. For example... Figure 2B As shown, the bright areas in the short exposure frame are clearer, from Figure 2B You can see it clearly in the middle. Figure 2A The bright areas are overexposed, while other bright areas are not clear enough. For example... Figure 2C As shown, the dark areas in the long exposure frame are clearer, from Figure 2C You can see it clearly in the middle. Figure 2A Content in areas with lower brightness, such as the outlines of balconies on distant buildings, tree trunks, and leaves, etc., can be captured by an electronic device. The device can use a medium-exposure frame as a reference frame, reconstruct the image of the high-brightness areas in the reference frame using the image of the high-brightness areas in the short-exposure frame, and reconstruct the image of the low-brightness areas in the reference frame using the image of the low-brightness areas in the long-exposure frame, ultimately producing a photograph where all brightness areas are sharp.
[0056] However, sometimes the image frames used by electronic devices to synthesize photos are not sharp enough, which can cause the synthesized photo based on that image frame to also be blurry, affecting the visual quality of the final image. Long exposure frames are more prone to blurring than medium and short exposure frames. This is because the exposure time for long exposure frames is longer, making it easier for the electronic device itself or the subject to shift during the shooting process, resulting in a blurry image. If the electronic device synthesizes a photo based on a blurry long exposure frame, the overall image sharpness will be compromised.
[0057] To address the aforementioned problems, embodiments of this application provide a photographing method, an electronic device, and a computer-readable storage medium. In this method, after acquiring a long-exposure frame, the electronic device can determine whether the long-exposure frame is blurry based on a preset rule. If the long-exposure frame is determined to be blurry, the electronic device can choose not to use it to synthesize the photograph, thus avoiding the blurriness affecting the image's clarity. If the long-exposure frame is determined to be blurry, the electronic device can still use it to synthesize the photograph. This reduces the impact of electronic device or target displacement on image clarity, providing users with clearer photos.
[0058] For ease of description and better understanding, subsequent embodiments of this application use the example of an electronic device synthesizing a photograph based on image frames taken with three exposure times to illustrate the photographing method. However, the method is not limited to three exposure times; the electronic device can synthesize a photograph based on image frames taken with longer or shorter exposure times, and this application does not impose such limitations. The photographing method for synthesizing a photograph based on image frames taken with longer or shorter exposure times can be found in the subsequent embodiments describing the method for synthesizing a photograph based on image frames taken with three exposure times, and will not be elaborated upon here.
[0059] The electronic device 100 provided in the embodiments of this application will be introduced first below.
[0060] Figure 3 This is a schematic diagram of the architecture of the electronic device 100 provided in the embodiments of this application.
[0061] Electronic device 100 may be equipped with Or other portable terminal devices with different operating systems, such as mobile phones, tablets, desktop computers, laptops, handheld computers, laptops, ultra-mobile personal computers (UMPCs), netbooks, as well as cellular phones, personal digital assistants (PDAs), augmented reality (AR) devices, virtual reality (VR) devices, artificial intelligence (AI) devices, wearable devices, in-vehicle devices, smart home devices and / or smart city devices, etc.
[0062] like Figure 3As shown, electronic device 100 may include processor 110, external memory interface 120, internal memory 121, display screen 130, and camera 140. These components are coupled through one or more buses. These buses may be inter-integrated circuit (I2C) buses, inter-integrated circuit sound (I2S) buses, pulse code modulation (PCM) buses, mobile industry processor interfaces (MIPI), etc.
[0063] Processor 110 may include one or more processing units, such as: application processor (AP), modem processor, graphics processing unit (GPU), image signal processor (ISP), controller, memory, image encoder, digital signal processor (DSP), baseband processor, and / or neural network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.
[0064] The controller can be the nerve center and command center of the electronic device 100. The controller can generate operation control signals according to the instruction opcode and timing signals to complete the control of fetching and executing instructions.
[0065] The processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. This memory can store instructions or data that the processor 110 has just used or that are used repeatedly. If the processor 110 needs to use the instruction or data again, it can retrieve it directly from the memory. This avoids repeated accesses, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.
[0066] The external storage interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 through the external storage interface 120 to perform data storage. Photos and videos can be specifically saved in a path accessible to the gallery application, so that users can view photos and videos in that path by opening the gallery. The gallery is an application that manages image files such as photos and videos, and can also be named an album.
[0067] Internal memory 121 can be used to store computer executable program code, which includes instructions. Processor 110 executes various functional applications and data processing of electronic device 100 by running the instructions stored in internal memory 121. Internal memory 121 may include a program storage area and a data storage area. The program storage area may store the operating system, at least one application required for a function (such as facial recognition, fingerprint recognition, mobile payment, etc.). The data storage area may store data created during the use of electronic device 100 (such as facial information template data, fingerprint information templates, etc.). Furthermore, internal memory 121 may include high-speed random access memory and non-volatile memory, such as at least one disk storage device, flash memory device, universal flash storage (UFS), etc.
[0068] In this embodiment, the internal memory 121 may include a zero-delay buffer, which can store a preset number or preset capacity of medium-exposure frames. After acquiring a medium-exposure frame, the electronic device 100 adds the newly acquired medium-exposure frame to the zero-delay buffer and deletes the oldest stored medium-exposure frame. Thus, when a shooting command is received, the electronic device can retrieve the medium-exposure frame from the zero-delay buffer to generate a photo.
[0069] Camera 140 may include: a lens ( Figure 3 (Not shown in the image) Photosensitive sensor and flexible printed circuit board (FPCB) section ( Figure 3(Not shown in the image). The FPCB is responsible for connecting other components of the camera 140, such as the photosensor, to the image signal processor (ISP), for example, transmitting the raw image data output by the photosensor to the ISP. When taking a picture, the shutter of the camera 140 is opened, allowing light to enter and illuminate the photosensor. The photosensor converts the light signal into an electrical signal, which is then further converted into a digital signal by an analog-to-digital converter (ADC) for transmission to the ISP. This digital signal data is the raw image data captured by the camera, and its data format can be, for example, Bayer format.
[0070] The process of opening the shutter of the camera 140 is also known as the exposure process, and the time interval between opening and closing the shutter of the camera 140 is the exposure time. In this embodiment, the electronic device 100 acquires RAW images with different exposure times by measuring the duration of the shutter opening of the camera 140. These RAW images with different exposure times may include long exposure frames, medium exposure frames, and short exposure frames.
[0071] An ISP can be used to perform a series of image processing operations on RAW images to obtain YUV or RGB frames. These image processing operations may include: automatic exposure control (AEC), automatic gain control (AGC), automatic white balance (AWB), color correction, and defect removal, etc. The ISP can also be integrated into the camera 140. In this embodiment, the ISP can also identify whether a long exposure frame is blurry. If the long exposure frame is blurry, the ISP can generate YUV or RGB frames based on medium and short exposure frames; if the long exposure frame is clear, the ISP can generate YUV or RGB frames based on long, short, and medium exposure frames. The ISP is not limited to synthesizing image frames with multiple different exposure times; other processors or processing units in the electronic device 100 can also synthesize image frames with different exposure times. This embodiment does not impose any limitations on this. Furthermore, the ISP is not limited to identifying whether a long exposure frame is blurry; other processors or processing units in the electronic device 100 can also identify whether a long exposure frame is blurry. This embodiment does not impose any limitations on this either.
[0072] Display screen 130 can be used to display images captured by camera 140, such as preview images. Preview images can be obtained from YUV or RGB frames output by the ISP through algorithms such as downsampling. Their resolution is often lower than that of photographs to avoid excessively high resolution causing long display delays. A series of preview images (preview frames) are arranged chronologically to form a preview stream. Based on this stream, the display screen can present the images captured by the camera in real time. The preview stream needs to be sent to the display screen before it is displayed. Sending to the display screen means pushing the preview images captured by the camera into the frame buffer (FB). The frame buffer is a storage space, which can be located in video memory or main memory, used to store rendering data processed by the graphics card chip or to be extracted. The content of the frame buffer corresponds to the interface displayed on the screen; it can be simply understood as a cache corresponding to the content displayed on the screen. In other words, modifying the content in the frame buffer modifies the image displayed on the screen.
[0073] An image encoder can encode YUV or RGB frames output by an ISP to obtain a photograph. The format of the photograph output by the image encoder can include, but is not limited to, any of the following formats: Joint Photographic Experts Group (JPEG), Portable Network Graphics (PNG), and Tag Image File Format (TIFF).
[0074] Figure 3 The illustrated structure does not constitute a specific limitation on electronic device 100; electronic device 100 may include, but is not limited to, other types of electronic devices. Figure 3 This may involve more or fewer components, or combining certain components, or splitting certain components, or different component arrangements. Figure 3 The components shown can be implemented in hardware, software, or a combination of both. For example, the electronic device may also include a graphics processing unit (GPU) for rendering. As another example, the electronic device 100 may also include a variety of sensors: pressure sensors, proximity sensors, touch sensors, ambient light sensors, etc. The touch sensor, also known as a "touch panel," can be mounted on the display screen. The touch sensor and the display screen can form a touchscreen, also called a "touch screen." The touch sensor detects touch operations applied to it, such as a user pressing a shutter button. The touch operation detected by the touch sensor can be transmitted to the application processor to determine the type of touch event.
[0075] In some embodiments, after acquiring multiple image frames with different exposure times, the electronic device can identify whether there is a long exposure frame that is blurred among the multiple image frames with different exposure times. The process by which the electronic device 100 identifies whether a long exposure frame is blurred is described below.
[0076] Figure 4 This is a schematic diagram illustrating the process by which the electronic device 100 provided in this application identifies whether a long exposure frame is blurred.
[0077] like Figure 4 As shown, after receiving a shooting command, the electronic device 100 can acquire multiple image frames with different exposure times via a camera. These multiple image frames with different exposure times may include one or more medium-exposure frames and long-exposure frames. In addition, it may also include one or more short-exposure frames. The aforementioned shooting command can be triggered by the electronic device 100 detecting, for example... Figure 1C The shooting instruction shown is generated after the user clicks the shutter button. However, it is not limited to this. The shooting instruction can also be generated after the electronic device 100 detects a person's smiling face, or after the electronic device 100 receives preset voice content (such as "cheese") to trigger shooting, etc. This application embodiment does not limit this.
[0078] Electronic device 100 can select a medium exposure frame from one or more exposure frames as a reference frame, and then perform brightness alignment between the reference frame and the long exposure frame. This reference frame can be the medium exposure frame at the time the electronic device receives the shooting command. For example, as... Figure 1C After receiving the operation of clicking the shutter button 105, the electronic device 100 can use the medium exposure frame i+3 generated when the shutter button 105 is clicked as the reference frame. Alternatively, the reference frame can also be the medium exposure frame with the highest clarity among a series of image frames with different exposure times generated by the electronic device 100 according to a preset rule after obtaining the shooting command, or the medium exposure frame in the middle position among the aforementioned series of image frames with different exposure times, etc. The choice of reference frame is not limited in this embodiment.
[0079] For example, the process by which electronic device 100 identifies whether a long exposure frame is blurry is described below, using the aforementioned preset pattern of medium exposure frame, medium exposure frame, medium exposure frame, short exposure frame, medium exposure frame, short exposure frame, and long exposure frame as an example. Under the aforementioned preset pattern, after receiving a shooting command, the electronic device will sequentially acquire medium exposure frame, medium exposure frame, medium exposure frame, short exposure frame, medium exposure frame, short exposure frame, and long exposure frame. This series of image frames is called the shooting sequence. For ease of description and better understanding, the above image frames are numbered. After receiving a shooting command, the electronic device sequentially acquires medium exposure frame 1, medium exposure frame 2, medium exposure frame 3, short exposure frame, medium exposure frame 4, short exposure frame 2, and long exposure frame. Among them, medium exposure frame 1 is the frame acquired when the electronic device receives the shooting command (e.g., the user clicks on a key). Figure 1C The image frame captured when the shutter button (as shown) is pressed.
[0080] Taking medium exposure frame 1 as a reference frame as an example, the process by which electronic device 100 identifies whether a long exposure frame is blurry may include the following steps:
[0081] ①Brightness Alignment
[0082] The electronic device 100 can perform brightness alignment between the reference frame and the long exposure frame. The purpose of brightness alignment is to process the reference frame and the long exposure frame to have the same brightness, which can reduce the interference of image brightness on subsequent feature point recognition and make the feature points recognized by the reference frame and the long exposure frame as consistent as possible.
[0083] In this process, when the electronic device performs brightness alignment on an image, the exposure time for capturing the reference frame can be t1, the total gain for capturing the reference frame can be g1, the exposure time for capturing the long exposure frame can be t2, and the total gain for capturing the long exposure frame can be g2. The electronic device can then calculate the brightness registration ratio = (t1 / g1) / (t2 / g2). Furthermore, the electronic device 100 can multiply the pixel value of each pixel in the long exposure frame by the brightness registration ratio to obtain the long exposure frame after brightness alignment with the reference frame. The total gain can be the ISO value. ISO measures the camera's sensitivity to light; a higher ISO value indicates higher sensitivity. The total gain can be calculated using the camera's analog and digital gain. Analog gain refers to adjusting the sensitivity of the camera's photosensitive sensor to light. By changing the photosensitive sensor's operating voltage, the light signal is amplified, thereby improving the sensor's effectiveness in low light. The unit of analog gain can be millivolts per charge (mV / e). - Digital gain is the amplification of a camera's signal value after converting it from an analog-to-digital converter to a digital signal, using software or hardware algorithms to further improve image brightness. The ISO value can be the product of the analog gain and the digital gain.
[0084] Not limited to the above methods, the electronic device 100 may also use other methods to perform brightness alignment between the reference frame and the long exposure frame, and the embodiments of this application do not limit this.
[0085] ② Feature point detection
[0086] After aligning the brightness of the reference frame and the long exposure frame, the electronic device 100 can detect feature points in both frames. Feature points can be points in the image that are significant and unique. They can include pixels where the image grayscale value changes drastically, and pixels with local maximum curvature or significant gradient changes (i.e., corner points). The electronic device 100 can detect feature points in the reference frame based on features such as the grayscale value and gradient value of pixels in the reference frame, and similarly, detect feature points in the long exposure frame based on the same features. The feature points detected by the electronic device 100 can include, for example, Harris corner points, FAST corner points, ORB corner points, Scale-Invariant Feature Transform (SIFT) corner points, etc., but are not limited to these types. Other types of corner points can also be included, and this embodiment does not impose any limitations on this.
[0087] In some embodiments, to reduce computational load and control processing time for each image, the electronic device 100 may detect a preset number of feature points in long-exposure frames and reference frames, instead of detecting all feature points in the image frames. However, this may result in a limited selection of the preset number, leading to a more selective and less comprehensive view of the detected feature points. The feature points identified by the electronic device are marked with solid circles, such as... Figure 5 As shown, the feature points detected by the electronic device are densely concentrated in local areas of the image, while feature points in many other areas are not detected. This may lead to subsequent comparisons of feature points between two image frames, where only a portion of the image content is compared, rather than the entire image, making it impossible to accurately determine whether a long-exposure frame is blurred. To solve this problem, solid circles are used to mark the feature points identified by the electronic device, such as... Figure 6As shown, in some embodiments, the electronic device 100 can divide an image frame into multiple regions and then detect feature points in each region separately. This ensures that the detected feature points are evenly distributed throughout the entire image, allowing for a comprehensive comparison of the long exposure frame and the reference frame based on the overall image features. The size of each region divided by the electronic device 100 can be the same, different, or partially different. The number of feature points identified by the electronic device 100 within each region can be the same or different; this embodiment does not impose any limitations on this. The distribution of feature points determines the primary area of focus for the electronic device 100 during blur detection. In some embodiments, the electronic device 100 can identify different numbers of feature points based on the image's location. For example, the electronic device 100 can identify a larger number of feature points in the central region of the image, meaning it focuses more on areas more easily observed by the human eye, prioritizing the determination of whether blur exists in the central region of the long exposure frame. Alternatively, the electronic device 100 can identify different numbers of feature points based on different captured content. For example, the electronic device 100 can identify a larger number of feature points in areas containing people, prioritizing the determination of whether the portrait captured in the long exposure frame is blurred. In other embodiments, the electronic device 100 can also detect all feature points in an image frame.
[0088] In some embodiments, in addition to long exposure frames, the electronic device 100 can also detect feature points of other medium exposure frames for subsequent detection of whether the long exposure frame is blurred. Here, the medium exposure frames other than the reference frame and long exposure frame used to detect whether the long exposure frame is blurred are referred to as comparison frames. For example, in the sequence of medium exposure frame 1, medium exposure frame 2, medium exposure frame 3, short exposure frame, medium exposure frame 4, short exposure frame 2, and long exposure frame, the comparison frame can be medium exposure frame 3 or medium exposure frame 4. Since the image frame whose shooting time is closer to the long exposure frame captures an image closer to the long exposure frame, the electronic device 100 can select the medium exposure frame closest to the long exposure frame as the comparison frame, such as medium exposure frame 4 in the above shooting sequence.
[0089] ③ Feature point matching
[0090] The electronic device 100 can match feature points identified in a long exposure frame with feature points identified in a reference frame. Matching feature points means finding one or more feature points in the long exposure frame that correspond to one or more feature points in the reference frame. These two feature points correspond to each other because they indicate the same location on the same photographed target.
[0091] The electronic device can calculate the descriptor for each feature point in the long exposure frame and the reference frame using a descriptor extraction algorithm, and then use a matching algorithm to match a set of descriptors from the long exposure frame with a set of descriptors from the reference frame. The descriptor can be a vector describing information about the feature point and its surrounding pixels. Descriptors can include SIFT descriptors, ORB (Oriented Fast and Rotated BRIEF) descriptors, Fourier descriptors, DAISY descriptors, GLOH descriptors, etc., and this embodiment does not limit the specific type. The electronic device can use different descriptor extraction algorithms to extract the descriptor for each feature point based on the type of descriptor.
[0092] When two descriptors are close in distance in the vector space, their corresponding feature points can be considered to match. The matching algorithm described above can be a threshold-based matching method, a nearest neighbor-based matching method, a nearest neighbor matching method based on distance ratio, etc., and the embodiments of this application do not limit this.
[0093] In some embodiments, in addition to matching feature points of the reference frame with those of the long exposure frame, the electronic device can also match feature points of the reference frame with those of the comparison frame (e.g., medium exposure frame 4). The electronic device 100 can then determine the difference between the number of feature points matched in the reference frame and the long exposure frame and the number of feature points matched in the comparison frame and the reference frame. This difference can be the ratio obtained by dividing the number of feature points matched in the reference frame and the long exposure frame by the number of feature points matched in the reference frame and the comparison frame, or it can be the difference obtained by subtracting the number of feature points matched in the reference frame and the long exposure frame from the number of feature points matched in the reference frame and the comparison frame, etc. This application embodiment does not impose any limitations on this.
[0094] Furthermore, the electronic device 100 can also determine the degree of camera displacement when capturing long exposure frames based on the matching of feature points. Specifically, the electronic device 100 can first select two medium exposure frames, such as a reference frame and a comparison frame, for feature point matching. Then, the electronic device 100 can determine the displacement of the feature points based on the coordinates of one or more pairs of matching feature points in the reference frame and the comparison frame, thereby determining the inter-frame displacement s. The inter-frame displacement indicates the displacement of the camera from the time the reference frame is captured to the time the comparison frame is captured. This displacement refers to the relative displacement of the camera relative to the target being captured from the time the reference frame is captured to the time the comparison frame is captured. This displacement can be the displacement of the camera itself or the displacement of the target being captured. For example, if a feature point in the reference frame has coordinates (1, 1), and a matching feature point in the comparison frame has coordinates (2, 2), the displacement of this feature point is from (1, 1) to (2, 2), with a displacement distance of √2. These coordinate points and displacement distances are merely examples; the electronic device 100 can determine the coordinates of two feature points and the displacement distance between them based on different coordinate systems. This embodiment of the application does not impose any limitations on this. The electronic device 100 can calculate the displacement distance of each pair of feature points, and then average the displacement distances of all feature point pairs to obtain the inter-frame displacement s. Alternatively, the electronic device 100 can determine the inter-frame displacement s based on the displacement distances of some feature point pairs; this embodiment does not limit this. Furthermore, the electronic device 100 can determine the time interval t between capturing two image frames (e.g., a reference frame and a comparison frame). Then, the displacement rate v of the camera when the electronic device 100 captures the reference frame and the comparison frame is equal to the inter-frame displacement s / time interval t. The electronic device can then determine the exposure time tl of the long exposure frame, and thus determine the movement distance of the pixel during the long exposure frame capture as v * tl. The movement distance of the pixel in the long exposure frame indicates the amount of camera displacement during the long exposure frame capture, which is also the amount of displacement of the target being captured during the long exposure frame capture.
[0095] ④ Solve for the homography matrix
[0096] Since there may be mismatches in the feature point pairs matched in step ③, resulting in two feature points indicating different shooting positions being matched, the electronic device 100 can further solve the homography matrix and determine the feature point pairs that meet the homography assumption in the feature point pairs matched in step ③ based on the homography matrix H.
[0097] Let (x) i y i (x′) is the feature point with index i on the long exposure frame. i y′ i ) is the reference frame with respect to the i-th feature point (x) i yi If we have matching feature points, where i is a positive integer, then we should have:
[0098]
[0099] Electronic device 100 can solve for the homography matrix H based on the feature point pairs identified in step ③. Since there are misclassified feature point pairs, not all feature point pairs can be used to solve for the homography matrix H. Electronic device 100 can set a loss function or derive the optimal homography matrix based on the random sample consensus (RANSAC) algorithm. It is not limited to the above methods; other methods can also be used to solve for the optimal homography matrix, and this application embodiment does not impose any limitations on this. The aforementioned optimal homography matrix is also the homography matrix that satisfies the correspondence of a larger number of feature point pairs. When a pair of feature points satisfies... This can also be described as the feature point pair conforming to the homography assumption. Thus, the electronic device 100 can determine the feature point pairs conforming to the homography assumption from the feature point pairs determined in step ②. A pair of feature points conforming to the homography assumption means that the two feature points point to the same plane in the image, or that the two feature points are coplanar. It can be understood that a feature point in the long exposure frame conforming to the homography assumption with a feature point in the reference frame means that the feature point in the long exposure frame and its corresponding feature point in the reference frame point to the same location on the same plane. In this way, the electronic device 100 determines the number of coplanar feature points among the matching feature points in the reference frame and the long exposure frame.
[0100] Furthermore, the electronic device 100 can determine the image features of coplanar feature points matching the reference frame and the long exposure frame. Since the reference frame and the long exposure frame underwent brightness alignment in step ①, the signal-to-noise ratio (SNR) of the two image frames may be different. This could affect the accuracy of subsequent comparisons of the image features of the two image frames due to the different SNR. In some embodiments, the electronic device 100 can process the reference frame or the long exposure frame to help better determine the feature differences between the two image frames. Specifically, the electronic device can calculate the noise level when the electronic device 1 captures the reference frame and the noise level when capturing the long exposure frame based on a device noise model. The formula for the aforementioned device noise model could be, for example, N = var_s + var_r. Here, N is the noise level, var_s is the photon noise value, and var_r is the readout noise value. Let the noise level of the reference frame at the corresponding ISO be N1, and the noise level of the long exposure frame at the corresponding ISO be N2, then the noise figure... The electronic device 100 can multiply the pixel value of each pixel in the long exposure frame by a noise coefficient k1, so that the signal-to-noise ratio (SNR) of the long exposure frame after the above processing is the same as that of the reference frame. The values of N1 and N2 can be pre-stored in the electronic device or stored in a cloud server; this embodiment does not impose any limitations on this. The electronic device can pre-store the magnitudes of photon noise and readout noise at various ISOs, or it can pre-store the total noise magnitude of camera shots at various ISOs. This allows for direct reading of the noise value corresponding to the ISO of the image frame when balancing the SNR. Photon noise is caused by the randomness of photons reaching the photosensitive sensor, leading to a difference between the actual and theoretical value of the number of photons reaching the sensor. Readout noise refers to the noise generated when the electronic device reads the charge stored in a pixel, causing errors in the camera's measurement of the number of photons per pixel. The readout noise follows a Gaussian distribution with a mean of 0 and a variance of σ.
[0101] The photon noise value mentioned above can be measured under bright light, while the readout noise value can be measured under dark conditions (e.g., when the camera is covered by a cover). Taking the measurement of readout noise as an example, the electronic device can capture multiple frames (e.g., 1000 frames) of images at a certain ISO in dark conditions. This way, multiple values are collected for each pixel in the image frame. The electronic device 100 can determine the magnitude of the readout noise at that ISO based on the standard deviation of the multiple values read from each pixel. Alternatively, the electronic device can subtract the pixel values of multiple pixels in two image frames and calculate the variance of the difference, using this variance to determine the magnitude of the readout noise at that ISO. Similarly, the electronic device 100 can change the environment in which the camera is located and then determine the photon noise value using the above calculation methods.
[0102] The methods described above are not limited to measuring readout noise and photon noise. Other methods can also be used to measure the values of readout noise and photon noise. This application does not limit the method used by the electronic device 100 to measure readout noise and photon noise at a certain ISO.
[0103] Not limited to readout noise and photon noise, the electronic device 100 may introduce more or less noise for calculation when calculating the noise level at a certain ISO, such as dark noise, ADC noise, etc. This application embodiment does not limit this. Furthermore, not limited to the above-mentioned device noise model for noise quantization, the electronic device 100 may also use other models for noise quantization, and this application embodiment does not limit this.
[0104] The electronic device 100 can measure the noise level at multiple ISOs and store it in a memory or cloud server. This allows the electronic device to determine the ISO of an image frame and directly read the noise level corresponding to that ISO, thus balancing the signal-to-noise ratio of the two image frames based on their respective noise levels.
[0105] Figure 7 This is a schematic diagram illustrating the effect of signal-to-noise ratio balancing on an image. For example... Figure 7 As shown, for ease of description and better understanding, a partial image is selected from the entire image as an example. It can be seen that, without balancing the signal-to-noise ratios of the reference frame and the long-exposure frame, the different signal-to-noise ratios of the reference frame and the long-exposure frame cause the pixels in the two images to be affected by noise to varying degrees when calculating the gradient. Figure 7 In the example, the gradient values of pixels in the long exposure frame are less affected by noise, while the gradient values of pixels in the reference frame are more affected by noise. This makes it impossible to correctly compare the gradient differences of feature points between the two image frames. To reduce the influence of noise on the gradient values of feature points in the two image frames, the electronic device 100 can multiply the pixel value of each feature point in the long exposure frame by a noise coefficient k1. The processed local image of the long exposure frame shows that the gradient values of pixels in the image are closer to the gradient values of pixels in the reference frame, making it easier to compare the differences between the two.
[0106] Furthermore, the electronic device 100 can perform gradient calculations on the long-exposure frame and the reference frame. Specifically, the electronic device 100 can use one or more operators to calculate the gradient value of each pair of coplanar feature points in the long-exposure frame and the reference frame. For example, the electronic device 100 can calculate the gradient value of each feature point based on the Sobel operator, the Laplacian operator, and the Entropy operator. The formula for calculating the gradient value of a feature point can be: gradient value f_sharpness = a * f_sobel + b * f_laplacian + c * f_entropy. Here, f_sobel is the gradient value of the feature point calculated by the electronic device based on the Sobel operator, f_Laplacian is the gradient value of the feature point calculated by the electronic device based on the Laplacian operator, and f_entropy is the gradient value of the feature point calculated by the electronic device based on the Entropy operator. a, b, and c can be non-negative numbers, where a, b, and c are not all simultaneously 0. Not limited to the Sobel, Laplacian, and Entropy operators, the electronic device 100 can also calculate the gradient values of feature points based on other operators, and this application embodiment does not limit this. After calculating the gradient value of each coplanar feature point in the image frame, the electronic device 100 can subtract the gradient values of each pair of coplanar feature points in the long exposure frame and the reference frame to obtain the gradient difference of each pair of coplanar feature points. Furthermore, the electronic device 100 can use the sum of the gradient differences of all coplanar feature points as the gradient difference of all feature points matched between the reference frame and the long exposure frame. Not limited thereto, the electronic device 100 can also use the sum of the gradient differences of all coplanar feature point pairs divided by the number of coplanar feature point pairs as the gradient difference of all feature points matched between the reference frame and the long exposure frame, or the electronic device can use the sum of the squares of the gradient differences of all coplanar feature points as the gradient difference of all feature points matched between the long exposure frame and the reference frame, and this application embodiment does not limit this.
[0107] In addition to determining the image feature difference between the reference frame and the long exposure frame based on the gradient difference of coplanar feature points, the electronic device 100 can also determine the image feature difference between the reference frame and the long exposure frame based on the gradient difference of other feature point pairs (including feature point pairs that do not satisfy the homography assumption) obtained in step ③. The above two types of feature point pairs can be used together or used separately, and this application embodiment does not limit this.
[0108] ⑤ Determine whether a long exposure frame is blurry based on one or more parameters.
[0109] Finally, the electronic device 100 can determine whether the long exposure frame is blurred based on one or more of the parameters (also referred to as the first parameters) obtained in the above steps. The first parameters may include: the number of feature points matched between the reference frame and the long exposure frame, the difference between the number of feature points matched between the reference frame, the long exposure frame, and the reference frame, the displacement of the target being photographed during the long exposure frame shooting, the number of coplanar feature points matched between the reference frame and the long exposure frame, and the gradient difference between the coplanar feature points matched between the reference frame and the long exposure frame, etc.
[0110] The electronic device 100 can determine whether a long exposure frame is blurred based on one or more of the aforementioned parameters. The relationship between these parameters and whether a long exposure frame is blurred may include:
[0111] The fewer feature points the reference frame matches the long exposure frame, the blurrier the long exposure frame is. This means that the more blurred the long exposure frame, the less distinct the edges of the subject in the image, and the fewer feature points the electronic device can recognize. Consequently, the long exposure frame can match fewer feature points with the reference frame, and vice versa. Figures 8A-8B As shown, Figure 8A A long exposure frame without any blurring. Figure 8B The image shows a long exposure frame with blurriness. It can be seen that when a long exposure frame is blurry, the electronic device can identify fewer feature points, and therefore the number of feature points that match between the reference frame and the long exposure frame is also fewer. Similarly, the blurrier the long exposure frame, the fewer coplanar feature points that can be matched between the long exposure frame and the reference frame.
[0112] The greater the difference between the number of feature points matched in the reference frame and the long exposure frame and the number of feature points matched in the reference frame and the comparison frame, the blurrier the long exposure frame will be. This means that the sharper the long exposure frame, the closer the edge sharpness of the image in the comparison frame will be to the long exposure frame. Consequently, the closer the number of feature points matched in the reference frame and the comparison frame is to the number of feature points matched in the long exposure frame and the reference frame, the smaller the difference between the number of feature points matched in the reference frame and the long exposure frame and the number of feature points matched in the reference frame and the comparison frame. Conversely, the greater the difference, the blurrier the long exposure frame will be.
[0113] The amount of displacement of the subject during long exposure frame shooting results in a more blurred image. In simpler terms, the more the camera moves during long exposure frame shooting, the greater the displacement of the subject, and consequently, the more displacement one or more pixels of the subject will experience, leading to a more blurred image. Conversely, the less displacement, the less blurred the image.
[0114] The greater the difference in image features between the coplanar feature points matched between the reference frame and the long exposure frame, the blurrier the long exposure frame will be. This can be understood as follows: the sharper the long exposure frame, the closer the changes in pixel values around each pixel in its image are to the reference frame. Therefore, the gradient values of the matched feature points in the long exposure frame are closer to the gradient values of the matched feature points in the reference frame, and the smaller the difference in image features between the coplanar feature points matched between the reference frame and the long exposure frame. In other words, the overall gradient difference between the coplanar feature points matched between the reference frame and the long exposure frame is smaller. Conversely, the less sharp the long exposure frame, the blurrier it will be.
[0115] Electronic device 100 can determine whether a long exposure frame is blurred based on one or more of the aforementioned rules. For example, electronic device 100 can determine whether a long exposure frame is blurred based on one or more of the following conditions: when the proportion of feature points matching the reference frame and the long exposure frame to the total number of identified feature points is lower than a certain threshold, the long exposure frame is blurred; when the ratio of the number of feature points matching the reference frame and the long exposure frame to the number of feature points matching the reference frame and the comparison frame is lower than a certain proportion, the long exposure frame is blurred; when the displacement of the photographed target exceeds a certain distance threshold during the long exposure frame shooting, the long exposure frame is blurred; when the proportion of coplanar feature points matching the reference frame and the long exposure frame to the total number of identified feature points is lower than a certain threshold, the long exposure frame is blurred; when the ratio of the image features of coplanar feature points matching the reference frame and the long exposure frame is lower than a certain proportion, the long exposure frame is blurred, and so on. Wherein, the electronic device can determine that the long exposure frame is blurred when all conditions are met, or when some conditions are met, the electronic device can determine that the long exposure frame is blurred. In some embodiments, the electronic device 100 may determine whether a long exposure frame is blurred based on a decision tree method. This application embodiment does not limit the method by which the electronic device 100 determines whether a long exposure frame is blurred based on the above rules.
[0116] In some embodiments, during HDR shooting, when the electronic device 100 determines that the long exposure frame is blurred based on the above process, it may not generate a photo based on the long exposure frame, but instead based on the medium and short exposure frames. When the electronic device 100 determines that the long exposure frame is not blurred based on the above process, it can generate a photo based on the long exposure frame, medium exposure frame, and short exposure frame. Figure 9A , Figure 9B As shown, Figure 9A This is a photograph generated by electronic device 100 based on medium and short exposure frames when a long exposure frame is blurry. Figure 9B This diagram illustrates how an electronic device can still generate photos based on long, medium, and short exposure frames even when the long exposure frame is blurry. It shows that when the long exposure frame is blurry, the electronic device does not use that blurry long exposure frame, and the photos generated using only the medium and short exposure frames are clearer.
[0117] In some embodiments, during HDR shooting, the electronic device 100 can capture multiple long exposure frames, and then select the long exposure frame with higher sharpness based on the above process to participate in image fusion, thereby generating a photo with higher sharpness. The electronic device can determine the long exposure frame with the highest sharpness based on a first parameter.
[0118] The method for identifying whether a long exposure frame is clear, as described above, is not limited to HDR shooting. It can also be used in other image processing processes, and the embodiments of this application do not limit this.
[0119] In some embodiments, one or both of the aforementioned reference frames and comparison frames may also be short exposure frames, and medium exposure frames are not necessarily used to identify whether long exposure frames are blurry.
[0120] The process is not limited to identifying whether long exposure frames are blurry. It can also be used to identify other types of image frames in the shooting sequence. For example, it can also be used to identify whether medium exposure frames and short exposure frames are blurry. For example, an electronic device can replace the long exposure frames in the above process with image frames in the HDR shooting sequence that are taken at a time far from the reference frame (e.g., medium exposure frame 4) to determine whether the medium exposure frame is blurry.
[0121] The following describes the photographing method provided in the embodiments of this application, such as... Figure 10 As shown, this method of taking photos may include, but is not limited to, the following steps:
[0122] S1001, The electronic device initiates high dynamic range imaging (HDR) shooting, acquiring multiple image frames with different exposure times. The multiple image frames include a first image frame and a second image frame, where the exposure time of the first image frame is longer than that of the second image frame.
[0123] An electronic device can initiate HDR shooting, thereby generating a series of multiple image frames with different exposure times according to a preset rule. This series of multiple image frames with different exposure times generated according to a preset rule (i.e., in sequence) can also be called a shooting sequence. For example, the shooting sequence may include a medium exposure frame, a medium exposure frame, a medium exposure frame, a short exposure frame, a medium exposure frame, a short exposure frame, and a long exposure frame; that is, after receiving a shooting command, the electronic device 100 can sequentially capture medium exposure frames, medium exposure frames, medium exposure frames, short exposure frames, medium exposure frames, short exposure frames, and long exposure frames. However, this is not a limitation; the shooting sequence may also contain more or fewer image frames, and the image frames with different exposure times may be arranged in other orders. This application embodiment does not impose any restrictions on this. The multiple image frames may include a first image frame and a second image frame. The first image frame may be a long exposure frame in the shooting sequence that is to be detected as blurry. The second image frame may also be called a reference frame, which may be a medium exposure frame in the shooting sequence (e.g., the first medium exposure frame in the shooting sequence), or the second image frame may be a short exposure frame.
[0124] S1002. The electronic device determines whether the first image frame is blurry based on the first parameter. If the first image frame is blurry, the electronic device generates a photo based on the first image frame. If the first image frame is not blurry, the electronic device generates a photo based on the first image frame and the second image frame.
[0125] The electronic device can determine whether the first image frame is blurry based on a first parameter, wherein the first parameter may include one or more of the following: the deviation of feature points between the first image frame and the second image frame, the difference in the image change trend between the first image frame and the second image frame, and the displacement of the target being photographed during the shooting of the first image frame.
[0126] When the first image frame is blurry, the electronic device can generate a photograph based on one or more of the second image frame, other medium-exposure frames, and short-exposure frames. When the first image frame is not blurry, the electronic device can generate a photograph based on one or more of the first image frame, the second image frame, other medium-exposure frames, and short-exposure frames. (Reference) Figure 9A , Figure 9B The illustrated embodiments, such as Figure 9B As shown, if an electronic device still generates a photo based on a blurry long exposure frame, the resulting photo will also be blurry. Therefore, when the electronic device 100 determines that the long exposure frame is blurry, it can omit the blurry long exposure frame when generating the photo, resulting in a clearer image. Figure 9A As shown.
[0127] In some embodiments, the deviation of feature points between the first image frame and the second image frame includes the number of matching feature points between the first image frame and the second image frame. The method for the electronic device to identify and match feature points of the first image frame (long exposure frame) and the second image frame (reference frame) can refer to the foregoing. Figure 4 The process illustrated will not be repeated here. Specifically, the more blurred the first image frame, the fewer feature points are matched between the first and second image frames.
[0128] In some embodiments, the multiple image frames include a third image frame, the exposure time of the third image frame is longer than the exposure time of the second image frame, and the deviation of the feature points of the first image frame and the second image frame includes the difference between the first number of feature points matched in the first image frame and the third image frame and the second number of feature points matched in the second image frame and the third image frame.
[0129] The electronic device can determine the ratio of the number of feature points matching in the first image frame and the second image frame to the total number of feature points identified in either the first or second image frame. If this ratio is less than a certain threshold, the first image frame is blurred. Alternatively, the electronic device can determine the number of feature points matching in the first image frame and the second image frame. If this number is less than a certain threshold, the first image frame is blurred.
[0130] The third image frame can also be called a comparison frame. The third image frame can be, for example, a medium-exposure frame closest to the long-exposure frame in the shooting sequence, or other medium-exposure or short-exposure frames. Because medium-exposure frames have a moderate exposure time, they contain more information than short-exposure frames, making them more suitable for determining the blur detection process of long-exposure frames. The greater the difference between the first quantity and the second quantity, the more blurred the first image frame. For example, the electronic device can subtract the first quantity from the second quantity to determine the difference. When the result of the subtraction is less than a certain preset threshold, it indicates that the first image frame is blurred. Alternatively, the electronic device can divide the first quantity from the second quantity and determine the difference based on the relationship between the division result and 1. For example, when the absolute value of the difference between the division result and 1 is greater than a certain threshold, it indicates that the first image frame is blurred; this embodiment does not impose limitations on this.
[0131] In some embodiments, the multiple image frames include a fourth image frame and a fifth image frame, the exposure time of the fourth image frame and the fifth image frame is less than the exposure time of the first image frame. Before the electronic device determines whether the first image frame is blurred based on the first parameter, the method further includes: the electronic device determining the inter-frame displacement between the fourth image frame and the fifth image frame based on the displacement of matching feature points in the fourth image frame and the fifth image frame; the electronic device determining the displacement rate based on the inter-frame displacement and the inter-frame interval, the inter-frame interval being the time difference between the electronic device acquiring the fourth image frame and the fifth image frame; and the electronic device determining the displacement of the target being photographed during the shooting of the first image frame based on the displacement rate and the exposure time of the first image frame.
[0132] In this embodiment, the fourth and fifth image frames can be two image frames with the same exposure time, so that their brightness is similar, which facilitates the matching of their feature points and the calculation of inter-frame displacement. For example, the fourth image frame can be the reference frame mentioned in the previous embodiment, which can be the first medium-exposure frame in the shooting sequence, and the fifth image frame can be the comparison frame mentioned in the previous embodiment, which can be the medium-exposure frame closest to the long-exposure frame in the shooting sequence. However, this is not a limitation; the fourth and fifth image frames can also be other image frames in the shooting sequence. The electronic device can determine the inter-frame displacement based on the displacement of the matched feature points in the fourth and fifth image frames, and then determine the displacement rate. Finally, the electronic device can determine the displacement of the target being photographed during the shooting process (i.e., the exposure process) of the first image frame based on the displacement rate of the fourth and fifth image frames. The method for the electronic device to determine the displacement of the target being photographed during the shooting process of the first image frame based on the displacement rate of the fourth and fifth image frames can be referred to... Figure 4 The method for determining the displacement of the target during the long exposure frame shooting process in the illustrated embodiment based on the displacement rates of the reference frame and the comparison frame is not described in detail here. The greater the displacement of the target during the first image frame shooting process, the more blurred the first image frame becomes.
[0133] In some embodiments, after the electronic device acquires multiple image frames with different exposure times, the method further includes: the electronic device dividing the first image frame and the second image frame into multiple regions respectively; and the electronic device determining feature points in each region of the first image frame and the second image frame.
[0134] refer to Figure 6 In the embodiment shown, the electronic device 100 can divide an image frame into multiple regions and then detect feature points sequentially in each region. This avoids the detected feature points being concentrated in local areas of the image frame, which would prevent the detected feature points from reflecting the features of the entire image and affecting the accuracy of subsequent detection of whether long-exposure frames are blurred.
[0135] In some embodiments, the feature points matched in the first image frame and the second image frame are coplanar. That is, the electronic device can determine whether the first image frame is blurry based on the coplanar feature points among the feature points matched in the first image frame and the second image frame. The more coplanar feature points matched in the first image frame and the second image frame, the clearer the first image frame will be.
[0136] In some embodiments, the difference in image change trends between the first image frame and the second image frame includes the difference in gradient values of the matching feature points between the first image frame and the second image frame. The method further includes: the electronic device processing the pixel values of the pixels in the first image frame, and the signal-to-noise ratio of the first image frame after processing is the same as that of the second image frame; the electronic device determining the difference in gradient values of the matching feature points between the first image frame and the second image frame after processing.
[0137] refer to Figure 7 In the illustrated embodiment, before comparing the gradients of feature points in the first and second image frames, the electronic device can process the first image frame by multiplying the pixel value of each pixel in the first image frame by a noise coefficient k1. The calculation method for the noise coefficient k1 can be referred to the aforementioned embodiment and will not be repeated here. After processing, the signal-to-noise ratio of the first and second image frames is the same, which allows for a better comparison of the image change differences between the two image frames and avoids the noise difference between the two image frames affecting the calculation result of the pixel value change trend (represented by the image gradient value) around the feature points. The method for the electronic device 100 to calculate the image gradient value can be referred to the description in the aforementioned embodiment and will not be repeated here. The greater the difference in gradient values of the matching feature points between the first and second image frames, that is, the greater the difference in image features between the first and second image frames, the more blurred the first image frame will be. The calculation method for the difference in image features of the matching feature points between the first and second image frames can be referred to the description in the aforementioned embodiment and will not be repeated here.
[0138] In some embodiments, before the electronic device initiates high dynamic range (HDR) imaging, the method further includes: the electronic device displaying a camera interface, the camera interface including a shutter button; the electronic device receiving a first operation to initiate HDR imaging; and the electronic device detecting a second operation applied to the shutter button.
[0139] refer to Figure 1B In the illustrated embodiment, the electronic device 100 displays a camera interface 103. The first operation is used to enable HDR shooting. When HDR shooting is enabled, the electronic device can generate a photo based on multiple image frames with different exposure times; when HDR shooting is disabled, the electronic device can generate a photo based on an image frame with a single exposure time (such as a medium exposure frame). The electronic device can initiate HDR shooting in response to the first operation of enabling HDR shooting. Further, as... Figure 1CAs shown, the electronic device 100 detects the operation of the shutter button 105. In response to the operation, the electronic device 100 can perform HDR shooting and capture a series of image frames with different exposure times based on a preset rule.
[0140] The apparatus for performing the above method provided in the embodiments of this application will now be described. Figure 11 As shown, Figure 11 This is a schematic diagram of a photographing device provided in an embodiment of this application. The communication device may be the electronic device in the embodiment of this application, or a chip or chip system within an electronic device.
[0141] The photographing device may include an image acquisition unit 1101 and a processing unit 1102.
[0142] The processing unit 1102 is used to initiate high dynamic range (HDR) imaging. The image acquisition unit 1101 is used to acquire multiple image frames with different exposure times after HDR imaging is enabled. The multiple image frames include a first image frame and a second image frame, where the exposure time of the first image frame is longer than that of the second image frame. The processing unit 1102 is used to determine whether the first image frame is blurred based on a first parameter. If the first image frame is blurred, the processing unit 1102 generates a photograph based on the second image frame. If the first image frame is not blurred, the processing unit 1102 generates a photograph based on the first image frame and the second image frame. The first parameter includes one or more of the following: the deviation of feature points between the first image frame and the second image frame, the difference in image change trends between the first image frame and the second image frame, and the displacement of the target being photographed during the first image frame imaging process.
[0143] In some embodiments, the multiple image frames include a fourth image frame and a fifth image frame, and the exposure time of the fourth image frame and the fifth image frame is less than the exposure time of the first image frame. Before the processing unit 1102 determines whether the first image frame is blurred based on the first parameter, the method further includes: the processing unit 1102 determining the inter-frame displacement between the fourth image frame and the fifth image frame based on the displacement of the matching feature points in the fourth image frame and the fifth image frame; the processing unit 1102 determining the displacement rate based on the inter-frame displacement and the inter-frame interval, where the inter-frame interval is the time difference between the acquisition unit 1101 acquiring the fourth image frame and the fifth image frame; and the processing unit 1102 determining the displacement of the target being photographed during the capture of the first image frame based on the displacement rate and the exposure time of the first image frame.
[0144] In some embodiments, after the processing unit 1102 acquires multiple image frames with different exposure times, it further includes: the processing unit 1102 divides the first image frame and the second image frame into multiple regions respectively; the processing unit 1102 determines feature points in each region of the first image frame and the second image frame.
[0145] In some embodiments, the processing unit 1102 is further configured to process the pixel values of the pixels in the first image frame, such that the signal-to-noise ratio of the first image frame after processing is the same as that of the second image frame; the processing unit 1102 is further configured to determine the difference in gradient values of the matching feature points between the processed first image frame and the second image frame.
[0146] In some embodiments, the imaging device 1100 further includes a display unit 1103 and an operation receiving unit 1104. Before the processing unit 1102 initiates high dynamic range (HDR) imaging, it further includes: the display unit 1103 displaying an imaging interface, which includes a shutter button; the operation receiving unit 1104 receiving a first operation to initiate HDR imaging; and the operation receiving unit 1104 detecting a second operation performed on the shutter button.
[0147] Figure 12 This is a schematic diagram of the structure of a chip provided in an embodiment of this application. Figure 12 As shown, chip 1200 includes one or more (including two) processors 1201, communication lines 1202 and communication interfaces 1203. Optionally, chip 1200 also includes a memory 1204.
[0148] In some implementations, memory 1204 stores elements such as executable modules or data structures, or subsets thereof, or extended sets thereof.
[0149] The methods described in the embodiments of this application can be applied to or implemented by the processor 1201. The processor 1201 may be an integrated circuit chip with signal processing capabilities. In implementation, each step of the above method can be completed by the integrated logic circuit in the hardware of the processor 1201 or by instructions in the form of software. The processor 1201 may be a general-purpose processor (e.g., a microprocessor or conventional processor), a digital signal processor, an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gates, transistor logic devices, or discrete hardware components. The processor 1201 can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application.
[0150] The steps of the method disclosed in the embodiments of this application can be directly implemented by a hardware decoding processor, or implemented by a combination of hardware and software modules in the decoding processor. The software modules can be located in mature storage media in the art, such as random access memory, read-only memory, programmable read-only memory, or electrically erasable programmable read-only memory (EEPROM). This storage medium is located in memory 1204, and processor 1201 reads information from memory 1204 and, in conjunction with its hardware, completes the steps of the above method.
[0151] The processor 1201, memory 1204 and communication interface 1203 can communicate with each other via communication line 1202.
[0152] In the above embodiments, the instructions stored in the memory for execution by the processor can be implemented in the form of a computer program product. This computer program product can be pre-written into the memory, or it can be downloaded and installed into the memory as software.
[0153] This application also provides a computer program product comprising one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the flow or function according to the embodiments of this application is generated. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that a computer can store or a data storage device such as a server or data center that integrates one or more available media. For example, available media may include magnetic media (e.g., floppy disk, hard disk, or magnetic tape), optical media (e.g., digital versatile disc (DVD)), or semiconductor media (e.g., solid-state disk (SSD)).
[0154] This application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program or instructions. When the computer program or instructions are executed by a processor, they implement the methods described above. The methods described in the above embodiments can be implemented wholly or partially by software, hardware, firmware, or any combination thereof. If implemented in software, the functionality can be stored as one or more instructions or code on or transmitted over the computer-readable medium. The computer-readable medium can include computer storage media and communication media, and can also include any medium that can transfer a computer program from one place to another. The storage medium can be any target medium accessible by a computer.
[0155] As one possible design, computer-readable media may include compact disc read-only memory (CD-ROM), RAM, ROM, EEPROM, or other optical disc storage; computer-readable media may include disk storage or other disk storage devices. Furthermore, any connecting cable may also be appropriately referred to as computer-readable media. For example, if software is transmitted from a website, server, or other remote source using coaxial cable, fiber optic cable, twisted pair, DSL, or wireless technologies such as infrared, radio, and microwave, then coaxial cable, fiber optic cable, twisted pair, DSL, or wireless technologies such as infrared, radio, and microwave are included in the definition of media. As used herein, disks and optical discs include optical discs (CD), laser discs, optical discs, DVDs, floppy disks, and Blu-ray discs, where disks typically reproduce data magnetically, while optical discs optically reproduce data using lasers. Combinations of the above should also be included within the scope of computer-readable media.
[0156] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit it. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application.
[0157] As used in the above embodiments, depending on the context, the term "when..." can be interpreted as meaning "if...", "after...", "in response to determining...", or "in response to detecting...". Similarly, depending on the context, the phrase "when determining..." or "if (the stated condition or event) is interpreted as meaning "if determining...", "in response to determining...", "when (the stated condition or event) is detected", or "in response to detecting (the stated condition or event)".
[0158] In the above embodiments, implementation can be achieved entirely or partially through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented entirely or partially 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, all or part of the processes or functions described in the embodiments of this application are generated. 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. 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 wired (e.g., coaxial cable, fiber optic, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) means. 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 integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid-state drive), etc.
[0159] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. This program can be stored in a computer-readable storage medium, and when executed, it can include the processes described in the above 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 method for taking photos, characterized in that, The method is applied to an electronic device, and the method includes: The electronic device initiates high dynamic range imaging (HDR) shooting to acquire multiple image frames with different exposure times. The multiple image frames include a first image frame and a second image frame, wherein the exposure time of the first image frame is longer than the exposure time of the second image frame. The electronic device determines whether the first image frame is blurry based on the first parameter. If the first image frame is blurry, the electronic device generates a photo based on the second image frame. If the first image frame is not blurry, the electronic device generates a photo based on the first image frame and the second image frame. The first parameter includes one or more of the following: the deviation of feature points between the first image frame and the second image frame, the difference in gradient values of the matching feature points between the first image frame and the second image frame, and the displacement of the target being photographed during the shooting of the first image frame.
2. The method according to claim 1, characterized in that, The deviation of feature points between the first image frame and the second image frame includes the number of matching feature points between the first image frame and the second image frame.
3. The method according to claim 2, characterized in that, The relationship between the number of matching feature points between the first image frame and the second image frame and whether the first image frame is blurry includes: the fewer the number of matching feature points between the first image frame and the second image frame, the more blurry the first image frame is.
4. The method according to any one of claims 1-3, characterized in that, The plurality of image frames includes a third image frame, the exposure time of the first image frame is longer than the exposure time of the third image frame, and the deviation of feature points between the first image frame and the second image frame includes the difference between the first number of feature points matched by the first image frame and the third image frame and the second number of feature points matched by the second image frame and the third image frame.
5. The method according to claim 4, characterized in that, The relationship between the difference between the first quantity and the second quantity and whether the first image frame is blurry includes: the greater the difference between the first quantity and the second quantity, the more blurry the first image frame is.
6. The method according to any one of claims 1-5, characterized in that, The plurality of image frames includes a fourth image frame and a fifth image frame, wherein the exposure time of the fourth image frame and the fifth image frame is less than the exposure time of the first image frame, and before the electronic device determines whether the first image frame is blurred based on a first parameter, the method further includes: The electronic device determines the inter-frame displacement between the fourth image frame and the fifth image frame based on the displacement of the matching feature points in the fourth image frame and the fifth image frame; The electronic device determines the displacement rate based on the inter-frame displacement and the inter-frame interval, wherein the inter-frame interval is the time difference between the electronic device acquiring the fourth image frame and the fifth image frame; The electronic device determines the displacement of the target being photographed during the capture of the first image frame based on the displacement rate and the exposure time of the first image frame.
7. The method according to claim 6, characterized in that, The relationship between the displacement of the target being photographed during the capture of the first image frame and whether the first image frame is blurred includes: the greater the displacement of the target being photographed during the capture of the first image frame, the more blurred the first image frame is.
8. The method according to claim 7, characterized in that, The exposure times of the fourth image frame and the fifth image frame are equal.
9. The method according to any one of claims 1-8, characterized in that, After the electronic device acquires multiple image frames with different exposure times, the method further includes: The electronic device divides the first image frame and the second image frame into multiple regions respectively; The electronic device determines feature points within each region of the first image frame and the second image frame.
10. The method according to any one of claims 1-9, characterized in that, The feature points matched in the first image frame and the second image frame are coplanar.
11. The method according to any one of claims 1-10, characterized in that, Before the electronic device determines whether the first image frame is blurred based on the first parameter, the method further includes: The electronic device processes the pixel values of the pixels in the first image frame, and the signal-to-noise ratio of the first image frame is the same as that of the second image frame after processing. The electronic device determines the difference in gradient values of the feature points that match the first image frame and the second image frame after processing.
12. The method according to claim 11, characterized in that, The relationship between the gradient value difference of the feature points matched between the first image frame and the second image frame and whether the first image frame is blurry includes: the greater the gradient value difference of the feature points matched between the first image frame and the second image frame, the more blurry the first image frame is.
13. The method according to any one of claims 1-12, characterized in that, Before the electronic device initiates high dynamic range (HDR) imaging, the method further includes: The electronic device displays a camera interface, which includes a shutter button. The electronic device receives the first operation to initiate HDR shooting; The electronic device detects a second operation performed on the shutter button.
14. An electronic device, characterized in that, The electronic device includes: a memory and a processor coupled to the memory; the memory stores a computer program, and when the processor executes the computer program, it causes the electronic device to perform the method as described in any one of claims 1 to 13.
15. A computer-readable storage medium storing computer instructions, characterized in that, When the computer instructions are executed on an electronic device, the electronic device causes the electronic device to perform the method as described in any one of claims 1 to 13.
16. A computer program product comprising computer instructions, characterized in that, When the computer instructions are executed by the processor, they implement the method of any one of claims 1 to 13.