WO2023016044A1 - 视频处理方法、装置、电子设备和存储介质 - Google Patents
视频处理方法、装置、电子设备和存储介质 Download PDFInfo
- Publication number
- WO2023016044A1 WO2023016044A1 PCT/CN2022/094782 CN2022094782W WO2023016044A1 WO 2023016044 A1 WO2023016044 A1 WO 2023016044A1 CN 2022094782 W CN2022094782 W CN 2022094782W WO 2023016044 A1 WO2023016044 A1 WO 2023016044A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- video
- camera
- zoom
- exposure frame
- image
- Prior art date
Links
- 238000003672 processing method Methods 0.000 title claims abstract description 45
- 238000012545 processing Methods 0.000 claims abstract description 133
- 238000004422 calculation algorithm Methods 0.000 claims abstract description 77
- 238000000034 method Methods 0.000 claims description 71
- 230000008569 process Effects 0.000 claims description 59
- 230000035945 sensitivity Effects 0.000 claims description 10
- 238000004590 computer program Methods 0.000 claims description 6
- 230000006870 function Effects 0.000 description 24
- 230000004927 fusion Effects 0.000 description 24
- 230000000694 effects Effects 0.000 description 20
- CLOMYZFHNHFSIQ-UHFFFAOYSA-N clonixin Chemical compound CC1=C(Cl)C=CC=C1NC1=NC=CC=C1C(O)=O CLOMYZFHNHFSIQ-UHFFFAOYSA-N 0.000 description 16
- 238000006243 chemical reaction Methods 0.000 description 9
- 238000010586 diagram Methods 0.000 description 9
- 230000004044 response Effects 0.000 description 9
- 238000004364 calculation method Methods 0.000 description 7
- 230000000295 complement effect Effects 0.000 description 7
- 239000003086 colorant Substances 0.000 description 6
- 238000013507 mapping Methods 0.000 description 5
- 230000008859 change Effects 0.000 description 4
- 239000011159 matrix material Substances 0.000 description 4
- 239000004065 semiconductor Substances 0.000 description 4
- 238000005516 engineering process Methods 0.000 description 3
- 230000003287 optical effect Effects 0.000 description 3
- 229920002877 acrylic styrene acrylonitrile Polymers 0.000 description 2
- 238000013473 artificial intelligence Methods 0.000 description 2
- 238000012937 correction Methods 0.000 description 2
- 238000013500 data storage Methods 0.000 description 2
- 230000014509 gene expression Effects 0.000 description 2
- 230000006872 improvement Effects 0.000 description 2
- 230000002452 interceptive effect Effects 0.000 description 2
- 229910044991 metal oxide Inorganic materials 0.000 description 2
- 150000004706 metal oxides Chemical class 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 230000008520 organization Effects 0.000 description 2
- 230000006641 stabilisation Effects 0.000 description 2
- 238000011105 stabilization Methods 0.000 description 2
- 230000000007 visual effect Effects 0.000 description 2
- 241000023320 Luma <angiosperm> Species 0.000 description 1
- 230000009471 action Effects 0.000 description 1
- 238000003491 array Methods 0.000 description 1
- 230000006399 behavior Effects 0.000 description 1
- 230000005540 biological transmission Effects 0.000 description 1
- 238000013135 deep learning Methods 0.000 description 1
- -1 deltaG and deltaB Chemical compound 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 238000007499 fusion processing Methods 0.000 description 1
- 238000007726 management method Methods 0.000 description 1
- 238000005259 measurement Methods 0.000 description 1
- OSWPMRLSEDHDFF-UHFFFAOYSA-N methyl salicylate Chemical compound COC(=O)C1=CC=CC=C1O OSWPMRLSEDHDFF-UHFFFAOYSA-N 0.000 description 1
- 239000013307 optical fiber Substances 0.000 description 1
- 238000005457 optimization Methods 0.000 description 1
- 230000008447 perception Effects 0.000 description 1
- 230000009467 reduction Effects 0.000 description 1
- 238000009877 rendering Methods 0.000 description 1
- 238000005070 sampling Methods 0.000 description 1
- 239000007787 solid Substances 0.000 description 1
- 230000009466 transformation Effects 0.000 description 1
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/60—Control of cameras or camera modules
- H04N23/69—Control of means for changing angle of the field of view, e.g. optical zoom objectives or electronic zooming
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T3/00—Geometric image transformations in the plane of the image
- G06T3/40—Scaling of whole images or parts thereof, e.g. expanding or contracting
- G06T3/4053—Scaling of whole images or parts thereof, e.g. expanding or contracting based on super-resolution, i.e. the output image resolution being higher than the sensor resolution
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR 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
-
- 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/60—Control of cameras or camera modules
- H04N23/63—Control of cameras or camera modules by using electronic viewfinders
- H04N23/631—Graphical user interfaces [GUI] specially adapted for controlling image capture or setting capture parameters
-
- 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/60—Control of cameras or camera modules
- H04N23/63—Control of cameras or camera modules by using electronic viewfinders
- H04N23/631—Graphical user interfaces [GUI] specially adapted for controlling image capture or setting capture parameters
- H04N23/632—Graphical user interfaces [GUI] specially adapted for controlling image capture or setting capture parameters for displaying or modifying preview images prior to image capturing, e.g. variety of image resolutions or capturing parameters
-
- 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/60—Control of cameras or camera modules
- H04N23/667—Camera operation mode switching, e.g. between still and video, sport and normal or high- and low-resolution modes
-
- 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/60—Control of cameras or camera modules
- H04N23/67—Focus control based on electronic image sensor signals
-
- 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/73—Circuitry for compensating brightness variation in the scene by influencing the exposure time
-
- 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/70—Circuitry for compensating brightness variation in the scene
- H04N23/76—Circuitry for compensating brightness variation in the scene by influencing the image signals
-
- 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
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/10—Image acquisition modality
- G06T2207/10141—Special mode during image acquisition
- G06T2207/10144—Varying exposure
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR 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/20212—Image combination
- G06T2207/20221—Image fusion; Image merging
-
- 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/84—Camera processing pipelines; Components thereof for processing colour signals
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N9/00—Details of colour television systems
- H04N9/79—Processing of colour television signals in connection with recording
Definitions
- the present application relates to the technical field of video shooting, and in particular to a video processing method, device, electronic equipment and storage medium.
- a video processing method, device, electronic equipment and storage medium which can improve the problem of low resolution caused by high scaling factor.
- a video processing method including: in a first zoom mode or a second zoom mode, acquiring a video captured by a camera, the video includes alternating first exposure frame video images and second exposure frame video images, The exposure time of the video image of the first exposure frame is greater than the exposure time of the video image of the second exposure frame; in the first zoom mode, the video image of the first exposure frame is processed by a super-resolution algorithm, and the super-resolution algorithm processing is used to improve the resolution; In the first zoom mode, the video image of the first exposure frame processed by the super-resolution algorithm is fused with the video image of the second exposure frame not processed by the super-resolution algorithm to obtain a fused video, and the video image of the first exposure frame has The first weight; in the second zoom mode, the first exposure frame video image and the second exposure frame video image are fused, the first exposure frame video image has a second weight, and the fused video is obtained, the first weight is greater than the first weight Two weights.
- the video processing method further includes: if the currently used camera is the first camera, and the shooting zoom factor belongs to the first zoom range, and the brightness of the current shooting picture is greater than the first brightness threshold, enter the first A zoom mode; if the currently used camera is the first camera, and the shooting zoom factor belongs to the second zoom range, and the second zoom range is smaller than the first zoom range, enter the second zoom mode; if the currently used camera is the first camera , and the shooting zoom factor belongs to the first zoom range, and the brightness of the current shooting picture is not greater than the first brightness threshold, then enter the second zoom mode.
- the first camera When using the first camera to shoot within the first zoom range, if the brightness of the current shooting picture is greater than the first brightness threshold, it is considered to be a non-dark scene, and enter the first zoom mode for video recording. If the brightness of the current shooting picture is not greater than When the first brightness threshold is reached, it is considered to be a dark scene, and enters the second zoom mode for video recording.
- the first camera is used to shoot in the lower second zoom range, even if it belongs to a non-dark scene, it still enters the second zoom mode. model. That is to say, for the same first camera, enter the first zoom mode when zooming at a high magnification in non-dark light.
- the super-resolution algorithm applied in the first zoom mode can be used to improve the resulting in low resolution problems.
- entering the second zoom mode does not need to use the super-resolution algorithm, nor does it need to reduce the fusion weight of the video image of the first exposure frame.
- the video processing method further includes: if the currently used camera is the second camera, and the shooting zoom factor belongs to the third zoom range, and the ISO of the camera belongs to the first ISO range, the third zoom range is smaller than the first ISO range.
- Second zoom range the focal length of the second camera is smaller than the focal length of the first camera, then enter the first zoom mode; if the currently used camera is the second camera, and the shooting zoom factor belongs to the third zoom range, and the camera ISO belongs to the second ISO range, and the brightness of the current shooting picture is greater than the second brightness threshold, and the second ISO range is greater than the first ISO range, then enter the second zoom mode; if the currently used camera is the second camera, and the zoom factor of the camera belongs to the fourth zoom range, the fourth zoom range is smaller than the third zoom range, and the brightness of the current shooting picture is greater than the third brightness threshold, then enter the second zoom mode.
- the video processing method further includes: if the currently used camera is the second camera, and the shooting zoom factor belongs to the second zoom range, and the brightness of the shooting picture is not greater than the fourth brightness threshold, enter the first Second zoom mode; if the currently used camera is the second camera, and the shooting zoom factor belongs to the second zoom range, and the shooting distance is less than the distance threshold, enter the second zoom mode; if the currently used camera is the second camera, and the shooting If the zoom factor belongs to the first zoom range, and the brightness of the shooting picture is not greater than the first brightness threshold, then enter the second zoom mode; if the currently used camera is the second camera, and the shooting zoom factor belongs to the first zoom range, and the shooting distance If it is smaller than the distance threshold, enter the first zoom mode.
- the super-resolution algorithm applied in the first zoom mode can be used to improve the due to Problem with low resolution due to high zoom factor.
- the video processing method further includes: in the first zoom mode, processing the fused video line through the logarithmic LOG curve corresponding to the current sensitivity ISO of the camera to obtain the LOG video;
- the lookup table LUT processes the LOG video to obtain the video processed by the LUT.
- the video recording process use the LUT technology of the film industry to process the LOG video based on the LUT corresponding to the determined video style template or the LUT corresponding to the first zoom mode, so that the recorded video has the determined video style template Corresponding style effects to meet higher color matching requirements.
- the video processing method further includes: performing super-resolution algorithm processing on the video image of the first exposure frame includes: acquiring statistical information corresponding to the video image of the first exposure frame; combining the statistical information and the video image of the first exposure frame
- the RAW image of the image is used as an input for super-resolution algorithm processing to obtain the processed RAW image of the video image of the first exposure frame.
- the logarithmic LOG curve corresponding to the current sensitivity ISO of the camera is used to process the fused video lines to obtain the LOG video, and based on the color lookup table
- the LUT processes the LOG video to obtain the process of the video processed by the LUT
- the video processing method also includes a second video processing flow, and the second video processing flow includes: the pair of logarithmic LOG curves corresponding to the current sensitivity ISO of the camera
- the fused video line is processed to obtain the LOG video
- the LOG video is processed based on the lookup table LUT to obtain the video processed by the LUT
- the video processing method also includes: saving the video processed by the LUT in the first video processing flow ; Preview the video after LUT processing in the second video processing flow.
- the preview video and the final video can have the same visual effect, which is convenient for the user to directly preview the video based on the color-graded style.
- a video processing device including: a processor and a memory, the memory is used to store at least one instruction, and when the instruction is loaded and executed by the processor, the above video processing method is implemented.
- an electronic device including: a camera; and the above-mentioned video processing device.
- a computer-readable storage medium In a fourth aspect, a computer-readable storage medium is provided.
- a computer program is stored in the computer-readable storage medium, and when running on a computer, the computer is made to execute the above video processing method.
- the video captured by the camera includes alternating first exposure frame video images and second exposure frame video images, wherein the exposure time of the first exposure frame video images is longer than The exposure time of the second exposure frame video image, in the first zoom mode, fuse the first exposure frame video image processed by the super-resolution algorithm and the second exposure frame video image without the super-resolution algorithm processing, in the second In the zoom mode, the video image of the first exposure frame and the video image of the second exposure frame are fused. Compared with the second zoom mode, in the first zoom mode, the video image of the first exposure frame has a larger fusion weight.
- the improvement in the first zoom mode is longer The fusion weight of the image at the exposure time, so that the fused image can more clearly reflect the effect of the super-resolution algorithm, and improve the problem of low resolution caused by the high zoom factor.
- FIG. 1 is a structural block diagram of an electronic device in an embodiment of the present application
- FIG. 2 is a flowchart of a video processing method in an embodiment of the present application
- FIG. 3 is a flow chart of another video processing method in the embodiment of the present application.
- Fig. 4 is the schematic diagram of a kind of LOG curve in the embodiment of the present application.
- FIG. 5 is a schematic diagram of a user interface in a movie mode in an embodiment of the present application.
- FIG. 6 is a partial flowchart of another video processing method in the embodiment of the present application.
- FIG. 7 is a schematic diagram of the relationship between a cube and a tetrahedron in a cube interpolation space in an embodiment of the present application
- Fig. 8 is a UV plane schematic diagram
- FIG. 9 is another structural block diagram of an electronic device in the embodiment of the present application.
- FIG. 10 is a software structural block diagram of an electronic device in an embodiment of the present application.
- FIG. 11 is a schematic diagram of a user interface in a professional mode in an embodiment of the present application.
- the electronic device 100 may include a processor 110, a camera 193, a display screen 194, and the like. It can be understood that, the structure illustrated in the embodiment of the present invention does not constitute a specific limitation on the electronic device 100 . In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown in the figure, or combine certain components, or separate certain components, or arrange different components. The illustrated components can be realized in hardware, software or a combination of software and hardware.
- the processor 110 may include one or more processing units, for example: the processor 110 may include a graphics processing unit (graphics processing unit, GPU), an image signal processor (image signal processor, ISP), a controller, a video codec, Digital signal processor (digital signal processor, DSP), etc. Wherein, different processing units may be independent devices, or may be integrated in one or more processors.
- the controller can generate an operation control signal according to the instruction opcode and timing signal, and complete the control of fetching and executing the instruction.
- a memory may also be provided in the processor 110 for storing instructions and data.
- the electronic device 100 realizes the display function through the GPU, the display screen 194 , and the application processor.
- the GPU is a microprocessor for image processing, and is connected to the display screen 194 and the application processor. GPUs are used to perform mathematical and geometric calculations for graphics rendering.
- Processor 110 may include one or more GPUs that execute program instructions to generate or change display information.
- the electronic device 100 can realize the shooting function through the ISP, the camera 193 , the video codec, the GPU, the display screen 194 and the application processor.
- the ISP is used for processing the data fed back by the camera 193 .
- the light is transmitted to the photosensitive element of the camera through the lens, and 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 converts it into an image visible to the naked eye.
- ISP can also perform algorithm optimization on 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 located in the camera 193 .
- Camera 193 is used to capture still images or video.
- the object generates an optical image through the lens and projects it 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 light signal into an electrical signal, and then transmits the electrical signal to the ISP to convert it into a digital image signal.
- the ISP outputs the digital image signal to the DSP for processing.
- DSP converts digital image signals into standard RGB, YUV and other image signals.
- the electronic device 100 may include 1 or N cameras 193 , where N is a positive integer greater than 1.
- 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 electronic device 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 electronic device 100 may support one or more video codecs.
- the electronic device 100 can play or record videos in various encoding formats, for example: moving picture experts group (moving picture experts group, MPEG) 1, MPEG2, MPEG3, MPEG4 and so on.
- MPEG moving picture experts group
- the embodiment of the present application provides a video processing method.
- the video processing method may be executed by a processor 110, specifically an ISP or a combination of an ISP and other processors.
- the video processing method includes:
- step 101 obtain the video shot by the camera, the video includes alternating first exposure frame video images and second exposure frame video images, and the exposure time of the first exposure frame video images greater than the exposure time of the second exposure frame video image;
- the first zoom mode and the second zoom mode can be switched based on the user's selection, or can be automatically judged and switched based on the current picture of the video captured by the camera on the basis of the user's selection. Alternately use different exposure times for shooting, so as to facilitate subsequent fusion of video images based on different exposure times.
- step 102 perform super-resolution algorithm processing on the video image of the first exposure frame, and the super-resolution algorithm processing is used to improve the resolution;
- the first zoom mode is a mode suitable for a larger zoom factor.
- the higher zoom factor may cause the resolution of the shooting picture to be lower.
- the super-resolution algorithm is an underlying image processing algorithm that can map low-resolution images to high-resolution images in order to enhance image details.
- the super-resolution algorithm can be a method algorithm based on deep learning. First, it uses a large number of high-resolution images to accumulate and learn, and then learns low-resolution images. The learning model of high-resolution images is introduced for restoration, and finally the image is obtained. The high-frequency details can obtain better image restoration effect. Improve image recognition ability and recognition accuracy.
- the camera captures the video image of the first exposure frame and the video image of the second exposure frame at a relatively high frequency. Therefore, it may not be possible to apply the super-resolution algorithm to both the video image of the first exposure frame and the video image of the second exposure frame.
- the video image of the first exposure frame is selected for super-resolution algorithm processing , the video image of the second exposure frame is not processed by the super-resolution algorithm, so that the application of the super-resolution algorithm can be realized within an effective time;
- step 103 In the first zoom mode, go to step 103 to fuse the video image of the first exposure frame processed by the super-resolution algorithm and the video image of the second exposure frame not processed by the super-resolution algorithm to obtain the fused video, the first exposure
- the frame video image has a first weight
- every adjacent first exposure frame video image and second exposure frame video image are fused into a new frame of video image, and the fused video image includes the first exposure frame video image and
- the information in the video image of the second exposure frame, the fusion weight of the two frames of images can be adjusted, the video image of the first exposure frame has the first weight, that is to say, the fusion weight occupied by the video image of the first exposure frame in the two frames , the larger the first weight is, the more information the first exposure frame video image contains in the fused video image, and correspondingly, the smaller the weight occupied by the second exposure frame video image is, that is, the information of the fused video image
- the second video frame contains less information.
- step 104 In the second zoom mode, enter step 104, and fuse the video image of the first exposure frame and the video image of the second exposure frame.
- the video image of the first exposure frame has a second weight to obtain the fused video.
- the first weight is greater than the second weight. Two weights.
- the first weight is 70% and the second weight is 50%
- the second zoom mode in the process of fusing the video image of the first exposure frame and the video image of the second exposure frame, according to each 50%
- the weight of the fusion is performed, and the fused video image contains 50% of the information in the first exposure frame video image and 50% of the information in the second exposure frame video image; in the first zoom mode, the first exposure frame video
- the fusion is carried out according to the weight of 70% of the video image of the first exposure frame and the weight of 30% of the video image of the second exposure frame, and the fused video image contains 70% of the first The information in the exposed frame video image and 30% of the information in the second exposed frame video image.
- the video image of the first exposure frame has a larger fusion weight.
- the fused video image can more clearly reflect the effect of processing through the super-resolution algorithm.
- related video processing may continue to be performed to complete video recording.
- the video captured by the camera includes alternating first exposure frame video images and second exposure frame video images, wherein the exposure time of the first exposure frame video images is longer than the exposure time of the second exposure frame video images Time, in the first zoom mode, fuse the video image of the first exposure frame processed by the super-resolution algorithm with the video image of the second exposure frame not processed by the super-resolution algorithm, and in the second zoom mode, fuse the video image of the first exposure frame
- the frame video image is fused with the second exposure frame video image.
- the first exposure frame video image has a larger fusion weight.
- the fusion weight of the image with a longer exposure time is increased in the first zoom mode. In order to make the fused image more clearly reflect the effect of the super-resolution algorithm, and improve the problem of low resolution caused by the high zoom factor.
- the video processing method further includes: if the currently used camera is the first camera, and the shooting zoom factor belongs to the first zoom range, and the brightness of the current shooting picture is greater than the first brightness threshold, enter the first A zoom mode; if the currently used camera is the first camera, and the shooting zoom factor belongs to the second zoom range, and the second zoom range is smaller than the first zoom range, enter the second zoom mode; if the currently used camera is the first camera , and the shooting zoom factor belongs to the first zoom range, and the brightness of the current shooting picture is not greater than the first brightness threshold, then enter the second zoom mode.
- the shooting zoom factor is related to the equivalent focal length.
- the first zoom range is (7x, 15x]
- x represents the multiple, that is, the first zoom range is 7 times to 15 times, including 10 times
- the extreme point and the extreme point of 15 times, the equivalent focal length range corresponding to the first zoom range is greater than 190mm;
- the second zoom range is [3.5x, 7x), that is, the second zoom range is 3.5 times to 7 times, Including the extreme point of 3.5 times, excluding the extreme point of 7 times, the equivalent focal length range corresponding to the second zoom range is [95mm, 190mm).
- An electronic device such as a mobile phone, may have multiple cameras, and the first camera may be, for example, a telephoto camera.
- Table 1 illustrates a zoom mode corresponding to different parameters in the embodiment of the present application.
- the super-resolution algorithm applied in the first zoom mode can be used to improve the resulting in low resolution problems.
- entering the second zoom mode does not need to use the super-resolution algorithm, nor does it need to reduce the fusion weight of the video image of the first exposure frame.
- the video processing method further includes: if the currently used camera is the second camera, and the shooting zoom factor belongs to the third zoom range, and the ISO of the camera belongs to the first ISO range, the third zoom range is smaller than the first ISO range.
- Second zoom range the focal length of the second camera is smaller than the focal length of the first camera, then enter the first zoom mode; if the currently used camera is the second camera, and the shooting zoom factor belongs to the third zoom range, and the camera ISO belongs to the second ISO range, and the brightness of the current shooting picture is greater than the second brightness threshold, and the second ISO range is greater than the first ISO range, then enter the second zoom mode; if the currently used camera is the second camera, and the zoom factor of the camera belongs to the fourth zoom range, the fourth zoom range is smaller than the third zoom range, and the brightness of the current shooting picture is greater than the third brightness threshold, then enter the second zoom mode.
- the fourth zoom range is [1x, 1.8x], that is, the fourth zoom range is 1x to 1.8x, including extreme points, and the equivalent focal length range corresponding to the fourth zoom range is (27mm, 48mm).
- the second camera is the main camera in the mobile phone, the focal length of the main camera is smaller than that of the telephoto camera.
- the first ISO range is less than or equal to 1600, and the second ISO range is greater than 1600.
- the second camera uses the second ISO range
- in the third zoom range if the brightness of the current shooting picture is greater than the second brightness threshold, it is considered to belong to a non-low light scene; otherwise, if the brightness of the current shooting picture is not greater than the second brightness threshold
- the fourth zoom range if the brightness of the current shooting picture is greater than the third brightness threshold, it is considered to be a non-low light scene.
- the second brightness threshold may be equal to or not equal to the third brightness threshold.
- the embodiment of the present application does not limit the specific implementation of the third zoom mode.
- image processing can be further optimized for low-light scenes.
- the embodiment of the present application does not limit the specific image processing process of the second zoom mode. In the second zoom mode, it can be further divided into different sub-modes to apply different algorithm processing.
- OIS Optical Image Stabilization
- EIS Electronic Image Stabilization
- Table 1 it can be seen that the second camera can also work in the fifth zoom range, the fifth zoom range is [0.9x, 1x), and the corresponding equivalent focal length range is [23mm, 27mm), at this time, in The above-mentioned second zoom mode can be entered in the whole scene.
- the electronic device in the embodiment of the present application also includes a third camera, the third camera can be a super wide-angle camera, the focal length of the third camera is smaller than the focal length of the second camera, the third camera can work with the sixth zoom range, the sixth zoom range is [0.4x, 0.9x), and the corresponding equivalent focal length range is [11mm, 23mm).
- the video processing method further includes: if the currently used camera is the second camera, and the shooting zoom factor belongs to the second zoom range, and the brightness of the shooting picture is not greater than the fourth brightness threshold, enter the first Second zoom mode; if the currently used camera is the second camera, and the shooting zoom factor belongs to the second zoom range, and the shooting distance is less than the distance threshold, enter the second zoom mode; if the currently used camera is the second camera, and the shooting If the zoom factor belongs to the first zoom range, and the brightness of the shooting picture is not greater than the first brightness threshold, then enter the second zoom mode; if the currently used camera is the second camera, and the shooting zoom factor belongs to the first zoom range, and the shooting distance If it is smaller than the distance threshold, enter the first zoom mode.
- the second camera when the second camera applies the second zoom range, it can be applied to dark scenes, that is, the brightness of the current shooting picture is not greater than the fourth brightness threshold, and the fourth brightness threshold can be the same as other brightness thresholds, or can be different from other brightness thresholds.
- you can enter the second zoom mode and it can also be applied to close-up shooting scenarios, that is, the shooting distance is less than the preset distance, for example, the shooting distance is ⁇ 1200cm, which can be considered as a close-up shooting scene, and you can enter the second zoom mode at this time.
- Two zoom modes Two zoom modes.
- the second camera When the second camera uses the first zoom range, it can be applied to a dark scene, that is, the brightness of the currently captured image is not greater than the first brightness threshold, and at this time, the second zoom mode can be entered.
- the second camera uses the first zoom range, it can be applied to a close-range shooting scene, for example, the shooting distance is ⁇ 1200 cm, and at this time, the first zoom scene can be entered. That is to say, in the close-up shooting scene of the second camera in the first zoom range and the second zoom range, if the zoom factor is relatively high, that is, it belongs to the first zoom range, the super zoom applied in the first zoom mode can The sub-algorithm improves the problem of low resolution due to high zoom factor.
- the video processing method further includes:
- step 105 process the fused video line through the logarithmic LOG curve corresponding to the current sensitivity ISO of the camera, and obtain the LOG video;
- Figure 4 illustrates a LOG curve, where the abscissa is a linear signal, represented by a 16-bit code value Code Value, and the ordinate is the LOG signal processed by the LOG curve, represented by a 10-bit code value.
- the signal input of the camera can be used to encode the information in the dark area to the middle tone (as shown in the steep part of the curve in Figure 4), forming a 10-bit signal output, which conforms to the human eye's LOG sensing rule for light, and maximizes the The dark information is preserved, and the LOG video can use the limited bit depth to maximize the details of shadows and highlights.
- the ASA in Figure 4 is the sensitivity, and different ASAs correspond to different ISOs, and the two belong to different standards.
- Step 106 process the LOG video based on the color look-up table (Look Up Table, LUT), and obtain the video processed by the LUT.
- LUT Color look-up table
- the essence of LUT is a mathematical conversion model, by using LUT, one set of RGB values can be output as another set of RGB values, thereby changing the exposure and color of the picture.
- the first zoom mode for example, there are two LUT-based processing methods. One is to only use the LUT to process the video according to the characteristics of the scene. In this method, the corresponding LUT; the other is to use LUT to apply different video styles, the following will take the second method as an example to illustrate. LUTs corresponding to different video styles can be pre-generated. Before the electronic device records a video, a video style template can be determined first.
- the video style template can be determined based on the user's choice, or based on artificial intelligence (AI), according to the current
- AI artificial intelligence
- the user operates the mobile phone to enter the shooting interface in the first zoom mode.
- the movie mode in the corresponding movie mode interface, including multiple video style template options, for example including "A" movie style template, "B" movie style template and "C” movie style template
- the user interface shown in Figure 5 Only one "A" movie style template is shown in . It is understandable that multiple different movie style templates can be displayed side by side in the user interface.
- the LUTs corresponding to different movie style templates can be pre-generated based on the corresponding movie color matching style.
- the color conversion of LUT has the style characteristics of the corresponding movie.
- the color matching style of "A" movie is complementary color.
- Complementary color refers to the contrast effect of two corresponding colors. Emphasize the contrast to enhance the bright and prominent effect. Usually, two contrasting colors symbolize conflicting behaviors. Through the presentation of external complementary colors, it can be used to express the character's inner conflict or exhausted state.
- "A" movie style template The corresponding LUT is used to convert the color mapping to make the complementary colors more obvious, so as to simulate the color matching style of the "A" movie.
- the mobile phone when the user operates the mobile phone to enter the movie mode, the mobile phone will obtain the picture taken by the current camera, and based on the AI algorithm, determine the scene corresponding to the picture and determine the scene corresponding to the scene.
- the recommended video style template for example, if it is recognized that the subject of the currently captured picture is a young female character, the corresponding recommended video style template is determined according to the algorithm as the "C" movie style template, and the movie "C" has a young female character as the theme movie, its corresponding LUT can simulate the color matching style of the movie "C"; It is a movie with city streets as the main scene, and its corresponding LUT can simulate the color matching style of the "B” movie. In this way, a video style template matching the current scene can be automatically recommended for the user. Film styles can be pre-extracted to produce LUTs suitable for mobile electronics.
- Different LUTs are applied to electronic equipment, and related modules in the electronic equipment can be adapted to adapt to different styles of LUTs.
- the predetermined video style template is a gray-tone video style template
- the characteristics of gray-tone images In order to make the picture have a strong sense of texture, low saturation, no more color interference except for the color of the character's skin, and cooler dark parts, based on these characteristics, the electronic device can adjust the relevant module parameters during the video recording process. Make adjustments to keep the texture in the picture, do not do strong denoising and sharpening, properly reduce the saturation of the picture, keep the skin color in the picture true to restore, and adjust the dark part of the picture to cool colors.
- the LUT technology of the film industry is used to process the LOG video based on the LUT corresponding to the determined video style template or the LUT corresponding to the first zoom mode, so that all The recorded video has the style effect corresponding to the determined video style template, so as to meet the higher color grading requirements.
- performing super-resolution algorithm processing on the video image of the first exposure frame includes: acquiring statistical information corresponding to the video image of the first exposure frame;
- the RAW image of an exposure frame video image is used as an input to perform super-resolution algorithm processing, and the processed RAW image of the first exposure frame video image is obtained.
- the RAW image is the original data that the sensor in the camera converts the captured light source signal into a digital signal.
- the electronic device includes a camera 193, a super-resolution algorithm module 31 and a statistical information acquisition module 32, wherein the statistical information acquisition Module 32 can be the module in ISP, obtains first exposure frame video image and second exposure frame video image by camera 193 in step 101, and this first exposure frame video image is transmitted to statistical information acquisition module 32 and super Sub-algorithm module 31, wherein, statistical information acquisition module 32 obtains the stats statistical information corresponding to the image according to the first exposure frame video image, and transmits the statistical information to the super-resolution algorithm module 31, and transmits it to the super-resolution algorithm module 31
- the first exposure frame video image can be a RAW image
- the super-resolution algorithm module 31 uses the RAW image as input, and simultaneously processes the first frame of video image based on the obtained corresponding statistical information, obtains the processed RAW image and outputs it to the subsequent process.
- the super-resolution algorithm module 31 performs the process of super-resolution algorithm processing in the RAW domain during the entire image processing process.
- the process of super-resolution algorithm processing It can also be done eg in the YUV domain.
- Bayer field Each lens on a digital camera has a light sensor to measure the brightness of the light, but to obtain a full-color image, generally three light sensors are required to obtain the three primary colors of red, green and blue information, and in order to reduce the cost and volume of digital cameras, manufacturers usually use CCD or CMOS image sensors.
- CCD or CMOS image sensors usually use CCD or CMOS image sensors.
- the original image output by CMOS image sensors is in Bayer domain RGB format, and a single pixel contains only one color value. To obtain the gray value of the image, it is necessary to interpolate the complete color information of each pixel, and then calculate the gray value of each pixel.
- the Bayer domain refers to a raw image format inside a digital camera.
- the Raw domain or Raw format refers to unprocessed images. Further, the Raw image can be understood as that the photosensitive element of the camera such as Complementary Metal Oxide Semiconductor (Complementary Metal Oxide Semiconductor, CMOS) or Charge-coupled Device (Charge-coupled Device, CCD) converts the captured light source signal into digital The raw data of the signal.
- CMOS Complementary Metal Oxide Semiconductor
- CCD Charge-coupled Device
- a RAW file is a record of the original information of the digital camera sensor, while recording some metadata (Metadata, such as ISO (International Organization for Standardization, International Organization for Standardization) settings, shutter speed, aperture value) generated by the camera. , white balance, etc.) files.
- the Raw domain is a format that has not been processed by the ISP nonlinearly and has not been compressed.
- the full name of Raw format is RAW Image Format.
- YUV is a color encoding method that is often used in various video processing components. YUV takes human perception into account when encoding photos or videos, allowing bandwidth reduction for chroma. YUV is a type of compiling true-color color space (color space). The proper nouns such as Y'UV, YUV, YCbCr, and YPbPr can all be called YUV, and they overlap with each other. Among them, "Y” represents the brightness (Luminance or Luma), that is, the grayscale value, "U” and “V” represent the chroma (Chrominance or Chroma), which are used to describe the color and saturation of the image, and are used to specify the color of the pixel .
- YUV is divided into two formats, one is: packed formats, which store Y, U, and V values into a Macro Pixels array, which is similar to the storage method of RGB.
- the other is: planar formats, which store the three components of Y, U, and V in different matrices.
- Planar formats means that each Y component, U component and V component are organized in an independent plane, that is to say, all U components are behind the Y component, and V components are behind all U components.
- step 106 process LOG video based on color lookup table (Look Up Table, LUT), the process of obtaining the video after LUT processing comprises:
- 3D-LUT is a color mapping relationship commonly used in the film industry. It can convert any input RGB pixel value into corresponding other RGB pixel values, such as inputting 12bit RGB Video image, output 12bit RGB video image after LUT processing and mapping.
- the LOG video is used as the input in the LUT processing process, and the pixel points mapped by the LUT processing are obtained for each pixel in the LOG video screen, which can realize the process of processing the LOG video through the LUT.
- Each pixel in the LOG video belongs to the cube in the above cube interpolation space, and the cube is divided into 6 tetrahedrons.
- the pixel value is converted to the pixel value processed by LUT.
- interpolation is performed according to the tetrahedron to which each pixel point belongs, and the pixel value is converted to the pixel value processed by LUT. After the pixel value.
- the mapped RGB pixel value can be directly obtained, that is, the pixel value can be directly mapped and converted into The corresponding pixel value, and if the pixel is located between the vertices of the cube, interpolate according to the tetrahedron to which the pixel belongs.
- the cube has the 0th to 7th vertices, which are represented by numbers 0 to 7 in Figure 7, and the direction from the 0th vertex to the first vertex is blue B
- the coordinate axis direction of the channel, the direction from the 0th vertex to the 4th vertex is the coordinate axis direction of the red R channel
- the direction from the 0th vertex to the second vertex is the coordinate axis direction of the green G channel
- the 2nd vertex and the 3rd vertex are located on the same plane
- the 1st vertex, the 3rd vertex, the 5th vertex and the 7th vertex are located on the same plane
- the 4th vertex, the 5th vertex, the 6th vertex and the 7th vertex are located on the same plane
- the 3rd vertex is located on the same plane.
- Vertex 0, Vertex 2, Vertex 4 and Vertex 6 are on the same plane; Vertex 0, Vertex 1, Vertex 5 and Vertex 7 form the first tetrahedron, Vertex 0, Vertex 1, Vertex 3
- the vertex and the 7th vertex form the second tetrahedron, the 0th vertex, the 2nd vertex, the 3rd vertex and the 7th vertex form the third tetrahedron, the 0th vertex, the 4th vertex, the 5th vertex and the 7th vertex form
- the 0th vertex, the 4th vertex, the 6th vertex and the 7th vertex form the fifth tetrahedron
- the 0th vertex, the 2nd vertex, the 6th vertex and the 7th vertex form the sixth tetrahedron;
- the coordinates of the i-th vertex are (Ri, Gi, Bi)
- the value of i is 0, 1, 2, 3, ..., 7, and the pixel value of the pixel value of the
- the above-mentioned pixel points that do not correspond to the vertices of the cube are interpolated according to the tetrahedron to which each pixel point belongs, and the process of converting the pixel value into the pixel value after LUT processing includes:
- VE(R, G, B) VE(R0, G0, B0)+(delta_valueR_E ⁇ deltaR+delta_valueG_E ⁇ deltaG+delta_valueB_E ⁇ deltaB+(step_size>1))/(step_size);
- VE(R0, G0, B0) is the E channel pixel value of the 0th vertex (R0, G0, B0) after LUT processing, and E is R, G and B;
- delta_valueR_E is the difference between the two vertices in the direction of the coordinate axis of the R channel corresponding to the tetrahedron to which the current pixel belongs, and the difference between the pixel values of the E channel after LUT processing.
- delta_valueB_E is the difference between the pixel values of the E channel after the LUT processing of two vertices in the direction of the coordinate axis of the tetrahedron to which the current pixel belongs corresponding to the B channel;
- deltaR is the difference between the R value in the current pixel point (R, G, B) and the R0 value in the 0th vertex (R0, G0, B0)
- deltaG is the G value in the current pixel point (R, G, B).
- deltaB is the difference between the B value in the current pixel point (R, G, B) and the B0 value in the 0th vertex (R0, G0, B0).
- step_size is the side length of the cube.
- step_size>>1 means step_size is shifted to the right by one bit.
- deltaR R-R0
- deltaG G-G0
- deltaB B-B0
- which tetrahedron the current pixel belongs to can be judged according to the relationship between deltaR, deltaG and deltaB.
- deltaB ⁇ deltaR and deltaR ⁇ deltaG determine that the current pixel belongs to the first tetrahedron; if deltaB ⁇ deltaG and deltaG ⁇ deltaR, determine that the current pixel belongs to the second tetrahedron; if deltaG ⁇ deltaB and deltaB ⁇ deltaR , it is determined that the current pixel point belongs to the third tetrahedron; if deltaR ⁇ deltaB and deltaB ⁇ deltaG, then it is determined that the current pixel point belongs to the fourth tetrahedron; if deltaR ⁇ deltaG and deltaG ⁇ deltaB, then it is determined that the current pixel point belongs to the fourth tetrahedron Five tetrahedrons; if the relationship among deltaR, deltaG, and deltaB does not belong to the above conditions of the first to fifth tetrahedrons, it is determined that the current pixel point belongs to the sixth tetrahedron.
- delta_valueR_E is the tetrahedron to which the current pixel point belongs
- delta_valueR_R VR(R5, G5, B5)-VR(R1, G1, B1)
- delta_valueG_R VR( R7, G7, B7)-VR(R5, G5, B5)
- delta_valueB_R VR(R1, G1, B1)-VR(R0, G0, B0)
- VR(R, G, B) VR(R0, G0 , B0)+(delta_valueR_R ⁇ deltaR+delta_valueG_R ⁇ deltaG+delta_valueB_R ⁇ deltaB+
- the process of processing the LOG video based on the color look-up table (Look Up Table, LUT) in the above step 106 to obtain the video processed by the LUT it also includes: converting the LOG video from RGB
- the LOG video of color space is converted into the LOG video of YUV color space;
- the LOG video of YUV color space is carried out YUV denoising process, obtains the LOG video after denoising, applies the LOG video of LUT to be through YUV denoising in step 106 After the LOG video.
- the LOG video obtained in step 105 can reflect the details of the dark part, but at the same time, the noise of the dark part will be amplified, that is, noise will be introduced. Therefore, after the LOG video can be converted into a YUV color space, YUV denoising can be performed, and the noise can be reduced through an algorithm. to improve video image quality.
- the process of processing the LOG video based on the color look-up table (Look Up Table, LUT) to obtain the video after LUT processing in the above step 106 it also includes: denoising the LOG video is converted into the LOG video of RGB color space by the LOG video of YUV color space;
- LOG video is processed, obtain after the process of the video after LUT processing , also includes: converting the LUT-processed video in the RGB color space to a video in the YUV color space.
- step 106 Because the process of processing the LOG video based on the LUT in step 106 is realized based on the RGB color space, therefore, before the step 105, the video in the YUV color space is converted to the video in the RGB color space, and after the step 106, then Reconvert video in RGB color space to video in YUV color space.
- YUV also known as YCbCr
- YCbCr is a color coding method used by the European television system.
- three-tube color cameras or color CCD cameras are usually used to capture images, and then the obtained color image signals are separated, amplified and corrected to obtain RGB signals, and then the brightness signals Y and Y are obtained through a matrix conversion circuit.
- Two color-difference signals B-Y (ie U) and R-Y (ie V), and finally the sending end encodes the three signals separately and sends them out on the same channel.
- This color representation method is the YUV color space.
- YCbCr is the specific implementation of the YUV model, which is actually a scaled and offset replica of YUV.
- Y has the same meaning as Y in YUV, and both Cb and Cr refer to color, but they are different in the way of expression.
- YCbCr is the most widely used member in computer systems, and its application fields are very wide. Both JPEG and MPEG use this format. Generally speaking, YUV mostly refers to YCbCr.
- the UV plane is shown in Figure 8.
- RGB and YUV color spaces can be realized by a 3x3 matrix:
- the electronic device may specifically include a camera 193, a super-resolution algorithm module 31, a statistical information acquisition module 32, an anti-mosaic Demosaic module 21, a deformation module 22, a fusion module 23, a noise Processing module 24, color correction matrix (Color Correction Matrix, CCM) module 25, global tone mapping (Global Tone Mapping, GTM) module 26, scaling Scaler module 27, YUV denoising module 28, LUT processing module 29, for example, in video
- the camera 193 captures the video image of the first exposure frame and the video image of the second exposure frame, and the exposure time corresponding to the video image of the first exposure frame is longer than the exposure time corresponding to the video image of the second exposure frame.
- the statistical information acquisition module 32 obtains the statistical information corresponding to the video image of the first exposure frame
- the super-resolution algorithm module 31 uses the statistical information and the RAW image of the video image of the first exposure frame as input to perform super-resolution algorithm processing, and obtains the super-resolution algorithm.
- the RAW image of the first exposure frame video image processed by the sub-algorithm, the first exposure frame video image after the super-resolution algorithm processing and the second exposure frame video image without the super-resolution algorithm processing are respectively processed by the anti-mosaic module 21 , the image is converted from the RAW domain to the RGB domain, and then the two-way video images are processed by the deformation warp module 22 respectively, and the effects of alignment and anti-shake are realized through the deformation of the video images, and then the two-way video images are processed by the fusion module 23,
- the two video images are fused into one, and the fused data is divided into two paths.
- the video processing method includes a first video processing flow S1 and a second video processing flow S2, and one of the paths processed by the fusion module 23 enters the first The video processing flow S1, another way enters the second video processing flow S2.
- the process of converting the video captured by the camera into a video in a wide color gamut color space processing the video through a logarithmic LOG curve to obtain a LOG video, and processing the LOG video based on the LUT The process of processing.
- the first video processing flow S1 includes, the video taken by the camera 193 from the fusion module 23 is denoised by the noise processing module 24, and then processed by the CCM module 25 to convert the video into RGB wide color gamut color space, and then the logarithmic LOG curve corresponding to the current sensitivity ISO of the camera is used to process the fused video line through the GTM module 26 to obtain the process of the LOG video, and then the video is zoomed through the scaling module 27, and then through the YUV
- the denoising module 28 performs YUV denoising on the video, and then the LOG video is processed based on the color lookup table LUT through the LUT processing module 29 to obtain the video processed by the LUT.
- the video after the LUT processing in the first video processing flow S1 is saved as a video.
- the second video processing flow S2 includes: the video taken by the camera 193 from the fusion module 23 is denoised by the noise processing module 24, and then processed by the CCM module 25 to convert the video into the color space of RGB wide color gamut, Then the logarithmic LOG curve corresponding to the current sensitivity ISO of the camera is used to process the fused video line by the GTM module 26 to obtain the process of the LOG video, and then the video is zoomed by the zoom module 27, and then by YUV
- the denoising module 28 performs YUV denoising on the video, and then executes the process of processing the LOG video based on the lookup table LUT through the LUT processing module 29 to obtain the video processed by the LUT.
- the video after the LUT processing in the second video processing flow S2 is previewed.
- the above only illustrates the specific video recording process in the first zoom mode. You can switch to the second zoom mode during the recording process or before two recordings. In the second zoom mode, no super-resolution algorithm processing is performed.
- the first The exposure frame video image and the second exposure frame video image are respectively processed by the anti-mosaic module 21 to convert the image from the RAW domain to the RGB domain, and then the two channels of video images are respectively processed by the warp warp module 22 to deform the video image.
- the effect of alignment and anti-shake is realized, and then the two-way video images are processed by the fusion module 23, and the two video images are fused into the same one.
- the fusion weight of the video image of the first exposure frame is smaller than that of the first zoom mode
- the fusion weight of the first exposure frame video image, the video image processing process after fusion in the second zoom mode may be the same as the first zoom mode, or different from the first zoom mode, which is not limited in the embodiment of the present application .
- FIG. 10 is a block diagram of the software structure of the electronic device 100 according to the 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. Layers communicate through software interfaces.
- the Android system is divided into five layers, which are, from top to bottom, the Application layer, the application framework framework layer, the system library library, the Hardware Abstraction Layer (Hardware Abstraction Layer, HAL) and the kernel layer.
- the application layer can include applications such as cameras.
- the application framework layer may include camera application programming interface (Application Programming Interface, API), media recording MediaRecorder and surface view Surfaceview, etc.
- Media recording is used to record video or image data and make this data accessible to applications.
- Surface views are used to display preview images.
- a system library can include multiple function modules. For example: camera service CameraSevice, etc.
- the hardware abstraction layer is used to provide interface support, for example, including the camera process CameraPipeline for the camera service to call Call.
- the kernel layer is the layer between hardware and software.
- the kernel layer includes display drivers, camera drivers, etc.
- the application layer sends a capture request CaptureRequest, which corresponds to a video stream and a preview stream.
- CaptureRequest corresponds to a video stream and a preview stream.
- HAL calls back two streams according to the dataflow mentioned above. Among them, the preview streaming display, the video streaming mediacodec.
- the video recording and video processing method provided in the embodiment of the present application may be represented as multiple functions in two shooting modes, where the two shooting modes may refer to: movie mode and professional mode.
- the movie mode is a shooting mode related to the theme of the movie.
- the image displayed by the electronic device 100 can give the user a sense of watching a movie.
- the electronic device 100 also provides a plurality of video related to the theme of the movie Style templates, users can use these video style templates to obtain tone-adjusted images or videos, and the tone of these images or videos is similar or identical to the tone of the movie.
- the movie mode can at least provide an interface for the user to trigger the LUT function and the HDR10 function. For specific descriptions about the LUT function and the HDR10 function, please refer to the following embodiments.
- the electronic device 100 may enter a movie mode in response to a user's operation.
- the electronic device 100 may detect a user's touch operation on the camera application, and in response to the operation, the electronic device 100 displays a default camera interface of the camera application.
- the default camera interface can include: preview frame, shooting mode list, gallery shortcut keys, shutter controls, etc. in:
- the preview frame can be used to display images collected by the camera 193 in real time.
- the electronic device 100 can refresh the displayed content therein in real time, so that the user can preview the image currently captured by the camera 193 .
- One or more shooting mode options may be displayed in the shooting mode list.
- the one or more shooting mode options may include: portrait mode options, video recording mode options, camera mode options, movie mode options, and professional options.
- the one or more shooting mode options can be represented as text information on the interface, such as "portrait”, “video recording”, “photographing”, “movie”, “professional”.
- the one or more shooting mode options may also be represented as icons or other forms of interactive elements (interactive element, IE) on the interface.
- Gallery shortcuts can be used to launch the Gallery application.
- the gallery application program is an application program for picture management on electronic devices such as smart phones and tablet computers, and may also be called "album".
- the name of the application program is not limited in this embodiment.
- the gallery application program can support users to perform various operations on pictures stored on the electronic device 100, such as browsing, editing, deleting, selecting and other operations.
- the shutter control can be used to listen for user actions that trigger a photo.
- the electronic device 100 may detect a user operation acting on the shutter control, and in response to the operation, the electronic device 100 may save the image in the preview frame as a picture in the gallery application.
- the electronic device 100 may also display the thumbnails of the saved images in the gallery shortcut key. That is, users can tap the shutter control to trigger a photo.
- the shutter control may be a button or other forms of control.
- the electronic device 100 may detect a user's touch operation on the movie mode option, and in response to the operation, the electronic device displays a user interface as shown in FIG. 5 .
- the electronic device 100 may turn on the movie mode by default after starting the camera application. Not limited thereto, the electronic device 100 may also enable the movie mode in other ways, for example, the electronic device 100 may also enable the movie mode according to a user's voice command, which is not limited in this embodiment of the present application.
- the electronic device 100 may detect a user's touch operation on the movie mode option, and in response to the operation, the electronic device displays a user interface as shown in FIG. 5 .
- the user interface shown in FIG. 5 includes function options, and the function options include HDR10 options, flash options, LUT options, and setting options. These multiple function options can detect the user's touch operation, and in response to the operation, enable or disable the corresponding shooting function, for example, HDR10 function, flash function, LUT function, setting function.
- the electronic device can enable the LUT function, and the LUT function can change the display effect of the preview image.
- the LUT function introduces a color lookup table, which is equivalent to a color conversion model, which can output adjusted color values according to the input color values.
- the color value of the image captured by the camera is equivalent to the input value, and different color values can be correspondingly obtained as an output value after passing through the color conversion model.
- the image displayed in the preview box is the image adjusted by the color transformation model.
- the electronic device 100 utilizes the LUT function to display an image composed of color values adjusted by the color conversion model, so as to achieve the effect of adjusting the tone of the image.
- the electronic device 100 can provide multiple video style templates, one video style template corresponds to one color conversion model, and different video style templates can bring different display effects to the preview image.
- these video style templates can be associated with the theme of the movie, and the tone adjustment effect brought by the video style template to the preview image can be close to or the same as the tone in the movie, creating an atmosphere for the user to shoot a movie.
- the electronic device 100 can determine a video style template among multiple video style templates according to the current preview video image, and the determined video style template can be displayed on the interface, so that the user can understand Currently determined video style templates, for example, a plurality of video style templates including "A" movie style template, "B" movie style template and "C” movie style template, the corresponding LUTs of different movie style templates can be based on the corresponding Generated by the movie color matching style, the color conversion of the LUT has the style characteristics of the corresponding movie. Film styles can be pre-extracted to produce LUTs suitable for mobile electronics. Turning on the LUT function will change the color tone of the preview video screen. As shown in FIG. 5 , the electronic device 100 determines and displays the "A" movie style template.
- the electronic device 100 may select a video style template according to the user's sliding operation. Specifically, when the electronic device 100 detects the user operation of enabling the LUT function and displays the LUT preview window, the electronic device 100 can select the first video style template located in the LUT preview window by default as the video style template selected by the electronic device 100. template. Afterwards, the electronic device 100 can detect the left and right sliding operation of the user acting on the LUT preview window, and move the position of each video style template in the LUT preview window. The first video style template displayed in the preview window is used as the video style template selected by the electronic device 100 .
- the electronic device 100 in addition to using the video style template to change the display effect of the preview image, can also detect a user operation to start recording a video after adding the video style template, and in response to the operation, the electronic device 100 starts recording Video, so as to obtain the video after adjusting the display effect using the video style template.
- the electronic device 100 can also detect the user operation of taking a photo. In response to this operation, the electronic device 100 saves the preview image with the video style template added in the preview box as a picture, so as to obtain the user's operation of using the video.
- the style template adjusts the image after the display effect.
- HDR10 is a high-dynamic range image (High-Dynamic Range, HDR). Compared with ordinary images, HDR can provide more dynamic range and image details, and can better Reflecting the visual effects in the real environment, 10 in HDR10 is 10 bits, and HDR10 can record video with a high dynamic range of 10 bits.
- the electronic device 100 may detect the user's touch operation on the professional mode option, and enter the professional mode.
- the functional options that can be included in the user interface are, for example: LOG option, flashlight option, LUT option, and setting option.
- the user interface also includes parameter adjustment options, such as: measurement Light M option, ISO option, shutter S option, exposure compensation EV option, focus mode AF option and white balance WB option.
- the electronic device 100 may turn on the professional mode by default after starting the camera application.
- the electronic device 100 can also enable the professional mode in other ways, for example, the electronic device 100 can also enable the professional mode according to the user's voice command, which is not limited in this embodiment of the present application.
- the electronic device 100 may detect a user operation on the LOG option by the user, and in response to the operation, the electronic device 100 starts the LOG function.
- the LOG function can apply the logarithmic function to the exposure curve to preserve the details of the highlights and shadows in the image captured by the camera to the maximum extent, so that the saturation of the final preview image is lower.
- the video recorded with LOG function is called LOG video.
- the electronic device 100 can not only record a video with a video style template added through the professional mode, but also add a video style template to the video after recording a video without a video style template, or record a LOG video after enabling the LOG function. Then add a video style template for the LOG video. In this way, the electronic device 100 can not only adjust the display effect of the picture before recording the video, but also adjust the display effect of the recorded video after the video recording is completed, which increases the flexibility and freedom of image adjustment.
- the embodiment of the present application also provides a video processing device, including: a video acquisition module, configured to acquire a video captured by a camera in the first zoom mode or the second zoom mode, the video includes alternating first exposure frame video images and The second exposure frame video image, the exposure time of the first exposure frame video image is greater than the exposure time of the second exposure frame video image; the super-resolution algorithm module is used to perform super-supervision on the first exposure frame video image in the first zoom mode Sub-algorithm processing, super-resolution algorithm processing is used to improve resolution; fusion module, used in the first zoom mode, for the first exposure frame video image processed by the super-resolution algorithm and the second exposure without super-resolution algorithm processing Frames of video images are fused to obtain a fused video, the first exposure frame video image has the first weight; in the second zoom mode, the first exposure frame video image and the second exposure frame video image are fused, the first exposure frame video image has the first weight; The frame video image has a second weight, and the fused video is obtained, and the first weight is
- each module of the video processing device is only a division of logical functions, and may be fully or partially integrated into one physical entity or physically separated during actual implementation.
- these modules can all be implemented in the form of software called by the processing element; they can also be implemented in the form of hardware; some modules can also be implemented in the form of software called by the processing element, and some modules can be implemented in the form of hardware.
- any one of the video acquisition module, the super-resolution algorithm module and the fusion module can be a separate processing element, and can also be integrated in a video processing device, such as being integrated in a certain chip of the video processing device.
- each step of the above method or each module above can be completed by an integrated logic circuit of hardware in the processor element or an instruction in the form of software.
- these modules of the video acquisition module, the super-resolution algorithm module and the fusion module may be one or more integrated circuits configured to implement the above method, for example: one or more specific integrated circuits (Application Specific Integrated Circuit, ASIC), or , one or more microprocessors (digital signal processor, DSP), or, one or more field programmable gate arrays (Field Programmable Gate Array, FPGA), etc.
- ASIC Application Specific Integrated Circuit
- DSP digital signal processor
- FPGA Field Programmable Gate Array
- the processing element may be a general-purpose processor, such as a central processing unit (Central Processing Unit, CPU) or other processors that can call programs.
- these modules can be integrated together and implemented in the form of a system-on-a-chip (SOC).
- SOC system-on-a-chip
- An embodiment of the present application further provides a video processing device, including: a processor and a memory, the memory is used to store at least one instruction, and when the instruction is loaded and executed by the processor, the video processing method in any of the foregoing embodiments is implemented.
- the video processing apparatus may apply the above-mentioned video processing method, and the specific process and principle will not be repeated here.
- the number of processors may be one or more, and the processors and memory may be connected through a bus or in other ways.
- the memory can be used to store non-transitory software programs, non-transitory computer-executable programs and modules, such as program instructions/modules corresponding to the video processing device in the embodiment of the present application.
- the processor executes various functional applications and data processing by running non-transitory software programs, instructions and modules stored in the memory, that is, implements the method in any of the above method embodiments.
- the memory may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application program required by at least one function; and necessary data and the like.
- the memory may include high-speed random access memory, and may also include non-transitory memory, such as at least one magnetic disk storage device, flash memory device, or other non-transitory solid-state storage devices.
- an embodiment of the present application further provides an electronic device, including: a camera 193 and the above-mentioned video processing device, where the video processing device includes a processor 110 .
- the electronic device may be any product or component with a video shooting function such as a mobile phone, a TV, a tablet computer, a watch, a bracelet, and the like.
- An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored, and when running on a computer, the computer is made to execute the video processing method in any of the foregoing embodiments.
- all or part of them may be implemented by software, hardware, firmware or any combination thereof.
- software When implemented using software, it may be implemented in whole or in part in the form of a computer program product.
- the computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on the computer, the processes or functions according to the present application will be 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.
- the computer instructions may be stored in or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transmitted from a website, computer, server or data center Transmission to another website site, computer, server, or data center by wired (eg, coaxial cable, optical fiber, DSL) or wireless (eg, infrared, wireless, microwave, etc.) means.
- the computer-readable storage medium may be any available medium that can be accessed by a computer, or a data storage device such as a server or a data center integrated with one or more available media.
- the available medium may be a magnetic medium (for example, a floppy disk, a hard disk, a magnetic tape), an optical medium (for example, DVD), or a semiconductor medium (for example, a Solid State Disk).
- "at least one” means one or more, and “multiple” means two or more.
- “And/or” describes the association relationship of associated objects, indicating that there may be three kinds of relationships, for example, A and/or B may indicate that A exists alone, A and B exist simultaneously, or B exists alone. Among them, A and B can be singular or plural.
- the character “/” generally indicates that the contextual objects are an “or” relationship.
- “At least one of the following” and similar expressions refer to any combination of these items, including any combination of single items or plural items.
- At least one of a, b, and c may represent: a, b, c, a-b, a-c, b-c, or a-b-c, wherein a, b, and c may be single or multiple.
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Human Computer Interaction (AREA)
- Studio Devices (AREA)
Abstract
本申请实施例提供一种视频处理方法、装置、电子设备和存储介质,涉及视频拍摄技术领域,可以改善由于缩放倍数较高而导致的分辨率低的问题。视频处理方法包括:在第一变焦模式或第二变焦模式下,获取通过摄像头拍摄的视频;在第一变焦模式下,对第一曝光帧视频图像进行超分算法处理,超分算法处理用于提高分辨率;在第一变焦模式下,对经过超分算法处理的第一曝光帧视频图像和未经超分算法处理的第二曝光帧视频图像进行融合,得到融合后的视频,第一曝光帧视频图像具有第一权重;在第二变焦模式下,对第一曝光帧视频图像和第二曝光帧视频图像进行融合,第一曝光帧视频图像具有第二权重,得到融合后的视频,第一权重大于第二权重。
Description
本申请要求于2021年8月12日提交中国专利局、申请号为202110926921.0、申请名称为“视频处理方法、装置、电子设备和存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
本申请涉及视频拍摄技术领域,特别涉及一种视频处理方法、装置、电子设备和存储介质。
随着技术的发展,用户对通过手机等终端所拍摄的视频效果的要求越来越高,然而,目前的手机中拍摄视频,由于拍摄的限制,在较高缩放倍数下的视频分辨率较低。
发明内容
一种视频处理方法、装置、电子设备和存储介质,可以改善由于缩放倍数较高而导致的分辨率低的问题。
第一方面,提供一种视频处理方法,包括:在第一变焦模式或第二变焦模式下,获取通过摄像头拍摄的视频,视频包括交替的第一曝光帧视频图像和第二曝光帧视频图像,第一曝光帧视频图像的曝光时间大于第二曝光帧视频图像的曝光时间;在第一变焦模式下,对第一曝光帧视频图像进行超分算法处理,超分算法处理用于提高分辨率;在第一变焦模式下,对经过超分算法处理的第一曝光帧视频图像和未经超分算法处理的第二曝光帧视频图像进行融合,得到融合后的视频,第一曝光帧视频图像具有第一权重;在第二变焦模式下,对第一曝光帧视频图像和第二曝光帧视频图像进行融合,第一曝光帧视频图像具有第二权重,得到融合后的视频,第一权重大于第二权重。
在一种可能的实施方式中,视频处理方法还包括:若当前使用的摄像头为第一摄像头,且拍摄缩放倍数属于第一缩放范围,且当前拍摄画面的亮度大于第一亮度阈值,则进入第一变焦模式;若当前使用的摄像头为第一摄像头,且拍摄缩放倍数属于第二缩放范围,第二缩放范围小于第一缩放范围,则进入第二变焦模式;若当前使用的摄像头为第一摄像头,且拍摄缩放倍数属于第一缩放范围,且当前拍摄画面的亮度不大于第一亮度阈值,则进入第二变焦模式。当使用第一摄像头在第一缩放范围内拍摄时,如果当前拍摄画面的亮度大于第一亮度阈值,认为属于非暗光场景,进入第一变焦模式进行视频录制,如果当前拍摄画面的亮度不大于第一亮度阈值时,认为属于暗光场景,进入第二变焦模式进行视频录制,当使用第一摄像头在较低的第二缩放范围内拍摄时,即便属于非暗光场景,仍进入第二变焦模式。也就是说,对于同样的第一摄像头来说,在非暗光的高倍率缩放时进入第一变焦模式,这样,可以通过第一变焦模式 下所应用的超分算法改善由于缩放倍率较高而导致的分辨率低的问题。而对于暗光场景或低倍率缩放时,进入第二变焦模式,无需使用超分算法,也无需减低第一曝光帧视频图像的融合权重。
在一种可能的实施方式中,视频处理方法还包括:若当前使用的摄像头为第二摄像头,且拍摄缩放倍数属于第三缩放范围,且摄像头ISO属于第一ISO范围,第三缩放范围小于第二缩放范围,第二摄像头的焦距小于第一摄像头的焦距,则进入第一变焦模式;若当前使用的摄像头为第二摄像头,且拍摄缩放倍数属于第三缩放范围,且摄像头ISO属于第二ISO范围,且当前拍摄画面的亮度大于第二亮度阈值,第二ISO范围大于第一ISO范围,则进入第二变焦模式;若当前使用的摄像头为第二摄像头,且摄像头的缩放倍数属于第四缩放范围,第四缩放范围小于第三缩放范围,且当前拍摄画面的亮度大于第三亮度阈值,则进入第二变焦模式。
在一种可能的实施方式中,视频处理方法还包括:若当前使用的摄像头为第二摄像头,且拍摄缩放倍数属于第二缩放范围,且拍摄画面的亮度不大于第四亮度阈值,则进入第二变焦模式;若当前使用的摄像头为第二摄像头,且拍摄缩放倍数属于第二缩放范围,且拍摄距离小于距离阈值,则进入第二变焦模式;若当前使用的摄像头为第二摄像头,且拍摄缩放倍数属于第一缩放范围,且拍摄画面的亮度不大于第一亮度阈值,则进入第二变焦模式;若当前使用的摄像头为第二摄像头,且拍摄缩放倍数属于第一缩放范围,且拍摄距离小于距离阈值,则进入第一变焦模式。第二摄像头在第一缩放范围和第二缩放范围中的近距离拍摄场景下,如果缩放倍数较高,即属于第一缩放范围,则可以通过第一变焦模式下所应用的超分算法改善由于缩放倍数较高而导致的分辨率低的问题。
在一种可能的实施方式中,视频处理方法还包括:在第一变焦模式下,通过摄像头当前的感光度ISO所对应的对数LOG曲线对融合后的视频行处理,得到LOG视频;基于颜色查找表LUT对LOG视频进行处理,得到经过LUT处理后的视频。在视频录制过程中,利用电影行业的LUT技术,基于所确定的视频风格模板对应的LUT或者第一变焦模式所对应的LUT对LOG视频进行处理,使所录制的视频具有所确定的视频风格模板对应的风格效果,以满足较高的调色要求。
在一种可能的实施方式中,视频处理方法还包括:对第一曝光帧视频图像进行超分算法处理包括:获取第一曝光帧视频图像对应的统计信息;将统计信息以及第一曝光帧视频图像的RAW图像作为输入进行超分算法处理,得到处理后的第一曝光帧视频图像的RAW图像。
在一种可能的实施方式中,在第一视频处理流程中执行通过摄像头当前的感光度ISO所对应的对数LOG曲线对融合后的视频行处理,得到LOG视频的过程、以及基于颜色查找表LUT对LOG视频进行处理,得到经过LUT处理后的视频的过程;视频处理方法还包括第二视频处理流程,第二视频处理流程包括:通过摄像头当前的感光度ISO所对应的对数LOG曲线对融合后的视频行处理,得到LOG视频;基于查找表LUT对LOG视频进行处理,得到经过LUT处理后的视频;视频处理方法还包括:将第一视频处理流程中经过LUT处理后的视频进行保存;将第二视频处理流程中经过LUT处理后的视频进行预览。可以使预览视频和最终得到的视频具有相同的视觉效果, 便于用户直接基于调色后的风格进行视频预览。
第二方面,提供一种视频处理装置,包括:处理器和存储器,存储器用于存储至少一条指令,指令由处理器加载并执行时以实现上述的视频处理方法。
第三方面,提供一种电子设备,包括:摄像头;上述的视频处理装置。
第四方面,提供一种计算机可读存储介质,计算机可读存储介质中存储有计算机程序,当其在计算机上运行时,使得计算机执行上述的视频处理方法。
本申请实施例中视频处理方法、装置、电子设备和存储介质,通过摄像头拍摄的视频包括交替的第一曝光帧视频图像和第二曝光帧视频图像,其中第一曝光帧视频图像的曝光时间大于第二曝光帧视频图像的曝光时间,在第一变焦模式下,对经过超分算法处理的第一曝光帧视频图像和未经超分算法处理的第二曝光帧视频图像进行融合,在第二变焦模式下,对第一曝光帧视频图像和第二曝光帧视频图像进行融合,相对于第二变焦模式,在第一变焦模式下,第一曝光帧视频图像具有较大的融合权重,一方面,在第一变焦模式下,仅对其中较长曝光时间的图像进行超分算法处理,节省了图像处理时间,另一方面,相较于第二变焦模式,在第一变焦模式下提高较长曝光时间的图像的融合权重,以使融合后的图像更加明显地体现通过超分算法处理的效果,改善由于缩放倍数较高而导致的分辨率低的问题。
图1为本申请实施例中一种电子设备的结构框图;
图2为本申请实施例中一种视频处理方法的流程图;
图3为本申请实施例中另一种视频处理方法的流程图;
图4为本申请实施例中一种LOG曲线的示意图;
图5为本申请实施例中一种电影模式下用户界面的示意图;
图6为本申请实施例中另一种视频处理方法的部分流程图;
图7为本申请实施例中一种立方体插值空间中立方体和四面体关系的示意图;
图8为UV平面示意图;
图9为本申请实施例中一种电子设备的另一种结构框图;
图10为本申请实施例中一种电子设备的软件结构框图;
图11为本申请实施例中一种专业模式下用户界面的示意图。
本申请的实施方式部分使用的术语仅用于对本申请的具体实施例进行解释,而非旨在限定本申请。
在介绍本申请实施例之前,首先对本申请实施例所涉及的电子设备进行介绍,如图1所示,电子设备100可以包括处理器110,摄像头193,显示屏194等。可以理解的是,本发明实施例示意的结构并不构成对电子设备100的具体限定。在本申请另一些实施例中,电子设备100可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。
处理器110可以包括一个或多个处理单元,例如:处理器110可以包括图形处理器(graphics processing unit,GPU),图像信号处理器(image signal processor,ISP),控制器,视频编解码器,数字信号处理器(digital signal processor,DSP)等。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。控制器可以根据指令操作码和时序信号,产生操作控制信号,完成取指令和执行指令的控制。处理器110中还可以设置存储器,用于存储指令和数据。
电子设备100通过GPU,显示屏194,以及应用处理器等实现显示功能。GPU为图像处理的微处理器,连接显示屏194和应用处理器。GPU用于执行数学和几何计算,用于图形渲染。处理器110可包括一个或多个GPU,其执行程序指令以生成或改变显示信息。
电子设备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等。
如图2所示,本申请实施例提供一种视频处理方法,该视频处理方法的执行主体可以为处理器110,具体可以为ISP或者ISP与其他处理器的组合,该视频处理方法包括:
在第一变焦模式或第二变焦模式下,进入步骤101、获取通过摄像头拍摄的视频,视频包括交替的第一曝光帧视频图像和第二曝光帧视频图像,第一曝光帧视频图像的曝光时间大于第二曝光帧视频图像的曝光时间;
其中,第一变焦模式和第二变焦模式可以基于用户的选择进行切换,也可以在用户选择基础上基于对通过摄像头拍摄的视频的当前画面自动判断并切换,在摄像头捕获视频的过程中,会交替使用不同的曝光时间进行拍摄,以便于后续基于不同曝光时 间的视频图像进行融合。
在第一变焦模式下,进入步骤102、对第一曝光帧视频图像进行超分算法处理,超分算法处理用于提高分辨率;
其中,第一变焦模式是一种适用于较大缩放倍数的模式,在摄像头的缩放倍数较高时,较高的缩放倍数可能会导致拍摄画面的分辨率较低,因此在该模式中通过超分算法对视频图像进行处理。超分算法是一项底层图像处理算法,可以将低分辨率的图像映射至高分辨率,以期达到增强图像细节的作用。超分算法例如可以是基于深度学习的方法算法,先利用大量的高分辨率图像积累并进行学习,再对低分辨率的图像进行学习高分辨率图像的学习模型引入来进行恢复,最后得到图像的高频细节,获得更好的图像恢复效果。提高图像的识别能力和识别精度。在电子设备中,摄像头通过较高的频率捕获第一曝光帧视频图像和第二曝光帧视频图像,因此,对于第一曝光帧视频图像和第二曝光帧视频图像均应用超分算法的话可能无法满足较高的帧率要求,由于其他第一曝光帧视频图像的曝光时间较长,进光量较大,因此,在本申请实施例中,选择其中的第一曝光帧视频图像进行超分算法处理,第二曝光帧视频图像不做超分算法处理,这样,可以在有效的时间内实现超分算法的应用;
在第一变焦模式下,进入步骤103、对经过超分算法处理的第一曝光帧视频图像和未经超分算法处理的第二曝光帧视频图像进行融合,得到融合后的视频,第一曝光帧视频图像具有第一权重;
其中,在视频图像的融合过程中,每相邻的第一曝光帧视频图像和第二曝光帧视频图像融合为新的一帧视频图像,融合后的视频图像中包含第一曝光帧视频图像和第二曝光帧视频图像中的信息,两帧图像的融合权重可以进行调节,第一曝光帧视频图像具有第一权重,也就是说,第一曝光帧视频图像在两帧中所占据的融合权重,第一权重越大,则融合后的视频图像所包含的第一曝光帧视频图像的信息越多,相应的,第二曝光帧视频图像所占据的权重越小,即融合后的视频图像所包含的第二帧视频图像的信息越少。
在第二变焦模式下,进入步骤104、对第一曝光帧视频图像和第二曝光帧视频图像进行融合,第一曝光帧视频图像具有第二权重,得到融合后的视频,第一权重大于第二权重。
具体地,假设第一权重为70%、第二权重为50%,即在第二变焦模式下,对第一曝光帧视频图像和第二曝光帧视频图像进行融合的过程中,按照各50%的权重进行融合,融合后的视频图像包含50%的第一曝光帧视频图像中的信息和50%的第二曝光帧视频图像中的信息;在第一变焦模式下,对第一曝光帧视频图像和第二曝光帧视频图像进行融合的过程中,按照第一曝光帧视频图像70%的权重、第二曝光帧视频图像30%的权重进行融合,融合后的视频图像包含70%的第一曝光帧视频图像中的信息和30%的第二曝光帧视频图像中的信息。也即是说,相对于第二变焦模式,在第一变焦模式下,第一曝光帧视频图像具有较大的融合权重,这样,在未对第二曝光帧视频图像进行超分算法处理的前提下,可以使融合后的视频图像更加明显地体现通过超分算法处理的效果。对于融合后的视频,可以继续执行相关的视频处理过程,以完成视频录制。
本申请实施例中视频处理方法,通过摄像头拍摄的视频包括交替的第一曝光帧视 频图像和第二曝光帧视频图像,其中第一曝光帧视频图像的曝光时间大于第二曝光帧视频图像的曝光时间,在第一变焦模式下,对经过超分算法处理的第一曝光帧视频图像和未经超分算法处理的第二曝光帧视频图像进行融合,在第二变焦模式下,对第一曝光帧视频图像和第二曝光帧视频图像进行融合,相对于第二变焦模式,在第一变焦模式下,第一曝光帧视频图像具有较大的融合权重,一方面,在第一变焦模式下,仅对其中较长曝光时间的图像进行超分算法处理,节省了图像处理时间,另一方面,相较于第二变焦模式,在第一变焦模式下提高较长曝光时间的图像的融合权重,以使融合后的图像更加明显地体现通过超分算法处理的效果,改善由于缩放倍数较高而导致的分辨率低的问题。
在一种可能的实施方式中,视频处理方法还包括:若当前使用的摄像头为第一摄像头,且拍摄缩放倍数属于第一缩放范围,且当前拍摄画面的亮度大于第一亮度阈值,则进入第一变焦模式;若当前使用的摄像头为第一摄像头,且拍摄缩放倍数属于第二缩放范围,第二缩放范围小于第一缩放范围,则进入第二变焦模式;若当前使用的摄像头为第一摄像头,且拍摄缩放倍数属于第一缩放范围,且当前拍摄画面的亮度不大于第一亮度阈值,则进入第二变焦模式。
具体地,拍摄缩放倍数与等效焦距相关,本申请实施例中,假设第一缩放范围为(7x,15x],x表示倍数,即第一缩放范围为7倍至15倍,包含10倍的极值点和15倍的极值点,第一缩放范围所对应的等效焦距范围为大于190mm;第二缩放范围为[3.5x,7x),即第二缩放范围为3.5倍至7倍,包含3.5倍的极值点,不包含7倍的极值点,第二缩放范围所对应的等效焦距范围为[95mm,190mm)。以下均以该具体数值为例进行说明。电子设备,例如手机中可以有多个摄像头,其中第一摄像头例如可以其中的长焦摄像头。如表1所示,表1示意了本申请实施例中一种不同参数下所对应的变焦模式。
表1
根据表1可以看出,当使用第一摄像头在第一缩放范围内拍摄时,如果当前拍摄画面的亮度大于第一亮度阈值,认为属于非暗光场景,进入第一变焦模式进行视频录制,如果当前拍摄画面的亮度不大于第一亮度阈值时,认为属于暗光场景,进入第二变焦模式进行视频录制,当使用第一摄像头在较低的第二缩放范围内拍摄时,即便属于非暗光场景,仍进入第二变焦模式。也就是说,对于同样的第一摄像头来说,在非暗光的高倍率缩放时进入第一变焦模式,这样,可以通过第一变焦模式下所应用的超分算法改善由于缩放倍率较高而导致的分辨率低的问题。而对于暗光场景或低倍率缩放时,进入第二变焦模式,无需使用超分算法,也无需减低第一曝光帧视频图像的融合权重。
在一种可能的实施方式中,视频处理方法还包括:若当前使用的摄像头为第二摄像头,且拍摄缩放倍数属于第三缩放范围,且摄像头ISO属于第一ISO范围,第三缩放范围小于第二缩放范围,第二摄像头的焦距小于第一摄像头的焦距,则进入第一变焦模式;若当前使用的摄像头为第二摄像头,且拍摄缩放倍数属于第三缩放范围,且摄像头ISO属于第二ISO范围,且当前拍摄画面的亮度大于第二亮度阈值,第二ISO范围大于第一ISO范围,则进入第二变焦模式;若当前使用的摄像头为第二摄像头,且摄像头的缩放倍数属于第四缩放范围,第四缩放范围小于第三缩放范围,且当前拍摄画面的亮度大于第三亮度阈值,则进入第二变焦模式。
具体地,假设第三缩放范围为(1.8x,3.5x),即第三缩放范围为1.8倍至3.5倍,不包含极值点,第三缩放范围所对应的等效焦距范围为(48mm,95mm),第四缩放范围为[1x,1.8x],即第四缩放范围为1倍至1.8倍,包含极值点,第四缩放范围所对应的等效焦距范围为(27mm,48mm)。假设第二摄像头为手机中的主摄像头,主摄像头的焦距小于长焦摄像头。假设第一ISO范围为小于或等于1600,第二ISO范围为大于1600。根据表1所示,在第三缩放范围和第四缩放范围,对于焦距较小的第二摄像头来说,如果属于相同的第一ISO范围,则应用于较小缩放范围时进入第二变焦模式,应用较大缩放范围时进入第一变焦模式,即通过第一变焦模式下所应用的超分算法改善由于缩放倍率较高而导致的分辨率较低的问题。另外,当第二摄像头应用第二ISO范围时,在第三缩放范围,如果当前拍摄画面的亮度大于第二亮度阈值,则认为属于非弱光场景,反之如果当前拍摄画面的亮度不大于第二亮度阈值,则认为属于弱光场景,在第四缩放范围,如果当前拍摄画面的亮度大于第三亮度阈值,则认为属于非弱光场景, 反之如果当前拍摄画面的亮度不大于第三亮度阈值,则认为属于弱光场景,第二亮度阈值可以等于或不等于第三亮度阈值,在第二ISO范围的非弱光场景下,进入第二变焦模式,而在第二ISO范围的弱光场景下,可以另外进入第三变焦模式,本申请实施例对于第三变焦模式的具体实现方式不做限定,在第三变焦模式下,例如可以针对弱光场景进一步进行图像处理的优化。另外需要说明的是,本申请实施例对于第二变焦模式的具体图像处理过程不做限定,在第二变焦模式中,可以进一步划分为不同的子模式来应用不同的算法处理,例如,在某些场景下,需要单独使用光学防抖(Optical Image Stabilization,OIS)算法对图像进行处理,在另外一些场景下,需要单独使用电子防抖(Electric Image Stabilization,EIS)算法对图像进行处理,在其他一些场景下,会使用OIS和EIS对图像进行处理。另外,根据表1可以看出,第二摄像头还可以工作于第五缩放范围,第五缩放范围为[0.9x,1x),对应的等效焦距范围为[23mm,27mm),此时,在全场景下可以进入上述第二变焦模式。本申请实施例中的电子设备还包括第三摄像头,第三摄像头可以为超广角摄像头,第三摄像头的焦距小于第二摄像头的焦距,第三摄像头可以工作与第六缩放范围,第六缩放范围为[0.4x,0.9x),对应的等效焦距范围为[11mm,23mm)。
在一种可能的实施方式中,视频处理方法还包括:若当前使用的摄像头为第二摄像头,且拍摄缩放倍数属于第二缩放范围,且拍摄画面的亮度不大于第四亮度阈值,则进入第二变焦模式;若当前使用的摄像头为第二摄像头,且拍摄缩放倍数属于第二缩放范围,且拍摄距离小于距离阈值,则进入第二变焦模式;若当前使用的摄像头为第二摄像头,且拍摄缩放倍数属于第一缩放范围,且拍摄画面的亮度不大于第一亮度阈值,则进入第二变焦模式;若当前使用的摄像头为第二摄像头,且拍摄缩放倍数属于第一缩放范围,且拍摄距离小于距离阈值,则进入第一变焦模式。
具体地,当第二摄像头应用第二缩放范围时,可以应用于暗光场景,即当前拍摄画面的亮度不大于第四亮度阈值,第四亮度阈值可以与其他的亮度阈值相同,也可以与其他的亮度阈值不同,此时可以进入第二变焦模式,还可以应用于近距离拍摄场景,即拍摄距离小于预设距离,例如拍摄距离<1200cm,可以认为属于近距离拍摄场景,此时可以进入第二变焦模式。当第二摄像头应用第一缩放范围时,可以应用于暗光场景,即当前拍摄画面的亮度不大于第一亮度阈值,此时可以进入第二变焦模式。当第二摄像头应用第一缩放范围时,可以应用于近距离拍摄场景,例如拍摄距离<1200cm,此时可以进入第一变焦场景。也就是说,第二摄像头在第一缩放范围和第二缩放范围中的近距离拍摄场景下,如果缩放倍数较高,即属于第一缩放范围,则可以通过第一变焦模式下所应用的超分算法改善由于缩放倍数较高而导致的分辨率低的问题。
在一种可能的实施方式中,如图3所示,视频处理方法,还包括:
在第一变焦模式下,进入步骤105、通过摄像头当前的感光度ISO所对应的对数LOG曲线对融合后的视频行处理,得到LOG视频;
其中,LOG曲线是基于场景的曲线,不同ISO下LOG曲线略有不同。随着ISO的增加,LOG曲线最大值也在增加。当ISO提高到一定程度,高光处有肩部形状,保持高光不过曝。如图4所示,图4示意了一种LOG曲线,其中横坐标为线性信号,以16比特bit编码值Code Value表示,纵坐标为经过LOG曲线处理后的LOG信号,以 10bit编码值表示。通过LOG曲线处理,可以利用摄像头的信号输入,将暗部区间的信息编码到中间调(如图4中曲线陡峭的部分),形成10bit的信号输出,符合人眼对光线LOG感应规则,最大化的保留了暗部信息,LOG视频可以利用有限的bit深度最大化的保留阴影和高光的细节。图4中的ASA即为感光度,不同的ASA即对应不同的ISO,两者属于不同制式。
步骤106、基于颜色查找表(Look Up Table,LUT)对LOG视频进行处理,得到经过LUT处理后的视频。
具体地,其中,LUT的本质为数学转换模型,利用LUT可以将一组RGB值输出为另一组RGB值,从而改变画面的曝光与色彩。在第一变焦模式下,可以例如有两种基于LUT的处理方式,一种是仅仅利用LUT来针对该场景下的特点对视频进行处理,在该方式下,可以自动应用第一变焦模式下对应的LUT;另一种是利用LUT来应用不同的视频风格,以下均以第二种方法为例进行说明。可以预先生成对应不同视频风格的LUT,在电子设备录制视频之前,首先确定出一个视频风格模板,例如可以基于用户的选择来确定视频风格模板,或者基于人工智能(Artificial Intelligence,AI),根据当前摄像头获取的图像所对应的场景自动确定视频风格模板。例如,假设电子设备为手机,在一种可能的实施方式中,如图5所示,用户操作手机进入第一变焦模式下的拍摄界面,拍摄界面包括电影模式选项,当用户进一步选择电影模式选项进入电影模式,在对应的电影模式界面中,包括多个视频风格模板选项,例如包括《A》电影风格模板、《B》电影风格模板和《C》电影风格模板,图5所示的用户界面中仅显示了一个《A》电影风格模板,可以理解地,用户界面中可以并排显示多个不同的电影风格模板,不同的电影风格模板所对应的LUT可以是预先基于对应电影配色风格所生成的,LUT的颜色转换具有对应电影所具有的风格特点,例如《A》电影的配色风格为互补色,互补色是指两种对应的颜色形成对比效果,以暖色系与冷色系的两种颜色来强调对比度以提升鲜艳、突出的效果,通常两种对比的色彩象征冲突行为,透过外在的互补色彩的呈现来表达角色内心正处于矛盾或是身心交瘁的状态,《A》电影风格模板所对应的LUT即用于将颜色映射转换之后,更明显地呈现互补色,以模拟《A》电影的配色风格。在一种可能的实施方式中,如图5所示,用户操作手机进入电影模式,手机会通过获取当前摄像头所拍摄的画面,并基于AI算法确定画面所对应的场景并确定与该场景对应的推荐的视频风格模板,例如若识别到当前所拍摄的画面主体为年轻女性人物,根据算法确定对应的推荐的视频风格模板为《C》电影风格模板,《C》电影为以年轻女性人物为主题的电影,其对应的LUT可以模拟《C》电影的配色风格;例如若识别到当前所拍摄的画面为城市街道,根据算法确定对应的视频风格模板为《B》电影风格模板,《B》电影为以城市街道为主要场景的电影,其对应的LUT可以模拟《B》电影的配色风格。这样,可以自动为用户推荐符合当前场景的视频风格模板。可以预先从电影风格中提取,产生适合移动电子设备的LUT。
不同的LUT应用在电子设备上,可以对电子设备中相关的模块进行适配,以适应不同风格的LUT,例如,如果预先所确定的视频风格模板为灰色调视频风格模板,灰色调画面的特点为使画面中纹理感较强、饱和度较低、除了人物皮肤的颜色,没有更多的颜色干扰、暗部较冷,基于这些特点,电子设备在录制视频的过程中,可以对相 关的模块参数进行调整,保持画面中的纹理,不做很强的去噪和锐化,适当降低画面的饱和度,保持画面中的皮肤颜色真实还原,使画面的暗部向冷色调整。
本申请实施例中的视频处理方法,在视频录制过程中,利用电影行业的LUT技术,基于所确定的视频风格模板对应的LUT或者第一变焦模式所对应的LUT对LOG视频进行处理,使所录制的视频具有所确定的视频风格模板对应的风格效果,以满足较高的调色要求。
在一种可能的实施方式中,如图6所示,上述步骤102、对第一曝光帧视频图像进行超分算法处理包括:获取第一曝光帧视频图像对应的统计信息;将统计信息以及第一曝光帧视频图像的RAW图像作为输入进行超分算法处理,得到处理后的第一曝光帧视频图像的RAW图像。
具体地,RAW图像就是摄像头中的传感器将捕获到的光源信号转化为数字信号的原始数据,例如,电子设备中包括摄像头193、超分算法模块31和统计信息获取模块32,其中,统计信息获取模块32可以为ISP中的模块,在步骤101中通过摄像头193获取到第一曝光帧视频图像和第二曝光帧视频图像,并将该第一曝光帧视频图像传输至统计信息获取模块32和超分算法模块31,其中,统计信息获取模块32根据第一曝光帧视频图像获取到图像所对应的stats统计信息,并将该统计信息传输至超分算法模块31,传输至超分算法模块31的第一曝光帧视频图像可以为RAW图像,超分算法模块31以RAW图像作为输入,同时基于所获取到的对应的统计信息对该第一帧视频图像进行处理,得到处理后的RAW图像并输出至后续过程。需要说明的是,在本实施例中,超分算法模块31执行超分算法处理的过程是在整个图像处理过程中的RAW域进行的,在其他可能的实施方式中,超分算法处理的过程也可以例如在YUV域进行。
以下对RAW和YUV的相关内容进行说明:
拜耳域:数码相机上的每个镜头都带有一个光传感器,用以测量光线的明亮程度,但若要获得一幅全彩图像,一般需要有三个光传感器分别获得红、绿、蓝三基色信息,而为了降低数码相机的成本与体积,生产厂商通常会采用CCD或CMOS图像传感器,通常的,CMOS图像传感器输出的原始图像为拜尔域RGB格式,单个像素点只包含一种颜色值,要得到图像的灰度值,需要先插补完整各像素点的颜色信息,再计算各像素点的灰度值。也就是说拜耳域是指数码相机内部的一种原始图片格式。
Raw域或称Raw格式,是指未经加工图像。进一步地,所述Raw图像可以理解为,就是相机的感光元件比如互补金属氧化物半导体(Complementary Metal OxideSemiconductor,CMOS)或者电荷耦合器件(Charge-coupled Device,CCD)将捕捉到的光源信号转化为数字信号的原始数据。RAW文件是一种记录了数码相机传感器的原始信息,同时记录了由相机拍摄所产生的一些元数据(Metadata,如感光度ISO(InternationalOrganization for Standardization,国际标准化组织)的设置、快门速度、光圈值、白平衡等)的文件。Raw域是未经ISP非线性处理、也未经压缩的格式。Raw格式的全称是RAW Image Format。
YUV是一种颜色编码方法,常使用在各个视频处理组件中。YUV在对照片或视频编码时,考虑到人类的感知能力,允许降低色度的带宽。YUV是编译true-color颜色空间(color space)的种类,Y'UV、YUV、YCbCr、YPbPr等专有名词都可以称为YUV, 彼此有重叠。其中“Y”表示明亮度(Luminance或Luma),也就是灰阶值,“U”和“V”表示色度(Chrominance或Chroma),作用是描述影像色彩及饱和度,用于指定像素的颜色。一般YUV分成两种格式,一种是:紧缩格式(packedformats),将Y、U、V值存储成Macro Pixels数组,和RGB的存放方式类似。另一种是:平面格式(planarformats),将Y、U、V的三个分量分别存放在不同的矩阵中。平面格式(planarformats)是指每Y分量,U分量和V分量都是以独立的平面组织的,也就是说所有的U分量都在Y分量后面,而V分量在所有的U分量后面。
在一种可能的实施方式中,上述步骤106、基于颜色查找表(Look Up Table,LUT)对LOG视频进行处理,得到经过LUT处理后的视频的过程包括:
基于LUT建立立方体插值空间,LUT为三维3D-LUT;
其中,3D-LUT的实现是在RGB域进行的,3D-LUT为电影工业中常用的调色映射关系,可以将任意输入的RGB像素值转换为对应的其他RGB像素值,例如输入12bit的RGB视频图像,经过LUT处理映射之后输出12bit的RGB视频图像。将整个RGB色彩空间均匀地分为例如33×33×33的立方体,对应LUT,每个立方体的边长step_size例如为2
(12-5)=2
7。
确定LOG视频中每个像素点在立方体插值空间中所属的立方体,立方体中被划分为6个四面体;
其中,LOG视频作为LUT处理过程中的输入,对LOG视频画面中每个像素点得到通过LUT处理映射后的像素点,既可以实现通过LUT对LOG视频进行处理的过程,需要确定每个作为输入的LOG视频中每个像素点在上述立方体插值空间中所属的立方体,立方体被划分为6个四面体。
确定LOG视频中每个像素点所属的四面体;
对于对应立方体顶点的像素点,将像素值转换为经过LUT处理后的像素值,对于不对应立方体顶点的像素点,根据每个像素点所属的四面体进行插值,将像素值转换为经过LUT处理后的像素值。
具体地,对于输入的像素点来说,如果像素点位于立方体的顶点,根据顶点的索引以及3D-LUT,可以直接获取映射后的RGB像素值,即可以直接通过LUT将其像素值映射转换为对应的像素值,而如果像素点位于立方体的顶点之间,则根据像素点所属的四面体进行插值。
在一种可能的实施方式中,如图7所示,立方体中具有第0至第7顶点,在图7中分别以数字0~7表示,第0顶点至第1顶点的方向为蓝色B通道的坐标轴方向,第0顶点至第4顶点的方向为红色R通道的坐标轴方向,第0顶点至第2顶点的方向为绿色G通道的坐标轴方向,第0顶点、第1顶点、第2顶点和第3顶点位于同一平面,第1顶点、第3顶点、第5顶点和第7顶点位于同一平面,第4顶点、第5顶点、第6顶点和第7顶点位于同一平面,第0顶点、第2顶点、第4顶点和第6顶点位于同一平面;第0顶点、第1顶点、第5顶点和第7顶点形成第一个四面体,第0顶点、第1顶点、第3顶点和第7顶点形成第二个四面体,第0顶点、第2顶点、第3顶点和第7顶点形成第三个四面体,第0顶点、第4顶点、第5顶点和第7顶点形成第四个四面体,第0顶点、第4顶点、第6顶点和第7顶点形成第五个四面体,第0顶点、 第2顶点、第6顶点和第7顶点形成第六个四面体;其中,第i顶点的坐标为(Ri,Gi,Bi),i的取值为0、1、2、3、…、7,第i顶点经过LUT处理后的像素值为VE(Ri,Gi,Bi),其中E取R、G和B;
上述对于不对应立方体顶点的像素点,根据每个像素点所属的四面体进行插值,将像素值转换为经过LUT处理后的像素值的过程包括:
根据当前像素点(R,G,B)生成经过LUT处理后的E通道像素值VE(R,G,B),E取R、G和B,当前像素点是指输入的LOG视频中的当前待进行插值计算的像素点;
VE(R,G,B)=VE(R0,G0,B0)+(delta_valueR_E×deltaR+delta_valueG_E×deltaG+delta_valueB_E×deltaB+(step_size>>1))/(step_size);
VE(R0,G0,B0)为第0顶点(R0,G0,B0)经过LUT处理后的E通道像素值,E取R、G和B;
delta_valueR_E为当前像素点所属四面体对应R通道的坐标轴方向上的两个顶点经过LUT处理后的E通道像素值之差,delta_valueG_E为当前像素点所属四面体对应G通道的坐标轴方向上的两个顶点经过LUT处理后的E通道像素值之差,delta_valueB_E为当前像素点所属四面体对应B通道的坐标轴方向上的两个顶点经过LUT处理后的E通道像素值之差;
deltaR为当前像素点(R,G,B)中的R值与第0顶点(R0,G0,B0)中的R0值之差,deltaG为当前像素点(R,G,B)中的G值与第0顶点(R0,G0,B0)中的G0值之差,deltaB为当前像素点(R,G,B)中的B值与第0顶点(R0,G0,B0)中的B0值之差;
step_size为立方体的边长。
其中,>>表示右移运算,(step_size>>1)即step_size右移一位。
具体地,例如,对于输入的当前像素点(R,G,B),计算deltaR、deltaG和deltaB,deltaR、deltaG和deltaB表示当前像素点(R,G,B)与第0顶点的距离,deltaR=R-R0,deltaG=G-G0,deltaB=B-B0,可以根据deltaR、deltaG以及deltaB之间的关系判断当前像素点属于哪个四面体。如果deltaB≥deltaR且deltaR≥deltaG,则确定当前像素点属于第一个四面体;如果deltaB≥deltaG且deltaG≥deltaR,则确定当前像素点属于第二个四面体;如果deltaG≥deltaB且deltaB≥deltaR,则确定当前像素点属于第三个四面体;如果deltaR≥deltaB且deltaB≥deltaG,则确定当前像素点属于第四个四面体;如果deltaR≥deltaG且deltaG≥deltaB,则确定当前像素点属于第五个四面体;如果deltaR、deltaG以及deltaB之间的关系不属于上述第一~第五个四面体的条件,则确定当前像素点属于第六个四面体。假设当前像素点(R,G,B)属于第一个四面体,该像素点经过LUT处理后的R通道像素值VR(R,G,B)的计算过程中,delta_valueR_E为当前像素点所属四面体对应R通道的坐标轴方向上的两个顶点经过LUT处理后的E通道像素值之差,即delta_valueR_R=VR(R5,G5,B5)-VR(R1,G1,B1),delta_valueG_R=VR(R7,G7,B7)-VR(R5,G5,B5),delta_valueB_R=VR(R1,G1,B1)-VR(R0,G0,B0),VR(R,G,B)=VR(R0,G0,B0)+(delta_valueR_R×deltaR+delta_valueG_R×deltaG+delta_valueB_R×deltaB+(step_size>>1))/ (step_size);该像素点经过LUT处理后的G通道像素值VG(R,G,B)的计算过程中,delta_valueG_E为当前像素点所属四面体对应G通道的坐标轴方向上的两个顶点经过LUT处理后的E通道像素值之差,即delta_valueR_G=VR(R5,G5,B5)-VR(R1,G1,B1),delta_valueG_G=VG(R7,G7,B7)-VG(R5,G5,B5),delta_valueB_G=VG(R1,G1,B1)-VG(R0,G0,B0),VG(R,G,B)=VG(R0,G0,B0)+(delta_valueR_G×deltaR+delta_valueG_G×deltaG+delta_valueB_G×deltaB+(step_size>>1))/(step_size);该像素点经过LUT处理后的B通道像素值VG(R,G,B)的计算过程中,delta_valueB_E为当前像素点所属四面体对应B通道的坐标轴方向上的两个顶点经过LUT处理后的E通道像素值之差,即delta_valueR_B=VB(R5,G5,B5)-VB(R1,G1,B1),delta_valueG_B=VB(R7,G7,B7)-VB(R5,G5,B5),delta_valueB_B=VB(R1,G1,B1)-VB(R0,G0,B0),VB(R,G,B)=VB(R0,G0,B0)+(delta_valueR_B×deltaR+delta_valueG_B×deltaG+delta_valueB_B×deltaB+(step_size>>1))/(step_size)。对于当前像素点(R,G,B)属于其他四面体的情况,计算过程类似,区别在于delta_valueR_E的计算,例如对于第二个四面体,delta_valueR_R=VR(R7,G7,B7)-VR(R3,G3,B3),delta_valueG_R=VR(R3,G3,B3)-VR(R1,G1,B1),delta_valueB_R=VR(R1,G1,B1)-VR(R0,G0,B0),基于其他四面体的具体计算过程在此不再赘述。
在一种可能的实施方式中,在上述步骤106、基于颜色查找表(Look Up Table,LUT)对LOG视频进行处理,得到经过LUT处理后的视频的过程之前,还包括:将LOG视频由RGB色彩空间的LOG视频转换为YUV色彩空间的LOG视频;对YUV色彩空间的LOG视频进行YUV去噪处理,得到去噪后的LOG视频,在步骤106中应用LUT的LOG视频即为经过YUV去噪后的LOG视频。由于步骤105中得到的LOG视频,能够体现暗部细节,但是同时会将暗部噪声放大,即会引入噪声,因此可以将LOG视频转换为YUV色彩空间之后,进行YUV去噪处理,通过算法降噪,以改善视频图像质量。
在一种可能的实施方式中,在上述步骤106、基于颜色查找表(Look Up Table,LUT)对LOG视频进行处理,得到经过LUT处理后的视频的过程之前,还包括:将去噪后的LOG视频由YUV色彩空间的LOG视频转换为RGB色彩空间的LOG视频;在上述步骤106、基于颜色查找表(Look Up Table,LUT)对LOG视频进行处理,得到经过LUT处理后的视频的过程之后,还包括:将RGB色彩空间的经过LUT处理后的视频转换为YUV色彩空间的视频。由于步骤106中基于LUT对LOG视频进行处理的过程是基于RGB色彩空间实现的,因此,因此,在步骤105之前先将YUV色彩空间的视频转换为RGB色彩空间的视频,在步骤106之后,再将RGB色彩空间的视频重新转换为YUV色彩空间的视频。
YUV(亦称YCbCr)是欧洲电视系统采用的一种颜色编码方法。在现代彩色电视系统中,通常采用三管彩色摄像机或彩色CCD摄影机进行取像,然后把取得的彩色图像信号经分色、分别放大校正后得到RGB信号,再经过矩阵变换电路得到亮度信号Y和两个色差信号B-Y(即U)、R-Y(即V),最后发送端将三个信号分别进行编码后用同一信道发送出去。这种色彩表示方法就是YUV颜色空间。YCbCr是YUV模型的具体实 现,其实是YUV经过缩放和偏移的翻版。其中Y与YUV中的Y含义一致,Cb和Cr同样都指色彩,只是在表示方法上不同而已。在YUV家族中,YCbCr是在计算机系统中应用最多的成员,其应用领域很广泛,JPEG、MPEG均采用此格式。一般人们所讲的YUV大多是指YCbCr。UV平面如图8所示。
RGB和YUV颜色空间的相互转换可以通过3x3的矩阵实现:
YUV主要有4种采样格式:YCbCr 4:2:0、YCbCr 4:2:2、YCbCr 4:1:1和YCbCr4:4:4。
在一种可能的实施方式中,如图9所示,电子设备具体可以包括摄像头193、超分算法模块31、统计信息获取模块32、反马赛克Demosaic模块21、变形模块22、融合模块23、噪声处理模块24、色彩校正矩阵(Color Correction Matrix,CCM)模块25、全局色调映射(Global Tone Mapping,GTM)模块26、缩放Scaler模块27、YUV去噪模块28、LUT处理模块29,例如,在视频录制的过程中,摄像头193拍摄得到第一曝光帧视频图像和第二曝光帧视频图像,第一曝光帧视频图像所对应的曝光时间大于第二曝光帧视频图像所对应的曝光时间,在第一变焦模式下,统计信息获取模块32获取第一曝光帧视频图像对应的统计信息,超分算法模块31将统计信息以及第一曝光帧视频图像的RAW图像作为输入进行超分算法处理,得到经过超分算法处理后的第一曝光帧视频图像的RAW图像,经过超分算法处理后的第一曝光帧视频图像和未经超分算法处理的第二曝光帧视频图像分别通过反马赛克模块21的处理,使图像从RAW域转换为RGB域,之后两路视频图像分别通过变形warp模块22的处理,通过对视频图像的变形实现对齐、防抖的效果,之后两路视频图像通过融合模块23处理,将两种视频图像融合为同一个,融合之后的数据再分流为两路,视频处理方法包括第一视频处理流程S1和第二视频处理流程S2,通过融合模块23处理之后的其中一路进入第一视频处理流程S1,另外一路进入第二视频处理流程S2。
在第一视频处理流程S1中执行将通过摄像头拍摄的视频转换为广色域的色彩空间的视频的过程、通过对数LOG曲线对视频进行处理,得到LOG视频的过程、以及基于LUT对LOG视频进行处理的过程。
例如,第一视频处理流程S1包括,将来自于融合模块23的通过摄像头193拍摄的视频通过噪声处理模块24进行去噪处理,然后通过CCM模块25处理,将视频转换为RGB广色域的色彩空间,然后通过GTM模块26执行通过摄像头当前的感光度ISO所对应的对数LOG曲线对融合后的视频行处理,得到LOG视频的过程,然后通过缩放模块27对视频进行缩放处理,然后通过YUV去噪模块28对视频进行YUV去噪,然后通过LUT处理模块29执行基于颜色查找表LUT对LOG视频进行处理,得到经过LUT处理后的视频。在第一视频处理流程S1之后,将第一视频处理流程S1中经过LUT处理后的视频进行保存,保存为录像。
第二视频处理流程S2包括:将来自于融合模块23的通过摄像头193拍摄的视频通过噪声处理模块24进行去噪处理,然后通过CCM模块25处理,将视频转换为RGB广色域的色彩空间,然后通过GTM模块26执行通过摄像头当前的感光度ISO所对应 的对数LOG曲线对所述融合后的视频行处理,得到LOG视频的过程,然后通过缩放模块27对视频进行缩放处理,然后通过YUV去噪模块28对视频进行YUV去噪,然后通过LUT处理模块29执行基于查找表LUT对LOG视频进行处理,得到经过LUT处理后的视频的过程。在第二视频处理流程S2之后,将第二视频处理流程S2中经过LUT处理后的视频进行预览。
以上仅说明了在第一变焦模式下的具体视频录制过程,可以在录制过程中或者两次录制之前切换至进入第二变焦模式,在第二变焦模式下,不进行超分算法处理,第一曝光帧视频图像和第二曝光帧视频图像分别通过反马赛克模块21的处理,使图像从RAW域转换为RGB域,之后两路视频图像分别通过变形warp模块22的处理,通过对视频图像的变形实现对齐、防抖的效果,之后两路视频图像通过融合模块23处理,将两种视频图像融合为同一个,在第二变焦模式下,第一曝光帧视频图像的融合权重小于第一变焦模式下第一曝光帧视频图像的融合权重,在第二变焦模式下融合之后的视频图像处理过程可以与第一变焦模式相同,也可以与第一变焦模式不同,本申请实施例对此不做限定。
以下结合软件架构对本申请实施例进行说明,本申请实施例以分层架构的Android系统为例,示例性说明电子设备100的软件结构。图10是本申请实施例的电子设备100的软件结构框图。
分层架构将软件分成若干个层,每一层都有清晰的角色和分工。层与层之间通过软件接口通信。在一些实施例中,将Android系统分为五层,从上至下分别为应用程序Application层、应用程序框架framework层、系统库library、硬件抽象层(Hardware Abstraction Layer,HAL)以及内核层。
应用程序层可以包括相机等应用程序。
应用程序框架层可以包括相机应用程序编程接口(Application Programming Interface,API)、媒体录制MediaRecorder和表面视图Surfaceview等。媒体录制用来录制视频或图片数据,并使这些数据可以被应用程序访问。表面视图用来显示预览画面。
系统库可以包括多个功能模块。例如:相机服务CameraSevice等。
硬件抽象层用于提供接口支持,例如包括相机流程CameraPipeline以供相机服务调用Call。
内核层是硬件和软件之间的层。内核层包含显示驱动,摄像头驱动等。
结合捕获视频的一种具体场景,应用程序层下发捕获请求CaptureRequest,请求对应一个录像的流和一个预览流。HAL按照上述的数据流dataflow,回调两路流。其中,预览流送显示,录像的流送mediacodec。
本申请实施例提供的录像视频处理方法可以表现为两种拍摄模式下的多个功能,其中这两种拍摄模式可以是指:电影模式、专业模式。
电影模式是一种与电影主题相关的拍摄模式,在该模式下,电子设备100显示的图像能够从感官上给用户一种观看电影的效果,电子设备100还提供多个与电影主题相关的视频风格模板,用户可以利用这些视频风格模板获得色调调整后的图像或视频,这些图像或视频的色调与电影的色调类似或相同。在本申请以下实施例中,电影模式 至少可提供用户触发LUT功能、HDR10功能的接口。具体关于LUT功能、HDR10功能的描述可以参见以下实施例。
例如,假设电子设备100为手机,在一种可能的实施方式中,如图5所示,电子设备可以响应用户的操作进入电影模式。例如,电子设备100可以检测到用户作用于相机应用程序的触控操作,响应于该操作,电子设备100显示相机应用程序的默认拍照界面。默认拍照界面可包括:预览框、拍摄模式列表、图库快捷键、快门控件等。其中:
预览框可用于显示摄像头193实时采集的图像。电子设备100可以实时刷新其中的显示内容,以便于用户预览摄像头193当前采集的图像。
拍摄模式列表中可以显示有一个或多个拍摄模式选项。这一个或多个拍摄模式选项可以包括:人像模式选项、录像模式选项、拍照模式选项、电影模式选项、专业选项。这一个或多个拍摄模式选项在界面上可以表现为文字信息,例如“人像”、“录像”、“拍照”、“电影”、“专业”。不限于此,这一个或多个拍摄模式选项在界面上还可以表现为图标或者其他形式的交互元素(interactive element,IE)。
图库快捷键可用于开启图库应用程序。图库应用程序是智能手机、平板电脑等电子设备上的一款图片管理的应用程序,又可以称为“相册”,本实施例对该应用程序的名称不做限制。图库应用程序可以支持用户对存储于电子设备100上的图片进行各种操作,例如浏览、编辑、删除、选择等操作。
快门控件可用于监听触发拍照的用户操作。电子设备100可以检测到作用于快门控件的用户操作,响应于该操作,电子设备100可以将预览框中的图像保存为图库应用程序中的图片。另外,电子设备100还可以在图库快捷键中显示所保存的图像的缩略图。也即是说,用户可以点击快门控件来触发拍照。其中,快门控件可以是按钮或者其他形式的控件。
电子设备100可以检测到用户作用于电影模式选项的触控操作,响应于该操作,电子设备显示如图5所示的用户界面。
在一些实施例中,电子设备100可以在启动相机应用程序后默认开启电影模式。不限于此,电子设备100还可以通过其他方式开启电影模式,例如电子设备100还可以根据用户的语音指令开启电影模式,本申请实施例对此不作限制。
电子设备100可以检测到用户作用于电影模式选项的触控操作,响应于该操作,电子设备显示如图5所示的用户界面。
如图5示出的用户界面中包括功能选项,功能选项包括HDR10选项、闪光灯选项、LUT选项、设置选项。这多个功能选项都可以检测到用户的触控操作,并响应于该操作,开启或关闭对应的拍摄功能,例如,HDR10功能、闪光灯功能、LUT功能、设置功能。
电子设备可以开启LUT功能,该LUT功能可以改变预览图像的显示效果。实质上,LUT功能引入了颜色查找表,颜色查找表相当于一个颜色转换模型,该颜色转换模型能够根据输入的色彩值,输出调整后的色彩值。摄像头采集的图像的色彩值相当于输入值,不同的色彩值经过颜色转换模型后,都可以对应得到一个输出值。最终,显示在预览框中的图像即为经过颜色转换模型调整后的图像。电子设备100利用该 LUT功能,显示经过颜色转换模型调整后的色彩值组成的图像,达到调整图像色调的效果。开启LUT功能之后,电子设备100可以提供多个视频风格模板,一个视频风格模板对应一个颜色转换模型,不同的视频风格模板可以给预览图像带来不同的显示效果。并且,这些视频风格模板可以与电影主题相关联,视频风格模板给预览图像带来的色调调整效果可以和电影中的色调接近或相同,为用户营造拍摄电影的氛围感。
另外,在电子设备100开启LUT功能之后,电子设备100可以根据当前预览视频画面,在多个视频风格模板中确定一个视频风格模板,所确定的视频风格模板可以显示在界面中,以便于用户了解当前所确定的视频风格模板,例如多个视频风格模板包括《A》电影风格模板、《B》电影风格模板和《C》电影风格模板,不同的电影风格模板所对应的LUT可以是预先基于对应电影配色风格所生成的,LUT的颜色转换具有对应电影所具有的风格特点。可以预先从电影风格中提取,产生适合移动电子设备的LUT。LUT功能的开启会改变预览视频画面的色调。如图5中示意的,电子设备100确定《A》电影风格模板并进行显示。
在一些实施例中,电子设备100可以根据用户的滑动操作来选择视频风格模板。具体地,当电子设备100检测到用户开启LUT功能的用户操作,显示LUT预览窗口之后,电子设备100可以默认选择位于LUT预览窗口中的第一个视频风格模板,作为电子设备100选中的视频风格模板。之后,电子设备100可以检测到用户作用于LUT预览窗口的左右滑动操作,移动LUT预览窗口中各视频风格模板的位置,当电子设备100不再检测到用户的滑动操作时,电子设备100将LUT预览窗口中显示的第一个视频风格模板作为电子设备100选中的视频风格模板。
在一些实施例中,电子设备100除了可以使用视频风格模板改变预览图像的显示效果,还可以在添加视频风格模板之后,检测到开始录制视频的用户操作,响应于该操作,电子设备100开始录制视频,从而获得使用视频风格模板调整显示效果后的视频。另外,在录制视频的过程中,电子设备100还可以检测到拍摄照片的用户操作,响应于该操作,电子设备100将预览框中添加了视频风格模板的预览图像保存成图片,从而获得使用视频风格模板调整显示效果后的图像。
电子设备可以开启HDR10功能,HDR10模式中,HDR即为高动态范围图像(High-Dynamic Range,HDR),相比于普通的图像,HDR可以提供更多的动态范围和图像细节,能够更好地反映出真实环境中的视觉效果,HDR10中的10即为10比特,HDR10可以以10位高动态范围录制视频。
电子设备100可以检测到用户作用于专业模式选项的触控操作,进入专业模式。如图11所示,电子设备处于专业模式时,用户界面中可以包括的功能选项例如为:LOG选项、闪光灯选项、LUT选项、设置选项,另外,用户界面还包括参数调节选项,例如为:测光M选项、ISO选项、快门S选项、曝光补偿EV选项、对焦方式AF选项和白平衡WB选项。
在一些实施例中,电子设备100可以在启动相机应用程序后默认开启专业模式。不限于此,电子设备100还可以通过其他方式开启专业模式,例如电子设备100还可以根据用户的语音指令开启专业模式,本申请实施例对此不作限制。
电子设备100可以检测到用户作用于LOG选项的用户操作,响应于该操作,电子 设备100开启LOG功能。其中,LOG功能能够将对数函数应用到曝光曲线上,最大限度地保留摄像头采集的图像中,高光和阴影部分的细节,使最终呈现出来的预览图像的饱和度较低。其中,使用LOG功能录制的视频称为LOG视频。
电子设备100通过专业模式除了可以录制添加了视频风格模板的视频,还可以在录制未添加视频风格模板的视频后,为该视频添加视频风格模板,或者,在开启LOG功能后,录制LOG视频,之后再为该LOG视频添加视频风格模板。这样,电子设备100不仅可以在录制视频的之前调整画面的显示效果,还可以在视频录制完成之后,调整录制的视频的显示效果,增加了图像调整的灵活性和自由度。
本申请实施例还提供一种视频处理装置,包括:视频获取模块,用于在第一变焦模式或第二变焦模式下,获取通过摄像头拍摄的视频,视频包括交替的第一曝光帧视频图像和第二曝光帧视频图像,第一曝光帧视频图像的曝光时间大于第二曝光帧视频图像的曝光时间;超分算法模块,用于在第一变焦模式下,对第一曝光帧视频图像进行超分算法处理,超分算法处理用于提高分辨率;融合模块,用于在第一变焦模式下,对经过超分算法处理的第一曝光帧视频图像和未经超分算法处理的第二曝光帧视频图像进行融合,得到融合后的视频,第一曝光帧视频图像具有第一权重;在第二变焦模式下,对第一曝光帧视频图像和第二曝光帧视频图像进行融合,第一曝光帧视频图像具有第二权重,得到融合后的视频,第一权重大于第二权重。
应理解以上视频处理装置的各个模块的划分仅仅是一种逻辑功能的划分,实际实现时可以全部或部分集成到一个物理实体上,也可以物理上分开。且这些模块可以全部以软件通过处理元件调用的形式实现;也可以全部以硬件的形式实现;还可以部分模块以软件通过处理元件调用的形式实现,部分模块通过硬件的形式实现。例如,视频获取模块、超分算法模块和融合模块中的任意一者可以为单独设立的处理元件,也可以集成在视频处理装置中,例如集成在视频处理装置的某一个芯片中实现,此外,也可以以程序的形式存储于视频处理装置的存储器中,由视频处理装置的某一个处理元件调用并执行以上各个模块的功能。其它模块的实现与之类似。此外这些模块全部或部分可以集成在一起,也可以独立实现。这里所述的处理元件可以是一种集成电路,具有信号的处理能力。在实现过程中,上述方法的各步骤或以上各个模块可以通过处理器元件中的硬件的集成逻辑电路或者软件形式的指令完成。
例如,视频获取模块、超分算法模块和融合模块这些模块可以是被配置成实施以上方法的一个或多个集成电路,例如:一个或多个特定集成电路(Application Specific Integrated Circuit,ASIC),或,一个或多个微处理器(digital singnal processor,DSP),或,一个或者多个现场可编程门阵列(Field Programmable Gate Array,FPGA)等。再如,当以上某个模块通过处理元件调度程序的形式实现时,该处理元件可以是通用处理器,例如中央处理器(Central Processing Unit,CPU)或其它可以调用程序的处理器。再如,这些模块可以集成在一起,以片上系统(system-on-a-chip,SOC)的形式实现。
本申请实施例还提供一种视频处理装置,包括:处理器和存储器,存储器用于存储至少一条指令,指令由处理器加载并执行时以实现上述任意实施例中的视频处理方法。
该视频处理装置可以应用上述的视频处理方法,具体过程和原理在此不再赘述。
处理器的数量可以为一个或多个,处理器和存储器可以通过总线或者其他方式连接。存储器作为一种非暂态计算机可读存储介质,可用于存储非暂态软件程序、非暂态计算机可执行程序以及模块,如本申请实施例中的视频处理装置对应的程序指令/模块。处理器通过运行存储在存储器中的非暂态软件程序、指令以及模块,从而执行各种功能应用以及数据处理,即实现上述任意方法实施例中的方法。存储器可以包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需要的应用程序;以及必要数据等。此外,存储器可以包括高速随机存取存储器,还可以包括非暂态存储器,例如至少一个磁盘存储器件、闪存器件、或其他非暂态固态存储器件。
如图1所示,本申请实施例还提供一种电子设备,包括:摄像头193和上述的视频处理装置,视频处理装置包括处理器110。
视频处理装置的具体原理和工作过程与上述实施例相同,在此不再赘述。该电子设备可以是例如手机、电视、平板电脑、手表、手环等任何具有视频拍摄功能的产品或部件。
本申请实施例还提供一种计算机可读存储介质,计算机可读存储介质中存储有计算机程序,当其在计算机上运行时,使得计算机执行上述任意实施例中的视频处理方法。
在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。所述计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行所述计算机程序指令时,全部或部分地产生按照本申请所述的流程或功能。所述计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。所述计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,所述计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线)或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。所述计算机可读存储介质可以是计算机能够存取的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。所述可用介质可以是磁性介质,(例如,软盘、硬盘、磁带)、光介质(例如,DVD)、或者半导体介质(例如固态硬盘Solid State Disk)等。
本申请实施例中,“至少一个”是指一个或者多个,“多个”是指两个或两个以上。“和/或”,描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示单独存在A、同时存在A和B、单独存在B的情况。其中A,B可以是单数或者复数。字符“/”一般表示前后关联对象是一种“或”的关系。“以下至少一项”及其类似表达,是指的这些项中的任意组合,包括单项或复数项的任意组合。例如,a,b和c中的至少一项可以表示:a,b,c,a-b,a-c,b-c,或a-b-c,其中a,b,c可以是单个,也可以是多个。
以上仅为本申请的优选实施例而已,并不用于限制本申请,对于本领域的技术人员来说,本申请可以有各种更改和变化。凡在本申请的精神和原则之内,所作的任何 修改、等同替换、改进等,均应包含在本申请的保护范围之内。
Claims (10)
- 一种视频处理方法,其特征在于,包括:在第一变焦模式或第二变焦模式下,获取通过摄像头拍摄的视频,所述视频包括交替的第一曝光帧视频图像和第二曝光帧视频图像,所述第一曝光帧视频图像的曝光时间大于所述第二曝光帧视频图像的曝光时间;在所述第一变焦模式下,对所述第一曝光帧视频图像进行超分算法处理,所述超分算法处理用于提高分辨率;在所述第一变焦模式下,对经过所述超分算法处理的第一曝光帧视频图像和未经所述超分算法处理的第二曝光帧视频图像进行融合,得到融合后的视频,所述第一曝光帧视频图像具有第一权重;在所述第二变焦模式下,对所述第一曝光帧视频图像和所述第二曝光帧视频图像进行融合,所述第一曝光帧视频图像具有第二权重,得到融合后的视频,所述第一权重大于所述第二权重。
- 根据权利要求1所述的视频处理方法,其特征在于,还包括:若当前使用的摄像头为第一摄像头,且拍摄缩放倍数属于第一缩放范围,且当前拍摄画面的亮度大于第一亮度阈值,则进入所述第一变焦模式;若当前使用的摄像头为所述第一摄像头,且拍摄缩放倍数属于第二缩放范围,所述第二缩放范围小于所述第一缩放范围,则进入所述第二变焦模式;若当前使用的摄像头为所述第一摄像头,且拍摄缩放倍数属于所述第一缩放范围,且当前拍摄画面的亮度不大于所述第一亮度阈值,则进入所述第二变焦模式。
- 根据权利要求2所述的视频处理方法,其特征在于,还包括:若当前使用的摄像头为第二摄像头,且拍摄缩放倍数属于第三缩放范围,且摄像头ISO属于第一ISO范围,所述第三缩放范围小于所述第二缩放范围,所述第二摄像头的焦距小于所述第一摄像头的焦距,则进入所述第一变焦模式;若当前使用的摄像头为所述第二摄像头,且拍摄缩放倍数属于第三缩放范围,且摄像头ISO属于第二ISO范围,且当前拍摄画面的亮度大于第二亮度阈值,所述第二ISO范围大于所述第一ISO范围,则进入所述第二变焦模式;若当前使用的摄像头为所述第二摄像头,且摄像头的缩放倍数属于第四缩放范围,所述第四缩放范围小于所述第三缩放范围,且当前拍摄画面的亮度大于第三亮度阈值,则进入所述第二变焦模式。
- 根据权利要求3所述的视频处理方法,其特征在于,还包括:若当前使用的摄像头为所述第二摄像头,且拍摄缩放倍数属于所述第二缩放范围,且拍摄画面的亮度不大于第四亮度阈值,则进入所述第二变焦模式;若当前使用的摄像头为所述第二摄像头,且拍摄缩放倍数属于所述第二缩放范围,且拍摄距离小于距离阈值,则进入所述第二变焦模式;若当前使用的摄像头为所述第二摄像头,且拍摄缩放倍数属于所述第一缩放范围,且拍摄画面的亮度不大于所述第一亮度阈值,则进入所述第二变焦模式;若当前使用的摄像头为所述第二摄像头,且拍摄缩放倍数属于所述第一缩放范围,且拍摄距离小于距离阈值,则进入所述第一变焦模式。
- 根据权利要求1所述的视频处理方法,其特征在于,还包括:在所述第一变焦模式下,通过所述摄像头当前的感光度ISO所对应的对数LOG曲线对所述融合后的视频行处理,得到LOG视频;基于颜色查找表LUT对所述LOG视频进行处理,得到经过LUT处理后的视频。
- 根据权利要求1所述的视频处理方法,其特征在于,还包括:所述对所述第一曝光帧视频图像进行超分算法处理包括:获取所述第一曝光帧视频图像对应的统计信息;将所述统计信息以及所述第一曝光帧视频图像的RAW图像作为输入进行超分算法处理,得到处理后的第一曝光帧视频图像的RAW图像。
- 根据权利要求5所述的视频处理方法,其特征在于,在第一视频处理流程中执行所述通过所述摄像头当前的感光度ISO所对应的对数LOG曲线对所述融合后的视频行处理,得到LOG视频的过程、以及所述基于颜色查找表LUT对所述LOG视频进行处理,得到经过LUT处理后的视频的过程;所述视频处理方法还包括第二视频处理流程,所述第二视频处理流程包括:通过所述摄像头当前的感光度ISO所对应的对数LOG曲线对所述融合后的视频行处理,得到LOG视频;基于查找表LUT对所述LOG视频进行处理,得到经过LUT处理后的视频;所述视频处理方法还包括:将所述第一视频处理流程中经过LUT处理后的视频进行保存;将所述第二视频处理流程中经过LUT处理后的视频进行预览。
- 一种视频处理装置,其特征在于,包括:处理器和存储器,所述存储器用于存储至少一条指令,所述指令由所述处理器加载并执行时以实现如权利要求1至7中任意一项所述的视频处理方法。
- 一种电子设备,其特征在于,包括:摄像头;如权利要求8所述的视频处理装置。
- 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质中存储有计算机程序,当其在计算机上运行时,使得计算机执行如权利要求1至7中任意一项所述的视频处理方法。
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
EP22855030.7A EP4287604A1 (en) | 2021-08-12 | 2022-05-24 | Video processing method and apparatus, electronic device, and storage medium |
US18/548,465 US20240236492A9 (en) | 2021-08-12 | 2022-05-24 | Video Processing Method and Apparatus, Electronic Device, and Storage Medium |
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110926921.0 | 2021-08-11 | ||
CN202110926921.0A CN115706870B (zh) | 2021-08-12 | 2021-08-12 | 视频处理方法、装置、电子设备和存储介质 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2023016044A1 true WO2023016044A1 (zh) | 2023-02-16 |
Family
ID=85181024
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2022/094782 WO2023016044A1 (zh) | 2021-08-12 | 2022-05-24 | 视频处理方法、装置、电子设备和存储介质 |
Country Status (4)
Country | Link |
---|---|
US (1) | US20240236492A9 (zh) |
EP (1) | EP4287604A1 (zh) |
CN (1) | CN115706870B (zh) |
WO (1) | WO2023016044A1 (zh) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117560574B (zh) * | 2024-01-10 | 2024-06-18 | 荣耀终端有限公司 | 一种拍摄方法、电子设备和可读存储介质 |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106251365A (zh) * | 2016-07-22 | 2016-12-21 | 北京邮电大学 | 多曝光视频融合方法及装置 |
CN106408518A (zh) * | 2015-07-30 | 2017-02-15 | 展讯通信(上海)有限公司 | 图像融合方法、装置及终端设备 |
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 |
CN110087003A (zh) * | 2019-04-30 | 2019-08-02 | 深圳市华星光电技术有限公司 | 多曝光图像融合方法 |
CN110619593A (zh) * | 2019-07-30 | 2019-12-27 | 西安电子科技大学 | 一种基于动态场景的双曝光视频成像系统 |
CN111510698A (zh) * | 2020-04-23 | 2020-08-07 | 惠州Tcl移动通信有限公司 | 图像处理方法、装置、存储介质及移动终端 |
CN111917950A (zh) * | 2020-06-30 | 2020-11-10 | 北京迈格威科技有限公司 | 图像处理方法、装置、电子设备及存储介质 |
Family Cites Families (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR20100056279A (ko) * | 2008-11-19 | 2010-05-27 | 삼성전자주식회사 | 디지털 영상 처리장치 및 그 제어방법 |
US9342871B2 (en) * | 2014-05-30 | 2016-05-17 | Apple Inc. | Scene motion correction in fused image systems |
CN106791377B (zh) * | 2016-11-29 | 2019-09-27 | Oppo广东移动通信有限公司 | 控制方法、控制装置及电子装置 |
WO2019071613A1 (zh) * | 2017-10-13 | 2019-04-18 | 华为技术有限公司 | 一种图像处理方法及装置 |
WO2019183813A1 (zh) * | 2018-03-27 | 2019-10-03 | 华为技术有限公司 | 一种拍摄方法及设备 |
CN109005342A (zh) * | 2018-08-06 | 2018-12-14 | Oppo广东移动通信有限公司 | 全景拍摄方法、装置和成像设备 |
CN110445988B (zh) * | 2019-08-05 | 2021-06-25 | Oppo广东移动通信有限公司 | 图像处理方法、装置、存储介质及电子设备 |
-
2021
- 2021-08-12 CN CN202110926921.0A patent/CN115706870B/zh active Active
-
2022
- 2022-05-24 EP EP22855030.7A patent/EP4287604A1/en active Pending
- 2022-05-24 WO PCT/CN2022/094782 patent/WO2023016044A1/zh active Application Filing
- 2022-05-24 US US18/548,465 patent/US20240236492A9/en active Pending
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106408518A (zh) * | 2015-07-30 | 2017-02-15 | 展讯通信(上海)有限公司 | 图像融合方法、装置及终端设备 |
CN106251365A (zh) * | 2016-07-22 | 2016-12-21 | 北京邮电大学 | 多曝光视频融合方法及装置 |
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 |
CN110087003A (zh) * | 2019-04-30 | 2019-08-02 | 深圳市华星光电技术有限公司 | 多曝光图像融合方法 |
CN110619593A (zh) * | 2019-07-30 | 2019-12-27 | 西安电子科技大学 | 一种基于动态场景的双曝光视频成像系统 |
CN111510698A (zh) * | 2020-04-23 | 2020-08-07 | 惠州Tcl移动通信有限公司 | 图像处理方法、装置、存储介质及移动终端 |
CN111917950A (zh) * | 2020-06-30 | 2020-11-10 | 北京迈格威科技有限公司 | 图像处理方法、装置、电子设备及存储介质 |
Also Published As
Publication number | Publication date |
---|---|
US20240236492A9 (en) | 2024-07-11 |
EP4287604A1 (en) | 2023-12-06 |
CN115706870A (zh) | 2023-02-17 |
US20240137650A1 (en) | 2024-04-25 |
CN115706870B (zh) | 2023-12-26 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2023016035A1 (zh) | 视频处理方法、装置、电子设备和存储介质 | |
WO2023016039A1 (zh) | 视频处理方法、装置、电子设备和存储介质 | |
WO2023016037A1 (zh) | 视频处理方法、装置、电子设备和存储介质 | |
CN113824914B (zh) | 视频处理方法、装置、电子设备和存储介质 | |
US10600170B2 (en) | Method and device for producing a digital image | |
CN114449199B (zh) | 视频处理方法、装置、电子设备和存储介质 | |
WO2023016044A1 (zh) | 视频处理方法、装置、电子设备和存储介质 | |
WO2023016040A1 (zh) | 视频处理方法、装置、电子设备和存储介质 | |
WO2023016043A1 (zh) | 视频处理方法、装置、电子设备和存储介质 | |
WO2023016042A1 (zh) | 视频处理方法、装置、电子设备和存储介质 | |
WO2023016041A1 (zh) | 视频处理方法、装置、电子设备和存储介质 | |
WO2023016038A1 (zh) | 视频处理方法、装置、电子设备和存储介质 | |
US20240080544A1 (en) | Imaging apparatus, control method for imaging apparatus, and control program | |
CN115706853A (zh) | 视频处理方法、装置、电子设备和存储介质 | |
JP2018133658A (ja) | 画像処理装置、制御方法およびプログラム |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
WWE | Wipo information: entry into national phase |
Ref document number: 18548465 Country of ref document: US |
|
ENP | Entry into the national phase |
Ref document number: 2022855030 Country of ref document: EP Effective date: 20230829 |
|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 22855030 Country of ref document: EP Kind code of ref document: A1 |
|
NENP | Non-entry into the national phase |
Ref country code: DE |