Video processing method, video processing apparatus, electronic device and medium

By acquiring video frames of multiple camera modules and performing image fusion processing in the video processing method of the mobile terminal, the problem of excessive picture jitter and too large differences during the camera module switching is solved, and the smoothness and effect of video shooting is improved.

WO2025108228A1PCT designated stage expired Publication Date: 2025-05-30VIVO MOBILE COMM CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/132666
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-11-20
Filing Date
2024-11-18
Publication Date
2025-05-30

AI Technical Summary

Technical Problem

When using a mobile terminal equipped with multiple camera modules to shoot video, the video shaking, lag, and excessive differences in color and brightness are prone to occur during the switching of camera modules, resulting in poor video shooting effects.

Method used

By acquiring the video frames collected simultaneously by the first camera module and the second camera module, the first area image in the video frame with a larger field of view angle is intercepted, and the video frame with a smaller field of view angle is image fusion processed with the area image to generate the fused video frame to reduce picture differences.

Benefits of technology

It effectively reduces the jitter and stuttering of the video image during the camera module switching process, reduces the color and brightness differences, and improves the smoothness and effect of video shooting.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024132666_30052025_PF_FP_ABST
    Figure CN2024132666_30052025_PF_FP_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of video data processing, and discloses a video processing method, a video processing apparatus, an electronic device, and a medium. The video processing method is applied to the electronic device, the electronic device comprises a first camera module and a second camera module, and the video processing method comprises: in the process of switching from the first camera module to the second camera module for video filming, obtaining a first video frame acquired by the first camera module and a second video frame acquired by the second camera module, the first video frame and the second video frame being acquired at the same time; intercepting a first area image in the second video frame; and carrying out image fusion processing on the first video frame and the first area image to obtain a third video frame.
Need to check novelty before this filing date? Find Prior Art

Description

Video processing method, video processing device, electronic equipment and medium

[0001] CROSS-REFERENCE TO RELATED APPLICATIONS

[0002] This application claims priority to the Chinese patent application filed with the China Patent Office on November 20, 2023, with application number 202311550337.5 and titled “Video Processing Method, Video Processing Device, Electronic Device and Medium,” the entire contents of which are incorporated by reference into this application. Technical Field

[0003] The present application belongs to the field of video data processing technology, and specifically relates to a video processing method, a video processing device, an electronic device and a medium. Background Art

[0004] In order to meet people's increasing photography needs, mobile terminals equipped with multiple camera modules are becoming increasingly popular. Among them, the lenses of each of the multiple camera modules can have different focal lengths for zoom shooting at different focal lengths.

[0005] However, when using a mobile terminal equipped with multiple camera modules for video capture, it's inevitable that different camera modules need to be used for switching shots. However, different camera modules often have different configurations. For example, different camera modules may have different image sensors or be installed in different locations. These differences can cause jitter, freezes, and significant color and brightness differences between frames captured before and after the switch, resulting in poor video quality. Summary of the Invention

[0006] The purpose of the embodiments of the present application is to provide a video processing method, a video processing device and an electronic device, which can solve the image problems that occur during the switching shooting process of the current camera module.

[0007] In a first aspect, an embodiment of the present application provides a video processing method, which is applied to an electronic device, wherein the electronic device includes: a first camera module and a second camera module, and the method includes:

[0008] In a process of switching from the first camera module to the second camera module for video shooting, obtaining a first video frame captured by the first camera module and a second video frame captured by the second camera module, wherein the first video frame and the second video frame are captured simultaneously;

[0009] intercepting an image of the first region in a third video frame, where the third video frame is a video frame captured using a relatively large field of view angle between the first video frame and the second video frame;

[0010] Image fusion processing is performed on the fourth video frame and the first area image to obtain a fifth video frame, where the fourth video frame is a video frame captured using a relatively smaller field of view angle between the first video frame and the second video frame.

[0011] In a second aspect, an embodiment of the present application provides a video processing device, which is applied to an electronic device, wherein the electronic device includes: a first camera module and a second camera module, and the device includes:

[0012] an acquisition module, configured to acquire, during a process of switching from the first camera module to the second camera module for video shooting, a first video frame captured by the first camera module and a second video frame captured by the second camera module, wherein the first video frame and the second video frame are acquired simultaneously;

[0013] a capture module, configured to capture an image of the first region in a third video frame, wherein the third video frame is a video frame captured using a relatively large field of view angle between the first video frame and the second video frame;

[0014] A fusion module is used to perform image fusion processing on the fourth video frame and the first area image to obtain a fifth video frame, where the fourth video frame is a video frame captured using a relatively small field of view angle between the first video frame and the second video frame.

[0015] In a third aspect, an embodiment of the present application provides an electronic device, comprising: a first camera module, a second camera module, a processor and a memory, wherein the memory stores programs or instructions that can be run on the processor, and when the programs or instructions are executed by the processor, the steps of the video processing method as described in any one of the first aspects are implemented.

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

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

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

[0019] In an embodiment of the present application, during the process of switching from the first camera module to the second camera module for video capture, the first video frame and the second video frame captured simultaneously by the first camera module and the second camera module are obtained to intercept the first area image in the second video frame, and the first video frame and the first area image are subjected to image fusion processing to obtain a third video frame. In this technical solution, since the first video frame is captured by the first camera module before the switch, and the second video frame is captured by the second camera module after the switch. Therefore, by performing image fusion processing on the first video frame and the first area image in the second video frame, the video frame captured with a relatively small field of view angle and the video frame captured with a relatively large field of view angle, the image features in the first video frame and the second video frame can be integrated to a certain extent, and the image difference features that may exist in the two pictures taken by two different camera modules can be eliminated, so that the fifth video frame obtained after image fusion processing is closer to the first video frame than the second video frame, and the video picture taken during the switching shooting process of the camera module is more likely to not have picture problems such as jitter, freeze, and excessive color and brightness differences between the video frames taken before and after switching, thereby improving the smoothness of the picture taken during the switching shooting process of the camera module and improving the video shooting effect. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] FIG1 is a flow chart of a video processing method provided by an embodiment of the present application;

[0021] FIG2 is a schematic diagram of a first region image capture method according to an embodiment of the present application;

[0022] FIG3 is another schematic diagram of a first region image capture method according to an embodiment of the present application;

[0023] FIG4 is a schematic diagram of another principle for capturing the first region image provided by an embodiment of the present application;

[0024] FIG5 is a schematic diagram showing the principle of an image fusion method provided in an embodiment of the present application;

[0025] FIG6 is a schematic diagram of a video frame provided in an embodiment of the present application;

[0026] FIG7 is another schematic diagram of a video frame provided in an embodiment of the present application;

[0027] FIG8 is a flowchart of another video processing method provided in an embodiment of the present application;

[0028] FIG9 is a schematic diagram showing a principle of consistency processing provided by an embodiment of the present application;

[0029] FIG10 is a schematic diagram of a video frame processing method provided by an embodiment of the present application;

[0030] FIG11 is a schematic diagram of another video frame processing method provided by an embodiment of the present application;

[0031] FIG12 is a schematic structural diagram of an electronic device provided in an embodiment of the present application;

[0032] FIG13 is a block diagram of a video processing device provided in an embodiment of the present application;

[0033] FIG14 is a schematic structural diagram of another electronic device provided in an embodiment of the present application;

[0034] FIG15 is a schematic structural diagram of another electronic device provided in an embodiment of the present application. Specific embodiments

[0035] The following will be combined with the accompanying drawings in the embodiments of the present application to clearly describe the technical solutions in the embodiments of the present application. Obviously, the embodiments described are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field are within the scope of protection of this application.

[0036] The terms "first," "second," and the like in the specification and claims of this application are used to distinguish similar objects, and are not used to describe a specific order or precedence. It should be understood that the terms used in this manner are interchangeable where appropriate, so that the embodiments of this application can be implemented in an order other than that illustrated or described herein, and that the objects distinguished by "first," "second," and the like are generally of the same type, and do not limit the number of objects; for example, the first object can be one or more. In addition, the term "and / or" in the specification and claims refers to at least one of the connected objects, and the character " / " generally indicates that the objects connected are in an "or" relationship.

[0037] The data processing method, sub-chip and electronic device provided in the embodiments of the present application are described in detail below with reference to the accompanying drawings through specific embodiments and their application scenarios.

[0038] Please refer to Figure 1, which shows a flow chart of a video processing method provided by an embodiment of the present application. The video processing method can be applied to an electronic device, and the electronic device includes: a first camera module and a second camera module. Optionally, the electronic device can be a mobile terminal. The mobile terminal can refer to a mobile phone, a tablet, a computer, a wearable device, etc. As shown in Figure 1, the video processing method includes:

[0039] Step 101: When switching from a first camera module to a second camera module for video shooting, a first video frame captured by the first camera module and a second video frame captured by the second camera module are acquired. The first video frame and the second video frame are acquired simultaneously.

[0040] In the embodiment of the present application, when switching from the first camera module to the second camera module for video capture, the first camera module and the second camera module are both in operation and simultaneously capture video frames. The electronic device obtains the video frames captured simultaneously by the first camera module and the second camera module for subsequent processing.

[0041] In an optional implementation, the electronic device may include a main control chip and an image processing chip, and the main control chip and the image processing chip are connected. The raw image data collected by the first camera module and the second camera module can be transmitted to the image processing chip via the main control chip, so that the image processing chip executes the video processing method provided in the embodiment of the present application. The process of the electronic device obtaining the first video frame collected by the first camera module and the second video frame collected by the second camera module may include:

[0042] The main control chip performs image preprocessing on the original image data collected by the first camera module to obtain a first video frame; the main control chip performs image preprocessing on the original image data collected by the second camera module to obtain a second video frame; the main control chip transmits the first video frame and the second video frame to the image processing chip.

[0043] The main control chip can receive raw image data collected simultaneously by the first and second camera modules during the process of switching from the first camera module to the second camera module for video capture. Image preprocessing is performed on the raw image data from the first camera module to obtain a first video frame; and image preprocessing is performed on the raw image data from the second camera module to obtain a second video frame. Optionally, image preprocessing can include at least one of the following processing methods: bad pixel removal, lens correction, gain processing, etc.

[0044] In this way, the main control chip is used to pre-process the original image data collected by the first camera module and the second camera module to obtain the first video frame and the second video frame. Not only can the image data quality of the first video frame and the second video frame be improved, which is convenient for subsequent processing effects. In addition, using the main control chip to perform image pre-processing can also share the processing work of the image processing chip and improve the processing efficiency of the image processing chip. Accordingly, the video processing method performed using the first video frame and the second video frame is executed by the image processing chip instead of the main control chip, which also reduces the processing work of the main control chip and reduces the power consumption of the main control chip.

[0045] In another optional implementation, the electronic device may include an image processing chip. The raw image data collected by the first camera module and the second camera module may be directly transmitted to the image processing chip, so that the image processing chip executes the video processing method provided in the embodiment of the present application.

[0046] Correspondingly, the process of the electronic device obtaining the first video frame captured by the first camera module and the second video frame captured by the second camera module may include: the image processing chip performs image preprocessing on the original image data captured by the first camera module to obtain the first video frame; the image processing chip performs image preprocessing on the original image data captured by the second camera module to obtain the second video frame.

[0047] Step 102: Capture an image of the first region in a third video frame. The third video frame is a video frame captured using a relatively large field of view between the first and second video frames.

[0048] There are two switching situations in the embodiment of the present application. In the first switching situation, the first field of view (FOV) of the first camera module is greater than the second field of view of the second camera module. When the first camera module is switched to the second camera module for video shooting, it is switching from a large field of view to a small field of view for video shooting. In the second switching situation, the first field of view of the first camera module is less than the second field of view of the second camera module. When the first camera module is switched to the second camera module for video shooting, it is switching from a small field of view to a large field of view for video shooting. In the embodiment of the present application, the electronic device can intercept the first area image in the third video frame captured using a relatively large field of view for subsequent processing. It is not difficult to understand that if the first field of view is greater than the second field of view, the third video frame is the first video frame. If the first field of view is less than the second field of view, the third video frame is the second video frame.

[0049] The first region image and the fourth video frame are of equal size. The fourth video frame is the video frame captured using the smaller field of view of the first and second video frames. It is readily understood that if the first field of view angle is greater than the second field of view angle, the fourth video frame is the second video frame. If the first field of view angle is less than the second field of view angle, the fourth video frame is the first video frame.

[0050] Moreover, when the overlapping range of the second field of view angle and the first field of view angle is the second field of view angle or the first field of view angle, that is, the first field of view angle covers all the second field of view angles, or the second field of view angle covers all the first field of view angles, the center of the first area image coincides with the center of the fourth video frame.

[0051] For example, assuming that the second field of view angle is greater than the first field of view angle, the third video frame is the second video frame, and the fourth video frame is the first video frame. As shown in Figure 2, the second field of view angle covers the entire first field of view angle, the second video frame captured by the second camera module is 201, and the first video frame captured by the first camera module is 202. Intercept the first area image of the second video frame 201 that coincides with the center of the first video frame 201 and is the same size as that of the first video frame 201. As shown in Figure 3, the second field of view angle covers part of the first field of view angle. The second video frame captured by the second camera module is 201, and the first video frame captured by the first camera module is 202. Intercept the first area image 2011 of the second video frame 201 that is the same size as that of the second video frame 201.

[0052] As a further example, as shown in Figure 4, assuming that the second field of view of the second camera module is greater than the first field of view of the first camera module, the third video frame is the second video frame, and the fourth video frame is the first video frame. When the focus distance when capturing the first and second video frames is distance_0, the second field of view covers the entire first field of view, and the edge of the second field of view does not overlap with the edge of the first field of view. The center of the first area image is aligned with the center of the first video frame, and the first area image is the same size as the first video frame. When the focus distance when capturing the first and second video frames is distance_1, the second field of view covers the entire first field of view, and there is an overlapping edge between the edge of the second field of view and the edge of the first field of view, the center of the first area image is aligned with the center of the first video frame, and the first area image is the same size as the first video frame. When the focus distance when capturing the first and second video frames is distance_2, the second field of view covers part of the first field of view, the center of the first area image is not aligned with the center of the first video frame, and the first area image is the same size as the first video frame. It should be noted that in FIG5 , the first region image is represented by an unfilled rectangle, the first video frame is represented by a filled rectangle with slashes, and the centers of the first region image and the first video frame are represented by a circle.

[0053] In some embodiments of the present application, the electronic device can align the first field of view angle and the second field of view angle using a calibration method according to the focusing distance. Taking the situation shown in Figure 5 as an example, the specific sizes of the first field of view angle and the second field of view angle of the first camera module and the second camera module are different at different focusing distances. For example, after the setting positions and angles of the first camera module and the second camera module on the electronic device are fixed, the difference in field of view angle between the two is relatively fixed at each focusing distance. Therefore, when the electronic device covers the complete first field of view angle with the second field of view angle, the second video frame and the first video frame can be aligned with the center of the first video frame according to the real-time focusing distance, so that the first video frame and the second video frame overlap, and smooth switching is achieved.

[0054] Optionally, before capturing the first region image in the third video frame, the electronic device may first determine the center position of the first region image and obtain the first horizontal length and first vertical length of the fourth video frame. Then, based on the center position, the first horizontal length, and the first vertical length, the electronic device captures the first region image in the third video frame. The horizontal length of the first region image is the first horizontal length, and the vertical length of the first region image is the first vertical length.

[0055] Based on this, before capturing the first area image in the third video frame in step 102, the electronic device may further perform steps 01 and 02.

[0056] In step 01, the focus distance when the first video frame and the second video frame are captured, and the first horizontal length and the first vertical length of the fourth video frame are obtained.

[0057] The focus distance refers to the sum of the distance from the lens to the subject and the distance from the lens to the image sensor in the first camera module / second camera module. Since the focus distances of the first camera module and the second camera module are approximately equal when the first camera module and the second camera module are simultaneously capturing video, the focus distance acquired by the electronic device can be the focus distance of either the first camera module or the second camera module.

[0058] In step 02, the center position of the first area image is calculated based on the focusing distance, the first field of view angle of the first camera module, the second field of view angle of the second camera module, and the relative position of the first camera module and the second camera module.

[0059] In some embodiments of the present application, the electronic device can calculate the horizontal and vertical distances between the center of the first area image and the edge of the field of view angle corresponding to the third video frame based on the focusing distance, the first field of view angle of the first camera module, the second field of view angle of the second camera module, and the relative positions of the first camera module and the second camera module to obtain the center position of the first area image.

[0060] For example, taking the case where the second field of view angle is greater than the first field of view angle, as shown in Figure 2, the electronic device calculates the horizontal distance dx and the vertical distance dy between the center of the first area image and the edge of the field of view angle corresponding to the second video frame, and obtains the center position (dx, dy) of the first area image.

[0061] Optionally, the electronic device can use the first formula and the second formula to calculate the center position of the first area image based on the focusing distance, the center position of the fourth video frame, the first field of view angle of the first camera module, the second field of view angle of the second camera module, and the relative position of the first camera module and the second camera module.

[0062] Among them, the first formula satisfies:

[0063] The second formula satisfies:

[0064] Among them, x2 represents the horizontal coordinate of the center position of the first area image, that is, dx. y2 represents the vertical coordinate of the center position of the first area image, that is, dy. Δdx represents the relative position of the first camera module and the second camera module in the horizontal direction. Δdy represents the relative position of the first camera module and the second camera module in the vertical direction. L represents the focus distance. θ1 represents the field of view corresponding to the fourth video frame. θ2 represents the field of view corresponding to the third video frame. x1 represents the horizontal coordinate of the center position of the fourth video frame. y1 represents the vertical coordinate of the center position of the fourth video frame. PixeSize1 represents the pixel size of the fourth video frame, that is, the pixel size of the image captured at the field of view corresponding to the fourth video frame. PixeSize2 represents the pixel size of the third video frame, that is, the pixel size of the image captured at the field of view corresponding to the third video frame.

[0065] Taking the example where the second field of view angle is greater than the first field of view angle, θ1 represents the first field of view angle. θ2 represents the second field of view angle. x1 represents the horizontal coordinate of the center position of the first video frame. y1 represents the vertical coordinate of the center position of the first video frame. PixeSize1 represents the pixel size of the image captured at the first field of view angle. PixeSize2 represents the pixel size of the image captured at the second field of view angle. As shown in Figure 4, when the focus distance when capturing the first video frame and the second video frame is distance_0, the electronic device calculates the horizontal distance dx_0 and the vertical distance dy_0 between the center of the first area image and the edge of the first field of view angle, and obtains the center position of the first area image (dx_0, dy_0). When the focus distance when capturing the first video frame and the second video frame is distance_1, the electronic device calculates the horizontal distance dx_1 and the vertical distance dy_1 between the center of the first area image and the edge of the first field of view angle, and obtains the center position of the first area image (dx_1, dy_1). When the focus distance when capturing the first and second video frames is distance_2, the electronic device calculates the horizontal distance dx_2 and the vertical distance dy_2 between the center of the first region image and the edge of the first field of view, and obtains the center position of the first region image (dx_2, dy_2). It should be noted that Figure 4 only shows the horizontal distance between the center of the first region image and the edge of the first field of view.

[0066] Step 103: Perform image fusion processing on the fourth video frame and the first region image to obtain a fifth video frame. The fourth video frame is a video frame captured using a relatively small field of view angle between the first video frame and the second video frame.

[0067] Optionally, the electronic device may directly perform image fusion processing on the fourth video frame and the first region image to obtain a fifth video frame. The image fusion processing may be alpha fusion, pyramid fusion, or Poisson fusion.

[0068] However, when the field of view corresponding to the third video frame partially overlaps the field of view corresponding to the fourth video frame, or when the field of view corresponding to the third video frame does not completely overlap the field of view corresponding to the fourth video frame, there is an image offset between the third and fourth video frames, which in turn causes an image offset between the first region image and the fourth video frame. As shown in Figures 3 and 4, when the second field of view partially overlaps the first field of view, there is an image offset between the first and second video frames, which in turn causes an image offset between the first region image and the first video frame. As the overlap between the second and first field of view angles decreases, the offset between the first and second video frames increases, and the offset between the first region image and the first video frame increases. Even when the second and first field of view angles do not overlap, the first and second video frames may not have overlapping images, and the first region image and the first video frame may not have overlapping images. As shown in Figure 4, when the focus distance changes from distance_1 to distance_2, there is a relative offset between the first and second video frames, and the first region image and the first video frame are relatively offset.

[0069] However, the degree of offset between the first area image and the fourth video frame directly affects the degree of overlap between the first area image and the fourth video frame, and further directly affects the fusion effect of the first area image and the fourth video frame. Therefore, in some embodiments of the present application, in order to reduce the offset between the first video frame and the second video frame, and the impact of the offset between the first area image and the fourth video frame on the image fusion effect, the electronic device can, when the overlapping range of the second field of view angle and the first field of view angle is not the second field of view angle or the first field of view angle, that is, when the field of view angle corresponding to the third video frame partially covers the field of view angle corresponding to the fourth video frame, or when the field of view angle corresponding to the third video frame does not cover the field of view angle corresponding to the fourth video frame, fade the first area image or the fourth video frame to reduce the transparency of the first area image or the fourth video frame, reduce the degree of visual non-overlap between the first area image and the fourth video frame, improve the image fusion effect of the first area image and the fourth video frame, ensure the smoothness of the captured image during the camera module switching shooting process, and improve the video shooting effect.

[0070] Optionally, the electronic device performs image fusion processing on the fourth video frame and the first region image to obtain a fifth video frame, which may include the following steps 1031 to 1032 .

[0071] In step 1031, when the overlapping range of the second field of view angle of the second camera module and the first field of view angle of the first camera module is the second field of view angle or the first field of view angle, the fourth video frame and the first area image are subjected to image fusion processing to obtain a fifth video frame.

[0072] The overlapping range of the second field of view angle and the first field of view angle is the second field of view angle or the first field of view angle, that is, the first field of view angle completely covers the second field of view angle, or the second field of view angle completely covers the first field of view angle. When the overlapping range of the second field of view angle of the second camera module and the first field of view angle of the first camera module is the second field of view angle or the first field of view angle, the first area image and the fourth video frame completely overlap and there is no offset issue. The electronic device can directly perform image fusion processing on the fourth video frame and the first area image to obtain a fifth video frame with a better image fusion effect.

[0073] For example, in the case shown in FIG2 and in FIG4 at focus distances of distance_0 and distance_1, the first region image and the fourth video frame completely overlap, and there is no offset problem. The electronic device directly performs image fusion processing on the fourth video frame and the first region image.

[0074] In step 1032, when the overlapping range of the second field of view angle and the first field of view angle is not the second field of view angle or the first field of view angle, the transparency of the target image is reduced, and image fusion processing is performed on the fourth video frame and the first area image to obtain a fifth video frame.

[0075] The target image is all or part of the first video frame captured by the first camera module. If the third video frame is the first video frame, the target image is a portion of the first video frame, i.e., the first region image. If the third video frame is the second video frame, the target image is the fourth video frame, i.e., the first video frame.

[0076] The overlapping range of the second field of view angle and the first field of view angle is not the second field of view angle or the first field of view angle, that is, the overlapping range of the second field of view angle and the first field of view angle is part of the second field of view angle, or part of the first field of view angle, or the second field of view angle and the first field of view angle do not have an overlapping range.

[0077] If the overlap range between the second field of view angle and the first field of view angle is not the second field of view angle or the first field of view angle, the first region image and the fourth video frame may not completely overlap, resulting in an offset. The electronic device may reduce the transparency of the target image and perform image fusion processing on the fourth video frame and the first region image to obtain a fifth video frame. Alternatively, the electronic device may reduce the transparency of the target image by a target value. The target value may be determined based on the actual image fusion effect. Alternatively, the target value may be user-defined.

[0078] 5 , taking the third video frame as the second video frame and the fourth video frame as the first video frame as an example, the first region image 501 is offset in a first direction r compared to the first video frame 502 .

[0079] The electronic device captures first region image 501 in the second video frame and reduces the transparency of first video frame 502. The first video frame 502 with reduced transparency is fused with first region image 501 to obtain a fifth video frame 503. It should be noted that the dotted line in fifth video frame 503 in FIG5 indicates that the transparency of first video frame 502 has been reduced.

[0080] In this way, when the overlapping range of the second field of view angle and the first field of view angle is not the second field of view angle or the first field of view angle, by reducing the transparency of the target image, that is, when there is an image offset problem between the first area image and the fourth video frame, by reducing all or part of the image of the first video frame captured by the first camera module, it is possible to reduce the degree of visual non-overlap between the first area image and the fourth video frame, so that the fifth video frame after image fusion retains more image features of the second video frame captured by the switching target module (i.e., the second camera module). Therefore, on the basis of improving the image fusion effect of the first area image and the fourth video frame, the camera module switching shooting effect is improved.

[0081] Optionally, the degree of reduction in the target image's transparency can be inversely proportional to the extent of the overlap between the second field of view angle and the first field of view angle. That is, the smaller the overlap between the second field of view angle and the first field of view angle, the lower the target image's transparency. Based on this, the process of the electronic device reducing the target image's transparency can include: determining an adjustment variable value based on the ratio of the second field of view angle to the first field of view angle; and reducing the target image's transparency based on the adjustment variable value.

[0082] The ratio of the second field of view angle to the first field of view angle is inversely proportional to the adjustment variable value. The adjustment variable value is a variable that reduces the transparency of the target image. For example, the adjustment variable value can be the sum of the product of the ratio and the adjustment coefficient and the baseline variable value. The adjustment coefficient is greater than 1.

[0083] Thus, when the overlap between the first and second field of view angles decreases, the offset between the first and second video frames increases, leading to a greater offset between the first region image and the fourth video frame. Therefore, by determining the ratio of the second field of view angle to the first, an adjustment variable value inversely proportional to this ratio is used. The target image's transparency is then reduced based on the adjustment variable value. This allows the target image's transparency to decrease more as the ratio of the second field of view angle to the first decreases, further reducing the visual non-overlap between the first region image and the fourth video frame, and improving the image fusion effect between the first region image and the fourth video frame.

[0084] In an embodiment of the present application, in the process of switching from the first camera module to the second camera module for video shooting, the first area image in the third video frame is captured, and the fourth video frame and the first area image are subjected to image fusion processing, so that in the process of switching from the first camera module to the second camera module for video shooting, the electronic device can obtain and output the fifth video frame after fusion processing.

[0085] Thus, as shown in FIG6 , when the first camera module is used for video shooting, the first camera module is triggered to switch to the second camera module for video shooting, and then the camera module is switched to the second camera module for video shooting, the entire video obtained by shooting mainly includes three video frames. The three video frames include: a first video frame 601 collected in the first stage of video shooting using the first camera module, a fifth video frame 602 after image fusion processing in the second stage of video shooting from the first camera module to the second camera module, and a second video frame 603 collected in the third stage of video shooting using the second camera module.

[0086] In the related art, as shown in FIG7 , when a first camera module is used to shoot a video, a trigger is triggered to switch from the first camera module to the second camera module to shoot a video, and then the camera module is switched to the second camera module to shoot a video, the entire video obtained by shooting mainly includes two video frames. The two video frames include: a first video frame 601 captured by the first camera module in the first and second stages, and a second video frame 603 captured by the second camera module in the third stage. However, the configurations of different camera modules are usually different. For example, different camera modules have different image sensors and different installation positions. These differences may cause jitter, freeze, and excessive color and brightness differences between the video frames shot before and after the switch during the switching shooting process of the camera module, resulting in poor video shooting effects.

[0087] In an embodiment of the present application, during the process of switching from the first camera module to the second camera module for video capture, the first video frame and the second video frame captured simultaneously by the first camera module and the second camera module are obtained to intercept the first area image in the second video frame, and the first video frame and the first area image are subjected to image fusion processing to obtain a third video frame. In this technical solution, since the first video frame is captured by the first camera module before the switch, and the second video frame is captured by the second camera module after the switch. Therefore, by performing image fusion processing on the first video frame and the first area image in the second video frame, the video frame captured with a relatively small field of view angle and the video frame captured with a relatively large field of view angle, the image features in the first video frame and the second video frame can be integrated to a certain extent, and the image difference features that may exist in the two pictures taken by two different camera modules can be eliminated, so that the fifth video frame obtained after image fusion processing is closer to the first video frame than the second video frame, and the video picture taken during the switching shooting process of the camera module is more likely to not have picture problems such as jitter, freeze, and excessive color and brightness differences between the video frames taken before and after switching, thereby improving the smoothness of the picture taken during the switching shooting process of the camera module and improving the video shooting effect.

[0088] Please refer to Figure 8, which shows a flow chart of another video processing method provided by an embodiment of the present application. The video processing method can be applied to an electronic device, and the electronic device includes: a first camera module and a second camera module. Optionally, the electronic device can be a mobile terminal. The mobile terminal can refer to a mobile phone, a tablet, a computer, a wearable device, etc. As shown in Figure 8, the video processing method includes:

[0089] Step 801: During a process of switching from a first camera module to a second camera module for video shooting, a first video frame captured by the first camera module and a second video frame captured by the second camera module are acquired. The first video frame and the second video frame are acquired simultaneously.

[0090] The explanation and implementation of this step can refer to the explanation and implementation of the aforementioned step 101, and will not be repeated here in the embodiment of the present application.

[0091] Step 802: When the overlapping range of the second field of view angle of the second camera module and the first field of view angle of the first camera module is the second field of view angle or the first field of view angle, the second video frame is corrected for brightness and color consistency based on the brightness difference information and color difference information of the second video frame compared with the first video frame to obtain a processed second video frame.

[0092] Optionally, when the second field of view angle of the second camera module and the first field of view angle of the first camera module overlap within the second field of view angle or the first field of view angle, the electronic device may perform brightness consistency correction processing on the second video frame based on brightness difference information between the second video frame and the first video frame to obtain an intermediate video frame. The electronic device may perform color consistency correction processing on the second video frame based on color difference information between the second video frame and the first video frame to obtain a processed second video frame.

[0093] If the third video frame is the second video frame and the fourth video frame is the first video frame, then when the overlapping range of the second camera module's second field of view angle and the first camera module's first field of view angle is the second field of view angle or the first field of view angle, there is a first region image in the second video frame that completely overlaps with the image content of the first video frame. The electronic device can perform brightness and color consistency correction processing on the first region image in the second video frame based on brightness difference information and color difference information between corresponding pixels in the first region image and the first video frame, to obtain a processed second video frame.

[0094] If the third video frame is the first video frame and the fourth video frame is the second video frame, then when the overlapping range of the second camera module's second field of view angle and the first camera module's first field of view angle is the second field of view angle or the first field of view angle, there is a first region image in the first video frame that completely overlaps with the image content of the second video frame. The electronic device can perform brightness and color consistency correction processing on the first region image in the second video frame based on the brightness difference information and color difference information of corresponding pixels in the first video frame and the first region image, to obtain a processed second video frame.

[0095] For example, as shown in FIG9 , first video frame 901 includes a first region image 9011 that completely overlaps with image content in second video frame 902. The electronic device performs brightness and color consistency correction processing on the pixels in the first row and first column of the first region image of the second video frame based on brightness and color difference information between the pixels in the first row and first column of the first video frame and the first region image; ...; performs brightness and color consistency correction processing on the pixels in the i-th row and j-th column of the first region image of the second video frame based on brightness and color difference information between the pixels in the i-th row and j-th column of the first video frame and the first region image, thereby obtaining a processed second video frame; ...; performs brightness and color consistency correction processing on the pixels in the p-th row and q-th column of the first region image of the second video frame based on brightness and color difference information between the pixels in the p-th row and q-th column of the first video frame and the first region image, thereby obtaining a processed second video frame. p is the number of pixel rows in the first video frame, i ≤ p, and is a positive integer. q is the number of pixel rows in the first video frame, j ≤ q, and is a positive integer.

[0096] In an optional implementation, the electronic device performs brightness and color consistency correction processing on the second video frame based on the brightness difference information and color difference information of the second video frame compared with the first video frame. The process of obtaining the processed second video frame may include the following steps 8021 to 8024.

[0097] In step 8021, the brightness value, red component value, green component value, and blue component value of each pixel in the first video frame and the second video frame are obtained.

[0098] Optionally, the electronic device can obtain the brightness value, red component value, green component value and blue component value of each pixel in the first video frame from the original image data captured by the first camera module; and obtain the brightness value, red component value, green component value and blue component value of each pixel in the second video frame from the original image data captured by the second camera module.

[0099] In step 8022, a first color ratio and a second color ratio are calculated for each pixel in the first video frame and the second video frame. The first color ratio is the ratio of the red component value to the green component value. The second color ratio is the ratio of the blue component value to the green component value.

[0100] In the embodiment of the present application, the electronic device calculates the first color ratio and the second color ratio of each pixel in the first video frame, and the first color ratio and the second color ratio of each pixel in the second video frame, and obtains the brightness difference information C grid 1 and C grid 2. C grid 1 is R grid 1 / G grid 1&B grid 1 / G grid 1. C grid 2 for R grid 2 / G grid 2&B grid 2 / G grid 2.

[0101] Among them, C grid 1 represents the first color ratio R of the first video frame grid 1 / G grid 1 and the second color ratio B grid 1 / G grid 1. R grid 1. G grid 1. B grid 1 represents the red component value, green component value, and blue component value of each pixel in the first video frame. grid 2 represents the first color ratio R of the second video frame grid 2 / G grid2 and the second color ratio B grid 2 / G grid 2. R grid 2. G grid 2. B grid 2 represents the red component value, green component value, and blue component value of each pixel in the second video frame respectively.

[0102] In step 8023, the white balance gain, color matrix, and hue gain corresponding to each pixel in the second video frame are calculated based on the brightness, first color ratio, and second color ratio of the corresponding pixels in the first video frame and the second video frame.

[0103] Optionally, the electronic device calculates a pixel average value of sub-pixels of each pixel in the first video frame as the brightness of the pixel, and calculates a pixel average value of sub-pixels of each pixel in the second video frame as the brightness of the pixel.

[0104] Taking the calculation of the brightness of each pixel in the first video frame as an example, the electronic device calculates the brightness of each pixel in the first video frame according to the third formula. The third formula satisfies: L grid-avg =Sum(PixelValue grid ) / PixelNum;

[0105] Among them, L grid-avg Indicates the brightness of each pixel in the first video frame. grid Indicates the pixel value of the sub-pixel, Sum(PixelValue grid ) represents the sum of the pixel values ​​of all sub-pixels in a pixel. PixelNum represents the number of sub-pixels in a pixel.

[0106] In an optional implementation, the electronic device may calculate the cumulative value of the first color ratios of multiple pixels in the first video frame corresponding to the second video frame to obtain the first color ratio of the first video frame; calculate the cumulative value of the second color ratios of multiple pixels in the first video frame corresponding to the second video frame to obtain the second color ratio of the first video frame. Furthermore, the electronic device may calculate the cumulative value of the first color ratios of multiple pixels in the second video frame corresponding to the first video frame to obtain the first color ratio of the second video frame; and calculate the cumulative value of the second color ratios of multiple pixels in the second video frame corresponding to the first video frame to obtain the second color ratio of the second video frame. The electronic device calculates the ratio of the first color ratio of the first video frame to the first color ratio of the second video frame, and the ratio of the second color ratio of the first video frame to the second color ratio of the second video frame to obtain the white balance gain (wbgain) of each pixel in the second video frame.

[0107] The electronic device may obtain a red component coefficient of a corresponding pixel in the first and second video frames by the ratio of the first color ratio of a single pixel in the first video frame to the first color ratio of the corresponding pixel in the second video frame, thereby obtaining a red component coefficient of each corresponding pixel in the first and second video frames. The electronic device may obtain a blue component coefficient of a corresponding pixel in the first and second video frames by the ratio of the second color ratio of the single pixel in the first video frame to the second color ratio of the corresponding pixel in the second video frame, thereby obtaining a blue component coefficient of each corresponding pixel in the first and second video frames. A color matrix for each corresponding pixel in the second video frame is constructed based on the red component coefficient and the blue classification coefficient of each corresponding pixel in the first and second video frames. In an optional case, if there is a pixel in the second video frame that does not correspond to the first video frame, the initial color matrix may be used as the color matrix of the pixel in the second video frame. The initial color matrix may indicate the relevant value of the unchanged pixel.

[0108] The electronic device may calculate the ratio of the brightness of a single pixel in the first video frame to the brightness of the corresponding pixel in the second video frame to obtain the hue gain of a corresponding pixel in the first video frame and the second video frame, thereby obtaining the hue gain (local gain) of each corresponding pixel in the first video frame and the second video frame. In an optional case, if there is a pixel in the second video frame that does not correspond to the first video frame, the initial hue gain may be used as the hue gain of the pixel in the second video frame. The hue gain may indicate a related value of an unchanged pixel.

[0109] In step 8024, white balance processing, color correction processing, and tone mapping processing are sequentially performed on each pixel in the second video frame according to the white balance gain, the color matrix, and the tone gain to obtain a processed second video frame.

[0110] In an embodiment of the present application, the electronic device performs white balance processing on each pixel in the second video frame according to the white balance gain, performs color correction processing on each pixel in the second video frame according to the color matrix, and performs tone mapping processing on each pixel in the second video frame according to the tone gain to obtain a processed second video frame.

[0111] Step 803: Capture the image of the first region in the third video frame. The third video frame is a video frame captured using a relatively large field of view angle between the first video frame and the second video frame.

[0112] The explanation and implementation of this step can refer to the explanation and implementation of the aforementioned step 102, and will not be repeated here in the embodiment of the present application.

[0113] Step 804: Perform image fusion processing on the fourth video frame and the first region image to obtain a fifth video frame. The fourth video frame is a video frame captured using a relatively small field of view angle between the first video frame and the second video frame.

[0114] The explanation and implementation of this step can refer to the explanation and implementation of the aforementioned step 103, and will not be repeated here in the embodiment of the present application.

[0115] In some embodiments of the present application, users can select a region of interest (ROI) during the shooting process and set the selected ROI as the center of the image after zoom shooting, that is, the center of the image when the camera module switches to shooting. Users can also set the zoom size of the image after switching to achieve zoom effects, and then display the zoomed image frame, enriching the video shooting effect and improving the user's shooting experience.

[0116] Optionally, after performing image fusion processing on the fourth video frame and the first region image to obtain a fifth video frame in step 804, the method further includes:

[0117] Step 805: Obtain the target center position and zoom factor of the user's area of ​​interest.

[0118] Alternatively, the user may perform an input on the display screen to select an area of ​​interest, so that the electronic device receives the input and, in response to the input, obtains the target center position of the area of ​​interest. The user may perform an input on the display screen to select a zoom factor, so that the electronic device receives the input and, in response to the input, obtains the zoom factor.

[0119] As an example, the input for selecting the region of interest may be a click or long press input on the display screen. The electronic device determines the click or long press point on the display screen as the target center position of the region of interest.

[0120] In another example, the zoom factor selection input may be an input in the form of a click, long press, slide, or voice command on a zoom control displayed on the display screen, to change the zoom factor value corresponding to the zoom control. The electronic device receives the zoom factor selection input and determines that the zoom factor value after the zoom control is changed is the zoom factor set by the user.

[0121] Step 806 : Calculate a second horizontal length and a second vertical length after zooming according to the zoom factor, the first horizontal length and the first vertical length of the fourth video frame.

[0122] Optionally, the electronic device calculates the product of the first horizontal extent and the zoom factor to obtain the second horizontal length; and calculates the product of the first vertical length and the zoom factor to obtain the second vertical length.

[0123] Step 807: intercept the second region image in the fifth video frame to obtain a sixth video frame. The center position of the second region image is the target center position, the horizontal length is the second horizontal length, and the vertical length is the second vertical length.

[0124] In an embodiment of the present application, the electronic device captures a second area image centered on the target center position of the area of ​​interest, with a horizontal length of the second horizontal length and a vertical length of the second vertical length from the fifth video frame to obtain a sixth video frame.

[0125] For example, as shown in Figure 10, the electronic device displays a first interface 1001 on the display screen, and displays the fifth video frame on the first interface 1001. The user clicks the area of ​​interest on the display screen so that the electronic device obtains the center coordinates of the area of ​​interest and obtains the target center position. The electronic device displays a second interface 1002 on the display screen, and displays a zoom control on the second interface 1002. The user slides the zoom control to change the zoom magnification corresponding to the zoom control. The electronic device obtains the zoom magnification corresponding to the change of the zoom control. Taking the zoom magnification greater than 1 as an example, the electronic device displays the sixth video frame on the third interface 1003 after enlargement with the target center position of the area of ​​interest as the center.

[0126] In some embodiments of the present application, users can also select transition effects during the camera module switching shooting process to add features to the fifth video frame, increase the interactive experience with the user, enrich the video shooting effect, and enhance the user shooting experience.

[0127] Optionally, after performing image fusion processing on the fourth video frame and the first area image in step 804 to obtain the fifth video frame, the method further includes: obtaining a transition special effect identifier selected by the user, performing special effects processing on the fifth video frame according to the transition special effect identifier, and obtaining the processed fifth video frame.

[0128] In some embodiments of the present application, the electronic device may display multiple transition effect identifiers, receive a user's input selecting a target transition effect identifier from the multiple transition effect identifiers, determine the target transition effect identifier to be the transition effect identifier selected by the user, and perform image fusion processing on the special effects template corresponding to the transition effect identifier selected by the user and the fifth video frame to obtain a processed fifth video frame.

[0129] Among them, the selection input of the target transition special effect identifier is used to select the transition special effect for the fifth video frame. Optionally, the selection input can be an input in the form of clicking, long pressing, sliding or voice on the target transition special effect identifier. For example, as shown in Figure 11, the electronic device can display the fifth video frame and display multiple transition special effect identifiers: white field transition, superimposed dissolve, and cross dissolve. The electronic device clicks on superimposed dissolve, performs special effect processing on the fifth video frame, and displays the fifth video frame with superimposed dissolve special effect.

[0130] In an embodiment of the present application, during the process of switching from the first camera module to the second camera module for video capture, the first video frame and the second video frame simultaneously captured by the first camera module and the second camera module are obtained to intercept the first area image in the second video frame, and the first video frame and the first area image are subjected to image fusion processing to obtain a third video frame. In this technical solution, since the first video frame is captured by the first camera module before the switch, and the second video frame is captured by the second camera module after the switch. Therefore, by performing image fusion processing on the first video frame and the first area image in the second video frame, the video frame captured with a relatively small field of view angle and the video frame captured with a relatively large field of view angle, the image features in the first video frame and the second video frame can be integrated to a certain extent, and the image difference features that may exist in the two pictures taken by two different camera modules can be eliminated, so that the fifth video frame obtained after image fusion processing is closer to the first video frame than the second video frame, and the video picture taken during the switching shooting process of the camera module is more likely to not have picture problems such as jitter, freeze, and excessive color and brightness differences between the video frames taken before and after switching, thereby improving the smoothness of the picture taken during the switching shooting process of the camera module and improving the video shooting effect.

[0131] Please refer to Figure 12, which shows a block diagram of an electronic device provided in an embodiment of the present application. The electronic device can execute the video processing method provided in an embodiment of the present application. As shown in Figure 12, the electronic device includes: a first camera module 1201, a second camera module 1202, an image processing chip 1203, and a display device 1204.

[0132] Among them, the first camera module 1201 is used to capture video frames simultaneously with the second camera module 1202 during the process of switching from the first camera module to the second camera module for video shooting, so as to capture the first video frame.

[0133] The second camera module 1202 is used to capture video frames simultaneously with the first camera module 1201 during the process of switching from the first camera module to the second camera module for video shooting, so as to capture a second video frame.

[0134] The image processing chip 1203 is connected to the first camera module 1201 and the second camera module 1202. The image processing chip 1203 is used to execute the video processing method provided in the embodiment of the present application.

[0135] In an optional case, the display device 1204 is connected to the first camera module 1201 and the second camera module 1202. The display device 1204 is used to display the first video frame or the second video frame.

[0136] In another optional case, the display device 1204 is further connected to the image processing chip 1203. The display device 1204 is configured to display the fifth video frame.

[0137] In an embodiment of the present application, when the electronic device switches from the first camera module to the second camera module for video capture, the electronic device obtains the first video frame and the second video frame simultaneously captured by the first camera module and the second camera module to intercept the first area image in the second video frame, and performs image fusion processing on the first video frame and the first area image to obtain a third video frame. In this technical solution, the first video frame is captured by the first camera module before the switch, and the second video frame is captured by the second camera module after the switch. Therefore, by performing image fusion processing on the first video frame and the first area image in the second video frame, the video frame captured with a relatively small field of view angle and the video frame captured with a relatively large field of view angle, the image features in the first video frame and the second video frame can be integrated to a certain extent, and the image difference features that may exist in the two pictures taken by two different camera modules can be eliminated, so that the fifth video frame obtained after image fusion processing is closer to the first video frame than the second video frame, and the video picture taken during the switching shooting process of the camera module is more likely to not have picture problems such as jitter, freeze, and excessive color and brightness differences between the video frames taken before and after switching, thereby improving the smoothness of the picture taken during the switching shooting process of the camera module and improving the video shooting effect.

[0138] Optionally, the image processing chip 1203 further includes: an image correction module 12031 and an image fusion module 12032 that are connected to each other.

[0139] The image correction module 12031 is used to perform brightness and color consistency correction processing on the second video frame according to the brightness difference information and color difference information of the second video frame compared with the first video frame when the overlapping range of the second field of view of the second camera module and the first field of view of the first camera module is the second field of view angle or the first field of view angle, so as to obtain a processed second video frame.

[0140] The image fusion module 12032 is used to capture the first area image in the third video frame, where the third video frame is a video frame captured using a relatively large field of view angle between the first video frame and the second video frame; and is also used to perform image fusion processing on the fourth video frame and the first area image to obtain a fifth video frame, where the fourth video frame is a video frame captured using a relatively small field of view angle between the first video frame and the second video frame.

[0141] Optionally, the image fusion module 12032 is also used to: obtain the focus distance when capturing the first video frame and the second video frame, and the first horizontal length and the first vertical length of the fourth video frame; calculate the center position of the first area image based on the focus distance, the first field of view angle of the first camera module, the second field of view angle of the second camera module, and the relative position of the first camera module and the second camera module; based on the center position, the first horizontal length and the first vertical length, capture the first area image in the third video frame, the horizontal length of the first area image being the first horizontal length, and the vertical length being the first vertical length.

[0142] Optionally, the image fusion module 12032 is further configured to: when the overlapping range of the second field of view angle of the second camera module and the first field of view angle of the first camera module is the second field of view angle or the first field of view angle, perform image fusion processing on the fourth video frame and the first area image to obtain a fifth video frame;

[0143] When the overlapping range of the second field of view angle and the first field of view angle is not the second field of view angle or the first field of view angle, the transparency of the target image is reduced, and image fusion processing is performed on the fourth video frame and the first area image to obtain a fifth video frame, wherein, when the third video frame is the first video frame, the target image is the first area image, and when the third video frame is the second video frame, the target image is the fourth video frame.

[0144] Optionally, the image fusion module 12032 is further used to: determine an adjustment variable value according to a ratio of the second field of view angle covering the first field of view angle, wherein the ratio is inversely proportional to the adjustment variable value; and reduce the transparency of the target image according to the adjustment variable value.

[0145] Further optionally, the image correction module 12031 also includes: a microcontroller unit (MCU) 120311, a white balance (WB) module 120312, a color correction module 120313, and a tone mapping module 120314.

[0146] The microcontroller unit 120311 is connected to the white balance module 120312, the color correction module 120313, and the tone mapping module 120314. The microcontroller unit 12031 is configured to obtain the brightness, red component, green component, and blue component values ​​of each pixel in the first video frame and the second video frame; calculate a first color ratio and a second color ratio for each pixel in the first video frame and the second video frame, where the first color ratio is the ratio of the red component to the green component, and the second color ratio is the ratio of the blue component to the green component; and calculate the white balance gain, color matrix, and hue gain corresponding to each pixel in the second video frame based on the difference between the brightness, the first color ratio, and the second color ratio of the corresponding pixel in the first video frame and the second video frame.

[0147] The white balance module 120312, the color correction module 120313, and the tone mapping module 120314 are connected in sequence. The white balance module 120312 is configured to perform white balance processing on each pixel in the second video frame according to the white balance gain to obtain a first intermediate video frame.

[0148] The color correction module 120313 is used to perform color correction processing on each pixel in the first intermediate video frame according to the color matrix to obtain a second intermediate video frame.

[0149] The tone mapping module 120314 is configured to perform tone mapping processing on each pixel in the second intermediate video frame according to the tone gain to obtain a processed second video frame.

[0150] In some embodiments of the present application, the image correction module 12031 also includes: demosaicing processing (Demosaic) 120315.

[0151] The demosaicing processing 120315 is respectively connected to the white balance module 120312 and the color correction module 120313. The demosaicing processing 120315 is used to perform a demosaicing process on the first intermediate video frame to obtain a processed first intermediate video frame.

[0152] Optionally, the image processing chip 1203 further includes: a gamma correction module 12033 , a scaler module 12034 , and a video encoder 12035 .

[0153] The gamma correction module 12033 is connected to the image correction module 12031 and the scaler module 12034. The gamma correction module 12033 is configured to perform gamma correction on the processed second video frame to obtain the processed second video frame.

[0154] The scaler module 12034 is used to convert the data format of the second video frame transmitted by the gamma correction module 12033 into a YUV format, and transmit the second video frame after the format conversion to the image fusion module 12032 .

[0155] The video encoder 12035 is connected to the image fusion module 12032 and the display device respectively. The video encoder 12035 is used to encode the fifth video frame and transmit it to the display device.

[0156] In some embodiments of the present application, the electronic device further includes: a main control chip 1205. The main control chip is also called an application processor (AP). The main control chip 1205 is connected to the first camera module 1201, the second camera module 1202 and the image processing chip 1203 respectively. The main control chip 1205 is used to obtain the original image data collected by the first camera module 1201, and perform image preprocessing on the original image data collected by the first camera module 1201 to obtain a first video frame. The main control chip 1205 is also used to obtain the original image data collected by the second camera module 1202, and perform image preprocessing on the original image data collected by the first camera module 1202 to obtain a second video frame. The main control chip 1205 is used to transmit the processed raw data (2x ProcessedRaw, 2x represents the data of the two camera modules) to the image processing chip 1203. The processed raw data includes the first video frame and the second video frame.

[0157] The main control chip 1205 is also used to obtain the focus distance (2x AF distance) when the first camera module 1201 and the second camera module 1202 capture the first video frame and the second video frame, and transmit the focus distance to the image processing chip 1203.

[0158] The main control chip 1205 is further configured to obtain statistical information (2x 2A(AE / AWB) stats) for the first and second video frames. The statistical information includes the brightness value, red component value, green component value, and blue component value of each pixel in the first and second video frames. The main control chip 1205 is further configured to transmit the statistical information to the image processing chip 1203.

[0159] Accordingly, the image processing chip 1203 is used to receive three channels of data transmitted by the main control chip, namely, the processed original data, focus distance and statistical information, so as to execute the video processing method provided in the embodiment of the present application according to the three channels of data received from the main control chip.

[0160] In one embodiment, the main control chip 1205 is directly connected to the display device 1204. The main control chip 1205 is further configured to transmit the first video frame or the second video frame directly to the display device 1204. Accordingly, the display device 1204 is further configured to directly display the first video frame or the second video frame received from the main control chip 1205. It is readily understood that the main control chip 1205 can generate at least four data streams: processed raw data, focus distance, statistical information, and a data stream directly transmitted to the display device 1204.

[0161] In summary, the electronic device provided by the embodiment of the present application, during the process of switching from the first camera module to the second camera module for video shooting, obtains the first video frame and the second video frame simultaneously captured by the first camera module and the second camera module to intercept the first area image in the second video frame, and performs image fusion processing on the first video frame and the first area image to obtain a third video frame. In this technical solution, since the first video frame is captured by the first camera module before the switch, and the second video frame is captured by the second camera module after the switch. Therefore, by performing image fusion processing on the first video frame and the first area image in the second video frame, the video frame captured with a relatively small field of view angle and the video frame captured with a relatively large field of view angle, the image features in the first video frame and the second video frame can be integrated to a certain extent, and the image difference features that may exist in the two pictures taken by two different camera modules can be eliminated, so that the fifth video frame obtained after image fusion processing is closer to the first video frame than the second video frame, and the video picture taken during the switching shooting process of the camera module is more likely to not have picture problems such as jitter, freeze, and excessive color and brightness differences between the video frames taken before and after switching, thereby improving the smoothness of the picture taken during the switching shooting process of the camera module and improving the video shooting effect.

[0162] It should be noted that the video processing method provided in the embodiments of the present application can be executed by a video processing device or a control module in the video processing device for executing the video processing method. In the embodiments of the present application, the video processing device provided in the embodiments of the present application is described by taking the video processing device executing the video processing method as an example.

[0163] Please refer to Figure 13, which shows a block diagram of a video processing device provided in an embodiment of the present application. The video processing device is applied to an electronic device, which includes a first camera module and a second camera module. As shown in Figure 13, video processing device 1300 includes an acquisition module 1301, an interception module 1302, and a fusion module 1303.

[0164] An acquisition module 1301 is configured to acquire, during a process of switching from a first camera module to a second camera module for video capture, a first video frame captured by the first camera module and a second video frame captured by the second camera module, wherein the first video frame and the second video frame are acquired simultaneously;

[0165] A capture module 1302 is configured to capture an image of the first region in a third video frame, where the third video frame is a video frame captured using a relatively large field of view between the first and second video frames;

[0166] The fusion module 1303 is configured to perform image fusion processing on the fourth video frame and the first region image to obtain a fifth video frame. The fourth video frame is a video frame captured using a relatively small field of view angle between the first video frame and the second video frame.

[0167] Optionally, the acquisition module 1301 is further configured to: acquire a focus distance when capturing the first video frame and the second video frame, and a first horizontal length and a first vertical length of the fourth video frame;

[0168] and further configured to calculate a center position of the first area image based on a focus distance, a first field of view angle of the first camera module, a second field of view angle of the second camera module, and a relative position between the first camera module and the second camera module;

[0169] The interception module 1302 is further configured to intercept a first region image in the third video frame according to the center position, the first horizontal length, and the first vertical length, wherein the horizontal length of the first region image is the first horizontal length, and the vertical length is the first vertical length.

[0170] Optionally, the fusion module 1303 is further configured to:

[0171] When the overlapping range of the second field of view angle of the second camera module and the first field of view angle of the first camera module is the second field of view angle or the first field of view angle, performing image fusion processing on the fourth video frame and the first area image to obtain a fifth video frame;

[0172] When the overlapping range of the second field of view angle and the first field of view angle is not the second field of view angle or the first field of view angle, the transparency of the target image is reduced, and image fusion processing is performed on the fourth video frame and the first area image to obtain a fifth video frame.

[0173] Wherein, when the third video frame is the first video frame, the target image is the first region image; when the third video frame is the second video frame, the target image is the fourth video frame.

[0174] Optionally, the fusion module 1303 is further configured to: determine an adjustment variable value according to a ratio of the second field of view angle covering the first field of view angle, where the ratio is inversely proportional to the adjustment variable value; and reduce the transparency of the target image according to the adjustment variable value.

[0175] Optionally, the video processing device 1300 also includes: a correction module, which is used to perform brightness and color consistency correction processing on the second video frame according to the brightness difference information and color difference information of the second video frame compared with the first video frame, when the overlapping range of the second field of view angle of the second camera module and the first field of view angle of the first camera module is the second field of view angle or the first field of view angle, to obtain a processed second video frame.

[0176] Optionally, the correction module is further configured to:

[0177] Obtaining the brightness value, red component value, green component value, and blue component value of each pixel in the first video frame and the second video frame;

[0178] Calculating a first color ratio and a second color ratio of each pixel in the first video frame and the second video frame, where the first color ratio is a ratio of a red component value to a green component value, and the second color ratio is a ratio of a blue component value to a green component value;

[0179] Calculate the white balance gain, color matrix, and hue gain corresponding to each pixel in the second video frame according to the difference between the brightness, the first color ratio, and the second color ratio of the corresponding pixels in the first video frame and the second video frame;

[0180] According to the white balance gain, the color matrix, and the tone gain, white balance processing, color correction processing, and tone mapping processing are sequentially performed on each pixel in the second video frame to obtain a processed second video frame.

[0181] Optionally, the acquisition module 1301 is further configured to acquire the target center position and zoom factor of the user's area of ​​interest;

[0182] The video processing device 1300 further includes: a calculation module, configured to calculate a second horizontal length and a second vertical length after zooming according to the zoom factor, the first horizontal length and the first vertical length of the fourth video frame;

[0183] The interception module 1302 is further configured to intercept the second area image in the fifth video frame to obtain a sixth video frame, wherein the center position of the second area image is the target center position, the horizontal length is the second horizontal length, and the vertical length is the second vertical length.

[0184] Optionally, the electronic device includes a main control chip and an image processing chip, which are connected. The main control chip performs image preprocessing on the original image data collected by the first camera module to obtain a first video frame; the main control chip performs image preprocessing on the original image data collected by the second camera module to obtain a second video frame; the main control chip transmits the first video frame and the second video frame to the image processing chip.

[0185] In an embodiment of the present application, when the electronic device switches from the first camera module to the second camera module for video capture, the electronic device obtains the first video frame and the second video frame simultaneously captured by the first camera module and the second camera module to intercept the first area image in the second video frame, and performs image fusion processing on the first video frame and the first area image to obtain a third video frame. In this technical solution, the first video frame is captured by the first camera module before the switch, and the second video frame is captured by the second camera module after the switch. Therefore, by performing image fusion processing on the first video frame and the first area image in the second video frame, the video frame captured with a relatively small field of view angle and the video frame captured with a relatively large field of view angle, the image features in the first video frame and the second video frame can be integrated to a certain extent, and the image difference features that may exist in the two pictures taken by two different camera modules can be eliminated, so that the fifth video frame obtained after image fusion processing is closer to the first video frame than the second video frame, and the video picture taken during the switching shooting process of the camera module is more likely to not have picture problems such as jitter, freeze, and excessive color and brightness differences between the video frames taken before and after switching, thereby improving the smoothness of the picture taken during the switching shooting process of the camera module and improving the video shooting effect.

[0186] The video processing device in the embodiments of the present application can be a device, or a component, integrated circuit, or chip in a terminal. The device can be a mobile terminal or a non-mobile terminal. For example, the mobile terminal can be a mobile phone, a tablet computer, a laptop computer, a PDA, a vehicle-mounted terminal, a wearable device, an ultra-mobile personal computer (UMPC), a netbook, or a personal digital assistant (PDA), etc. The non-mobile terminal can be a server, a network attached storage (NAS), a personal computer (PC), a television (TV), a teller machine, or a self-service machine, etc., and the embodiments of the present application do not specifically limit this.

[0187] The video processing device in the embodiment of the present application may be a device having an operating system. The operating system may be an Android operating system, an iOS operating system, or other possible operating systems, which are not specifically limited in the embodiment of the present application.

[0188] The video processing device provided in the embodiment of the present application can implement each process implemented in the method embodiments of Figures 2 to 4. To avoid repetition, they will not be described here.

[0189] Optionally, as shown in FIG14 , an embodiment of the present application further provides an electronic device 1400, comprising a processor 1401, a memory 1402, and a data processing system provided in an embodiment of the present application. Memory 1402 stores a program or instruction that can be run on the processor 1401. When the program or instruction is executed by the processor 1401, each step of the above-mentioned data processing method embodiment is implemented, and the same technical effect is achieved. To avoid repetition, the details are not repeated here. The electronic device 1400 further comprises: a first camera module and a second camera module.

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

[0191] Figure 15 is a schematic diagram of the hardware structure of an electronic device implementing an embodiment of the present application. The electronic device 1500 includes, but is not limited to, components such as a radio frequency unit 1501, a network module 1502, an audio output unit 1503, an input unit 1504, a sensor 1505, a display unit 1506, a user input unit 1507, an interface unit 1508, a memory 1509, and a processor 1510. The electronic device 1500 also includes a first camera module and a second camera module.

[0192] Those skilled in the art will appreciate that the electronic device 1500 may further include a power source (e.g., a battery) to power various components. The power source may be logically connected to the processor 1510 via a power management system, thereby enabling the power management system to manage charging, discharging, and power consumption. The electronic device structure shown in FIG15 does not limit the electronic device. The electronic device may include more or fewer components than shown, or may combine certain components, or have different component arrangements, which will not be described in detail here.

[0193] The processor 1510 is configured to obtain, during a process of switching from the first camera module to the second camera module for video capture, a first video frame captured by the first camera module and a second video frame captured by the second camera module, where the first video frame and the second video frame are captured simultaneously.

[0194] and for capturing an image of the first area in a third video frame, wherein the third video frame is a video frame captured using a relatively large field of view angle between the first video frame and the second video frame;

[0195] And it is used to perform image fusion processing on the fourth video frame and the first area image to obtain a fifth video frame, where the fourth video frame is a video frame captured using a relatively small field of view angle between the first video frame and the second video frame.

[0196] In an embodiment of the present application, when the electronic device switches from the first camera module to the second camera module for video capture, the electronic device obtains the first video frame and the second video frame simultaneously captured by the first camera module and the second camera module to intercept the first area image in the second video frame, and performs image fusion processing on the first video frame and the first area image to obtain a third video frame. In this technical solution, the first video frame is captured by the first camera module before the switch, and the second video frame is captured by the second camera module after the switch. Therefore, by performing image fusion processing on the first video frame and the first area image in the second video frame, the video frame captured with a relatively small field of view angle and the video frame captured with a relatively large field of view angle, the image features in the first video frame and the second video frame can be integrated to a certain extent, and the image difference features that may exist in the two pictures taken by two different camera modules can be eliminated, so that the fifth video frame obtained after image fusion processing is closer to the first video frame than the second video frame, and the video picture taken during the switching shooting process of the camera module is more likely to not have picture problems such as jitter, freeze, and excessive color and brightness differences between the video frames taken before and after switching, thereby improving the smoothness of the picture taken during the switching shooting process of the camera module and improving the video shooting effect.

[0197] Optionally, the processor 1510 is further configured to:

[0198] Obtaining a focus distance when capturing the first video frame and the second video frame, and a first horizontal length and a first vertical length of the fourth video frame;

[0199] Calculating a center position of the first area image according to the focus distance, a first field of view angle of the first camera module, a second field of view angle of the second camera module, and a relative position of the first camera module and the second camera module;

[0200] A first area image is captured in the third video frame according to the center position, the first horizontal length, and the first vertical length, wherein the horizontal length of the first area image is the first horizontal length, and the vertical length is the first vertical length.

[0201] Optionally, the processor 1510 is further configured to:

[0202] When the overlapping range of the second field of view angle of the second camera module and the first field of view angle of the first camera module is the second field of view angle or the first field of view angle, performing image fusion processing on the fourth video frame and the first area image to obtain a fifth video frame;

[0203] When the overlapping range of the second field of view angle and the first field of view angle is not the second field of view angle or the first field of view angle, the transparency of the target image is reduced, and image fusion processing is performed on the fourth video frame and the first area image to obtain a fifth video frame.

[0204] Wherein, when the third video frame is the first video frame, the target image is the first area image; when the third video frame is the second video frame, the target image is the fourth video frame.

[0205] Optionally, the processor 1510 is further configured to: determine an adjustment variable value based on a ratio of the second field of view angle covering the first field of view angle, wherein the ratio is inversely proportional to the adjustment variable value; and reduce the transparency of the target image based on the adjustment variable value.

[0206] Optionally, the processor 1510 is also used to perform brightness and color consistency correction processing on the second video frame according to the brightness difference information and color difference information of the second video frame compared with the first video frame, when the overlapping range of the second field of view angle of the second camera module and the first field of view angle of the first camera module is the second field of view angle or the first field of view angle, so as to obtain a processed second video frame.

[0207] Optionally, the processor 1510 is further configured to:

[0208] Obtaining a brightness value, a red component value, a green component value, and a blue component value of each pixel in the first video frame and the second video frame;

[0209] Calculating a first color ratio and a second color ratio of each pixel in the first video frame and the second video frame, wherein the first color ratio is a ratio of a red component value to a green component value, and the second color ratio is a ratio of a blue component value to a green component value;

[0210] Calculating a white balance gain, a color matrix, and a hue gain corresponding to each pixel in the second video frame according to differences between the brightness, the first color ratio, and the second color ratio of corresponding pixels in the first video frame and the second video frame;

[0211] According to the white balance gain, the color matrix, and the tone gain, white balance processing, color correction processing, and tone mapping processing are sequentially performed on each pixel in the second video frame to obtain a processed second video frame.

[0212] Optionally, the processor 1510 is further configured to:

[0213] Get the target center position and zoom factor of the user's area of ​​interest;

[0214] Calculating a zoomed second horizontal length and a second vertical length according to the zoom factor, the first horizontal length and the first vertical length of the fourth video frame;

[0215] The second area image in the fifth video frame is intercepted to obtain a sixth video frame, wherein the center position of the second area image is the target center position, the horizontal length is the second horizontal length, and the vertical length is the second vertical length.

[0216] Optionally, the electronic device includes a main control chip and an image processing chip, and the main control chip and the image processing chip are connected. The main control chip performs image preprocessing on the original image data collected by the first camera module to obtain a first video frame; the main control chip performs image preprocessing on the original image data collected by the second camera module to obtain a second video frame; the main control chip transmits the first video frame and the second video frame to the image processing chip.

[0217] In an embodiment of the present application, when the electronic device switches from the first camera module to the second camera module for video capture, the electronic device obtains the first video frame and the second video frame simultaneously captured by the first camera module and the second camera module to intercept the first area image in the second video frame, and performs image fusion processing on the first video frame and the first area image to obtain a third video frame. In this technical solution, the first video frame is captured by the first camera module before the switch, and the second video frame is captured by the second camera module after the switch. Therefore, by performing image fusion processing on the first video frame and the first area image in the second video frame, the video frame captured with a relatively small field of view angle and the video frame captured with a relatively large field of view angle, the image features in the first video frame and the second video frame can be integrated to a certain extent, and the image difference features that may exist in the two pictures taken by two different camera modules can be eliminated, so that the fifth video frame obtained after image fusion processing is closer to the first video frame than the second video frame, and the video picture taken during the switching shooting process of the camera module is more likely to not have picture problems such as jitter, freeze, and excessive color and brightness differences between the video frames taken before and after switching, thereby improving the smoothness of the picture taken during the switching shooting process of the camera module and improving the video shooting effect.

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

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

[0220] Processor 1510 may include one or more processing units. Optionally, processor 1510 integrates an application processor and a modem processor. The application processor primarily handles operations related to the operating system, user interface, and application programs, while the modem processor primarily processes wireless communication signals, such as a baseband processor. It is understood that the modem processor may not be integrated into processor 1510.

[0221] An embodiment of the present application also provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, the various processes of the above-mentioned data processing method embodiment are implemented and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

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

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

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

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

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

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

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

Claims

1. A video processing method, applied to an electronic device, the electronic device comprising: A first camera module and a second camera module, the method comprising: In the process of switching from the first camera module to the second camera module for video shooting, a first video frame captured by the first camera module and a second video frame captured by the second camera module are acquired, and the first video frame and the second video frame are acquired at the same time; intercepting an image of a first area in a third video frame, wherein the third video frame is a video frame acquired by using a relatively large field of view angle between the first video frame and the second video frame; The fourth video frame and the first area image are subjected to image fusion processing to obtain a fifth video frame, wherein the fourth video frame is a video frame captured with a relatively small field of view angle between the first video frame and the second video frame.

2. The method according to claim 1, wherein: The method further comprises: Obtaining a focus distance when the first video frame and the second video frame are captured, and a first horizontal length and a first vertical length of the fourth video frame; Calculate the center position of the first area image according to the focus distance, the first field of view angle of the first camera module, the second field of view angle of the second camera module, and the relative position of the first camera module and the second camera module; The capturing of the first area image in the third video frame includes: capturing the first area image in the third video frame according to the center position, the first horizontal length and the first vertical length, wherein the horizontal length of the first area image is the first horizontal length, and the vertical length is the first vertical length.

3. The method according to claim 1, wherein: The performing image fusion processing on the fourth video frame and the first area image to obtain a fifth video frame includes: When the overlapping range of the second field of view angle of the second camera module and the first field of view angle of the first camera module is the second field of view angle or the first field of view angle, performing image fusion processing on the fourth video frame and the first area image to obtain a fifth video frame; When the overlapping range of the second field of view angle and the first field of view angle is not the second field of view angle or the first field of view angle, the transparency of the target image is reduced, and the fourth video frame and the first area image are subjected to image fusion processing to obtain a fifth video frame. Wherein, when the third video frame is the first video frame, the target image is the first area image; and when the third video frame is the second video frame, the target image is the fourth video frame.

4. The method according to claim 3, wherein: The reducing the transparency of the target image comprises: Determine an adjustment variable value according to a ratio of the second field of view angle covering the first field of view angle, wherein the ratio is inversely proportional to the adjustment variable value; The transparency of the target image is reduced according to the adjustment variable value.

5. The method according to claim 1, wherein: Before intercepting the first area image in the third video frame, the method further includes: When the overlapping range of the second field of view angle of the second camera module and the first field of view angle of the first camera module is the second field of view angle or the first field of view angle, the second video frame is corrected for brightness and color consistency based on the brightness difference information and color difference information of the second video frame compared with the first video frame to obtain a processed second video frame.

6. The method according to claim 5, wherein: The step of performing brightness and color consistency correction processing on the second video frame according to brightness difference information and color difference information between the second video frame and the first video frame to obtain a processed second video frame includes: Obtaining a brightness value, a red component value, a green component value, and a blue component value of each pixel in the first video frame and the second video frame; Calculate a first color ratio and a second color ratio of each pixel in the first video frame and the second video frame, wherein the first color ratio is a ratio of a red component value to a green component value, and the second color ratio is a ratio of a blue component value to a green component value; Calculate the white balance gain, color matrix, and hue gain corresponding to each pixel in the second video frame according to the brightness, the first color ratio, and the second color ratio of the corresponding pixels in the first video frame and the second video frame; According to the white balance gain, the color matrix and the tone gain, white balance processing, color correction processing and tone mapping processing are performed on each pixel in the second video frame in sequence to obtain a processed second video frame.

7. The method according to claim 1, wherein: After performing image fusion processing on the fourth video frame and the first region image to obtain a fifth video frame, the method further includes: Get the target center position and zoom factor of the user's area of ​​interest; Calculating a zoomed second horizontal length and a second vertical length according to the zoom factor, the first horizontal length and the first vertical length of the fourth video frame; The second area image in the fifth video frame is intercepted to obtain a sixth video frame, wherein the center position of the second area image is the target center position, the horizontal length is the second horizontal length, and the vertical length is the second vertical length.

8. The method according to claim 1, wherein: The electronic device includes a main control chip and an image processing chip, the main control chip is connected to the image processing chip, and the obtaining of a first video frame captured by the first camera module and a second video frame captured by the second camera module includes: The main control chip performs image preprocessing on the original image data collected by the first camera module to obtain a first video frame; The main control chip performs image preprocessing on the original image data collected by the second camera module to obtain a second video frame; The main control chip transmits the first video frame and the second video frame to the image processing chip.

9. A video processing device, applied to an electronic device, the electronic device comprising: A first camera module and a second camera module, the device comprising: an acquisition module, used for acquiring a first video frame captured by the first camera module and a second video frame captured by the second camera module during a process of switching from the first camera module to the second camera module for video shooting, wherein the first video frame and the second video frame are acquired simultaneously; A capture module, configured to capture an image of a first region in a third video frame, wherein the third video frame is a video frame captured using a relatively large field of view angle between the first video frame and the second video frame; A fusion module is used to perform image fusion processing on a fourth video frame and the first area image to obtain a fifth video frame, wherein the fourth video frame is a video frame captured using a relatively small field of view angle between the first video frame and the second video frame.

10. The device according to claim 9, wherein: The device also includes: A correction module is used to perform brightness and color consistency correction processing on the second video frame according to brightness difference information and color difference information of the second video frame compared with the first video frame, when the overlapping range of the second field of view angle of the second camera module and the first field of view angle of the first camera module is the second field of view angle or the first field of view angle, so as to obtain a processed second video frame.

11. The device according to claim 9, wherein: The acquisition module is further used to: acquire the focus distance when the first video frame and the second video frame are acquired, and the first horizontal length and the first vertical length of the fourth video frame; and is also used to calculate the center position of the first area image according to the focus distance, the first field of view angle of the first camera module, the second field of view angle of the second camera module, and the relative positions of the first camera module and the second camera module; The capture module 1302 is further used to capture a first area image in the third video frame according to the center position, the first horizontal length and the first vertical length, wherein the horizontal length of the first area image is the first horizontal length, and the vertical length is the first vertical length.

12. The device according to claim 9, wherein: The fusion module is further configured to: when the overlapping range of the second field of view angle of the second camera module and the first field of view angle of the first camera module is the second field of view angle or the first field of view angle, perform image fusion processing on the fourth video frame and the first area image to obtain a fifth video frame; When the overlapping range of the second field of view angle and the first field of view angle is not the second field of view angle or the first field of view angle, the transparency of the target image is reduced, and image fusion processing is performed on the fourth video frame and the first area image to obtain a fifth video frame, wherein when the third video frame is the first video frame, the target image is the first area image, and when the third video frame is the second video frame, the target image is the fourth video frame.

13. The device according to claim 12, wherein: The fusion module is further used for: An adjustment variable value is determined according to a ratio of the second field of view angle covering the first field of view angle, wherein the ratio is inversely proportional to the adjustment variable value; and the transparency of the target image is reduced according to the adjustment variable value.

14. The device according to claim 10, wherein: The correction module is also used for: Obtaining a brightness value, a red component value, a green component value, and a blue component value of each pixel in the first video frame and the second video frame; Calculate a first color ratio and a second color ratio of each pixel in the first video frame and the second video frame, wherein the first color ratio is a ratio of a red component value to a green component value, and the second color ratio is a ratio of a blue component value to a green component value; Calculate the white balance gain, color matrix, and hue gain corresponding to each pixel in the second video frame according to the brightness, the first color ratio, and the second color ratio of the corresponding pixels in the first video frame and the second video frame; According to the white balance gain, the color matrix and the tone gain, white balance processing, color correction processing and tone mapping processing are performed on each pixel in the second video frame in sequence to obtain a processed second video frame.

15. The device according to claim 9, wherein: The acquisition module is further used to acquire the target center position and zoom factor of the user's area of ​​interest; The device further includes: a calculation module, configured to calculate a zoomed second horizontal length and a second vertical length according to the zoom factor, the first horizontal length and the first vertical length of the fourth video frame; The capture module is further used to capture the second area image in the fifth video frame to obtain a sixth video frame, wherein the center position of the second area image is the target center position, the horizontal length is the second horizontal length, and the vertical length is the second vertical length.

16. The device according to claim 9, wherein: The electronic device comprises a main control chip and an image processing chip, the main control chip and the image processing chip are connected, and the acquisition module is further used for: The main control chip performs image preprocessing on the original image data collected by the first camera module to obtain a first video frame; The main control chip performs image preprocessing on the original image data collected by the second camera module to obtain a second video frame; The main control chip transmits the first video frame and the second video frame to the image processing chip.

17. An electronic device, comprising a first camera module, a second camera module, a processor and a memory, wherein the memory stores programs or instructions that can be run on the processor, and when the programs or instructions are executed by the processor, the steps of the video processing method as described in any one of claims 1 to 8 are implemented.

18. A readable storage medium storing a program or an instruction, wherein the program or the instruction, when executed by a processor, implements the steps of the video processing method according to any one of claims 1 to 8.

19. A chip, comprising a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run a program or instruction to implement the steps of the video processing method according to any one of claims 1 to 8.

20. A computer program product, wherein the computer program product is stored in a storage medium, and wherein the computer program product is executed by at least one processor to implement the steps of the video processing method according to any one of claims 1 to 8.

Citation Information

Patent Citations

  • Video generation method and device, electronic equipment and readable storage medium

    CN113905175A

  • Camera switching method and device, electronic equipment and storage medium

    CN116095476A

  • Video processing method, video processing device, electronic equipment and medium

    CN117479025A

  • Image-capturing apparatus and image-capturing control method

    US20180288323A1

  • Image processing method and apparatus, and image collection device and storage medium

    WO2023077431A1