Photographing method, electronic device, storage medium and program product
By acquiring and processing image sequences in streamer shutter mode, real-time preview of light track images and satisfaction with the shooting effect are achieved, solving the problem of users being unable to preview light track images during the shooting process, and improving the shooting experience and effect.
Patent Information
- Application Number
- CN202310971174.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-02
- Publication Date
- 2024-10-25
- Estimated Expiration
- 2043-08-02
AI Technical Summary
In the current photography method, when capturing images through the streamer shutter mode, the user cannot obtain a preview of the light track image during the shooting process, resulting in poor shooting results.
By obtaining the image sequence collected by the camera in the light track image preview mode, if no photo request is received, whenever the number of new images in the image sequence reaches the preset value, light track fusion processing is performed to obtain the original light track image, and Perform post-processing on the preview stream to obtain a preview track image; if a photo request is received, perform light track fusion processing on the indicated image sequence to obtain a photo track image.
It enables real-time preview of the light track image without changing the native camera architecture, allowing users to observe the shooting effect in real time and end the shooting when the needs are met, ensuring that the effect of the light track image captured meets expectations.
Smart Images

Figure CN117692763B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image processing technology, and in particular to a photographing method, an electronic device, a storage medium, and a program product. Background Art
[0002] With the development of image processing technology, the shooting functions supported by electronic devices are becoming more and more powerful.
[0003] Among them, the streamer shutter can create a unique streamline effect, record the movement of light, and reflect environmental changes and object activities under different lighting conditions. Common shooting scenes include light painting graffiti, busy traffic, silky flowing water, gorgeous star trails, tripod fireworks, starry sky photography, etc.
[0004] In the process of capturing images using the light trail shutter mode based on current photography methods, the application usually sends a photo request to the underlying layer, which then processes the image and generates the final light trail image.
[0005] In addition, as far as the current camera architecture configured in electronic devices is concerned, the corresponding paths and processing flows of the camera stream data and the preview stream data are independent of each other, resulting in users having to obtain the final light track image before judging the image effect. The light track image for preview cannot be obtained during the shooting process, resulting in poor shooting effects. Summary of the Invention
[0006] The purpose of the embodiments of the present application is to provide a photographing method, electronic device, storage medium, and program product to enable preview of a light track image, thereby ensuring the imaging effect of the light track image. The specific technical solution is as follows:
[0007] In a first aspect, an embodiment of the present application provides a photographing method, which is applied to an electronic device, comprising:
[0008] In response to a light track image preview request, obtaining an image sequence captured by a camera in a light track image preview mode; the number of images included in the image sequence increases with the duration of the light track image preview mode;
[0009] If no light track image capture request is received, whenever the number of newly added images in the image sequence reaches a preset value, light track fusion processing is performed on the images in the current image sequence to obtain a first original light track image, and the first original light track image is subjected to a preview stream post-processing process to obtain a preview light track image;
[0010] If the light track image photographing request is received, light track fusion processing is performed on the image sequence indicated by the light track image photographing request to obtain a second original light track image, and the second original light track image is subjected to a photographing stream post-processing process to obtain a photographed light track image.
[0011] In one embodiment of the present application, the method further includes:
[0012] In response to the light track image photographing request in the light track image preview mode, obtaining an image sequence indicated by the light track image photographing request from a cache, and adding a photographing frame identification mark to the obtained image sequence;
[0013] For the original light track image obtained by each light track fusion process, determine whether the original light track image carries the photo frame identification mark. If so, identify the original light track image as the second original light track image; if not, identify the original light track image as the first original light track image.
[0014] In one embodiment of the present application, after acquiring the image sequence captured by the camera in the light track image preview mode, the method further includes:
[0015] The image sequence is stored in a buffer configured for the preview path.
[0016] In one embodiment of the present application, after obtaining the image sequence captured by the camera in the light track image preview mode in response to the light track image preview request, the method further includes:
[0017] Sampling the image sequence based on the sampling frame rate indicated by the light track image preview request, and caching the sampled image sequence;
[0018] The step of performing light track fusion processing on the images in the current image sequence to obtain a first original light track image whenever the number of newly added images in the image sequence reaches a preset value includes:
[0019] Whenever the number of newly added images in the sampled image sequence reaches the preset value, performing light track fusion processing on the images in the current sampled image sequence to obtain the first original light track image;
[0020] The step of performing light track fusion processing on the image sequence indicated by the light track image photographing request to obtain a second original light track image includes:
[0021] Light track fusion processing is performed on the sampled image sequence indicated by the light track image photographing request to obtain the second original light track image.
[0022] In one embodiment of the present application, the step of performing a post-processing process of a preview stream on the first original light track image to obtain a preview light track image includes:
[0023] Downsampling is performed on the first original light trajectory image to obtain the preview light trajectory image.
[0024] In one embodiment of the present application, the step of performing a post-processing process of a photographing stream on the second original light track image to obtain a photographing light track image includes:
[0025] The second original light track image is encoded into a preset output format to obtain the photographed light track image.
[0026] In one embodiment of the present application, before obtaining the image sequence captured by the camera in the preview mode in response to the preview request, the method further includes:
[0027] In response to a first operation, a first preview image is displayed through a preview interface; the first preview image is a preview image of the image currently captured by the camera, and the first operation is used to instruct the electronic device to enter a streamer shutter mode.
[0028] In one embodiment of the present application, the method further includes:
[0029] After receiving the light track image photographing request, the light track image preview mode is exited, and the first preview image is displayed through the preview interface.
[0030] In a second aspect, an embodiment of the present application provides an electronic device comprising a memory for storing computer program instructions and a processor for executing the program instructions, wherein, when the computer program instructions are executed by the processor, the electronic device is triggered to execute any one of the methods described in the first aspect.
[0031] In a third aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium includes a stored program, wherein when the program is running, the device where the computer-readable storage medium is located is controlled to execute any one of the methods in the first aspect.
[0032] In a fourth aspect, an embodiment of the present application provides a computer program product, which includes executable instructions. When the executable instructions are executed on a computer, the computer executes any one of the methods described in the first aspect.
[0033] Beneficial effects of the embodiments of the present application:
[0034] The photographing method, electronic device, storage medium, and program product provided in the embodiments of the present application respond to a light track image preview request, obtain an image sequence captured by a camera in a light track image preview mode, and if no light track image photographing request is received, whenever the number of newly added images in the image sequence reaches a preset value, perform light track fusion processing on the images in the current image sequence to obtain a first original light track image, and perform a preview stream post-processing process on the first original light track image to obtain a preview light track image; if a light track image photographing request is received, perform light track fusion processing on the image sequence indicated by the light track image photographing request to obtain a second original light track image, and perform a photographing stream post-processing process on the second original light track image to obtain a photographed light track image. It can be seen that the embodiment of the present application instructs the electronic device to start shooting the light track image by sending a light track image preview request to the underlying layer, and makes reasonable use of the preview path in the shooting architecture configured in the electronic device, so that the preview of the light track image can be realized without changing the native shooting architecture, so that the user can observe the shooting effect of the light track image in real time, and instruct the electronic device to end shooting when it is determined that the shooting effect meets the requirements. At this time, the electronic device responds to the light track image shooting request, and obtains the shooting light track image based on the image sequence indicated by the light track image shooting request, thereby ensuring that the actual effect of the shooting light track image meets the user's expectations.
[0035] Of course, it is not necessary to achieve all the advantages described above at the same time when implementing any product or method of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] Figure 1a A schematic diagram of an electronic device provided in an embodiment of the present application;
[0037] Figure 1b A software structure block diagram of an electronic device provided in an embodiment of the present application;
[0038] Figure 2 This is a structural block diagram of an electronic device provided in an embodiment of the present application;
[0039] Figure 3 1 is a flow chart of a photographing method provided in an embodiment of the present application;
[0040] Figure 4 is a schematic diagram of a mobile phone interface provided in an embodiment of the present application;
[0041] Figure 5 is a schematic diagram of the identification process of the selection module provided in an embodiment of the present application;
[0042] Figure 6 It is a structural diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0043] In order to better understand the technical solution of the present application, the embodiments of the present application are described in detail below with reference to the accompanying drawings.
[0044] In order to facilitate the clear description of the technical solutions of the embodiments of the present application, in the embodiments of the present application, words such as "first" and "second" are used to distinguish between identical or similar items with substantially the same functions and effects. For example, the first instruction and the second instruction are intended to distinguish different user instructions and do not limit their order. Those skilled in the art will 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.
[0045] It should be noted that, in this application, words such as "exemplarily" or "for example" are used to indicate examples, illustrations, or explanations. Any embodiment or design described in this application as "exemplary" or "for example" should not be construed as being preferred or advantageous over other embodiments or designs. Rather, the use of words such as "exemplarily" or "for example" is intended to present the relevant concepts in a concrete manner.
[0046] The embodiments of the present application can be applied to terminals with communication functions, such as mobile phones, tablet computers, personal computers (PCs), personal digital assistants (PDAs), smart watches, netbooks, wearable electronic devices, augmented reality (AR) devices, virtual reality (VR) devices, in-vehicle devices, smart cars, robots, smart glasses, smart TVs, etc.
[0047] For example, Figure 1a The figure shows a schematic diagram of the structure of the terminal 100. The terminal 100 may include a processor 110, a display screen 120, a camera 130, an internal memory 140, a SIM (Subscriber Identification Module) card interface 150, a USB (Universal Serial Bus) interface 160, a charging management module 170, a power management module 171, a battery 172, a sensor module 180, a mobile communication module 190, a wireless communication module 200, an antenna 1, and an antenna 2. The sensor module 180 may include a pressure sensor 180A, a fingerprint sensor 180B, a touch sensor 180C, an ambient light sensor 180D, and the like.
[0048] It should be understood that the structures illustrated in the embodiments of the present application do not constitute a specific limitation on the terminal 100. In other embodiments of the present application, the terminal 100 may include more or fewer components than shown, or may combine or separate certain components, or arrange the components differently. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0049] The processor 110 may include one or more processing units. For example, the processor 110 may include a central processing unit (CPU), an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU). The different processing units may be independent components or integrated into one or more processors. In some embodiments, the terminal 100 may also include one or more processors 110. The controller may generate operation control signals based on instruction opcodes and timing signals to control instruction fetching and execution. In other embodiments, the processor 110 may also include a memory for storing instructions and data. For example, the memory in the processor 110 may be a cache memory. This memory may store instructions or data that have just been used or are being recycled by the processor 110. If the processor 110 needs to use the instruction or data again, it can directly call it from the memory. This avoids repeated access, reduces the waiting time of the processor 110, and thus improves the efficiency of the terminal 100 in processing data or executing instructions.
[0050] In some embodiments, the processor 110 may include one or more interfaces. The interfaces may include an Inter-Integrated Circuit (I2C) interface, an Inter-Integrated Circuit Sound (I2S) interface, a Pulse Code Modulation (PCM) interface, a Universal Asynchronous Receiver / Transmitter (UART) interface, a Mobile Industry Processor Interface (MIPI), a General-Purpose Input / Output (GPIO) interface, a SIM card interface, and / or a USB interface. The USB interface 160 is an interface that complies with USB standards and may be a Mini USB interface, a Micro USB interface, a USB Type-C interface, or the like. The USB interface 160 may be used to connect a charger to charge the terminal 100, or to transfer data between the terminal 100 and peripheral devices. The USB interface 160 may also be used to connect headphones to play audio through the headphones.
[0051] It is understood that the interface connection relationship between the modules illustrated in the embodiments of the present application is for illustrative purposes only and does not constitute a structural limitation on the terminal 100. In other embodiments of the present application, the terminal 100 may also adopt different interface connection methods from the above embodiments, or a combination of multiple interface connection methods.
[0052] The wireless communication function of the terminal 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 190, the wireless communication module 200, the modem processor, and the baseband processor.
[0053] Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in terminal 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In other embodiments, the antennas can be used in conjunction with a tuning switch.
[0054] Terminal 100 implements display functions through a GPU, display screen 120, and an application processor. The GPU is a microprocessor for image processing that connects display screen 120 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. Processor 110 may include one or more GPUs that execute program instructions to generate or modify display information.
[0055] The display screen 120 is used to display images, videos, etc. The display screen 120 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a mini-LED, a micro-LED, a micro-o-LED, or a quantum dot light-emitting diode (QLED). In some embodiments, the terminal 100 may include one or more display screens 120.
[0056] In some embodiments of the present application, when the display panel adopts materials such as OLED, AMOLED, FLED, etc., the above Figure 1a The display screen 120 can be bent. Here, the display screen 120 can be bent to any angle at any position and can be maintained at that angle. For example, the display screen 120 can be folded in half from the middle to the left or right. It can also be folded in half from the middle to the top or bottom.
[0057] The display screen 120 of the terminal 100 may be a flexible screen. Currently, flexible screens have attracted much attention due to their unique characteristics and huge potential. Compared with traditional screens, flexible screens are more flexible and bendable, which can provide users with a new way of interaction based on the bendable characteristics, and can meet more user demands for the terminal. For terminals equipped with a foldable display, the foldable display on the terminal can be switched between a small screen in a folded form and a large screen in an unfolded form at any time. Therefore, users are using the split-screen function on terminals equipped with a foldable display more and more frequently.
[0058] The terminal 100 can implement a shooting function through an ISP, a camera 130, a video codec, a GPU, a display screen 120, and an application processor, wherein the camera 130 includes a front camera and a rear camera.
[0059] The ISP processes data fed back by the camera 130. For example, when shooting, the shutter is opened, and light is transmitted through the lens to the camera's photosensitive element. The light signal is converted into an electrical signal, which is then passed to the ISP for processing and converted into a visible image. The ISP can perform algorithmic optimization on image noise, brightness, and color. The ISP can also optimize parameters such as exposure and color temperature of the captured scene. In some embodiments, the ISP can be located within the camera 130.
[0060] The camera 130 is used to take photos or videos. The object generates an optical image through the lens and projects it onto the photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal oxide semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, and then passes the electrical signal to the ISP for conversion into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard red, green, blue (RGB), YUV, or other format. In some embodiments, the terminal 100 may include 1 or N cameras 130, where N is a positive integer greater than 1.
[0061] The digital signal processor is used to process digital signals. In addition to processing digital image signals, it can also process other digital signals. For example, when the terminal 100 selects a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy.
[0062] Video codecs are used to compress or decompress digital video. Terminal 100 may support one or more video codecs. This allows terminal 100 to play or record videos in various encoding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, and MPEG4.
[0063] The NPU is a neural network (NN) computing processor. Drawing on the structure of biological neural networks, such as the transmission patterns between neurons in the human brain, it rapidly processes input information and can continuously self-learn. The NPU enables intelligent cognitive applications in the terminal 100, such as image recognition, face recognition, speech recognition, and text comprehension.
[0064] The internal memory 140 can be used to store one or more computer programs, which include instructions. The processor 110 can execute the above instructions stored in the internal memory 140, so that the terminal 100 performs the video segmentation method provided in some embodiments of the present application, as well as various applications and data processing. The internal memory 140 may include a program storage area and a data storage area. The program storage area may store an operating system; the program storage area may also store one or more applications (such as a gallery, contacts, etc.). The data storage area may store data created during the use of the terminal 100 (such as photos, contacts, etc.). In addition, the internal memory 140 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more disk storage components, a flash memory component, a universal flash memory (UFS), etc. In some embodiments, the processor 110 can execute the video segmentation method provided in the embodiments of the present application, as well as other applications and data processing by executing the instructions stored in the internal memory 140 and / or the instructions stored in the memory provided in the processor 110.
[0065] The internal memory 140 can be used to store the relevant programs of the video segmentation method provided in the embodiment of the present application, and the processor 110 can be used to call the relevant programs of the video segmentation method stored in the internal memory 140 when displaying information to execute the video segmentation method of the embodiment of the present application.
[0066] The sensor module 180 may include a pressure sensor 180A, a fingerprint sensor 180B, a touch sensor 180C, an ambient light sensor 180D, and the like.
[0067] Pressure sensor 180A is used to sense pressure signals and convert them into electrical signals. In some embodiments, pressure sensor 180A can be located on display screen 120. There are many types of pressure sensors 180A, including resistive, inductive, and capacitive pressure sensors. A capacitive pressure sensor may comprise at least two parallel plates made of conductive material. When force is applied to pressure sensor 180A, the capacitance between the electrodes changes, and terminal 100 determines the intensity of the pressure based on the change in capacitance. When a touch operation is applied to display screen 120, terminal 100 detects the touch operation based on pressure sensor 180A. Terminal 100 can also calculate the touch location based on the detection signal from pressure sensor 180A. In some embodiments, touch operations applied to the same touch location but with different touch operation intensities can correspond to different operation instructions. For example, when a touch operation with an intensity less than a first pressure threshold is applied to a short message application icon, a command to view short messages is executed; when a touch operation with an intensity greater than or equal to the first pressure threshold is applied to a short message application icon, a command to create a new short message is executed.
[0068] The fingerprint sensor 180B is used to collect fingerprints. The terminal 100 can use the collected fingerprint characteristics to implement functions such as unlocking, accessing application locks, taking photos, and answering calls.
[0069] Touch sensor 180C, also known as a touch-sensitive device, can be provided on display screen 120. Touch sensor 180C and display screen 120 form a touch screen, also known as a touchscreen. Touch sensor 180C is used to detect touch operations applied thereto or in the vicinity thereof. Touch sensor 180C can transmit the detected touch operations to an application processor to determine the type of touch event. Visual output related to the touch operations can be provided via display screen 120. In other embodiments, touch sensor 180C can also be provided on the surface of terminal 100, in a different location from display screen 120.
[0070] Ambient light sensor 180D is used to sense ambient light brightness. Terminal 100 can adaptively adjust the brightness of display screen 120 based on the perceived ambient light brightness. Ambient light sensor 180D can also be used to automatically adjust white balance during photography. Ambient light sensor 180D can also transmit information about the device's environment to the GPU.
[0071] The ambient light sensor 180D is also used to obtain the brightness, light ratio, color temperature, etc. of the acquisition environment in which the camera 130 captures images.
[0072] Taking the electronic device as a smart phone as an example, the photographing method in the embodiment of the present application can be performed by Figure 1b The smartphone system architecture shown is implemented in Figure 1b The smartphone system architecture includes the kernel, framework and application layers. The kernel includes the driver layer and real-time operating system. The driver layer includes GPU (graphics processor), display driver (LCD driver in the figure), TP driver (touch screen driver), buttons, etc. The real-time operating system includes interrupt management, task scheduling, and MEM (memory management). The framework layer includes basic system capabilities, underlying software services, hardware service capabilities, etc. The application layer includes shooting applications, display applications, system applications, communication applications, etc.
[0073] Figure 2 It is a structural block diagram of the electronic device provided in the embodiment of the present application. For ease of understanding, the software system of the electronic device involved in the embodiment of the present application is exemplarily described below. The software system inside the electronic device can specifically adopt a layered architecture, which may include an application layer (Applications, APP) and a hardware abstraction layer (HardwareAbstrast Layer, HAL). The functions of the APP layer and the HAL layer are briefly described below. For other system layers that may be present in the software system and the specific functions of each system layer, please refer to the description in the relevant technology.
[0074] The APP layer may specifically include various application packages. For example, the APP layer may specifically include a camera application for taking photos, a gallery application for storing images, and the like.
[0075] The HAL layer is an interface layer between the operating system kernel and the hardware circuit. Its purpose is to abstract the hardware. The HAL layer can include multiple functional modules. Figure 2 The HAL layer may include a streamer shutter algorithm module, or an algorithm module, for performing light track fusion processing on multiple images to obtain an original light track image, and a selection module for selecting whether to process the original light track image obtained by the algorithm module into a preview light track image or a photo light track image for output.
[0076] Based on the structure of the above electronic device, the present application embodiment provides a method for taking pictures, see Figure 3 The photographing method provided by this application specifically includes the following steps:
[0077] Step S301: in response to a light track image preview request, obtaining an image sequence captured by a camera in a light track image preview mode; the number of images included in the image sequence increases with the duration of the light track image preview mode.
[0078] In actual applications, electronic devices may support multiple shooting modes, such as normal shooting mode, panoramic shooting mode, etc. The shooting mode involved in the embodiment of the present application is specifically the streamer shutter mode.
[0079] Specifically, the native camera architecture configured within an electronic device typically distinguishes between a photo mode and a preview mode, and the image processing flows and corresponding processing paths within the electronic device differ between the two modes. It should be noted that in the embodiments of the present application, when a user needs to capture a light trail image, the electronic device will specifically capture the image sequence in the light trail image preview mode, i.e., the preview mode within the streamer shutter mode.
[0080] In addition, after the electronic device responds to the light track image preview request and enters the light track image preview mode, the camera will continue to capture images. Therefore, as the time of entering the light track image preview mode increases, the number of images in the image sequence in the embodiment of the present application will continue to increase.
[0081] Step S302: If no light track image capture request is received, whenever the number of newly added images in the image sequence reaches a preset value, light track fusion processing is performed on the images in the current image sequence to obtain a first original light track image, and the first original light track image is post-processed with a preview stream to obtain a preview light track image.
[0082] Specifically, the shooting of the light track image is based on the original implementation of stacking, that is, a large number of images are collected within a certain period of time, and then the static background pictures in these images are retained based on the relevant algorithm, and the dynamic difference parts in each image are synthesized to obtain the final image, so that the motion trajectory of the light can be presented in the final image. In the embodiment of the present application, this process is called light track fusion processing, which can be specifically achieved through Figure 2 The specific processing process involved can be referred to the content of the relevant technology and will not be described in detail here.
[0083] As mentioned in the above step S302, when the electronic device is in the light track image preview mode, the camera will continue to collect image sequences. During this process, in order to facilitate the user to judge the shooting effect of the light track image in real time, a preset value can be set in advance. Whenever the number of images in the image sequence reaches the preset value, the light track fusion processing can be performed on the current image sequence to obtain the first original light track image.
[0084] The size of the preset value can be selected based on actual needs, and the embodiments of the present application do not limit this. As an example, in order to ensure the preview effect, the preset value can be set to 1, that is, every time the camera captures an image, the electronic device will perform light track fusion processing based on the current image sequence. In this case, when the camera captures the nth image, the algorithm module performs light track fusion processing on the n images captured, and when the camera captures the n+1th image, the algorithm module performs light track fusion processing on the n+1 images captured.
[0085] After each acquisition of the first original image, the preview stream post-processing process can be performed on the first original light track image based on actual preview requirements to obtain a preview light track image, which is then displayed through the preview interface of the electronic device. As the number of images in the acquired image sequence gradually increases, the number of images used for light track fusion processing also increases, and the light track in each preview light track image gradually lengthens. Therefore, users can observe the light track formation process in real time on the preview interface.
[0086] Among them, the post-processing process for the preview stream can refer to the content in the relevant technology, and the embodiments of this application will not be described in detail.
[0087] Step S303: If a light track image photographing request is received, light track fusion processing is performed on the image sequence indicated by the light track image photographing request to obtain a second original light track image, and a photographing stream post-processing process is performed on the second original light track image to obtain a photographed light track image.
[0088] As mentioned in step S302 above, the user can observe the light track formation process in real time based on the preview light track image. Thus, when the user observes the ideal light track image display effect, the user can instruct the electronic device to take a photo. Therefore, when the electronic device is in the light track image preview mode, if a light track image photo taking request is received, the electronic device can perform light track fusion processing on the image sequence indicated by the light track image photo taking request to obtain a second original light track image, and then perform the photo stream post-processing process on the second original light track image to obtain a photo light track image.
[0089] In the embodiment of the present application, since the user can observe the light track formation process in real time based on the preview light track image, the image sequence indicated by the light track image photo taking request can also be understood as the image sequence corresponding to the preview light track image being displayed on the preview interface when the user interacts with the electronic device to instruct the electronic device to take a photo. Therefore, it can be ensured that the image effect of the final photo light track image meets the user's expectations.
[0090] For example, if the user instructs the electronic device to end shooting and output the photo light track image, the preview interface is displaying the preview light track image obtained based on the first n frames of images captured in the light track image preview mode. In this case, it can be considered that these first n frames of images are the image sequence indicated by the light track image shooting request.
[0091] Among them, the post-processing process of the photo stream can also refer to the content in the relevant technology, and the embodiments of this application will not go into details about it.
[0092] Figure 4 This is a schematic diagram of the mobile phone interface provided by the embodiment of the present application. The following takes the mobile phone as an example. Figure 2 and Figure 4 The actual application process of the embodiment of the present application is exemplified.
[0093] As an example, in actual application scenarios, when the user needs to preview the light track image, he can first select Figure 4 The light trail shutter option in the photo app interface shown in the figure instructs the electronic device to enter the light trail shutter mode. In this case, the real scene is observed through the normal preview. When it is determined that the real scene is suitable for starting to shoot light trail images, the corresponding control is clicked, such as Figure 4 401 shown in the figure can instruct the electronic device to enter the light track image preview mode. In response to the user's interaction, the APP sends the preview instruction in the light stream shutter mode, that is, the light track image preview request, to the HAL to start taking pictures. The camera collects the image sequence in the light track image preview mode.
[0094] In this case, if no light track image capture request is received, each time the number of newly added images in the image sequence reaches a preset value, the algorithm module performs light track fusion processing on the current image sequence to obtain a first original light track image, and the selection module inputs the first original light track image into the post-processing path corresponding to the preview stream to obtain a preview light track image, and displays the preview light track image, so that the user can perform a light stream shutter preview on the preview interface and observe the light track formation process in real time.
[0095] When the user is previewing the light trail based on the preview interface, if the user observes that the preview light trail image meets the requirements, the user can click the corresponding control, such as clicking Figure 4 401 shown in the figure instructs the electronic device to end shooting. The algorithm module performs light track fusion processing on the image sequence indicated by the user to obtain a second original light track image. The selection module inputs the second original light track image into the post-processing path corresponding to the photo stream to obtain the final image, that is, the photo light track image.
[0096] The photographing method provided in an embodiment of the present application responds to a light track image preview request, obtains an image sequence captured by a camera in a light track image preview mode, and if no light track image photographing request is received, whenever the number of newly added images in the image sequence reaches a preset value, performs light track fusion processing on the images in the current image sequence to obtain a first original light track image, and performs a preview stream post-processing process on the first original light track image to obtain a preview light track image; if a light track image photographing request is received, performs light track fusion processing on the image sequence indicated by the light track image photographing request to obtain a second original light track image, and performs a photographing stream post-processing process on the second original light track image to obtain a photographed light track image. It can be seen that the embodiment of the present application instructs the electronic device to start shooting the light track image by sending a light track image preview request to the underlying layer, and makes reasonable use of the preview path in the shooting architecture configured in the electronic device, so that the preview of the light track image can be realized without changing the native shooting architecture, so that the user can observe the shooting effect of the light track image in real time, and instruct the electronic device to end shooting when it is determined that the shooting effect meets the requirements. At this time, the electronic device responds to the light track image shooting request, and obtains the shooting light track image based on the image sequence indicated by the light track image shooting request, thereby ensuring that the actual effect of the shooting light track image meets the user's expectations.
[0097] In one embodiment of the present application, the photographing method provided in the embodiment of the present application further includes:
[0098] In response to a light track image photographing request in the light track image preview mode, obtaining an image sequence indicated by the light track image photographing request from a cache, and adding a photographing frame identification mark to the obtained image sequence;
[0099] For the original light track image obtained by each light track fusion process, determine whether the original light track image carries a photo frame identification mark. If so, identify the original light track image as the second original light track image; if not, identify the original light track image as the first original light track image.
[0100] Figure 5 This is a schematic diagram of the identification process of the selection module provided in the embodiment of the present application. Figure 5 The photographing method provided in the embodiment of the present application is exemplified.
[0101] Specifically, the electronic device may be configured with a cache for storing images. When the camera captures an image sequence, the electronic device may write the current image captured by the camera into the cache, so that the current image sequence can be stored in the cache.
[0102] Based on the above embodiments of the present application, it can be seen that the image acquisition process of the present application is specifically carried out in the light track image preview mode. Therefore, in order to facilitate algorithm processing and simplify the path process, as far as the algorithm module is concerned, it is not necessary to distinguish whether the input image is a photo frame or a preview frame. That is, the algorithm module is unaware of the front-end image output, and there is no difference in the light track fusion processing process between the photo frame and the preview frame.
[0103] However, the photo frame and preview frame have different post-processing processes. To facilitate determining the corresponding post-processing process after obtaining the original light track image output by the algorithm module, when a light track image photo request is received, the image sequence indicated by the light track image photo request can be retrieved from the cache and a photo frame identification tag can be added to the acquired image sequence. The photo frame identification tag can be specifically added to one or more image frames in the image sequence.
[0104] Therefore, when no light track image photo taking request is received, the image sequence input to the algorithm module will not be added with a photo frame identification mark. After the algorithm module performs light track fusion processing on the image sequence and outputs the original light track image to the selection module, the selection module determines that there is no distinguishing mark, i.e., the photo frame identification mark, in the input image information, and then identifies the input image information as a preview frame, i.e., the first original light track image, and thus inputs the first original light track image into the post-processing path corresponding to the preview stream, and finally obtains a preview light track image for preview.
[0105] When a light track image photo taking request is received, the electronic device obtains the corresponding image sequence from the cache and inputs the image sequence with the photo frame identification mark added to the algorithm module. After the algorithm module performs light track fusion processing on the input image sequence and outputs the original light track image to the selection module, the photo frame identification mark added to the image frame can be retained in the original light track image after the light track fusion processing. Therefore, the selection module determines the presence of a distinguishing mark in the input image information and identifies the input image information as a photo frame, that is, the second original light track image, and thus inputs the second original light track image into the post-processing path corresponding to the photo stream, and finally obtains the photo light track image.
[0106] The photography method provided in the embodiment of the present application, in response to a light track image photography request, obtains the image sequence indicated by the light track image photography request from the cache, adds a photography frame identification tag to the obtained image sequence, and distinguishes between the photography frame and the preview frame based on the photography frame identification tag. Therefore, in the case where light track fusion processing is required for both the photography frame and the preview frame, the algorithm module does not need to distinguish between the photography frame and the preview frame. Instead, the subsequent selection module identifies the original light track image output by the algorithm module as the first original light track image or the second original light track image based on the photography frame identification tag, and determines the corresponding post-processing process for the photography frame and the preview frame, which facilitates the algorithm module to perform image processing and simplifies the path process.
[0107] In one embodiment of the present application, after obtaining the image sequence captured by the camera in the light track image preview mode, the method further includes:
[0108] Saves the image sequence into a cache configured for the preview pass.
[0109] As mentioned above, with respect to the native camera architecture configured in the electronic device, the preview stream and the camera stream correspond to different processing flows and pathways. For the current light track image photography scheme, to start shooting the light track image, it is achieved by issuing a photo request. In the embodiment of the present application, a light track image preview request is issued. In this case, the image sequence captured by the camera can be stored specifically through the cache configured for the preview pathway. It should be understood that the cache configured for the preview pathway and the photo pathway is specifically used to achieve different needs, and there are differences in the pathways and functions.
[0110] Implementing a preview function when issuing a photo request for light trail image capture doesn't conform to the inherent logic of the photo framework's internal pathways and requires modifications to the existing photo framework, making this solution difficult to implement. Furthermore, when issuing a photo request for light trail image capture, the image sequence captured by the camera is stored in a cache configured for the photo pipeline. This cache's performance isn't compatible with preview requirements, so even if previewing is possible, it can be unsatisfactory.
[0111] In an embodiment of the present application, the shooting of the light track image is started by issuing a light track image preview request, so that the image captured by the camera will be stored in the cache configured for the preview image, the internal path of the photo frame is reasonably utilized, and the internal cache management is reasonable, so that the preview effect of the preview light track image can be guaranteed while facilitating the realization of the light track image preview.
[0112] In one embodiment of the present application, after obtaining the image sequence captured by the camera in the light track image preview mode in response to the light track image preview request, the method further includes:
[0113] Sampling the image sequence based on the sampling frame rate indicated by the light track image preview request, and caching the sampled image sequence;
[0114] The aforementioned step of performing light track fusion processing on the images in the current image sequence to obtain a first original light track image whenever the number of newly added images in the image sequence reaches a preset value includes:
[0115] Whenever the number of newly added images in the sampled image sequence reaches a preset value, light track fusion processing is performed on the images in the current sampled image sequence to obtain a first original light track image;
[0116] The aforementioned step of performing light track fusion processing on the image sequence indicated by the light track image photographing request to obtain a second original light track image includes:
[0117] A light track fusion process is performed on the sampled image sequence indicated by the light track image photographing request to obtain a second original light track image.
[0118] Specifically, the internal camera architecture of the electronic device has a fixed frame rate in the camera mode and does not support adjustment, resulting in a relatively uniform light trail image. However, the frame rate in the preview mode is adjustable. The embodiment of the present application captures light trail images in the streamer shutter preview mode. Therefore, the required frame rate can be determined based on actual needs, reducing the processing load of the electronic device and improving the uniformity of the light trail image.
[0119] In one embodiment of the present application, the aforementioned post-processing process of performing a preview stream on the first original light track image to obtain a preview light track image includes:
[0120] Downsampling is performed on the first original light trajectory image to obtain a preview light trajectory image.
[0121] In actual applications, the preview light track image is only used by the user to determine whether the currently generated light track effect meets the user's expectations. Therefore, the image resolution requirement is lower than that of the photo light track image. Therefore, to reduce the processing load of the electronic device displaying the preview light track image and improve preview efficiency, the first original light track image can be downsampled to reduce the resolution of the original light track image to obtain the preview light track image, and the preview light track image can be displayed through the preview interface.
[0122] In one embodiment of the present application, the aforementioned step of performing a post-processing process of the second original light track image to obtain a photographic light track image includes:
[0123] The second original light track image is encoded into a preset output format to obtain a photographic light track image.
[0124] Specifically, to obtain a photo light trail image, the image needs to be output to an output format supported by the electronic device. Therefore, based on the actual configuration of the electronic device, the second original light trail image can be encoded into a preset output format to obtain the final photo light trail image. As an example, the preset output format can be JPEG (Joint Photographic Experts Group, an image file format).
[0125] In one embodiment of the present application, before obtaining the image sequence captured by the camera in the preview mode in response to the preview request, the method further includes:
[0126] In response to the first operation, a first preview image is displayed through the preview interface; the first preview image is a preview image of the image currently captured by the camera, and the first operation is used to instruct the electronic device to enter the streamer shutter mode.
[0127] In an embodiment of the present invention, after a request is made to preview the light track image and before a request is made to take a photo of the light track image, the images captured by the camera will all be used to generate the original light track image. Because, in order to ensure the effect of the light track image, after the electronic device enters the streamer shutter mode and before a request is made to preview the light track image, the image can be displayed in a normal preview mode. Specifically, for the image frame currently captured by the camera, the image frame is processed into a first preview image that meets the preview requirements, and the first preview image is displayed through the preview interface. In this case, the user can observe the real scene based on the first preview image, and when it is determined that the real scene is suitable for starting to shoot the light track image, the electronic device is instructed to enter the light track image preview mode, start shooting the light track image, and ensure the imaging effect of the light track image.
[0128] Specifically, the user can instruct the electronic device to enter the streamer shutter mode through the first operation, the first operation is specifically an interactive behavior with the photo APP, and the specific category of the first operation needs to be determined according to the specific involvement of the photo APP. Figure 4 For example, the first operation is to select the light stream shutter option from the multiple shooting modes below the preview interface.
[0129] In one embodiment of the present application, after receiving a light track image photographing request, the light track image preview mode may be exited, and the first preview image may be displayed through the preview interface.
[0130] Specifically, since the user can observe the shooting effect of the light track image in real time through the preview interface, after receiving the light track image shooting request, it can be considered that the light track image that meets the user's needs has been captured, so the light track image preview mode can be exited and the image can be displayed through the normal preview mode, that is, the first preview image corresponding to the image frame currently captured by the camera is displayed through the preview interface to reduce the image processing load of the electronic device.
[0131] Figure 6 This is a schematic diagram of the structure of the electronic device provided in the embodiment of the present application. Figure 6 The photographing method provided in the embodiment of the present application is further described.
[0132] Specifically, after the upper layer and lower light track image preview request, the camera collects the image sequence in the light track image preview mode. At this time, the relevant sensors configured in the electronic device, such as T sensor, w sensor and uw sensor, detect the signals collected by the camera, obtain the image data corresponding to the image sequence, and output the image data to IFE (Image Front End, an image data processing hardware module) for processing. For example, the image data is output to IFE 0, IFE 1 and IFE 2 shown in the figure for processing to obtain RAW (an image data format) data and META (metadata) corresponding to the processed image data.
[0133] When no light track image shooting request is received, the RAW data and META corresponding to the image sequence are input into the pipeline for image processing with the source data module as the entry. The raw2yuv module is used to encode the image data corresponding to the image sequence into YUV (an image data format), that is, convert the RAW format data corresponding to the image sequence into YUV format, and input the YUV format image data into the algorithm module. The algorithm module performs light track fusion processing on the input image data, and passes the obtained original light track image to the selection module. The selection module determines that it does not carry a photo frame identification mark, identifies the original light track image as the first original light track image, and passes the first original light track image to the post-processing module corresponding to the preview stream through the output port connected to the streamer shutter preview path, that is, passes it to the ISP (Image Signal Processor) module for downsampling processing to obtain a preview light track image, and sends the preview light track image to the preview.
[0134] At the same time, the ZSL Buffer (Zero Shutter Lag Buffer) can cache the image data output by the IFE. When a light track image photo request is received, the image data corresponding to the image sequence indicated by the light track image photo request is obtained from the ZSL Buffer, and the image data after adding the photo frame identification mark is input into the sourc module. The subsequent processing flow from the raw2yuv module to the algorithm module is consistent with the case where no light track image photo request is received. It will not be repeated here. After the algorithm module outputs the original light track image to the selection module, the selection module determines whether it carries the photo frame identification mark and identifies the original light track image as the second original light track image. The second original light track image is passed to the post-processing module corresponding to the photo stream through the output port connected to the stream shutter photo path, that is, it is passed to the JPEG module to encode the second original light track image into JPEG format to obtain the final photo light track image, and the photo light track image is sent to the application's Capture Buffer.
[0135] It can be seen that the photographing method provided in the embodiment of the present application starts the photographing of the light track image by issuing a light track image preview request, makes reasonable use of the internal path of the photographing frame, and has reasonable cache management. In addition, the selection module distinguishes between the photographing frame and the preview frame at the bottom layer, and the algorithm module does not need to distinguish between the photographing frame and the preview frame, and the path design is simple.
[0136] In a specific implementation, the present application further provides a computer storage medium, wherein the computer storage medium may store a program, wherein when the program is executed, the device containing the computer-readable storage medium is controlled to perform some or all of the steps in the above embodiment. The above storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).
[0137] In a specific implementation, an embodiment of the present application further provides a computer program product, which includes executable instructions. When the executable instructions are executed on a computer, the computer executes some or all of the steps in the above method embodiment.
[0138] The various embodiments of the mechanisms disclosed in this application can be implemented in hardware, software, firmware, or a combination of these implementation methods. The embodiments of the present application can be implemented as a computer program or program code executed on a programmable system, which includes at least one processor, a storage system (including volatile and non-volatile memory and / or storage elements), at least one input device, and at least one output device.
[0139] Program code can be applied to input instructions to perform the functions described herein and generate output information. The output information can be applied to one or more output devices in a known manner. For the purposes of this application, a processing system includes any system having a processor such as, for example, a digital signal processor (DSP), a microcontroller, an application specific integrated circuit (ASIC), or a microprocessor.
[0140] Program code can be implemented with a high-level programming language or an object-oriented programming language to communicate with the processing system. Where necessary, program code can also be implemented in assembly language or machine language. In fact, the mechanism described in this application is not limited to the scope of any particular programming language. In either case, the language can be a compiled language or an interpreted language.
[0141] In some cases, the disclosed embodiments can be implemented in hardware, firmware, software or any combination thereof. The disclosed embodiments can also be implemented as instructions carried or stored on one or more temporary or non-temporary machine-readable (e.g., computer-readable) storage media, which can be read and executed by one or more processors. For example, instructions can be distributed over a network or by other computer-readable media. Therefore, machine-readable media can include any mechanism for storing or transmitting information in a machine (e.g., computer) readable form, including but not limited to, floppy disks, optical disks, optical disks, compact disc read-only memories (Compact Disc Read Only Memory, CD-ROMs), magneto-optical disks, read-only memories (ROM), random access memories (RAM), erasable programmable read-only memories (EPROM), electrically erasable programmable read-only memories (EEPROM), magnetic cards or optical cards, flash memory, or tangible machine-readable memories for transmitting information (e.g., carrier waves, infrared signal digital signals, etc.) using the Internet in electrical, optical, acoustic or other forms of propagation signals. Accordingly, machine-readable media includes any type of machine-readable media suitable for storing or transmitting electronic instructions or information in a form readable by a machine (eg, a computer).
[0142] In the accompanying drawings, some structural or method features may be shown in a particular arrangement and / or order. However, it should be understood that such a particular arrangement and / or order may not be required. Rather, in some embodiments, these features may be arranged in a manner and / or order different from that shown in the accompanying drawings. In addition, the inclusion of a structural or method feature in a particular figure does not imply that such a feature is required in all embodiments, and in some embodiments, such features may not be included or may be combined with other features.
[0143] It should be noted that the units / modules mentioned in the various device embodiments of the present application are all logical units / modules. Physically, a logical unit / module can be a physical unit / module, or a part of a physical unit / module, or can be implemented as a combination of multiple physical units / modules. The physical implementation of these logical units / modules themselves is not the most important. The combination of functions implemented by these logical units / modules is the key to solving the technical problems raised by this application. In addition, in order to highlight the innovative part of this application, the above-mentioned device embodiments of this application do not introduce units / modules that are not closely related to solving the technical problems raised by this application. This does not mean that other units / modules do not exist in the above-mentioned device embodiments.
[0144] It should be noted that in the examples and description of this patent, relational terms such as first and second, etc. are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device that includes a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "including a" does not exclude the presence of other identical elements in the process, method, article or device that includes the element.
[0145] Although the present application has been shown and described with reference to certain preferred embodiments thereof, it will be understood by those skilled in the art that various changes in form and details may be made therein without departing from the spirit and scope of the application.
Claims
1. A photographing method, characterized in that: Applied to electronic equipment, the method comprises: In response to a light track image preview request, an image sequence captured by a camera is acquired in a light track image preview mode; the number of images included in the image sequence increases with the duration of the light track image preview mode; If no light track image shooting request is received, whenever the number of newly added images in the image sequence reaches a preset value, light track fusion processing is performed on the images in the current image sequence to obtain a first original light track image, and a preview stream post-processing process is performed on the first original light track image to obtain a preview light track image; If the light track image photographing request is received, light track fusion processing is performed on the image sequence indicated by the light track image photographing request to obtain a second original light track image, and a photographing stream post-processing process is performed on the second original light track image to obtain a photographing light track image; In response to the light track image photographing request in the light track image preview mode, acquiring an image sequence indicated by the light track image photographing request from a cache, and adding a photographing frame identification mark to the acquired image sequence; For the original light track image obtained by each light track fusion processing, determine whether the original light track image carries the photo frame identification mark. If so, identify the original light track image as the second original light track image. If not, identify the original light track image as the first original light track image.
2. The method according to claim 1, characterized in that After acquiring the image sequence captured by the camera in the light track image preview mode, the method further includes: The image sequence is stored in a buffer configured for the preview pass.
3. The method according to claim 1, characterized in that After the image sequence captured by the camera is acquired in the light track image preview mode in response to the light track image preview request, the method further includes: Based on the sampling frame rate indicated by the light track image preview request, sampling the image sequence, and caching the sampled image sequence; Whenever the number of newly added images in the image sequence reaches a preset value, performing light track fusion processing on the images in the current image sequence to obtain a first original light track image comprises: Whenever the number of newly added images in the sampled image sequence reaches the preset value, performing light track fusion processing on the images in the current sampled image sequence to obtain the first original light track image; The step of performing light track fusion processing on the image sequence indicated by the light track image photographing request to obtain a second original light track image includes: A light track fusion process is performed on the sampled image sequence indicated by the light track image photographing request to obtain the second original light track image.
4. The method according to claim 1, characterized in that: The step of performing a post-processing process of performing a preview stream on the first original light track image to obtain a preview light track image includes: Down-sampling is performed on the first original light trajectory image to obtain the preview light trajectory image.
5. The method according to claim 1, characterized in that The step of performing a post-processing process of the second original light track image to obtain a photographic light track image includes: The second original light track image is encoded into a preset output format to obtain the photographed light track image.
6. The method according to claim 1, characterized in that Before obtaining the image sequence captured by the camera in the preview mode in response to the preview request, the method further includes: In response to a first operation, a first preview image is displayed through a preview interface; the first preview image is a preview image of an image currently captured by the camera, and the first operation is used to instruct the electronic device to enter a streamer shutter mode.
7. The method according to claim 6, characterized in that The method further comprises: After receiving the light track image photographing request, the light track image preview mode is exited, and the first preview image is displayed through the preview interface.
8. An electronic device, characterized in that: include: one or more processors and memory; The memory is coupled to the one or more processors, and the memory is used to store computer program codes, wherein the computer program codes include computer instructions, and the one or more processors call the computer instructions to enable the electronic device to perform the method as claimed in any one of claims 1 to 7.
9. A computer-readable storage medium, characterized in that: The method comprises a computer program, which, when executed on an electronic device, enables the electronic device to execute the method according to any one of claims 1 to 7.
10. A computer program product, characterized in that The computer program product comprises executable instructions, and when the executable instructions are executed on a computer, the computer is caused to execute the method according to any one of claims 1 to 7.
