Image capture method, terminal, storage medium and program product

By detecting and deleting images with substandard image quality and optimizing the cache queue, it solves the problem of large memory requirements during image capture and improves memory utilization and image quality.

CN117692791BActive Publication Date: 2024-10-18HONOR DEVICE CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202310939433.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-07-27
Publication Date
2024-10-18
Estimated Expiration
2043-07-27

AI Technical Summary

Technical Problem

In the existing technology, due to the large number of cached images during image capture, a large amount of memory is required, which affects device performance.

Method used

By detecting image quality and deleting images with substandard image quality, the image storage in the cache queue is optimized, the cache space is released, and image quality and memory utilization are improved.

Benefits of technology

While not affecting the quality of captured images, it reduces the memory requirements when generating captured images and improves memory utilization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117692791B_ABST
    Figure CN117692791B_ABST
Patent Text Reader

Abstract

The embodiment of the present application provides an image capture method, terminal, storage medium and program product, which relates to the field of image processing technology. The method includes: storing the original image collected by the image sensor into a cache queue in the memory; detecting a first image whose image quality does not meet the standard in the detection image corresponding to the original image, and deleting the original image corresponding to the first image from the cache queue; detecting a wonderful image in the detection image within the capture observation interval; based on the information of the wonderful image, selecting the original image from the cache queue to obtain a second image; generating a captured image based on the second image. Applying the image capture solution provided by the embodiment of the present application can reduce the memory requirement of the image capture process.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image processing technology, and in particular to an image capture method, a terminal, a storage medium and a program product. Background Art

[0002] Mobile phones, tablet computers and other terminals are generally equipped with image sensors, and thus have the function of taking pictures. People often take pictures to relax and record their lives, and have higher and higher demands for the photo-taking experience, hoping to capture wonderful moments when taking pictures.

[0003] In view of this, in the related art, the terminal generally caches in memory several images captured by the image sensor before and after the user clicks the photo button. However, in order to obtain images of wonderful moments based on the cached images, a large number of images are often cached, which leads to a large memory demand. Summary of the invention

[0004] In view of this, the present application provides an image capture method, a terminal, a storage medium and a program product to reduce the memory requirement when capturing images.

[0005] In a first aspect, an embodiment of the present application provides an image capture method, the method comprising:

[0006] The original image captured by the image sensor is stored in a cache queue in the memory;

[0007] Detecting a first image whose image quality does not meet the standard in the detection images corresponding to the original image, and deleting the original image corresponding to the first image from the cache queue;

[0008] Detecting wonderful images in the detection images within the snapshot observation interval;

[0009] Based on the information of the wonderful image, selecting an original image from the cache queue to obtain a second image;

[0010] A captured image is generated based on the second image.

[0011] As can be seen from the above, the image quality of the first image is poor. After the original image corresponding to the first image with poor image quality is removed from the cache queue, on the one hand, the remaining original images stored in the cache queue are all original images with higher image quality. On the other hand, part of the cache space in the cache queue is released, and the released cache space can be used to store other original images with higher image quality. Therefore, the captured image can be generated based on the original image with higher image quality in the cache queue. In this way, when the solution provided in the embodiment of the present application is used to capture an image, the cache space in the cache queue occupied by the first image with poor image quality is released in time without affecting the image quality of the generated captured image, thereby reducing the memory requirement when generating the captured image.

[0012] In one embodiment of the present application, the detecting of the first image whose image quality does not meet the standard in the detection image corresponding to the original image includes:

[0013] Obtaining a dynamic quality representation value of a detection image corresponding to the original image;

[0014] Based on the obtained quality characterization value and the quality threshold, a first image whose image quality does not meet the standard is detected in the detection images.

[0015] The dynamic quality characterization value of the detected image reflects the quality information of the detected image in the dynamic dimension or the time dimension. Therefore, based on the obtained dynamic quality characterization value and the first quality threshold, the first image that does not meet the quality standard in the dynamic dimension or the time dimension can be timely determined and deleted from the cache queue. In this way, the remaining original images stored in the cache queue are original images with higher quality, thereby improving the image quality of the subsequent captured images generated based on the remaining original images stored in the cache queue.

[0016] In one embodiment of the present application, the detecting of the first image whose image quality does not meet the standard in the detection image corresponding to the original image includes:

[0017] Obtaining a static quality characterization value of a detection image corresponding to the original image;

[0018] Based on the obtained quality characterization value and the quality threshold, a first image whose image quality does not meet the standard is detected in the detection images.

[0019] The static quality characterization value of the detected image reflects the quality information of the detected image in the static dimension or the spatial dimension. Therefore, based on the obtained static quality characterization value and the second quality threshold, the first image whose quality does not meet the standard in the static dimension or the spatial dimension can be timely determined and deleted from the cache queue. In this way, the remaining original images stored in the cache queue are original images with higher quality, thereby improving the image quality of the subsequent captured images generated based on the remaining original images stored in the cache queue.

[0020] In one embodiment of the present application, the dynamic quality characterization value includes at least one of the following information:

[0021] The motion amplitude of the object in the detected image;

[0022] The detecting method includes detecting a first difference between a motion amplitude of an object in the image and a motion amplitude of an object in an adjacent image.

[0023] In this way, for a single detection image, a dynamic quality characterization value can be obtained based on the motion amplitude of the object in the detection image, wherein the above motion amplitude reflects the motion of the object in the single detection image in the time dimension, and can more accurately measure the dynamic quality of the detection image in the time dimension. Therefore, the dynamic quality characterization value obtained based on the above motion amplitude can reflect the dynamic quality of the object in the detection image in the time dimension, thereby improving the accuracy and comprehensiveness of the obtained dynamic quality characterization value.

[0024] Moreover, the above-mentioned first difference reflects the difference between the motion amplitudes of the object in multiple temporally consecutive detection images, and reflects the change in the motion of the object in the multiple detection images in the time dimension, and can more accurately measure the dynamic quality of the detection image in the time dimension. Therefore, the dynamic quality characterization value obtained based on the above-mentioned first difference can reflect the dynamic quality of the object in the detection image in the time dimension, thereby improving the accuracy and comprehensiveness of the obtained dynamic quality characterization value.

[0025] In one embodiment of the present application, the static quality characterization value includes at least one of the following information:

[0026] The automatic exposure AE convergence of the detection image; the automatic focus AF convergence of the detection image; the automatic white balance AWB convergence of the detection image; the clarity of the detection image; the contrast of the detection image; the color saturation of the detection image; and the color uniformity of the detection image.

[0027] It can be seen that the static quality characterization value can include information corresponding to various types of static evaluation indicators, thereby being able to more comprehensively and accurately reflect the quality information of the image in the static dimension or spatial dimension.

[0028] In one embodiment of the present application, the quality threshold is determined based on the length of the cache queue and is inversely proportional to the length of the cache queue.

[0029] On the one hand, a larger quality threshold can be determined when the cache queue length is short. Since the shorter the cache queue length is, the fewer original images the cache queue can store, a larger quality threshold is conducive to determining more first images with substandard image quality and deleting them from the cache queue, thereby improving the utilization rate of the cache space, and the released cache space can be used to store other original images with higher image quality, which is conducive to improving the image quality of subsequent captured images generated based on the original images stored in the cache queue. On the other hand, a smaller quality threshold can be determined when the cache queue length is long. Since the longer the cache queue length is, the more original images the cache queue can store, a smaller quality threshold is conducive to determining fewer first images with substandard image quality and deleting them from the cache queue, thereby increasing the number of high-quality original images stored in the cache queue, which is conducive to improving the image quality of subsequent captured images generated based on the original images stored in the cache queue.

[0030] In one embodiment of the present application, the length of the cache queue is smaller than the length of the snapshot observation interval.

[0031] In this way, since the first image with substandard image quality can be removed from the cache queue in time, a part of the cache space in the cache queue is released, so that the cache queue can accommodate the remaining original images in the snapshot observation interval. Therefore, even if the cache queue length is less than the snapshot observation interval length, there is a high probability that the cache queue can accommodate all the original images in the snapshot observation interval except the first image, so that the original image corresponding to the wonderful image can be taken out from the cache queue based on the information of the wonderful image. It can be seen that the length of the cache queue can be less than the length of the snapshot observation interval, so that the length of the cache queue required to be reserved for image capture can be reduced, and the memory utilization rate can be improved.

[0032] In one embodiment of the present application, the selecting the original image from the cache queue based on the information of the wonderful image to obtain the second image includes:

[0033] Selecting an original image whose acquisition sequence information is closest to the acquisition sequence information corresponding to the wonderful image from the cache queue to obtain a third image;

[0034] Based on the third image, a second image is determined.

[0035] It can be seen that in this way, the original image whose acquisition sequence information is closest to the acquisition sequence information corresponding to the wonderful image can be selected from the cache queue to obtain the third image. Since the original image whose acquisition sequence information is closest to the acquisition sequence information corresponding to the wonderful image is often the original image corresponding to the wonderful image, or the original image closest to the original image corresponding to the wonderful image, the third image with a stronger correlation with the wonderful image can be obtained according to the above method, and then the second image with a stronger correlation with the wonderful image can be obtained based on the third image, which is conducive to improving the image quality of the captured image generated based on the second image.

[0036] In one embodiment of the present application, determining the second image based on the third image includes:

[0037] Determining a second difference between a motion amplitude of an object in the third image and a motion amplitude of an object in a fourth image, wherein the fourth image is: an image in the cache queue adjacent to the third image;

[0038] If the second difference is greater than a difference threshold, determining the third image as the second image;

[0039] Otherwise, the third image and the fourth image are both determined as the second image.

[0040] When the second difference is greater than the difference threshold, it means that the difference between the third image and its adjacent fourth image is large. At this time, the third image is directly determined as the second image for generating the snapshot image, which can avoid the influence of the fourth image on the generation of the snapshot image; when the second difference is not greater than the difference threshold, it means that the difference between the third image and its adjacent fourth image is small, that is, the third image is relatively close to the fourth image. At this time, the third image and the fourth image are both determined as the second image. When the snapshot image is subsequently generated based on the second image, the snapshot image can be generated more comprehensively based on the image features of the third image and the fourth image, which is beneficial to improving the image quality of the generated snapshot image.

[0041] In one embodiment of the present application, the detection image is obtained by performing at least one of the following processing on the original image:

[0042] Downsampling, noise reduction, sharpening, and smoothing.

[0043] After the original image is processed as above, the image features of the original image can be retained while reducing the storage space occupied by the image or reducing the impact of noise in the image, thereby facilitating subsequent image quality evaluation.

[0044] In a second aspect, an embodiment of the present application further provides a terminal, including:

[0045] one or more processors, image sensors, and memory;

[0046] The memory is coupled to the one or more processors, and the memory is used to store computer program codes, where the computer program codes include computer instructions. The one or more processors call the computer instructions to enable the terminal to execute any one of the methods described in the first aspect.

[0047] In a third aspect, an embodiment of the present application further provides a computer-readable storage medium, comprising a computer program, which, when executed on a terminal, enables the terminal to execute any of the methods described in the first aspect.

[0048] In a fourth aspect, 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 the method described in any one of the first aspects above.

[0049] In the fifth aspect, an embodiment of the present application also provides a chip system, which is applied to a terminal, and the chip system includes one or more processors, and the processor is used to call computer instructions so that the terminal inputs data into the chip system, and executes the method described in any one of the first aspects above to process the data and output the processing results.

[0050] The beneficial effects of the solutions provided by the embodiments in the second, third, fourth and fifth aspects can refer to the beneficial effects of the solutions provided by the embodiments in the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS

[0051] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0052] Figure 1 A schematic diagram of the structure of a terminal provided in an embodiment of the present application;

[0053] Figure 2 A software structure block diagram of a terminal provided in an embodiment of the present application;

[0054] Figure 3 A schematic diagram of the process of the first image capture method provided in an embodiment of the present application;

[0055] Figure 4 A schematic diagram of an image storage process provided in an embodiment of the present application;

[0056] Figure 5a A schematic diagram of the first snapshot observation interval provided in an embodiment of the present application;

[0057] Figure 5b A schematic diagram of a second snapshot observation interval provided in an embodiment of the present application;

[0058] Figure 5c A schematic diagram of a third snapshot observation interval provided in an embodiment of the present application;

[0059] Figure 6a It is a schematic diagram of the image capture process in the related art;

[0060] Figure 6b A schematic diagram of an image capture process provided in an embodiment of the present application;

[0061] Figure 7 A schematic diagram of a flow chart of a second image capture method provided in an embodiment of the present application;

[0062] Figure 8 A schematic diagram of the structure of a chip system provided in an embodiment of the present application. DETAILED DESCRIPTION

[0063] 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.

[0064] 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, the words "first" and "second" are used to distinguish the same items or similar items with substantially the same functions and effects. For example, the first instruction and the second instruction are to distinguish different user instructions, and their order is not limited. Those skilled in the art can understand that the words "first" and "second" do not limit the quantity and execution order, and the words "first" and "second" do not necessarily limit them to be different.

[0065] 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 as "exemplarily" or "for example" in this application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplarily" or "for example" is intended to present related concepts in a specific way.

[0066] The solution provided in the embodiments of the present application can be applied to terminals equipped with image sensors, such as mobile phones, tablet computers, personal digital assistants (PDAs), smart watches, wearable electronic devices, augmented reality (AR) devices, virtual reality (VR) devices, robots, smart glasses, etc.

[0067] For example, Figure 1 The schematic diagram of the structure of the terminal 100 is shown. The terminal 100 may include a processor 110, a display screen 120, an internal memory 130, a SIM (Subscriber Identification Module) card interface 140, a USB (Universal Serial Bus) interface 150, a charging management module 160, a battery management module 161, a battery 162, a sensor module 170, a mobile communication module 180, a wireless communication module 190, an antenna 1 and an antenna 2, etc. The sensor module 170 may include a pressure sensor 170A, a fingerprint sensor 170B, a touch sensor 170C, an ambient light sensor 170D, an image sensor 170E, etc.

[0068] It is to be understood that the structure illustrated in the embodiment of the present application does 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 in the figure, or combine certain components, or split certain components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.

[0069] 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 processor (NPU), etc. Among them, 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. Among them, the controller may generate an operation control signal according to the instruction opcode and the timing signal to complete the control of fetching and executing instructions. In some other embodiments, a memory may also be set in the processor 110 for storing instructions and data. Exemplarily, the memory in the processor 110 may be a high-speed cache memory. The memory may store instructions or data that the processor 110 has just used or circulated. If the processor 110 needs to use the instruction or data again, it can be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 110, and thus improves the efficiency of the terminal 100 in processing data or executing instructions.

[0070] In some embodiments, the processor 110 may include one or more interfaces. The interface 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, etc. Among them, the USB interface 150 is an interface that complies with the USB standard specification, and may specifically be a Mini USB interface, a Micro USB interface, a USB Type C interface, etc. The USB interface 150 may be used to connect a charger to charge the terminal 100, and may also be used to transmit data between the terminal 100 and a peripheral device. The USB interface 150 may also be used to connect headphones to play audio through the headphones.

[0071] It is understandable that the interface connection relationship between the modules illustrated in the embodiment 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 in the above embodiments, or a combination of multiple interface connection methods.

[0072] The wireless communication function of the terminal 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 180, the wireless communication module 190, the modem processor and the baseband processor.

[0073] 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 the utilization of the antennas. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In some other embodiments, the antenna can be used in combination with a tuning switch.

[0074] The terminal 100 implements the display function through a GPU, a display screen 120, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 120 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs, which execute program instructions to generate or change display information.

[0075] 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), Miniled, MicroLed, Micro-oLed, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the terminal 100 may include one or more display screens 120.

[0076] In some embodiments of the present application, when the display panel is made of materials such as OLED, AMOLED, FLED, etc., the above Figure 1 The display screen 120 in the embodiment can be bent. Here, the display screen 120 can be bent means that the display screen can be bent to any angle at any position and can be kept at the 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.

[0077] The display screen 120 of the terminal 100 may be a flexible screen. Currently, flexible screens have attracted much attention for their unique characteristics and great potential. Compared with traditional screens, flexible screens are flexible and bendable, which can provide users with a new interaction method based on the bendable characteristics, and can meet more user demands for the terminal. For a terminal equipped with a foldable display screen, the foldable display screen 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 foldable displays more and more frequently.

[0078] The terminal 100 can implement a shooting function through an ISP, an image sensor 170E, a video codec, a GPU, a display screen 120, and an application processor.

[0079] The ISP is used to process the data fed back by the image sensor 170E. For example, when shooting, the shutter is opened, and light is transmitted to the image sensor 170E through the lens. The light signal is converted into an electrical signal, and the image sensor 170E transmits the electrical signal to the ISP for processing and converts it into an image visible to the naked eye. The ISP can perform algorithmic optimization on the noise, brightness and color of the image. The ISP can also optimize the exposure and color temperature of the shooting scene and other parameters.

[0080] The image sensor 170E is used to capture photos or videos. The object generates an optical image through the lens and projects it onto the image sensor 170E. The image sensor 170E may include a charge coupled device (CCD) or a complementary metal oxide semiconductor (CMOS) phototransistor. The image sensor 170E converts the optical signal into an electrical signal, and then transmits the electrical signal to the ISP to convert it 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 image sensors 170E, where N is a positive integer greater than 1.

[0081] The digital signal processor is used to process digital signals, and can process not only digital image signals but also other digital signals. For example, when the terminal 100 is selecting a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy.

[0082] Video codecs are used to compress or decompress digital videos. Terminal 100 may support one or more video codecs. Thus, terminal 100 may play or record videos in multiple coding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, and MPEG4.

[0083] NPU is a neural network (NN) computing processor. By drawing on the structure of biological neural networks, such as the transmission mode between neurons in the human brain, it can quickly process input information and can also continuously self-learn. Through NPU, applications such as intelligent cognition of the terminal 100 can be realized, such as image recognition, face recognition, voice recognition, text understanding, etc.

[0084] The internal memory 130 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 130, so that the terminal 100 executes the video cutout method provided in some embodiments of the present application, as well as various applications and data processing. The internal memory 130 may include a program storage area and a data storage area. Among them, the program storage area can store an operating system; the program storage area can also store one or more applications (such as a gallery, contacts, etc.). The data storage area can store data (such as photos, contacts, etc.) created during the use of the terminal 100. In addition, the internal memory 130 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more disk storage components, flash memory components, universal flash memory (Universal Flash Storage, UFS), etc. In some embodiments, the processor 110 can execute the video cutout method provided in the embodiment of the present application, as well as other applications and data processing by running instructions stored in the internal memory 130 and / or instructions stored in a memory provided in the processor 110.

[0085] The internal memory 130 can be used to store the relevant programs of the video cutout method provided in the embodiment of the present application, and the processor 110 can be used to call the relevant programs of the video cutout method stored in the internal memory 130 when displaying information, and execute the video cutout method of the embodiment of the present application.

[0086] The sensor module 170 may include a pressure sensor 170A, a fingerprint sensor 170B, a touch sensor 170C, an ambient light sensor 170D, and the like.

[0087] The pressure sensor 170A is used to sense the pressure signal and can convert the pressure signal into an electrical signal. In some embodiments, the pressure sensor 170A can be set on the display screen 120. There are many types of pressure sensors 170A, for example, they can be resistive pressure sensors, inductive pressure sensors or capacitive pressure sensors. The capacitive pressure sensor can be a parallel plate including at least two conductive materials. When the force acts on the pressure sensor 170A, the capacitance between the electrodes changes, and the terminal 100 determines the intensity of the pressure according to the change in capacitance. When the touch operation acts on the display screen 120, the terminal 100 detects the touch operation according to the pressure sensor 170A. The terminal 100 can also calculate the position of the touch according to the detection signal of the pressure sensor 170A. In some embodiments, touch operations acting on the same touch position but with different touch operation intensities can correspond to different operation instructions. For example: when a touch operation with a touch operation intensity less than the first pressure threshold acts on a short message application icon, an instruction to view the short message is executed; when a touch operation with a touch operation intensity greater than or equal to the first pressure threshold acts on a short message application icon, an instruction to create a new short message is executed.

[0088] The fingerprint sensor 170B is used to collect fingerprints. The terminal 100 can use the collected fingerprint characteristics to realize functions such as unlocking, accessing application locks, taking pictures, and answering calls.

[0089] The touch sensor 170C is also called a touch control device. The touch sensor 170C can be arranged on the display screen 120, and the touch sensor 170C and the display screen 120 form a touch screen, which is also called a touch control screen. The touch sensor 170C is used to detect a touch operation acting on or near it. The touch sensor 170C can pass the detected touch operation to the application processor to determine the type of touch event. A visual output related to the touch operation can be provided through the display screen 120. In other embodiments, the touch sensor 170C can also be arranged on the surface of the terminal 100, and is arranged at a different position from the display screen 120.

[0090] The ambient light sensor 170D is used to sense the ambient light brightness. The terminal 100 can adaptively adjust the brightness of the display screen 120 according to the perceived ambient light brightness. The ambient light sensor 170D can also be used to automatically adjust the white balance when shooting. The ambient light sensor 170D can also transmit the environment information of the device to the GPU.

[0091] The ambient light sensor 170D is also used to obtain the brightness, light ratio, color temperature, etc. of the collection environment.

[0092] Figure 2 The software system of the terminal can adopt a layered architecture, an event-driven architecture, a micro-kernel architecture, a micro-service architecture, or a cloud architecture.

[0093] The layered architecture divides the terminal's software system into several layers, each with clear roles and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the software system can be divided into five layers, namely, application layer (applications), application framework layer (application framework), hardware abstract layer (HAL), driver layer and hardware layer.

[0094] The application layer may include a series of application packages, and the application layer runs applications by calling the application programming interface (API) provided by the application framework layer. For example, the application package may include applications such as browser, camera, gallery, music, and video. It can be understood that the port of each of the above applications can be used to receive data.

[0095] The application framework layer provides APIs and programming frameworks for applications in the application layer. The application framework layer includes some predefined functions. For example, the application framework layer may include a window manager, a content provider, a view system, a resource manager, a notification manager, a DHCP (Dynamic Host Configuration Protocol) module, a camera management module, etc.

[0096] The hardware abstraction layer can include multiple library modules, such as display library modules and motor library modules. The hardware abstraction layer can also include image quality detection modules and image selection modules. The terminal system can load the corresponding library modules for the device hardware, thereby achieving the purpose of the application framework layer accessing the device hardware.

[0097] The driver layer is a layer between hardware and software. The driver layer is used to drive the hardware so that the hardware works. The driver layer at least includes a display driver, an audio driver, a camera device driver, a sensor driver, and a motor driver, etc., which are not limited in the embodiments of the present application. It can be understood that the display driver, the audio driver, the camera device driver, the sensor driver, and the motor driver, etc. can all be regarded as a driver node. Each of the above-mentioned driver nodes includes an interface that can be used to receive data.

[0098] The hardware layer is the lowest part of the terminal system, which can be composed of various physical components required such as processor, memory, input and output interface (I / O), etc. The hardware layer can also include image sensors and image signal processors.

[0099] Combine the following Figure 2, the interaction process between various layers of the software system in the process of image capture using the solution provided in the embodiment of the present application is introduced.

[0100] First, the user triggers an image acquisition instruction through the camera application in the application layer. The application layer can pass the image acquisition instruction to the application framework layer through the camera access interface. The camera management module in the application framework layer forwards the image acquisition instruction to the HAL layer. The HAL layer forwards the image acquisition instruction to the driver layer. The driver layer finally forwards the image acquisition instruction to the image sensor and image signal processor in the hardware layer through the camera device driver module. The image sensor and image signal processor in the hardware layer respond to the above image acquisition instruction, acquire the original image, store the original image in the cache queue, and notify the HAL layer to perform image detection and image selection through forwarding by the driver layer.

[0101] Then, on the one hand, the image quality detection module in the HAL layer calls the algorithm from the camera algorithm library, detects the first image with substandard image quality in the tiny stream based on the above algorithm, and clears the first image from the cache queue. On the other hand, the image selection module in the HAL layer calls the algorithm from the camera algorithm library, determines the wonderful image from the tiny stream based on the above algorithm, and selects the original image from the cache queue based on the wonderful image.

[0102] Finally, the HAL layer can generate a captured image based on the selected original image, and feed the captured image back to the gallery application in the application layer via forwarding by the application framework layer, so that the captured image can be displayed in the gallery application.

[0103] Among them, the concepts such as tiny stream mentioned in the above content refer to the explanation in the subsequent specific embodiments and are not described in detail here.

[0104] The following describes some concepts involved in the image capture solution provided in the embodiments of the present application.

[0105] 1. Command triggering time

[0106] The user can click a photo button in the user interface of the camera application to trigger an image acquisition instruction. The moment when the photo button is clicked can be referred to as the instruction triggering moment.

[0107] 2. Command receiving time

[0108] The command receiving time refers to the time when the image sensor actually receives the image acquisition command.

[0109] Since it takes a certain amount of time to transmit the command within the terminal, there is often a certain delay between the moment when the image sensor actually receives the image acquisition command and the moment when the command is triggered, that is, the command reception moment is after the command triggering moment.

[0110] 3. Length of cache queue

[0111] The length of the cache queue reflects the size of the cache space corresponding to the cache queue.

[0112] In one case, the length of the cache queue can be described by the number of buffers contained in the cache queue, each buffer being used to store an original image.

[0113] For example, the length of the cache queue is 8, which means that the cache queue contains 8 buffers, that is, the cache queue can store a total of 8 original images.

[0114] It should be noted that, in addition to storing an original image, each buffer can also store identification information such as the frame number, sequence number, acquisition timestamp, etc. related to the original image.

[0115] 4. Length of snapshot observation interval

[0116] The snapshot observation interval refers to a time interval to which the image acquisition moment of the original image expected to be used to generate the snapshot image belongs.

[0117] In one case, the length of the snapshot observation interval can be reflected by the number of original images located within the snapshot observation interval at the time of image acquisition.

[0118] For example, the length of the snapshot observation interval is 12, which means that the image acquisition moments of 12 original images are located in the snapshot observation interval, that is, the snapshot observation interval corresponds to 12 original images.

[0119] 5. Snap the original image within the observation interval

[0120] The original image in the snapshot observation interval is: the original image in the snapshot observation interval at the image acquisition moment.

[0121] The image capture solution provided in the embodiment of the present application is described in detail below through specific examples.

[0122] See also Figure 3 , is a flow chart of the first image capture method provided in an embodiment of the present application, and the method includes the following steps S301-S305.

[0123] Step S301: storing the original image captured by the image sensor into a cache queue in the memory.

[0124] An image sensor may refer to a device that utilizes a photoelectric conversion function to convert a light image on a photosensitive surface into an electrical signal that is proportional to the light image and generates an image based on the electrical signal. An image sensor may also be referred to as a SENSOR.

[0125] The image generated by the image sensor is not processed in any additional way and can be called the original image captured by the image sensor.

[0126] The cache queue is a cache space of a fixed size reserved in the memory for caching the original image captured by the image sensor.

[0127] Among them, every time the image sensor captures an original image, the original image is stored in the cache queue. Therefore, the original image captured first will be stored in the cache queue first; in addition, since the size of the cache queue is fixed, the number of original images that can be accommodated is also certain. Therefore, when the number of cached original images in the cache queue reaches the maximum and there are new original images to be stored, in order to release the cache space for storing the above-mentioned new original images to be stored, the original image first stored in the cache queue will be cleared from the cache queue.

[0128] In other words, the original images captured by the image sensor are stored in the cache queue in a "first in, first out" manner.

[0129] Combine the following Figure 4 Provide a more intuitive explanation.

[0130] See also Figure 4 , which is a schematic diagram of an image storage process provided in an embodiment of the present application.

[0131] It can be seen that the cache queue consists of 8 buffers and can store 8 original images. The first buffer from left to right in the cache queue can be called the rear or queue entrance, and the last buffer from left to right can be called the front or queue exit. The original image is stored in the front or the free buffer closest to the front. Figure 4 The image storage process shown is introduced.

[0132] Step s1: The image sensor does not perform image acquisition and the cache queue is empty.

[0133] Step s2: the image sensor captures the original image 1, and the original image 1 is stored in the cache queue.

[0134] Initially, the cache queue is empty, and the original image 1 is the first image stored in the cache queue, so it will be directly stored in the last buffer from left to right, that is, stored at the head of the queue.

[0135] Step s3: the image sensor captures original image 2, which is stored in the cache queue. Similarly, original images 3-7 captured by the image sensor are all stored in the cache queue.

[0136] Original image 2 is the second image stored in the cache queue. At this time, original image 1 has been stored at the head of the queue. Therefore, original image 2 will be stored in the free buffer closest to the head of the queue, that is, the second to last buffer from left to right.

[0137] Similarly, the remaining original images 3-7 are also stored in the cache queue in sequence.

[0138] Step s4: the image sensor captures the original image 8, and the original image 8 is stored in the cache queue.

[0139] It can be seen that after the original image 8 is stored in the first buffer (the end of the queue) from left to right, all eight buffers in the cache queue are occupied, that is, the cache queue is full.

[0140] Step s5: the image sensor captures the original image 9, the original image 1 first stored in the cache queue is cleared from the cache queue, and the remaining original images 2-8 in the cache queue are moved one buffer toward the head of the queue, so that the tail of the queue is released and the latest captured original image 9 is stored at the tail of the queue.

[0141] The timing for executing this step is described below.

[0142] In one case, this step may be performed in response to a camera application being opened.

[0143] That is, after the camera application is opened, the image sensor can start collecting raw images and store the raw images in the cache queue.

[0144] In this case, the image sensor has already captured the original image before the instruction is triggered, so the cache queue stores the original image captured before the instruction is triggered; and when the user clicks the photo button, the image sensor can continue to capture the original image, so the cache queue can also store the original image captured after the instruction is triggered.

[0145] In another case, this step may be performed when the image sensor receives an image acquisition instruction.

[0146] That is, this step starts to be executed when the instruction is received.

[0147] Obviously, in this case, the acquisition time of each original image acquired by the image sensor is after the instruction triggering time, so the original images stored in the cache queue are all images acquired after the above instruction triggering time.

[0148] Step S302: Detect a first image whose image quality does not meet the standard in the detection images corresponding to the original image, and delete the original image corresponding to the first image from the cache queue.

[0149] The detection image corresponding to the original image may be an image obtained after various preprocessing is performed on the original image.

[0150] In one case, the detection image can be obtained by performing at least one of the following processing on the original image:

[0151] Downsampling, noise reduction, sharpening, and smoothing.

[0152] After the original image is processed as above, the image features of the original image can be retained while reducing the storage space occupied by the image or reducing the impact of noise in the image, thereby facilitating subsequent image quality evaluation.

[0153] In one case, the detection image can be an image obtained by downsampling the original image. As the image sensor continuously collects original images, the detection images obtained by downsampling each original image form an image stream. Since the image size of the detection image is smaller than that of the corresponding original image, the above image stream can be called a tiny stream.

[0154] The following is a description of a specific method for detecting a first image whose image quality does not meet the standard in a detection image corresponding to an original image.

[0155] In one implementation, a dynamic quality characterization value of a detection image corresponding to the original image may be obtained, and based on the obtained quality characterization value and a first quality threshold, a first image whose image quality does not meet the standard may be detected in the detection images.

[0156] The above dynamic quality characterization value can be obtained based on the motion amplitude of the object in the detection image, and is used to evaluate the quality information of the detection image in a dynamic dimension or a time dimension.

[0157] In one embodiment, the dynamic quality characterization value includes at least one of the following information:

[0158] 1. Detect the motion amplitude of objects in the image.

[0159] The above-mentioned objects can be people, animals, etc., and the objects in the above-mentioned detection images can be identified based on various object detection algorithms or pre-trained object recognition models, which is not limited in the embodiments of the present application.

[0160] The motion amplitude of the object can have various meanings based on the different image scenes corresponding to the detected image, which are introduced below through examples.

[0161] For example, if the image scene corresponding to the detected image is a scene of a person jumping, the above-mentioned movement amplitude may be the jumping height of the person, etc.

[0162] For another example, if the image scene corresponding to the detected image is a scene of a person smiling, the above-mentioned movement amplitude may be the upward amplitude of the corner of the person's mouth, and the like.

[0163] Among them, the embodiment of the present application does not limit the method of determining the image scene corresponding to the above-mentioned detection image. In one case, the above-mentioned detection image can be input into a pre-trained image scene classification model to obtain the image scene output by the above-mentioned image classification model.

[0164] In this way, for a single detection image, a dynamic quality characterization value can be obtained based on the motion amplitude of the object in the detection image, wherein the above motion amplitude reflects the motion of the object in the single detection image in the time dimension, and can more accurately measure the dynamic quality of the detection image in the time dimension. Therefore, the dynamic quality characterization value obtained based on the above motion amplitude can reflect the dynamic quality of the object in the detection image in the time dimension, thereby improving the accuracy and comprehensiveness of the obtained dynamic quality characterization value.

[0165] 2. Detecting a first difference between the magnitude of motion of an object in an image and the magnitude of motion of an object in an adjacent image.

[0166] The adjacent image mentioned above is another detection image whose corresponding image acquisition moment is adjacent to the image acquisition moment of the detection image.

[0167] The meaning of the motion amplitude of the object in the adjacent images is the same as the meaning of the motion amplitude of the object in the detection image.

[0168] The above-mentioned first difference reflects the difference between the motion amplitudes of the object in multiple detection images that are consecutive in time, and reflects the change in the motion of the object in the multiple detection images in the time dimension. It can measure the dynamic quality of the detection image more accurately in the time dimension. Therefore, the dynamic quality characterization value obtained based on the above-mentioned first difference can reflect the dynamic quality of the object in the detection image in the time dimension, thereby improving the accuracy and comprehensiveness of the obtained dynamic quality characterization value.

[0169] After obtaining the dynamic quality characterization value of the detection image corresponding to the original image, it can be determined whether the dynamic quality characterization value of each detection image is less than the first quality threshold. If so, the above detection image is determined to be the first image whose image quality does not meet the standard.

[0170] The first quality threshold mentioned above can be set by the staff according to experience or actual needs.

[0171] The dynamic quality characterization value of the detected image reflects the quality information of the detected image in the dynamic dimension or the time dimension. Therefore, based on the obtained dynamic quality characterization value and the first quality threshold, the first image that does not meet the quality standard in the dynamic dimension or the time dimension can be timely determined and deleted from the cache queue. In this way, the remaining original images stored in the cache queue are original images with higher quality, thereby improving the image quality of the subsequent captured images generated based on the remaining original images stored in the cache queue.

[0172] In another implementation, a static quality characterization value of a detection image corresponding to the original image may be obtained, and based on the obtained static quality characterization value and a second quality threshold, a first image in the detection image that does not meet the image quality standard may be detected.

[0173] The above static quality characterization value can be obtained based on the static evaluation index of the detection image, and is used to evaluate the quality information of the detection image in the static dimension or the spatial dimension.

[0174] In one case, the static quality characterization value may include at least one of the following information:

[0175] Detect the convergence of automatic exposure (AE) of the image, detect the convergence of automatic focus (AF) of the image, detect the convergence of automatic white balance (AWB) of the image, detect the clarity of the image, detect the contrast of the image, detect the color saturation of the image, and detect the color uniformity of the image.

[0176] It can be seen that the static quality characterization value can include information corresponding to various types of static evaluation indicators, thereby being able to more comprehensively and accurately reflect the quality information of the image in the static dimension or spatial dimension.

[0177] After obtaining the static quality characterization value of the detection image corresponding to the original image, it can be determined whether the static quality characterization value of each detection image is less than the second quality threshold. If so, the above detection image is determined to be the first image whose image quality does not meet the standard.

[0178] The second quality threshold may be set by staff based on experience or actual needs.

[0179] The static quality characterization value of the detected image reflects the quality information of the detected image in the static dimension or the spatial dimension. Therefore, based on the obtained static quality characterization value and the second quality threshold, the first image whose quality does not meet the standard in the static dimension or the spatial dimension can be timely determined and deleted from the cache queue. In this way, the remaining original images stored in the cache queue are original images with higher quality, thereby improving the image quality of the subsequent captured images generated based on the remaining original images stored in the cache queue.

[0180] In one embodiment of the present application, the first quality threshold and / or the second quality threshold may be determined based on the length of the cache queue and be inversely proportional to the length of the cache queue.

[0181] For example, the longer the length of the cache queue is, the smaller the first quality threshold and / or the second quality threshold can be set; conversely, the shorter the length of the cache queue is, the larger the first quality threshold and / or the second quality threshold can be set.

[0182] On the one hand, a larger quality threshold can be determined when the cache queue length is short. Since the shorter the cache queue length is, the fewer original images the cache queue can store, a larger quality threshold is conducive to determining more first images with substandard image quality and deleting them from the cache queue, thereby improving the utilization rate of the cache space, and the released cache space can be used to store other original images with higher image quality, which is conducive to improving the image quality of subsequent captured images generated based on the original images stored in the cache queue. On the other hand, a smaller quality threshold can be determined when the cache queue length is long. Since the longer the cache queue length is, the more original images the cache queue can store, a smaller quality threshold is conducive to determining fewer first images with substandard image quality and deleting them from the cache queue, thereby increasing the number of high-quality original images stored in the cache queue, which is conducive to improving the image quality of subsequent captured images generated based on the original images stored in the cache queue.

[0183] In another embodiment, a dynamic quality characterization value and a static quality characterization value of the detection image corresponding to the original image may be obtained respectively, and based on the obtained quality characterization value and quality threshold, a first image whose image quality does not meet the standard in the detection image may be detected.

[0184] This embodiment can be obtained by combining the above two embodiments, and will not be described in detail here.

[0185] In this way, the image quality of the detection image can be more comprehensively evaluated from both the motion dimension and the static dimension, and the first image that does not meet the quality standard can be determined from the detection image based on the image quality of the detection image, thereby deleting the above-mentioned first image from the cache queue, so that the remaining original images stored in the cache queue are original images with higher quality, thereby further improving the image quality of the subsequent captured images generated based on the original images stored in the cache queue.

[0186] It should be noted that the above step S302 may be performed after each original image is stored in the cache queue, or may be performed when it is detected that the cache queue is full, which is not limited in this embodiment of the present application.

[0187] Step S303: Detecting wonderful images in the detection images within the snapshot observation interval.

[0188] Depending on the timing at which the image sensor collects the original image in step S301, the above-mentioned snapshot observation interval may have various situations, which are described below respectively.

[0189] 1. When step S301 is executed when the camera application is opened:

[0190] In this case, the image sensor has already captured the original image before the instruction is triggered, so the cache queue stores the original image captured before the instruction is triggered; and when the user clicks the photo button, the image sensor can continue to capture the original image, so the cache queue can also store the original image captured after the instruction is triggered.

[0191] In this case, the snapshot observation interval may be a period of time before and after the above instruction triggering moment.

[0192] Among them, the sub-interval in the snapshot observation interval that is located before the above-mentioned instruction triggering time can be called the previous interval, and the sub-interval in the snapshot observation interval that is located after the above-mentioned instruction triggering time can be called the following interval.

[0193] According to the different command triggering times, it can be divided into two situations. Figure 5a and Figure 5b Give examples to illustrate each one.

[0194] First case:

[0195] See also Figure 5a , which is a schematic diagram of the first snapshot observation interval provided in an embodiment of the present application.

[0196] Figure 5aIn the figure, T1 represents the acquisition start time of the image sensor, that is, the program start time of the camera application, T2 represents the command triggering time, and T3 represents the command receiving time.

[0197] The snapshot observation interval may be a time interval before and after T2, that is, a time interval shown as [T4, T5].

[0198] Among them, T4 can be called the starting time of the snapshot observation interval, and [T4, T2] is the above-mentioned previous interval; T5 can be called the ending time of the snapshot observation interval, and [T2, T5] is the above-mentioned subsequent interval.

[0199] The above-mentioned time T4 can be determined based on a first preset length of the previous interval, such as T2-first preset length; the time T5 can be determined based on a second preset length of the subsequent interval, such as T2+second preset length.

[0200] In this case, the time length between the instruction triggering time T2 and the collection starting time T1 is longer, that is, [T1, T2]>the first preset length.

[0201] Second case:

[0202] See also Figure 5b , which is a schematic diagram of the second snapshot observation interval provided in an embodiment of the present application.

[0203] Figure 5b In the figure, T1 represents the start time of image sensor acquisition, that is, the program start time of the camera application, T2 represents the command trigger time, T3 represents the command receiving time, and T4 represents the end time of the snapshot observation interval.

[0204] In this case, the time length between the instruction triggering time T2 and the collection starting time T1 is shorter, that is, [T1, T2]<the first preset length.

[0205] At this time, the length of the front interval cannot reach the first preset length, and [T1, T2] can be directly determined as the front interval to obtain the longest possible front interval. In order to ensure that the snapshot observation interval reaches a certain length, the length of the rear interval can be appropriately extended, and [T2, T4] can be determined as the rear interval.

[0206] For example, in this case, the length of the rear interval may be the sum of the second preset length and the target length, and the target length may be the difference between the first preset length and the length [T1, T2].

[0207] 2. When step S101 is executed when an image acquisition instruction is received:

[0208] In this case, the acquisition time of each original image acquired by the image sensor is after the instruction triggering time, so the original images stored in the cache queue are all images acquired after the above instruction triggering time.

[0209] In this case, the snapshot observation interval may be a period of time after the above instruction triggering moment.

[0210] See also Figure 5c , which is a schematic diagram of the third snapshot observation interval provided in an embodiment of the present application.

[0211] Figure 5c In the figure, T1 indicates the command triggering time, T2 indicates the acquisition starting time, that is, the command receiving time, and T3 indicates the end time of the snapshot observation interval.

[0212] It can be seen that in this case, the snapshot observation interval can be the time interval shown by [T2, T3], and T2 is also the interval starting time of the snapshot observation interval.

[0213] Among them, T3 can be determined based on the third preset length of the snapshot observation interval, such as T2+the third preset length.

[0214] It should be noted that, in this case, the acquisition start time may not be the instruction receiving time, but a time after the instruction receiving time, and the embodiment of the present application does not limit this.

[0215] After determining the snapshot observation interval, the detection image within the snapshot observation interval at the acquisition time can be determined. The determined detection image can be called the detection image within the snapshot observation interval, and a wonderful image can be selected from the determined detection images.

[0216] Specifically, the detection image with the largest corresponding dynamic quality characterization value can be determined as a wonderful image, the detection image with the largest corresponding static quality characterization value can be determined as a wonderful image, or the image with the largest sum of the corresponding dynamic quality characterization value and the static quality characterization value can be determined as a wonderful image.

[0217] Step S304: Based on the information of the wonderful image, an original image is selected from the cache queue to obtain a second image.

[0218] Since the detection image corresponds to the original image, and the wonderful image is selected from the detection image, the wonderful image also corresponds to the original image. Based on the information of the wonderful image, the original image can be selected from the cache queue.

[0219] The information of the above-mentioned wonderful image may be the acquisition timestamp of the original image corresponding to the wonderful image, the image frame number of the original image corresponding to the wonderful image, the sequence number of the original image corresponding to the wonderful image stored in the cache queue, or any other information that can be used to identify the original image. In this way, the original image can be selected from the cache queue based on the above-mentioned information.

[0220] In one implementation, an original image whose acquisition sequence information is closest to the acquisition sequence information corresponding to the wonderful image can be selected from the cache queue to obtain a third image, and then the second image is determined based on the third image. Figure 7 Step S705 in the illustrated embodiment is not described in detail here.

[0221] Step S305: Generate a captured image based on the second image.

[0222] Specifically, if the number of the selected second images is 1, the second image may be directly determined as a captured image.

[0223] In one embodiment of the present application, if the number of selected second images is greater than 1, a captured image can be generated based on multiple second images. Figure 7 Step S706 in the illustrated embodiment.

[0224] It can be seen from the above that when the solution provided in the embodiment of the present application is used to capture an image, after the original image captured by the image sensor is stored in the cache queue in the memory, the first image whose image quality does not meet the standard in the detection image corresponding to the original image can be detected, and the original image corresponding to the first image can be deleted from the cache queue. Then, based on the information of the wonderful images in the detection image within the capture observation interval, the original image can be selected from the cache queue, and finally a captured image can be generated based on the selected original image.

[0225] Among them, the image quality of the first image is poor. After the original image corresponding to the first image with poor image quality is removed from the cache queue, on the one hand, the remaining original images stored in the cache queue are all original images with higher image quality. On the other hand, part of the cache space in the cache queue is released, and the released cache space can be used to store other original images with higher image quality. Therefore, the captured image can be generated based on the original image with higher image quality in the cache queue. In this way, the cache space in the cache queue occupied by the first image with poor image quality is released in time without affecting the image quality of the generated captured image, thereby reducing the memory requirement when generating the captured image.

[0226] In one embodiment of the present application, the length of the cache queue is smaller than the length of the snapshot observation interval.

[0227] First, the relationship between the snapshot observation interval and the cache queue is explained.

[0228] As can be seen from the aforementioned concept explanation, the snapshot observation interval refers to the time interval to which the image acquisition moment of the original image expected to be used to generate the snapshot image belongs, and the cache queue is used to store the original image.

[0229] The cache queue is often a fixed cache space reserved. If the cache queue is not large enough to accommodate all the original images within the snapshot observation interval, the original images acquired later will be cleared from the cache queue due to insufficient length of the cache queue after the original images acquired later are stored in the cache queue.

[0230] Therefore, in order to ensure that the cache queue can store every original image within the snapshot observation interval, so that any original image within the snapshot observation interval can be selected from the cache queue later, in related technologies, the length of the cache queue is often greater than or equal to the length of the snapshot observation interval.

[0231] When the solution provided by the embodiment of the present application is applied, the original images with low image quality can be cleared from the cache queue, and the released cache space can be used to store other original images collected within the snapshot observation interval. Therefore, the length of the above cache queue can be less than the length of the snapshot observation interval. It can be seen that compared with the prior art, the solution provided by the embodiment of the present application can use a shorter cache queue to achieve image capture, which reduces the length of the cache queue required to be reserved and improves memory utilization.

[0232] Next, combine Figure 6a and Figure 6b , further illustrating the advantages of the solution provided in the embodiments of the present application compared with the related art.

[0233] See first Figure 6a , which is a schematic diagram of the image capture process in the related art.

[0234] Figure 6a In the figure, the length of the cache queue is 4, P1-P5 represent the original images in the snapshot observation interval, and the image acquisition times of P1-P5 are arranged from early to late, p1-p5 are the detection images corresponding to P1-P5 in the tiny stream, and based on the image quality representation values ​​of p1-p5, it can be determined that p1 is a wonderful image.

[0235] from Figure 6a It can be seen from the left branch that, first, P1-P4 are stored in the cache queue in the order of image acquisition time, and then, in order to store P5 in the cache queue, according to the "first in, first out" principle, P1, which is first stored in the cache queue, needs to be cleared from the cache queue. In this way, the original images stored in the final cache queue are P2-P5.

[0236] Then, since P1 is not stored in the cache queue, based on the information of p1, the original image P1 corresponding to p1 cannot be taken out from the cache queue.

[0237] As can be seen from the above, in the related art, if the length of the cache queue is smaller than the length of the snapshot observation interval, some of the original images within the snapshot observation interval may not be stored in the cache queue, and as a result, it may be impossible to retrieve the original images corresponding to the wonderful images from the cache queue based on the information of the wonderful images, thereby reducing the image quality of the captured images generated based on the selected images.

[0238] See also Figure 6b , is a schematic diagram of an image capture process provided in an embodiment of the present application.

[0239] Figure 6b In the figure, the cache queue length is 4, P1-P5 represent the original images in the snapshot observation interval, and the image acquisition times of P1-P5 are arranged from early to late, p1-p5 are the detection images corresponding to P1-P5 in the tiny stream, and based on the image quality representation values ​​of p1-p5, it can be determined that p1 is a wonderful image.

[0240] After each original image is stored in the cache queue, it can be determined whether the original image is the first image that does not meet the image quality standard. Figure 6b Only the determination process for the original image P2 is shown.

[0241] from Figure 6b From the left branch, we can see that, according to the order of image acquisition time, P1 is first stored in the cache queue, and then P2 is stored in the cache queue. At this time, P2 is determined to be the first image whose image quality does not meet the standard. Therefore, P2 can be deleted from the cache queue, releasing the buffer that can accommodate one original image. Therefore, subsequent P3-P5 can be stored in the cache queue in sequence. In this way, the original images stored in the final cache queue are P1, P3-P5

[0242] Then, since P1 is stored in the cache queue, based on the information of p1, the original image P1 corresponding to p1 can be taken out from the cache queue.

[0243] It can be seen from the above that, by applying the solution provided in the embodiment of the present application, the first image whose image quality does not meet the standard can be cleared from the cache queue in a timely manner, so that a part of the cache space in the cache queue is released, and the released cache space can accommodate the remaining original images in the snapshot observation interval. Therefore, even if the length of the cache queue is less than the length of the snapshot observation interval, there is a high probability that the cache queue can accommodate all the original images with higher image quality except the first image in the snapshot observation interval, thereby ensuring that any original image with higher image quality except the first image can be taken out from the cache queue later.

[0244] In summary, compared with the related technology, in the solution provided in the embodiment of the present application, the length of the cache queue can be smaller than the length of the snapshot observation interval, that is, the solution provided in the embodiment of the present application can reduce the length of the cache queue reserved for image capture and improve memory utilization.

[0245] exist Figure 3 Based on the embodiment shown, when selecting an original image from the cache queue based on the information of the wonderful image, an original image whose acquisition sequence information is closest to the acquisition sequence information corresponding to the wonderful image can be selected from the cache queue. In view of the above situation, the embodiment of the present application provides a second image capture method.

[0246] See also Figure 7 , is a flow chart of a second image capture method provided in an embodiment of the present application, the method includes the following steps S701-S706.

[0247] Step S701: storing the original image captured by the image sensor into a cache queue in the memory.

[0248] Step S702: Detect a first image whose image quality does not meet the standard in the detection images corresponding to the original image, and delete the original image corresponding to the first image from the cache queue.

[0249] Step S703: Detecting wonderful images in the detection images within the snapshot observation interval.

[0250] Step S704: Selecting an original image whose acquisition sequence information is closest to the acquisition sequence information corresponding to the wonderful image from the cache queue to obtain a third image.

[0251] The acquisition sequence information corresponding to the original image may be the acquisition timestamp of the original image, the image frame number of the original image, the sequence number of the original image stored in the cache queue, or any other information that can be used to identify the original image; the acquisition sequence information corresponding to the wonderful image may be the acquisition sequence information of the original image corresponding to the wonderful image.

[0252] In this step, when selecting the original image whose acquisition sequence information is closest to the acquisition sequence information corresponding to the wonderful image from the cache queue, there are the following two situations:

[0253] In one case, the cache queue stores original images whose acquisition sequence information is consistent with the acquisition sequence information corresponding to the wonderful image. In this case, the original images can be directly selected from the cache queue.

[0254] In another case, the cache queue does not store original images whose acquisition sequence information is consistent with that of the wonderful image. In this case, the cache queue may select an original image whose acquisition sequence information is closest to that of the wonderful image.

[0255] Among them, selecting from the cache queue the original image whose acquisition sequence information is closest to the acquisition sequence information corresponding to the wonderful image may refer to selecting from the cache queue the original image whose acquisition sequence information has the smallest absolute difference with the acquisition sequence information corresponding to the wonderful image.

[0256] For example, the acquisition sequence information corresponding to the wonderful image is the acquisition timestamp t1, and the original image corresponding to the acquisition timestamp t2 with the smallest absolute difference with t1 can be selected from the cache queue.

[0257] Step S705: Determine the second image based on the third image.

[0258] Specifically, the second image may be determined based on the third image in the following manner.

[0259] In one implementation, a second difference between the motion amplitude of the object in the third image and the motion amplitude of the object in the fourth image may be determined. If the second difference is greater than a difference threshold, the third image is determined as the second image; otherwise, both the third image and the fourth image are determined as the second image.

[0260] The fourth image is: an image in the cache queue that is adjacent to the third image.

[0261] The above difference threshold can be set by the staff based on experience or actual needs.

[0262] The concept of the above range of motion has been mentioned above. Figure 3 It is described in step S302 of the illustrated embodiment that the method for obtaining the second difference can be obtained on the basis of the method for obtaining the first difference introduced in the above step S302, which will not be described in detail here.

[0263] When the second difference is greater than the difference threshold, it means that the difference between the third image and its adjacent fourth image is large. At this time, the third image is directly determined as the second image for generating the snapshot image, which can avoid the influence of the fourth image on the generation of the snapshot image; when the second difference is not greater than the difference threshold, it means that the difference between the third image and its adjacent fourth image is small, that is, the third image is relatively close to the fourth image. At this time, the third image and the fourth image are both determined as the second image. When the snapshot image is subsequently generated based on the second image, the snapshot image can be generated more comprehensively based on the image features of the third image and the fourth image, which is beneficial to improving the image quality of the generated snapshot image.

[0264] In another implementation manner, the third image may be directly determined as the second image.

[0265] Step S706: Generate a captured image based on the second image.

[0266] It can be seen from the above step S705 that in some cases, there may be multiple second images. In this case, the multiple second images may be fused to generate a captured image.

[0267] It can be seen that in this way, the original image whose acquisition sequence information is closest to the acquisition sequence information corresponding to the wonderful image can be selected from the cache queue to obtain the third image. Since the original image whose acquisition sequence information is closest to the acquisition sequence information corresponding to the wonderful image is often the original image corresponding to the wonderful image, or the original image closest to the original image corresponding to the wonderful image, the third image with a stronger correlation with the wonderful image can be obtained according to the above method, and then the second image with a stronger correlation with the wonderful image can be obtained based on the third image, which is conducive to improving the image quality of the captured image generated based on the second image.

[0268] The user information involved in the embodiments of the present application is information that has been authorized by the user. The acquisition, storage, use, processing, transmission, provision and disclosure of the user information are in compliance with the relevant laws and regulations and do not violate public order and good morals.

[0269] 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 where the computer readable storage medium is located is controlled to perform some or all of the steps in the above embodiment. The above storage medium may be a disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM), etc.

[0270] 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.

[0271] In a specific implementation, the embodiment of the present application further provides a terminal, including:

[0272] one or more processors, image sensors, and memory;

[0273] 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 terminal to execute the aforementioned image capture method.

[0274] like Figure 8 As shown, the present application also provides a chip system, which is applied to a terminal 100. The chip system includes one or more processors 801. The processor 801 is used to call computer instructions so that the terminal 100 inputs the data to be processed into the chip system. The chip system processes the data based on the image capture method provided in an embodiment of the present application and outputs the processing result.

[0275] In a possible implementation, the chip system also includes input and output interfaces for inputting and outputting data.

[0276] The various embodiments of the mechanism disclosed in the present 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.

[0277] Program code can be applied to input instructions to perform the functions described in this application 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.

[0278] Program code can be implemented with high-level programming language or object-oriented programming language to communicate with the processing system. When necessary, program code can also be implemented with assembly language or machine language. In fact, the mechanism described in this application is not limited to the scope of any specific programming language. In either case, the language can be a compiled language or an interpreted language.

[0279] 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 through 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, random access memories, erasable programmable read-only memories (Erasable Programmable Read Only Memory, EPROM), electrically erasable programmable read-only memories (Electrically Erasable Programmable Read Only Memory, 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 include 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).

[0280] In the accompanying drawings, some structural or method features may be shown in a specific arrangement and / or order. However, it should be understood that such a specific arrangement and / or order may not be required. Instead, in some embodiments, these features may be arranged in a manner and / or order different from that shown in the accompanying drawings of the specification. In addition, the inclusion of structural or method features in a particular figure does not mean that such features are required in all embodiments, and in some embodiments, these features may not be included or may be combined with other features.

[0281] 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 method 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 proposed by the present application. In addition, in order to highlight the innovative part of the present application, the above-mentioned device embodiments of the present application do not introduce units / modules that are not closely related to solving the technical problems proposed by the present application, which does not mean that there are no other units / modules in the above-mentioned device embodiments.

[0282] It should be noted that in the examples and description of this patent, relational terms such as first and second, etc. are only used 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 including 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, the elements defined by the sentence "including one" do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0283] Although the present application has been illustrated and described with reference to certain preferred embodiments thereof, it will be apparent to 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 present application.

Claims

1. An image capture method, It is characterized in that The method comprises: In response to the camera application being opened, storing the raw image captured by the image sensor into a cache queue in the memory; Detecting a first image whose image quality does not meet the standard in the detection images corresponding to the original image, and deleting the original image corresponding to the first image from the cache queue, wherein the detection image is: an image obtained by preprocessing the original image; Detecting wonderful images in the detection images within the snapshot observation interval, the number of original images that can be stored in the cache queue is less than the number of original images located in the snapshot observation interval at the time of acquisition; Based on the information of the wonderful image, selecting an original image from the cache queue to obtain a second image; generating a captured image based on the second image; The step of detecting a first image whose image quality does not meet the standard in the detection image corresponding to the original image includes: Obtaining a dynamic quality characterization value and / or a static quality characterization value of a detection image corresponding to the original image; detecting a first image whose image quality does not meet the standard in the detection image based on the obtained quality characterization value and a quality threshold, wherein the quality threshold is determined based on the length of the cache queue and is inversely proportional to the length of the cache queue; The step of selecting an original image from the cache queue based on the information of the wonderful image to obtain a second image comprises: An original image whose acquisition sequence information is closest to the acquisition sequence information corresponding to the wonderful image is selected from the cache queue to obtain a third image; and a second image is determined based on the third image.

2. The method according to claim 1, It is characterized in that The dynamic quality characterization value includes at least one of the following information: The motion amplitude of the object in the detected image; The first difference between the motion amplitude of the object in the detected image and the motion amplitude of the object in the adjacent image.

3. The method according to claim 1, It is characterized in that The static quality characterization value includes at least one of the following information: Automatic exposure AE convergence of the detected image; The automatic focus AF convergence degree of the detected image; Automatic white balance (AWB) convergence degree of the detected image; The clarity of the detected image; The contrast of the detected image; The color saturation of the detected image; The color uniformity of the detected image.

4. The method according to claim 1, It is characterized in that The step of determining the second image based on the third image includes: Determining a second difference between a motion amplitude of an object in the third image and a motion amplitude of an object in a fourth image, wherein the fourth image is: an image in the cache queue adjacent to the third image; If the second difference is greater than a difference threshold, determining the third image as the second image; Otherwise, the third image and the fourth image are both determined as the second image.

5. The method according to any one of claims 1 to 3, It is characterized in that The detection image is obtained by performing at least one of the following processing on the original image: Downsampling, noise reduction, sharpening, and smoothing.

6. A terminal, It is characterized in that include: one or more processors, image sensors, and memory; The memory is coupled to the one or more processors, and the memory is used to store computer program codes, where the computer program codes include computer instructions. The one or more processors call the computer instructions to enable the terminal to execute the method according to any one of claims 1 to 5.

7. A computer-readable storage medium, It is characterized in that The method comprises a computer program, and when the computer program is run on a terminal, the terminal is caused to execute the method according to any one of claims 1 to 5.

8. A computer program product, It is characterized in that The computer program product comprises executable instructions, and when the executable instructions are executed on a terminal, the terminal is caused to execute the method according to any one of claims 1 to 5.

9. A chip system, It is characterized in that The chip system is applied to a terminal, and the chip system includes one or more processors, and the processor is used to call computer instructions so that the terminal inputs data into the chip system, and executes the method described in any one of claims 1 to 5 to process the data and then output the processing results.

Citation Information

Patent Citations

  • Method and device for taking picture

    CN112771612A

  • Image processing method, electronic equipment, chip and readable storage medium

    CN113938602A

  • Video processing method, electronic equipment and readable medium

    CN114827342A