Photo generation method and device, electronic equipment and medium

By starting to capture and store the original image after receiving the user's shooting instructions, and only storing the necessary number of images to generate photos, the problem of excessive power consumption of electronic devices caused by zero-delay photography is solved, and the energy efficiency during the shooting process is achieved reduce.

CN119094887AActive Publication Date: 2024-12-06VIVO MOBILE COMM CO LTD
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202411142179.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-19
Publication Date
2024-12-06
Estimated Expiration
2044-08-19

AI Technical Summary

Technical Problem

The existing zero-delay photography method causes electronic devices to continuously capture and store original images in the shooting preview mode, resulting in excessive power consumption, but very few original images used to generate photos, resulting in unnecessary waste of energy.

Method used

After receiving the user's shooting instructions, the original image will be captured and stored, and only a certain number of images (N pictures) will be stored before stopping. Photos will be generated based on these images, thereby reducing unnecessary image capture and storage operations and reducing the power Consumption.

Benefits of technology

By capturing and storing original images only when needed, unnecessary operations during the photo shooting process are significantly reduced, power consumption of electronic devices is reduced, and shooting efficiency and energy efficiency are improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119094887A_ABST
    Figure CN119094887A_ABST
Patent Text Reader

Abstract

The invention discloses a photo generation method and device, electronic equipment and a medium, and belongs to the technical field of image processing. The method comprises the steps that first input of a user is received, the input moment of the first input is the first moment, and the first input is used for indicating photographing; in response to the first input, N original images are stored in a cache queue, the original images are stored in the cache queue from the first moment, and N is a positive integer; and generating a photo according to the N original images.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of image processing technology, and specifically relates to a method, device, electronic device and medium for generating a photo. Background Art

[0002] Nowadays, more and more electronic devices have the function of taking photos, and the photo taking method of these electronic devices is usually zero-delay photo taking. When an electronic device takes a photo with zero delay, every time the electronic device enters the preview mode of taking a photo, the electronic device will continuously capture the original image (raw image) and store each frame of the original image in the memory area of ​​the electronic device until the user clicks the photo button.

[0003] This method requires caching a large number of original images in the electronic device, but only a few original images are used to generate photos, which causes excessive power consumption of the electronic device. Summary of the invention

[0004] The purpose of the embodiments of the present application is to provide a method, device, electronic device and medium for generating photos, which can solve the technical problem of excessive power consumption of electronic devices caused by existing zero-delay photography.

[0005] In a first aspect, an embodiment of the present application provides a method for generating a photo, the method comprising:

[0006] receiving a first input from a user, where the input time of the first input is a first time, and the first input is used to instruct taking a photo;

[0007] In response to the first input, N original images are stored in a cache queue, wherein the original images are stored in the cache queue starting from the first moment, and N is a positive integer;

[0008] A photo is generated according to the N original images.

[0009] In a second aspect, an embodiment of the present application provides a device for generating a photo, the device comprising:

[0010] A first receiving module, used to receive a first input from a user, where the input time of the first input is a first time, and the first input is used to instruct taking a photo;

[0011] A first storage module, configured to store N original images in a cache queue in response to the first input, wherein the original images are stored in the cache queue starting from the first moment, and N is a positive integer;

[0012] A generating module is used to generate photos according to the N original images.

[0013] In a third aspect, an embodiment of the present application provides an electronic device, which includes a processor and a memory, wherein the memory stores programs or instructions that can be run on the processor, and when the programs or instructions are executed by the processor, the steps of the method provided in the first aspect are implemented.

[0014] In a fourth aspect, an embodiment of the present application provides a readable storage medium, on which a program or instruction is stored, and when the program or instruction is executed by a processor, the steps of the method provided in the first aspect are implemented.

[0015] In a fifth aspect, an embodiment of the present application provides a chip, the chip including a processor and a communication interface, the communication interface and the processor are coupled, and the processor is used to run programs or instructions to implement the method provided in the first aspect.

[0016] In a sixth aspect, an embodiment of the present application provides a computer program product, which is stored in a storage medium and is executed by at least one processor to implement the method provided in the first aspect.

[0017] In the photo generation method, device, electronic device and medium of the present application, a first input from a user is received, the input time of the first input is a first moment, and the first input is used to instruct to take a photo; in response to the first input, N original images are stored in a cache queue, wherein the original images are stored in the cache queue starting from the first moment, and N is a positive integer; a photo is generated based on the N original images. In this way, the original images are captured and stored only when it is determined that the user's photo-taking instruction has been received, and only N original images are stored. When N images are reached, the storage stops, and the photo can be generated based on these N original images, so that unnecessary image capture and storage operations can be significantly reduced during the photo shooting process, thereby reducing power consumption. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] Figure 1 This is one of the flowcharts of a method for generating a photo provided by an embodiment of the present application;

[0019] Figure 2 This is a second flow chart of a method for generating a photo provided by an embodiment of the present application;

[0020] Figure 3 This is a third flow chart of a method for generating a photo provided by an embodiment of the present application;

[0021] Figure 4 This is a fourth flow chart of a method for generating a photo provided by an embodiment of the present application;

[0022] Figure 5 This is a fifth flow chart of a method for generating a photo provided by an embodiment of the present application;

[0023] Figure 6 is a structural schematic diagram of a device for generating a photo provided by another embodiment of the present application;

[0024] Figure 7 is a structural schematic diagram of an electronic device provided by another embodiment of the present application;

[0025] Figure 8 It is a schematic diagram of the hardware structure of the electronic device provided in the embodiment of the present application. DETAILED DESCRIPTION

[0026] The following will be combined with the drawings in the embodiments of the present application to clearly describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments in the present application belong to the scope of protection of this application.

[0027] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the terms used in this way are interchangeable where appropriate, so that the embodiments of the present application can be implemented in an order other than those illustrated or described herein, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.

[0028] In the related art, the method of taking a photo is as follows: Figure 1 As shown, the electronic device includes a camera application and a hardware abstraction layer (HAL). When the electronic device is in the shooting preview interface, the hardware abstraction layer in the electronic device saves each original image (raw image) to a cache queue. Until receiving the user's input to trigger the photo shooting, the most recently stored original image is selected from the cache queue and a photo is generated based on the original image.

[0029] Specifically, Figure 1 As shown, the electronic device can enter the shooting preview interface at the third moment, which is before the storage moment of the original image R101, and the user triggers the input of taking a photo at the fourth moment, which is the storage moment of the original image R101. The electronic device can respond to the input of taking a photo at the storage moment of the original image R104.

[0030] During this process, at least 8 original images are stored in the cache queue of the electronic device. These 8 original images are R97 to R104, and the electronic device will only generate photos based on the most recently stored original image R104. Then, the caching process of the other 7 original images R97 to R103 in the cache queue consumes a lot of power, but does not play a role in the photo generation process, resulting in a waste of power consumption.

[0031] In order to solve the above technical problems, the present application provides a method for generating a photo. The following is a detailed description of the method for generating a photo provided by the embodiment of the present application through specific embodiments and application scenarios in conjunction with the accompanying drawings.

[0032] like Figure 2 As shown, Figure 2 : is a flow chart of a method for generating a photo provided by an embodiment of the present application. The embodiment of the present application provides a method for generating a photo, which may include:

[0033] S201, receiving a first input from a user, where the input time of the first input is a first time, and the first input is used to instruct taking a photo;

[0034] In this embodiment, after the electronic device opens the camera application, the display interface of the electronic device is a shooting preview interface, in which a real-time preview image is displayed in the electronic device. In the shooting preview interface, the user can instruct the electronic device to take a photo through a first input at a first moment.

[0035] For example, there may be a shooting control displayed in the shooting preview interface, and the user may instruct to take a photo by performing a first input on the shooting control, wherein the first input may be a click input, a long press input, or a sliding input on the shooting control.

[0036] S202, in response to the first input, storing N original images in a cache queue, wherein the original images are stored in the cache queue starting from the first moment, and N is a positive integer;

[0037] In this embodiment, after the electronic device receives the first input, it can respond to the first input and continuously capture N original images (raw images) starting from a first moment and store them in a cache queue.

[0038] Specifically, the original image is the unprocessed or compressed raw data directly captured by the camera sensor. When the electronic device is in the shooting preview interface and has not received the first input, the sensor in the electronic device will capture an original image at a first time interval, and perform preliminary processing on each original image to obtain a preview image, and display the preview image on the electronic device, but will not save the captured original image.

[0039] Until receiving the first input from the user, the electronic device will store the original images captured from the first moment into the cache queue, and will not stop caching until N original images are stored in the cache queue. Then, a photo can be generated based on the N original images in the cache queue.

[0040] In some embodiments, the method is applied to an electronic device, the electronic device includes a hardware abstraction layer and a camera server, and the above S202 includes:

[0041] In response to the first input, the camera server generates an interface call request, and the camera server sends the interface call request to the hardware abstraction layer;

[0042] Based on the interface call request, the hardware abstraction layer stores N original images in a cache queue.

[0043] In this embodiment, the electronic device includes a camera application and a hardware abstraction layer, and the hardware abstraction layer is used to convert high-level operation requests into instructions that can be understood by the underlying hardware. When the electronic device is in the shooting preview interface, the user can make a first input through the camera application.

[0044] For example, Figure 3 As shown, an interface can be set in advance between the camera application and the hardware abstraction layer, and the camera application can control the hardware abstraction layer to store the original image by calling the interface. Wherein, when the electronic device is an Android device, the interface can be an interface defined by the Android Interface Definition Language (AIDL).

[0045] The electronic device displays a camera button, and the user clicks the camera button on the touch screen through the capture touch action, which is the first input to the electronic device. Whenever the user's first input is received, the camera application can generate an interface call request and send the interface call request to the hardware abstraction layer to call the AIDL interface, and by calling the AIDL interface, instruct the hardware abstraction layer to cache the N original images in the queue. Figure 3 As shown, N is 8.

[0046] In this way, the application can control the hardware abstraction layer in real time through interface calls to capture and store raw images, thereby flexibly enabling the storage of raw images.

[0047] S203: Generate a photo based on the N original images.

[0048] In an embodiment of the present application, after N original images are stored in the cache queue, a reference image can be selected from the N original images in the cache queue. The reference image can be an original image of the moment closest to the first moment among the N original images, or can be the one with the best quality among the N original images. Then the N original images can be aligned, and noise reduction and high dynamic range (HDR) processing can be performed on the reference image based on the N original images to obtain the final photo.

[0049] In the present application, when a shooting preview interface is displayed, a first input from a user is received, the input time of the first input is a first moment, and the first input is used to instruct to take a photo; in response to the first input, N original images are stored in a cache queue, wherein one original image is stored in the cache queue at a first time interval starting from the first moment until there are N original images in the cache queue, where N is a positive integer; and a photo is generated based on the N original images. In this way, the original image is captured and stored only when it is determined that a user's photo-taking instruction has been received, and only N original images are stored. When N images are reached, the storage stops, and a photo can be generated based on these N original images, so that unnecessary image capture and storage operations can be significantly reduced during the photo-taking process, thereby reducing power consumption.

[0050] In some embodiments, S203 includes:

[0051] Acquire P original images in the cache queue at a second moment, where the second moment is a moment after the first moment, and P is a positive integer less than N;

[0052] Determine a reference image from the P original images;

[0053] The reference image is enhanced based on (N-1) first original images to obtain the photo, wherein the first original image is an original image among the N original images except the reference image.

[0054] In this embodiment, in addition to the camera application and the hardware abstraction layer, the electronic device also includes a camera server (camera server) and an image signal processor (Image Signal Processor, ISP). The camera server is used to manage and coordinate access requests of the camera device, and the image signal processor processes the image data captured by the sensor.

[0055] Whenever the camera application receives the first input from the user, a photo request can be generated in the camera application and sent to the camera server. After receiving the photo request, the camera server can package the photo request into a complete photo request and pass the packaged photo request to the hardware abstraction layer. After receiving the photo request from the camera server, the hardware abstraction layer disassembles the photo request into specific hardware instructions. The hardware abstraction layer sends these instructions to the image signal processor driver pipeline (ISP driver pipeline).

[0056] The image signal processor can obtain P original images from the cache queue at the second moment, where the P original images are the original images stored from the first moment to the second moment, and then determine the reference image among the P original images, and enhance the reference image through the first original image to obtain the final photo.

[0057] As an optional embodiment, Figure 3 As shown, the first moment and the second moment may differ by 132ms, P is 4, and N is 8. The first moment is the storage moment of the original image R101. At the first moment, the electronic device calls the AIDL interface and instructs the hardware abstraction layer to store 8 original images in the cache queue by calling the AIDL interface. These 8 original images are R101-R108. The second moment is the moment of storing the image R104, so the first 4 original images are R101-R104, and the last 4 original images are R105-R108.

[0058] The original images can be stored when the photo is triggered. Since there is a time difference between the first moment when the photo is triggered and the second moment when the photo is executed, the time difference is sufficient to store P original images, that is, a reference image can be selected based on the P original images, and (NP) original images can still be captured and stored after the second moment, and the reference image is enhanced based on the (N-1) first original images to obtain a photo.

[0059] In this way, by using the time difference between triggering the photo-taking and executing the photo-taking, the original image can be stored as little as possible while ensuring the photo-taking quality and efficiency, thereby reducing the power consumption of the photo-taking.

[0060] In some embodiments, determining the reference image from the P original images includes:

[0061] The original image with the highest definition among the P original images is determined as the reference image.

[0062] In this embodiment, the moment when the user triggers taking a photo through the first input is the first moment, the moment when the photo is actually taken is the second moment, and the P original images are the original images stored in the cache queue from the first moment to the second moment.

[0063] Since the acquisition time of the P original images is close to the time when the user triggers the photo taking, the benchmark image can be determined from the P original images. Since the benchmark image is the original image that best represents the final photo among multiple original images, the original image with the highest clarity is selected from the P original images as the benchmark image, so that the final photo can better meet the user's needs.

[0064] In some embodiments, the performing image enhancement on the reference image based on the (N-1) first original images includes:

[0065] The reference image is subjected to noise reduction processing according to the (N-1) first original images, or the (N-1) first original images and the reference image are subjected to image fusion.

[0066] In this embodiment, after selecting a reference image from P original images, the (N-1) first original images may be aligned based on the reference image. The reference image may be subjected to at least one of noise reduction processing and high dynamic range processing. Specifically, the noise reduction processing is to use the (N-1) first original images as references, reduce the noise in the reference image by weighted averaging and other methods, and improve the clarity of the image; the high dynamic range processing is to use the reference image as the standard exposure image, fuse the (N-1) first original images and the reference image, expand the dynamic range of the reference image, and finally generate an image with a higher dynamic range and detail expression.

[0067] Through the above method, the image enhancement process of the reference image can be performed by utilizing multiple frames of original images, so that the finally generated photo has higher quality and detail expression.

[0068] In some embodiments, the electronic device is in a video recording mode, the electronic device includes a hardware abstraction layer and a flash memory, and before generating photos according to the N original images, the method further includes:

[0069] When the hardware abstraction layer receives the interface call request, the hardware abstraction layer stores the N original images in the flash memory based on the interface call request;

[0070] receiving a second input from the user, where the second input is used to indicate the end of video recording;

[0071] The step of generating a photo according to the N original images includes:

[0072] In response to the second input, a photo is generated based on the N original images in the flash memory.

[0073] In this embodiment, when the electronic device is in the recording mode, the camera sensor in the electronic device continuously captures the original image, provides a preview image after processing the original image, and stores the recording data. When the user wants to take a photo during the recording process, the electronic device can make a first input to the electronic device at the first moment in the recording mode. In response to the user's first input, N original images (raw images) are continuously captured from the first moment and stored in the cache queue. Specifically, the camera application can call a pre-set interface through an interface call request to control the hardware abstraction layer to store the original image.

[0074] The user can instruct the electronic device to end recording through the second input, and the electronic device stops recording in response to the second input, and the electronic device will then exit the recording mode. After exiting the recording mode, the electronic device can obtain N original images from the cache queue and generate a final photo based on the N original images.

[0075] In the above manner, if the user wants to take photos during video recording, N original images can be stored only when the user's photo-taking instruction is received, and photos can be generated based on these N original images after recording is stopped, thereby avoiding excessive power consumption during the recording process.

[0076] As an optional embodiment, Figure 4 An implementation of the above-mentioned photo generation method is shown as follows:

[0077] S401: A user starts a camera application in an electronic device.

[0078] S402: The electronic device enters a photo preview interface in a camera application.

[0079] S403: The camera sensor starts to capture raw image data and transmits the data to the image signal processor.

[0080] S404: before receiving the first input of shooting, after receiving the original image output by the sensor, the ISP only sends the original image to the display screen for preview.

[0081] S405: The user triggers a photo-taking action in the camera application and calls an interface provided by the HAL.

[0082] S406: The HAL layer receives a call notification from the camera application and saves the original image output by the sensor into a cache queue, which may be stored at a double data rate (DDR).

[0083] S407: Generate a photo based on the original image stored in the cache queue.

[0084] As an optional embodiment, Figure 5 Another implementation of the above-mentioned photo generation method is shown below:

[0085] S501: A user starts a camera application in an electronic device.

[0086] S502: The electronic device enters a video recording interface in a camera application.

[0087] S503: The camera sensor starts to capture raw image data and transmits the data to the image signal processor.

[0088] S504: before receiving the first input of shooting, after receiving the original image output by the sensor, the ISP only sends the original image to the display screen for preview and video storage.

[0089] S505: During the recording process, the user triggers a photo-taking action in the camera application and calls an interface provided by the HAL.

[0090] S506: The HAL layer receives the call notification from the camera application and saves the original image output by the sensor into the universal flash storage (UFS).

[0091] S507: receiving a second input from the user and ending the video recording.

[0092] S508: After the video recording is finished, a photo is generated based on the original image in the universal flash memory.

[0093] Figure 6 is a schematic diagram of the structure of a device for generating a photo provided by another embodiment of the present application, such as Figure 6 As shown, the photo generating device may include:

[0094] A first receiving module 601 is used to receive a first input from a user, where the input time of the first input is a first moment, and the first input is used to instruct taking a photo;

[0095] A first storage module 602, configured to store N original images in a cache queue in response to the first input, wherein the original images are stored in the cache queue starting from the first moment, and N is a positive integer;

[0096] The generating module 603 is used to generate a photo according to the N original images.

[0097] In the present application, a first input from a user can be received, the input time of the first input is a first moment, and the first input is used to instruct to take a photo; in response to the first input, N original images are stored in a cache queue, wherein the original images are stored in the cache queue starting from the first moment, and N is a positive integer; and a photo is generated based on the N original images. In this way, the original images are captured and stored only when it is determined that a photo-taking instruction from the user is received, and only N original images are stored. When N images are reached, the storage stops, and a photo can be generated based on these N original images, so that unnecessary image capture and storage operations can be significantly reduced during the photo-taking process, thereby reducing power consumption.

[0098] In another optional example, the first storage module 602 includes:

[0099] a calling unit, configured to generate an interface calling request by the camera server in response to a first input, and send the interface calling request by the camera server to a hardware abstraction layer;

[0100] The storage unit is used for storing N original images in a cache queue by the hardware abstraction layer based on the interface call request.

[0101] In another optional example, the generating module 603 includes:

[0102] an acquisition unit, configured to acquire P original images in the cache queue at a second moment, where the second moment is a moment after the first moment, and P is a positive integer less than N;

[0103] A determination unit, configured to determine a reference image from the P original images;

[0104] An enhancement unit is used to perform image enhancement on the reference image based on (N-1) first original images to obtain the photo, wherein the first original image is an original image among the N original images except the reference image.

[0105] In another optional example, the determining unit is specifically configured to:

[0106] The original image with the highest definition among the P original images is determined as the reference image.

[0107] In another optional example, the enhancement unit is further used to perform noise reduction processing on the reference image based on the (N-1) first original images, or to perform image fusion on the (N-1) first original images and the reference image.

[0108] In another optional example, the photo generating device further includes:

[0109] A second storage module, configured to, when the hardware abstraction layer receives an interface call request, store the N original images in the flash memory based on the interface call request;

[0110] A second receiving module, used to receive a second input from a user, where the second input is used to indicate the end of video recording;

[0111] The generating module 603 includes:

[0112] A generating unit is used to generate a photo according to the N original images in the flash memory in response to a second input.

[0113] The device for generating the photo in the embodiment of the present application can be an electronic device, or a component in the electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal, or other devices other than a terminal. Exemplarily, the electronic device can be a mobile phone, a tablet computer, a laptop computer, a PDA, a vehicle-mounted electronic device, a mobile Internet device (Mobile Internet Device, MID), an augmented reality (augmented reality, AR) / virtual reality (virtual reality, VR) device, a robot, a wearable device, an ultra-mobile personal computer (ultra-mobile personal computer, UMPC), a netbook or a personal digital assistant (personal digital assistant, PDA), etc., and can also be a server, a network attached storage (Network Attached Storage, NAS), a personal computer (personal computer, PC), a television (television, TV), a teller machine or a self-service machine, etc., and can also be a server, a network attached storage (Network Attached Storage, NAS), a personal computer (personal computer, PC), a television (television, TV), a teller machine or a self-service machine, etc., and the embodiment of the present application is not specifically limited.

[0114] The device for generating the photo in the embodiment of the present application may be a device having an operating system. The operating system may be an Android operating system, an IOS operating system, or other possible operating systems, which are not specifically limited in the embodiment of the present application.

[0115] The photo generation device provided in the embodiment of the present application can achieve Figure 2 To avoid repetition, the various processes implemented by the method embodiment are not described here.

[0116] Alternatively, if Figure 7 As shown, the embodiment of the present application also provides an electronic device 100, including a processor 110, a memory 119, and a program or instruction stored in the memory 119 and executable on the processor 110. When the program or instruction is executed by the processor 110, each process of the above-mentioned photo generation method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be described here.

[0117] It should be noted that the electronic devices in the embodiments of the present application include the above-mentioned mobile electronic devices and non-mobile electronic devices.

[0118] Please refer to Figure 8 , Figure 8 The hardware structure diagram of an electronic device for implementing an embodiment of the present application is shown in FIG. The electronic device 100 includes, but is not limited to, a radio frequency unit 121, a network module 122, an audio output unit 123, an input unit 124, a sensor 125, a display unit 126, a user input unit 127, an interface unit 128, a memory 129, and a processor 120.

[0119] Those skilled in the art will appreciate that the electronic device 100 may also include a power source (such as a battery) for supplying power to various components, and the power source may be logically connected to the processor 120 through a power management system, thereby implementing functions such as managing charging, discharging, and power consumption management through the power management system. Figure 8 The electronic device structure shown in the figure does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently, which will not be described in detail here.

[0120] The input unit 124 is used to receive a first input from a user, where the input time of the first input is a first time, and the first input is used to instruct taking a photo;

[0121] A memory 129, configured to store N original images in a cache queue in response to the first input, wherein the original images are stored in the cache queue starting from the first moment, and N is a positive integer;

[0122] The processor 120 is configured to generate a photo based on the N original images.

[0123] In the present application, a first input from a user can be received, the input time of the first input is a first moment, and the first input is used to instruct to take a photo; in response to the first input, N original images are stored in a cache queue, wherein one original image is stored in the cache queue at a first time interval starting from the first moment until there are N original images in the cache queue, where N is a positive integer; and a photo is generated based on the N original images. In this way, the original image is captured and stored only when it is determined that the user's photo-taking instruction has been received, and only N original images are stored. When N images are reached, the storage stops, and a photo can be generated based on these N original images, so that unnecessary image capture and storage operations can be significantly reduced during the photo-taking process, thereby reducing power consumption.

[0124] In another optional example, the processor 120 is further configured to, in response to the first input, cause the camera server to generate an interface call request, and the camera server sends the interface call request to the hardware abstraction layer;

[0125] The memory 129 is further configured to, based on the interface call request, enable the hardware abstraction layer to store the N original images in a cache queue.

[0126] In another optional example, the processor 120 is further configured to:

[0127] Acquire P original images in the cache queue at a second moment, where the second moment is a moment after the first moment, and P is a positive integer less than N;

[0128] Determine a reference image from the P original images;

[0129] The reference image is enhanced based on (N-1) first original images to obtain the photo, wherein the first original image is an original image among the N original images except the reference image.

[0130] In another optional example, the processor 120 is further configured to:

[0131] The original image with the highest definition among the P original images is determined as the reference image.

[0132] In another optional example, the processor 120 is further used to perform noise reduction processing on the reference image according to the (N-1) first original images, or to perform image fusion on the (N-1) first original images and the reference image.

[0133] In another optional example, the input unit 124 is used for storing N original images in the flash memory based on the interface call request when the hardware abstraction layer receives the interface call request;

[0134] The processor 120 is further configured to receive a second input from a user, where the second input is used to instruct to end video recording;

[0135] The processor 120 is further configured to generate a photo based on the N original images in the flash memory in response to a second input.

[0136] It should be understood that in the embodiment of the present application, the input unit 124 may include a graphics processor (Graphics Processing Unit, GPU) 1241 and a microphone 1242, and the graphics processor 1241 processes the image data of a static picture or video obtained by an image capture device (such as a camera) in a video capture mode or an image capture mode. The display unit 126 may include a display panel 1261, and the display panel 1261 may be configured in the form of a liquid crystal display, an organic light emitting diode, etc. The user input unit 127 includes a touch panel 1271 and at least one of other input devices 1272. The touch panel 1271 is also called a touch screen. The touch panel 1271 may include two parts: a touch detection device and a touch controller. Other input devices 1272 may include, but are not limited to, a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, and a joystick, which will not be repeated here.

[0137] The memory 129 can be used to store software programs and various data. The memory 129 may mainly include a first storage area for storing programs or instructions and a second storage area for storing data, wherein the first storage area may store an operating system, an application program or instructions required for at least one function (such as a sound playback function, an image playback function, etc.), etc. In addition, the memory 129 may include a volatile memory or a non-volatile memory, or the memory 129 may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), a static random access memory (SRAM), a dynamic random access memory (DRAM), a synchronous dynamic random access memory (SDRAM), a double data rate synchronous dynamic random access memory (DDRSDRAM), an enhanced synchronous dynamic random access memory (ESDRAM), a synchronous link dynamic random access memory (SLDRAM) and a direct memory bus random access memory (DRRAM). The memory 129 in the embodiment of the present application includes but is not limited to these and any other suitable types of memory.

[0138] The processor 120 may include one or more processing units; optionally, the processor 120 integrates an application processor and a modem processor, wherein the application processor mainly processes operations related to an operating system, a user interface, and application programs, and the modem processor mainly processes wireless communication signals, such as a baseband processor. It is understandable that the modem processor may not be integrated into the processor 120.

[0139] The embodiment of the present application also provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, each process of the above-mentioned photo generation method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0140] The processor is the processor in the electronic device in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory ROM, a random access memory RAM, a magnetic disk or an optical disk.

[0141] An embodiment of the present application further provides a chip, which includes a processor and a communication interface, wherein the communication interface and the processor are coupled, and the processor is used to run programs or instructions to implement the various processes of the above-mentioned photo generation method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.

[0142] It should be understood that the chip mentioned in the embodiments of the present application can also be called a system-level chip, a system chip, a chip system or a system-on-chip chip, etc.

[0143] An embodiment of the present application provides a computer program product, which is stored in a storage medium. The program product is executed by at least one processor to implement the various processes of the above-mentioned photo generation method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.

[0144] It should be noted that, in this article, the terms "comprise", "include" or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise one..." do not exclude the presence of other identical elements in the process, method, article or device including the element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved, for example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.

[0145] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a computer software product, which is stored in a storage medium (such as ROM / RAM, a disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present application.

[0146] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.

Claims

1. A photo generation method, characterized in that: The method comprises: receiving a first input from a user, where the input time of the first input is a first time, and the first input is used to instruct taking a photo; In response to the first input, N original images are stored in a cache queue, wherein the original images are stored in the cache queue starting from the first moment, and N is a positive integer; A photo is generated according to the N original images.

2. The method according to claim 1, characterized in that Applied to an electronic device, the electronic device comprising a hardware abstraction layer and a camera server; The step of storing N original images in a cache queue in response to the first input includes: In response to the first input, the camera server generates an interface call request, and the camera server sends the interface call request to the hardware abstraction layer; Based on the interface call request, the hardware abstraction layer stores N original images in a cache queue.

3. The method according to claim 1, characterized in that The step of generating a photo according to the N original images comprises: Acquire P original images in the cache queue at a second moment, where the second moment is a moment after the first moment, and P is a positive integer less than N; Determine a reference image from the P original images; The reference image is enhanced based on (N-1) first original images to obtain the photo, wherein the first original image is an original image among the N original images except the reference image.

4. The method according to claim 3, characterized in that The determining of the reference image from the P original images comprises: The original image with the highest definition among the P original images is determined as the reference image.

5. The method according to claim 3, characterized in that: The performing image enhancement on the reference image based on the (N-1) first original images comprises: The reference image is subjected to noise reduction processing according to the (N-1) first original images, or the (N-1) first original images and the reference image are subjected to image fusion.

6. The method according to claim 1, characterized in that The method is applied to an electronic device, the electronic device is in a video recording mode, the electronic device includes a hardware abstraction layer and a flash memory, and before generating photos according to the N original images, the method further includes: When the hardware abstraction layer receives the interface call request, the hardware abstraction layer stores the N original images in the flash memory based on the interface call request; receiving a second input from the user, where the second input is used to indicate the end of video recording; The step of generating a photo according to the N original images comprises: In response to the second input, a photo is generated based on the N original images in the flash memory.

7. A device for generating a photo, characterized in that: include: A first receiving module, used to receive a first input from a user, where the input time of the first input is a first time, and the first input is used to instruct taking a photo; A first storage module, configured to store N original images in a cache queue in response to the first input, wherein the original images are stored in the cache queue starting from the first moment, and N is a positive integer; A generating module is used to generate photos according to the N original images.

8. The device according to claim 7, characterized in that The device also includes: A second storage module, configured to, when the hardware abstraction layer receives an interface call request, store the N original images in a flash memory based on the interface call request; A second receiving module, used to receive a second input from a user, where the second input is used to indicate the end of video recording; The generation module comprises: A generating unit is used to generate a photo according to the N original images in the flash memory in response to a second input.

9. An electronic device, characterized in that: The method comprises a processor and a memory, wherein the memory stores a program or instruction that can be run on the processor, and when the program or instruction is executed by the processor, the steps of the method for generating a photo according to any one of claims 1 to 6 are implemented.

10. A readable storage medium, characterized in that: The readable storage medium stores a program or instruction, and when the program or instruction is executed by a processor, the steps of the method for generating a photo according to any one of claims 1 to 6 are implemented.

Citation Information

Patent Citations

  • Photographing method and replay method

    CN105407282A

  • Rapid shooting method and mobile terminal

    CN105812553A

  • Shooting method, terminal and computer readable storage medium

    CN109688293A

  • Determination method of exposure parameters and electronic equipment

    CN115297269A

  • Method for capturing image in video recording and electronic equipment

    CN115802146A