Image processing method and device
By providing an image processing method and device in the long exposure photography function, the user allows flexibly setting the shutter time and automatically processing the image sequence, solving the problem of single photography operation in the prior art, and achieving a more efficient and flexible shooting effect.
Patent Information
- Application Number
- CN202311658516.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-05
- Publication Date
- 2025-04-29
- Estimated Expiration
- 2043-12-05
AI Technical Summary
In the long exposure photography function, the photography operation is relatively simple, making it difficult for users to set the shutter time flexibly, resulting in poor shooting results.
An image processing method and device are provided, through a display interface, allowing the user to set a shutter time, automatically acquire an image sequence in response to a user's operation, and perform image fusion processing to generate a target image.
It realizes flexible setting of shutter time in the long exposure photography function, simplifies the photography process, and improves the flexibility and quality of the shooting effect.
Smart Images

Figure CN118474525B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of terminal technology, and in particular to an image processing method and device. Background Art
[0002] With the popularization and development of the Internet, people's functional requirements for electronic devices are becoming more and more diverse. Camera applications can support different camera functions, such as portrait camera function, night scene camera function, or long exposure camera function for capturing motion trajectories. In different camera functions, different image processing is performed on the subject to obtain a camera image that better meets user needs.
[0003] However, in the long exposure photography function, the photography operation is relatively simple. Summary of the invention
[0004] The embodiments of the present application provide an image processing method and device, which are applied to the field of terminal technology, so that a user can flexibly set the shutter time in a long-exposure photography function according to photography requirements.
[0005] In a first aspect, an embodiment of the present application provides an image processing method. The method includes: displaying a first interface, the first interface including: a photo button and a first button for setting a shutter time; in response to an operation on the first button, displaying a second button for setting a shutter time; in a case where the shutter time is set to a first duration based on the second button, in response to an operation on the photo button, acquiring an image sequence within the first duration; performing image fusion processing on images in the image sequence to obtain a target image.
[0006] The first interface can be Figure 4 In the interface shown in b, the photo button may be the photo button 402, the first button may be the button 403, and the second button may be Figure 4 The button in the progress bar 404 in the interface shown in c.
[0007] When the image sequence is the first image sequence described in the embodiment of the present application, the target image may be the first long exposure photographed image described in the embodiment of the present application; when the image sequence is the second image sequence described in the embodiment of the present application, the target image may be the second long exposure photographed image described in the embodiment of the present application; when the image sequence is the third image sequence described in the embodiment of the present application, the target image may be the third long exposure photographed image described in the embodiment of the present application.
[0008] The electronic device can conveniently set the shutter duration in the long exposure photography scene through the first button and the second button. For example, when the first duration is 0.5 hours, in response to the user's triggering operation on the photography button, the electronic device automatically ends the photography process after acquiring the image sequence within 0.5 hours, without triggering the end photography button, making the entire photography process more flexible and concise.
[0009] In one possible implementation, an image sequence includes: a first image and a second image, and image fusion processing is performed on the images in the image sequence to obtain a target image, including: adding brightness values at the same position in the first image and the second image to obtain a third image; obtaining the maximum value of the brightness values at the same position in the third image and the second image to obtain the target image.
[0010] In the scene of shooting busy traffic and light painting graffiti, the first image may be the calculation result of the previous frame described in the embodiment of the present application, the second image may be the current image described in the embodiment of the present application, and the third image may be the accumulated result obtained by nonlinearly adding the calculation results of the current image and the previous frame.
[0011] For example, see Figure 7 as well as Figure 8 When the first image is image A and the second image is image B, the third image may be sumAB and the target image may be image B'; when the first image is image B' and the second image may be image C, the third image may be sumABC and the target image may be image C'; when the first image is image C' and the second image may be image D, the third image may be sumABCD and the target image may be image D'.
[0012] The electronic device can obtain the motion trajectory of each image by adding the brightness values, and calculate the brightness of the retained image by the maximum brightness value between the two images, so that the target image can reflect the trajectory of the moving object and retain the appropriate brightness range.
[0013] In a possible implementation, before adding the brightness values at the same position in the first image and the second image, the method also includes: performing brightness correction processing on any image in the image sequence to obtain a brightness-corrected image sequence, the brightness correction processing is used to reduce the brightness of the image, and the brightness-corrected image sequence includes: a brightness-corrected first image and a brightness-corrected second image; adding the brightness values at the same position in the first image and the second image, including: adding the brightness values at the same position in the brightness-corrected first image and the brightness-corrected second image to obtain a third image.
[0014] The brightness correction process may be the brightness correction process described in S703.
[0015] Electronic devices can obtain non-overexposed images by correcting the brightness of the image, thereby preventing the bright area from being overexposed when the brightness values of two subsequent adjacent frames are accumulated.
[0016] In a possible implementation, obtaining a target image by obtaining a maximum value of brightness values at the same position in the third image and the second image includes: obtaining a fourth image by obtaining a maximum value of brightness values at the same position in the third image and the second image; and performing brightness correction processing on the fourth image to obtain a target image.
[0017] Brightness correction processing is used to process overexposed images into non-overexposed images.
[0018] Electronic devices can perform another brightness correction process to ensure that the target image is not overexposed.
[0019] In a possible implementation, the image sequence includes: a fifth image and a sixth image, and the images in the image sequence are subjected to image fusion processing to obtain a target image, including: calculating the average value of brightness values at the same position in the fifth image and the sixth image to obtain the target image.
[0020] See also Fig. 9 , when the fifth image is image A and the sixth image is image B, the target image may be image meanAB; when the fifth image is image meanAB and the sixth image may be image C, the target image may be image meanABC; when the fifth image is image meanABC and the sixth image may be image D, the target image may be image meanABCD.
[0021] In the scene of shooting silky flowing water, the electronic device can retain the pixel details of each image by calculating the average value between the two images, so that the second long exposure image has a uniform brushed image effect.
[0022] In a possible implementation, the image sequence includes: a seventh image and an eighth image, and the images in the image sequence are subjected to image fusion processing to obtain a target image, including: obtaining the maximum value of brightness values at the same position in the seventh image and the eighth image to obtain the target image.
[0023] See also Fig.10 , when the seventh image is image A and the eighth image is image B, the target image may be image maxAB; when the seventh image is image maxAB and the eighth image may be image C, the target image may be image maxABC; when the seventh image is image maxABC and the eighth image may be image D, the target image may be image maxABCD.
[0024] When shooting gorgeous star trails, electronic devices can calculate the maximum value between two images and retain the highlight pixels in each image to obtain clear star trails.
[0025] In a possible implementation, the image sequence includes at least one short frame or an ultra-short frame and at least one normal frame, the exposure time of the normal frame is greater than the exposure time of the short frame, and the exposure time of the short frame is greater than the exposure time of the ultra-short frame.
[0026] Since it is necessary to preserve the dark background, stars and other obstructions while photographing the starry sky, electronic devices can use short frames and / or ultra-short frames to preserve most of the dark areas in the shooting scene to avoid the shooting results being too bright and inconsistent with the real starry sky.
[0027] In a possible implementation, when the image sequence includes: an ultra-short frame, a short frame, and a normal frame, the time for acquiring the ultra-short frame is earlier than the time for acquiring the short frame, and the time for acquiring the short frame is earlier than the time for acquiring the normal frame.
[0028] Since there is no obvious brightness jump between the short frame and the normal frame, the target image with higher picture effect can be obtained by sequentially acquiring the ultra-short frame, the short frame and the normal frame.
[0029] In one possible implementation, after responding to an operation on a photo button, the method also includes: displaying a second interface, the second interface including: an end photo button, and countdown information of a first time length; in response to the operation on the end photo button, acquiring an image sequence within a second time length, the second time length being less than the first time length; performing image fusion processing on the image sequence within the second time length to obtain a ninth image.
[0030] Even if the user sets the shutter time, the electronic device can end the photographing process in advance when receiving an operation on the end photographing button, so as to achieve flexible control over long exposure photography.
[0031] In one possible implementation, the first interface also includes a third button for turning on the filter, and the method also includes: in response to an operation on the third button, displaying at least one button for setting the filter, the at least one button for setting the filter including: a fourth button for setting the first filter; obtaining an image sequence within a first time length, including: when the fourth button is selected, obtaining an image sequence with the first filter within the first time length.
[0032] The third button can be Figure 6 In the interface shown in a, the fourth button can be button 601. Figure 6 Button 604 in the interface shown in c.
[0033] Electronic devices can add filters to the long-exposure photography function so that the photography results can not only retain the trajectory of moving objects but also present a more vivid picture effect.
[0034] In a possible implementation, when the electronic device is in a first photographing scene, the image sequence is determined based on a first photographing parameter, and the exposure time in the first photographing parameter satisfies a first value range; or, when the electronic device is in a second photographing scene, the image sequence is determined based on a second photographing parameter, and the exposure time in the second photographing parameter satisfies a second value range; or, when the electronic device is in a third photographing scene, the image sequence is determined based on a third photographing parameter, and the exposure time in the third photographing parameter satisfies a third value range; wherein the maximum exposure time in the third value range is greater than the maximum exposure time in the first value range, and the minimum exposure time in the first value range is greater than the maximum exposure time in the second value range.
[0035] The first photographing scene may be a scene of photographing busy traffic or light painting graffiti. For example, the first value range may be 100 milliseconds to 150 milliseconds.
[0036] The second photographing scene may be a scene of shooting silk flowing water, for example, the second value range may be a range of 10 milliseconds to 50 milliseconds.
[0037] The third photo-taking scene may be a scene of photographing gorgeous star trails. For example, the third value range may be a range of 5 milliseconds to 3 seconds.
[0038] The electronic device can obtain a more suitable long exposure image in each photographing scene by setting different photographing parameters in different photographing scenes.
[0039] In a second aspect, an embodiment of the present application provides an image processing device, which may be an electronic device, or a chip or chip system in an electronic device. The image processing device may include a display unit and a processing unit. When the image processing device is an electronic device, the display unit may be a display screen. The display unit is used to perform the display step so that the electronic device implements an image processing method described in the first aspect or any possible implementation of the first aspect. When the image processing device is an electronic device, the processing unit may be a processor. The image processing device may also include a storage unit, which may be a memory. The storage unit is used to store instructions, and the processing unit executes the instructions stored in the storage unit so that the electronic device implements an image processing method described in the first aspect or any possible implementation of the first aspect. When the image processing device is a chip or chip system in an electronic device, the processing unit may be a processor. The processing unit executes the instructions stored in the storage unit so that the electronic device implements an image processing method described in the first aspect or any possible implementation of the first aspect. The storage unit may be a storage unit within the chip (eg, a register, a cache, etc.), or a storage unit within the electronic device that is located outside the chip (eg, a read-only memory, a random access memory, etc.).
[0040] Exemplarily, a display unit is used to display a first interface, which includes: a photo button, and a first button for setting a shutter time; a processing unit is used to respond to an operation on the first button, and the display unit is used to display a second button for setting a shutter time; when the shutter time is set to a first duration based on the second button, the processing unit is used to respond to the operation on the photo button and obtain an image sequence within the first duration; the processing unit is used to perform image fusion processing on images in the image sequence to obtain a target image.
[0041] In one possible implementation, the image sequence includes: a first image and a second image, a processing unit specifically used to add the brightness values at the same position in the first image and the second image to obtain a third image; the processing unit is also specifically used to obtain the maximum value of the brightness values at the same position in the third image and the second image to obtain a target image.
[0042] In a possible implementation, the processing unit is further used to perform brightness correction processing on any image in the image sequence to obtain a brightness-corrected image sequence, where the brightness correction processing is used to reduce the brightness of the image, and the brightness-corrected image sequence includes: a first brightness-corrected image and a second brightness-corrected image; the processing unit is further used to add the brightness values at the same position in the first brightness-corrected image and the second brightness-corrected image to obtain a third image.
[0043] In one possible implementation, the processing unit is specifically used to obtain the maximum value of the brightness value at the same position in the third image and the second image to obtain a fourth image; the processing unit is also specifically used to perform brightness correction processing on the fourth image to obtain a target image, and the brightness correction processing is used to process the overexposed image into a non-overexposed image.
[0044] In a possible implementation, the image sequence includes: a fifth image and a sixth image, and a processing unit specifically configured to calculate an average value of brightness values at the same position in the fifth image and the sixth image to obtain a target image.
[0045] In a possible implementation, the image sequence includes: a seventh image and an eighth image, and a processing unit specifically configured to obtain a maximum value of brightness values at the same position in the seventh image and the eighth image to obtain a target image.
[0046] In a possible implementation, the image sequence includes at least one short frame or an ultra-short frame and at least one normal frame, the exposure time of the normal frame is greater than the exposure time of the short frame, and the exposure time of the short frame is greater than the exposure time of the ultra-short frame.
[0047] In a possible implementation, when the image sequence includes: an ultra-short frame, a short frame, and a normal frame, the time for acquiring the ultra-short frame is earlier than the time for acquiring the short frame, and the time for acquiring the short frame is earlier than the time for acquiring the normal frame.
[0048] In one possible implementation, a single eye is displayed and also used to display a second interface, which includes: an end photo-taking button and countdown information of a first time length; a processing unit is used to obtain an image sequence within a second time length in response to an operation on the end photo-taking button, where the second time length is less than the first time length; the processing unit is further used to perform image fusion processing on the image sequence within the second time length to obtain a ninth image.
[0049] In one possible implementation, the first interface also includes a third button for turning on the filter. In response to an operation on the third button, the display unit is further used to display at least one button for setting the filter, and the at least one button for setting the filter includes: a fourth button for setting the first filter; when the fourth button is selected, the processing unit is further used to obtain a sequence of images with the first filter within a first time length.
[0050] In a possible implementation, when the electronic device is in a first photographing scene, the image sequence is determined based on a first photographing parameter, and the exposure time in the first photographing parameter satisfies a first value range; or, when the electronic device is in a second photographing scene, the image sequence is determined based on a second photographing parameter, and the exposure time in the second photographing parameter satisfies a second value range; or, when the electronic device is in a third photographing scene, the image sequence is determined based on a third photographing parameter, and the exposure time in the third photographing parameter satisfies a third value range; wherein the maximum exposure time in the third value range is greater than the maximum exposure time in the first value range, and the minimum exposure time in the first value range is greater than the maximum exposure time in the second value range.
[0051] In a third aspect, an embodiment of the present application provides an electronic device, including a processor and a memory, the memory being used to store code instructions, and the processor being used to run the code instructions to execute the method described in the first aspect or any possible implementation of the first aspect.
[0052] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, in which a computer program or instructions are stored. When the computer program or instructions are run on a computer, the computer executes the method described in the first aspect or any possible implementation of the first aspect.
[0053] In a fifth aspect, an embodiment of the present application provides a computer program product including a computer program. When the computer program runs on a computer, the computer executes the method described in the first aspect or any possible implementation manner of the first aspect.
[0054] In a sixth aspect, the present application provides a chip or a chip system, the chip or chip system comprising at least one processor and a communication interface, the communication interface and the at least one processor are interconnected by a line, and the at least one processor is used to run a computer program or instruction to execute the method described in the first aspect or any possible implementation of the first aspect. The communication interface in the chip can be an input / output interface, a pin or a circuit, etc.
[0055] In a possible implementation, the chip or chip system described above in the present application further includes at least one memory, in which instructions are stored. The memory may be a storage unit inside the chip, such as a register, a cache, etc., or a storage unit of the chip (e.g., a read-only memory, a random access memory, etc.).
[0056] It should be understood that the second to sixth aspects of the present application correspond to the technical solutions of the first aspect of the present application, and the beneficial effects achieved by each aspect and the corresponding feasible implementation methods are similar and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0057] Figure 1 A schematic diagram of a scenario provided for an embodiment of the present application;
[0058] Figure 2 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application;
[0059] Figure 3 A schematic diagram of the software structure of an electronic device provided in an embodiment of the present application;
[0060] Figure 4 A schematic diagram of an interface for entering a long exposure photo taking function provided in an embodiment of the present application;
[0061] Figure 5 A schematic diagram of another interface for entering a long exposure photo taking function provided in an embodiment of the present application;
[0062] Figure 6 A schematic diagram of an interface for using a filter in a long exposure photography function provided in an embodiment of the present application;
[0063] Figure 7 A flowchart of an image processing method provided in an embodiment of the present application;
[0064] Figure 8 A schematic diagram of an image sequence provided in an embodiment of the present application;
[0065] Fig. 9 A flowchart of another image processing method provided in an embodiment of the present application;
[0066] Fig.10 A flowchart of another image processing method provided in an embodiment of the present application;
[0067] Fig.11 A schematic diagram of a framework of an image processing method provided in an embodiment of the present application;
[0068] Fig.12 A schematic diagram of the structure of an image processing device provided in an embodiment of the present application;
[0069] Fig.13 A schematic diagram of the hardware structure of another electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0070] In order to clearly describe the technical solutions of the embodiments of the present application, some terms and technologies involved in the embodiments of the present application are briefly introduced below:
[0071] 1. Shutter
[0072] The shutter is a curtain in your camera that controls how long light enters the camera. The slower the shutter speed, the longer the light stays in the camera.
[0073] Some camera applications may provide a slow shutter speed function. When using this function to shoot scenes with insufficient ambient light, the camera can reduce the shutter speed to ensure that the camera has enough light to achieve normal exposure.
[0074] 2. Exposure time
[0075] Exposure time can also be called exposure duration, etc. Exposure time refers to the light-sensitive time of the film. The longer the exposure time, the brighter the photo generated on the film, and vice versa. When the external light is relatively dark, it is generally required to extend the exposure time to capture a brighter image.
[0076] 3. Exposure
[0077] Exposure can be understood as the amount of light exposed by the camera, that is, the number of photons that hit the photosensitive film or digital sensor. Usually, exposure can be related to exposure time and ISO value, for example, exposure = exposure time × ISO value.
[0078] 4. Long exposure photography function and photography scenes
[0079] The long exposure photography function may also be called a slow shutter photography function or a light streamer shutter photography function, etc. When the electronic device starts the long exposure photography function, the electronic device may record the motion trajectory of a moving object such as light by increasing the exposure time.
[0080] In order to obtain better photo effects, the long exposure photography function can support a variety of photo scenes, including long exposure image shooting in four photo scenes: busy traffic, light painting graffiti, silky flowing water and gorgeous star trails.
[0081] Specifically, the overview of the four photo-taking scenarios can be as follows:
[0082] Traffic: Traffic can be used to capture the effect of the flow of car lights in a dark environment. For example, on an overpass or high-rise building far away from the traffic, find a suitable angle to shoot the car lights and get a large picture of the car tracks.
[0083] Light painting: Light painting can be used to capture a light source with appropriate brightness and color in a dark environment, and capture the desired pattern by capturing the moving trajectory of the light source. For example, the light source can be emitted by one or more of the following objects, such as: light sticks, flashlights, fluorescent sticks, fairy sticks, steel wool, or fireworks.
[0084] Silky Flowing Water: Silky Flowing Water can be used to shoot dynamic water flow, making the water flow as smooth, soft and dreamy as silk. For example, the objects shot by Silky Flowing Water can include one or more of the following, such as flowing water, sea waves, white clouds floating in the sky, etc.
[0085] Take the shooting of white clouds as an example. In normal shooting, electronic devices can turn moving clouds into still images. Clouds recorded under silky water can have a brushed effect. Take the shooting of lake water as an example. The lake surface recorded under silky water becomes smoother.
[0086] Star Trails: Used to capture the movement of stars in a dark environment. For example, choose a relatively open and cloudless night to capture the starry sky. When shooting, you can avoid light sources to avoid long exposure that will cause partial brightness in the shot.
[0087] 5. Preview images and take photos
[0088] The preview image may be data collected in real time by a camera of the electronic device and used to be displayed in a preview screen. For example, when the electronic device receives an operation of a user to start a camera application, the electronic device may collect the preview image captured by the camera and display it in real time in a preview screen of the camera application.
[0089] The photographed image may be data obtained based on a photographing button in the electronic device. For example, when the electronic device receives a trigger operation of the user on the photographing button, the electronic device may obtain a photographed image obtained based on a camera at the time of photographing.
[0090] Based on the long exposure photo function described in the embodiment of the present application, the obtained preview image can be called a long exposure preview image; based on the long exposure photo function described in the embodiment of the present application, the obtained photo image can be called a long exposure photo image.
[0091] 6. High dynamic range (HDR)
[0092] HDR is a processing technology that improves image brightness and contrast. Compared with ordinary images, HDR can provide more dynamic range and image details. The final HDR image is synthesized by using the image with the best details corresponding to each exposure time, which can better reflect the visual effect in the real environment. HDR images can be obtained by fusion of at least two images with different exposure times.
[0093] 7. Other terms
[0094] In the embodiments of the present application, words such as "first" and "second" are used to distinguish the same or similar items with substantially the same functions and effects. For example, the first chip and the second chip are only used to distinguish different chips, and their order is not limited. Those skilled in the art can understand that words such as "first" and "second" do not limit the quantity and execution order, and words such as "first" and "second" do not necessarily limit them to be different.
[0095] It should be noted that in the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.
[0096] In the embodiments of the present application, "at least one" refers to one or more, and "more than one" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, or c can represent: a, b, c, ab, a--c, bc, or abc, where a, b, c can be single or multiple.
[0097] 8. Electronic devices
[0098] The electronic devices of the embodiments of the present application may include handheld devices with camera functions, vehicle-mounted devices, etc. For example, some electronic devices are: mobile phones, tablet computers, PDAs, laptop computers, mobile internet devices (MID), wearable devices, virtual reality (VR) devices, augmented reality (AR) devices, etc., which are not limited in the embodiments of the present application.
[0099] The electronic devices in the embodiments of the present application may also be referred to as: terminal equipment, user equipment (UE), mobile station (MS), mobile terminal (MT), access terminal, user unit, user station, mobile station, mobile station, remote station, remote terminal, mobile device, user terminal, terminal, wireless communication equipment, user agent or user device, etc.
[0100] In an embodiment of the present application, the electronic device or each network device includes a hardware layer, an operating system layer running on the hardware layer, and an application layer running on the operating system layer. The hardware layer includes hardware such as a central processing unit (CPU), a memory management unit (MMU), and a memory (also called main memory). The operating system can be any one or more computer operating systems that implement business processing through processes, such as Linux operating system, Unix operating system, Android operating system, iOS operating system, or Windows operating system. The application layer includes applications such as browsers, address books, word processing software, and instant messaging software.
[0101] For example, Figure 1 A schematic diagram of a scenario provided in an embodiment of the present application. Figure 1 In the corresponding embodiments, an electronic device is taken as a mobile phone as an example for illustration, and this example does not constitute a limitation on the embodiments of the present application.
[0102] In response to the user's operation of turning on the camera, the electronic device can display Figure 1 The interface shown in a in the figure may be a preview interface in the camera function. The preview interface may display one or more of the following: a camera button 101, a preview screen 102, a control for switching cameras, or a more function button, etc. The user may trigger the more function button to open other camera functions supported by the camera application.
[0103] The camera app also has other functions besides taking pictures, such as supporting aperture photography, night scene photography, video recording, short video creation, and more photography functions.
[0104] The preview image 102 may include: a person 103 in the foreground and a starry sky in the background, and the starry sky may include at least one twinkling star.
[0105] In response to the user's triggering operation on the camera button 101, the electronic device can capture the following image: Figure 1The photographed image 104 shown in b in FIG. Since the stars are not always still in the sky but may be in motion, only a static starry sky can be captured using the photographing function in the camera, and the image quality is poor.
[0106] In a possible implementation, in some electronic devices that support the long exposure photography function, in response to a trigger operation on a photography button in the long exposure photography function, the electronic device can start acquiring an image sequence, and then in response to a trigger operation on an end photography button by the user, the electronic device can end shooting and perform image processing on the image sequence acquired within the shooting time to obtain a long exposure photography image.
[0107] However, the above method of capturing a long-exposure photo image by triggering the photo button and the end photo button is relatively simple. In addition, when the user triggers the photo button and forgets to trigger the end photo button, the electronic device may obtain a large number of useless images, affecting the generation result of the long-exposure photo image.
[0108] In view of this, an embodiment of the present application provides an image processing method, so that an electronic device can display a button for selecting a shutter time after responding to a user's operation on a button for setting a shutter time. For example, when a user sets the shutter time to a first duration, in response to a user's triggering operation on a photo button, the electronic device automatically ends the photo taking process after acquiring an image sequence within the first duration, without triggering the end photo taking button, making the entire photo taking process more flexible and concise.
[0109] In order to better understand the embodiments of the present application, the structure of the electronic device of the embodiments of the present application is introduced below. Figure 2 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application.
[0110] The electronic device may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, an indicator 192, a camera 193, and a display screen 194, etc.
[0111] The sensor module 180 may include one or more of the following: the touch sensor 180A may be disposed on the display screen 194, and the touch sensor 180A and the display screen 194 form a touch screen, or a "touch screen". For example, the touch sensor 180A is used to receive a user's touch operation on a camera application, such as a touch operation on a photo button or a touch operation on a stop photo button.
[0112] It is to be understood that the structure illustrated in the embodiments of the present application does not constitute a specific limitation on the electronic device. In other embodiments of the present application, the electronic device may include more or fewer components than shown in the figure, or combine certain components, or split certain components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
[0113] The processor 110 may include one or more processing units. Among them, different processing units may be independent devices or integrated into one or more processors. A memory may also be provided in the processor 110 for storing instructions and data. For example, the processor 110 is used to implement the steps performed in the image processing method provided in the embodiment of the present application, and to store instructions and data related to the image processing method.
[0114] The electronic device implements the display function through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. For example, the GPU is used to perform the graphics rendering process in the image processing method.
[0115] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. In some embodiments, the electronic device may include 1 or N display screens 194, where N is a positive integer greater than 1. For example, the display screen 194 is used to display a preview screen in a camera application and a photographed image, etc.
[0116] The electronic device can realize the photo taking function through ISP, camera 193, video codec, GPU, display screen 194 and application processor.
[0117] The camera 193 is used to capture static images or videos. In some embodiments, the electronic device may include 1 or N cameras 193, where N is a positive integer greater than 1. For example, in response to a user's photo-taking operation, the camera 193 may be used to obtain an image sequence, which may include one or more of the following images, such as a short frame image, an ultra-short frame image, and a normal frame image.
[0118] The external memory 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. The internal memory 121 can be used to store computer executable program codes, and the executable program codes include instructions. The internal memory 121 can include a program storage area and a data storage area. For example, the internal memory 121 can be used to store executable program codes in the image processing method.
[0119] The key 190 includes a power button, a volume button, etc. The key 190 may be a mechanical key. It may also be a touch key. The electronic device may receive key input and generate key signal input related to the user settings and function control of the electronic device. In some scenarios, the electronic device may also implement a photo operation in response to the user pressing one or more keys in the key 190. The specific method of the photo operation is not limited in the embodiments of the present application.
[0120] The software system of the electronic device can adopt a layered architecture, an event-driven architecture, a micro-kernel architecture, a micro-service architecture, or a cloud architecture, etc., which will not be elaborated here.
[0121] Figure 3 A schematic diagram of the software structure of an electronic device provided in an embodiment of the present application.
[0122] The layered architecture divides the system into several layers, each with clear roles and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the system is divided into five layers, from top to bottom: application (APP), application framework layer (FWK), hardware abstraction layer (HAL), driver layer, and hardware layer.
[0123] The application layer may include a series of application packages. In the embodiment of the present application, the application package may include: camera, gallery, etc. The camera may support the long exposure photography function described in the embodiment of the present application, and may realize the shooting of long exposure photography images, as well as the preview and display of long exposure photography images.
[0124] The gallery can also be called an album, etc. The gallery can store and access long-exposure photos.
[0125] The application framework layer provides an application programming interface (API) and a programming framework for the application of the application layer. The application framework layer includes some predefined functions. In an embodiment of the present application, the application framework layer may include a camera access interface, wherein the camera access interface may include camera management and camera devices. The camera access interface is used to provide an application programming interface and a programming framework for camera applications.
[0126] The hardware abstraction layer is an interface layer between the application framework layer and the driver layer, and provides a virtual hardware platform for the operating system. In the embodiment of the present application, the hardware abstraction layer may include a camera hardware abstraction layer and a camera algorithm library.
[0127] The camera hardware abstraction layer may provide virtual hardware for camera device 1, camera device 2 or more camera devices. The camera algorithm library may include operating codes and data for implementing the image processing method provided in the embodiment of the present application.
[0128] The driver layer is a layer between hardware and software. The driver layer includes drivers for various hardware. The driver layer may include camera device drivers, digital signal processor drivers, and image processor drivers.
[0129] The camera device driver is used to drive the camera sensor to collect images and drive the image signal processor to pre-process the images. The digital signal processor driver is used to drive the digital signal processor to process images. The image processor driver is used to drive the graphics processor to process images.
[0130] The following is a detailed description of the image processing method in the embodiment of the present application in combination with the above system structure:
[0131] In response to the user's operation of opening the camera application, such as clicking the camera application icon, the camera application calls the camera access interface of the application framework layer to start the camera application, and then sends an instruction to start the camera by calling the camera device (camera device 1 and / or other camera devices) in the camera hardware abstraction layer. The camera hardware abstraction layer sends the instruction to the camera device driver of the kernel layer. The camera device driver can start the corresponding camera sensor and collect image light signals through the sensor. A camera device in the camera hardware abstraction layer corresponds to a camera sensor in the hardware layer.
[0132] Then, the camera sensor can transmit the collected image light signal to the image signal processor for preprocessing to obtain the image electrical signal (raw image), and transmit the above raw image to the camera hardware abstraction layer through the camera device driver.
[0133] The camera hardware abstraction layer can send the original image to the camera algorithm library. The camera algorithm library stores the program code for implementing the image processing method provided in the embodiment of the present application. Based on the digital signal processor and the image processor, the camera algorithm library executes the above code to implement the process of generating a long-exposure photographed image in the image processing method described in the embodiment of the present application.
[0134] The camera algorithm library can send the raw image captured by the camera to the camera hardware abstraction layer, which can then display it.
[0135] It should be understood that the software architecture provided in the embodiments of the present application is merely an example and does not constitute a limitation on the embodiments of the present application.
[0136] The following specific embodiments are used to describe in detail the technical solution of the present application and how the technical solution of the present application solves the above technical problems. The following specific embodiments can be implemented independently or in combination with each other, and the same or similar concepts or processes may not be described in detail in some embodiments.
[0137] Before introducing the image processing method in the embodiment of the present application, the process of turning on the long exposure photo function can be schematically described. Figure 4-Figure 6 Corresponding embodiments. Wherein, Figure 4 This is an illustration of controlling the long exposure photography function based on the photography time preset by the user. Figure 5 This is an illustration of controlling the long exposure photography function based on the user's triggering operation of the photo button and the end photo button. Figure 6 This is a function diagram for using filters in the long exposure photography function.
[0138] In the camera application of electronic devices, the long exposure photography function can also be called the streamer shutter photography function. The long exposure photography function can be used to obtain long exposure photography images. The long exposure photography function can be used to capture scenes such as busy traffic, light painting graffiti, silky flowing water, and gorgeous star trails.
[0139] For example, Figure 4 This is a schematic diagram of an interface for entering a long exposure photography function provided in an embodiment of the present application. Figure 4 In the corresponding embodiment, a long exposure photography function called a streamer shutter photography function is taken as an example for illustration, and this example does not constitute a limitation on the embodiments of the present application.
[0140] In response to the user Figure 1 In a, the operation of the more function button in the camera application is triggered, and the electronic device displays the following Figure 4The interface may include one or more of the following: a button for turning on the HDR photography function, a button for turning on the slow motion photography function, a button for turning on the micro-movie recording function, a button for turning on the time-lapse photography recording function, a button for turning on the dynamic photo photography function, or a button 401 for turning on the streamer shutter photography function.
[0141] In response to the triggering operation on button 401, the electronic device displays the following Figure 4 The interface shown in b in the figure may be a streamer shutter shooting interface or a first interface. The interface may display one or more of the following: a shooting button 402, a button 403 for setting the shutter time, an identifier for indicating a shooting scene (e.g., the identifier may be displayed as a busy scene), and multiple buttons for selecting a shooting scene. Referring to the words in the identifier for indicating a shooting scene, the streamer shutter shooting function is currently in the scene of shooting a busy scene.
[0142] Button 403 may also be referred to as a first button. The button 403 may display the letter B and a pointer, which is not limited in the embodiment of the present application.
[0143] In response to the user's triggering operation on button 403, the electronic device displays the following Figure 4 The interface shown in c in FIG. The interface may display one or more of the following: a photo taking button 402, a progress bar 404 for setting the shutter time, or a button 405 for indicating that the shutter time is being set.
[0144] The progress bar 404 may display values such as 0.5, 2.5, and 4.5. The progress bar 404 may be used to set the shutter time from 0.5 hours to 4.5 hours, which is not limited in the embodiments of the present application.
[0145] The button 405 may display the letter B. The button 405 may be in a state of bold, grayscale display or color display. When the electronic device displays the button 405, the user may determine that the current setting interface for the shutter time is in progress.
[0146] In a possible implementation, in response to a user's triggering operation on button 405, the electronic device may switch to Figure 4 The interface shown in b.
[0147] It is understandable that the progress bar 404 may be an example for setting the shutter time. Figure 4 The interface shown in c in FIG. 1 displays multiple buttons, which can be used to set different shutter times respectively.
[0148] In the case where the user sets the shutter time to 2.5 hours based on the button in the progress bar 404, in response to the user's triggering operation on the photo button 402, the electronic device displays the following Figure 4 The interface shown in d in the figure may be a photo taking interface. The interface may display one or more of the following: countdown information 406 for indicating the shutter time, an end photo taking button 407, or a prompt information for indicating to keep the camera stable. The countdown information 406 may be displayed as a value such as 02:29:59, and the countdown information 406 may be determined based on the set shutter time.
[0149] The button in the progress bar 404 may also be referred to as a second button.
[0150] When the shutter time of 2.5 hours ends, the electronic device can automatically end the photographing process and generate a long-exposure photographed image based on the image sequence acquired within 2.5 hours. The first time length can be 2.5 hours.
[0151] Alternatively, when the shutter time does not reach 2.5 hours, in response to the user's triggering operation on the end shooting button 407, the electronic device can end the shooting process in advance and generate a long-exposure shooting image (or the ninth image) based on the image sequence acquired within the shutter time of less than 2.5 hours. This allows for flexible control of long-exposure shooting. The second time length can be less than 2.5 hours.
[0152] During the photo shoot, Figure 4 The interface shown in d in FIG. 1 may display a long exposure preview image, which may be obtained by fusion of multiple images acquired in real time. The long exposure preview image is similar to or the same as the long exposure photo image, so that the user can check the photo result at any time in the preview screen to determine whether to stop taking photos.
[0153] Figure 5 A schematic diagram of another interface for entering the long exposure photo taking function provided in an embodiment of the present application.
[0154] Electronic devices display Figure 5 The interface shown in a in the figure may display a camera button 402. The content displayed in the interface may be the same as Figure 4 The contents shown in b are the same as those shown in b and will not be repeated here.
[0155] In response to the user's triggering operation on the photo button 402, the electronic device displays the following Figure 5The interface shown in b in the figure may be a photo taking interface. The interface may display one or more of the following: information 501 indicating the shutter time, a button 502 to end photo taking, or a prompt indicating to keep the camera stable. Information 501 may be displayed as the duration of the shutter opening. For example, when the shutter is opened for 1 second, information 501 may be displayed as 00:00:01.
[0156] In response to the user's triggering operation on the end photographing button 502, the electronic device can end the photographing process and generate a long-exposure photographed image based on the image sequence acquired within the shutter time.
[0157] The shutter time described in the embodiments of the present application can be understood as the total duration of taking photos by starting the long exposure photo function.
[0158] It is understandable that users can Figure 4 The corresponding embodiment pre-sets the shutter time, which is convenient for users to take photos within a fixed time; users can also manually control the shutter time based on the corresponding embodiment 5 to conveniently control the recording time. The switching between these two shutter time setting methods is flexible, which improves the flexibility of users in using the long exposure photo function.
[0159] Figure 6 A schematic diagram of an interface for using filters in a long exposure photography function provided in an embodiment of the present application.
[0160] Electronic devices display Figure 6 The interface shown in a in FIG. 1 may include: a button 601 for opening a filter; other contents displayed in the interface may refer to Figure 4 The interface shown in b in FIG. 6 is not described in detail here. Button 601 may also be referred to as a third button.
[0161] In response to the user's triggering operation on button 601, the electronic device displays the following Figure 6 The interface shown in b in FIG. At least one button for selecting a photo filter may be displayed inside the dotted frame 602 in the interface, and the name of the filter may be displayed around the dotted frame 602. The dotted frame 602 may display: a button 603 for selecting the original image, and the button 603 is in a selected state.
[0162] The filter may include one or more of the following: vivid, soft, bright, etc. The dotted frame 602 is only used to indicate the position where the button is displayed, and is not actually displayed in the interface.
[0163] In response to the user sliding leftward within the dotted frame 602, the electronic device may display the following Figure 6The interface shown in c in FIG. 1 may display: a button 604 for selecting a vivid filter and a photo button 605, wherein the button 604 is in a selected state. The button 604 may also be referred to as a fourth button. The first filter is a vivid filter.
[0164] When button 604 is in a selected state, in response to the user's triggering operation on the photo button 605, the electronic device can acquire an image under a vivid filter, and then in response to the user's triggering operation on the end photo button, the electronic device can generate a long-exposure photo image based on the image sequence acquired during the photo shooting time. The long-exposure photo image generated based on the corresponding embodiment in 6 has the effect of a vivid filter, making the photo result more vivid.
[0165] Or when button 604 is in the selected state, the electronic device can also Figure 5 The corresponding embodiment obtains an image sequence with a sharp filter within the shutter time by setting the shutter time, thereby obtaining a long-exposure photographic image.
[0166] Based on this, when the filter is activated in the long exposure photography function, the electronic device can not only obtain the trajectory of the moving object, but also capture more vivid long exposure photography images.
[0167] exist Figure 4 On the basis of the corresponding embodiments, the embodiments of the present application can respectively explain the image processing process according to the shooting scenes supported by the long exposure shooting function.
[0168] In scenario 1, the electronic device can illustrate the image processing method when photographing the busy traffic and light painting graffiti, see Figure 7 In the second scenario, the electronic device can illustrate the image processing method when shooting silk flowing water, see Fig. 9 In scenario three, the electronic device can illustrate the image processing method when shooting gorgeous star trails, see Fig.10 Corresponding embodiments. Since both the busy scene and the light painting graffiti may include: a dark background and a bright light source, the electronic device can use the same image processing method in the busy scene and the light painting graffiti scene.
[0169] Scene 1: Image processing method for shooting busy traffic and light painting graffiti.
[0170] For example, Figure 7 A schematic diagram of a flow chart of an image processing method provided in an embodiment of the present application. Figure 7 As shown, the electronic device may include one or more of the following: a gallery, a camera, a camera access interface, a camera algorithm library, a camera hardware abstraction layer, or a camera device driver, etc.
[0171] S701: In response to a user's photographing operation, a camera device driver acquires a first image sequence according to a first photographing parameter.
[0172] The first photographing parameter may include one or more of the following: a first exposure time, or a first ISO value, etc.
[0173] The first exposure time can be pre-set, and the value range of the first exposure time (or referred to as the first value range) can be a range such as 100 milliseconds-150 milliseconds. For example, the first exposure time can be a value such as 100 milliseconds, 120 milliseconds or 150 milliseconds. The value of the first exposure time is not limited in the embodiment of the present application.
[0174] It is understandable that in the normal photo function, the electronic device can set the exposure time to a range of 10 milliseconds to 15 milliseconds, etc.; in the night scene photo function, in order to obtain more picture details, the electronic device can set the exposure time to a range of 50-60 milliseconds, etc. In scene 1, the electronic device can set the exposure time to a range of 100 milliseconds to 150 milliseconds, etc., to increase the picture brightness while retaining more light source details.
[0175] The first ISO value may be determined based on the first exposure and the first exposure time, where the first ISO value = first exposure / first exposure time. The first exposure may be determined by the electronic device based on the ambient light brightness, for example, the electronic device may use a smart auto exposure (smartAE) algorithm and / or a base AE algorithm to determine the exposure corresponding to the ambient brightness, such as smartAE may be used to determine the exposure of a photographed image, and baseAE may be used to determine the exposure of a preview image.
[0176] Exemplarily, in response to the user entering a busy photo scene or a light painting graffiti photo scene, the camera device driver can obtain the ambient brightness and determine the first exposure under the current ambient light from the first extensible markup language (XML) file of the smartAE algorithm. Based on the first exposure and the first exposure time, the first ISO value is calculated to obtain the first photo parameter. Among them, the first XML file can be used to store the correspondence between ambient brightness and exposure in a busy photo scene or a light painting graffiti photo scene. It is understandable that the electronic device can simulate the shooting habit of SLR slow shutter shooting by preferentially adjusting the exposure time in the photo parameters.
[0177] The first image sequence may include N images, where N may be an integer greater than or equal to 1. The images in the first image sequence may be sent to the camera algorithm library by the camera device driver in chronological order, or may be sent to the camera algorithm library after acquiring multiple images at one time, which is not limited in the embodiments of the present application.
[0178] In the long exposure photography function, the photography operation may be: a user triggering a photography button in a busy traffic photography scene, or a user triggering a photography button in a light painting graffiti photography scene, etc.
[0179] S702: The camera algorithm library obtains a first image sequence from a camera device driver.
[0180] S703: The camera algorithm library performs brightness correction processing on the first image sequence to obtain a first image sequence after brightness correction.
[0181] The brightness correction method can be used to perform nonlinear operations on the brightness values of the images in the first image sequence, reduce the brightness of the images in the first image sequence, and achieve the effect of processing the overexposed images in the first image sequence into non-overexposed images. Wherein, any image in the first image sequence can be a red green blue (RGB) image or a grayscale image, which is not limited in the embodiments of the present application.
[0182] The brightness correction method may include: a gamma brightness correction method, etc. The brightness correction method and the correction curve used in the brightness correction method are not limited in the embodiments of the present application.
[0183] Exemplarily, the camera algorithm library can perform brightness correction processing on any image in the first image sequence to obtain the first image sequence after brightness correction. In this scenario, the brightness difference between adjacent images in the first image sequence after brightness correction is relatively gentle, so as to obtain a long-exposure photo image with a smoother effect. Alternatively, the camera algorithm library can also identify overexposed images in the first image sequence, perform brightness correction processing on the overexposed images in the first image sequence, and obtain the first image sequence after brightness correction, which is not limited in the embodiments of the present application.
[0184] It is understandable that electronic devices can obtain non-overexposed images by correcting the brightness of the image, preventing the bright area from being overexposed when the brightness values of two subsequent adjacent frames are accumulated. Since there are often light sources in busy photography scenes and light painting graffiti photography scenes, brightness correction can be used to reduce the overall brightness of the picture and reduce overexposed images.
[0185] S704: The camera algorithm library accumulates calculation results of the current image and the previous frame in the first image sequence, and performs maximum value calculation on the accumulated result and the current image to obtain a first long exposure image.
[0186] Accumulation can be understood as adding the brightness values at the same position in two images to obtain an image composed of the brightness values between the two images. For example, if the brightness value at position 1 of the current image is 20, and the brightness value at position 1 in the calculation result of the previous frame is 0, the camera algorithm library can determine that the brightness value at position 1 in the accumulation result is 20 through accumulation.
[0187] In possible implementations, the accumulation method may be nonlinear accumulation or other forms of accumulation, which is not limited in the embodiments of the present application.
[0188] The maximum value calculation can be understood as calculating the maximum value of the brightness values at the same position in the two images to obtain an image composed of the maximum brightness values between the two images. For example, when the brightness value at position 1 in the accumulated result is 0 and the brightness value at position 1 in the current image is 20, the camera algorithm library can calculate the maximum value of 0 and 20 to determine that the brightness value at position 1 in the first long exposure photo is 20.
[0189] Figure 8 A schematic diagram of an image sequence provided in an embodiment of the present application. Figure 8 As shown, the first image sequence includes: image A, image B, image C, and image D. For example, the first image sequence includes: image A, image B, image C, and image D.
[0190] Exemplarily, when the first image sequence includes image A, the camera algorithm library may determine that the accumulation result may be image A when receiving the current image, such as image A. The accumulation result and the current image are both image A, so the first long exposure photographed image may also be image A.
[0191] When the calculation result of the previous frame is image A, the camera algorithm library can determine that the accumulation result can be the accumulation result of image A and image B, that is, sumAB, when receiving the current image, such as image B. The camera algorithm library can obtain the maximum value of sumAB and the brightness value in image B to obtain the first long exposure image, that is, image B'.
[0192] When the calculation result of the previous frame is image B', the camera algorithm library can determine that the accumulation result can be the accumulation result of image B' and image C, that is, sumABC, when receiving the current image, such as image C. The camera algorithm library can obtain the maximum value of sumABC and the brightness value in image C to obtain the first long exposure image, that is, image C'.
[0193] When the calculation result of the previous frame is image C', the camera algorithm library can determine that the accumulation result can be the accumulation result of image C' and image D, that is, sumABCD, when receiving the current image, such as image D. The camera algorithm library can obtain the maximum value of sumABCD and the brightness value in image D to obtain the first long exposure image, that is, image D'.
[0194] It can be understood that the camera algorithm library can obtain the trajectory of the moving object in the image through the accumulation calculation between the two images, and retain the light source information in the image through the maximum value calculation.
[0195] In a possible implementation, the camera algorithm library may also perform brightness correction processing on the acquired first long exposure photographed image to ensure that the first long exposure photographed image is not overexposed. The brightness correction method may be the same as or different from that described in S703, and this is not limited in the embodiments of the present application.
[0196] In combination with the steps shown in S701-S704, the electronic device may also use the baseAE algorithm to determine the exposure of the preview image, and determine the shooting parameters of the preview image based on the exposure of the preview image and the first exposure time. A preview image sequence is obtained based on the shooting parameters of the preview image, and a long-exposure preview image is obtained by image accumulation, maximum value calculation, etc., and then displayed in real time on the preview screen. It can be understood that the image processing process for the preview image sequence can be similar to the process of processing the first image sequence into the first long-exposure photographed image, which will not be repeated here.
[0197] For example, the camera can be Figure 4 The first long exposure photo image is displayed in the interface shown in d.
[0198] S705: In response to the user ending the photographing operation, the image library obtains a first long-exposure photographed image from the camera algorithm library.
[0199] In a possible implementation, in response to the operation of ending the shutter time, the image library obtains the first long-exposure photographed image from the camera algorithm library.
[0200] Specifically, the camera access interface (or the first interface) can obtain the first long exposure photographed image from the camera algorithm library, and then the camera can obtain the first long exposure photographed image from the camera access interface (or the first interface). Figure 7 (not shown) can be used to establish a data path between the image library and the camera algorithm library. The embodiment of the present application does not limit the type of the first interface.
[0201] In the long exposure photography function, the end photography operation may be: a user triggering an end photography button in a busy photography scene, or a user triggering an end photography button in a light painting graffiti photography scene.
[0202] It is understandable that, in response to the user ending the photo-taking operation, the electronic device may execute the steps shown in S705 and S707 simultaneously, or may execute the steps shown in S705 and S707 successively, which will not be described in detail here.
[0203] S706: The gallery stores the first long-exposure photographed image.
[0204] S706: The camera algorithm library processes the first long-exposure photographed image into a first thumbnail.
[0205] The camera algorithm library can process the first long-exposure photographed image into the first thumbnail through thumbnail processing methods such as sampling or neural networks, which is not limited in this embodiment of the present application.
[0206] S708: The camera obtains a first thumbnail from a camera algorithm library.
[0207] Specifically, the camera access interface can obtain the first thumbnail from the camera algorithm library, and then the camera can obtain the first thumbnail from the camera access interface.
[0208] S709: The camera calls the display screen to display the first thumbnail.
[0209] For example, the camera can be Figure 4 The first thumbnail is displayed in the lower left corner of the interface shown in b.
[0210] Based on this, in scenario one, the electronic device can avoid overexposure of the image through brightness correction processing, and then retain the pixel details between the images through the superposition processing between two adjacent images and the maximum value calculation between the superposition result and the current image.
[0211] Scene 2: Image processing method when shooting silk flowing water.
[0212] For example, Fig. 9 A flowchart of another image processing method provided in an embodiment of the present application is shown below. Fig. 9 As shown, the electronic device may include one or more of the following: a gallery, a camera, a camera access interface, a camera algorithm library, a camera hardware abstraction layer, or a camera device driver, etc.
[0213] S901: In response to a user's photographing operation, a camera device driver acquires a second image sequence according to a second photographing parameter.
[0214] The second photographing parameter may include one or more of the following: a second exposure time, or a second ISO value, etc.
[0215] The second exposure time can be pre-set, and the value range of the second exposure time (or referred to as the second value range) can be in the range of 10 milliseconds to 50 milliseconds. For example, the second exposure time can be 10 milliseconds, 30 milliseconds or 50 milliseconds. The value of the second exposure time is not limited in the embodiment of the present application.
[0216] It is understandable that since silk flowing water is usually photographed during the day, in order to avoid overexposure of the image due to too long exposure time, the electronic device can set a smaller exposure time.
[0217] The second ISO value may be determined based on the second exposure amount and the second exposure time, where the second ISO value=the second exposure amount / the second exposure time. The first exposure amount may be determined by the electronic device based on the ambient light brightness.
[0218] Exemplarily, in response to the user entering the silk flowing water photography scene, the camera device driver can obtain the ambient light brightness. Based on the correspondence between the ambient light brightness and the exposure in the second XML file corresponding to smartAE, the exposure corresponding to any preview image is determined, and the exposure of the preview image is the same as the exposure of the photographed image. Furthermore, in response to the user's photography operation, the electronic device can obtain the second exposure corresponding to the last preview image, determine and calculate the second ISO value based on the second exposure and the second exposure time, and obtain the second photography parameter. Among them, the second XML file can be used to store the correspondence between the ambient light brightness and the exposure in the silk flowing water photography scene.
[0219] The second image sequence may include N images, all of which may be normal frame images, and N may be an integer greater than or equal to 1.
[0220] In the long exposure photography function, the photography operation may be: a user triggering a photography button in a silk flowing water photography scene, and the like.
[0221] S902: The camera algorithm library obtains a second image sequence from the camera device driver.
[0222] S903: The camera algorithm library calculates the average value of the current image and the average value of the previous frame in the second image sequence to obtain a second long exposure image.
[0223] Average calculation can be understood as calculating the arithmetic average of the brightness values at the same position in the two images, and obtaining an image composed of the average brightness values between the two images. For example, if the brightness value at position 1 of the current image is 20, and the brightness value at position 1 in the accumulated result of the previous frame is 0, the camera algorithm library can determine that the brightness value at position 1 in the second exposure image is 10 through average calculation.
[0224] Similarly, when the second image sequence includes image A, the camera algorithm library may determine that the second long exposure image may be image A upon receiving the current image, such as image A.
[0225] When the average value result of the previous frame is image A, the camera algorithm library can determine that the second exposure image can be an image composed of the average value of pixels between image A and image B when receiving the current image, such as image B, that is, obtain image meanAB.
[0226] When the average value result of the previous frame is image meanAB, the camera algorithm library can determine that the second exposure image can be an image composed of the average value of pixels between image meanAB and image C, that is, meanABC, when receiving the current image, such as image C.
[0227] When the average value result of the previous frame is image meanABC, the camera algorithm library can determine that the second exposure image can be an image composed of the average value of pixels between image meanABC and image D, that is, meanABCD, when receiving the current image, such as image D.
[0228] It is understandable that the camera algorithm library can calculate the average value between the two images to retain the pixel details of each image, so that the second long exposure image has a uniform brushed image effect. For example, when the brightness value at position 2 in a certain image is 0, and the brightness value at position 2 in another adjacent image is 250, the camera algorithm library can calculate the average value to determine that the brightness value at position 2 is 125 after the two images are fused. In this way, the fused image can not only retain the brightness value of the image but also avoid the abruptness caused by the jump between adjacent images.
[0229] Similarly, the electronic device can also determine the preview image shooting parameters corresponding to the ambient light brightness using the baseAE algorithm based on the step pair shown in S1001-S1003, and generate a preview image based on the preview image shooting parameters. The long exposure preview image under scene 2 is obtained by calculating the average brightness of the preview image and other processing, and then displayed in real time on the preview screen.
[0230] S904: In response to the user ending the photographing operation, the image library obtains a second long exposure photographed image from the camera algorithm library.
[0231] The specific process of the image library obtaining the image from the camera algorithm library can be found in the description of S705, which will not be repeated here.
[0232] In the long exposure photography function, the end photography operation may be: a user triggering an end photography button in the silk flowing water photography scene.
[0233] It is understandable that, in response to the user ending the photo-taking operation, the electronic device may execute steps S904 and S906 simultaneously, or may execute steps S904 and S906 successively, which will not be described in detail here.
[0234] S905. The gallery stores the second long exposure photographed image.
[0235] S906: The camera algorithm library processes the second long-exposure photographed image into a second thumbnail.
[0236] The camera algorithm library can process the second long exposure photo image into a second thumbnail through thumbnail processing methods such as sampling or neural networks, which is not limited in this embodiment of the present application.
[0237] S907: The camera obtains a second thumbnail from the camera algorithm library.
[0238] Specifically, the camera access interface can obtain the second thumbnail from the camera algorithm library, and then the camera can obtain the second thumbnail from the camera access interface.
[0239] S908. The camera calls up the display screen to display the second thumbnail.
[0240] For example, the camera can be Figure 4 The second thumbnail is displayed in the lower left corner of the interface shown in b.
[0241] Based on this, in scenario two, the electronic device can retain the pixel details between images through the average value, so that the image obtained by shooting the flowing water can have a uniformly drawn water flow effect.
[0242] Scene 3: Image processing method for shooting gorgeous star trails.
[0243] For example, Fig.10 A flowchart of another image processing method provided in an embodiment of the present application is shown below. Fig.10 As shown, the electronic device may include one or more of the following: a gallery, a camera, a camera access interface, a camera algorithm library, a camera hardware abstraction layer, or a camera device driver, etc.
[0244] S1001. In response to a user's photographing operation, a camera device driver acquires a third image sequence according to a third photographing parameter.
[0245] The third photographing parameter may include one or more of the following: a third exposure time, or a third ISO value, etc.
[0246] The value range of the third exposure time (or referred to as the third value range) can be a range such as 5 milliseconds to 3 seconds. For example, the third exposure time can be 5 milliseconds, 200 milliseconds, 2 seconds or 3 seconds. The value of the third exposure time is not limited in the embodiment of the present application.
[0247] The third ISO value may be determined based on the third exposure amount and the third exposure time, where the third ISO value=the first exposure amount / the first exposure time. The third exposure amount may be determined by the electronic device based on the ambient light brightness.
[0248] It is understandable that since it is usually a dark sky when photographing gorgeous star trails, when the exposure time is short, the electronic device can capture a black picture; and when the exposure time is too long, such as 30 seconds, the electronic device can capture short lines formed by the stars rather than star points.
[0249] The third image sequence may include N images, where N may be an integer greater than or equal to 1.
[0250] The N images may include one or more of the following: short frames, ultra short frames, or normal frames. A short frame may be an image with an exposure time shorter than a normal frame, and an ultra short frame may be an image with an exposure time shorter than a short frame.
[0251] The images acquired in the third image sequence may include: a short frame, and N normal frames in sequence. Alternatively, the images acquired in the third image sequence may include: an ultra-short frame, a short frame, and N normal frames in sequence. In this scenario, since there is no obvious brightness jump between the short frame and the normal frame, a photographic image with a higher picture effect can be obtained.
[0252] It is understandable that, since it is necessary to preserve the dark background, stars and other obstructions when photographing the starry sky, the electronic device can preserve most of the dark light areas in the shooting scene through short frames and / or ultra-short frames to avoid the shooting result being too bright and inconsistent with the real starry sky. The electronic device can also preserve other areas in the shooting scene except the dark light area through normal frames.
[0253] In response to the user entering the gorgeous star trail photography scene, the camera device driver can obtain the ambient light brightness and determine the exposure time and ISO value corresponding to the ambient light brightness from the third XML file corresponding to smartAE. The first corresponding relationship can be seen in the description in Table 1.
[0254] Table 1 is a schematic diagram of a first correspondence relationship provided in an embodiment of the present application.
[0255] Serial number Ambient light brightness The third exposure time Third ISO value 1 150lux 5 ms 500 2 300lux 25 ms 6000 3 500lux 3 seconds 25000 … … … …
[0256] The first corresponding relationship described in Table 1 is only an example. In a possible implementation, the first corresponding relationship may include corresponding relationships between multiple groups of ambient light brightness, the third exposure time, and the third ISO value, which is not limited in the embodiments of the present application.
[0257] The first corresponding relationship may include: a short frame shooting parameter (or an ultra-short frame shooting parameter). The short frame shooting parameter (or an ultra-short frame shooting parameter) may be predetermined based on historical data of shooting the starry sky, or may be determined based on a normal frame shooting parameter. For example, the exposure of the short frame may be half or one-third of the exposure of the normal frame, etc., which is not limited in the embodiments of the present application.
[0258] In the long exposure photography function, the photography operation may be: the user triggering the photography button in the gorgeous star trail photography scene, etc.
[0259] In a possible implementation, in response to a user's photographing operation, the electronic device may acquire a third image sequence according to a third photographing parameter when it detects that there are stars in the picture.
[0260] S1002: The camera algorithm library obtains a third image sequence from the camera device driver.
[0261] S1003: The camera algorithm library performs maximum value calculation on the maximum value results of the current image and the previous frame in the third image sequence to obtain a third long exposure image.
[0262] The meaning of the maximum value calculation can be found in the step shown in S704, which will not be described in detail here.
[0263] Similarly, when the third image sequence includes image A, the camera algorithm library may determine that the third long exposure image may be image A upon receiving the current image, such as image A.
[0264] When the maximum value result of the previous frame is image A, the camera algorithm library can determine that the third exposure image can be an image composed of the maximum pixel values between images A and B when receiving the current image, such as image B, that is, obtain image maxAB.
[0265] When the maximum value result of the previous frame is image maxAB, the camera algorithm library can determine that the third exposure image can be an image composed of the maximum value of pixels between image maxAB and image C, that is, maxABC, when receiving the current image, such as image C.
[0266] When the maximum value result of the previous frame is image maxABC, the camera algorithm library can determine that the third exposure image can be an image composed of the maximum value of pixels between image maxABC and image D, that is, maxABCD, when receiving the current image, such as image D.
[0267] It is understandable that the camera algorithm library can retain the highlight pixels in each image by calculating the maximum value between the two images.
[0268] Similarly, the electronic device can also determine the preview image shooting parameters corresponding to the ambient light brightness using the baseAE algorithm based on the step pair shown in S1001-S1003, and generate a preview image based on the preview image shooting parameters. The long exposure preview image under scene three is obtained by calculating the maximum brightness value of the preview image and then displayed in real time on the preview screen.
[0269] S1004: In response to the user ending the photographing operation, the image library obtains a third long exposure photographed image from the camera algorithm library.
[0270] The specific process of the image library obtaining the image from the camera algorithm library can be found in the description of S705, which will not be repeated here.
[0271] In the long exposure photography function, the end photography operation may be: a user triggers an end photography button in a gorgeous star trail photography scene.
[0272] It is understandable that, in response to the user ending the photo-taking operation, the electronic device may execute steps S1004 and S1006 simultaneously, or may execute steps S1004 and S1006 sequentially, which will not be described in detail here.
[0273] S1005. The gallery stores the third long exposure photographed image.
[0274] S1006: The camera algorithm library processes the third long exposure photographed image into a third thumbnail.
[0275] The camera algorithm library can process the third long exposure photo image into a third thumbnail through thumbnail processing methods such as sampling or neural networks, which is not limited in this embodiment of the present application.
[0276] S1007: The camera obtains a third thumbnail from the camera algorithm library.
[0277] Specifically, the camera access interface can obtain the third thumbnail from the camera algorithm library, and then the camera can obtain the third thumbnail from the camera access interface.
[0278] S1008. The camera calls up the display screen to display the third thumbnail.
[0279] For example, the camera can be Figure 4 The third thumbnail is displayed in the lower left corner of the interface shown in b.
[0280] In order to obtain a better star trail effect in scene three, an exposure time of more than 4 minutes is required to shoot the star trails.
[0281] Based on this, in scene three, the electronic device can retain the dark background in the photographed image through short frames (or ultra-short frames) in the third image sequence, and retain other areas except the dark background through normal frames in the third image sequence, and then obtain the highlight pixels in the dark scene by calculating the maximum brightness value between adjacent images, thereby achieving the purpose of obtaining more star details in the starry sky.
[0282] It is understandable that, based on the description of the above scenarios 1, 2, and 3, when the electronic device includes different types of cameras, the electronic device can also configure corresponding photographing parameters for different cameras, so that the electronic device can obtain a long-exposure photographed image with a good photographing effect when taking pictures with any camera.
[0283] For example, the different types of cameras may include one or more of the following: a main camera, a telephoto camera, or a wide-angle camera, etc. The electronic device may obtain photographing parameters corresponding to the camera type in any scenario.
[0284] In combination with the description of scenes 1 to 3, the electronic device can obtain the photographing parameters corresponding to the current photographing scene and obtain an image sequence after responding to the photographing operation. The image sequence is processed using the image processing method corresponding to the photographing scene to obtain long-exposure photographed images under different photographing scenes. In this way, the electronic device can obtain long-exposure images with better photographing effects by processing the images under the photographing scenes separately.
[0285] exist Figure 7-10 Based on the corresponding embodiments, Fig.11 A schematic diagram of the framework of an image processing method provided in an embodiment of the present application.
[0286] like Fig.11 As shown, the electronic device can determine the shooting parameters based on the ambient light brightness in the preview screen, the ambient light brightness and the XML file. In different shooting scenes, multiple frames are obtained based on different shooting parameters, and then the shooting image is obtained based on the fusion of multiple frames, and the image is written back to the preview window.
[0287] In the busy traffic and light painting graffiti photography scenes, a first image sequence is generated based on a first photography parameter, and a first long-exposure photographic image is obtained by fusion processing of the first image sequence.
[0288] In the silk flowing water photography scene, a second image sequence is generated based on the first photography parameters, and a second long exposure photography image is obtained by fusion processing of the second image sequence.
[0289] In the gorgeous star trail photography scene, a third image sequence is generated based on the first photography parameters, and a third long exposure photography image is obtained by fusion processing of the third image sequence.
[0290] Based on this, the electronic device can obtain photographic images that are more suitable for the scene in different long-exposure photography scenarios based on different photography parameters and different image processing methods to improve the picture effect.
[0291] It should be understood that the interface provided in the embodiment of the present application is merely an example and does not constitute a limitation on the embodiment of the present application.
[0292] It should be noted that the module names involved in the embodiments of the present application can be defined as other names as long as the functions of each module can be achieved, and there is no specific restriction on the names of the modules.
[0293] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in the embodiments of the present application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0294] The image processing method of the embodiment of the present application has been described above, and the device for executing the above method provided by the embodiment of the present application is described below. Those skilled in the art can understand that the method and the device can be combined and referenced with each other, and the relevant device provided by the embodiment of the present application can execute the steps in the above list sorting method.
[0295] like Fig.12 As shown, Fig.12 A schematic diagram of the structure of an image processing device provided in an embodiment of the present application. The image processing device may be an electronic device in an embodiment of the present application, or a chip or chip system in an electronic device.
[0296] like Fig.12 As shown, the image processing apparatus 1200 can be used in a communication device, a circuit, a hardware component or a chip. The image processing apparatus 1200 includes: a display unit 1201 and a processing unit 1202 .
[0297] The display unit 1201 is used to support the display steps of the display method, for example, the display unit 1201 is used to perform Figure 4-Figure 6 , S709, S908 and the steps shown in S1008. The processing unit 1202 is used to support the image processing apparatus 1200 to perform information processing steps, for example, the processing unit 1202 is used to perform the image processing steps in S701-S708, perform the image processing steps in S901-S907, and perform the image processing steps in S1001-S1007.
[0298] In a possible implementation, the image processing apparatus 1200 may further include a communication unit 1203, and the communication unit 1203 is used to support the image processing apparatus 1200 to perform steps such as receiving or sending a message.
[0299] The image processing devices described in the embodiments of the present application may include Fig.12 The units described in the corresponding embodiments.
[0300] Specifically, the processing unit 1202 and the display unit 1201 may be integrated together, and the processing unit 1202 and the display unit 1201 may communicate with each other.
[0301] In a possible implementation, the image processing apparatus 1200 may further include: a storage unit 1204. The storage unit 1204 may include one or more memories, and the memory may be a device in one or more devices or circuits for storing programs or data.
[0302] The storage unit 1204 may exist independently and be connected to the processing unit 1202 via a communication bus. The storage unit 1204 may also be integrated with the processing unit 1202.
[0303] Taking the image processing device 1200 as an example, which can be a chip or chip system of an electronic device in an embodiment of the present application, the storage unit 1204 can store computer-executable instructions of the method of the electronic device, so that the processing unit 1202 executes the method of the electronic device in the above embodiment. The storage unit 1204 can be a register, a cache, or a random access memory (RAM), etc. The storage unit 1204 can be integrated with the processing unit 1202. The storage unit 1204 can be a read-only memory (ROM) or other types of static storage devices that can store static information and instructions, and the storage unit 1204 can be independent of the processing unit 1202.
[0304] In a possible implementation, the image processing apparatus 1200 may further include: a communication unit 1203. The communication unit 1203 is used to support the image processing apparatus 1200 to interact with other devices. Exemplarily, when the image processing apparatus 1200 is an electronic device, the communication unit 1203 may be a communication interface or an interface circuit. When the image processing apparatus 1200 is a chip or a chip system in an electronic device, the communication unit 1203 may be a communication interface. For example, the communication interface may be an input / output interface, a pin or a circuit, etc.
[0305] The device of this embodiment can be used to execute the steps executed in the above method embodiment. Its implementation principle and technical effects are similar and will not be described in detail here.
[0306] Fig.13 A schematic diagram of the hardware structure of another electronic device provided in an embodiment of the present application.
[0307] The electronic device includes a processor 1301, a communication circuit 1304 and at least one communication interface ( Fig.13 The communication interface 1303 is used as an example for explanation).
[0308] The processor 1301 may be a general-purpose central processing unit (CPU), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits for controlling the execution of the program of the present application.
[0309] Communications link 1304 may include circuitry to transmit information between the above-described components.
[0310] The communication interface 1303 uses any transceiver or other device for communicating with other devices or communication networks, such as Ethernet, wireless local area networks (WLAN), etc.
[0311] Possibly, the electronic device may further include a memory 1302 .
[0312] The memory 1302 may be a read-only memory (ROM) or other types of static storage devices that can store static information and instructions, a random access memory (RAM) or other types of dynamic storage devices that can store information and instructions, or an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed optical disc, laser disc, optical disc, digital versatile disc, Blu-ray disc, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. The memory may exist independently and be connected to the processor via a communication line 1304. The memory may also be integrated with the processor.
[0313] The memory 1302 is used to store computer-executable instructions for executing the solution of the present application, and the execution is controlled by the processor 1301. The processor 1301 is used to execute the computer-executable instructions stored in the memory 1302, thereby implementing the method provided by the embodiment of the present application.
[0314] Possibly, the computer-executable instructions in the embodiments of the present application may also be referred to as application code, and the embodiments of the present application do not specifically limit this.
[0315] In a specific implementation, as an embodiment, the processor 1301 may include one or more CPUs, such as Fig.13 CPU0 and CPU1 in.
[0316] In a specific implementation, as an embodiment, the electronic device may include multiple processors, such as Fig.13 1301 and processor 1305 in the embodiment of the present invention. Each of these processors may be a single-CPU processor or a multi-CPU processor. The processor herein may refer to one or more devices, circuits, and / or processing cores for processing data (e.g., computer program instructions).
[0317] In the above embodiments, the instructions stored in the memory for execution by the processor may be implemented in the form of a computer program product, wherein the computer program product may be pre-written in the memory, or may be downloaded and installed in the memory in the form of software.
[0318] The image processing method provided in the embodiment of the present application can be applied to electronic devices with communication functions. The electronic devices include terminal devices, and the specific device form of the terminal devices can refer to the above related descriptions, which will not be repeated here.
[0319] An embodiment of the present application provides a terminal device, which includes: a processor and a memory; the memory stores computer-executable instructions; the processor executes the computer-executable instructions stored in the memory, so that the terminal device executes the above method.
[0320] The embodiment of the present application provides a chip. The chip includes a processor, and the processor is used to call a computer program in a memory to execute the technical solution in the above embodiment. Its implementation principle and technical effect are similar to those of the above related embodiments, and will not be repeated here.
[0321] The embodiments of the present application also provide a computer-readable storage medium. The computer-readable storage medium stores a computer program. The above method is implemented when the computer program is executed by the processor. The method described in the above embodiment can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. If implemented in software, the function can be stored as one or more instructions or codes on a computer-readable medium or transmitted on a computer-readable medium. Computer-readable media 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 that can be accessed by a computer.
[0322] In one possible implementation, a computer-readable medium may include RAM, ROM, compact disc read-only memory (CD-ROM) or other optical disk storage, disk storage or other magnetic storage devices, or any other medium that is intended to carry or store the required program code in the form of instructions or data structures and can be accessed by a computer. Moreover, any connection is appropriately referred to as a computer-readable medium. For example, if a coaxial cable, fiber optic cable, twisted pair, digital subscriber line (DSL) or wireless technology (such as infrared, radio and microwave) is used to transmit software from a website, server or other remote source, the coaxial cable, fiber optic cable, twisted pair, DSL or wireless technology such as infrared, radio and microwave are included in the definition of medium. Disks and optical disks as used herein include optical disks, laser disks, optical disks, digital versatile disks (DVD), floppy disks and Blu-ray disks, where disks usually reproduce data magnetically, while optical disks reproduce data optically using lasers. Combinations of the above should also be included in the scope of computer-readable media.
[0323] An embodiment of the present application provides a computer program product, which includes a computer program. When the computer program is executed, the computer executes the above method.
[0324] The embodiments of the present application are described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processing unit of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable device to generate a machine, so that the instructions executed by the processing unit of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0325] The above specific implementation methods further illustrate the purpose, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above are only specific implementation methods of the present invention and are not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made on the basis of the technical solutions of the present invention should be included in the scope of protection of the present invention.
Claims
1. An image processing method, characterized in that: include: Displaying a first interface, wherein the first interface includes: a photo taking button and a first button for setting a shutter time; In response to an operation on the first button, displaying a second button for setting a shutter time; In a case where the shutter time is set to a first duration based on the second button, in response to an operation on the photo button, a second interface is displayed, and an image sequence within the first duration is acquired, wherein the second interface at least includes countdown information of the first duration; Performing image fusion processing on the images in the image sequence to obtain a target image; The image sequence includes at least one short frame or an ultra-short frame, and at least one normal frame, the exposure time of the normal frame is greater than the exposure time of the short frame, and the exposure time of the short frame is greater than the exposure time of the ultra-short frame; The second interface also includes: an end photo taking button; the method also includes: In response to the operation of the end shooting button, an image sequence within a second time length is acquired, and the second time length is less than the first time length; and image fusion processing is performed on the image sequence within the second time length to obtain a ninth image.
2. The method according to claim 1, characterized in that The image sequence includes: a first image and a second image, and the image fusion processing is performed on the images in the image sequence to obtain a target image, including: Adding brightness values at the same position in the first image and the second image to obtain a third image; The maximum value of the brightness values at the same position in the third image and the second image is obtained to obtain the target image.
3. The method according to claim 2, characterized in that Before adding the brightness values at the same position in the first image and the second image, the method further includes: Performing brightness correction processing on any image in the image sequence to obtain the image sequence after brightness correction, wherein the brightness correction processing is used to reduce the brightness of the image, and the image sequence after brightness correction includes: the first image after brightness correction and the second image after brightness correction; The adding of the brightness values at the same position in the first image and the second image includes: adding the brightness values at the same position in the first image after brightness correction and the second image after brightness correction to obtain the third image.
4. The method according to claim 2 or 3, characterized in that: The step of acquiring the maximum value of brightness values at the same position in the third image and the second image to obtain the target image includes: Obtaining the maximum value of brightness values at the same position in the third image and the second image to obtain a fourth image; Perform brightness correction processing on the fourth image to obtain the target image.
5. The method according to any one of claims 1 to 3, characterized in that: The image sequence includes: a fifth image and a sixth image, and the image fusion processing is performed on the images in the image sequence to obtain a target image, including: The target image is obtained by calculating an average value of the brightness values at the same position in the fifth image and the sixth image.
6. The method according to any one of claims 1 to 3, characterized in that: The image sequence includes: a seventh image and an eighth image, and the image fusion processing is performed on the images in the image sequence to obtain a target image, including: The maximum value of the brightness values at the same position in the seventh image and the eighth image is obtained to obtain the target image.
7. The method according to claim 1, characterized in that When the image sequence includes: the ultra-short frame, the short frame and the normal frame, the time for acquiring the ultra-short frame is earlier than the time for acquiring the short frame, and the time for acquiring the short frame is earlier than the time for acquiring the normal frame.
8. The method according to any one of claims 1 to 3 and 7, characterized in that: The first interface also includes a third button for turning on the filter, and the method further includes: In response to an operation on the third button, displaying at least one button for setting a filter, wherein the at least one button for setting a filter includes: a fourth button for setting a first filter; Acquiring the image sequence within the first duration includes: when the fourth button is selected, acquiring the image sequence with the first filter within the first duration.
9. The method according to any one of claims 1 to 3 and 7, characterized in that: When the electronic device is in a first photographing scene, the image sequence is determined based on a first photographing parameter, and an exposure time in the first photographing parameter satisfies a first value range; Alternatively, when the electronic device is in a second photographing scene, the image sequence is determined based on a second photographing parameter, and the exposure time in the second photographing parameter satisfies a second value range; Alternatively, when the electronic device is in a third photographing scene, the image sequence is determined based on a third photographing parameter, and the exposure time in the third photographing parameter satisfies a third value range; Among them, the maximum exposure time in the third value range is greater than the maximum exposure time in the first value range, and the minimum exposure time in the first value range is greater than the maximum exposure time in the second value range.
10. An electronic device, characterized in that: include: Processor and memory; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory, so that the electronic device performs the method according to any one of claims 1 to 9.
11. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 9 is implemented.
12. A chip system, characterized in that: The method comprises at least one processor and a communication interface, wherein the communication interface and the at least one processor are interconnected via a line, and the at least one processor is used to run a computer program or instruction to execute the method according to any one of claims 1 to 9.
13. A computer program product, characterized in that The method comprises a computer program, which, when being executed, enables a computer to execute the method according to any one of claims 1 to 9.
Citation Information
Patent Citations
Generation of simulated long exposure images in response to multiple short exposures
CN101866092A
Terminal touch method, terminal touch device and terminal
CN105630373A
Control method, control device and movable platform
CN112640423A