Nothing Special   »   [go: up one dir, main page]

CN117692792A - Image capturing method, terminal, storage medium and program product - Google Patents

Image capturing method, terminal, storage medium and program product Download PDF

Info

Publication number
CN117692792A
CN117692792A CN202310948323.2A CN202310948323A CN117692792A CN 117692792 A CN117692792 A CN 117692792A CN 202310948323 A CN202310948323 A CN 202310948323A CN 117692792 A CN117692792 A CN 117692792A
Authority
CN
China
Prior art keywords
image
image sensor
acquired
images
moment
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310948323.2A
Other languages
Chinese (zh)
Inventor
王菊远
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Honor Device Co Ltd
Original Assignee
Honor Device Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Honor Device Co Ltd filed Critical Honor Device Co Ltd
Priority to CN202310948323.2A priority Critical patent/CN117692792A/en
Publication of CN117692792A publication Critical patent/CN117692792A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/95Computational photography systems, e.g. light-field imaging systems
    • H04N23/951Computational photography systems, e.g. light-field imaging systems by using two or more images to influence resolution, frame rate or aspect ratio
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules
    • H04N23/61Control of cameras or camera modules based on recognised objects
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules
    • H04N23/62Control of parameters via user interfaces
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/80Camera processing pipelines; Components thereof
    • H04N23/84Camera processing pipelines; Components thereof for processing colour signals
    • H04N23/86Camera processing pipelines; Components thereof for processing colour signals for controlling the colour saturation of colour signals, e.g. automatic chroma control circuits
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/80Camera processing pipelines; Components thereof
    • H04N23/84Camera processing pipelines; Components thereof for processing colour signals
    • H04N23/88Camera processing pipelines; Components thereof for processing colour signals for colour balance, e.g. white-balance circuits or colour temperature control

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Human Computer Interaction (AREA)
  • Computing Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Studio Devices (AREA)

Abstract

The embodiment of the application provides an image capturing method, a terminal, a storage medium and a program product, and relates to the technical field of image processing, wherein the method comprises the following steps: responding to clicking of a snap shot button by a user, and obtaining an image acquired by an image sensor; determining a scene type of a shooting scene based on action information of an object in an image acquired by an image sensor; if the scene type is a non-motion scene, selecting a reference image from the images acquired by the image sensor based on a first moment and a static quality characterization value of the images acquired by the image sensor, wherein the first moment is: the user clicks the generation moment of the image acquisition instruction triggered by the snapshot button; if the scene type is a motion scene, selecting a reference image from the images acquired by the image sensor based on the action information of the object in the images acquired by the image sensor; based on the reference image, a snap shot image is generated. By applying the image snapshot scheme provided by the embodiment of the application, the better image can be snapped.

Description

Image capturing method, terminal, storage medium and program product
Technical Field
The present disclosure relates to the field of image processing technologies, and in particular, to an image capturing method, a terminal, a storage medium, and a program product.
Background
Terminals such as mobile phones and tablet computers are generally provided with image sensors, so that the terminals have a photographing function. People often relax and record life through photographing, and have an increasingly high pursuit for photographing experience, and hope to be able to capture better images when photographing.
However, many people have limited shooting levels, and it is difficult to control the terminal to capture a better image, and the captured image is often unsatisfactory.
In view of the foregoing, it is desirable to provide an image capture scheme to capture a better image.
Disclosure of Invention
In view of the foregoing, the present application provides an image capturing method, terminal, storage medium and program product for capturing a preferred image.
In a first aspect, an embodiment of the present application provides an image capturing method, where the method includes:
responding to clicking of a snap shot button by a user, and obtaining an image acquired by an image sensor;
determining a scene type of a shooting scene based on action information of an object in an image acquired by the image sensor;
if the scene type is a non-motion scene, selecting a reference image from the images acquired by the image sensor based on a first moment and a static quality characterization value of the images acquired by the image sensor, wherein the first moment is: the image sensor receives the moment when the user clicks an image acquisition instruction triggered by a snapshot button;
If the scene type is a motion scene, selecting a reference image from the images acquired by the image sensor based on action information of objects in the images acquired by the image sensor;
and generating a snap shot image based on the reference image.
As can be seen from the above, in the scheme provided by the embodiment, before the reference image is selected from the images acquired by the image sensor, the scene type of the shooting scene is first distinguished based on the motion information of the object in the image, and the scene type is determined as a moving scene or a non-moving scene, so that the reference image can be selected from the images acquired by the image sensor in different manners based on the determined scene type. Therefore, the reference image can be selected in a targeted manner according to the characteristics of the two scene types, namely the motion scene and the non-motion scene, so that the selected reference image is more reasonable and targeted, and the snapshot image generated based on the selected reference image is more reasonable and targeted. In summary, the scheme provided by the embodiment of the application can be used for capturing a better image.
In one embodiment of the present application, the selecting a reference image from the images acquired by the image sensor based on the first time and the static quality characterization value of the images acquired by the image sensor includes:
Selecting a first image from images acquired by the image sensor based on a first time;
obtaining a static quality characterization value of the first image;
and selecting a reference image from the first image according to the obtained static quality characterization value.
In the scheme provided by the embodiment, when the reference image is selected, the first image is selected from the images acquired by the image sensor based on the first moment, and then the reference image is selected from the first image according to the static quality characterization value of the first image. Because the first moment is the moment of receiving the image acquisition instruction, based on the first moment, the first image of which the acquisition moment is related to the moment of receiving the image acquisition instruction can be selected from the images acquired by the image sensor, and the first image of which the moment is related to the moment of receiving the image acquisition instruction is generally similar to the picture seen when the user actually clicks to shoot.
In one embodiment of the present application, the selecting, based on the first time, a first image from the images acquired by the image sensor includes:
The first image is selected in at least one of the following ways:
determining a first image acquired before the first moment in the images acquired by the image sensor;
a first image acquired after the first time is determined from among the images acquired by the image sensor.
The first moment is the moment when the image sensor receives the image acquisition instruction, and because of the existence of instruction time delay, the first moment is positioned after the second moment, so that the image acquired before the first moment is the image of which the acquisition moment is close to the second moment, and the image is determined to be the first image, thereby being beneficial to obtaining the reference image of which the acquisition moment is close to the second moment based on the first image. Because the collection time of the reference image is close to the second time, the reference image is similar to the picture seen when the user clicks the snapshot button, so that a snapshot image similar to the picture seen when the user clicks the snapshot button can be generated based on the reference image, and the snapshot image is a better image for the user, so that user experience is improved.
In addition, the first moment is the moment when the image acquisition instruction is received, and because the user always keeps stable holding of the terminal for a period of time after clicking the photographing button when photographing by adopting the terminal, the image acquired after the first moment is always the image acquired when the terminal is in a stable posture, and the static image quality is always better. Therefore, the image acquired after the first moment is determined to be the first image, and the image with higher static image quality can be obtained, so that the image quality of the reference image selected from the first image is higher, the image quality of the snap-shot image generated based on the reference image is improved, and for a user, the snap-shot image is a better image, and the user experience is improved.
In one embodiment of the present application, the selecting a reference image from the first image according to the obtained static quality characterization value includes:
determining a second moment when the user clicks the snapshot button;
a reference image is selected from the first image based on the second time instant and the obtained static quality characterization value.
Because the second moment is the moment when the user actually clicks the snapshot button, based on the second moment, a reference image close to the second moment can be selected from the first image, namely, an image which is more similar to the picture seen by the user when the user actually clicks the snapshot button is selected, so that the generation of the snapshot image which is more similar to the picture seen by the user when the user actually clicks the snapshot button based on the reference image is facilitated, the image is more close to the picture seen by the user when the user clicks the snapshot button, and therefore, for the user, the snapshot image is a better image, and the user experience is improved.
In one embodiment of the present application, the selecting a reference image from the first image based on the second time and the obtained static quality characterization value includes:
and determining a reference image which is closest to the second moment in acquisition time and has the image quality reaching the standard from the first image based on the obtained static quality characterization value.
Therefore, on the premise that the image quality reaches the standard, the reference image with the acquisition time closest to the second time is determined, and as the second time is the time when the user actually clicks the snapshot button, the reference image with the most similar picture as seen by the user at the time when the user actually clicks the snapshot button can be determined as much as possible, the picture is close to the picture as seen by the user when the user clicks the snapshot button, namely, the picture is seen, and the picture is obtained, so that the snapshot image is a better picture for the user, and the user experience is improved.
In one embodiment of the present application, the static quality characterization value includes at least one of the following information:
the automatic exposure AE convergence degree of the image acquired by the image sensor;
the automatic focusing AF convergence degree of the image acquired by the image sensor;
the automatic white balance AWB convergence of the image acquired by the image sensor;
the definition of the image collected by the image sensor;
the contrast of the image acquired by the image sensor;
color saturation of an image acquired by the image sensor;
color uniformity of images acquired by the image sensor.
Therefore, the static quality characterization value can comprise information corresponding to various types of static evaluation indexes, so that the quality information of the image in the static dimension or the space dimension can be reflected more comprehensively and accurately.
In one embodiment of the present application, the action information includes at least one of the following information:
the motion amplitude of the object in the image acquired by the image sensor;
the difference between the motion amplitude of the object in the image acquired by the image sensor and the motion amplitude of the object in the adjacent image.
The motion amplitude reflects the motion condition of an object in a single image in the time dimension, and the dynamic change of the detection image can be accurately measured in the time dimension, so that the scene type of a shooting scene can be accurately determined based on the motion amplitude.
In addition, the difference reflects the difference between the motion amplitudes of the objects in the plurality of images which are continuous in time, reflects the change of the motion condition of the objects in the plurality of images in the time dimension, and can accurately measure the dynamic change of the images in the time dimension, so that the scene type of the shooting scene can be accurately determined based on the difference.
In one embodiment of the present application, the selecting a reference image from the images acquired by the image sensor based on the motion information of the object in the images acquired by the image sensor includes:
And selecting a reference image from the images acquired by the image sensor based on the action information of the object in the images acquired by the image sensor and the static quality characterization value of the images.
Therefore, the images acquired by the image sensor can be evaluated more comprehensively from two aspects of the motion dimension and the static dimension, so that more excellent reference images can be obtained, and more excellent snap-shot images can be generated based on the reference images.
In one embodiment of the present application, the generating a snap shot image based on the reference image includes:
determining a second difference between the motion amplitude of the object in the reference image and the motion amplitude of the object in a second image, wherein the second image is: an image adjacent to the reference image in the images acquired by the image sensor;
if the second difference is greater than a difference threshold, generating a snap-shot image based on the reference image;
otherwise, a snap shot image is generated based on the reference image and the second image.
When the second difference is larger than the difference threshold, the fact that the difference between the reference image and the second image adjacent to the reference image is larger is indicated, and at the moment, the snapshot image is directly generated based on the reference image, so that the influence of the second image on the generation of the snapshot image can be avoided; when the second difference is not larger than the difference threshold, the difference between the reference image and the second image adjacent to the reference image is smaller, namely the reference image is closer to the second image, at the moment, the snapshot image is generated based on the reference image and the second image, the image contents of the reference image and the second image are comprehensively considered, and the generation of the better snapshot image is facilitated.
In a second aspect, an embodiment of the present application further provides a terminal, including:
one or more processors, image sensors, and memory;
the memory is coupled to the one or more processors, the memory for storing computer program code comprising computer instructions that the one or more processors invoke the computer instructions to cause the terminal to perform the method of any of the above aspects.
In a third aspect, embodiments of the present application also provide a computer readable storage medium comprising a computer program which, when run on a terminal, causes the terminal to perform the method of any one of the first aspects above.
In a fourth aspect, embodiments of the present application also provide a computer program product comprising executable instructions which, when executed on a terminal, cause the terminal to perform the method of any one of the first aspects above.
In a fifth aspect, an embodiment of the present application further provides a chip system, where the chip system is applied to a terminal, and the chip system includes one or more processors, where the processors are configured to invoke computer instructions to cause the terminal to input data into the chip system, and perform the method according to any one of the first aspect to process the data and output a processing result.
Advantageous effects of the solutions provided by the embodiments in the second aspect, the third aspect, the fourth aspect, and the fifth aspect described above may be referred to the advantageous effects of the solutions provided by the embodiments in the first aspect described above.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the embodiments will be briefly described below, it being obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a schematic structural diagram of a terminal according to an embodiment of the present application;
fig. 2 is a software structural block diagram of a terminal according to an embodiment of the present application;
fig. 3 is a flowchart of a first image capturing method according to an embodiment of the present application;
fig. 4a is a schematic diagram of a first image capturing moment according to an embodiment of the present application;
fig. 4b is a schematic diagram of a second image capturing moment according to an embodiment of the present application;
fig. 4c is a schematic diagram of a third image capturing moment according to an embodiment of the present application;
fig. 5 is a flowchart of a second image capturing method according to an embodiment of the present application;
Fig. 6 is a schematic diagram of a first image capturing effect provided in an embodiment of the present application;
fig. 7 is a schematic diagram of a second image capturing effect provided in an embodiment of the present application;
fig. 8 is a schematic structural diagram of a chip system according to an embodiment of the present application.
Detailed Description
For a better understanding of the technical solutions of the present application, embodiments of the present application are described in detail below with reference to the accompanying drawings.
In order to clearly describe the technical solutions of the embodiments of the present application, in the embodiments of the present application, the words "first", "second", etc. are used to distinguish the same item or similar items having substantially the same function and effect. For example, the first instruction and the second instruction are for distinguishing different user instructions, and the sequence of the instructions is not limited. It will be appreciated by those of skill in the art that the words "first," "second," and the like do not limit the amount and order of execution, and that the words "first," "second," and the like do not necessarily differ.
In this application, the terms "exemplary" or "such as" are used to mean serving as an example, instance, or illustration. Any embodiment or design described herein as "exemplary" or "for example" should not be construed as preferred or advantageous over other embodiments or designs. Rather, the use of words such as "exemplary" or "such as" is intended to present related concepts in a concrete fashion.
The scheme provided by the embodiment of the application can be applied to terminals provided with image sensors, such as mobile phones, tablet computers, personal digital assistants (Personal Digital Assistant, PDA), smart watches, wearable electronic devices, augmented Reality (Augmented Reality, AR) devices, virtual Reality (VR) devices, robots, smart glasses and the like.
By way of example, fig. 1 shows a schematic structural diagram of a terminal 100. The terminal 100 may include a processor 110, a display 120, an internal memory 130, a subscriber identity module (Subscriber Identification Module, SIM) card interface 140, a universal serial bus (Universal Serial Bus, USB) interface 150, a charge 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, an antenna 2, and the like. The sensor modules 170 may include, among other things, pressure sensors 170A, fingerprint sensors 170B, touch sensors 170C, ambient light sensors 170D, image sensors 170E, and the like.
It should be understood that the structure illustrated in the embodiments of the present application does not constitute a specific limitation on the terminal 100. In other embodiments of the present application, terminal 100 may include more or less components than illustrated, or certain components may be combined, or certain components may be split, or different arrangements of components. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
The processor 110 may include one or more processing units, such as: the processor 110 may include a central processor (Central Processing Unit, CPU), an application processor (Application Processor, AP), a modem processor, a graphics processor (graphics processing unit, GPU), an image signal processor (Image Signal Processor, ISP), a controller, a video codec, a digital signal processor (Digital Signal Processor, DSP), a baseband processor, and/or a Neural network processor (Neural-network Processing Unit, NPU), etc. Wherein the different processing units may be separate components or may be integrated in one or more processors. In some embodiments, terminal 100 can also include one or more processors 110. The controller can generate operation control signals according to the instruction operation codes and the time sequence signals to finish the control of instruction fetching and instruction execution. In other embodiments, memory may also be provided in the processor 110 for storing instructions and data. Illustratively, the memory in the processor 110 may be a cache memory. The memory may hold instructions or data that the processor 110 has just used or recycled. If the processor 110 needs to reuse the instruction or data, it may be called directly from memory. This avoids repeated accesses and reduces the latency of the processor 110, thereby improving the efficiency of the terminal 100 in processing data or executing instructions.
In some embodiments, the processor 110 may include one or more interfaces. The interfaces may include Inter-integrated circuit (Inter-Integrated Circuit, I2C) interfaces, inter-integrated circuit audio (Inter-Integrated Circuit Sound, I2S) interfaces, pulse code modulation (Pulse Code Modulation, PCM) interfaces, universal asynchronous receiver Transmitter (Universal Asynchronous Receiver/Transmitter, UART) interfaces, mobile industry processor interfaces (Mobile Industry Processor Interface, MIPI), general-Purpose Input/Output (GPIO) interfaces, SIM card interfaces, and/or USB interfaces, among others. The USB interface 150 is an interface conforming to the USB standard, and may specifically be a Mini USB interface, a Micro USB interface, a USB Type C interface, or the like. The USB interface 150 may be used to connect a charger to charge the terminal 100, and may also be used to transfer data between the terminal 100 and peripheral devices. The USB interface 150 may also be used to connect headphones through which audio is played.
It should be understood that the interfacing relationship between the modules illustrated in the embodiments of the present application is for illustrative purposes, and is not limited to the structure of the terminal 100. In other embodiments of the present application, the terminal 100 may also use different interfacing manners, or a combination of multiple interfacing manners in the foregoing embodiments.
The wireless communication function of the terminal 100 may be implemented by the antenna 1, the antenna 2, the mobile communication module 180, the wireless communication module 190, a modem processor, a baseband processor, and the like.
The antennas 1 and 2 are used for transmitting and receiving electromagnetic wave signals. Each antenna in terminal 100 may be configured to cover a single or multiple communication bands. Different antennas may also be multiplexed to improve the utilization of the antennas. For example: the antenna 1 may be multiplexed into a diversity antenna of a wireless local area network. In other embodiments, the antenna may be used in conjunction with a tuning switch.
Terminal 100 implements display functions through a GPU, display 120, and an application processor, etc. The GPU is a microprocessor for image processing, and is connected to the display 120 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. Processor 110 may include one or more GPUs that execute program instructions to generate or change display information.
The display 120 is used to display images, videos, and the like. The display 120 includes a display panel. The display panel may employ a liquid crystal display (Liquid Crystal Display, LCD), an Organic Light-Emitting Diode (OLED), an Active-Matrix Organic Light Emitting Diode (AMOLED), a flexible Light-Emitting Diode (FLED), miniled, microLed, micro-OLED, a quantum dot Light-Emitting Diode (Quantum Dot Light Emitting Diodes, QLED), or the like. In some embodiments, terminal 100 may include 1 or more display screens 120.
In some embodiments of the present application, when the display panel is made of OLED, AMOLED, FLED, the display screen 120 in fig. 1 may be folded. Here, the display 120 may be folded, which means that the display may be folded at any angle at any portion and may be held at the angle, for example, the display 120 may be folded in half from the middle. Or folded up and down from the middle.
The display 120 of the terminal 100 may be a flexible screen that is currently of great interest due to its unique characteristics and great potential. Compared with the traditional screen, the flexible screen has the characteristics of strong flexibility and bending property, can provide a new interaction mode based on the bending property for the user, and can meet more requirements of the user on the terminal. For a terminal equipped with a foldable display, the foldable display on the terminal can be switched between a small screen in a folded configuration and a large screen in an unfolded configuration at any time. Accordingly, users use a split screen function on a terminal configured with a foldable display screen, also more and more frequently.
The terminal 100 may implement a photographing function through an ISP, an image sensor 170E, a video codec, a GPU, a display screen 120, an application processor, and the like.
The ISP is used to process the data fed back by the image sensor 170E. For example, when photographing, the shutter is opened, light is transmitted to the image sensor 170E through the lens, the optical signal is converted into an electrical signal, and the image sensor 170E transmits the electrical signal to the ISP to be processed, and converts into an image visible to the naked eye. The ISP can carry out algorithm optimization on noise, brightness and color of the image, and can optimize parameters such as exposure, color temperature and the like of a shooting scene.
The image sensor 170E is used to capture photographs or video. The object is projected through a lens to generate an optical image to the image sensor 170E. The image sensor 170E may include a charge coupled device (Charge Coupled Cevice, CCD) or a Complementary Metal Oxide Semiconductor (CMOS) phototransistor. The image sensor 170E converts the optical signal into an electrical signal, and then transfers the electrical signal to the ISP to convert 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 a standard Red Green Blue (RGB), YUV format image signal, and the like. In some embodiments, the terminal 100 may include 1 or N image sensors 170e, N being a positive integer greater than 1.
The digital signal processor is used for processing digital signals, and can process other digital signals besides digital image signals. For example, when the terminal 100 selects a frequency bin, the digital signal processor is used to fourier transform the frequency bin energy, etc.
Video codecs are used to compress or decompress digital video. The terminal 100 may support one or more video codecs. In this way, the terminal 100 may play or record video in a variety of encoding formats, such as: dynamic picture experts group (Moving Picture Experts Group, MPEG) 1, MPEG2, MPEG3, and MPEG4.
The NPU is a Neural-Network (NN) computing processor, and can rapidly process input information by referencing a biological Neural Network structure, for example, referencing a transmission mode between human brain neurons, and can also continuously perform self-learning. Applications such as intelligent cognition of the terminal 100 can be implemented by the NPU, for example: image recognition, face recognition, speech recognition, text understanding, etc.
The internal memory 130 may be used to store one or more computer programs, including instructions. The processor 110 may cause the terminal 100 to perform the video matting method provided in some embodiments of the present application, various applications, data processing, and the like by executing the above-described instructions stored in the internal memory 130. The internal memory 130 may include a storage program area and a storage data area. The storage program area can store an operating system; the storage program area may also store one or more applications (such as gallery, contacts, etc.), etc. The storage data area may store data (e.g., photos, contacts, etc.) created during use of the terminal 100, etc. In addition, the internal memory 130 may include high-speed random access memory, and may also include non-volatile memory, such as one or more disk storage units, flash memory units, universal flash memory (Universal Flash Storage, UFS), and the like. In some embodiments, the processor 110 may cause the terminal 100 to perform the video matting methods provided in embodiments of the present application, as well as other applications and data processing, by executing instructions stored in the internal memory 130, and/or instructions stored in a memory provided in the processor 110.
The internal memory 130 may be used to store a related program of the video matting method provided in the embodiment of the present application, and the processor 110 may be used to call the related program of the video matting method stored in the internal memory 130 when information is presented, so as to execute the video matting method in the embodiment of the present application.
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.
The pressure sensor 170A is used to sense a pressure signal, which can be converted into an electrical signal. In some embodiments, the pressure sensor 170A may be disposed on the display 120. The pressure sensor 170A may be of various types, such as a resistive pressure sensor, an inductive pressure sensor, or a capacitive pressure sensor. The capacitive pressure sensor may be a device comprising at least two parallel plates of conductive material, the capacitance between the electrodes changing as a force is applied to the pressure sensor 170A, the terminal 100 determining the strength of the pressure based on the change in capacitance. When a touch operation is applied to the display screen 120, the terminal 100 detects the touch operation according to the pressure sensor 170A. The terminal 100 may also calculate the location of the touch based on the detection signal of the pressure sensor 170A. In some embodiments, touch operations that act on the same touch location, but at different touch operation strengths, may correspond to different operation instructions. For example: executing an instruction for checking the short message when the touch operation with the touch operation intensity smaller than the first pressure threshold acts on the short message application icon; and executing the instruction of newly creating the short message when the touch operation with the touch operation intensity being larger than or equal to the first pressure threshold acts on the short message application icon.
The fingerprint sensor 170B is used to collect a fingerprint. The terminal 100 can utilize the collected fingerprint characteristics to realize the functions of unlocking, accessing an application lock, shooting and receiving an incoming call, and the like.
The touch sensor 170C, also referred to as a touch device. The touch sensor 170C may be disposed 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 screen. The touch sensor 170C is used to detect a touch operation acting thereon or thereabout. The touch sensor 170C may communicate the detected touch operation to the application processor to determine the touch event type. Visual output related to the touch operation may be provided through the display screen 120. In other embodiments, the touch sensor 170C may also be disposed on the surface of the terminal 100 and at a different location than the display 120.
The ambient light sensor 170D is used to sense ambient light level. The terminal 100 may adaptively adjust the brightness of the display 120 according to the perceived ambient light level. The ambient light sensor 170D may also be used to automatically adjust white balance at the time of photographing. Ambient light sensor 170D may also communicate the ambient information in which the device is located to the GPU.
The ambient light sensor 170D is also used to obtain the brightness, light ratio, color temperature, etc. of the acquisition environment.
Fig. 2 is a software architecture block diagram of a terminal applicable to an embodiment of the present application. The software system of the terminal can adopt a layered architecture, an event driven architecture, a microkernel architecture, a microservice architecture or a cloud architecture.
The layered architecture divides the software system of the terminal into several layers, each layer having a distinct role and division of work. The layers communicate with each other through a software interface. In some embodiments, the software system may be divided into five layers, an application layer (applications), an application framework layer (application framework), a hardware abstraction layer (Hardware Abstract Layer, HAL), a driver layer, and a hardware layer, respectively.
The application layer may include a series of application packages that run applications by calling an application program interface (Application Programming Interface, API) provided by the application framework layer. For example, the application package may include applications such as a browser, camera, gallery, music, video, and the like. It will be appreciated that the ports of each of the applications described above may be used to receive data.
The application framework layer provides APIs and programming frameworks for application programs of the application layer. The application framework layer includes a number of 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, and DHCP (Dynamic Host Configuration Protocol ) module, a camera management module, and the like.
The hardware abstraction layer can comprise a plurality of library modules, wherein the library modules can be a display library module, a motor library module and the like, and the hardware abstraction layer can also comprise a scene type detection module and an image selection module. The terminal system can load a corresponding library module for the equipment hardware, so that the purpose of accessing the equipment hardware by the application program framework layer is achieved.
The driver layer is a layer between hardware and software. The driving layer is used for driving the hardware so that the hardware works. The driving layer at least includes a display driving, an audio driving, a camera device driving, a sensor driving, a motor driving, and the like, which is not limited in the embodiment of the present application. It will be appreciated that display driving, audio driving, camera device driving, sensor driving, motor driving, etc. may all be considered a driving node. Each of the drive nodes described above includes an interface that may be used to receive data.
The hardware layer is the bottom part of the terminal system, and can be composed of various physical components required by a processor, a memory, an input/output interface (I/O) and the like. The hardware layer may also include an image sensor and an image signal processor.
The following describes an interaction flow between layers of a software system in the process of performing image capturing by using the scheme provided in the embodiment of the present application with reference to fig. 2.
Firstly, a user triggers an image acquisition instruction through a camera application program in an application program layer, sends the image acquisition instruction to an application program framework layer, the application framework layer can receive the image acquisition instruction through a camera access interface, a camera management module in the application framework layer forwards the image acquisition instruction to a HAL layer, the HAL layer forwards the image acquisition instruction to a driving layer, and the driving layer finally forwards the image acquisition instruction to an image sensor and an image signal processor in a hardware layer through a camera equipment driving module; and responding to the image acquisition instruction by the image sensor and the image signal processor in the hardware layer, acquiring an image, caching the image, and informing the HAL layer to perform scene type detection and image selection through the forwarding of the driving layer.
Then, on one hand, the scene type detection module in the HAL layer invokes an algorithm from the camera algorithm library, determines the scene type of the shooting scene based on the algorithm, and on the other hand, the image selection module in the HAL layer invokes an algorithm from the camera algorithm library, and selects a reference image from the cached images according to the scene type of the shooting scene based on the algorithm.
Finally, the HAL layer may generate a snapshot image based on the selected reference image, and feed the snapshot image back to the gallery application in the application layer via forwarding by the application framework layer, so that the gallery application may display the snapshot image.
The concepts such as scene types mentioned in the foregoing are explained in the following specific embodiments, and will not be described in detail herein.
The following describes some concepts related to the image capturing scheme provided in the embodiment of the present application.
1. Second moment of time
The second time represents the time when the user clicks a snap button within the user interface of the camera application program.
2. At a first time
Clicking the snap button by the user may trigger an image acquisition instruction, and the moment when the image sensor receives the image acquisition instruction may be referred to as a first moment.
Because a certain time is required for transmitting the instruction in the terminal, a certain time delay exists between the moment when the image sensor actually receives the image acquisition instruction and the moment when the user clicks the snapshot button, namely, the first moment is positioned after the second moment.
The image capturing scheme provided by the embodiment of the application is described in detail below through specific embodiments.
Referring to fig. 3, a flowchart of a first image capturing method according to an embodiment of the present application is provided, where the method includes the following steps S301 to S305.
Step S301: and responding to clicking the snap button by a user, and acquiring an image acquired by the image sensor.
The image SENSOR may be a device that converts an optical image on a photosensitive surface into an electrical signal in a proportional relation with the optical image by a photoelectric conversion function, and generates an image based on the electrical signal, and may be also called a SENSOR.
The user may click a snap button at a user interface of the camera application to trigger an image acquisition instruction, so that the terminal may obtain an image acquired by the image sensor in response to the user clicking the snap button.
The images obtained in this step may be different depending on the timing at which the image sensor starts to acquire images, and will be described below.
1. The image sensor begins to capture images when the camera application is turned on.
In this case, the user may collect the image without clicking the snap button, and thus, the image collected by the image sensor may include the image collected before the second time, or may include the image collected after the second time.
In this case, in this step, an image may be obtained in a time zone in which the acquisition time is located before and after the second time, which may be referred to as a target zone.
The sub-section of the target section located before the second time may be referred to as a preceding section, and the sub-section of the target section located after the second time may be referred to as a following section.
The second time can be divided into 2 cases, which are illustrated by fig. 4a and 4b, respectively.
First case:
for example, referring to fig. 4a, a schematic diagram of a first image capturing moment according to an embodiment of the present application is provided.
In fig. 4a, T1 represents the acquisition start time of the image sensor, that is, the program start time of the camera application, T2 represents the second time, and T3 represents the first time.
In this case, as shown in fig. 4a, the target section to which the acquisition time of the image obtained in this step belongs is a section shown by [ T4, T5], that is, an image acquired by the image sensor and having the acquisition time within [ T4, T5] can be obtained.
Wherein, T4 may be referred to as the start time of the target zone, and [ T4, T2] is the preceding zone; t5 may be referred to as the end time of the target section, and [ T2, T5] is the following section.
The time T4 may be determined according to a first preset length of a previous section, which is preset, for example, T2-the first preset length; the time T5 may be determined according to a second preset length of the following interval, which is preset, for example, t2+ the second preset length.
In this case, the second time T2 is longer from the acquisition start time T1, i.e., [ T1, T2] > a first preset length.
Second case:
referring to fig. 4b, a schematic diagram of a second image capturing moment according to an embodiment of the present application is provided.
In fig. 4b, T1 represents the acquisition start time of the image sensor, that is, the program start time of the camera application, T2 represents the second time, T3 represents the first time, and T4 represents the section end time.
In this case, as shown in fig. 4b, the target interval to which the acquisition time of the image obtained in this step belongs is an interval shown by [ T1, T4], and T1 is also the interval start time, that is, an image acquired by the image sensor and having the acquisition time within [ T1, T4] can be obtained.
In this case, the second time T2 is shorter from the acquisition start time, i.e., [ T1, T2] < the first preset length.
At this time, the length of the preceding section cannot reach the first preset length, the [ T1, T2] may be directly determined as the preceding section to obtain the preceding section as long as possible, and in order to ensure that the target section reaches a certain length, the length of the following section may be appropriately prolonged, and the [ T2, T4] may be determined as the following section.
For example, in this case, the length of the subsequent section may be the sum of the second preset length and the target length, which may be the difference between the first preset length and the section length of [ T1, T2 ].
2. The image sensor starts to acquire an image at the first time.
In this case, the user has clicked the snap button, and the image sensor receives the image acquisition instruction at the first time, so that the images acquired by the image sensor are all images acquired after the first time.
Referring to fig. 4c, a schematic diagram of a third image capturing moment according to an embodiment of the present application is provided.
In fig. 4c, T1 represents the second time, T2 represents the first time, T2 also represents the acquisition start time, and T3 represents the section end time.
In this case, the target interval to which the acquisition time of the obtained image belongs may be a time interval indicated by [ T2, T3], and T2 is also the interval start time.
Wherein T3 may be determined based on a third preset length of the target interval, for example, t2+ the third preset length may be used.
In this case, the acquisition start time may be not the first time but a time after the first time, which is not limited in the embodiment of the present application.
Step S302: and determining the scene type of the shooting scene based on the action information of the object in the image acquired by the image sensor.
The objects in the image may be people, animals, etc., and may be identified based on various object detection algorithms or pre-trained object identification models, which are not limited in this embodiment of the present application.
The action information of the object may be various kinds of information for describing the action of the object, which is not limited in the embodiment of the present application.
For example, positional information of the subject, such as head position, arm position, leg position, and the like, may be included; the motion amplitude information of the object can also be included, such as the front-back distance of the hands, the front-back distance of the feet, the jump height, the mouth angle lifting amplitude, the body inclination degree and the like of the object.
In one case, the action information may include at least one of the following information:
1. amplitude of motion of objects in images
The motion amplitude reflects the motion condition of an object in a single image in the time dimension, and the dynamic change of the detection image can be accurately measured in the time dimension, so that the scene type of a shooting scene can be accurately determined based on the motion amplitude.
2. The difference between the motion amplitude of an object in an image and the motion amplitude of an object in an adjacent image.
The adjacent images of an image refer to: and the corresponding acquisition time is adjacent to the image acquisition time of the image.
The meaning of the motion amplitude of the object in the adjacent image is the same as that of the object in the detected image.
The difference reflects the difference between the motion amplitudes of the objects in the plurality of images which are continuous in time, reflects the change of the motion condition of the objects in the plurality of images in the time dimension, and can accurately measure the dynamic change of the images in the time dimension, so that the scene type of the shooting scene can be accurately determined based on the difference.
Specifically, the scene type of the photographed scene may be determined based on the motion information of the object in the image in the following manner.
In one embodiment, the scene type may be determined based on a difference in motion information of neighboring images:
for each image, a first difference between the motion amplitude of the object in the image and the motion amplitude of the object in its neighboring image is determined, and based on the resulting first difference, the scene type of the photographed scene is determined.
The difference between the motion magnitudes of the objects in the adjacent images reflects the motion situation of the objects in the time dimension, and thus, the scene type of the photographed scene can be determined based on the above-described first difference, which will be exemplified by the following two cases.
Under the condition, if the target number of the images with the corresponding first difference larger than the first difference threshold value is larger than a certain proportion of the total number of the images, the scene type of the shooting scene can be determined to be a motion scene, otherwise, the scene type of the shooting scene is determined to be a non-motion scene.
When the target number is greater than a certain proportion of the total number of images, the difference between the motion amplitudes of the objects in the images is larger when more images are compared with the adjacent images, namely the motion of the objects is continuously changed in the time dimension, so that the scene type of the shooting scene can be determined to be a motion scene. Otherwise, it may be determined that the scene type is a non-moving scene.
The first discrepancy threshold may be set by the staff member based on experience or actual demand.
In another case, if the first difference corresponding to any image is greater than the second difference threshold, the scene type of the shooting scene can be determined to be a motion scene, otherwise, the scene type of the shooting scene is determined to be a non-motion scene.
The second difference threshold may be greater than the first difference threshold, and a specific value of the second difference threshold may be set by a worker based on experience or actual demand.
When the first difference corresponding to an image is larger than the second difference threshold, the image is compared with the adjacent image, and the motion amplitude of the object in the image is larger, and because the image is continuous with the adjacent image in acquisition time and the time span between the acquisition time of the image and the acquisition time of the adjacent image is smaller, the situation indicates that the object has larger motion change in a smaller time interval, so that the scene type of the shooting scene can be determined to be a motion scene. Otherwise, it may be determined that the scene type is a non-moving scene.
In another embodiment, the scene type may be determined based on motion information of each single image:
judging whether images with motion information larger than a motion threshold exist in the images, if so, determining that the scene type of the shooting scene is a motion type, otherwise, determining that the scene type of the shooting scene is a non-motion type.
For example, the motion information may include a jump height, and if the jump height of the object in the image P1 is h1 > the motion threshold K1, it may be directly determined that the photographed scene is of a motion type. This situation indicates that the object in P1 is in a jumping state and it is obvious that the above scene type motion type can be directly determined.
For another example, the motion information may include a front-back distance between two hands and a front-back distance between two feet, and if the front-back distance between two hands of the object in the image P2 is s1 > the motion threshold K2 and the front-back distance between two feet of the object is s2 > the motion threshold K3, the shooting scene may be directly determined to be of a motion type. This situation indicates that the object in P2 is running, and it is obvious that the above scene type motion type can be directly determined.
Step S303: if the scene type is a non-moving scene, a reference image is selected from the images acquired by the image sensor based on the first moment and a static quality characterization value of the images acquired by the image sensor.
The non-motion scene may also be referred to as a static scene, and it should be noted that, in the embodiment of the present application, the static scene does not represent a scene in which an object is absolutely stationary, but represents that the motion amplitude of the object in the scene is smaller.
The static quality characterization value can be obtained based on a static evaluation index of the image and is used for evaluating quality information of the image in a static dimension or a space dimension.
In one case, the static quality characterization value may include at least one of the following information:
an Auto exposure (Automatic Exposure, AE) convergence of an image captured by an image sensor, an Auto Focus (AF) convergence of the image, an Auto white balance (Automatic white balance, AWB) convergence of the image, a sharpness of the image, a contrast of the image, a color saturation of the image, a color uniformity of the image.
Therefore, the static quality characterization value can comprise information corresponding to various types of static evaluation indexes, so that the quality information of the image in the static dimension or the space dimension can be reflected more comprehensively and accurately.
In particular, in the case where the scene type is a non-moving scene, a reference image may be selected from images acquired by the image sensor in the following manner.
In one embodiment, a first image may be selected from images acquired by an image sensor based on a first time, a static quality characterization value of the first image is obtained, and a reference image may be selected from images acquired by the image sensor based on the obtained static quality characterization value. The specific embodiments are described in the following steps S503 to S505 in the embodiment shown in fig. 5, and will not be described in detail here.
In another embodiment, a preset number of target images whose acquisition time is closest to the target time may be determined from the images acquired by the image sensor, and the reference image may be selected from the target images based on the static quality characterization value of the target images.
The target time may be obtained based on a difference between the first time and the estimated instruction delay.
As can be seen from the explanation of the above conceptual explanation, the image sensor can actually receive the image acquisition instruction after a certain time delay after the user clicks the snap button due to the time delay of the instruction transmission in the terminal, that is, the first time is located after the second time.
Therefore, the target time obtained based on the difference between the first time and the estimated instruction time delay is closer to the second time, that is, the time when the user clicks the snapshot button.
On the basis, the preset number of target images with the acquisition time closest to the target time in the obtained images are images with the acquisition time closer to the second time when the user clicks the snapshot button.
After the target image is determined, one image with the largest static quality characterization value can be determined from the target image to serve as a reference image, a preset number of images with the largest static instruction characterization value can be determined from the selected images to serve as the reference image, and an image with the image quality characterization value larger than a preset threshold value can be determined from the selected images to serve as the reference image.
Therefore, the reference image with the acquisition time being close to the second time when the user clicks the snapshot button can be determined, and the reference image is similar to the picture seen when the user clicks the snapshot button because the acquisition time of the reference image is close to the second time.
Step S304: and if the scene type is a motion scene, selecting a reference image from the images acquired by the image sensor based on the action information of the object in the images acquired by the image sensor.
Specifically, dynamic quality characterization values of the respective images may be obtained based on motion information of the object in the images acquired by the image sensor, and the reference image may be selected from the images based on the obtained dynamic quality characterization values.
For example, one image with the largest corresponding dynamic quality representation value may be selected as the reference image, a preset number of images with the largest corresponding dynamic instruction representation value may be selected as the reference image, an image with a corresponding dynamic quality representation value greater than a preset threshold may be selected as the reference image, and so on.
The motion quality characterization value may be obtained by performing processes such as fusion and weighting calculation on information included in the motion information corresponding to the image, which will not be described herein.
In one embodiment of the present application, if the scene type is a motion scene, the reference image may be selected from the images acquired by the image sensor based on motion information of the object in the images acquired by the image sensor and a static quality characterization value of the images.
The present embodiment may be obtained by combining step S303 with the above embodiment described in the present step, for example, determining, as a reference image, an image having the largest sum of the corresponding dynamic quality characterization value and static quality characterization value, and the like, which will not be described herein.
Therefore, the images acquired by the image sensor can be evaluated more comprehensively from two aspects of the motion dimension and the static dimension, so that more excellent reference images can be obtained, and more excellent snap-shot images can be generated based on the reference images.
Step S305: based on the reference image, a snap shot image is generated.
Specifically, a snap-shot image may be generated based on a reference image in the following manner.
In one embodiment, the reference image may be determined directly as a snap shot image.
In another embodiment, a second difference between the motion amplitude of the object in the reference image and the motion amplitude of the object in the second image may be determined, and if the second difference is greater than the difference threshold, a snap shot image is generated based on the reference image, otherwise, the snap shot image is generated based on the reference image and the second image.
Wherein the second image is: an image adjacent to the reference image among images acquired by the image sensor.
When the snapshot image is generated based on the reference image and the second image, the reference image and the second image can be subjected to image fusion, so that the snapshot image is generated.
When the second difference is larger than the difference threshold, the fact that the difference between the reference image and the second image adjacent to the reference image is larger is indicated, and at the moment, the snapshot image is directly generated based on the reference image, so that the influence of the second image on the generation of the snapshot image can be avoided; when the second difference is not larger than the difference threshold, the difference between the reference image and the second image adjacent to the reference image is smaller, namely the reference image is closer to the second image, at the moment, the snapshot image is generated based on the reference image and the second image, the image contents of the reference image and the second image are comprehensively considered, and the generation of the better snapshot image is facilitated.
From the above, when the scheme provided by the embodiment of the application is applied to generate a snap-shot image, firstly, responding to the click of a snap-shot button by a user to obtain an image collected by an image sensor, then, determining the scene type of a shooting scene based on action information of an object in the image collected by the image sensor, and selecting a reference image from the image collected by the image sensor based on the first moment when the image sensor receives an image collection instruction triggered by the click of the snap-shot button by the user and a static quality representation value of the image collected by the image sensor under the condition that the scene type is a non-moving scene; selecting a reference image from images acquired by the image sensor based on motion information of an object in the images acquired by the image sensor under the condition that the scene type is a motion scene; and finally successfully generating a snap-shot image based on the selected reference image.
Before selecting the reference image from the images acquired by the image sensor, distinguishing the scene type of the shooting scene based on the action information of the object in the image, and determining the scene type as a moving scene or a non-moving scene, so that the reference image can be selected from the images acquired by the image sensor in different modes based on the determined scene type. Therefore, the reference image can be selected in a targeted manner according to the characteristics of the two scene types, namely the motion scene and the non-motion scene, so that the selected reference image is more reasonable and targeted, and the snapshot image generated based on the selected reference image is more reasonable and targeted.
In summary, the scheme provided by the embodiment of the application can be used for capturing a better image.
On the basis of the embodiment shown in fig. 3, if the scene type of the shooting scene is a non-moving scene, when selecting the reference image from the images acquired by the image sensor, a first image may be selected from the images acquired by the image sensor based on the first moment, and then the reference image may be selected from the first image according to the static quality representation value of the first image. In view of the above, the embodiment of the present application provides a second image capturing method.
Referring to fig. 5, a flowchart of a second image capturing method according to an embodiment of the present application is provided, where the method includes the following steps S501 to S507.
Step S501: and responding to clicking the snap button by a user, and acquiring an image acquired by the image sensor.
Step S502: and determining the scene type of the shooting scene based on the action information of the object in the image acquired by the image sensor.
The steps S501 to S502 are the same as the steps S301 to S302 in the embodiment shown in fig. 3, and are not described herein.
Step S503: if the scene type is a non-motion scene, a first image is selected from images acquired by the image sensor based on a first time.
Specifically, the first image may be selected in the following manner.
In one embodiment, a first image of the images acquired by the image sensor that was acquired prior to a first time may be determined.
The first image may be all the images of the acquired images whose acquisition time is before the first time, or may be part of the images of all the images.
The partial images may be randomly selected images in all the images, or may be a preset number of images in all the images, where the acquisition time is closest to the first time.
The first moment is the moment when the image sensor receives the image acquisition instruction, and because of the existence of instruction time delay, the first moment is positioned after the second moment, so that the image acquired before the first moment is the image of which the acquisition moment is close to the second moment, and the image is determined to be the first image, thereby being beneficial to obtaining the reference image of which the acquisition moment is close to the second moment based on the first image. Because the collection time of the reference image is close to the second time, the reference image is similar to the picture seen when the user clicks the snapshot button, so that a snapshot image similar to the picture seen when the user clicks the snapshot button can be generated based on the reference image, and the snapshot image is a better image for the user, so that user experience is improved.
In one case, a first image of the images acquired by the image sensor that is acquired before the first time and after the second time may be determined.
The determined first image acquisition time is between the time when the user clicks the snapshot button and the time when the image sensor receives the image acquisition instruction, namely, the first image which is relatively similar to the picture seen by the user at the second time when the user clicks the snapshot button and the acquisition time is after the second time can be determined, and the determined first image is relatively reasonable.
In another embodiment, a first image acquired after a first time in the images acquired by the image sensor may be determined.
Similarly, the first image may be all images of the acquired images whose acquisition time is after the first time, or may be part of the images of all the images. The partial images may be selected randomly from all the images, or may be a preset number of images in all the images, the acquisition time of which is closest to the first time.
The first moment is the moment when the image acquisition instruction is received, and because the user can keep stable holding of the terminal for a period of time after clicking the photographing button when photographing by adopting the terminal, the image acquired after the first moment is the image acquired when the terminal is in a stable posture, and the static image quality of the image is better. Therefore, the image acquired after the first moment is determined to be the first image, and the image with higher static image quality can be obtained, so that the image quality of the reference image selected from the first image is higher, the image quality of the snap-shot image generated based on the reference image is improved, and for a user, the snap-shot image is a better image, and the user experience is improved.
In yet another embodiment, a first image of the images acquired by the image sensor that was acquired before the first time may be determined, and a first image of the images acquired by the image sensor that was acquired after the first time may be determined.
This embodiment may be obtained by combining the above two embodiments, and will not be described here again.
On the one hand, the method is beneficial to generating the snapshot image closer to the first moment based on the reference image, and on the other hand, the image quality of the snapshot image generated based on the reference image can be improved, so that the better snapshot image can be obtained.
Step S504: a static quality characterization value of the first image is obtained.
The manner of obtaining the static command representation value is described in step S303 in the embodiment shown in fig. 3, and is not described herein.
Step S505: and selecting a reference image from the first image according to the obtained static quality characterization value.
In one embodiment, a second time at which the user clicks the snap button may be determined, and a reference image may be selected from the first image based on the second time and the obtained static quality characterization value.
Since the second time is when the user clicks the snapshot button, it is advantageous to determine a reference image that is more similar to the screen that the user sees when clicking the snapshot button based on the second time.
In one case, a reference image with an interval between the acquisition time and the second time smaller than a preset time length and the image quality reaching the standard can be determined from the first image based on the obtained static quality characterization value.
And determining whether the static instruction characterization value is larger than a preset first quality threshold, if so, determining that the image quality of the first image meets the standard, otherwise, determining that the image quality of the first image does not meet the standard.
The first quality threshold may be set by a worker according to experience or actual requirements.
In another case, a reference image whose acquisition time is closest to the second time and whose image quality meets the standard may be determined from the first image based on the obtained static quality characterization value.
For example, the static quality characterization values of the first images may be traversed from the first time to the second time in the order from the late to early of the acquisition time, so that the reference image, whose acquisition time is closest to the second time and whose image quality meets the standard, may be determined from the first images.
Therefore, on the premise that the image quality reaches the standard, the reference image with the acquisition time closest to the second time is determined, and as the second time is the time when the user actually clicks the snapshot button, the reference image with the most similar picture as seen by the user at the time when the user actually clicks the snapshot button can be determined as much as possible, the picture is close to the picture as seen by the user when the user clicks the snapshot button, namely, the picture is seen, and the picture is obtained, so that the snapshot image is a better picture for the user, and the user experience is improved.
Because the second moment is the moment when the user actually clicks the snapshot button, based on the second moment, a reference image close to the second moment can be selected from the first image, namely, an image which is more similar to the picture seen by the user when the user actually clicks the snapshot button is selected, so that the generation of the snapshot image which is more similar to the picture seen by the user when the user actually clicks the snapshot button based on the reference image is facilitated, the image is more close to the picture seen by the user when the user clicks the snapshot button, and therefore, for the user, the snapshot image is a better image, and the user experience is improved.
Step S506: and if the scene type is a motion scene, selecting a reference image from the images acquired by the image sensor based on the action information of the object in the images acquired by the image sensor.
Step S507: based on the reference image, a snap shot image is generated.
The steps S506 to S507 are the same as the steps S304 to S305 in the embodiment shown in fig. 3, and are not repeated here.
From the above, when the scheme provided by the embodiment of the application is applied to select the reference image, the first image is selected from the images acquired by the image sensor based on the first moment, and then the reference image is selected from the first image according to the static quality characterization value of the first image. Because the first moment is the moment of receiving the image acquisition instruction, based on the first moment, the first image of which the acquisition moment is related to the moment of receiving the image acquisition instruction can be selected from the images acquired by the image sensor, and the first image of which the moment is related to the moment of receiving the image acquisition instruction is generally similar to the picture seen when the user actually clicks to shoot.
The following describes image capturing under the condition that the scene type is a non-motion scene and an action scene according to the scheme provided by the embodiment of the application more intuitively through two examples.
Referring to fig. 6, a schematic diagram of a first image capturing effect provided in an embodiment of the present application is shown.
Fig. 6 is a schematic diagram of an image capturing effect under a non-motion scene, wherein images collected by an image sensor are P1-P4, collecting moments of the P1-P4 are t1-t4 respectively, and the t1-t4 are arranged in sequence from early to late.
It should be noted that, since the shooting scene is a non-moving scene, P1-P4 may be similar images, and the difference of the image content is small, that is, the difference is the static quality difference of the images, so the difference of the image content of P1-P4 is not shown in fig. 6.
After the static quality characterization values of P1-P4 are obtained, the acquisition time t1 of P1 corresponds to the second time when the user clicks the snap button, P2 may be determined to be a reference image based on the static quality characterization values of P1-P4, and a snap image may be generated based on P2. For example, P2 is determined to be the image whose acquisition time is closest to the second time and whose image quality meets the standard, so P2 can be determined as the reference image and a snap shot image can be generated based on P2.
Therefore, when the scheme provided by the embodiment of the application is applied to image capturing, after the image acquired by the image sensor is acquired under the condition that the scene type of the shooting scene is a non-motion scene, the second moment when the user clicks the capturing button and the image quality are comprehensively considered, and the reference image closest to the second moment when the user clicks the capturing button can be determined on the premise that the image quality reaches the standard. On the one hand, the quality of the reference image can be ensured to be higher, and on the other hand, the reference image close to the picture seen when the user clicks the snapshot button is favorable to be determined, so that the subsequent snapshot image generated based on the reference image is more close to the picture seen when the user clicks the snapshot button, and the better snapshot image can be obtained.
Referring to fig. 7, a schematic diagram of a second image capturing effect according to an embodiment of the present application is provided.
Fig. 7 is a schematic diagram of an image capturing effect under a motion scene, wherein images collected by an image sensor are P5-P8, the collection moments of the P5-P8 are t5-t8 respectively, and the t5-t8 are arranged in sequence from early to late.
After the acquisition time t6 of P6 corresponds to the second time when the user clicks the snapshot button to obtain the motion information of the object in P5-P8, P7 may be determined to be a reference image based on the motion information of the object in P5-P8, and a snapshot image may be generated based on P7. For example, P7 may be determined to be the image with the greatest dynamic quality characterization value, and thus P7 may be determined to be the reference image, and a snap shot image may be generated based on P7.
Therefore, when the scheme provided by the embodiment of the application is applied to image capturing, under the condition that the scene type of the shooting scene is a motion scene, images acquired before and after the second moment when the user clicks the capturing button are considered, and based on the motion information of the images, the image with the maximum dynamic quality representation value can be selected as a reference image, so that the reference image with the most wonderful object motion in the image can be captured from the obtained image, and a more wonderful capturing image can be generated based on the reference image, namely, the better capturing image can be obtained.
The user information related in the embodiment of the application is authorized information of the user, and the processes of obtaining, storing, using, processing, transmitting, providing, disclosing and the like of the user information are all in accordance with the regulations of related laws and regulations and do not violate the popular regulations of the public order.
In a specific implementation, the application further provides a computer storage medium, where the computer storage medium may store a program, where when the program runs, the device where the computer readable storage medium is controlled to execute part or all of the steps in the foregoing embodiments. The storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), or the like.
In a specific implementation, an embodiment of the present application further provides a computer program product, where the computer program product contains executable instructions, where the executable instructions when executed on a terminal cause the terminal to perform some or all of the steps in the above method embodiments.
In a specific implementation, the embodiment of the application further provides a terminal, including:
one or more processors, image sensors, and memory;
the memory is coupled to the one or more processors for storing computer program code comprising computer instructions that are invoked by the one or more processors to cause the terminal to perform the aforementioned image capture method.
As shown in fig. 8, the present application further provides a chip system, where the chip system is applied to the terminal 100, and the chip system includes one or more processors 801, where the processors 801 are configured to invoke computer instructions to enable the terminal 100 to input data to be processed into the chip system, and the chip system processes the data based on the image capturing method provided in the embodiments of the present application and then outputs a processing result.
In one possible implementation, the chip system further includes input and output interfaces for inputting and outputting data.
Embodiments of the mechanisms disclosed herein may be implemented in hardware, software, firmware, or a combination of these implementations. Embodiments of the present application may be implemented as a computer program or program code that is executed on a programmable system including 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.
Program code may be applied to input instructions to perform the functions described herein and generate output information. The output information may be applied to one or more output devices in a known manner. For purposes of this application, a processing system includes any system having a processor such as, for example, a digital signal processor (Digital Signal Processor, DSP), microcontroller, application specific integrated circuit (Application Specific Integrated Circuit, ASIC), or microprocessor.
The program code may be implemented in a high level procedural or object oriented programming language to communicate with a processing system. Program code may also be implemented in assembly or machine language, if desired. Indeed, the mechanisms described in the present application are not limited in scope to any particular programming language. In either case, the language may be a compiled or interpreted language.
In some cases, the disclosed embodiments may be implemented in hardware, firmware, software, or any combination thereof. The disclosed embodiments may also be implemented as instructions carried by or stored on one or more transitory or non-transitory machine-readable (e.g., computer-readable) storage media, which may be read and executed by one or more processors. For example, the instructions may be distributed over a network or through other computer readable media. Thus, a machine-readable medium may include any mechanism for storing or transmitting information in a form readable by a machine (e.g., a computer), including but not limited to floppy diskettes, optical disks, optical disk 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 or optical cards, flash memory, or tangible machine-readable memory for transmitting information (e.g., carrier waves, infrared signal digital signals, etc.) using the internet in an electrical, optical, acoustical or other form of propagated signal. Thus, a machine-readable medium includes any type of machine-readable medium suitable for storing or transmitting electronic instructions or information in a form readable by a machine (e.g., a computer).
In the drawings, some structural or methodological features may be shown in a particular arrangement and/or order. However, it should be understood that such a particular arrangement and/or ordering may not be required. Rather, in some embodiments, these features may be arranged in a different manner and/or order than shown in the drawings of the specification. Additionally, the inclusion of structural or methodological features in a particular figure is not meant to imply that such features are required in all embodiments, and in some embodiments, may not be included or may be combined with other features.
It should be noted that, in the embodiments of the present application, each unit/module is a logic unit/module, and in physical aspect, one logic unit/module may be one physical unit/module, or may be a part of one physical unit/module, or may be implemented by a combination of multiple physical units/modules, where the physical implementation manner of the logic unit/module itself is not the most important, and the combination of functions implemented by the logic unit/module is the key to solve the technical problem posed by the present application. Furthermore, to highlight the innovative part of the present application, the above-described device embodiments of the present application do not introduce units/modules that are less closely related to solving the technical problems presented by the present application, which does not indicate that the above-described device embodiments do not have other units/modules.
It should be noted that in the examples and descriptions of this patent, relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
While the present application has been shown and described with reference to certain preferred embodiments thereof, it will be understood by those skilled in the art that various changes in form and details may be made therein without departing from the spirit and scope of the present application.

Claims (13)

1. A method of capturing images, the method comprising:
responding to clicking of a snap shot button by a user, and obtaining an image acquired by an image sensor;
determining a scene type of a shooting scene based on action information of an object in an image acquired by the image sensor;
if the scene type is a non-motion scene, selecting a reference image from the images acquired by the image sensor based on a first moment and a static quality characterization value of the images acquired by the image sensor, wherein the first moment is: the image sensor receives the moment when the user clicks an image acquisition instruction triggered by a snapshot button;
if the scene type is a motion scene, selecting a reference image from the images acquired by the image sensor based on action information of objects in the images acquired by the image sensor;
and generating a snap shot image based on the reference image.
2. The method of claim 1, wherein selecting the reference image from the images acquired by the image sensor based on the first time and a static quality characterization value of the images acquired by the image sensor comprises:
selecting a first image from images acquired by the image sensor based on a first time;
Obtaining a static quality characterization value of the first image;
and selecting a reference image from the first image according to the obtained static quality characterization value.
3. The method of claim 2, wherein selecting a first image from among the images acquired by the image sensor based on the first time instant comprises:
the first image is selected in at least one of the following ways:
determining a first image acquired before the first moment in the images acquired by the image sensor;
a first image acquired after the first time is determined from among the images acquired by the image sensor.
4. The method of claim 2, wherein selecting a reference image from the first image based on the obtained static quality characterization value comprises:
determining a second moment when the user clicks the snapshot button;
a reference image is selected from the first image based on the second time instant and the obtained static quality characterization value.
5. The method of claim 4, wherein selecting a reference image from the first image based on the second time instant and the obtained static quality characterization value comprises:
And determining a reference image which is closest to the second moment in acquisition time and has the image quality reaching the standard from the first image based on the obtained static quality characterization value.
6. The method according to any one of claims 1-5, wherein the static quality characterization value comprises at least one of the following information:
the automatic exposure AE convergence degree of the image acquired by the image sensor;
the automatic focusing AF convergence degree of the image acquired by the image sensor;
the automatic white balance AWB convergence of the image acquired by the image sensor;
the definition of the image collected by the image sensor;
the contrast of the image acquired by the image sensor;
color saturation of an image acquired by the image sensor;
color uniformity of images acquired by the image sensor.
7. The method according to any one of claims 1-5, wherein the action information comprises at least one of the following information:
the motion amplitude of the object in the image acquired by the image sensor;
the difference between the motion amplitude of the object in the image acquired by the image sensor and the motion amplitude of the object in the adjacent image.
8. The method of any of claims 1-5, wherein selecting a reference image from the image acquired by the image sensor based on motion information of an object in the image acquired by the image sensor comprises:
And selecting a reference image from the images acquired by the image sensor based on the action information of the object in the images acquired by the image sensor and the static quality characterization value of the images.
9. The method of any of claims 1-5, wherein the generating a snap shot image based on the reference image comprises:
determining a second difference between the motion amplitude of the object in the reference image and the motion amplitude of the object in a second image, wherein the second image is: an image adjacent to the reference image in the images acquired by the image sensor;
if the second difference is greater than a difference threshold, generating a snap-shot image based on the reference image;
otherwise, a snap shot image is generated based on the reference image and the second image.
10. A terminal, comprising:
one or more processors, image sensors, and memory;
the memory being coupled to the one or more processors, the memory being for storing computer program code comprising computer instructions that are invoked by the one or more processors to cause the terminal to perform the method of any one of claims 1 to 9.
11. A computer readable storage medium comprising a computer program which, when run on a terminal, causes the terminal to perform the method of any of claims 1 to 9.
12. A computer program product comprising executable instructions which, when executed on a terminal, cause the terminal to perform the method of any of claims 1 to 9.
13. A chip system for application to a terminal, the chip system comprising one or more processors for invoking computer instructions to cause the terminal to input data into the chip system and to output the result of processing after processing the data by performing the method of any of claims 1 to 9.
CN202310948323.2A 2023-07-28 2023-07-28 Image capturing method, terminal, storage medium and program product Pending CN117692792A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310948323.2A CN117692792A (en) 2023-07-28 2023-07-28 Image capturing method, terminal, storage medium and program product

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310948323.2A CN117692792A (en) 2023-07-28 2023-07-28 Image capturing method, terminal, storage medium and program product

Publications (1)

Publication Number Publication Date
CN117692792A true CN117692792A (en) 2024-03-12

Family

ID=90125220

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310948323.2A Pending CN117692792A (en) 2023-07-28 2023-07-28 Image capturing method, terminal, storage medium and program product

Country Status (1)

Country Link
CN (1) CN117692792A (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106060406A (en) * 2016-07-27 2016-10-26 维沃移动通信有限公司 Photographing method and mobile terminal
US20170064199A1 (en) * 2014-02-21 2017-03-02 Samsung Electronics Co., Ltd. Electronic device and method for processing image
CN112771612A (en) * 2019-09-06 2021-05-07 华为技术有限公司 Method and device for shooting image
CN115225819A (en) * 2022-07-20 2022-10-21 哲库科技(上海)有限公司 Image shooting method, device, chip, terminal and storage medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170064199A1 (en) * 2014-02-21 2017-03-02 Samsung Electronics Co., Ltd. Electronic device and method for processing image
CN106060406A (en) * 2016-07-27 2016-10-26 维沃移动通信有限公司 Photographing method and mobile terminal
CN112771612A (en) * 2019-09-06 2021-05-07 华为技术有限公司 Method and device for shooting image
CN115225819A (en) * 2022-07-20 2022-10-21 哲库科技(上海)有限公司 Image shooting method, device, chip, terminal and storage medium

Similar Documents

Publication Publication Date Title
CN110045908B (en) Control method and electronic equipment
CN113254120B (en) Data processing method and related device
WO2021218694A1 (en) Video processing method and mobile terminal
CN116301363B (en) Space gesture recognition method, electronic equipment and storage medium
WO2024031879A1 (en) Method for displaying dynamic wallpaper, and electronic device
WO2022206589A1 (en) Image processing method and related device
CN116348917A (en) Image processing method and device
CN117499779B (en) Image preview method, device and storage medium
CN115643485B (en) Shooting method and electronic equipment
CN109164917A (en) Control method of electronic device, storage medium and electronic equipment
CN117692792A (en) Image capturing method, terminal, storage medium and program product
CN117692791B (en) Image capturing method, terminal, storage medium and program product
WO2022170866A1 (en) Data transmission method and apparatus, and storage medium
CN117692752B (en) Image processing method, terminal, storage medium and program product
CN116703729B (en) Image processing method, terminal, storage medium and program product
CN117692751B (en) Image processing method, terminal, storage medium and program product
CN117689611B (en) Quality prediction network model generation method, image processing method and electronic equipment
CN116206321B (en) Form identification method, electronic equipment, storage medium and program product
CN115988339B (en) Image processing method, electronic device, storage medium, and program product
WO2023035868A1 (en) Photographing method and electronic device
CN116193243B (en) Shooting method and electronic equipment
CN117692753B (en) Photographing method and electronic equipment
CN117692763A (en) Photographing method, electronic device, storage medium and program product
WO2024088253A1 (en) Display method for foldable screen and electronic device
CN118574008A (en) Automatic exposure method, terminal, storage medium and program product

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination