WO2021190097A1 - 图像处理方法和装置 - Google Patents
图像处理方法和装置 Download PDFInfo
- Publication number
- WO2021190097A1 WO2021190097A1 PCT/CN2021/071489 CN2021071489W WO2021190097A1 WO 2021190097 A1 WO2021190097 A1 WO 2021190097A1 CN 2021071489 W CN2021071489 W CN 2021071489W WO 2021190097 A1 WO2021190097 A1 WO 2021190097A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- image
- camera
- terminal
- magnification
- scene
- 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.)
- Ceased
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N23/00—Cameras or camera modules comprising electronic image sensors; Control thereof
- H04N23/95—Computational photography systems, e.g. light-field imaging systems
- H04N23/951—Computational photography systems, e.g. light-field imaging systems by using two or more images to influence resolution, frame rate or aspect ratio
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N23/00—Cameras or camera modules comprising electronic image sensors; Control thereof
- H04N23/10—Cameras or camera modules comprising electronic image sensors; Control thereof for generating image signals from different wavelengths
- H04N23/13—Cameras or camera modules comprising electronic image sensors; Control thereof for generating image signals from different wavelengths with multiple sensors
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T5/00—Image enhancement or restoration
- G06T5/50—Image enhancement or restoration using two or more images, e.g. averaging or subtraction
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/04—Architecture, e.g. interconnection topology
- G06N3/045—Combinations of networks
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/04—Architecture, e.g. interconnection topology
- G06N3/045—Combinations of networks
- G06N3/0455—Auto-encoder networks; Encoder-decoder networks
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/04—Architecture, e.g. interconnection topology
- G06N3/0464—Convolutional networks [CNN, ConvNet]
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/06—Physical realisation, i.e. hardware implementation of neural networks, neurons or parts of neurons
- G06N3/063—Physical realisation, i.e. hardware implementation of neural networks, neurons or parts of neurons using electronic means
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/08—Learning methods
- G06N3/09—Supervised learning
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T5/00—Image enhancement or restoration
- G06T5/70—Denoising; Smoothing
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T5/00—Image enhancement or restoration
- G06T5/90—Dynamic range modification of images or parts thereof
- G06T5/92—Dynamic range modification of images or parts thereof based on global image properties
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N23/00—Cameras or camera modules comprising electronic image sensors; Control thereof
- H04N23/70—Circuitry for compensating brightness variation in the scene
- H04N23/71—Circuitry for evaluating the brightness variation
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N23/00—Cameras or camera modules comprising electronic image sensors; Control thereof
- H04N23/70—Circuitry for compensating brightness variation in the scene
- H04N23/72—Combination of two or more compensation controls
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N23/00—Cameras or camera modules comprising electronic image sensors; Control thereof
- H04N23/70—Circuitry for compensating brightness variation in the scene
- H04N23/741—Circuitry for compensating brightness variation in the scene by increasing the dynamic range of the image compared to the dynamic range of the electronic image sensors
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N23/00—Cameras or camera modules comprising electronic image sensors; Control thereof
- H04N23/80—Camera processing pipelines; Components thereof
- H04N23/81—Camera processing pipelines; Components thereof for suppressing or minimising disturbance in the image signal generation
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N9/00—Details of colour television systems
- H04N9/64—Circuits for processing colour signals
- H04N9/646—Circuits for processing colour signals for image enhancement, e.g. vertical detail restoration, cross-colour elimination, contour correction, chrominance trapping filters
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/20—Special algorithmic details
- G06T2207/20084—Artificial neural networks [ANN]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N23/00—Cameras or camera modules comprising electronic image sensors; Control thereof
- H04N23/90—Arrangement of cameras or camera modules, e.g. multiple cameras in TV studios or sports stadiums
Definitions
- This application relates to the field of image processing technology, and in particular to image processing methods and devices.
- the color optimization is usually based on a single frame image, that is, the color of the image is optimized based on the characteristics of the captured image itself.
- This method lacks the collection of objective environmental information, so it is difficult to ensure objective and controllable robustness, that is, the final effect is prone to "off-topic distortion", resulting in poor user performance.
- the embodiments of the present application provide an image processing method and device, which help optimize the color, contrast, or dynamic range of the image, and at the same time make the optimized image more objective and improve the robustness.
- an image processing method is provided, which is applied to a terminal, the terminal includes a first camera and a second camera, the magnification of the first camera is not less than the magnification of the second camera, and the method includes: When the sensitivity ISO in the current shooting environment is greater than the first threshold: use the first camera to capture a first image for the first scene in the current shooting environment; use the second camera to capture a second image for the first scene; according to the second image Optimize the first image and get the third image.
- the color of the third image is better than the color of the first image (condition 1); or, when the contrast of the second image is higher than the contrast of the first image , The contrast of the third image is higher than the contrast of the first image (condition 2); or, when the dynamic range of the second image is greater than the dynamic range of the first image, the dynamic range of the third image is greater than the dynamic range of the first image ( Condition 3). It should be noted that at least two of the above condition 1, condition 2 and condition 3 can be satisfied at the same time.
- the terminal optimizes the first image by using a second image based on the color, contrast, or dynamic range of the same scene that is better than the first image. Since the collection of objective environmental information is considered, compared with the prior art, the use of a single-frame image to optimize the color of the technical solution helps to make the optimized image more objectively represent the real scene, and improves the robustness sex.
- the color of the second image is better than the color of the first image, including at least one of the following conditions: the chromaticity of the second image is greater than the chromaticity of the first image; the brightness of the second image is greater than that of the first image. The brightness of the image.
- the image content of the third image is the same (or approximately the same) as the image content of the first image, which can be embodied in that the texture information of the third image is the same (or approximately the same) as the texture information of the first image. ).
- the photosensitive performance of the second camera is greater than the photosensitive performance of the first camera. This helps to make at least one of the color, contrast, or dynamic range of the second image better than the first image.
- the aperture of the second camera is larger than the aperture of the first camera. This helps to make at least one of the color, contrast, or dynamic range of the second image better than the first image.
- the exposure time when the second camera collects the second image is longer than the exposure time when the first camera collects the first image. This helps to make at least one of the color, contrast, or dynamic range of the second image better than the first image.
- the ISO used when the second camera captures the second image is greater than the ISO used when the first camera captures the first image. This helps to make at least one of the color, contrast, or dynamic range of the second image better than the first image.
- the magnification range of the second camera includes [0.5, 1)
- the magnification range of the first camera includes [1, 20].
- the second camera is a wide-angle camera
- the first camera is a 1X camera, a 3X camera, or a 10X camera.
- the magnification of the second camera is 1, and the magnification range of the first camera includes (1, 20).
- the second camera is a 1X camera
- the first camera is a 3X camera or a 10X camera.
- the method further includes: collecting N frames of images for the first scene through the first camera, where N is an integer greater than or equal to 1, and performing multi-frame noise reduction (or more Frame fusion) to obtain the fourth image.
- the image content of the fourth image is the same as the image content of the first image.
- optimizing the first image based on the second image to obtain the third image includes: optimizing the fourth image based on the second image to obtain the third image.
- the terminal can optimize the image based on the fusion of multiple images taken by the same camera to obtain the third image.
- the method further includes: collecting N1 frames of images and N2 frames of images for the first scene through the first camera and the second camera respectively; wherein, N1 and N2 are both integers greater than or equal to 1; according to N1
- the frame image, the N2 frame image, and the first image are subjected to multi-frame noise reduction (or multi-frame fusion) to obtain a fifth image.
- the image content of the fifth image is the same as the image content of the first image.
- optimizing the first image based on the second image to obtain the third image includes: optimizing the fifth image based on the second image to obtain the third image.
- the terminal can optimize the image after the fusion of multiple images taken by different cameras to obtain the third image.
- the method further includes: when the shooting magnification of the terminal for the first scene is [1,A), selecting a camera with a magnification of 1 in the terminal as the first camera; or, when the terminal is for the first scene When the shooting magnification is [A,B), the camera with magnification A in the terminal is selected as the first camera; or, when the shooting magnification of the terminal for the first scene is greater than C, the camera with magnification C in the terminal is selected as the first camera. Camera.
- the terminal’s shooting magnification for the first scene is [1,3)
- the terminal further includes a third camera, the third camera is a camera different from the first camera and the second camera in the terminal, and the magnification of the third camera is not greater than the magnification of the first camera; the method also includes : Collect N3 frames of images and N4 frames of images for the first scene through the first camera and the third camera respectively; where N3 and N4 are integers greater than or equal to 1, and multiply based on N3 frames of images, N4 frames of images, and the first image. Frame noise reduction (or multi-frame fusion) to obtain the sixth image. Wherein, the image content of the sixth image is the same as the image content of the first image.
- optimizing the first image based on the second image to obtain the third image includes: optimizing the sixth image based on the second image to obtain the third image.
- the terminal may optimize the image based on the fusion of multiple images captured by at least three cameras to obtain the third image.
- the method further includes: when the shooting magnification of the terminal for the first scene is [7,10), selecting a camera with a magnification of 10 in the terminal as the first camera, and selecting a magnification of 3 in the terminal The camera is used as the third camera.
- the above method further includes: when the terminal's shooting magnification for the first scene is [1,A), selecting a camera with a magnification of 1 or less than 1 in the terminal as the second camera; or, when the terminal When the shooting magnification for the first scene is [A, B), select the camera with a magnification less than or equal to A in the terminal as the second camera; or, when the shooting magnification of the terminal for the first scene is greater than C, select the camera with a magnification less than or equal to C The C camera is used as the second camera.
- a camera with a magnification of 1 or less than 1 in the terminal is selected as the second camera;
- the shooting magnification of the terminal for the first scene is [3, 7)
- a camera with a magnification of 3, 1, or less than 1 in the terminal is selected as the second camera;
- a camera with a magnification of 10, 3, 1, or less than 1 in the terminal is selected as the second camera.
- optimizing the first image based on the second image to obtain the third image includes: obtaining a color correction matrix CCM matrix of at least two sub-images in the first image; wherein, at least two sub-images include the first sub-image Image, the CCM matrix of the first sub-image is used to characterize the mapping relationship between the features of the first sub-image and the features of the second sub-image in the second image; the first sub-image and the second sub-image are images of the same object Features include at least one of color, contrast, or dynamic range; based on the CCM matrix of at least two sub-images, obtain the CCM matrix of the pixels in the first image; wherein the first image includes the first pixel, the CCM of the first pixel The matrix is used to characterize the mapping relationship between the feature of the first pixel and the feature of the second pixel in the second image; the first pixel and the second pixel correspond to the same image content; the CCM matrix and the CCM matrix based on the pixels in the first image The first image, the
- the first pixel and the second pixel correspond to the same image content, which can be understood as: after the first image and the second image are registered, the position of the first pixel in the first image and the position of the second pixel in the second image The location is the same (or approximately the same).
- obtaining the CCM matrix of at least two sub-images in the first image includes: using a first neural network to obtain the CCM matrix of the at least two sub-images; The texture information, and the feature and texture information of the second image are analyzed to obtain CCM matrices of at least two sub-images.
- optimizing the first image based on the second image to obtain the third image includes:
- the second neural network is used to optimize the image style of the image with the poorer image style by using the image with the better image style. This helps to make the optimization results better.
- an image processing method is provided, which is applied to a terminal.
- the terminal includes a first camera and a second camera.
- the magnification of the first camera is not less than the magnification of the second camera.
- the method includes: when the first camera is currently shooting When the sensitivity ISO in the environment is greater than the first threshold: use the first camera to capture the first image for the first scene in the current shooting environment; use the second camera to capture the second image for the first scene; where the color of the second image The color of the first image is closer to the true color of the first scene; the first image is optimized according to the second image to obtain the third image; the color of the third image is closer to the true color of the first scene than the color of the first image.
- This embodiment is particularly suitable for scenes where the color of the captured image is too much different from the color of the real scene, that is, in a scene where a color cast phenomenon occurs. In this scene, it helps to achieve that the color of the optimized image is compared with the color before the optimization. The color of the image is closer to the color of the real scene.
- the second image and the first image meet at least one of the following conditions: the chromaticity of the second image is closer to the true chromaticity of the first scene than the chromaticity of the first image; the brightness of the second image The brightness of the first image is closer to the real brightness of the first scene.
- the image content of the third image is the same (or approximately the same) as the image content of the first image.
- the photosensitive performance of the second camera is greater than the photosensitive performance of the first camera.
- the aperture of the second camera is larger than the aperture of the first camera.
- the exposure time when the second camera collects the second image is longer than the exposure time when the first camera collects the first image.
- the ISO used when the second camera captures the second image is greater than the ISO used when the first camera captures the first image.
- the magnification range of the second camera includes [0.5, 1)
- the magnification range of the first camera includes [1, 20].
- the magnification of the second camera is 1, and the magnification range of the first camera includes (1, 20).
- use the second image to optimize the fourth, fifth, or sixth image.
- optimize the first For image first calculate the CCM matrix of the sub-image in the first image, then interpolate to obtain the CCM matrix of the pixels in the first image, and then optimize the first image based on the CCM matrix of the pixels. For example, directly use the neural network to optimize the first image.
- an image processing device which may be a terminal, a chip, or a chip system.
- the device can be used to execute any of the methods provided in the first or second aspect described above.
- the device may be divided into functional modules according to any of the methods provided in the first aspect.
- each function module can be divided corresponding to each function, or two or more functions can be integrated into one processing module.
- the present application may divide the device into a processing unit and a sending unit according to functions.
- the device includes: a memory and one or more processors, the memory is used to store computer instructions, and the processor is used to call the computer instructions to execute the first aspect and its Any method provided by any possible design method, or any method provided by the second aspect and any possible design method thereof.
- a terminal including: a processor, a memory, and at least two cameras, the at least two cameras are used to capture images, the memory is used to store computer programs and instructions, and the processor is used to call the computer programs and instructions Execute any method provided in the first aspect or the second aspect in cooperation with the at least two cameras.
- a computer-readable storage medium such as a non-transitory computer-readable storage medium.
- a computer program (or instruction) is stored thereon, and when the computer program (or instruction) runs on a computer, the computer executes any one of the possible implementations of the first aspect or the second aspect. method.
- a computer program product which, when running on a computer, enables any method provided in any one of the possible implementation manners of the first aspect or the second aspect to be executed.
- each functional module does not constitute a limitation on the device or the functional module itself. In actual implementation, these devices or functional modules may appear under other names. As long as the function of each device or functional module is similar to that of this application, it falls within the scope of the claims of this application and its equivalent technologies.
- FIG. 1 is a schematic diagram of the hardware structure of a terminal applicable to an embodiment of the present application
- FIG. 2 is a block diagram of a software structure of a terminal applicable to an embodiment of the present application
- FIG. 3 is a flowchart of an image processing method provided by an embodiment of the application.
- FIG. 4 is a flowchart of a method for acquiring a first image and a second image provided by an embodiment of the application
- FIG. 5 is a flowchart of another method for acquiring a first image and a second image according to an embodiment of the application
- FIG. 6 is a flowchart of a method for optimizing a first image according to an embodiment of the application
- FIG. 7 is a schematic diagram of using a grid to divide a first image evenly according to an embodiment of the application.
- FIG. 8A is a schematic diagram of a process of optimizing a first image based on a CCM matrix according to an embodiment of the application.
- 8B is a schematic diagram of the comparison of the first image, the second image, and the third image when the first image is optimized based on the CCM matrix according to an embodiment of the application;
- FIG. 9 is a flowchart of another method for optimizing a first image according to an embodiment of the application.
- FIG. 10 is a schematic diagram of the network structure and logic function of a neural network provided by an embodiment of this application.
- FIG. 11 is a schematic diagram of another image processing method provided by an embodiment of the application.
- FIG. 12 is a schematic structural diagram of a terminal provided by an embodiment of the application.
- words such as “exemplary” or “for example” are used as examples, illustrations, or illustrations. Any embodiment or design solution described as “exemplary” or “for example” in the embodiments of the present application should not be construed as being more preferable or advantageous than other embodiments or design solutions. To be precise, words such as “exemplary” or “for example” are used to present related concepts in a specific manner.
- first and second are only used for descriptive purposes, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of indicated technical features. Thus, the features defined with “first” and “second” may explicitly or implicitly include one or more of these features. In the description of the embodiments of the present application, unless otherwise specified, "plurality" means two or more.
- a terminal which can be a terminal with a camera, such as a smart phone, a tablet computer, a wearable device, an AR/VR device, or a personal computer (personal computer, A PC), a personal digital assistant (PDA), a netbook, and other devices may also be any other terminal that can implement the embodiments of the present application.
- a terminal can be a terminal with a camera, such as a smart phone, a tablet computer, a wearable device, an AR/VR device, or a personal computer (personal computer, A PC), a personal digital assistant (PDA), a netbook, and other devices may also be any other terminal that can implement the embodiments of the present application.
- PDA personal digital assistant
- This application does not limit the specific form of the terminal.
- Wearable devices can also be called wearable smart devices. It is a general term for using wearable technology to intelligently design everyday wear and develop wearable devices, such as glasses, gloves, watches, clothing and shoes.
- a wearable device is a portable device that is directly worn
- Wearable devices are not only a kind of hardware device, but also realize powerful functions through software support, data interaction, and cloud interaction.
- wearable smart devices include full-featured, large-sized, complete or partial functions that can be achieved without relying on smart phones, such as smart watches or smart glasses, and only focus on a certain type of application function, and need to cooperate with other devices such as smart phones.
- the structure of the terminal may be as shown in Figure 1.
- the terminal 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, and a battery 142, Antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, audio module 170, speaker 170A, receiver 170B, microphone 170C, earphone interface 170D, sensor module 180, button 190, motor 191, indicator 192, camera 193, A display screen 194, a subscriber identification module (SIM) card interface 195, and so on.
- SIM subscriber identification module
- the sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, and ambient light Sensor 180L, bone conduction sensor 180M, etc.
- the number of cameras 193 included in the terminal 100 may be one or more. If the terminal 100 includes a camera, the embodiment of the present application supports the camera to work in different working states. For a detailed description of the working status, please refer to the following. If the terminal 100 includes multiple cameras, the magnifications of the multiple cameras may be different. The multiple cameras include the first camera and the second camera described in the embodiment of the present application.
- the structure illustrated in this embodiment does not constitute a specific limitation on the terminal 100.
- the terminal 100 may include more or fewer components than shown, or combine certain components, or split certain components, or arrange different components.
- the illustrated components can be implemented in hardware, software, or a combination of software and hardware.
- the processor 110 may include one or more processing units.
- the processor 110 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), and an image signal processor. (image signal processor, ISP), controller, video codec, digital signal processor (digital signal processor, DSP), baseband processor, and/or neural-network processing unit (NPU), etc.
- AP application processor
- modem processor modem processor
- GPU graphics processing unit
- image signal processor image signal processor
- ISP image signal processor
- controller video codec
- digital signal processor digital signal processor
- DSP digital signal processor
- NPU neural-network processing unit
- the different processing units may be independent devices or integrated in one or more processors.
- the processor 110 may control the first camera to collect the first image for the first camera when the sensitivity of the first camera in the first scene (international standards organization, ISO) is greater than a first threshold, And control the second camera to collect a second image for the first scene, and optimize the first image according to the second image to obtain a third image.
- ISO international standards organization
- the controller may be the nerve center and command center of the terminal 100.
- the controller can generate operation control signals according to the instruction operation code and timing signals to complete the control of fetching instructions and executing instructions.
- a memory may also be provided in the processor 110 to store instructions and data.
- the memory in the processor 110 is a cache memory.
- the memory can store instructions or data that have just been used or recycled by the processor 110. If the processor 110 needs to use the instruction or data again, it can be directly called from the memory. Repeated accesses are avoided, the waiting time of the processor 110 is reduced, and the efficiency of the system is improved.
- the processor 110 may include one or more interfaces.
- the interface may include an integrated circuit (inter-integrated circuit, I2C) interface, an integrated circuit built-in audio (inter-integrated circuit sound, I2S) interface, a pulse code modulation (pulse code modulation, PCM) interface, and a universal asynchronous transmitter/receiver (universal asynchronous) interface.
- I2C integrated circuit
- I2S integrated circuit built-in audio
- PCM pulse code modulation
- PCM pulse code modulation
- UART universal asynchronous transmitter/receiver
- MIPI mobile industry processor interface
- GPIO general-purpose input/output
- SIM subscriber identity module
- USB Universal Serial Bus
- the MIPI interface can be used to connect the processor 110 with the display screen 194, the camera 193 and other peripheral devices.
- the MIPI interface includes a camera serial interface (camera serial interface, CSI), a display serial interface (display serial interface, DSI), and so on.
- the processor 110 and the camera 193 communicate through a CSI interface to implement the shooting function of the terminal 100.
- the processor 110 and the display screen 194 communicate through a DSI interface to realize the display function of the terminal 100.
- the GPIO interface can be configured through software.
- the GPIO interface can be configured as a control signal or as a data signal.
- the GPIO interface can be used to connect the processor 110 with the camera 193, the display screen 194, the wireless communication module 160, the audio module 170, the sensor module 180, and so on.
- the GPIO interface can also be configured as an I2C interface, I2S interface, UART interface, MIPI interface, etc.
- the USB interface 130 is an interface that complies with the USB standard specification, and specifically may be a Mini USB interface, a Micro USB interface, a USB Type C interface, and so on.
- the USB interface 130 can be used to connect a charger to charge the terminal 100, and can also be used to transfer data between the terminal 100 and peripheral devices. It can also be used to connect earphones and play audio through earphones. This interface can also be used to connect to other terminals, such as AR devices.
- the interface connection relationship between the modules illustrated in this embodiment is merely a schematic description, and does not constitute a structural limitation of the terminal 100.
- the terminal 100 may also adopt different interface connection modes in the foregoing embodiments, or a combination of multiple interface connection modes.
- the power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110.
- the power management module 141 receives input from the battery 142 and/or the charge management module 140, and supplies power to the processor 110, the internal memory 121, the display screen 194, the camera 193, and the wireless communication module 160.
- the power management module 141 can also be used to monitor parameters such as battery capacity, battery cycle times, and battery health status (leakage, impedance).
- the power management module 141 may also be provided in the processor 110.
- the power management module 141 and the charging management module 140 may also be provided in the same device.
- the wireless communication function of the terminal 100 can be implemented by the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor, and the baseband processor.
- the terminal 100 implements a display function through a GPU, a display screen 194, and an application processor.
- the GPU is an image processing microprocessor, which is connected to the display screen 194 and the application processor.
- the GPU is used to perform mathematical and geometric calculations and is used for graphics rendering.
- the processor 110 may include one or more GPUs that execute program instructions to generate or change display information.
- the display screen 194 is used to display images, videos, and the like.
- the display screen 194 includes a display panel.
- the display panel can use liquid crystal display (LCD), organic light-emitting diode (OLED), active matrix organic light-emitting diode or active-matrix organic light-emitting diode (active-matrix organic light-emitting diode).
- LCD liquid crystal display
- OLED organic light-emitting diode
- active-matrix organic light-emitting diode active-matrix organic light-emitting diode
- AMOLED flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-oled, quantum dot light-emitting diode (QLED), etc.
- the terminal 100 may include one or N display screens 194, and N is a positive integer greater than one.
- GUIs graphical user interfaces
- a control is a GUI element. It is a software component contained in an application. It controls all the data processed by the application and the interactive operations on these data. The user can interact with the control through direct manipulation. , So as to read or edit the relevant information of the application.
- controls may include visual interface elements such as icons, buttons, menus, tabs, text boxes, dialog boxes, status bars, navigation bars, and Widgets.
- the terminal 100 can implement a shooting function through an ISP, a camera 193, a video codec, a GPU, a display screen 194, and an application processor.
- the ISP is used to process the data fed back from the camera 193. For example, when taking a picture, the shutter is opened, the light is transmitted to the photosensitive element of the camera through the lens, the light signal is converted into an electrical signal, and the photosensitive element of the camera transmits the electrical signal to the ISP for processing and is converted into an image visible to the naked eye.
- ISP can also optimize the image noise, brightness, and skin color. ISP can also optimize the exposure, color temperature and other parameters of the shooting scene.
- the ISP may be provided in the camera 193.
- the camera 193 is used to capture still images or videos.
- the object generates an optical image through the lens and is projected to the photosensitive element.
- the photosensitive element may be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor.
- CMOS complementary metal-oxide-semiconductor
- the photosensitive element converts the optical signal into an electrical signal, and then transfers the electrical signal to the ISP to convert it into a digital image signal.
- ISP outputs digital image signals to DSP for processing.
- DSP converts digital image signals into standard RGB, YUV and other formats of image signals.
- the terminal 100 may include one or N cameras 193, and N is a positive integer greater than one.
- Digital signal processors are used to process digital signals. In addition to digital image signals, they can also process other digital signals. For example, when the terminal 100 selects a frequency point, the digital signal processor is used to perform Fourier transform on the energy of the frequency point.
- 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 can play or record videos in multiple encoding formats, such as: moving picture experts group (MPEG) 1, MPEG2, MPEG3, MPEG4, and so on.
- MPEG moving picture experts group
- MPEG2 MPEG2, MPEG3, MPEG4, and so on.
- NPU is a neural-network (NN) computing processor.
- NN neural-network
- applications such as intelligent cognition of the terminal 100 can be realized, such as image recognition, face recognition, voice recognition, text understanding, and so on.
- the external memory interface 120 may be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the terminal 100.
- the external memory card communicates with the processor 110 through the external memory interface 120 to realize the data storage function. For example, save music, video and other files in an external memory card.
- the internal memory 121 may be used to store computer executable program code, where the executable program code includes instructions.
- the processor 110 executes various functional applications and data processing of the terminal 100 by running instructions stored in the internal memory 121. For example, in this embodiment, the processor 110 may acquire the pose of the terminal 100 by executing instructions stored in the internal memory 121.
- the internal memory 121 may include a storage program area and a storage data area. Among them, the storage program area can store an operating system, an application program (such as a sound playback function, an image playback function, etc.) required by at least one function, and the like.
- the data storage area can store data (such as audio data, phone book, etc.) created during the use of the terminal 100.
- the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, a universal flash storage (UFS), and the like.
- the processor 110 executes various functional applications and data processing of the terminal 100 by running instructions stored in the internal memory 121 and/or instructions stored in a memory provided in the processor.
- the terminal 100 can implement audio functions through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the earphone interface 170D, and the application processor. For example, music playback, recording, etc.
- the audio module 170 is used to convert digital audio information into an analog audio signal for output, and is also used to convert an analog audio input into a digital audio signal.
- the audio module 170 can also be used to encode and decode audio signals.
- the audio module 170 may be provided in the processor 110, or part of the functional modules of the audio module 170 may be provided in the processor 110.
- the speaker 170A also called “speaker” is used to convert audio electrical signals into sound signals.
- the terminal 100 can listen to music through the speaker 170A, or listen to a hands-free call.
- the receiver 170B also called “earpiece” is used to convert audio electrical signals into sound signals.
- the terminal 100 answers a call or voice message, it can receive the voice by bringing the receiver 170B close to the human ear.
- the microphone 170C also called “microphone”, “microphone”, is used to convert sound signals into electrical signals.
- the user can make a sound by approaching the microphone 170C through the human mouth, and input the sound signal into the microphone 170C.
- the terminal 100 may be provided with at least one microphone 170C. In other embodiments, the terminal 100 may be provided with two microphones 170C, which can implement noise reduction functions in addition to collecting sound signals. In other embodiments, the terminal 100 may also be provided with three, four or more microphones 170C to collect sound signals, reduce noise, identify sound sources, and realize directional recording functions.
- the earphone interface 170D is used to connect wired earphones.
- the earphone interface 170D may be a USB interface 130, or a 3.5mm open mobile terminal platform (OMTP) standard interface, and a cellular telecommunications industry association (cellular telecommunications industry association of the USA, CTIA) standard interface.
- OMTP open mobile terminal platform
- CTIA cellular telecommunications industry association of the USA, CTIA
- the pressure sensor 180A is used to sense the pressure signal and can convert the pressure signal into an electrical signal.
- the pressure sensor 180A may be provided on the display screen 194.
- the capacitive pressure sensor may include at least two parallel plates with conductive materials. When a force is applied to the pressure sensor 180A, the capacitance between the electrodes changes.
- the terminal 100 determines the strength of the pressure according to the change in capacitance.
- the terminal 100 detects the intensity of the touch operation according to the pressure sensor 180A.
- the terminal 100 may also calculate the touched position according to the detection signal of the pressure sensor 180A.
- touch operations that act on the same touch position but have different touch operation strengths may correspond to different operation instructions. For example: when a touch operation whose intensity of the touch operation is less than the first pressure threshold is applied to the short message application icon, an instruction to view the short message is executed. When a touch operation with a touch operation intensity greater than or equal to the first pressure threshold acts on the short message application icon, an instruction to create a new short message is executed.
- the gyro sensor 180B may be used to determine the movement posture of the terminal 100.
- the angular velocity of the terminal 100 around three axes ie, x, y, and z axes
- the gyro sensor 180B can be used for image stabilization.
- the gyroscope sensor 180B detects the shake angle of the terminal 100, calculates the distance that the lens module needs to compensate according to the angle, and allows the lens to counteract the shake of the terminal 100 through a reverse movement to achieve anti-shake.
- the gyro sensor 180B can also be used for navigation and somatosensory game scenes.
- the air pressure sensor 180C is used to measure air pressure.
- the terminal 100 calculates the altitude based on the air pressure value measured by the air pressure sensor 180C to assist positioning and navigation.
- the magnetic sensor 180D includes a Hall sensor.
- the terminal 100 may use the magnetic sensor 180D to detect the opening and closing of the flip holster.
- the terminal 100 can detect the opening and closing of the flip according to the magnetic sensor 180D.
- features such as automatic unlocking of the flip cover are set.
- the acceleration sensor 180E can detect the magnitude of the acceleration of the terminal 100 in various directions (generally three axes). When the terminal 100 is stationary, the magnitude and direction of gravity can be detected. It can also be used to recognize the terminal's posture, apply to horizontal and vertical screen switching, pedometer and other applications.
- the terminal 100 can measure the distance by infrared or laser. In some embodiments, when shooting a scene, the terminal 100 may use the distance sensor 180F to measure the distance to achieve fast focusing.
- the proximity light sensor 180G may include, for example, a light emitting diode (LED) and a light detector such as a photodiode.
- the light emitting diode may be an infrared light emitting diode.
- the terminal 100 emits infrared light to the outside through the light emitting diode.
- the terminal 100 uses a photodiode to detect infrared reflected light from nearby objects. When sufficient reflected light is detected, it can be determined that there is an object near the terminal 100. When insufficient reflected light is detected, the terminal 100 may determine that there is no object near the terminal 100.
- the terminal 100 can use the proximity light sensor 180G to detect that the user holds the terminal 100 close to the ear to talk, so as to automatically turn off the screen to save power.
- the proximity light sensor 180G can also be used in leather case mode, and the pocket mode will automatically unlock and lock the screen.
- the ambient light sensor 180L is used to sense the brightness of the ambient light.
- the terminal 100 can adaptively adjust the brightness of the display screen 194 according to the perceived brightness of the ambient light.
- the ambient light sensor 180L can also be used to automatically adjust the white balance when taking pictures.
- the ambient light sensor 180L can also cooperate with the proximity light sensor 180G to detect whether the terminal 100 is in a pocket to prevent accidental touch.
- the fingerprint sensor 180H is used to collect fingerprints.
- the terminal 100 can use the collected fingerprint characteristics to implement fingerprint unlocking, access application locks, fingerprint photographs, fingerprint answering calls, and so on.
- the temperature sensor 180J is used to detect temperature.
- the terminal 100 uses the temperature detected by the temperature sensor 180J to execute a temperature processing strategy. For example, when the temperature reported by the temperature sensor 180J exceeds a threshold value, the terminal 100 executes to reduce the performance of the processor located near the temperature sensor 180J, so as to reduce power consumption and implement thermal protection.
- the terminal 100 when the temperature is lower than another threshold, the terminal 100 heats the battery 142 to avoid abnormal shutdown of the terminal 100 due to low temperature.
- the terminal 100 boosts the output voltage of the battery 142 to avoid abnormal shutdown caused by low temperature.
- Touch sensor 180K also called “touch device”.
- the touch sensor 180K may be disposed on the display screen 194, and the touch screen is composed of the touch sensor 180K and the display screen 194, which is also called a “touch screen”.
- the touch sensor 180K is used to detect touch operations acting on or near it.
- the touch sensor can pass the detected touch operation to the application processor to determine the type of touch event.
- the visual output related to the touch operation can be provided through the display screen 194.
- the touch sensor 180K may also be disposed on the surface of the terminal 100, which is different from the position of the display screen 194.
- the bone conduction sensor 180M can acquire vibration signals.
- the bone conduction sensor 180M can obtain the vibration signal of the vibrating bone mass of the human voice.
- the bone conduction sensor 180M can also contact the human pulse and receive the blood pressure pulse signal.
- the bone conduction sensor 180M may also be provided in the earphone, combined with the bone conduction earphone.
- the audio module 170 can parse the voice signal based on the vibration signal of the vibrating bone block of the voice obtained by the bone conduction sensor 180M, and realize the voice function.
- the application processor can analyze the heart rate information based on the blood pressure beating signal obtained by the bone conduction sensor 180M, and realize the heart rate detection function.
- the button 190 includes a power-on button, a volume button, and so on.
- the button 190 may be a mechanical button. It can also be a touch button.
- the terminal 100 may receive key input, and generate key signal input related to user settings and function control of the terminal 100.
- the motor 191 can generate vibration prompts.
- the motor 191 can be used for incoming call vibration notification, and can also be used for touch vibration feedback.
- touch operations applied to different applications can correspond to different vibration feedback effects.
- Acting on touch operations in different areas of the display screen 194, the motor 191 can also correspond to different vibration feedback effects.
- Different application scenarios for example: time reminding, receiving information, alarm clock, games, etc.
- the touch vibration feedback effect can also support customization.
- the indicator 192 may be an indicator light, which may be used to indicate the charging status, power change, or to indicate messages, missed calls, notifications, and so on.
- an operating system runs.
- the iOS operating system developed by Apple the Android open source operating system developed by Google
- the Windows operating system developed by Microsoft You can install and run applications on this operating system.
- the operating system of the terminal 100 may adopt a layered architecture, an event-driven architecture, a microkernel architecture, a microservice architecture, or a cloud architecture.
- the embodiment of the present application takes an Android system with a layered architecture as an example to illustrate the software structure of the terminal 100 by way of example.
- FIG. 2 is a block diagram of the software structure of the terminal 100 according to an embodiment of the present application.
- the layered architecture divides the software into several layers, and each layer has a clear role and division of labor. Communication between layers through software interface.
- the Android system is divided into four layers, from top to bottom, the application layer, the application framework layer, the Android runtime and system library, and the kernel layer.
- the application layer can include a series of application packages.
- the application package can include applications such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, short message, etc.
- the camera application can access the camera interface management service provided by the application framework layer.
- the application framework layer provides an application programming interface (application programming interface, API) and a programming framework for applications in the application layer.
- the application framework layer includes some predefined functions.
- the application framework layer can include a window manager, a content provider, a view system, a phone manager, a resource manager, and a notification manager.
- the application framework layer may provide APIs related to the photographing function for the application layer, and provide camera interface management services for the application layer to realize the photographing function.
- the window manager is used to manage window programs.
- the window manager can obtain the size of the display screen, determine whether there is a status bar, lock the screen, take a screenshot, etc.
- the content provider is used to store and retrieve data and make these data accessible to applications.
- the data may include videos, images, audios, phone calls made and received, browsing history and bookmarks, phone book, etc.
- the view system includes visual controls, such as controls that display text, controls that display pictures, and so on.
- the view system can be used to build applications.
- the display interface can be composed of one or more views.
- a display interface that includes a short message notification icon may include a view that displays text and a view that displays pictures.
- the phone manager is used to provide the communication function of the terminal 100. For example, the management of the call status (including connecting, hanging up, etc.).
- the resource manager provides various resources for the application, such as localized strings, icons, pictures, layout files, video files, and so on.
- the notification manager enables the application to display notification information in the status bar, which can be used to convey notification-type messages, and it can automatically disappear after a short stay without user interaction.
- the notification manager is used to notify download completion, message reminders, and so on.
- the notification manager can also be a notification that appears in the status bar at the top of the system in the form of a chart or a scroll bar text, such as a notification of an application running in the background, or a notification that appears on the screen in the form of a dialog window. For example, text messages are prompted in the status bar, a prompt sound is emitted, the terminal vibrates, and the indicator light flashes.
- Android Runtime includes core libraries and virtual machines. Android runtime is responsible for the scheduling and management of the Android system.
- the core library consists of two parts: one part is the function functions that the java language needs to call, and the other part is the core library of Android.
- the application layer and application framework layer run in a virtual machine.
- the virtual machine executes the java files of the application layer and the application framework layer as binary files.
- the virtual machine is used to perform functions such as object life cycle management, stack management, thread management, security and exception management, and garbage collection.
- the system library can include multiple functional modules. For example: surface manager (surface manager), media library (Media Libraries), three-dimensional graphics processing library (for example: OpenGL ES), 2D graphics engine (for example: SGL), etc.
- the surface manager is used to manage the display subsystem and provides a combination of 2D and 3D layers for multiple applications.
- the media library supports playback and recording of a variety of commonly used audio and video formats, as well as still image files.
- the media library can support multiple audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.
- the 3D graphics processing library is used to implement 3D graphics drawing, image rendering, synthesis, and layer processing.
- the 2D graphics engine is a drawing engine for 2D drawing.
- the kernel layer is the layer between hardware and software.
- the kernel layer contains at least display driver, camera driver, audio driver, and sensor driver.
- the touch sensor 180K receives the touch operation and reports it to the processor 110, so that the processor 110 starts the camera application in response to the aforementioned touch operation, and displays the user interface of the camera application on the display screen 194.
- the touch sensor 180K receives a touch operation on the camera application icon, it reports the touch operation on the camera application to the processor 110, so that the processor 110 starts the camera application in response to the above touch operation, and displays it on the display screen 194
- the user interface of the camera may also start the camera application in other ways, and display the user interface of the camera application on the display screen 194.
- the terminal 100 when the terminal 100 displays a black screen, displays a lock screen interface, or displays a certain user interface after unlocking, it can start the camera application in response to a user's voice instruction or shortcut operation, and display the user interface of the camera application on the display screen 194.
- the environmental factors of the current scene may cause the color, light and shadow effects of the captured image to be poor.
- the color light and shadow effect of the captured image is poor compared to the color light and shadow effect of the image captured in the bright light scene.
- the optimization of the color, light and shadow of the image to improve the user experience has been a hot spot for research and commercial use.
- an embodiment of the present application provides an image processing method, which is applied to a terminal.
- the terminal includes a first camera and a second camera.
- the magnification of the first camera is greater than that of the second camera.
- the method includes: when the ISO of the first camera in the first scene is greater than the first threshold, collecting a first image for the first scene by the first camera, and collecting a second image for the first scene by the second camera; and a second image
- the degree of color shading of is higher than the degree of color shading of the first image; the first image is optimized according to the second image to obtain the third image; the degree of color shading of the third image is higher than the degree of color shading of the first image.
- the terminal optimizes the image with a low level of color light and shadow based on the image of the same scene with a high degree of color light and shadow, and takes into account the collection of objective environment information.
- a single frame image is used to optimize the color light and shadow. The technical solution helps to enable the optimized image to more objectively represent the real scene and improve the robustness.
- image style can also be understood as “color, light and shadow of the image”.
- the image style (or the color and shadow of the image) may include at least one of the color, contrast, and dynamic range of the image.
- the image style of the second image is better than the image style of the first image, which is equivalent to that the color brightness of the second image is higher than the color brightness of the first image.
- FIG. 3 it is a flowchart of an image processing method provided by an embodiment of this application.
- the method shown in Figure 3 includes the following steps:
- the terminal determines the first camera and the second camera before collecting images for the first scene in the current shooting environment.
- the first camera is used to shoot the image to be optimized (such as the first image in this application)
- the second camera is used to shoot the reference image (that is, the image used in the process of optimizing the image to be optimized, such as the first image in this application). Two images).
- the ISO of the first camera in the current shooting environment of the first camera is greater than the first threshold.
- the first threshold value is greater than or equal to the value of the ISO of the first camera when characterizing the critical state of the bright area and the dark area.
- the value of the first threshold is related to the specifications of the first camera, the critical state defining the bright area and the dark area, and so on.
- the parameters used to characterize the specifications of the camera may include: focal length, magnification, and photosensitive performance.
- the first threshold may be about 200.
- the first scene is a dark scene, such as a night scene, or a dark area scene during the day.
- the first scene is a high dynamic range scene or an ultra-high dynamic range scene. Specifically, if the ratio of the maximum value and the minimum value of the brightness of the preview image when the first camera shoots the first scene is greater than a threshold, it indicates that the first scene is a high dynamic range scene or an ultra-high dynamic range scene.
- the first scene is a high-contrast scene. Specifically, if the difference between the maximum value and the minimum value of the contrast of the preview image when the first camera shoots the first scene is greater than a threshold, it indicates that the first scene is a high-contrast scene.
- the first scenario is an abnormal scenario.
- the abnormal scene here means that the image obtained by shooting the first scene cannot truly reflect the scene due to environmental factors. For example, the texture information of the object in the image obtained by shooting the scene is distorted, or the color cast (that is, the color is changed).
- the embodiment of the present application can optimize the color, light and shadow information of the image. Therefore, the embodiment of the present application is particularly suitable for scenes with poor shooting effects, such as the aforementioned night scenes or abnormal scenes.
- the magnification of the first camera is greater than the magnification of the second camera.
- the magnification range of the second camera includes [0.5, 1)
- the magnification range of the first camera includes [1, 20].
- the second camera is a wide-angle camera
- the first camera is a 1X camera (that is, a camera with a magnification of 1), a 3X camera (that is, a camera with a magnification of 3), or a 10X camera (that is, a camera with a magnification of 10).
- the magnification of the second camera is 1, and the magnification of the first camera belongs to the interval (1, 20).
- the second camera is a 1X camera
- the first camera is a 3X camera or a 10X camera.
- the magnification of the second camera belongs to the interval (1, 10), and the magnification of the second camera belongs to the interval [10, 20].
- the second camera is a 3X camera
- the first camera is a 10X camera.
- the magnification of the first camera is equal to the magnification of the second camera.
- the magnifications of the first camera and the second camera are both less than 1, or both are equal to 1, or both are greater than 1.
- the first and second cameras are both wide-angle cameras, or both are 1X cameras, or both are 3X cameras , Or both are 10X cameras.
- the second camera is used to capture black and white images
- the first camera is used to capture color images.
- the second camera is a 1X camera
- the second camera is a wide-angle camera or a 1X camera. Of course it is not limited to this.
- both the second camera and the first camera can be used to capture color images.
- both the first image and the second image are color images as examples, and the description is unified here, and the details are not repeated below.
- the terminal includes multiple cameras, and the terminal may determine the first camera and the second camera based on the following steps:
- the camera with the magnification 1 in the terminal is selected as the first camera.
- a camera with a magnification of 1 or less than 1 in the terminal can be selected as the second camera.
- a camera with a magnification of 3 in the terminal is selected as the first camera.
- a camera with a magnification of 3, 1, or less than 1 in the terminal can be selected as the second camera.
- the camera with a magnification of 10 in the terminal is selected as the first camera.
- a camera with a magnification of 3, 1, or less than 1 in the terminal can be selected as the second camera.
- a camera with a magnification of 10 in the terminal is selected as the first camera.
- a camera with a magnification of 10, 3, 1, or less than 1 in the terminal can be selected as the second camera.
- the shooting magnification of the terminal for the first scene is [1,A); select the camera with the magnification of 1 or the main camera in the terminal as the first camera;
- the shooting magnification of the terminal for the first scene is [A, B)
- the camera with the magnification A or the main camera in the terminal is selected as the first camera
- the camera with the magnification C or the main camera in the terminal is selected as the first camera
- the camera with the magnification C or the main camera in the terminal is selected as the first camera
- a camera with a magnification less than or equal to that of the first camera in the terminal can be selected as the second camera.
- the terminal collects a first image for the first scene through a first camera, and collects a second image for the first scene through the second camera.
- the degree of color light and shadow of the second image is higher than the degree of color light and shadow of the first image.
- the embodiment of the present application does not limit the shooting time interval of the first image and the second image.
- the shooting time interval between the first image and the second image is less than a threshold. Since the longer the shooting time interval, the higher the probability of shaking, drastic changes in the environment, etc., which will cause the content of the first image and the second image to differ greatly. Therefore, in theory, the first image and the second image The shorter the shooting interval, the better.
- the shooting time interval between the two may be on the order of milliseconds or on the order of tens of milliseconds.
- the degree of color shading of the image can be characterized based on at least one of the color, contrast, and dynamic range of the image.
- a preset condition is satisfied between the second image and the first image, it indicates that the color light and shadow degree of the second image is higher than the color light and shadow degree of the first image.
- the preset condition includes at least one of the following:
- Condition 1 The color of the second image is better than the color of the first image.
- the color of the pixel representing an object in the second image is better than the color of the pixel representing the object in the first image, and the number of pixels having the characteristic in the second image is greater than the threshold.
- the overall color of the second image is better than the overall color of the first image.
- the signal-to-noise ratio of the color of the second image is higher than the signal-to-noise ratio of the color of the first image, it means that the color of the second image is better than the color of the first image.
- the chromaticity of the second image is greater than the chromaticity of the first image, and/or the brightness of the second image is greater than the brightness of the first image, it means that the color of the second image is better than the color of the first image.
- Condition 2 The contrast of the second image is higher than the contrast of the first image.
- Condition 3 The dynamic range of the second image is greater than the dynamic range of the first image.
- the embodiments of the present application provide the following implementation manners, which are helpful to realize that the color light and shadow degree of the second image is higher than the color light and shadow degree of the first image:
- Method 1 The photosensitive performance of the second camera is higher than the photosensitive performance of the first camera.
- the photosensitive performance of the camera is an inherent characteristic of the camera, which is used to indicate the imaging capability of the camera. Generally, the larger the area of the sensor in the camera, the stronger the light-sensing performance of the camera. Under the same other conditions, the stronger the light-sensing performance of the camera, the higher the degree of color and shadow of the captured image.
- Method 2 The aperture of the second camera is larger than the aperture of the first camera.
- Manner 3 The exposure time when the second camera collects the second image is greater than the exposure time when the first camera collects the first image.
- a second camera capture hundred milliseconds long exposure time of the second image, such as the T a may be approximately 500 milliseconds, the exposure time of acquiring a second image of the first camera long several to several tens of milliseconds.
- the best ISO value of the camera under different illuminance is different.
- the best ISO value under a certain illuminance refers to the ISO value when the color shading degree of the image is the highest (or the color shading degree reaches a certain threshold) under the illuminance.
- the optimal ISO value under any illuminance can be obtained based on experiments, which is not limited in the embodiments of the present application. Under the same illuminance, when the ISO value is less than or equal to the optimal ISO value, the larger the ISO value, the higher the color shading of the captured image; when the ISO value is greater than the optimal ISO value, the higher the ISO value Larger, the lower the degree of color light and shadow of the captured image.
- the above method 1 and method 2 can be understood as the realization that the color light and shadow degree of the second image is higher than the color light and shadow degree of the first image based on the hardware properties of the camera.
- the above manner 3 and manner 4 can be understood as adjusting the parameters of the camera based on software, so as to realize that the color light and shadow degree of the second image is higher than the color light and shadow degree of the first image.
- the above method 3 and method 4 may be applicable to the case where the photosensitive performance of the second camera is the same as the photosensitive performance of the first camera, or there is not much difference.
- the aperture and exposure time of the camera affect the amount of light entering the camera, and the sensor photosensitive area and iso of the camera determine the ability of the camera to receive light.
- the larger the aperture the longer the exposure time, the larger the photosensitive area, and the higher the iso, the greater the amount of light that the camera can actually receive.
- the larger the amount of received light the better.
- there is an exposure threshold If the amount of received light is less than the exposure threshold, the greater the amount of received light, the better the color, light and shadow effects of the captured image. If the amount of received light is greater than or equal to the exposure threshold, the greater the amount of received light, the color and light effects of the captured image may deteriorate due to overexposure.
- the above method 3 and method 4 may be applicable to scenes where the received light amount is less than the exposure threshold.
- S102 can be implemented in the following way A or way B:
- S102 may include the following steps S21 to S25:
- S21 The terminal determines the illuminance of the first scene.
- S22 The terminal obtains the first exposure duration and the first ISO of the first camera based on the determined illuminance of the first scene.
- this step reference may be made to the prior art, which will not be repeated here.
- S23 The terminal uses the first exposure duration and the first ISO to shoot the first scene to obtain the first image.
- the terminal determines the second exposure time and the second ISO for shooting the second camera based on at least one of the first exposure time length and the first ISO.
- the terminal can pre-store the following association: the corresponding relationship between the exposure of the first camera (or "exposure duration and/or ISO”) and the exposure of the second camera (or "exposure duration and/or ISO”); then, The second exposure time and the second ISO are determined based on the first exposure duration and the first ISO of the first camera determined in step 2, and the aforementioned pre-stored correspondence relationship.
- the embodiment of the present application does not limit the specific embodiment of the foregoing corresponding relationship, for example, it may be a functional relationship, a table, and the like.
- T a represents the second exposure duration
- T m represents the first exposure duration
- ISO m represents the first ISO.
- ISO a is obtained based on the value of at least one parameter among T m , ISO m and T a .
- ISO a represents the second ISO.
- S25 The terminal uses the second exposure duration and the second ISO to shoot the first scene to obtain the second image.
- S102 may include the following steps S31 to S36:
- the terminal determines the ISO of the camera corresponding to the illuminance interval where the illuminance of the first scene is located based on the correspondence between the illuminance intervals of the multiple scenes and the ISO of the camera, and uses the determined ISO as the ISO of the second camera.
- the corresponding relationship may be predefined.
- the ISO of the camera in the corresponding relationship can be specifically made to be the best ISO value of the camera.
- the best ISO value please refer to the above, which will not be repeated here.
- the terminal determines the second exposure time of the second camera based on at least one of the first exposure time and the first ISO.
- the specific implementation can refer to the above.
- the "best ISO value" can be considered as a factor that affects the value of f, so that the value obtained by executing S24 The second ISO value is closer to the optimal ISO value.
- first image and the second image are taken by different cameras.
- first image and the second image can also be obtained in any of the following ways:
- the first image and the second image may be captured by the same camera in different working states.
- the camera may capture the second image when the flash is turned on, and the first image when the flash is turned off; or, the camera may capture the first image and the second image by adjusting the exposure time and ISO of the camera.
- the second image may be an image with the highest degree of color light and shadow selected among images captured by multiple cameras, or an image with a color light and shadow degree higher than a certain threshold.
- any one of the first image and the second image may be a fusion of multiple frames of images, instead of being directly captured by a camera.
- the multi-frame cameras may be captured by the same camera, or may be captured by different cameras, or may be partly captured by the same camera, and the other part may be captured by different cameras, etc. This embodiment of the application does not limit this .
- Example 1 The above method further includes: collecting N frames of images for the first scene through the first camera, where N is an integer greater than or equal to 1, and performing multi-frame noise reduction according to the N frames of images and the first image to obtain a fourth image.
- optimizing the first image based on the second image to obtain the third image may include: optimizing the fourth image based on the second image to obtain the third image.
- the terminal optimizes the image based on the fusion of multiple images captured by the same camera to obtain the third image.
- Example 2 The above method also includes: acquiring N1 frames of images and N2 frames of images for the first scene through the first camera and the second camera respectively; wherein, N1 and N2 are integers greater than or equal to 1; according to N1 frames of images and N2 frames
- the image and the first image are subjected to multi-frame noise reduction to obtain the fifth image.
- optimizing the first image based on the second image to obtain the third image may include: optimizing the fifth image based on the second image to obtain the third image.
- the terminal optimizes the image based on the fusion of multiple images captured by different cameras to obtain the third image.
- the above example 1 and example 2 can be applied to the case where the shooting magnification of the terminal for the first scene is [1,3), [3,7) or greater than 10, how to choose the first camera in these cases
- the specific implementation of the second camera and the second camera can be referred to above, which will not be repeated here.
- Example 3 The foregoing terminal further includes a third camera, and the magnification of the third camera is not greater than the magnification of the first camera.
- the above method further includes: collecting N3 frames of images and N4 frames of images for the first scene through the first camera and the third camera respectively; wherein, N3 and N4 are integers greater than or equal to 1;
- One image is subjected to multiple frames of noise reduction to obtain a sixth image.
- optimizing the first image based on the second image to obtain the third image may include: optimizing the sixth image based on the second image to obtain the third image.
- the third camera is a camera different from the first camera and the second camera in the terminal. In other words, the terminal may optimize the image based on the fusion of multiple images captured by at least three cameras to obtain the third image.
- the above example 1 and example 2 can be applied to the case where the shooting magnification of the terminal for the first scene is [7,10).
- how to select the first camera and the second camera for specific implementations can be referred to Above, I won't repeat it here.
- S103 The terminal judges whether the second image is available.
- the second image obtained by shooting will have no reference The value (or the reference value is low), that is, the second image is not available. Therefore, in the embodiment of the present application, before performing the optimization of the chromaticity of the first image, it is possible to determine whether the second image is available.
- S103 may include the following steps S103A to S103B:
- S103A The terminal preprocesses the second image so that the viewing ranges of the first image and the processed second image are the same or similar (that is, the difference between the viewing ranges is within a preset range), and the first image and the processed second image have the same or similar viewing ranges.
- the size (including width and height) of the second image is the same or similar (that is, the size difference is within a preset range).
- Step 1 When a preset condition is satisfied between the shooting condition of the first image and the shooting condition of the second image, the terminal performs processing such as zooming and cropping on the second image, so that the viewing range of the processed second image is the same as that of the first image.
- the viewing ranges of the images are similar (that is, the difference in viewing ranges is within the preset range).
- the preset conditions may include the following condition 1 or condition 2:
- Condition 1 The first image was taken under zoom conditions; and, the second image was taken under non-zoom conditions, or the second image was taken under zoom conditions, but the zoom used when capturing the second image The magnification is different from the zoom magnification used when capturing the first image.
- Condition 2 The first image was taken under non-zoom conditions; and, the second image was taken under zoom conditions.
- step 1 is optional. If the first image and the second image are both taken under non-zoom conditions, or if the first image and the second image are both taken under zoom conditions, but the first and second images are captured The zoom magnification is the same; then, the viewing ranges of the first image and the second image are usually similar (including the same or similar). In this case, processing such as zooming and cropping may not be performed on the second image, but the following step 2 may be performed directly.
- Step 2 The terminal can adjust the size of the first image and the second image with similar viewing ranges to be the same (or similar), and the specific implementation manner can refer to the prior art.
- step S103A is optional. If the shooting range of the first image and the second image are similar and the sizes are the same or similar, the terminal may not execute S103A.
- S103B The terminal determines whether the first image and the processed second image can be effectively registered when the brightness histograms are corrected to be equivalent (that is, the difference between the brightness histograms is within a preset range). If it can be effectively registered, it means that the second image is available; otherwise, it means that the second image is not available.
- the embodiment of the present application does not limit the measurement method of effective registration.
- the measurement method may include: using classic sift or surf methods to find the feature pair between the first image and the processed second image. If the number of feature pairing points of the two is less than or equal to the preset value, it is considered that the two cannot be effectively registered; otherwise, it is considered that the two can be effectively registered.
- the specific implementation method can refer to the prior art, which will not be repeated here.
- S103B specifically means that the terminal determines that the first image and the second image are corrected to be equivalent in the brightness histogram. , Whether it can be effectively registered.
- the first image, the second image, and the third image meet at least one of the following conditions: if the color of the second image is better than the color of the first image, the color of the third image is better than the color of the first image; if the second image If the contrast of the third image is higher than the contrast of the first image, the contrast of the third image is higher than the contrast of the first image; if the dynamic range of the second image is greater than the dynamic range of the first image, the dynamic range of the third image is greater than that of the first image Dynamic range.
- the image content of the third image is the same as the image content of the first image. It is equivalent to: the texture information of the third image is the same as the texture information of the first image.
- the "same” here can mean the same within a certain error range.
- the first image if some areas (marked as the first type of area) exist in the first image due to abnormal situations such as jitter and blur, but not in the second image, that is, the first image cannot be found in the second image.
- the second image is available, which specifically means that the area corresponding to the second type of area in the second image is available.
- the terminal can use the ghost detection method to circle the area in the first image where the corresponding area cannot be found in the second image (that is, the first type of area).
- the embodiment of the present application does not limit the ghost detection method.
- the terminal may perform S104 to obtain the third image, and perform no processing on the area in the third image corresponding to the area of the first type (that is, the area that represents the same object as the area of the first type), and compare the area with other areas. Gradual fusion is performed on the boundary to remove the obvious dividing line between this area and other areas and improve the image quality.
- the method may further include: the terminal registers the first image and the second image (specifically, the second image obtained after the above-mentioned preprocessing), Registration methods can include but are not limited to classic sift, surf, etc. Of course, AI networks can also be used for registration. After the registration step, S104 is executed again, which helps to make the optimization result more accurate.
- the terminal may display the third image obtained in S104.
- the terminal acquires the first target sub-image in the first image; where the first target sub-image is an area in the first image that is not expected to be changed in color and light and shadow information. Specifically, it can be a highlight area or even an overburdened area in the first image, or an area containing a specific color, or a delineated area based on semantic content, or it can be obtained based on a network such as an attention network.
- the terminal acquires the second target sub-image in the third image; wherein, the second target sub-image and the first target sub-image describe the same object. Then, the terminal uses the first target sub-image to update (or replace) the second target sub-image in the third image to obtain the fourth image.
- the terminal splices images other than the second target sub-image in the first target sub-image and the third image to obtain the fourth image.
- the final result represents the fourth image
- the straight-out result represents the third image
- mask represents the position of the first target sub-image in the first image, or the position of the second target sub-image in the third image
- the first image* represents the first target sub-image
- the straight-out result *mask represents the second target sub-image.
- the terminal can display the fourth image.
- the color light and shadow degree of the fourth image is higher than the color light and shadow information of the first image; the image content of the fourth image is the same (or similar) to the image content of the first image.
- the mask can also be an area surrounding the second image, which is often more efficient, that is, areas with poor effects on the second image are not expected to be used on the first image, such as highlight and overexposed areas.
- the circled mask is subjected to gaussian blur or up-sampling to blur to construct a gradual transition zone, so that when applied to the first image, there is no need to care about the misregistration between the first image and the second image, and the expected effect is guaranteed.
- the mask can also be solved by a network, such as an attention network.
- the input to the network may be the first image, or the second image, or a combination of the first image and the second image.
- the terminal uses the second image to optimize the first image to obtain the third image, which may include:
- Manner 1 Use the CCM matrix to represent the mapping relationship between the color light and shadow information of the first image and the second image, thereby optimizing the first image based on the CCM matrix to obtain the third image.
- mode 1 may include the following steps S41 to S45:
- the terminal performs feature extraction on the first image and the second image respectively to obtain the first tensor and the second tensor; where the first tensor is used to characterize the texture information and color, light and shadow information of the first image, and the second tensor The quantity is used to characterize the texture information and color light and shadow information of the second image.
- the size of the first tensor and the second tensor are the same.
- the terminal uses AI technology such as neural network to perform feature extraction on the first image and the second image respectively to obtain the first Zhangliang and the second tensor.
- AI technology such as neural network to perform feature extraction on the first image and the second image respectively to obtain the first Zhangliang and the second tensor.
- the method for the terminal to use the neural network to perform feature extraction on the image can refer to the prior art, which will not be repeated here.
- the terminal may also use traditional technology instead of AI technology to perform feature extraction on the first image and the second image, which is not limited in the embodiment of the present application.
- the second image in S104A may specifically be a preprocessed second image.
- the terminal before using the third neural network to extract the features of the first image and the second image, the terminal can perform the following steps: First, combine the first image and the second image Resize to the same size, for example, by scaling the second image, so that the size of the first image and the scaled second image are the same. If after S102 is executed, the size of the first image and the second image are the same, this step may not be executed. Then, the adjusted first image and second image are input to the third neural network.
- the sizes of the adjusted first image and the second image are marked as H*W*3, where H and W represent the width and height of the adjusted first image and the second image, respectively, and 3 represents RGB three channels.
- the values of H and W may be predefined in the third neural network.
- the third neural network can finally divide the first image and the second image into h*w image blocks.
- h and w respectively represent the number of image blocks divided in the width and height directions of the first image (or the second image).
- the values of h and w may be predefined in the third neural network.
- c f is the number of features. For example, if 10 texture features and 10 color features are extracted, c f is 20.
- the values of h f , w f and c f may be predefined in the third neural network.
- the terminal may use the same third neural network or different third neural networks to extract the features of the first image and extract the features of the second image.
- S42 The terminal performs a superposition operation (concat) on the first tensor and the second tensor based on the feature dimensions of the first tensor and the second tensor to obtain the target tensor. Or, perform a subtraction operation on the first tensor and the second tensor to obtain the target tensor.
- the first tensor and the second tensor are The size of the target tensor obtained after the superposition operation is h f *w f *2c f .
- the tensor obtained by subtracting two tensors is a tensor formed by subtracting elements at the same position in the two tensors. Taking the dimensions of the first tensor and the second tensor as h f *w f *c f as an example, the size of the target tensor obtained by subtracting the first tensor and the second tensor is h f *w f *c f . "AB" is equivalent to "A+(-B)", therefore, subtracting the first tensor and the second tensor is equivalent to adding the opposite of the second tensor to the first tensor Operation.
- the terminal uses the first neural network to obtain the CCM matrix of at least two sub-images.
- the first neural network is used to analyze the color shading information and texture information of the first image, and the color shading information and texture information of the second image, to obtain the CCM matrix of at least two sub-images, as divided by the first image The CCM matrix of each sub-image.
- the input information of the first neural network includes a target tensor.
- the output information of the first neural network includes the CCM matrix of each sub-image in the first image.
- the at least two sub-images include a first sub-image, and the CCM matrix of the first sub-image is used to characterize the mapping relationship between the color of the first sub-image and the color of the second sub-image in the second image.
- the first sub-image and the second sub-image are images of the same object.
- the first sub-image may be any one of the at least two sub-images included in the first image.
- "Object" refers to the same part/part of the same object.
- the object can be a person's eyes, nose, mouth, etc., for example, the object can be a person's left index finger, or a right pinky.
- the sub-image satisfies one of the following conditions:
- Condition 1 The sub-image is an image block in the first image, and different image blocks have the same size.
- One frame of image may include at least two image blocks.
- the image block is rectangular, for example, it may be square. Based on Condition 1, a sub-image can be considered as an image block in a frame of image.
- the sub-image is determined based on the similarity of the pixels in the first image, and the similarity of the pixels in the same sub-image is greater than or equal to the third threshold.
- different similarities in different sub-images are less than a third threshold.
- the size of the third threshold may be the same or different.
- each sub-image obtained by dividing the image based on the similarity is referred to as a pixel group.
- One frame of image may include one or more pixel groups. Based on Condition 2, a sub-image can be considered as a pixel group in a frame of image.
- the sub-image is determined based on the similarity of the pixels in the image block in the first image, different image blocks have the same size, and the similarity of the pixels in the same sub-image of the same image block is greater than the third threshold.
- a sub-image can be considered as a pixel group in an image block of a frame of image.
- this condition 3 divides a frame of image from a finer granularity. In this way, it is helpful to obtain more CCM matrices when performing S43, so that the interpolation result obtained when performing S44 is more accurate.
- the size of the output result of the first neural network may be h*w*(n g *n m ).
- the process of processing the first image and the second image by the first neural network can be equivalent to dividing the first image frame into h*w pixel blocks on average, and the pixels in each pixel block are divided into n g pixel groups according to the similarity. ;
- the first neural network network outputs n m CCM matrix elements.
- n m can take a value less than 9, such as 6. This is equivalent to processing the 3 elements of the y channel without consideration.
- the CCM matrix output at this time works in the YUV domain.
- the foregoing S43 may be considered as an implementation manner for obtaining the CCM matrix of at least two sub-images, and the specific implementation is not limited to this.
- a traditional method instead of AI technology can be used to obtain a CCM matrix of at least two sub-images.
- the terminal obtains the CCM matrix of the pixel in the first image based on the CCM matrix of the at least two sub-images. For example, the terminal performs an interpolation operation based on the CCM matrices of the at least two sub-images to obtain the CCM matrix of each pixel in the first image.
- the first image includes a first pixel, and the first pixel may be any pixel in the first image.
- the CCM matrix of the first pixel is used to characterize the mapping relationship between the color of the first pixel and the color of the second pixel in the second image.
- the first pixel and the second pixel correspond to the same image content.
- FIG. 7 it is a schematic diagram of dividing the first image equally by using a grid.
- circle a square area. The area of this area can be equal to the size of each square area equally divided by the first image. All grid points in this square area are used to interpolate to obtain the pixel's CCM matrix.
- the simplest way is to use the y channel value of the pixel.
- the y channel value range [0,255] is equally divided into n g groups, and there is an integer part of (n g -1)*s/255 That is n ms .
- Yuv can be considered comprehensively, correlation can be calculated, and the network can even be specially trained to calculate it.
- the similarity measurement methods of pixels for each interpolation grid point can be different, as long as the continuity of the interpolation can be guaranteed. In order to ensure continuity, for a single grid point, all pixels of the first image in a square area with a side length of 2D centered on the grid point are measured by the same similarity method relative to the grid point .
- the output of the network is a local CCM matrix.
- the network can synchronously output a global CCM matrix, and then for each pixel, the local CCM matrix and the global CCM matrix are combined to obtain the final CCM matrix.
- the synthesis method can be proportional linear addition.
- the terminal can use relevant hardware parameters during shooting to perform re-examination and correction. Further optimize the CCM matrix, or terminate the solution in case the calculated CCM matrix is excessive (for example, the first image or the second image is abnormal, or the calculation is wrong).
- additional sensors can be used to simultaneously record environmental information as a verification (it can be used to infer whether the first image or the second image taken is normal).
- the terminal optimizes the first image based on the CCM matrix of the pixels (for example, each pixel) in the first image to obtain the third image. Specifically, for any pixel (marked as a target pixel) in the first image, the terminal multiplies the pixel value of the target pixel by the CCM matrix of the target pixel to obtain the pixel value of a pixel in the third image.
- the third pixel and the target pixel in the first pixel correspond to the same image content.
- the CCM matrix method is used to optimize the first image, which helps to ensure that the processed texture information and definition of the first image remain unchanged (or basically unchanged).
- the CCM matrix of each sub-image is first obtained through the neural network, and then the CCM matrix of each pixel is obtained through the traditional method of interpolation. In this way, compared with the technical solution of "obtaining the CCM matrix of each pixel directly based on the neural network" in the prior art, it helps to reduce the calculation complexity, thereby shortening the calculation time, and effectively controlling the performance overhead.
- FIG. 8A it is a schematic diagram of the process of optimizing the first image based on the CCM matrix.
- FIG. 8A it is a schematic diagram of the process of optimizing the first image based on the CCM matrix.
- FIG. 8B it is a schematic diagram of the comparison of the first image, the second image, and the third image when the first image is optimized based on the CCM matrix. It can be seen from FIG. 8B that this technical solution can "migrate" (not limited to this) the color light and shadow information in the second image to the corresponding position of the first image pair. Moreover, comparing the third image with the first image, it can be seen that the texture information and definition of the third image and the first image are basically the same, that is, the original texture information and definition of the first image are basically unchanged before and after optimization.
- the vividness and saturation of the green plants in the third image are better than those of the first image, and the brightness of the ground and stone fences in the third image is also better than that of the first image.
- the original color light and shadow level of the first image before and after optimization is improved.
- the above description is based on “first acquiring the CCM matrix of the multiple sub-images included in the first image, and then performing interpolation based on the CCM matrix of the multiple sub-images to obtain the CCM of each pixel in the first image”.
- the first image may not be divided into sub-images, that is, the CCM matrix of the first image is obtained with the image as the granularity, and the CCM matrix of the first image is used as the CCM matrix of each pixel in the first image. In this way, it helps to reduce computational complexity and reduce computational performance overhead.
- Method 2 Use the neural network to directly output the third image, that is, directly output the pixels of each image in the third image. As shown in FIG. 9, it may specifically include the following steps S51 to S53:
- the terminal optimizes the first image using the second neural network and the second image to obtain a third image.
- the second neural network is used to optimize the image style of an image with a poor image style by using an image with a better image style.
- the input information of the second neural network includes a target tensor, and the target tensor is used to represent texture information and color light and shadow information of the first image, and texture information and color light and shadow information of the second image.
- the output information of the second neural network includes the third image.
- the second neural network may be a Unet-type AI network.
- FIG. 10 a schematic diagram of the structure and logic of a second neural network provided in this embodiment of the application.
- the second neural network can apply coding and decoding ideas.
- the left side of the network is regarded as the coding layer for the first image, and the right side is the decoding layer for the first image.
- the coding layer part includes a texture information layer and a color light and shadow information layer.
- the texture information layer is used to code the texture information of the first image
- the color light and shadow information layer is used to code the color light and shadow information of the first image.
- the requirements for the coding layer include: when the network input is the texture information and color light and shadow information of the same first image in two frames and the tensor is obtained after concat, the color light and shadow information layer faithfully records the original color light and shadow information of the first image, so that the network output will be Strictly equal to the first image itself.
- the network input is the texture information and color light and shadow information of the first image
- the texture information and color light and shadow information of the second image are concated to obtain the tensor
- the network will learn the color light and shadow information of the second image and guide the first image.
- the color and shadow information layer of an image changes, but the texture information layer is not affected (or affected in a smaller range), and the final network output is the expected result of the color and shadow information optimization of the first image (that is, the above Third image).
- the second neural network performs convolution operations on the first sub-tensor and the second sub-tensor in the target tensor respectively, where the first sub-tensor includes texture information in the target tensor, and the second The sub-tensor includes the colors in the target tensor.
- multiple convolution operations can be performed.
- the tensor obtained by performing the convolution operation based on the first sub-tensor and the tensor obtained by performing the convolution operation based on the second sub-tensor are superimposed to obtain the superimposed tensor.
- the superimposed tensor, the first sub-tensor and the second sub-tensor are superimposed to obtain the third image.
- the actual benefits of designing the network in this way include: while the network processes the color, light and shadow information of the first image, the texture information of the first image is not changed (or the texture information of the first image changes slightly).
- the network structurally decouples texture information and color light and shadow information, so that, on the one hand, it helps to make the network processing more targeted, more accurate, and not easy to introduce artifacts, and to ensure that the color is changed. While the light and shadow information does not affect the texture information and clarity; on the other hand, it helps to reduce the performance overhead of network processing.
- the performance overhead of processing the convolution operation before decoupling is generally higher than that used to process the detail information layer and the color light and shadow information layer with two convolution operations after decoupling. The performance overhead is much larger.
- the image is used as the granularity, and the characteristic information of the image (including texture information and color light and shadow information) is input into the second neural network to perform the optimization step.
- the characteristic information of the image including texture information and color light and shadow information
- the optimization step is performed; then, the optimization results of the corresponding sub-images in the first image and the second image are spliced to obtain a third image.
- transitional fusion may be required, and the specific implementation method can refer to the existing technology.
- S104 can also be implemented using traditional methods, such as solving optimization equations, matching color, light and shadow information between the first image and the second image, and so on.
- FIG. 11 it is a schematic diagram of an image processing method provided by an embodiment of this application.
- the method is applied to a terminal.
- the terminal includes a first camera and a second camera.
- the magnification of the first camera is not less than the magnification of the second camera.
- the method may include the following steps:
- the terminal collects a first image for a first scene in the current shooting environment through the first camera.
- the first image is collected by the first camera for the first scene in the current shooting environment.
- S202 The terminal collects a second image for the first scene through the second camera; wherein the color of the second image is closer to the true color of the first scene than the color of the first image.
- the second image and the first image satisfy at least one of the following conditions: the chromaticity of the second image is closer to the true chromaticity of the first scene than the chromaticity of the first image; the brightness of the second image is higher than that of the first image The brightness of is closer to the real brightness of the first scene.
- S203 The terminal optimizes the first image according to the second image to obtain a third image; the color of the third image is closer to the true color of the first scene than the color of the first image.
- the image content of the third image is the same as the image content of the first image.
- This embodiment is particularly suitable for scenes where the color of the captured image is too different from the color of the real scene, that is, the color cast phenomenon occurs.
- the conditions that the first camera and the second camera meet in this embodiment, how to select the first camera and the second camera, how to use the second image to optimize the first image (or the first image obtained after optimizing the fusion), etc., can all be referred to Above. In principle, if there is no conflict, any optional implementation based on this embodiment can refer to the above.
- the terminal includes hardware structures and/or software modules corresponding to each function.
- the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a certain function is executed by hardware or computer software-driven hardware depends on the specific application scenarios and design constraints of the technical solution.
- FIG. 12 contains a schematic structural diagram of a possible image processing device provided by an embodiment of the present application.
- These image processing apparatuses can be used to implement the functions of the terminal in the foregoing method embodiments, and therefore can also achieve the beneficial effects of the foregoing method embodiments.
- the image processing apparatus may be the terminal 100 as shown in FIG. 1, or may be a module (such as a chip) applied to the terminal.
- the image processing device 131 is a module (such as a chip) in a terminal as an example.
- the terminal 13 includes an image processing device 131, a first camera 132 and a second camera 133.
- the magnification of the first camera 132 is not less than the magnification of the second camera 133.
- the image processing device 131 may include: a control unit 1311 and an optimization unit 1312.
- control unit 1311 is configured to control the first camera 132 to collect the first image for the first scene in the current shooting environment when the ISO of the first camera 132 in the current shooting environment is greater than the first threshold. , And control the second camera 133 to collect a second image for the first scene.
- the optimization unit 1312 is configured to optimize the first image according to the second image to obtain the third image.
- the control unit 1311 may be used to perform S102, and the optimization unit 1312 may be used to perform S104.
- the color of the third image is better than the color of the first image; or, when the contrast of the second image is higher than the contrast of the first image, the third image The contrast of is higher than the contrast of the first image; or, when the dynamic range of the second image is greater than the dynamic range of the first image, the dynamic range of the third image is greater than the dynamic range of the first image.
- the color of the second image is better than the color of the first image, including at least one of the following conditions: the chromaticity of the second image is greater than the chromaticity of the first image; and the brightness of the second image is greater than the brightness of the first image.
- control unit 1311 is configured to control the first camera 132 to capture the first scene in the current shooting environment when the sensitivity ISO of the first camera 132 in the current shooting environment is greater than the first threshold.
- the first image, the third image is obtained; the color of the third image is closer to the true color of the first scene than the color of the first image.
- the control unit 1311 may be used to perform S201 and S202, and the optimization unit 1312 may be used to perform S203.
- the second image and the first image satisfy at least one of the following conditions: the chromaticity of the second image is closer to the true chromaticity of the first scene than the chromaticity of the first image; the brightness of the second image is higher than that of the first image The brightness of is closer to the real brightness of the first scene.
- the image content of the third image is the same as the image content of the first image.
- the light sensitivity performance of the second camera 133 is greater than the light sensitivity performance of the first camera 132.
- the aperture of the second camera 133 is larger than the aperture of the first camera 132.
- the exposure time when the second camera 133 collects the second image is greater than the exposure time when the first camera 132 collects the first image.
- the ISO used when the second camera 133 collects the second image is greater than the ISO used when the first camera 132 collects the first image.
- the magnification range of the second camera 133 includes [0.5, 1), and the magnification range of the first camera 132 includes [1, 20].
- the magnification of the second camera 133 is 1, and the magnification range of the first camera 132 includes (1, 20).
- the image processing device 131 further includes: a noise reduction unit 1313.
- control unit 1311 is further configured to control the first camera 132 to collect N frames of images for the first scene, where N is an integer greater than or equal to 1, and the noise reduction unit 1313 is configured to perform multiple operations based on the N frames of images and the first image.
- the frame noise is reduced to obtain the fourth image;
- the optimization unit 1312 is specifically configured to optimize the fourth image according to the second image to obtain the third image.
- the image content of the fourth image is the same as the image content of the first image.
- control unit 1311 is further configured to control the collection of N1 frames of images and N2 frames of images for the first scene through the first camera 132 and the second camera 133, respectively; wherein, N1 and N2 are integers greater than or equal to 1;
- the noise unit 1313 is configured to perform multi-frame noise reduction according to the N1 frame image, the N2 frame image and the first image to obtain the fifth image;
- the optimization unit 1312 is specifically configured to optimize the fifth image according to the second image to obtain the third image.
- the image content of the fifth image is the same as the image content of the first image.
- the terminal 13 further includes a third camera 134, the magnification of the third camera 134 is smaller than the magnification of the first camera 132; the control unit 1311 is also used to control the first camera 132 and the third camera 134 to capture the first scene respectively N3 frames of images and N4 frames of images; among them, N3 and N4 are integers greater than or equal to 1; the noise reduction unit 1313 is used to perform multi-frame noise reduction based on the N3 frames of images, N4 frames of images and the first image to obtain the sixth image ;
- the optimization unit 1312 is specifically configured to optimize the sixth image according to the second image to obtain the third image. Wherein, the image content of the sixth image is the same as the image content of the first image.
- the image processing device 131 further includes:
- the selection unit 1314 is used for:
- the camera with the magnification 1 in the terminal 13 is selected as the first camera 132.
- a camera with a magnification of 3 in the terminal 13 is selected as the first camera 132.
- a camera with a magnification of 10 in the terminal 13 is selected as the first camera 132.
- the camera with the magnification of 10 in the terminal 13 is selected as the first camera, and the camera with the magnification of 3 in the terminal is selected as the third camera 132.
- the selection unit 1314 is also used for:
- the shooting magnification of the terminal 13 for the first scene is [1, 3)
- a camera with a magnification of 3, 1, or less than 1 in the terminal 13 is selected as the second camera 133;
- a camera with a magnification of 3, 1, or less than 1 in the terminal 13 is selected as the second camera 133;
- a camera with a magnification of 10, 3, 1, or less than 1 in the terminal 13 is selected as the second camera 133.
- the optimization unit 1312 is specifically configured to: obtain a color correction matrix CCM matrix of at least two sub-images in the first image; wherein, the at least two sub-images include the first sub-image, and the CCM matrix of the first sub-image is used to characterize the first sub-image.
- the mapping relationship between the feature of a sub-image and the feature of the second sub-image in the second image; the first sub-image and the second sub-image are images of the same object; the feature includes at least one of color, contrast, or dynamic range Species; Based on the CCM matrix of at least two sub-images, the CCM matrix of the pixels in the first image is obtained; wherein, the first image includes the first pixel, and the CCM matrix of the first pixel is used to characterize the characteristics of the first pixel and the second image.
- the mapping relationship between the features of the second pixel in the second pixel; the first pixel and the second pixel correspond to the same image content; the third image is obtained based on the CCM matrix of the pixels in the first image and the first image.
- the optimization unit 1312 may be used to execute S43-S45.
- the optimization unit 1312 executes the acquisition of the CCM matrix of at least two sub-images in the first image, it is specifically configured to: use the first neural network to acquire the CCM matrix of the at least two sub-images; The feature and texture information of the image and the feature and texture information of the second image are analyzed to obtain CCM matrices of at least two sub-images.
- the optimization unit 1312 is specifically configured to: use the second neural network and the second image to optimize the first image to obtain the third image; the second neural network is configured to use the image with better image style to compare with the image with poor image style. Perform image style optimization.
- the function of any one of the control unit 1311, the optimization unit 1312, the noise reduction unit 1313, and the selection unit 1314 can be implemented by the processor 110 calling the degree code stored in the internal memory 121.
- Another embodiment of the present application also provides a computer-readable storage medium that stores instructions in the computer-readable storage medium.
- the instructions are executed on a terminal, each step executed by the terminal in the method flow shown in the foregoing method embodiment is performed.
- the disclosed methods may be implemented as computer program instructions encoded on a computer-readable storage medium in a machine-readable format or encoded on other non-transitory media or articles.
- the above embodiments it may be implemented in whole or in part by software, hardware, firmware, or any combination thereof.
- a software program it can be implemented in the form of a computer program product in whole or in part.
- the computer program product includes one or more computer instructions.
- the computer execution instructions When the computer execution instructions are loaded and executed on the computer, the processes or functions according to the embodiments of the present application are generated in whole or in part.
- the computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices.
- Computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium.
- computer instructions can be transmitted from a website, computer, server, or data center through a cable (such as Coaxial cable, optical fiber, digital subscriber line (digital subscriber line, DSL) or wireless (such as infrared, wireless, microwave, etc.) transmission to another website site, computer, server or data center.
- the computer-readable storage medium may be any available medium that can be accessed by a computer, or may include one or more data storage devices such as a server or a data center that can be integrated with the medium.
- the usable medium may be a magnetic medium (for example, a floppy disk, a hard disk, and a magnetic tape), an optical medium (for example, a DVD), or a semiconductor medium (for example, a solid state disk (SSD)).
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Signal Processing (AREA)
- Multimedia (AREA)
- General Physics & Mathematics (AREA)
- Biophysics (AREA)
- Computing Systems (AREA)
- Health & Medical Sciences (AREA)
- Life Sciences & Earth Sciences (AREA)
- Biomedical Technology (AREA)
- Molecular Biology (AREA)
- Computational Linguistics (AREA)
- General Engineering & Computer Science (AREA)
- General Health & Medical Sciences (AREA)
- Mathematical Physics (AREA)
- Software Systems (AREA)
- Artificial Intelligence (AREA)
- Evolutionary Computation (AREA)
- Data Mining & Analysis (AREA)
- Neurology (AREA)
- Studio Devices (AREA)
- Telephone Function (AREA)
- Image Processing (AREA)
Abstract
本申请公开了图像处理方法和装置,涉及图像处理技术领域,有助于在对图像的颜色、对比度或动态范围进行优化的同时,使得优化后的图像能够更客观,且提高了鲁棒性。该方法应用于包括第一摄像头和第二摄像头的终端,第一摄像头的倍率不小于第二摄像头的倍率,方法包括:当第一摄像头在当前拍摄环境中的ISO大于第一阈值时:通过第一摄像头针对当前拍摄环境中的第一场景采集第一图像;通过第二摄像头针对第一场景采集第二图像;根据第二图像优化第一图像,得到第三图像。第二图像的图像风格优于第一图像,第三图像的图像风格优于第一图像。图像风格包括颜色、对比度和动态范围中的至少一种。
Description
本申请要求于2020年03月26日提交国家知识产权局、申请号为202010226094.X、申请名称为“图像处理方法和装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
本申请涉及图像处理技术领域,尤其涉及图像处理方法和装置。
在拍照时,对图像颜色的优化一直是研究和商用的热点。目前,通常基于单帧图像进行颜色的优化,即基于所拍摄的图像本身的特征对该图像的颜色进行优化。该方法缺乏对客观环境信息的采集,故很难保证客观和可控鲁棒,即最终效果容易“偏题失真”,从而导致用户体现差。
发明内容
本申请实施例提供了图像处理方法和装置,有助于在对图像的颜色、对比度或动态范围进行优化的同时,使得优化后的图像能够更客观,且提高了鲁棒性。
为达到上述目的,本申请采用如下技术方案:
第一方面,提供了一种图像处理方法,该方法应用于终端,该终端包括第一摄像头和第二摄像头,第一摄像头的倍率不小于第二摄像头的倍率,该方法包括:当第一摄像头在当前拍摄环境中的感光度ISO大于第一阈值时:通过第一摄像头针对当前拍摄环境中的第一场景采集第一图像;通过第二摄像头针对第一场景采集第二图像;根据第二图像优化第一图像,得到第三图像。其中,当第二图像的颜色优于第一图像的颜色时,第三图像的颜色优于第一图像的颜色(条件1);或者,当第二图像的对比度高于第一图像的对比度时,第三图像的对比度高于第一图像的对比度(条件2);或者,当第二图像的动态范围大于第一图像的动态范围时,第三图像的动态范围大于第一图像的动态范围(条件3)。需要说明的是,上述条件1、条件2和条件3中的至少两种可以同时满足。
该技术方案中,终端利用基于同一场景中颜色、对比度或动态范围优于第一图像的第二图像,优化第一图像。由于考虑了客观环境信息的采集,因此,相比现有技术中,使用单帧图像优化颜色的技术方案,有助于使得优化的的图像能够更客观的表示真实场景,并且,提高了鲁棒性。
在一种可能的设计中,第二图像的颜色优于第一图像的颜色,包括以下至少一种条件:第二图像的色度大于第一图像的色度;第二图像的亮度大于第一图像的亮度。
在一种可能的设计中,第三图像的图像内容与第一图像的图像内容相同(或者近似相同),具体可以体现为第三图像的纹理信息与第一图像的纹理信息相同(或者近似相同)。这样,有助于在实现对第一图像的颜色、对比度或动态范围中的至少一种进行优化的同时,保证了纹理信息不变或者变化不大,从而有助于使得图像的纹理更接近于真实场景中的纹理,进而提高了图像的效果,提高了用户体验。
在一种可能的设计中,第二摄像头的感光性能大于第一摄像头的感光性能。这有助于使得第二图像的颜色、对比度或动态范围中的至少一种优于第一图像。
在一种可能的设计中,第二摄像头的光圈大于第一摄像头的光圈。这有助于使得第二图像的颜色、对比度或动态范围中的至少一种优于第一图像。
在一种可能的设计中,第二摄像头采集第二图像时的曝光时长大于第一摄像头采集第一图像时的曝光时长。这有助于使得第二图像的颜色、对比度或动态范围中的至少一种优于第一图像。
在一种可能的设计中,第二摄像头采集第二图像时所使用的ISO大于第一摄像头采集第一图像时所使用的ISO。这有助于使得第二图像的颜色、对比度或动态范围中的至少一种优于第一图像。
在一种可能的设计中,第二摄像头的倍率范围包括[0.5,1),第一摄像头的倍率范围包括[1,20]。例如,第二摄像头是广角摄像头,第一摄像头是1X摄像头、3X摄像头或10X摄像头等。
在一种可能的设计中,第二摄像头的倍率是1,第一摄像头的倍率范围包括(1,20]。例如,第二摄像头是1X摄像头,第一摄像头是3X摄像头或10X摄像头等。
在一种可能的设计中,该方法还包括:通过第一摄像头针对第一场景采集N帧图像,N是大于等于1的整数;根据N帧图像以及第一图像进行多帧降噪(或多帧融合),得到第四图像。其中,第四图像的图像内容与第一图像的图像内容相同。该情况下,根据第二图像优化第一图像,得到第三图像,包括:根据第二图像优化第四图像,得到第三图像。也就是说,终端可以对基于同一摄像头拍摄的多个图像融合后的图像进行优化,得到第三图像。
在一种可能的设计中,该方法还包括:通过第一摄像头和第二摄像头分别针对第一场景采集N1帧图像和N2帧图像;其中,N1和N2均是大于等于1的整数;根据N1帧图像、N2帧图像和第一图像进行多帧降噪(或多帧融合),得到第五图像。其中,第五图像的图像内容与第一图像的图像内容相同。该情况下,根据第二图像优化第一图像,得到第三图像,包括:根据第二图像优化第五图像,得到第三图像。也就是说,终端可以对不同摄像头拍摄的多个图像融合后的图像进行优化,得到第三图像。
在一种可能的设计中,方法还包括:当终端针对第一场景的拍摄倍率在[1,A)时,选择终端中倍率为1的摄像头作为第一摄像头;或者,当终端针对第一场景的拍摄倍率在[A,B)时,选择终端中倍率为A的摄像头作为第一摄像头;或者,当终端针对第一场景的拍摄倍率大于C时,选择终端中倍率为C的摄像头作为第一摄像头。
例如,当终端针对第一场景的拍摄倍率在[1,3)时,选择终端中倍率为1的摄像头作为第一摄像头;或者,当终端针对第一场景的拍摄倍率在[3,7)时,选择终端中倍率为3的摄像头作为第一摄像头;或者,当终端针对第一场景的拍摄倍率大于10时,选择终端中倍率为10的摄像头作为第一摄像头。
在一种可能的设计中,终端还包括第三摄像头,第三摄像头为终端中不同于第一摄像头和第二摄像头的摄像头,第三摄像头的倍率不大于第一摄像头的倍率;该方法还包括:通过第一摄像头和第三摄像头分别针对第一场景采集N3帧图像和N4帧图像;其中,N3和N4均是大于等于1的整数;根据N3帧图像、N4帧图像和第一图像进行多帧降噪(或多帧融合),得到第六图像。其中,第六图像的图像内容与第一图像的图像内容相同。该情况下,根据第二图像优化第一图像,得到第三图像,包括:根据第 二图像优化第六图像,得到第三图像。也就是说,终端可以基于至少三个摄像头拍摄的多个图像融合后的图像进行优化,得到第三图像。
在一种可能的设计中,该方法还包括:当终端针对第一场景的拍摄倍率在[7,10)时,选择终端中倍率为10的摄像头作为第一摄像头,并选择终端中倍率为3的摄像头作为第三摄像头。
在一种可能的设计中,上述方法还包括:当终端针对第一场景的拍摄倍率在[1,A)时,选择终端中倍率为1或者小于1的摄像头作为第二摄像头;或者,当终端针对第一场景的拍摄倍率在[A,B)时,选择终端中倍率小于等于A的摄像头作为第二摄像头;或者,当终端针对第一场景的拍摄倍率大于C时,选择终端中倍率小于等于C摄像头作为第二摄像头。
例如,当终端针对第一场景的拍摄倍率在[1,3)时,选择终端中倍率1或小于1的摄像头作为第二摄像头;
或者,当终端针对第一场景的拍摄倍率在[3,7)时,选择终端中倍率为3、1、或者小于1的摄像头作为第二摄像头;
或者,当终端针对第一场景的拍摄倍率在[7,10)时,选择终端中倍率为3、1、或者小于1的摄像头作为第二摄像头;
或者,当终端针对第一场景的拍摄倍率大于10时,选择终端中倍率为10、3、1、或者小于1的摄像头作为第二摄像头。
在一种可能的设计中,根据第二图像优化第一图像,得到第三图像,包括:获取第一图像中至少两个子图像的颜色校正矩阵CCM矩阵;其中,至少两个子图像包括第一子图像,第一子图像的CCM矩阵用于表征第一子图像的特征与第二图像中的第二子图像的特征之间的映射关系;第一子图像和第二子图像是同一对象的图像;特征包括颜色、对比度或动态范围中的至少一种;基于至少两个子图像的CCM矩阵,得到第一图像中的像素的CCM矩阵;其中,第一图像包括第一像素,第一像素的CCM矩阵用于表征第一像素的特征与第二图像中的第二像素的特征之间的映射关系;第一像素和第二像素对应于同一图像内容;基于第一图像中的像素的CCM矩阵和第一图像,得到第三图像。先确定每个子图像的CCM矩阵,再通过传统的方法插值得到每个像素的CCM矩阵。这样,有助于降低计算复杂度,从而缩短计算时间,并有效控制了性能开销。
其中,第一像素和第二像素对应于同一图像内容,可以理解为:第一图像和第二图像配准之后,第一像素在第一图像中的位置与第二像素在第二图像中的位置相同(或者近似相同)。
在一种可能的设计中,获取第一图像中至少两个子图像的CCM矩阵,包括:使用第一神经网络获取至少两个子图像的CCM矩阵;第一神经网络用于对第一图像的特征和纹理信息,以及第二图像的特征和纹理信息进行分析,得到至少两个子图像的CCM矩阵。
在一种可能的设计中,根据第二图像优化第一图像,得到第三图像,包括:
使用第二神经网络和第二图像优化第一图像,得到第三图像;第二神经网络用于利用图像风格较好的图像对图像风格较差的图像进行图像风格优化。这样有助于使优化结果更好。
第二方面,提供了一种图像处理方法,方法应用于终端,终端包括第一摄像头和第二摄像头,第一摄像头的倍率不小于第二摄像头的倍率,方法包括:当第一摄像头在当前拍摄环境中的感光度ISO大于第一阈值时:通过第一摄像头针对当前拍摄环境中的第一场景采集第一图像;通过第二摄像头针对第一场景采集第二图像;其中,第二图像的颜色比第一图像的颜色更接近第一场景的真实颜色;根据第二图像优化第一图像,得到第三图像;第三图像的颜色比第一图像的颜色更接近第一场景的真实颜色。本实施例尤其适用于所拍摄的图像的颜色与真实场景的颜色相差过大,即出现偏色现象的场景中,在该场景中,有助于实现优化后的图像的颜色相比优化前的图像的颜色更接近于真实场景的颜色。
在一种可能的设计中,第二图像与第一图像满足如下至少一种条件:第二图像的色度比第一图像的色度更接近第一场景的真实色度;第二图像的亮度比第一图像的亮度更接近第一场景的真实亮度。
上述第一方面的任意一种可能的设计中,所提供的部分或者全部特征,在不冲突的情况下,均可以作为第二方面的可能的设计。例如,第三图像的图像内容与第一图像的图像内容相同(或者近似相同)。例如,第二摄像头的感光性能大于第一摄像头的感光性能。例如,第二摄像头的光圈大于第一摄像头的光圈。例如,第二摄像头采集第二图像时的曝光时长大于第一摄像头采集第一图像时的曝光时长。例如,第二摄像头采集第二图像时所使用的ISO大于第一摄像头采集第一图像时所使用的ISO。例如,第二摄像头的倍率范围包括[0.5,1),第一摄像头的倍率范围包括[1,20]。例如,第二摄像头的倍率是1,第一摄像头的倍率范围包括(1,20]。例如,使用第二图像对上述第四图像、第五图像或第六图像进行优化。例如,优化第一图像时,先计算第一图像中子图像的CCM矩阵,再插值得到第一图像中像素的CCM矩阵,然后基于像素的CCM矩阵进行优化第一图像。例如,直接使用神经网络优化第一图像。
第三方面,提供了一种图像处理装置,该装置可以是终端、芯片或芯片系统。
在一种可能的设计中,该装置可以用于执行上述第一方面或第二方面提供的任一种方法。本申请可以根据上述第一方面提供的任一种方法,对该装置进行功能模块的划分。例如,可以对应各个功能划分各个功能模块,也可以将两个或两个以上的功能集成在一个处理模块中。示例性的,本申请可以按照功能将该装置划分为处理单元和发送单元等。上述划分的各个功能模块执行的可能的技术方案和有益效果的描述均可以参考上述第一方面或第二方面或其相应的可能的设计提供的技术方案,此处不再赘述。
在另一种可能的设计中,该装置包括:存储器和一个或多个处理器,所述存储器用于存储计算机指令,所述处理器用于调用所述计算机指令,以执行如第一方面及其任一种可能的设计方式提供的任一种方法,或第二方面及其任一种可能的设计方式提供的任一种方法。
第四方面,提供了一种终端,包括:处理器、存储器和至少两个摄像头,该至少两个摄像头用于拍摄图像,存储器用于存储计算机程序和指令,处理器用于调用该计算机程序和指令,与该至少两个摄像头协同执行上述第一方面或第二方面提供的任一种方法。
第五方面,提供了一种计算机可读存储介质,如计算机非瞬态的可读存储介质。其上储存有计算机程序(或指令),当该计算机程序(或指令)在计算机上运行时,使得该计算机执行上述第一方面或第二方面中任一种可能的实现方式提供的任一种方法。
第六方面,提供了一种计算机程序产品,当其在计算机上运行时,使得第一方面或第二方面中的任一种可能的实现方式提供的任一种方法被执行。
可以理解的是,上述提供的任一种图像处理装置、计算机存储介质、计算机程序产品或芯片系统等均可以应用于上文所提供的对应的方法,因此,其所能达到的有益效果可参考对应的方法中的有益效果,此处不再赘述。
在本申请中,上述图像处理装置或者各功能模块的名字对设备或功能模块本身不构成限定,在实际实现中,这些设备或功能模块可以以其他名称出现。只要各个设备或功能模块的功能和本申请类似,属于本申请权利要求及其等同技术的范围之内。
本申请的这些方面或其他方面在以下的描述中会更加简明易懂。
图1为可适用于本申请实施例的一种终端的硬件结构示意图;
图2为可适用于本申请实施例的一种终端的软件结构框图;
图3为本申请实施例提供的一种图像处理的方法的流程图;
图4为本申请实施例提供的一种采集第一图像和第二图像的方法流程图;
图5为本申请实施例提供的另一种采集第一图像和第二图像的方法流程图;
图6为本申请实施例提供的一种优化第一图像的方法流程图;
图7为本申请实施例提供的一种使用网格平均划分第一图像的示意图;
图8A为本申请实施例提供的一种基于CCM矩阵优化第一图像的过程示意图;
图8B为本申请实施例提供的一种为基于CCM矩阵优化第一图像时,第一图像、第二图像和第三图像的对比示意图;
图9为本申请实施例提供的另一种优化第一图像的方法流程图;
图10为本申请实施例提供的一种神经网络的网络结构和逻辑功能示意图;
图11为本申请实施例提供的另一种图像处理方法的示意图;
图12为本申请实施例提供的一种终端的结构示意图。
在本申请实施例中,“示例性的”或者“例如”等词用于表示作例子、例证或说明。本申请实施例中被描述为“示例性的”或者“例如”的任何实施例或设计方案不应被解释为比其它实施例或设计方案更优选或更具优势。确切而言,使用“示例性的”或者“例如”等词旨在以具体方式呈现相关概念。
在本申请实施例中,术语“第一”、“第二”仅用于描述目的,而不能理解为指示或暗示相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”的特征可以明示或者隐含地包括一个或者更多个该特征。在本申请实施例的描述中,除非另有说明,“多个”的含义是两个或两个以上。
本申请实施例提供的图像处理方法可以应用于终端中,该终端可以是带有摄像头的终端,如智能手机、平板电脑、可穿戴设备、AR/VR设备,也可以是个人计算机 (personal computer,PC)、个人数字助理(personal digital assistant,PDA)、上网本等设备,还可以是其他任一能够实现本申请实施例的终端。本申请对终端的具体形态不予限定。可穿戴设备也可以称为穿戴式智能设备,是应用穿戴式技术对日常穿戴进行智能化设计、开发出可以穿戴的设备的总称,如眼镜、手套、手表、服饰及鞋等。可穿戴设备即直接穿在身上,或是整合到用户的衣服或配件的一种便携式设备。可穿戴设备不仅仅是一种硬件设备,更是通过软件支持以及数据交互、云端交互来实现强大的功能。广义穿戴式智能设备包括功能全、尺寸大、可不依赖智能手机实现完整或者部分的功能,例如:智能手表或智能眼镜等,以及只专注于某一类应用功能,需要和其它设备如智能手机配合使用,如各类进行体征监测的智能手环、智能首饰等。
在本申请中,终端的结构可以如图1所示。如图1所示,终端100可以包括处理器110,外部存储器接口120,内部存储器121,通用串行总线(universal serial bus,USB)接口130,充电管理模块140,电源管理模块141,电池142,天线1,天线2,移动通信模块150,无线通信模块160,音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,传感器模块180,按键190,马达191,指示器192,摄像头193,显示屏194,以及用户标识模块(subscriber identification module,SIM)卡接口195等。其中传感器模块180可以包括压力传感器180A,陀螺仪传感器180B,气压传感器180C,磁传感器180D,加速度传感器180E,距离传感器180F,接近光传感器180G,指纹传感器180H,温度传感器180J,触摸传感器180K,环境光传感器180L,骨传导传感器180M等。
终端100中包括的摄像头193的个数可以是一个或多个。如果终端100包括一个摄像头,则本申请实施例中支持该摄像头工作在不同工作状态。关于工作状态的具体描述可以参考下文。如果终端100包括多个摄像头,则该多个摄像头的倍率可以不同。该多个摄像头包括本申请实施例中描述的第一摄像头和第二摄像头。
可以理解的是,本实施例示意的结构并不构成对终端100的具体限定。在另一些实施例中,终端100可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。
处理器110可以包括一个或多个处理单元,例如:处理器110可以包括应用处理器(application processor,AP),调制解调处理器,图形处理器(graphics processing unit,GPU),图像信号处理器(image signal processor,ISP),控制器,视频编解码器,数字信号处理器(digital signal processor,DSP),基带处理器,和/或神经网络处理器(neural-network processing unit,NPU)等。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。例如,在本申请中,处理器110可以在当第一摄像头在第一场景中的感光度(international standards organization,ISO)大于第一阈值时,控制第一摄像头针对第一摄像头采集第一图像,并控制第二摄像头针对第一场景采集第二图像,以及根据第二图像优化第一图像,得到第三图像。具体实现方式可以参考下文。
其中,控制器可以是终端100的神经中枢和指挥中心。控制器可以根据指令操作码和时序信号,产生操作控制信号,完成取指令和执行指令的控制。
处理器110中还可以设置存储器,用于存储指令和数据。在一些实施例中,处理器110中的存储器为高速缓冲存储器。该存储器可以保存处理器110刚用过或循环使用的指令或数据。如果处理器110需要再次使用该指令或数据,可从所述存储器中直接调用。避免了重复存取,减少了处理器110的等待时间,因而提高了系统的效率。
在一些实施例中,处理器110可以包括一个或多个接口。接口可以包括集成电路(inter-integrated circuit,I2C)接口,集成电路内置音频(inter-integrated circuit sound,I2S)接口,脉冲编码调制(pulse code modulation,PCM)接口,通用异步收发传输器(universal asynchronous receiver/transmitter,UART)接口,移动产业处理器接口(mobile industry processor interface,MIPI),通用输入输出(general-purpose input/output,GPIO)接口,用户标识模块(subscriber identity module,SIM)接口,和/或通用串行总线(universal serial bus,USB)接口等。
MIPI接口可以被用于连接处理器110与显示屏194,摄像头193等外围器件。MIPI接口包括摄像头串行接口(camera serial interface,CSI),显示屏串行接口(display serial interface,DSI)等。在一些实施例中,处理器110和摄像头193通过CSI接口通信,实现终端100的拍摄功能。处理器110和显示屏194通过DSI接口通信,实现终端100的显示功能。
GPIO接口可以通过软件配置。GPIO接口可以被配置为控制信号,也可被配置为数据信号。在一些实施例中,GPIO接口可以用于连接处理器110与摄像头193,显示屏194,无线通信模块160,音频模块170,传感器模块180等。GPIO接口还可以被配置为I2C接口,I2S接口,UART接口,MIPI接口等。
USB接口130是符合USB标准规范的接口,具体可以是Mini USB接口,Micro USB接口,USB Type C接口等。USB接口130可以用于连接充电器为终端100充电,也可以用于终端100与外围设备之间传输数据。也可以用于连接耳机,通过耳机播放音频。该接口还可以用于连接其他终端,例如AR设备等。
可以理解的是,本实施例示意的各模块间的接口连接关系,只是示意性说明,并不构成对终端100的结构限定。在本申请另一些实施例中,终端100也可以采用上述实施例中不同的接口连接方式,或多种接口连接方式的组合。
电源管理模块141用于连接电池142,充电管理模块140与处理器110。电源管理模块141接收电池142和/或充电管理模块140的输入,为处理器110,内部存储器121,显示屏194,摄像头193,和无线通信模块160等供电。电源管理模块141还可以用于监测电池容量,电池循环次数,电池健康状态(漏电,阻抗)等参数。在其他一些实施例中,电源管理模块141也可以设置于处理器110中。在另一些实施例中,电源管理模块141和充电管理模块140也可以设置于同一个器件中。
终端100的无线通信功能可以通过天线1,天线2,移动通信模块150,无线通信模块160,调制解调处理器以及基带处理器等实现。
终端100通过GPU,显示屏194,以及应用处理器等实现显示功能。GPU为图像处理的微处理器,连接显示屏194和应用处理器。GPU用于执行数学和几何计算,用于图形渲染。处理器110可包括一个或多个GPU,其执行程序指令以生成或改变显示信息。
显示屏194用于显示图像,视频等。显示屏194包括显示面板。显示面板可以采用液晶显示屏(liquid crystal display,LCD),有机发光二极管(organic light-emitting diode,OLED),有源矩阵有机发光二极体或主动矩阵有机发光二极体(active-matrix organic light emitting diode的,AMOLED),柔性发光二极管(flex light-emitting diode,FLED),Miniled,MicroLed,Micro-oled,量子点发光二极管(quantum dot light emitting diodes,QLED)等。在一些实施例中,终端100可以包括1个或N个显示屏194,N为大于1的正整数。
终端100的显示屏194上可以显示一系列图形用户界面(graphical user interface,GUI),这些GUI都是该终端100的主屏幕。一般来说,终端100的显示屏194的尺寸是固定的,只能在该终端100的显示屏194中显示有限的控件。控件是一种GUI元素,它是一种软件组件,包含在应用程序中,控制着该应用程序处理的所有数据以及关于这些数据的交互操作,用户可以通过直接操作(direct manipulation)来与控件交互,从而对应用程序的有关信息进行读取或者编辑。一般而言,控件可以包括图标、按钮、菜单、选项卡、文本框、对话框、状态栏、导航栏、Widget等可视的界面元素。
终端100可以通过ISP,摄像头193,视频编解码器,GPU,显示屏194以及应用处理器等实现拍摄功能。
ISP用于处理摄像头193反馈的数据。例如,拍照时,打开快门,光线通过镜头被传递到摄像头感光元件上,光信号转换为电信号,摄像头感光元件将所述电信号传递给ISP处理,转化为肉眼可见的图像。ISP还可以对图像的噪点,亮度,肤色进行算法优化。ISP还可以对拍摄场景的曝光,色温等参数优化。在一些实施例中,ISP可以设置在摄像头193中。
摄像头193用于捕获静态图像或视频。物体通过镜头生成光学图像投射到感光元件。感光元件可以是电荷耦合器件(charge coupled device,CCD)或互补金属氧化物半导体(complementary metal-oxide-semiconductor,CMOS)光电晶体管。感光元件把光信号转换成电信号,之后将电信号传递给ISP转换成数字图像信号。ISP将数字图像信号输出到DSP加工处理。DSP将数字图像信号转换成标准的RGB,YUV等格式的图像信号。在一些实施例中,终端100可以包括1个或N个摄像头193,N为大于1的正整数。
数字信号处理器用于处理数字信号,除了可以处理数字图像信号,还可以处理其他数字信号。例如,当终端100在频点选择时,数字信号处理器用于对频点能量进行傅里叶变换等。
视频编解码器用于对数字视频压缩或解压缩。终端100可以支持一种或多种视频编解码器。这样,终端100可以播放或录制多种编码格式的视频,例如:动态图像专家组(moving picture experts group,MPEG)1,MPEG2,MPEG3,MPEG4等。
NPU为神经网络(neural-network,NN)计算处理器,通过借鉴生物神经网络结构,例如借鉴人脑神经元之间传递模式,对输入信息快速处理,还可以不断的自学习。通过NPU可以实现终端100的智能认知等应用,例如:图像识别,人脸识别,语音识别,文本理解等。
外部存储器接口120可以用于连接外部存储卡,例如Micro SD卡,实现扩展终端100的存储能力。外部存储卡通过外部存储器接口120与处理器110通信,实现数据存储功能。例如将音乐,视频等文件保存在外部存储卡中。
内部存储器121可以用于存储计算机可执行程序代码,所述可执行程序代码包括指令。处理器110通过运行存储在内部存储器121的指令,从而执行终端100的各种功能应用以及数据处理。例如,在本实施例中,处理器110可以通过执行存储在内部存储器121中的指令,获取终端100的位姿。内部存储器121可以包括存储程序区和存储数据区。其中,存储程序区可存储操作系统,至少一个功能所需的应用程序(比如声音播放功能,图像播放功能等)等。存储数据区可存储终端100使用过程中所创建的数据(比如音频数据,电话本等)等。此外,内部存储器121可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件,闪存器件,通用闪存存储器(universal flash storage,UFS)等。处理器110通过运行存储在内部存储器121的指令,和/或存储在设置于处理器中的存储器的指令,执行终端100的各种功能应用以及数据处理。
终端100可以通过音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,以及应用处理器等实现音频功能。例如音乐播放,录音等。
音频模块170用于将数字音频信息转换成模拟音频信号输出,也用于将模拟音频输入转换为数字音频信号。音频模块170还可以用于对音频信号编码和解码。在一些实施例中,音频模块170可以设置于处理器110中,或将音频模块170的部分功能模块设置于处理器110中。
扬声器170A,也称“喇叭”,用于将音频电信号转换为声音信号。终端100可以通过扬声器170A收听音乐,或收听免提通话。
受话器170B,也称“听筒”,用于将音频电信号转换成声音信号。当终端100接听电话或语音信息时,可以通过将受话器170B靠近人耳接听语音。
麦克风170C,也称“话筒”,“传声器”,用于将声音信号转换为电信号。当拨打电话或发送语音信息时,用户可以通过人嘴靠近麦克风170C发声,将声音信号输入到麦克风170C。终端100可以设置至少一个麦克风170C。在另一些实施例中,终端100可以设置两个麦克风170C,除了采集声音信号,还可以实现降噪功能。在另一些实施例中,终端100还可以设置三个,四个或更多麦克风170C,实现采集声音信号,降噪,还可以识别声音来源,实现定向录音功能等。
耳机接口170D用于连接有线耳机。耳机接口170D可以是USB接口130,也可以是3.5mm的开放移动电子设备平台(open mobile terminal platform,OMTP)标准接口,美国蜂窝电信工业协会(cellular telecommunications industry association of the USA,CTIA)标准接口。
压力传感器180A用于感受压力信号,可以将压力信号转换成电信号。在一些实施例中,压力传感器180A可以设置于显示屏194。压力传感器180A的种类很多,如电阻式压力传感器,电感式压力传感器,电容式压力传感器等。电容式压力传感器可以是包括至少两个具有导电材料的平行板。当有力作用于压力传感器180A,电极之间的电容改变。终端100根据电容的变化确定压力的强度。当有触摸操作作用于显示屏194, 终端100根据压力传感器180A检测所述触摸操作强度。终端100也可以根据压力传感器180A的检测信号计算触摸的位置。在一些实施例中,作用于相同触摸位置,但不同触摸操作强度的触摸操作,可以对应不同的操作指令。例如:当有触摸操作强度小于第一压力阈值的触摸操作作用于短消息应用图标时,执行查看短消息的指令。当有触摸操作强度大于或等于第一压力阈值的触摸操作作用于短消息应用图标时,执行新建短消息的指令。
陀螺仪传感器180B可以用于确定终端100的运动姿态。在一些实施例中,可以通过陀螺仪传感器180B确定终端100围绕三个轴(即,x,y和z轴)的角速度。陀螺仪传感器180B可以用于拍摄防抖。示例性的,当按下快门,陀螺仪传感器180B检测终端100抖动的角度,根据角度计算出镜头模组需要补偿的距离,让镜头通过反向运动抵消终端100的抖动,实现防抖。陀螺仪传感器180B还可以用于导航,体感游戏场景。
气压传感器180C用于测量气压。在一些实施例中,终端100通过气压传感器180C测得的气压值计算海拔高度,辅助定位和导航。
磁传感器180D包括霍尔传感器。终端100可以利用磁传感器180D检测翻盖皮套的开合。在一些实施例中,当终端100是翻盖机时,终端100可以根据磁传感器180D检测翻盖的开合。进而根据检测到的皮套的开合状态或翻盖的开合状态,设置翻盖自动解锁等特性。
加速度传感器180E可检测终端100在各个方向上(一般为三轴)加速度的大小。当终端100静止时可检测出重力的大小及方向。还可以用于识别终端姿态,应用于横竖屏切换,计步器等应用。
距离传感器180F,用于测量距离。终端100可以通过红外或激光测量距离。在一些实施例中,拍摄场景,终端100可以利用距离传感器180F测距以实现快速对焦。
接近光传感器180G可以包括例如发光二极管(LED)和光检测器,例如光电二极管。发光二极管可以是红外发光二极管。终端100通过发光二极管向外发射红外光。终端100使用光电二极管检测来自附近物体的红外反射光。当检测到充分的反射光时,可以确定终端100附近有物体。当检测到不充分的反射光时,终端100可以确定终端100附近没有物体。终端100可以利用接近光传感器180G检测用户手持终端100贴近耳朵通话,以便自动熄灭屏幕达到省电的目的。接近光传感器180G也可用于皮套模式,口袋模式自动解锁与锁屏。
环境光传感器180L用于感知环境光亮度。终端100可以根据感知的环境光亮度自适应调节显示屏194亮度。环境光传感器180L也可用于拍照时自动调节白平衡。环境光传感器180L还可以与接近光传感器180G配合,检测终端100是否在口袋里,以防误触。
指纹传感器180H用于采集指纹。终端100可以利用采集的指纹特性实现指纹解锁,访问应用锁,指纹拍照,指纹接听来电等。
温度传感器180J用于检测温度。在一些实施例中,终端100利用温度传感器180J检测的温度,执行温度处理策略。例如,当温度传感器180J上报的温度超过阈值,终端100执行降低位于温度传感器180J附近的处理器的性能,以便降低功耗实施热保 护。在另一些实施例中,当温度低于另一阈值时,终端100对电池142加热,以避免低温导致终端100异常关机。在其他一些实施例中,当温度低于又一阈值时,终端100对电池142的输出电压执行升压,以避免低温导致的异常关机。
触摸传感器180K,也称“触控器件”。触摸传感器180K可以设置于显示屏194,由触摸传感器180K与显示屏194组成触摸屏,也称“触控屏”。触摸传感器180K用于检测作用于其上或附近的触摸操作。触摸传感器可以将检测到的触摸操作传递给应用处理器,以确定触摸事件类型。可以通过显示屏194提供与触摸操作相关的视觉输出。在另一些实施例中,触摸传感器180K也可以设置于终端100的表面,与显示屏194所处的位置不同。
骨传导传感器180M可以获取振动信号。在一些实施例中,骨传导传感器180M可以获取人体声部振动骨块的振动信号。骨传导传感器180M也可以接触人体脉搏,接收血压跳动信号。在一些实施例中,骨传导传感器180M也可以设置于耳机中,结合成骨传导耳机。音频模块170可以基于所述骨传导传感器180M获取的声部振动骨块的振动信号,解析出语音信号,实现语音功能。应用处理器可以基于所述骨传导传感器180M获取的血压跳动信号解析心率信息,实现心率检测功能。
按键190包括开机键,音量键等。按键190可以是机械按键。也可以是触摸式按键。终端100可以接收按键输入,产生与终端100的用户设置以及功能控制有关的键信号输入。
马达191可以产生振动提示。马达191可以用于来电振动提示,也可以用于触摸振动反馈。例如,作用于不同应用(例如拍照,音频播放等)的触摸操作,可以对应不同的振动反馈效果。作用于显示屏194不同区域的触摸操作,马达191也可对应不同的振动反馈效果。不同的应用场景(例如:时间提醒,接收信息,闹钟,游戏等)也可以对应不同的振动反馈效果。触摸振动反馈效果还可以支持自定义。
指示器192可以是指示灯,可以用于指示充电状态,电量变化,也可以用于指示消息,未接来电,通知等。
另外,在上述部件之上,运行有操作系统。例如苹果公司所开发的iOS操作系统,谷歌公司所开发的Android开源操作系统,微软公司所开发的Windows操作系统等。在该操作系统上可以安装运行应用程序。
终端100的操作系统可以采用分层架构,事件驱动架构,微核架构,微服务架构,或云架构。本申请实施例以分层架构的Android系统为例,示例性说明终端100的软件结构。
图2是本申请实施例的终端100的软件结构框图。
分层架构将软件分成若干个层,每一层都有清晰的角色和分工。层与层之间通过软件接口通信。在一些实施例中,将Android系统分为四层,从上至下分别为应用程序层,应用程序框架层,安卓运行时(Android runtime)和系统库,以及内核层。
应用程序层可以包括一系列应用程序包。如图2所示,应用程序包可以包括相机,图库,日历,通话,地图,导航,WLAN,蓝牙,音乐,视频,短信息等应用程序。例如,在拍照时,相机应用可以访问应用程序框架层提供的相机接口管理服务。
应用程序框架层为应用程序层的应用程序提供应用编程接口(application programming interface,API)和编程框架。应用程序框架层包括一些预先定义的函数。如图2所示,应用程序框架层可以包括窗口管理器,内容提供器,视图系统,电话管理器,资源管理器,通知管理器等。例如,在本申请实施例中,在拍照时,应用程序框架层可以为应用程序层提供拍照功能相关的API,并为应用程序层提供相机接口管理服务,以实现拍照功能。
窗口管理器用于管理窗口程序。窗口管理器可以获取显示屏大小,判断是否有状态栏,锁定屏幕,截取屏幕等。
内容提供器用来存放和获取数据,并使这些数据可以被应用程序访问。所述数据可以包括视频,图像,音频,拨打和接听的电话,浏览历史和书签,电话簿等。
视图系统包括可视控件,例如显示文字的控件,显示图片的控件等。视图系统可用于构建应用程序。显示界面可以由一个或多个视图组成的。例如,包括短信通知图标的显示界面,可以包括显示文字的视图以及显示图片的视图。
电话管理器用于提供终端100的通信功能。例如通话状态的管理(包括接通,挂断等)。
资源管理器为应用程序提供各种资源,比如本地化字符串,图标,图片,布局文件,视频文件等等。
通知管理器使应用程序可以在状态栏中显示通知信息,可以用于传达告知类型的消息,可以短暂停留后自动消失,无需用户交互。比如通知管理器被用于告知下载完成,消息提醒等。通知管理器还可以是以图表或者滚动条文本形式出现在系统顶部状态栏的通知,例如后台运行的应用程序的通知,还可以是以对话窗口形式出现在屏幕上的通知。例如在状态栏提示文本信息,发出提示音,终端振动,指示灯闪烁等。
Android Runtime包括核心库和虚拟机。Android runtime负责安卓系统的调度和管理。
核心库包含两部分:一部分是java语言需要调用的功能函数,另一部分是安卓的核心库。
应用程序层和应用程序框架层运行在虚拟机中。虚拟机将应用程序层和应用程序框架层的java文件执行为二进制文件。虚拟机用于执行对象生命周期的管理,堆栈管理,线程管理,安全和异常的管理,以及垃圾回收等功能。
系统库可以包括多个功能模块。例如:表面管理器(surface manager),媒体库(Media Libraries),三维图形处理库(例如:OpenGL ES),2D图形引擎(例如:SGL)等。
表面管理器用于对显示子系统进行管理,并且为多个应用程序提供了2D和3D图层的融合。
媒体库支持多种常用的音频,视频格式回放和录制,以及静态图像文件等。媒体库可以支持多种音视频编码格式,例如:MPEG4,H.264,MP3,AAC,AMR,JPG,PNG等。
三维图形处理库用于实现三维图形绘图,图像渲染,合成,和图层处理等。
2D图形引擎是2D绘图的绘图引擎。
内核层是硬件和软件之间的层。内核层至少包含显示驱动,摄像头驱动,音频驱动,传感器驱动。
需要说明的是,本申请实施例虽然以Android系统为例进行说明,但是其基本原理同样适用于基于iOS或Windows等操作系统的终端。
下面结合图1和拍照场景,示例性说明终端100软件以及硬件的工作流程。
触摸传感器180K接收到触摸操作,上报给处理器110,使得处理器110响应于上述触摸操作,启动相机应用,并在显示屏194上显示该相机应用的用户界面。例如,触摸传感器180K当接收到对相机应用图标的触摸操作后,向处理器110上报对相机应用的触摸操作,使得处理器110响应于上述触摸操作,启动相机应用,并在显示屏194上显示相机的用户界面。此外,本申请实施例中还可以通过其它方式使得终端100启动相机应用,并在显示屏194上显示相机应用的用户界面。例如,终端100在黑屏、显示锁屏界面或者解锁后显示某一用户界面时,可以响应于用户的语音指令或者快捷操作等,启动相机应用,并在显示屏194上显示相机应用的用户界面。
在使用终端拍照时,可能因当前场景的环境因素,导致所拍摄的图像的颜色光影效果不好。例如,在暗光场景、高动态范围场景或超高范围场景中,导致所拍摄的图像的颜色光影效果,相比于亮光场景时所拍摄的图像的颜色光影效果差。对此,对图像的颜色光影的优化,从而提高用户体验,是一直研究和商用的热点。
为了解决对图像的颜色光影优化的问题,本申请实施例提供了一种图像处理方法,该方法应用于终端,该终端包括第一摄像头和第二摄像头,第一摄像头的倍率大于第二摄像头的倍率。该方法包括:当第一摄像头在第一场景中的ISO大于第一阈值时,通过第一摄像头针对第一场景采集第一图像,通过第二摄像头针对第一场景采集第二图像;第二图像的颜色光影程度高于第一图像的颜色光影程度;根据第二图像优化第一图像,得到第三图像;第三图像的颜色光影程度高于第一图像的颜色光影程度。在本申请实施例中,终端利用基于同一场景的颜色光影程度高的图像优化颜色光影程度低的图像,考虑了客观环境信息的采集,相比现有技术中,使用单帧图像优化颜色光影的技术方案,有助于使得优化的的图像能够更客观的表示真实场景,并且,提高了鲁棒性。
需要说明的是,在本申请实施例中,“图像风格”也可以理解为“图像的颜色光影”。例如,图像风格(或图像的颜色光影)可以包括图像的颜色、对比度和动态范围中的至少一种。又如,第二图像的图像风格优于第一图像的图像风格,等价于第二图像的颜色光影程度高于第一图像的颜色光影程度。
下面将结合附图对本申请实施例的实施方式进行详细描述。
如图3所示,为本申请实施例提供的图像处理的方法的流程图。图3所示的方法包括以下步骤:
S101:终端针对当前拍摄环境中的第一场景采集图像之前,确定第一摄像头和第二摄像头。其中,第一摄像头用于拍摄待优化图像(如本申请中的第一图像),第二摄像头用于拍摄参考图像(即优化待优化图像的过程中所使用的图像,如本申请中的第二图像)。
在一种实现方式中,第一摄像头在第一摄像头在当前拍摄环境中的ISO大于第一阈值。
对于同一摄像头来说,在不同环境时,会自动调节自身ISO的取值。第一阈值大 于等于表征亮区和暗区的临界状态时第一摄像头的ISO的取值。第一阈值的取值与第一摄像头的规格、界定亮区和暗区的临界状态等相关。其中,用于表征摄像头的规格的参数可以包括:焦距、倍率和感光性能等。在一个示例中,第一阈值可以是200左右。
在这种实现方式中,通俗地讲,第一场景是暗光场景,如夜景,或者白天的暗区场景等。
在另一种实现方式中,第一场景是高动态范围场景或超高动态范围场景。具体的,如果第一摄像头拍摄第一场景时的预览图像的亮度的最大值和最小值的比值大于一个阈值,则说明第一场景是高动态范围场景或超高动态范围场景。
在另一种实现方式中,第一场景是高对比度场景。具体的,如果第一摄像头拍摄第一场景时的预览图像的对比度的最大值和最小值的差大于一个阈值,则说明第一场景是高对比度场景。
在另一种实现方式中,第一场景是异常场景。其中,这里的异常场景是指因环境环境因素等导致拍摄第一场景得到的图像不能真实反映该场景。例如,拍摄该场景得到的图像中的物体的纹理信息发生畸变,或者发生偏色(即颜色发生改变)。
可以理解的是,本申请实施例可以对图像的颜色光影信息进行优化,因此,本申请实施例尤其适用于拍摄效果不好的场景,如上述夜景或异常场景等。
可选的,第一摄像头的倍率大于第二摄像头的倍率。
在一种实现方式中,第二摄像头的倍率范围包括[0.5,1),第一摄像头的倍率范围包括[1,20]。例如,第二摄像头是广角摄像头,第一摄像头是1X摄像头(即倍率是1的摄像头)、3X摄像头(即倍率是3的摄像头)或10X摄像头(即倍率是10的摄像头)。
在另一种实现方式中,第二摄像头的倍率是1,第一摄像头的倍率属于区间(1,20]。例如,第二摄像头是1X摄像头,第一摄像头是3X摄像头或10X摄像头。
在另一种实现方式中,第二摄像头的倍率属于区间(1,10),第二摄像头的倍率属于区间[10,20]。例如,第二摄像头是3X摄像头,第一摄像头是10X摄像头。
可选的,第一摄像头的倍率、等于第二摄像头的倍率。例如,第一摄像头和第二摄像头的倍率均小于1,或者均等于1,或者均大于1,例如,第一摄像头和第二摄像头均是广角摄像头,或者均是1X摄像头,或者均是3X摄像头,或者均是10X摄像头。
上述仅为示例,其不对本申请实施例所适用的摄像头的倍率的具体取值构成限定。
可选的,第二摄像头用于拍摄黑白图像,第一摄像头用于拍摄彩色图像。示例的,第二摄像头是1X摄像头,第二摄像头是广角摄像头或者1X摄像头。当然不限于此。
当然,第二摄像头和第一摄像头可以均用于拍摄彩色图像。下文中均是以第一图像和第二图像均是彩色图像为例进行说明的,在此统一描述,下文不在赘述。
可选的,终端中包括多个摄像头,终端可以基于如下步骤确定第一摄像头和第二摄像头:
当终端针对第一场景的拍摄倍率在[1,3)时,选择终端中倍率为1的摄像头作为第一摄像头。该情况下,可以选择终端中倍率为1或者小于1的摄像头作为第二摄像头。
当终端针对第一场景的拍摄倍率在[3,7)时,选择终端中倍率为3的摄像头作为第一摄像头。该情况下,可以选择终端中倍率为3、1、或者小于1的摄像头作为第二摄像头。
当终端针对第一场景的拍摄倍率在[7,10)时,选择终端中倍率为10的摄像头作为第一摄像头。该情况下,可以选择终端中倍率为3、1、或者小于1的摄像头作为第二摄像头。
当终端针对第一场景的拍摄倍率大于10时,选择终端中倍率为10的摄像头作为第一摄像头。该情况下,可以选择终端中倍率为10、3、1、或者小于1的摄像头作为第二摄像头。
更为普适性地,当终端针对第一场景的拍摄倍率在[1,A)时;选择终端中倍率是1的摄像头或者主摄摄像头作为第一摄像头;
或者,当终端针对第一场景的拍摄倍率在[A,B)时,选择终端中倍率是A的摄像头或者主摄摄像头作为第一摄像头;
或者,当终端针对第一场景的拍摄倍率大于B时,选择终端中倍率是C的摄像头或者主摄摄像头作为第一摄像头;
或者,当终端针对第一场景的拍摄倍率大于C时,选择终端中倍率是C的摄像头或者主摄摄像头作为第一摄像头;
其中,1<A<B<C。
当第一摄像头确定下来后,可以选择终端中倍率小于等于第一摄像头的倍率的摄像头作为第二摄像头。
S102:终端通过第一摄像头针对第一场景采集第一图像,通过所述第二摄像头针对所述第一场景采集第二图像。其中,第二图像的颜色光影程度高于第一图像的颜色光影程度。
本申请实施例对第一图像和第二图像的拍摄时间间隔不进行限定。例如,第一图像与第二图像的拍摄时间间隔小于一个阈值。由于拍摄时间间隔越长,发生抖动、环境巨变等概率会越高,这样,会导致第一图像与第二图像的内容相差大的概率越高,因此,理论上,第一图像和第二图像的拍摄时间间隔越小越好。可选的,二者的拍摄时间间隔可以是毫秒量级或者是几十毫秒量级。
图像的颜色光影程度可以基于图像的颜色、对比度和动态范围中的至少一种表征。
可选的,如果第二图像与第一图像之间满足预设条件,则说明第二图像的颜色光影程度高于第一图像的颜色光影程度。该预设条件包括以下至少一种:
条件1:第二图像的颜色优于第一图像的颜色。
具体的,第二图像中表示一个对象的像素的颜色优于第一图像中表示该对象的像素的颜色,且第二图像中具有该特征的像素的个数大于阈值。通俗地讲,第二图像的整体颜色优于第一图像的整体颜色。
可选的,如果第二图像的颜色的信噪比高于第一图像的颜色的信噪比,则说明第二图像的颜色优于第一图像的颜色。
可选的,如果第二图像的色度大于第一图像的色度,和/或第二图像的亮度大于第一图像的亮度,则说明第二图像的颜色优于第一图像的颜色。
条件2:第二图像的对比度高于第一图像的对比度。
条件3:第二图像的动态范围大于第一图像的动态范围。
本申请实施例提供了以下几种实现方式,这有助于实现第二图像的颜色光影程度高于第一图像的颜色光影程度:
方式1:第二摄像头的感光性能高于第一摄像头的感光性能。
摄像头的感光性能是摄像头的固有特性,用于表示摄像头的成像能力。通常,摄像头中的传感器(sensor)的面积越大,该摄像头的感光性能越强,在其他条件都相同的情况下,摄像头的感光性能越强,拍摄得到的图像的颜色光影程度越高。
方式2:第二摄像头的光圈大于第一摄像头的光圈。
方式3:第二摄像头采集第二图像时的曝光时长大于第一摄像头采集第一图像时的曝光时长。示例的,第二摄像头采集第二图像时的曝光时长在百毫秒量级,如T
a可以是500毫秒左右,第一摄像头采集第二图像时的曝光时长在几到几十毫秒量级。
方式4:第二摄像头采集第二图像时所使用的ISO大于第一摄像头采集第一图像时所使用的ISO。
不同照度下摄像头的最佳ISO值不同。某一照度下的最佳ISO值,是指该照度下使得图像的颜色光影程度最高(或者颜色光影程度达到一定阈值)时的ISO的取值。任意照度下的最佳ISO值可以基于实验得到,本申请实施例对此不进行限定。同一照度下,在ISO的值小于等于最佳ISO值时,ISO的取值越大,拍摄得到的图像的颜色光影程度越高;在ISO的值大于最佳ISO值时,ISO的取值越大,拍摄得到的图像的颜色光影程度越低。
上述方式1和方式2可以理解为基于摄像头的硬件属性,实现第二图像的颜色光影程度高于第一图像的颜色光影程度。上述方式3和方式4可以理解为基于软件调节摄像头的参数,以实现第二图像的颜色光影程度高于第一图像的颜色光影程度。上述方式3和方式4可以适用于第二摄像头的感光性能与第一摄像头的感光性能相同,或者相差不大的情况下。
摄像头的光圈和曝光时长影响摄像头的进光量,摄像头的sensor感光面积以及iso决定了摄像头接收光量的能力。通常来说,光圈越大,曝光时长越长,感光面积越大,iso越高,则摄像头最终实际能接收的光量越大。但是接收光量不是越大越好,对于具体拍摄环境而言,存在一个曝光临界值,如果接收光量小于曝光临界值时,则接收光量越大,拍摄得到的图像的颜色光影效果越好。如果接收光量大于等于曝光临界值,则接收光量越大,拍摄得到的图像的颜色光影效果可能会因为过曝而变差。作为示例,上述方式3和方式4可以适用于接收光量小于曝光临界值的场景。
需要说明的是,在不冲突的情况下,上述方式1~方式4中的多种方式可以结合使用,从而构成新的实现方式。例如,上述方式3和方式4可以结合使用。
可选的,S102可以通过以下方式A或方式B实现:
方式A:如图4所示,S102可以包括以下步骤S21~S25:
S21:终端确定第一场景的照度。
S22:终端基于所确定的第一场景的照度,获取第一摄像头的第一曝光时长和第一ISO。该步骤的具体实现方式可以参考现有技术,此处不再赘述。
S23:终端使用第一曝光时长和第一ISO拍摄第一场景,得到第一图像。
S24:终端基于第一曝光时长和第一ISO中的至少一种,确定拍摄第二摄像头的第二曝光时长和第二ISO。
摄像头的曝光量EV、曝光时长T和ISO之间的关系满足:EV=log
2(T*ISO)。终端可以预存如下关联关系:第一摄像头的曝光量(或者“曝光时长和/或ISO”)与第二摄像头的曝光量(或者“曝光时长和/或ISO”)之间的对应关系;然后,基于步骤2中所确定的第一摄像头的第一曝光时长和第一ISO,以及上述预存的对应关系,确定第二曝光时长和第二ISO。本申请实施例对上述对应关系的具体体现形式不进行限定,例如,可以是函数关系、表格等。
可选的,首先,基于预定义的T
a与T
m之间的对应关系,或者预定的T
a与“T
m和ISO
m”之间的关联关系,或者预定义T
a与ISO
m之间的关联关系等,获取T
a的取值。其中,T
a表示第二曝光时长,T
m表示第一曝光时长,ISO
m表示第一ISO。然后,基于T
m、ISO
m和T
a中至少一个参数的值,获取ISO
a。其中,ISO
a表示第二ISO。
在一个示例中,终端可以通过调节ISO
a,使得采集第二图像时第二摄像头的曝光量EV
a=log
2(T
a*ISO
a)比采集第一图像时第一摄像头的曝光量EV
m=log
2(T
m*ISO
m)大一定的量,即满足EV
a=EV
m+f,其中,f为预定义值。
在另一个示例中,基于预定义的ISO
a与ISO
m之间的关联关系,或者预定义的ISO
a与“T
m和ISO
m”之间的关联关系,或者预定义的ISO
a与T
m之间的关联关系,获取ISO
a的取值。
S25:终端使用第二曝光时长和第二ISO,拍摄第一场景,得到第二图像。
方式B:如图5所示,S102可以包括以下步骤S31~S36:
S31~S33:可以参考上述S21~S23。
S34:终端基于多个场景的照度区间与摄像头的ISO之间的对应关系,确定第一场景的照度所在的照度区间对应的摄像头的ISO,并将所确定的ISO作为第二摄像头的ISO。
该对应关系可以是预定义的。该对应关系中的摄像头的ISO,具体可以使之摄像头的最佳ISO值,关于最佳ISO值的相关描述可以参考上文,此处不再赘述。
需要说明的是,某一照度下,使用最佳ISO值拍摄图像时,在保障拍摄得到的图像的颜色光影程度较高的同时,可能会牺牲纹理信息,放宽噪声,以及降低配准程度(即同一场景下采集的不同图像之间的配准度);也就是说,使用最佳ISO值采集图像时,是以牺牲纹理信息、放宽噪声和不配准容忍上限为代价,高质量地记录了该图像的颜色光影信息。
S35:终端基于第一曝光时长和第一ISO中的至少一种,确定第二摄像头的第二曝光时长。具体实现方式可以参考上文。
S36:可以参考上述S25。
可选的,基于上述方式A中,在设计执行S24时所使用的预定义的对应关系时,可以考虑将“最佳ISO值”作为影响f的取值的因素,从而使得执行S24所得到的第二ISO的取值更接近于最佳ISO值。
需要说明的是,上文中均是以第一图像和第二图像分别由不同摄像头拍摄得到的。 除此之外,第一图像和第二图像还可以由以下任一方式获得:
在一种实现方式中,第一图像和第二图像可以由同一摄像头在不同工作状态下拍摄得到。例如,该摄像头可以在开启闪光灯时拍摄得到第二图像,并在关闭闪光灯时拍摄得到第一图像;或者,该摄像头通过调节该摄像头的曝光时长和ISO,拍摄得到第一图像和第二图像。
在另一种实现方式中,第二图像可以是从多个摄像头拍摄得到的图像中,选择到的颜色光影程度最高,或者颜色光影程度高于某一阈值的图像。
在另一种实现方式中,第一图像和第二图像中的任意一个图像可以是由多帧图像融合而成的,而非由摄像头直接拍摄得到的。其中,该多帧摄像头可以由同一个摄像头拍摄得到,也可以由不同摄像头拍摄得到,还可以是部分由同一摄像头拍摄得到,另一部分由不同摄像头拍摄得到等,本申请实施例对此不进行限定。
示例1:上述方法还包括:通过第一摄像头针对第一场景采集N帧图像,N是大于等于1的整数;根据N帧图像以及第一图像进行多帧降噪,得到第四图像。该情况下,根据第二图像优化第一图像,得到第三图像,可以包括:根据第二图像优化第四图像,得到第三图像。也就是说,终端优化基于同一摄像头拍摄的多个图像融合后的图像,得到第三图像。
示例2:上述方法还包括:通过第一摄像头和第二摄像头分别针对第一场景采集N1帧图像和N2帧图像;其中,N1和N2均是大于等于1的整数;根据N1帧图像、N2帧图像和第一图像进行多帧降噪,得到第五图像。该情况下,根据第二图像优化第一图像,得到第三图像,可以包括:根据第二图像优化第五图像,得到第三图像。也就是说,终端优化基于不同摄像头拍摄的多个图像融合后的图像,得到第三图像。
作为示例,上述示例1和示例2,可以适用于终端针对第一场景的拍摄倍率在[1,3)、[3,7)或大于10的情况下,关于这些情况下,如何选择第一摄像头和第二摄像头的具体实现方式可以参考上文,此处不再赘述。
示例3:上述终端还包括第三摄像头,第三摄像头的倍率不大于第一摄像头的倍率。上述方法还包括:通过第一摄像头和第三摄像头分别针对第一场景采集N3帧图像和N4帧图像;其中,N3和N4均是大于等于1的整数;根据N3帧图像、N4帧图像和第一图像进行多帧降噪,得到第六图像。该情况下,根据第二图像优化第一图像,得到第三图像,可以包括:根据第二图像优化第六图像,得到第三图像。第三摄像头为终端中不同于第一摄像头和第二摄像头的摄像头。也就是说,终端可以基于至少三个摄像头拍摄的多个图像融合后的图像进行优化,得到第三图像。
作为示例,上述示例1和示例2,可以适用于终端针对第一场景的拍摄倍率在[7,10)的情况下,该情况下,如何选择第一摄像头和第二摄像头的具体实现方式可以参考上文,此处不再赘述。
上述示例1~示例3提供的技术方案,有助于使得优化后得到的第三图像的颜色光影程度更高,从而提高用户体验。
具体实现时,还有更多的出帧和融合的方法,本申请实施例不予以限定。
S103:终端判断第二图像是否可用。
由于在拍摄第一场景得到第二图像的过程中,可能会遇到镜头被遮挡、环境巨变、 手抖动非常严重、模糊严重等等异常情形,这样,会导致拍摄所得到的第二图像没有参考价值(或者参考价值较低),也就是说,第二图像不可用,因此,在本申请实施例中,执行优化第一图像的色度之前,可以先判断第二图像是否可用。
可选的,S103可以包括以下步骤S103A~S103B:
S103A:终端对第二图像进行预处理,以使得第一图像和处理后的第二图像的取景范围相同或相近(即取景范围之差在预设范围内),且第一图像和处理后的第二图像的尺寸(包括宽和高)相同或相近(即尺寸之差在预设范围内)。具体的:
步骤1:当第一图像的拍摄条件和第二图像的拍摄条件之间满足预设条件时,终端通过对第二图像进行缩放裁剪等处理,使得处理后的第二图像的取景范围与第一图像的取景范围相近(即取景范围之差在预设范围内)。
其中,预设条件可以包括以下条件1或条件2:
条件1:第一图像是在zoom条件下拍摄的;并且,第二图像是在非zoom条件下拍摄的,或者第二图像是在zoom条件下拍摄的,但是采集第二图像时所使用的zoom倍率与采集第一图像时所使用的zoom倍率不同。
条件2:第一图像是在非zoom条件下拍摄的;并且,第二图像是在zoom条件下拍摄的。
需要说明的是,步骤1是可选的。如果第一图像和第二图像均是在非zoom条件下拍摄的,或者,如果第一图像和第二图像均是在zoom条件下拍摄的,但采集第一图像和第二图像时所使用的zoom倍率相同;那么,第一图像和第二图像的取景范围通常相近(包括相同或者相近),该情况下,可以不对第二图像执行缩放裁剪等处理,而是直接执行以下步骤2。
步骤2:终端可以将取景范围相近的第一图像和第二图像的尺寸)调到相同(或者相近),具体实现方式可以参考现有技术。
需要说明的是,步骤S103A是可选的,如果拍摄得到的第一图像和第二图像的取景范围相近,且尺寸相同或相近,则终端可以不执行S103A。
S103B:终端判断第一图像和处理后的第二图像在亮度直方图校正到相当(即亮度直方图之差在预设范围内)的情况下,是否能够有效配准。如果能够有效配准,则说明第二图像可用;否则,则说明第二图像不可用。
本申请实施例对有效配准的衡量方法不进行限定。例如,该衡量方法可以包括:使用经典的sift或surf等方法寻找第一图像和处理后的第二图像之间的特征配对点对。如果二者的特征配对点对的个数小于等于预设值,则认为二者无法有效配准;否则,认为二者能够有效配准。具体实现方法可以参考现有技术,此处不再赘述。
需要说明的是,本申请实施例提供的技术方案,对于抖动和模糊等异常情形下拍摄得到的第二图像具有很强的鲁棒性,这种情况下,使用经典的sift或surf等方法,进行有效配准的判断结果通常是“不可用”。对此,在一种可能的实现方式中,可以专门训练一个二分类AI网络来实现有效配准的判断,该方法会比经典方法更灵活准确。具体的训练二分类AI网络的方法等,本申请实施例不进行限定。
另外需要说明的是,如果不需要对第二图像进行预处理(即不执行S103A),直接执行S103B,则S103B具体为终端判断第一图像和第二图像在亮度直方图校正到相当 的情况下,是否能够有效配准。
S104:如果第二图像可用(即第一图像和第二图像配准成功),则基于第二图像优化第一图像,得到第三图像。其中,第三图像的颜色光影程度优于第一图像的颜色光影程度。
关于两个图像的颜色光影程度的判断方式可以参考上文,此处不再赘述。
基于上述对第二图像的颜色光影程度和第一图像的颜色光影程度的解释,以及第三图像和第一图像之间满足第三图像的颜色光影程度优于第一图像的颜色光影程度,可以得出:
第一图像、第二图像和第三图像满足如下至少一种条件:如果第二图像的颜色优于第一图像的颜色,则第三图像的颜色优于第一图像的颜色;如果第二图像的对比度高于第一图像的对比度,则第三图像的对比度高于第一图像的对比度;如果第二图像的动态范围大于第一图像的动态范围,则第三图像的动态范围大于第一图像的动态范围。
可选的,第三图像的图像内容与第一图像的图像内容相同。等价于:第三图像的纹理信息与第一图像的纹理信息相同。这里的“相同”可以是指在一定误差范围内相同。
可选的,如果因抖动和模糊等异常情形导致某些区域(标记为第一类区域)存在于第一图像中,而不存在于第二图像中,即:在第二图像中无法找到第一类区域对应的区域,其中,一个区域与该区域对应的区域用于表示同一对象;并且,某些区域(标记为第二类区域)存在于第一图像中也存在于第二图像中,即:在第二图像中能够找到第二类区域对应的区域。那么,可以认为第二图像可用。该情况下,第二图像可用,具体是指第二图像中与第二类区域对应的区域可用。
基于此,终端可以通过鬼影检测方法,在第一图像中圈出无法在第二图像中找到对应区域的区域(即第一类区域)。本申请实施例对鬼影检测方法不进行限定。进一步地,终端可以在执行S104获得第三图像之后,针对第三图像中对应于第一类区域的区域(即与第一类区域表示同一对象的区域)不作处理,并将该区域与其他区域在边界进行渐变融合,以去除该区域与其他区域之间的明显分界线,提高图像质量。
可选的,如果第二图像可用,则在执行S104之前,该方法还可以包括:终端对第一图像和第二图像(具体可以是经上述预处理后得到的第二图像)进行配准,配准方法可以包括但不限于经典的sift、surf等,当然也可以使用AI网络进行配准。经配准步骤后,再执行S104,有助于使得优化结果更精确。
执行上述S104之后:
在一种实现方式中,终端可以显示S104得到的第三图像。
在另一种实现方式中,考虑到具体实现时,可能存在仅希望对某个像素值范围(或者是某个区域)进行调节,其他位置维持不变。基于此,本申请实施例提供了如下技术方案:
首先,终端获取第一图像中的第一目标子图像;其中,第一目标子图像是第一图像中不希望被改变颜色光影信息的区域。具体可以是第一图像中的高光区域甚至是过爆区域,或者是包含特定颜色的区域,或者是基于语义内容等圈定的区域,或者是基 于网络如attention网络求得的。其次,终端获取第三图像中的第二目标子图像;其中,第二目标子图像与第一目标子图像描述同一对象。接着,终端使用第一目标子图像更新(或替换)第三图像中的第二目标子图像,得到第四图像。或者,终端拼接第一目标子图像与第三图像中除第二目标子图像之外的图像,得到第四图像。例如,最终结果=直出结果*(1-mask)+第一图像*mask。其中,最终结果表示第四图像,直出结果表示第三图像,mask表示第一目标子图像在第一图像中的位置,或第二目标子图像在第三图像中的位置,第一图像*mask表示第一目标子图像,直出结果*mask表示第二目标子图像。后续,终端可以显示第四图像。其中,第四图像的颜色光影程度高于第一图像的颜色光影信息;第四图像的图像内容与第一图像的图像内容相同(或相近)。
可选的,mask也可以是圈第二图像的区域,效率往往更高,即第二图像上效果不好的区域,不希望用到第一图像上,比如高光过曝区域。对此,将圈出的mask进行gaussian blur或者上下采样进行模糊化构造出渐变的过渡带,这样应用于第一图像便不必在乎第一图像和第二图像间的不配准,保证预期效果。
可选的,mask也可以用网络来求解,比如attention网络。
可选的,基于上述任一方式,网络的输入可以是第一图像,或者第二图像,或者第一图像和第二图像的组合。
以下,说明S104的具体实现方式:
可选的,终端使用第二图像优化第一图像,得到第三图像,可以包括:
方式1:使用CCM矩阵表示第一图像与第二图像的颜色光影信息之间的映射关系,从而基于CCM矩阵优化第一图像,得到第三图像。
具体的,如图6所示,方式1可以包括以下步骤S41~S45:
S41:终端对第一图像和第二图像分别进行特征提取,得到第一张量和第二张量;其中,第一张量用于表征第一图像的纹理信息和颜色光影信息,第二张量用于表征第二图像的纹理信息和颜色光影信息。第一张量和第二张量的尺寸相同。
例如,终端使用AI技术如神经网路,对第一图像和第二图像分别进行特征提取,得到第一张良和第二张量。其中,终端使用神经网络对图像进行特征提取的方法,可以参考现有技术,此处不再赘述。当然,具体实现时,终端也可以采用传统的技术而非AI技术,对第一图像和第二图像分别进行特征提取,本申请实施例对此不进行限定。
在执行上述S103A的基础之上,执行S104A时,S104A中的第二图像具体可以是经预处理后的第二图像。
以第一图像和第二图像均是彩色图像为例,在使用第三神经网络对第一图像和第二图像进行特征提取之前,终端可以执行以下步骤:首先,将第一图像和第二图像的尺寸调整(resize)到相同,如通过缩放第二图像,使得第一图像和缩放后的第二图像的尺寸相同。如果在执行S102后,第一图像和第二图像的尺寸相同,则可以不执行该步骤。然后,将调整后的第一图像和第二图像输入到第三神经网络。其中,调整后的第一图像和第二图像的尺寸标记为H*W*3,其中,H和W分别表示调整后的第一图像和第二图像的宽和高,3表示RGB三通道。示例的,H和W的取值可以是第三神经网络中预定义的。
在一个示例中,第三神经网络最终可以将第一图像和第二图像分别划分为h*w个图像块。其中,h和w分别表示第一图像(或第二图像)宽和高方向上所划分的图像块的个数。示例的,h和w的取值可以是第三神经网络中预定义的。
可选的,如果第三神经网络中所使用的卷积运算的卷积核(kernel)是正方形卷积核,则要求满足H/h=W/w=D,其中,D为正整数。该情况下,每个图像块的尺寸是D*D。
可选的,假设将第一张量和第二张量的尺寸标记为h
f*w
f*c
f,则满足H/h
f=W/w
f=D1,其中,D1为正整数。c
f是特征的个数,例如,如果提取10个纹理特征,10个颜色特征,则c
f是20。示例的,h
f、w
f和c
f的取值可以是第三神经网络中预定义的。
可选的,终端可以使用同一第三神经网络,也可以使用不同第三神经网络,对第一图像的特征提取和对第二图像的特征提取。
S42:终端基于第一张量和第二张量的特征维度,对第一张量和第二张量进行叠加运算(concat),得到目标张量。或者,对第一张量和第二张量进行相减运算,得到目标张量。
以第一张量和第二张量的尺寸标记为h
f*w
f*c
f为例,基于第一张量和第二张量的特征维度,对第一张量和第二张量进行叠加运算后得到的目标张量的尺寸为h
f*w
f*2c
f。
两个张量相减后得到的张量,是这两个张量中相同位置的元素相减后得到的元素构成的张量。以第一张量和第二张量的尺寸标记为h
f*w
f*c
f为例,对第一张量和第二张量进行相减运算后得到的目标张量的尺寸为h
f*w
f*c
f。“A-B”等价于“A+(-B)”,因此,对第一张量和第二张量进行相减运算,等价于对第二张量的相反数与第一张量进行相加运算。
S43:终端使用第一神经网络获取至少两个子图像的CCM矩阵。其中,第一神经网络用于对第一图像的颜色光影信息和纹理信息,以及第二图像的颜色光影信息和纹理信息进行分析,得到至少两个子图像的CCM矩阵,如第一图像所分成的每个子图像的CCM矩阵。
可选的,第一神经网络的输入信息包括目标张量。第一神经网络的输出信息包括第一图像中每个子图像的CCM矩阵。
该至少两个子图像包括第一子图像,第一子图像的CCM矩阵用于表征第一子图像的颜色与第二图像中的第二子图像的颜色之间的映射关系。第一子图像和第二子图像是同一对象的图像。其中,第一子图像可以是第一图像所包括的至少两个子图像中的任意一个子图像。“对象”,是指同一物体的同一部分/部位,例如,对象可以是人的眼睛,鼻子,嘴巴等,又如,对象可以是人的左手食指部分,或者是右手小拇指部分等。
可选的,子图像满足以下条件之一:
条件1:子图像是第一图像中的图像块,不同图像块的大小相同。
一帧图像可以包括至少两个图像块。图像块是矩形,例如可以是正方形。基于条件1,一个子图像可以认为是一帧图像中的一个图像块。
条件2:子图像是基于第一图像中的像素的相似度确定的,同一子图像中的像素的相似度大于等于第三阈值。可选的,不同子图像中的不同相似度小于第三阈值。
这是在考虑到“通常情况下,同一图像中,描述同一物体的像素的相似度相差不 大,而描述不同物体的像素的相似度相差较大”而提出的技术方案。例如,假设第一图像中包括人和建筑物,则可能存在描述人的像素和描述建筑物的像素的相似度相差较大,而描述建筑物的像素的相似度相差不大,该情况下,可以将描述人的像素共同作为一个子图像,将描述建筑物的像素共同作为一个子图像。又如,对于描述人的像素来说,可能存在描述人的上衣的像素与描述人的头发的像素之间的相似度可能相差很大,该情况下,可以将描述人的上衣的像素共同作为一个子图像,将描述人的头发的像素共同作为一个子图像。
可以理解的是,对于不同子图像来说,第三阈值的大小可以相同,也可以不同。
为了与像素块进行区分,在本申请实施例的一些描述中,将基于相似度划分图像得到的每个子图像,称为是一个像素组。一帧图像可以包括一个或多个像素组。基于条件2,一个子图像可以认为是一帧图像中的一个像素组。
条件3:子图像是基于第一图像中图像块中的像素的相似度确定的,不同图像块的大小相同,同一图像块的同一子图像中的像素的相似度大于第三阈值。
基于条件3,一个子图像可以认为是一帧图像的一个图像块中的一个像素组。
相比上述条件1或条件2,该条件3是从更细粒度上对一帧图像进行了划分。这样,有助于在执行S43时得到更多的CCM矩阵,从而使得执行S44时得到的插值结果更精确。
基于条件3,第一神经网络的输出结果的尺寸可以为h*w*(n
g*n
m)。第一神经网络处理第一图像和第二图像的过程,可以相当于:将第一图像帧平均分成h*w个像素块,每个像素块中的像素按相似度被分成n
g个像素组;针对每个像素组,第一神经网络网络输出n
m个CCM矩阵元素。示例的,n
m一般取9,对应于常规3*3的CCM矩阵的元素个数,即对y通道、u通道和y通道均做处理。示例的,如果希望该方案只对色度做处理,即只对u通道和y通道做处理,则n
m可以取小于9的值,比如是6。这相当于处理y通道的3个元素可以不用考虑了。当然,此时输出的CCM矩阵是作用在YUV域的。
上述S43可以认为是获取至少两个子图像的CCM矩阵的一种实现方式,具体实现时,不限于此。例如,可以使用传统方法而非AI技术,获得至少两个子图像的CCM矩阵。
S44:终端基于该至少两个子图像的CCM矩阵,得到第一图像中的像素的CCM矩阵。例如,终端基于该至少两个子图像的CCM矩阵,进行插值运算,得到第一图像中的每个像素的CCM矩阵。其中,第一图像包括第一像素,第一像素可以是第一图像中的任意一个像素。第一像素的CCM矩阵用于表征第一像素的颜色与第二图像中的第二像素的颜色之间的映射关系。第一像素和第二像素对应于同一图像内容。
如图7所示,为使用网格平均划分第一图像的示意图。假设令第第一神经网络输出netout[i,j,0:n
g*n
m]是第一图像第(i,j)个,0<=i<h;0<=j<w,区域中心点(即网格点)对应的CCM矩阵;那么,第一图像上每个像素的CCM矩阵都可按照临近它的网格点进行插值得到。以每个像素为中心,圈出一块正方形区域,这个区域面积可以取和第一图像平均划分的每块正方形区域等大,将在这个正方形区域内的所有网格点用来插值得到该像素的CCM矩阵。按此规则,如图7所示,不难看出有三类插值区域 (如第一类插值区域,第二类插值区域和第三类插值区域),按插值所需网格点的数目划分。
记第一图像的一个像素的相似度为s;供其插值的网格点有M个,则其中第m个网格点,0<=m<M,参与插值的数据有netout[i
m,j
m,n
ms*n
m:(n
ms+1)*n
m]和netout[i
m,j
m,(n
ms+1)*n
m:(n
ms+2)*n
m],其中对于第m个网格点而言,像素相似度s介于第n
ms组和第n
ms+1组之间,0<=n
ms<n
g-1,这里可理解为该像素可以被归入这两个组。关于相似度的衡量,最简单的是使用像素的y通道值,至于分组则是将y通道值范围[0,255]平均分成n
g组,则有(n
g-1)*s/255的整数部分即为n
ms。当然,相似度也有其他计算方法,可以综合考虑yuv,可以计算相关性,甚至可以专门训练网络来计算。更宽泛地,像素对于各个插值网格点而言的相似度衡量方法可以不同,只要能够保证插值的连续性。为了保证连续性,对单个网格点而言,以该网格点为中心的边长为2D的正方形区域内的第一图像的所有像素,相对于该网格点用同种相似度衡量方法。
插值方法可以是线性、cubic、lancoz等等方法。以线性为例,对第m个网格点,像素相似度s到第n
ms组和第n
ms+1组的距离分别为L
ms和L
ms+1,可记Am=netout[i
m,j
m,n
ms*n
m:(n
ms+1)*n
m]*L
ms+1/(L
ms+L
ms+1)+netout[i
m,j
m,(n
ms+1)*n
m:(n
ms+2)*n
m]*L
ms/(L
ms+L
ms+1)。已知像素和M个插值网格点的坐标,则用上各个Am进行双线性插值,便得到了像素的CCM矩阵。
使用网格划分法,网络输出的是局部的CCM矩阵。其实网络可以同步输出一个全局的CCM矩阵,然后对每个像素,局部CCM矩阵和全局CCM矩阵两者综合得到最终的CCM矩阵。综合方法可以是按比例线性相加。
可选的,终端得到每个像素的CCM矩阵之后,可以利用拍摄中相关的硬件参数进行重验复查校正。进一步优化CCM矩阵,或者在万一算出的CCM矩阵是很离谱的情况下(比如第一图像或第二图像异常,或者计算有错),终止方案。特别地,还可以同步用额外传感器记录环境信息,作为校验(可以是用来推断拍到的第一图像或第二图像是否正常)。
S45:终端基于第一图像中的像素(如每个像素)的CCM矩阵,优化第一图像,得到第三图像。具体的,对于第一图像中的任意一个像素(标记为目标像素)来说,终端将该目标像素的像素值乘以该目标像素的CCM矩阵,得到第三图像中的一个像素的像素值。其中,第三像素与第一像素中的目标像素对应于同一图像内容。
该方式1中,使用CCM矩阵方法,优化第一图像,有助于保证第一图像经处理后的纹理信息和清晰度不变(或者基本不变)。另外,上述S43~S44,先通过神经网络得到每个子图像的CCM矩阵,再通过传统的方法插值得到每个像素的CCM矩阵。这样,相对于现有技术中“直接基于神经网络获得每个像素的CCM矩阵”的技术方案,有助于降低计算复杂度,从而缩短计算时间,并有效控制了性能开销。
如图8A所示,为基于CCM矩阵优化第一图像的过程示意图。具体的过程描述可以参考上文,此处不再赘述。
如图8B所示,为基于CCM矩阵优化第一图像时,第一图像、第二图像和第三图像的对比示意图。由图8B可知,该技术方案可以将第二图像中的颜色光影信息“迁移”(具体不限于此)到了第一图像对对应位置上。并且,对比第三图像和第一图像可知, 第三图像与第一图像的纹理信息和清晰度基本保持一致,也就是说,优化前后第一图像原有的纹理信息和清晰度基本不变。并且,对比第三图像和第一图像可知,第三图像中绿植的鲜艳度和饱和度均优于第一图像,且第三图像中地面和石栏的亮度也优于第一图像,也就是说,优化前后第一图像原有的颜色光影程度提高了。
上文中均是以“先获取第一图像包括的多个子图像的CCM矩阵,再基于该多个子图像的CCM矩阵进行插值,得到第一图像中每个像素的CCM”进行说明的。可选的,也可以不对第一图像划分子图像,即以图像为粒度,获取第一图像的CCM矩阵,并将第一图像的CCM矩阵,作为第一图像中每个像素的CCM矩阵。这样,有助于降低计算复杂度,降低计算性能开销。
方式2:使用神经网络直接输出第三图像,即直接输出第三图像中每个图像的像素。如图9所示,具体可以包括以下步骤S51~S53:
S51~S52:可以参考上述S41~S42。
S53:终端使用第二神经网络和第二图像优化第一图像,得到第三图像。其中,第二神经网络用于利用图像风格较好的图像对图像风格较差的图像进行图像风格优化。
可选的,第二神经网络的输入信息包括目标张量,目标张量用于表征第一图像的纹理信息和颜色光影信息,以及第二图像的纹理信息和颜色光影信息。第二神经网络的输出信息包括第三图像。
可选的,第二神经网络可以是Unet型的AI网络。
可选的,如图10所示,为本申请实施例提供的一种第二神经网络的结构及逻辑示意图。
第二神经网络可以应用编解码思路,将网络左侧视为对第一图像的编码层,右侧为对第一图像的解码层。编码层部分包括纹理信息层和颜色光影信息层,其中,纹理信息层用于编码第一图像的纹理信息,颜色光影信息层用于编码第一图像的颜色光影信息。对编码层要求包括:当网络输入为两帧相同第一图像的纹理信息和颜色光影信息进行concat后得到张量时,颜色光影信息层如实记录第一图像的原始颜色光影信息,从而网络输出将严格等于第一图像本身。而当网络输入为第一图像的纹理信息和颜色光影信息,以及第二图像的纹理信息和颜色光影信息进行concat后得到张量时,网络会学到第二图像的颜色光影信息,从而引导第一图像的颜色光影信息层发生变化,但纹理信息层不受影响(或者在较小范围内受影响),最终网络输出便是预期的第一图像的颜色光影信息优化后的结果图(即上述第三图像)。
具体的,如图10所示,第二神经网络分别对目标张量中的第一子张量和第二子张量进行卷积运算,其中,第一子张量包括目标张量中的纹理信息,第二子张量包括目标张量中的颜色。具体实现时,可以执行多次卷积运算。然后,将基于第一子张量进行卷积运算得到的张量,以及基于第二子张量进行卷积运算得到的张量进行叠加,得到叠加后的张量。最后,将叠加后得到的张量、第一子张量和第二子张量进行叠加,得到第三图像。
这样设计网络的实际收益包括:在网络处理第一图像的颜色光影信息的同时,不改变第图像的纹理信息(或者第一图像的纹理信息改变较小)。此外,该网络从结构上将纹理信息和颜色光影信息解耦,这样,一方面,有助于使使网络处理更有针对性, 更准确而不容易引入伪影(artifacts),并保证改变颜色光影信息的同时,不影响纹理信息和清晰度;另一方面,有助于降低网络处理的性能开销。例如,假设纹理信息层经过卷积处理前后的深度为d1in和d1out,颜色光影信息层经过卷积处理前后的深度为d2in和d2out,解耦前经过卷积处理前后的总深度为d1in+d2in和d1out+d2out,那么,只要卷积核的尺寸相当,处理解耦前的卷积操作的性能开销,一般要比解耦后用两个卷积操作分别处理细节信息层和颜色光影信息层所用的性能开销要大许多。
该方式2中,是以图像为粒度,将图像的特征信息(包括纹理信息和颜色光影信息)输入第二神经网络执行优化步骤的。实际实现时,也可以以子图像(如图像块)为粒度,将第一图像和第二图像中,表示同一对应的图像块的特征信息(包括纹理信息和颜色光影信息)输入第二神经网络执行优化步骤的;然后,将第一图像和第二图像中相应子图像的优化结果进行拼接,得到第三图像。拼接时可能需要进行过渡融合,具体实现方式可以参考现有技术。
除了上述方式1和方式2之外,S104还可以使用传统的方法,比如求解优化方程、第一图像和第二图像之间的颜色光影信息匹配等方法实现。
如图11所示,为本申请实施例提供的一种图像处理方法的示意图。该方法应用于终端,终端包括第一摄像头和第二摄像头,第一摄像头的倍率不小于第二摄像头的倍率,该方法可以包括以下步骤:
S201:终端通过第一摄像头针对当前拍摄环境中的第一场景采集第一图像。可选的,当第一摄像头在当前拍摄环境中的感光度ISO大于第一阈值时,通过第一摄像头针对当前拍摄环境中的第一场景采集第一图像。
S202:终端通过第二摄像头针对第一场景采集第二图像;其中,第二图像的颜色比第一图像的颜色更接近第一场景的真实颜色。
可选的,第二图像与第一图像满足如下至少一种条件:第二图像的色度比第一图像的色度更接近第一场景的真实色度;第二图像的亮度比第一图像的亮度更接近第一场景的真实亮度。
S203:终端根据第二图像优化第一图像,得到第三图像;第三图像的颜色比第一图像的颜色更接近第一场景的真实颜色。
可选的,第三图像的图像内容与第一图像的图像内容相同。
本实施例尤其适用于所拍摄的图像的颜色与真实场景的颜色相差过大,即出现偏色现象的场景中。本实施例中第一摄像头和第二摄像头满足的条件,如何选择第一摄像头和第二摄像头,如何使用第二图像优化第一图像(或者优化融合后得到的第一图像)等,均可以参考上文。原则上,在不冲突的情况下,基于本实施例的任意可选的实现方式均可以参考上文。
可以理解的是,为了实现上述实施例中功能,终端包括了执行各个功能相应的硬件结构和/或软件模块。本领域技术人员应该很容易意识到,结合本申请中所公开的实施例描述的各示例的单元及方法步骤,本申请能够以硬件或硬件和计算机软件相结合的形式来实现。某个功能究竟以硬件还是计算机软件驱动硬件的方式来执行,取决于技术方案的特定应用场景和设计约束条件。
图12包含本申请的实施例提供的可能的图像处理装置的结构示意图。这些图像处 理装置可以用于实现上述方法实施例中终端的功能,因此也能实现上述方法实施例所具备的有益效果。在本申请的实施例中,该图像处理装置可以是如图1所示的终端100,还可以是应用于终端的模块(如芯片)。下文中以图像处理装置131是终端中的模块(如芯片)为例进行说明。
如图12所示终端13包括图像处理装置131第一摄像头132和第二摄像头133。第一摄像头132的倍率不小于第二摄像头133的倍率。图像处理装置131可以包括:控制单元1311和优化单元1312。
在一些实施例中,控制单元1311用于,用于当第一摄像头132在当前拍摄环境中的ISO大于第一阈值时,控制第一摄像头132针对当前拍摄环境中的第一场景采集第一图像,以及控制第二摄像头133针对第一场景采集第二图像。优化单元1312,用于根据第二图像优化第一图像,得到第三图像。例如,结合图3,控制单元1311可以用于执行S102,优化单元1312可以用于执行S104。其中,当第二图像的颜色优于第一图像的颜色时,第三图像的颜色优于第一图像的颜色;或者,当第二图像的对比度高于第一图像的对比度时,第三图像的对比度高于第一图像的对比度;或者,当第二图像的动态范围大于第一图像的动态范围时,第三图像的动态范围大于第一图像的动态范围。
可选的,第二图像的颜色优于第一图像的颜色,包括以下至少一种条件:第二图像的色度大于第一图像的色度;第二图像的亮度大于第一图像的亮度。
在另一些实施例中,控制单元1311,用于当第一摄像头132在当前拍摄环境中的感光度ISO大于第一阈值时,控制第一摄像头132针对当前拍摄环境中的第一场景采集第一图像,以及控制第二摄像头133针对第一场景采集第二图像;其中,第二图像的颜色比第一图像的颜色更接近第一场景的真实颜色;优化单元1312,用于根据第二图像优化第一图像,得到第三图像;第三图像的颜色比第一图像的颜色更接近第一场景的真实颜色。例如,结合图11,控制单元1311可以用于执行S201和S202,优化单元1312可以用于执行S203。
可选的,第二图像与第一图像满足如下至少一种条件:第二图像的色度比第一图像的色度更接近第一场景的真实色度;第二图像的亮度比第一图像的亮度更接近第一场景的真实亮度。
基于上述任一实施例,均提供了以下可选的实现方式:
可选的,第三图像的图像内容与第一图像的图像内容相同。
可选的,第二摄像头133的感光性能大于第一摄像头132的感光性能。
可选的,第二摄像头133的光圈大于第一摄像头132的光圈。
可选的,第二摄像头133采集第二图像时的曝光时长大于第一摄像头132采集第一图像时的曝光时长。
可选的,第二摄像头133采集第二图像时所使用的ISO大于第一摄像头132采集第一图像时所使用的ISO。
可选的,第二摄像头133的倍率范围包括[0.5,1),第一摄像头132的倍率范围包括[1,20]。
可选的,第二摄像头133的倍率是1,第一摄像头132的倍率范围包括(1,20]。
如图12所示,可选的,图像处理装置131还包括:降噪单元1313。
可选的,控制单元1311还用于,控制第一摄像头132针对第一场景采集N帧图像,N是大于等于1的整数;降噪单元1313,用于根据N帧图像以及第一图像进行多帧降噪,得到第四图像;优化单元1312具体用于,根据第二图像优化第四图像,得到第三图像。其中,第四图像的图像内容与第一图像的图像内容相同。
可选的,控制单元1311还用于,控制通过第一摄像头132和第二摄像头133分别针对第一场景采集N1帧图像和N2帧图像;其中,N1和N2均是大于等于1的整数;降噪单元1313,用于根据N1帧图像、N2帧图像和第一图像进行多帧降噪,得到第五图像;优化单元1312具体用于,根据第二图像优化第五图像,得到第三图像。其中,第五图像的图像内容与第一图像的图像内容相同。
可选的,终端13还包括第三摄像头134,第三摄像头134的倍率小于第一摄像头132的倍率;控制单元1311还用于,控制第一摄像头132和第三摄像头134分别针对第一场景采集N3帧图像和N4帧图像;其中,N3和N4均是大于等于1的整数;降噪单元1313,用于根据N3帧图像、N4帧图像和第一图像进行多帧降噪,得到第六图像;优化单元1312具体用于,根据第二图像优化第六图像,得到第三图像。其中,第六图像的图像内容与第一图像的图像内容相同。
如图12所示,可选的,图像处理装置131还包括:
可选的,选择单元1314,用于:
当终端13针对第一场景的拍摄倍率在[1,3)时,选择终端13中倍率为1的摄像头作为第一摄像头132。
或者,当终端13针对第一场景的拍摄倍率在[3,7)时,选择终端13中倍率为3的摄像头作为第一摄像头132。
或者,当终端13针对第一场景的拍摄倍率大于10时,选择终端13中倍率为10的摄像头作为第一摄像头132。
或者,当终端13针对第一场景的拍摄倍率在[7,10)时,选择终端13中倍率为10的摄像头作为第一摄像头,并选择终端中倍率为3的摄像头作为第三摄像头132。
可选的,选择单元1314,还用于:
当终端13针对第一场景的拍摄倍率在[1,3)时,选择终端13中倍率为1或者小于1的摄像头作为第二摄像头133;
或者,当终端13针对第一场景的拍摄倍率在[3,7)时,选择终端13中倍率为3、1、或者小于1的摄像头作为第二摄像头133;
或者,当终端13针对第一场景的拍摄倍率在[7,10)时,选择终端13中倍率为3、1、或者小于1的摄像头作为第二摄像头133;
或者,当终端13针对第一场景的拍摄倍率大于10时,选择终端13中倍率为10、3、1、或者小于1的摄像头作为第二摄像头133。
可选的,优化单元1312具体用于:获取第一图像中至少两个子图像的颜色校正矩阵CCM矩阵;其中,至少两个子图像包括第一子图像,第一子图像的CCM矩阵用于表征第一子图像的特征与第二图像中的第二子图像的特征之间的映射关系;第一子图像和第二子图像是同一对象的图像;特征包括颜色、对比度或动态范围中的至少一种; 基于至少两个子图像的CCM矩阵,得到第一图像中的像素的CCM矩阵;其中,第一图像包括第一像素,第一像素的CCM矩阵用于表征第一像素的特征与第二图像中的第二像素的特征之间的映射关系;第一像素和第二像素对应于同一图像内容;基于第一图像中的像素的CCM矩阵和第一图像,得到第三图像。例如,结合图6,优化单元1312可以用于执行S43~S45。
可选的,优化单元1312在执行获取第一图像中至少两个子图像的CCM矩阵时,具体用于:使用第一神经网络获取至少两个子图像的CCM矩阵;第一神经网络用于对第一图像的特征和纹理信息,以及第二图像的特征和纹理信息进行分析,得到至少两个子图像的CCM矩阵。
可选的,优化单元1312具体用于:使用第二神经网络和第二图像优化第一图像,得到第三图像;第二神经网络用于利用图像风格较好的图像对图像风格较差的图像进行图像风格优化。
关于上述可选方式的具体描述可以参见前述的方法实施例,此处不再赘述。此外,上述提供的任一种图像处理装置131的解释以及有益效果的描述均可参考上述对应的方法实施例,不再赘述。
作为示例,结合图1,上述控制单元1311、优化单元1312、降噪单元1313和选择单元1314中的任意一个单元的功能,均可以通过处理器110调用存储内部存储器121中的程度代码实现。
本申请另一实施例还提供一种计算机可读存储介质,该计算机可读存储介质中存储有指令,当指令在终端执行上述方法实施例所示的方法流程中该终端执行的各个步骤。
在一些实施例中,所公开的方法可以实施为以机器可读格式被编码在计算机可读存储介质上的或者被编码在其它非瞬时性介质或者制品上的计算机程序指令。
应该理解,这里描述的布置仅仅是用于示例的目的。因而,本领域技术人员将理解,其它布置和其它元素(例如,机器、接口、功能、顺序、和功能组等等)能够被取而代之地使用,并且一些元素可以根据所期望的结果而一并省略。另外,所描述的元素中的许多是可以被实现为离散的或者分布式的组件的、或者以任何适当的组合和位置来结合其它组件实施的功能实体。
在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。当使用软件程序实现时,可以全部或部分地以计算机程序产品的形式来实现。该计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行计算机执行指令时,全部或部分地产生按照本申请实施例的流程或功能。计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,计算机指令可以从一个网站站点、计算机、服务器或者数据中心通过有线(例如同轴电缆、光纤、数字用户线(digital subscriber line,DSL))或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。计算机可读存储介质可以是计算机能够存取的任何可用介质或者是包含一个或多个可以用介质集成的服务器、数据中心等数据存储设备。可用介质可以是磁性介质(例如, 软盘、硬盘、磁带),光介质(例如,DVD)、或者半导体介质(例如固态硬盘(solid state disk,SSD))等。
以上所述,仅为本发明的具体实施方式,但本发明的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本发明揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本发明的保护范围之内。因此,本发明的保护范围应以所述权利要求的保护范围为准。
Claims (35)
- 一种图像处理方法,其特征在于,所述方法应用于终端,所述终端包括第一摄像头和第二摄像头,所述第一摄像头的倍率不小于所述第二摄像头的倍率,所述方法包括:当所述第一摄像头在当前拍摄环境中的感光度ISO大于第一阈值时:通过所述第一摄像头针对所述当前拍摄环境中的第一场景采集第一图像;通过所述第二摄像头针对所述第一场景采集第二图像;根据所述第二图像优化所述第一图像,得到第三图像;其中,当所述第二图像的颜色优于所述第一图像的颜色时,所述第三图像的颜色优于所述第一图像的颜色;或者,当所述第二图像的对比度高于所述第一图像的对比度时,所述第三图像的对比度高于所述第一图像的对比度;或者,当所述第二图像的动态范围大于所述第一图像的动态范围时,所述第三图像的动态范围大于所述第一图像的动态范围。
- 根据权利要求1所述的方法,所述第二图像的颜色优于所述第一图像的颜色,包括以下至少一种条件:所述第二图像的色度大于所述第一图像的色度;所述第二图像的亮度大于所述第一图像的亮度。
- 根据权利要求1或2所述的方法,其特征在于,所述第三图像的图像内容与所述第一图像的图像内容相同。
- 根据权利要求1至3任一项所述的方法,其特征在于,所述第二摄像头的感光性能大于所述第一摄像头的感光性能。
- 根据权利要求1至4任一项所述的方法,其特征在于,所述第二摄像头的光圈大于所述第一摄像头的光圈。
- 根据权利要求1至5任一项所述的方法,其特征在于,所述第二摄像头采集所述第二图像时的曝光时长大于所述第一摄像头采集所述第一图像时的曝光时长。
- 根据权利要求1至6任一项所述的方法,其特征在于,所述第二摄像头采集所述第二图像时所使用的ISO大于所述第一摄像头采集所述第一图像时所使用的ISO。
- 根据权利要求1至7任一项所述的方法,其特征在于,所述第二摄像头的倍率范围包括[0.5,1),所述第一摄像头的倍率范围包括[1,20];或者,所述第二摄像头的倍率是1,所述第一摄像头的倍率范围包括(1,20]。
- 根据权利要求1至8任一项所述的方法,其特征在于,所述方法还包括:通过所述第一摄像头针对所述第一场景采集N帧图像,N是大于等于1的整数;根据所述N帧图像以及所述第一图像进行多帧降噪,得到第四图像;其中,所述第四图像的图像内容与所述第一图像的图像内容相同;所述根据所述第二图像优化所述第一图像,得到第三图像,包括:根据所述第二图像优化所述第四图像,得到所述第三图像。
- 根据权利要求1至8任一项所述的方法,其特征在于,所述方法还包括:通过所述第一摄像头和所述第二摄像头分别针对所述第一场景采集N1帧图像和N2帧图像;其中,N1和N2均是大于等于1的整数;根据所述N1帧图像、所述N2帧图像和所述第一图像进行多帧降噪,得到第五图像;其中,所述第五图像的图像内容与所述第一图像的图像内容相同;所述根据所述第二图像优化所述第一图像,得到第三图像,包括:根据所述第二图像优化所述第五图像,得到所述第三图像。
- 根据权利要求9或10所述的方法,其特征在于,所述方法还包括:当所述终端针对所述第一场景的拍摄倍率在[1,3)时,选择所述终端中倍率为1的摄像头作为所述第一摄像头;或者,当所述终端针对所述第一场景的拍摄倍率在[3,7)时,选择所述终端中倍率为3的摄像头作为所述第一摄像头;或者,当所述终端针对所述第一场景的拍摄倍率大于10时,选择所述终端中倍率为10的摄像头作为所述第一摄像头。
- 根据权利要求1至8任一项所述的方法,其特征在于,所述终端还包括第三摄像头,所述第三摄像头为所述终端中不同于所述第一摄像头和所述第二摄像头的摄像头,所述第三摄像头的倍率不大于所述第一摄像头的倍率;所述方法还包括:通过所述第一摄像头和所述第三摄像头分别针对所述第一场景采集N3帧图像和N4帧图像;其中,N3和N4均是大于等于1的整数;根据所述N3帧图像、所述N4帧图像和所述第一图像进行多帧降噪,得到第六图像;其中,所述第六图像的图像内容与所述第一图像的图像内容相同;所述根据所述第二图像优化所述第一图像,得到第三图像,包括:根据所述第二图像优化所述第六图像,得到所述第三图像。
- 根据权利要求12所述的方法,其特征在于,所述方法还包括:当所述终端针对所述第一场景的拍摄倍率在[7,10)时,选择所述终端中倍率为10的摄像头作为所述第一摄像头,并选择所述终端中倍率为3的摄像头作为所述第三摄像头。
- 根据权利要求11或13所述的方法,其特征在于,所述方法还包括:当所述终端针对所述第一场景的拍摄倍率在[1,3)时,选择所述终端中倍率为1或者小于1的摄像头作为所述第二摄像头;或者,当所述终端针对所述第一场景的拍摄倍率在[3,7)时,选择所述终端中倍率为3、1、或者小于1的摄像头作为所述第二摄像头;或者,当所述终端针对所述第一场景的拍摄倍率在[7,10)时,选择所述终端中倍率为3、1、或者小于1的摄像头作为所述第二摄像头;或者,当所述终端针对所述第一场景的拍摄倍率大于10时,选择所述终端中倍率为10、3、1、或者小于1的摄像头作为所述第二摄像头。
- 根据权利要求1至14任一项所述的方法,其特征在于,所述根据所述第二图像优化所述第一图像,得到第三图像,包括:获取所述第一图像中至少两个子图像的颜色校正矩阵CCM矩阵;其中,所述至少 两个子图像包括第一子图像,所述第一子图像的CCM矩阵用于表征所述第一子图像的特征与所述第二图像中的第二子图像的特征之间的映射关系;所述第一子图像和所述第二子图像是同一对象的图像;所述特征包括颜色、对比度或动态范围中的至少一种;基于所述至少两个子图像的CCM矩阵,得到所述第一图像中的像素的CCM矩阵;其中,所述第一图像包括第一像素,所述第一像素的CCM矩阵用于表征所述第一像素的特征与所述第二图像中的第二像素的特征之间的映射关系;所述第一像素和所述第二像素对应于同一图像内容;基于所述第一图像中的像素的CCM矩阵和所述第一图像,得到所述第三图像。
- 根据权利要求15所述的方法,其特征在于,所述获取所述第一图像中至少两个子图像的CCM矩阵,包括:使用第一神经网络获取所述至少两个子图像的CCM矩阵;所述第一神经网络用于对所述第一图像的特征和纹理信息,以及所述第二图像的特征和纹理信息进行分析,得到所述至少两个子图像的CCM矩阵。
- 根据权利要求1至16任一项所述的方法,其特征在于,所述根据所述第二图像优化所述第一图像,得到第三图像,包括:使用第二神经网络和所述第二图像优化所述第一图像,得到所述第三图像;所述第二神经网络用于利用图像风格较好的图像对图像风格较差的图像进行图像风格优化。
- 一种图像处理装置,其特征在于,所述装置应用于终端,所述终端还包括第一摄像头和第二摄像头,所述第一摄像头的倍率不小于所述第二摄像头的倍率,所述装置包括:控制单元,用于当所述第一摄像头在当前拍摄环境中的感光度ISO大于第一阈值时,控制所述第一摄像头针对所述当前拍摄环境中的第一场景采集第一图像,以及控制所述第二摄像头针对所述第一场景采集第二图像;优化单元,用于根据所述第二图像优化所述第一图像,得到第三图像;其中,当所述第二图像的颜色优于所述第一图像的颜色时,所述第三图像的颜色优于所述第一图像的颜色;或者,当所述第二图像的对比度高于所述第一图像的对比度时,所述第三图像的对比度高于所述第一图像的对比度;或者,当所述第二图像的动态范围大于所述第一图像的动态范围时,所述第三图像的动态范围大于所述第一图像的动态范围。
- 根据权利要求18所述的装置,所述第二图像的颜色优于所述第一图像的颜色,包括以下至少一种条件:所述第二图像的色度大于所述第一图像的色度;所述第二图像的亮度大于所述第一图像的亮度。
- 根据权利要求18或19所述的装置,其特征在于,所述第三图像的图像内容与所述第一图像的图像内容相同。
- 根据权利要求18至20任一项所述的装置,其特征在于,所述第二摄像头的感光性能大于所述第一摄像头的感光性能。
- 根据权利要求18至21任一项所述的装置,其特征在于,所述第二摄像头的光圈大于所述第一摄像头的光圈。
- 根据权利要求18至22任一项所述的装置,其特征在于,所述第二摄像头采集所述第二图像时的曝光时长大于所述第一摄像头采集所述第一图像时的曝光时长。
- 根据权利要求18至23任一项所述的装置,其特征在于,所述第二摄像头采集所述第二图像时所使用的ISO大于所述第一摄像头采集所述第一图像时所使用的ISO。
- 根据权利要求18至24任一项所述的装置,其特征在于,所述第二摄像头的倍率范围包括[0.5,1),所述第一摄像头的倍率范围包括[1,20];或者,所述第二摄像头的倍率是1,所述第一摄像头的倍率范围包括(1,20]。
- 根据权利要求18至25任一项所述的装置,其特征在于,所述控制单元还用于,控制所述第一摄像头针对所述第一场景采集N帧图像,N是大于等于1的整数;所述装置还包括:降噪单元,用于根据所述N帧图像以及所述第一图像进行多帧降噪,得到第四图像;其中,所述第四图像的图像内容与所述第一图像的图像内容相同;所述优化单元具体用于,根据所述第二图像优化所述第四图像,得到所述第三图像。
- 根据权利要求18至25任一项所述的装置,其特征在于,所述控制单元还用于,控制通过所述第一摄像头和所述第二摄像头分别针对所述第一场景采集N1帧图像和N2帧图像;其中,N1和N2均是大于等于1的整数;所述装置还包括:降噪单元,用于根据所述N1帧图像、所述N2帧图像和所述第一图像进行多帧降噪,得到第五图像;其中,所述第五图像的图像内容与所述第一图像的图像内容相同;所述优化单元具体用于,根据所述第二图像优化所述第五图像,得到所述第三图像。
- 根据权利要求26或27所述的装置,其特征在于,所述装置还包括选择单元,用于:当所述终端针对所述第一场景的拍摄倍率在[1,3)时,选择所述终端中倍率为1的摄像头作为所述第一摄像头;或者,当所述终端针对所述第一场景的拍摄倍率在[3,7)时,选择所述终端中倍率为3的摄像头作为所述第一摄像头;或者,当所述终端针对所述第一场景的拍摄倍率大于10时,选择所述终端中倍率为10的摄像头作为所述第一摄像头。
- 根据权利要求18至25任一项所述的装置,其特征在于,所述终端还包括第三摄像头,所述第三摄像头为所述终端中不同于所述第一摄像头和所述第二摄像头的摄像头,所述第三摄像头的倍率不大于所述第一摄像头的倍率;所述控制单元还用于,控制所述第一摄像头和所述第三摄像头分别针对所述第一 场景采集N3帧图像和N4帧图像;其中,N3和N4均是大于等于1的整数;所述装置还包括:降噪单元,用于根据所述N3帧图像、所述N4帧图像和所述第一图像进行多帧降噪,得到第六图像;其中,所述第六图像的图像内容与所述第一图像的图像内容相同;所述优化单元具体用于,根据所述第二图像优化所述第六图像,得到所述第三图像。
- 根据权利要求29所述的装置,其特征在于,所述装置还包括选择单元,用于:当所述终端针对所述第一场景的拍摄倍率在[7,10)时,选择所述终端中倍率为10的摄像头作为所述第一摄像头,并选择所述终端中倍率为3的摄像头作为所述第三摄像头。
- 根据权利要求28或30所述的装置,其特征在于,所述选择单元还用于:当所述终端针对所述第一场景的拍摄倍率在[1,3)时,选择所述终端中倍率为1或者小于1的摄像头作为所述第二摄像头;或者,当所述终端针对所述第一场景的拍摄倍率在[3,7)时,选择所述终端中倍率为3、1、或者小于1的摄像头作为所述第二摄像头;或者,当所述终端针对所述第一场景的拍摄倍率在[7,10)时,选择所述终端中倍率为3、1、或者小于1的摄像头作为所述第二摄像头;或者,当所述终端针对所述第一场景的拍摄倍率大于10时,选择所述终端中倍率为10、3、1、或者小于1的摄像头作为所述第二摄像头。
- 根据权利要求18至31任一项所述的装置,其特征在于,所述优化单元具体用于:获取所述第一图像中至少两个子图像的颜色校正矩阵CCM矩阵;其中,所述至少两个子图像包括第一子图像,所述第一子图像的CCM矩阵用于表征所述第一子图像的特征与所述第二图像中的第二子图像的特征之间的映射关系;所述第一子图像和所述第二子图像是同一对象的图像;所述特征包括颜色、对比度或动态范围中的至少一种;基于所述至少两个子图像的CCM矩阵,得到所述第一图像中的像素的CCM矩阵;其中,所述第一图像包括第一像素,所述第一像素的CCM矩阵用于表征所述第一像素的特征与所述第二图像中的第二像素的特征之间的映射关系;所述第一像素和所述第二像素对应于同一图像内容;基于所述第一图像中的像素的CCM矩阵和所述第一图像,得到所述第三图像。
- 根据权利要求32所述的装置,其特征在于,所述优化单元在执行所述获取所述第一图像中至少两个子图像的CCM矩阵时,具体用于:使用第一神经网络获取所述至少两个子图像的CCM矩阵;所述第一神经网络用于对所述第一图像的特征和纹理信息,以及所述第二图像的特征和纹理信息进行分析,得到所述至少两个子图像的CCM矩阵。
- 根据权利要求18至33任一项所述的装置,其特征在于,所述优化单元具体用于:使用第二神经网络和所述第二图像优化所述第一图像,得到所述第三图像;所述第二神经网络用于利用图像风格较好的图像对图像风格较差的图像进行图像风格优化。
- 一种终端,其特征在于,包括:处理器、存储器和至少两个摄像头,所述至少两个摄像头用于拍摄图像,所述存储器用于存储计算机程序和指令,所述处理器用于调用所述计算机程序和指令,与所述至少两个摄像头协同执行如权利要求1-17中任一项所述的方法。
Priority Applications (3)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| EP25192282.9A EP4682767A3 (en) | 2020-03-26 | 2021-01-13 | Image processing method and apparatus |
| EP21775021.5A EP4113970B1 (en) | 2020-03-26 | 2021-01-13 | Image processing method and device |
| US17/934,697 US12159373B2 (en) | 2020-03-26 | 2022-09-23 | Image processing method and apparatus |
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202010226094.X | 2020-03-26 | ||
| CN202010226094.XA CN113518172B (zh) | 2020-03-26 | 2020-03-26 | 图像处理方法和装置 |
Related Child Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| US17/934,697 Continuation US12159373B2 (en) | 2020-03-26 | 2022-09-23 | Image processing method and apparatus |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2021190097A1 true WO2021190097A1 (zh) | 2021-09-30 |
Family
ID=77891482
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2021/071489 Ceased WO2021190097A1 (zh) | 2020-03-26 | 2021-01-13 | 图像处理方法和装置 |
Country Status (4)
| Country | Link |
|---|---|
| US (1) | US12159373B2 (zh) |
| EP (2) | EP4113970B1 (zh) |
| CN (1) | CN113518172B (zh) |
| WO (1) | WO2021190097A1 (zh) |
Families Citing this family (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US11979832B2 (en) * | 2021-11-02 | 2024-05-07 | Snap Inc. | Eyewear having current consumption optimization of wireless system interface |
| CN116416171B (zh) * | 2021-12-31 | 2026-02-17 | 中科寒武纪科技股份有限公司 | 图像处理方法、装置、设备、存储介质及程序 |
| KR20240104591A (ko) * | 2022-12-28 | 2024-07-05 | 삼성전자주식회사 | 고해상도의 디지털 줌 영상을 생성하는 방법 및 장치 |
Citations (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN103856719A (zh) * | 2014-03-26 | 2014-06-11 | 深圳市金立通信设备有限公司 | 一种拍照方法及终端 |
| CN105208259A (zh) * | 2014-06-17 | 2015-12-30 | 中兴通讯股份有限公司 | 相机自动对焦优化的方法及相机 |
| CN106713762A (zh) * | 2017-01-19 | 2017-05-24 | 宇龙计算机通信科技(深圳)有限公司 | 图像处理方法及装置 |
| US20180070018A1 (en) * | 2016-09-07 | 2018-03-08 | Multimedia Image Solution Limited | Method of utilizing wide-angle image capturing element and long-focus image capturing element for achieving clear and precise optical zooming mechanism |
| CN109064415A (zh) * | 2018-07-09 | 2018-12-21 | 奇酷互联网络科技(深圳)有限公司 | 图像处理方法、系统、可读存储介质及终端 |
| CN109379522A (zh) * | 2018-12-06 | 2019-02-22 | Oppo广东移动通信有限公司 | 成像方法、成像装置、电子装置及介质 |
Family Cites Families (30)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| AU2009201637B2 (en) * | 2009-04-24 | 2011-08-11 | Canon Kabushiki Kaisha | Processing multi-view digital images |
| KR101633893B1 (ko) | 2010-01-15 | 2016-06-28 | 삼성전자주식회사 | 다중노출 영상을 합성하는 영상합성장치 및 방법 |
| US9473708B1 (en) * | 2013-08-07 | 2016-10-18 | Google Inc. | Devices and methods for an imaging system with a dual camera architecture |
| KR20150039019A (ko) * | 2013-10-01 | 2015-04-09 | 엘지전자 주식회사 | 이동 단말기 및 그 제어방법 |
| EP3164987B1 (en) * | 2014-07-01 | 2024-01-03 | Apple Inc. | Mobile camera system |
| WO2016103274A1 (en) * | 2014-12-22 | 2016-06-30 | Harman Finochem Limited | "a novel process for chiral resolution of highly pure (6r)-6-(dimethylamino)-4,4-diphenyl-3-heptanone from racemic methadone hydrochloride" |
| CN104883511A (zh) | 2015-06-12 | 2015-09-02 | 联想(北京)有限公司 | 图像处理方法以及电子设备 |
| US10382698B2 (en) * | 2015-09-30 | 2019-08-13 | Apple Inc. | Mobile zoom using multiple optical image stabilization cameras |
| CN105530436B (zh) | 2016-01-11 | 2019-05-14 | Oppo广东移动通信有限公司 | 拍摄参数调节方法和拍摄终端 |
| KR102603426B1 (ko) * | 2016-06-27 | 2023-11-20 | 삼성전자주식회사 | 이미지 처리장치 및 방법 |
| CN106454077B (zh) * | 2016-09-26 | 2021-02-23 | 宇龙计算机通信科技(深圳)有限公司 | 拍摄方法、拍摄装置和终端 |
| CN106534633A (zh) * | 2016-10-27 | 2017-03-22 | 深圳奥比中光科技有限公司 | 一种组合摄像系统、移动终端及图像处理方法 |
| JP6803982B2 (ja) * | 2016-11-03 | 2020-12-23 | 華為技術有限公司Huawei Technologies Co.,Ltd. | 光学撮像方法および装置 |
| CN106454131B (zh) * | 2016-11-29 | 2019-09-06 | Oppo广东移动通信有限公司 | 终端的拍照方法、装置及终端 |
| CN106911892A (zh) * | 2017-02-21 | 2017-06-30 | 深圳市金立通信设备有限公司 | 一种图像处理的方法及终端 |
| CN106851122B (zh) | 2017-02-27 | 2020-02-18 | 上海兴芯微电子科技有限公司 | 基于双摄像头系统的自动曝光参数的标定方法和装置 |
| US10142543B1 (en) * | 2017-05-12 | 2018-11-27 | Mediatek Inc. | Power reduction in a multi-sensor camera device by on-demand sensors activation |
| US10715727B2 (en) | 2017-05-16 | 2020-07-14 | Apple Inc. | Synthetic long exposure image with optional enhancement using a guide image |
| KR102318013B1 (ko) * | 2017-10-13 | 2021-10-27 | 삼성전자 주식회사 | 복수의 이미지들을 합성하는 전자장치 및 방법 |
| CN108198161A (zh) | 2017-12-29 | 2018-06-22 | 深圳开立生物医疗科技股份有限公司 | 一种双摄像头图像的融合方法、装置及设备 |
| CN111641778B (zh) | 2018-03-26 | 2021-05-04 | 华为技术有限公司 | 一种拍摄方法、装置与设备 |
| CN108337449A (zh) | 2018-04-12 | 2018-07-27 | Oppo广东移动通信有限公司 | 基于双摄像头的高动态范围图像获取方法、装置及设备 |
| US20190335150A1 (en) | 2018-04-26 | 2019-10-31 | Qualcomm Incorporated | Systems and methods for color balancing |
| CN110868548B (zh) * | 2018-08-27 | 2021-05-18 | 华为技术有限公司 | 一种图像处理方法及电子设备 |
| JP2020042578A (ja) | 2018-09-11 | 2020-03-19 | トヨタ自動車株式会社 | 画像処理装置 |
| US11170524B1 (en) * | 2019-06-21 | 2021-11-09 | Amazon Technologies, Inc. | Inpainting image feeds of operating vehicles |
| CN110430360A (zh) | 2019-08-01 | 2019-11-08 | 珠海格力电器股份有限公司 | 一种全景图像拍摄方法及装置、存储介质 |
| US10911677B1 (en) * | 2019-09-09 | 2021-02-02 | Apple Inc. | Multi-camera video stabilization techniques |
| ES2917214T3 (es) * | 2019-10-07 | 2022-07-07 | Optos Plc | Sistema de formación de imágenes oftálmicas |
| CN110855957B (zh) * | 2019-11-01 | 2022-05-10 | RealMe重庆移动通信有限公司 | 图像处理方法及装置、存储介质和电子设备 |
-
2020
- 2020-03-26 CN CN202010226094.XA patent/CN113518172B/zh active Active
-
2021
- 2021-01-13 WO PCT/CN2021/071489 patent/WO2021190097A1/zh not_active Ceased
- 2021-01-13 EP EP21775021.5A patent/EP4113970B1/en active Active
- 2021-01-13 EP EP25192282.9A patent/EP4682767A3/en active Pending
-
2022
- 2022-09-23 US US17/934,697 patent/US12159373B2/en active Active
Patent Citations (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN103856719A (zh) * | 2014-03-26 | 2014-06-11 | 深圳市金立通信设备有限公司 | 一种拍照方法及终端 |
| CN105208259A (zh) * | 2014-06-17 | 2015-12-30 | 中兴通讯股份有限公司 | 相机自动对焦优化的方法及相机 |
| US20180070018A1 (en) * | 2016-09-07 | 2018-03-08 | Multimedia Image Solution Limited | Method of utilizing wide-angle image capturing element and long-focus image capturing element for achieving clear and precise optical zooming mechanism |
| CN106713762A (zh) * | 2017-01-19 | 2017-05-24 | 宇龙计算机通信科技(深圳)有限公司 | 图像处理方法及装置 |
| CN109064415A (zh) * | 2018-07-09 | 2018-12-21 | 奇酷互联网络科技(深圳)有限公司 | 图像处理方法、系统、可读存储介质及终端 |
| CN109379522A (zh) * | 2018-12-06 | 2019-02-22 | Oppo广东移动通信有限公司 | 成像方法、成像装置、电子装置及介质 |
Non-Patent Citations (1)
| Title |
|---|
| See also references of EP4113970A4 |
Also Published As
| Publication number | Publication date |
|---|---|
| US20230014272A1 (en) | 2023-01-19 |
| CN113518172A (zh) | 2021-10-19 |
| US12159373B2 (en) | 2024-12-03 |
| EP4113970A1 (en) | 2023-01-04 |
| EP4113970A4 (en) | 2023-06-28 |
| EP4113970B1 (en) | 2025-08-27 |
| EP4682767A2 (en) | 2026-01-21 |
| CN113518172B (zh) | 2023-06-20 |
| EP4682767A3 (en) | 2026-03-25 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN112712470B (zh) | 一种图像增强方法及装置 | |
| CN109559270B (zh) | 一种图像处理方法及电子设备 | |
| CN113364971B (zh) | 图像处理方法和装置 | |
| CN113254120B (zh) | 数据处理方法和相关装置 | |
| WO2020168956A1 (zh) | 一种拍摄月亮的方法和电子设备 | |
| US12598381B2 (en) | Quick photographing method, electronic device, and computer-readable storage medium | |
| WO2021244295A1 (zh) | 拍摄视频的方法和装置 | |
| CN110602403A (zh) | 一种暗光下拍照的方法及电子设备 | |
| US12437197B2 (en) | Image processing method and related device | |
| CN113452969B (zh) | 图像处理方法和装置 | |
| WO2021052111A1 (zh) | 图像处理方法及电子装置 | |
| CN116069212A (zh) | 一种应用卡片的快速查看方法、电子设备及存储介质 | |
| US12159373B2 (en) | Image processing method and apparatus | |
| CN113542580B (zh) | 去除眼镜光斑的方法、装置及电子设备 | |
| CN113891009B (zh) | 曝光调整方法及相关设备 | |
| CN112150499B (zh) | 图像处理方法及相关装置 | |
| US20230351570A1 (en) | Image processing method and apparatus | |
| CN114887323A (zh) | 一种电子设备操控方法及电子设备 | |
| WO2022033344A1 (zh) | 视频防抖方法、终端设备和计算机可读存储介质 | |
| WO2024078275A1 (zh) | 一种图像处理的方法、装置、电子设备及存储介质 | |
| WO2023005298A1 (zh) | 基于多摄像头的图像内容屏蔽方法和装置 | |
| WO2024153043A1 (zh) | 一种投屏方法 | |
| CN114283195B (zh) | 生成动态图像的方法、电子设备及可读存储介质 | |
| WO2022057384A1 (zh) | 拍摄方法和装置 | |
| CN117714860B (zh) | 图像处理方法及电子设备 |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| 121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 21775021 Country of ref document: EP Kind code of ref document: A1 |
|
| ENP | Entry into the national phase |
Ref document number: 2021775021 Country of ref document: EP Effective date: 20220929 |
|
| NENP | Non-entry into the national phase |
Ref country code: DE |
|
| WWG | Wipo information: grant in national office |
Ref document number: 2021775021 Country of ref document: EP |