Video processing method and device, and electronic device

By acquiring and utilizing the image distribution information between video frames, the problem of inter-frame flickering after video enhancement processing was solved, resulting in better display effects.

CN117745546BActive Publication Date: 2026-06-19DOUYIN VISION CO LTD +1

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
DOUYIN VISION CO LTD
Filing Date
2022-09-13
Publication Date
2026-06-19

AI Technical Summary

Technical Problem

In existing technologies, the discontinuous distribution of images between frames after video enhancement processing causes flickering and results in poor display quality.

Method used

By acquiring image distribution information from multiple image frames in the video, related image frames are determined based on the information of the current frame and the previous N frames, and an enhanced video is generated, which is then adjusted by combining the pixel distribution information between frames.

Benefits of technology

It avoids inter-frame flickering and improves the display effect of the enhanced video.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117745546B_ABST
    Figure CN117745546B_ABST
Patent Text Reader

Abstract

This disclosure provides a video processing method, apparatus, and electronic device. The method includes: acquiring image distribution information of a plurality of first image frames in a first video; for any given first image frame, determining a second image frame associated with the first image frame based on the image distribution information of the first image frame and the image distribution information of the preceding N image frames of the first image frame, where N is an integer greater than or equal to 1; and generating a second video based on the second image frames associated with the plurality of first image frames, wherein the second video is a video enhanced from the first video. This improves the display effect of the enhanced video.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of image processing technology, and more particularly to a video processing method, apparatus, and electronic device. Background Technology

[0002] Video enhancement technology can improve the display quality of videos. For example, if a user-shot video has low color accuracy, video enhancement technology can improve its color, brightness, contrast, and other aspects.

[0003] Currently, histogram algorithms can be used to process videos, thereby improving their display quality. For example, histogram algorithms can adjust the pixels of each frame in a video, improving parameters such as color, brightness, and contrast, thus enhancing the video's display. However, the discontinuous image distribution between video frames can cause flickering between frames after video enhancement, resulting in a poor overall display quality. Summary of the Invention

[0004] This disclosure provides a video processing method, apparatus, and electronic device to solve the technical problem in the prior art that results in poor display quality after video enhancement processing.

[0005] In a first aspect, this disclosure provides a video processing method, the method comprising:

[0006] Obtain the image distribution information of multiple first image frames in the first video;

[0007] For any first image frame, based on the image distribution information of the first image frame and the image distribution information of the previous N image frames of the first image frame, a second image frame associated with the first image frame is determined, where N is an integer greater than or equal to 1;

[0008] A second video is generated based on the second image frames associated with the plurality of first image frames, and the second video is a video enhanced by the first video.

[0009] Secondly, this disclosure provides a video processing apparatus, which includes an acquisition module, a determination module, and a generation module, wherein:

[0010] The acquisition module is used to acquire image distribution information of multiple first image frames in the first video;

[0011] The determining module is used to determine, for any first image frame, a second image frame associated with the first image frame based on the image distribution information of the first image frame and the image distribution information of the previous N image frames of the first image frame, where N is an integer greater than or equal to 1;

[0012] The generation module is used to generate a second video based on the second image frames associated with the plurality of first image frames, wherein the second video is a video enhanced by the first video.

[0013] Thirdly, embodiments of this disclosure provide an electronic device, including: a processor and a memory;

[0014] The memory stores computer-executed instructions;

[0015] The processor executes computer execution instructions stored in the memory, causing the at least one processor to perform the video processing methods described in the first aspect above and various possible aspects of the first aspect.

[0016] Fourthly, embodiments of this disclosure provide a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the video processing methods described in the first aspect and various possible aspects thereof.

[0017] Fifthly, embodiments of this disclosure provide a computer program product, including a computer program that, when executed by a processor, implements the video processing methods described in the first aspect above and various possible aspects of the first aspect.

[0018] This disclosure provides a video processing method, apparatus, and electronic device. The method involves acquiring image distribution information of multiple first image frames in a first video. For any given first image frame, based on the image distribution information of the first image frame and the image distribution information of the preceding N image frames, a second image frame associated with the first image frame is determined, where N is an integer greater than or equal to 1. Based on the second image frames associated with the multiple first image frames, a second video is generated, which is a video enhanced from the first video. According to this method, since the electronic device enhances the image of the current frame using the image distribution information of the current frame and the previous frame, and combines the image distribution information between video frames, it can avoid the problem of flickering between frames after image enhancement, thereby improving the display effect of the enhanced video. Attached Figure Description

[0019] To more clearly illustrate the technical solutions in the embodiments of this disclosure or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this disclosure. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0020] Figure 1This is a schematic diagram of an application scenario provided by an embodiment of the present disclosure;

[0021] Figure 2 A schematic flowchart of an audio processing method provided in an embodiment of this disclosure;

[0022] Figure 3 This is a schematic diagram of image distribution information provided in an embodiment of the present disclosure;

[0023] Figure 4 This is a schematic diagram illustrating a process for determining a pixel distribution range, provided in an embodiment of the present disclosure.

[0024] Figure 5 This is a schematic diagram illustrating an embodiment of the present disclosure for obtaining a first pixel value and a second pixel value;

[0025] Figure 6 This is a schematic diagram of a method for obtaining a second image frame provided in an embodiment of the present disclosure;

[0026] Figure 7 This is a schematic diagram of a video processing method provided in an embodiment of the present disclosure;

[0027] Figure 8 This is a schematic diagram of the structure of a video processing apparatus provided in an embodiment of the present disclosure; and,

[0028] Figure 9 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this disclosure. Detailed Implementation

[0029] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numerals in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this disclosure. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this disclosure as detailed in the appended claims.

[0030] For ease of understanding, the concepts involved in the embodiments of this disclosure will be explained below.

[0031] Electronic device: A device with wireless transceiver capabilities. Electronic devices can be deployed on land, including indoors or outdoors, handheld, wearable, or vehicle-mounted; they can also be deployed on water (such as on ships). These electronic devices can be mobile phones, tablets, computers with wireless transceiver capabilities, virtual reality (VR) electronic devices, augmented reality (AR) electronic devices, wireless terminals in industrial control, vehicle-mounted electronic devices, wireless terminals in self-driving vehicles, wireless electronic devices in remote medical care, wireless electronic devices in smart grids, wireless electronic devices in transportation safety, wireless electronic devices in smart cities, wireless electronic devices in smart homes, wearable electronic devices, etc. The electronic devices involved in the embodiments of this disclosure can also be referred to as terminals, user equipment (UE), access electronic devices, vehicle-mounted terminals, industrial control terminals, UE units, UE stations, mobile stations, mobile stations, remote stations, remote electronic devices, mobile devices, UE electronic devices, wireless communication devices, UE agents, or UE devices, etc. Electronic devices can be fixed or mobile.

[0032] Video Enhancement: Video enhancement algorithms can improve the display quality of videos. For example, video enhancement processing can improve the brightness, contrast, and color of a video, thereby enhancing its display quality. Optionally, video enhancement algorithms can process each frame of a video to improve its display quality. For example, video enhancement algorithms can adjust the pixels in each frame of a video to improve the brightness, contrast, and color of each frame, thus improving the video's display quality.

[0033] Histogram Algorithm: The histogram algorithm can adjust the pixel distribution in an image. For example, electronic devices can use the histogram algorithm to obtain the histogram information of the R, G, and B channels in an image, and adjust pixels in dark areas to bright areas, thereby improving the brightness, contrast, and color of the image.

[0034] In related technologies, when the video display effect acquired by an electronic device is low (e.g., low color, low brightness), the electronic device can improve the video display effect through video enhancement processing technology. Currently, histogram algorithms can be used to process video. For example, electronic devices can use histogram algorithms to adjust the pixels of each frame in a video, moving pixels from dark areas to bright areas, thereby improving parameters such as color, brightness, and contrast of each frame and enhancing the video display effect. However, when the pixel distribution of adjacent video frames differs significantly, after processing each frame with a histogram algorithm, flickering may occur between the two frames with large pixel distribution differences, resulting in a poor display effect after video enhancement.

[0035] To address the technical problems in related technologies, this disclosure provides a video processing method. An electronic device acquires image distribution information of multiple first image frames in a first video. For any given first image frame, based on the image distribution information, a first pixel distribution interval associated with the first image frame is determined. Based on the image distribution information of the preceding N image frames, N second pixel distribution intervals of the N image frames are determined. Based on the first pixel distribution intervals and the N second pixel distribution intervals, the first image frame is processed to obtain a second image frame. Based on the multiple second image frames, a second video enhanced from the first video is generated. In this method, because the electronic device enhances the image of the current frame using the pixel distribution intervals of the current frame and the previous frame, it incorporates pixel distribution information between video frames. Therefore, when adjusting pixels, flickering between adjacent video frames with large pixel distribution differences can be avoided after image enhancement, thereby improving the display effect of the enhanced video.

[0036] Below, in conjunction with Figure 1 The application scenarios of this disclosure are explained.

[0037] Figure 1 This is a schematic diagram illustrating an application scenario provided by an embodiment of this disclosure. Please refer to [link / reference]. Figure 1The system includes an electronic device and a first video. The first video includes image A and image B, where image A is the first frame and image B is the second frame. By inputting images A and B to the electronic device, the device can acquire the pixel distribution information of both images. Based on this information, it processes image B to obtain a second video. The second video includes images A and C, where image C is the enhanced version of image B. In this way, when enhancing each frame of the first video, the electronic device can combine the pixel distribution information between adjacent video frames, thus avoiding flickering between adjacent video frames with large pixel distribution differences after image enhancement, and improving the display effect of the enhanced video.

[0038] The technical solutions of this disclosure and how they solve the aforementioned technical problems will be described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of this disclosure will now be described with reference to the accompanying drawings.

[0039] Figure 2 This is a schematic flowchart illustrating an audio processing method provided in an embodiment of this disclosure. Please refer to [link / reference]. Figure 2 The method may include:

[0040] S201. Obtain the image distribution information of multiple first image frames in the first video.

[0041] The execution subject of this disclosure can be an electronic device or a video processing device installed in an electronic device. The video processing device can be implemented through software or a combination of software and hardware.

[0042] Optionally, the first video can be a video acquired by an electronic device. For example, the electronic device can acquire the first video in real time through a camera device, the electronic device can retrieve the first video stored in a database, or the electronic device can receive the first video sent by other devices. This disclosure does not limit this aspect.

[0043] Optionally, the first image frame is a video frame in the first video, and the image distribution information indicates the pixel distribution information of the first image frame. For example, the image distribution information can be the pixel distribution information of the image frame in the R, G, and B channels of the first video. Optionally, the electronic device can obtain the image distribution information of the first image frame through a preset algorithm. For example, the electronic device can process the first image frame through a histogram algorithm to obtain the image distribution information of the first image frame.

[0044] Optionally, before the electronic device obtains the image distribution information of the first image frame through a preset algorithm, the electronic device can perform color enhancement processing on the first image frame through a color enhancement algorithm and obtain the image distribution information of the first image frame after color enhancement, which can improve the accuracy of image distribution information acquisition.

[0045] Below, in conjunction with Figure 3 The image distribution information of the first image frame is explained.

[0046] Figure 3 This is a schematic diagram of image distribution information provided in an embodiment of this disclosure. Please refer to [link / reference]. Figure 3 This includes the pixel distribution curve corresponding to the first image frame. The horizontal axis of the pixel distribution curve represents the pixel value, and the vertical axis represents the number of pixels. By analyzing the pixel distribution curve corresponding to the first image frame, it can be determined that the first image frame contains a larger number of darker pixels and a smaller number of brighter pixels.

[0047] S202. For any first image frame, based on the image distribution information of the first image frame and the image distribution information of the previous N image frames of the first image frame, determine the second image frame associated with the first image frame.

[0048] Optionally, N is an integer greater than or equal to 1. For example, the electronic device can acquire the image distribution information of the first image frame and the image distribution information of the previous image frame; the electronic device can acquire the distribution information of the first image frame and the image distribution information of the previous two image frames, which is not limited in this embodiment.

[0049] Optionally, the second image frame is an image frame obtained by enhancing the first image frame. For example, the electronic device enhances the color, contrast, and brightness of the first image frame using the image distribution information of the first image frame and the image distribution information of the previous image frame to obtain the second image frame.

[0050] Optionally, the electronic device may determine the second image frame associated with the first image frame by the following feasible implementation: determining the first pixel distribution interval of the first image frame based on the image distribution information of the first image frame; determining the N second pixel distribution intervals of the N image frames based on the image distribution information of the previous N image frames; and processing the first image frame based on the first pixel distribution interval and the N second pixel distribution intervals to obtain the second image frame.

[0051] Optionally, the pixel distribution range is used to indicate the range of valid pixels in an image frame. For example, in practical applications, after an electronic device processes an image frame using a histogram algorithm, it obtains the pixel distribution information of the image frame. The pixels in the pixel distribution information are arranged according to their hue values, and the electronic device can determine the pixel distribution range based on the hue value of each pixel.

[0052] Below, in conjunction with Figure 4 The process of determining the pixel distribution range is explained.

[0053] Figure 4 This is a schematic diagram illustrating a process for determining a pixel distribution range according to an embodiment of this disclosure. Please refer to... Figure 4 This includes a pixel distribution curve. The x-axis of the pixel distribution curve represents the pixel value, and the y-axis represents the number of pixels. Pixel values ​​A corresponding to the pixels at 5% of the total number of pixels and B corresponding to the pixels at 95% of the total number of pixels are determined on the pixel distribution curve, resulting in pixel distribution intervals. The left endpoint of each pixel distribution interval is pixel value A, and the right endpoint is pixel value B.

[0054] It should be noted that, Figure 4 In the illustrated embodiments, 5% and 95% can be arbitrarily set values, and this disclosure does not limit this. Figure 4 In the embodiment shown, the electronic device can acquire a first pixel distribution range of a first image frame and N second pixel distribution ranges of N image frames.

[0055] Optionally, based on a first pixel distribution interval and N second pixel distribution intervals, the first image frame is processed to obtain a second image frame. Specifically, the first pixel value at the left endpoint and the second pixel value at the right endpoint of the first pixel distribution interval are obtained. For example, if the first pixel distribution interval includes 1%-99% of the pixels in the histogram information associated with the first image frame, then the pixel value corresponding to the 1% position in the histogram information is obtained and determined as the first pixel value, and the pixel value corresponding to the 99% position in the histogram information is obtained and determined as the second pixel value.

[0056] Obtain the third pixel value at the left endpoint and the fourth pixel value at the right endpoint of the second pixel distribution interval. For example, if the second pixel distribution interval includes 5%-95% of the pixels in the histogram information associated with the previous image frame (taking N as an example), then obtain the pixel value corresponding to the 5% position in the histogram information and determine it as the third pixel value, and obtain the pixel value corresponding to the 95% position in the histogram information and determine it as the fourth pixel value.

[0057] Below, in conjunction with Figure 5The process of obtaining the first pixel value and the second pixel value is explained.

[0058] Figure 5 This is a schematic diagram illustrating an embodiment of obtaining a first pixel value and a second pixel value. Please refer to [link / reference]. Figure 5 This includes the first pixel distribution interval. The pixel value corresponding to the left endpoint of the first pixel distribution interval is determined as the first pixel value of the first image frame, and the pixel value corresponding to the right endpoint of the first pixel distribution interval is determined as the second pixel value of the first image frame. In this way, the endpoint pixel value corresponding to each image frame can be determined using the image distribution information corresponding to each image frame.

[0059] The first image frame is processed based on the first pixel value, the second pixel value, the third pixel value, and the fourth pixel value to obtain the second image frame. For example, the first image frame is subjected to adaptive curve stretching processing using the first pixel value, the second pixel value, the third pixel value, and the fourth pixel value to obtain the second image frame.

[0060] S203. Generate a second video based on the second image frames associated with multiple first image frames.

[0061] Optionally, the second video is a video enhanced from the first video. For example, the electronic device enhances the brightness, color, and contrast of each first image frame in the first video to obtain the second video.

[0062] This disclosure provides a video processing method. An electronic device acquires image distribution information of multiple first image frames in a first video. For any given first image frame, the electronic device can determine a first pixel distribution interval associated with the first image frame based on its image distribution information. Based on the image distribution information of the preceding N image frames, it determines N second pixel distribution intervals for the N image frames. The first image frame is then processed using the pixel values ​​associated with the left and right endpoints of the first and second pixel distribution intervals to obtain a second image frame. Based on these multiple second image frames, a second video enhanced from the first video is generated. In this method, because the electronic device enhances the image of the current frame using the pixel distribution intervals of the current frame and the previous frame, it incorporates pixel distribution information between video frames. Therefore, when adjusting pixels, it can avoid flickering between adjacent video frames with large pixel distribution differences after image enhancement, thereby improving the display effect of the enhanced video.

[0063] exist Figure 2 Based on the illustrated embodiment, the following will take N=1 as an example, combined with... Figure 6The process of processing the first image frame based on the first pixel value, the second pixel value, the third pixel value, and the fourth pixel value to obtain the second image frame in the above video processing method is described.

[0064] Figure 6 This is a schematic diagram illustrating a method for acquiring a second image frame according to an embodiment of this disclosure. Please refer to... Figure 6 The method process includes:

[0065] S601. Based on the first pixel value, the second pixel value, the third pixel value, and the fourth pixel value, determine the first weighting parameter and the second weighting parameter.

[0066] Optionally, the first weighting parameter and the second weighting parameter are used to perform image enhancement processing on the first image frame. For example, the stretching curve corresponding to the first image frame can be obtained through the first weighting parameter and the second weighting parameter, and then the image enhancement processing of the first image frame can be performed through the stretching curve.

[0067] Optionally, the electronic device may determine the first weighting parameter and the second weighting parameter according to the following feasible implementation methods: determining scene switching information based on the first pixel value and the third pixel value, or determining scene switching information based on the second pixel value and the fourth pixel value, and determining the first weighting parameter and the second weighting parameter based on the scene switching information, the first pixel value, the second pixel value, the third pixel value and the fourth pixel value.

[0068] Optionally, scene switching information is used to indicate whether a scene switch has occurred between the first image frame and the previous image frame. For example, if the first image frame is the first frame in a sky footage video and the previous frame is the last frame in a ocean footage video, then a scene switch has occurred between the first image frame and the previous image frame.

[0069] Optionally, there are two feasible implementation methods to determine the scene switching information between the first image frame and the previous image frame:

[0070] One feasible implementation method:

[0071] Scene switching information is determined based on the first pixel value and the third pixel value. For example, if the absolute value of the difference between the first pixel value and the third pixel value is greater than a first preset threshold, it is determined that a scene switch has occurred between the first image frame and the previous image frame, and the scene switching information indicates that a scene switch has occurred between the first image frame and the previous image frame; if the absolute value of the difference between the first pixel value and the third pixel value is less than or equal to the first preset threshold, it is determined that no scene switch has occurred between the first image frame and the previous image frame, and the scene switching information indicates that no scene information has occurred between the first image frame and the previous image frame.

[0072] Optionally, scene switching information can be determined using the following feasible formula:

[0073] |p_min n -p_min n-1 |>A

[0074] Where p_min n p_min is the value of the first pixel. n-1 The value of the third pixel; n is the sequence number of the first image frame in the first video; A is the first preset threshold; if |p_min n -p_min n-1 If |p_min is greater than A, then a scene switch has occurred between the first image frame and the previous image frame. n -p_min n-1 If | is less than or equal to A, then it is determined that no scene switching occurred between the first image frame and the previous image frame.

[0075] Another feasible implementation method:

[0076] Scene switching information is determined based on the second and fourth pixel values. For example, if the absolute value of the difference between the second and fourth pixel values ​​is greater than a second preset threshold, it is determined that a scene switch has occurred between the first image frame and the previous image frame, and the scene switching information indicates that a scene switch has occurred between the first image frame and the previous image frame. If the absolute value of the difference between the second and fourth pixel values ​​is less than or equal to the second preset threshold, it is determined that no scene switch has occurred between the first image frame and the previous image frame, and the scene switching information indicates that no scene information has occurred between the first image frame and the previous image frame. It should be noted that the first preset threshold and the second preset threshold can be the same or different, and this embodiment does not limit this. For example, the first preset threshold can be 10, and the second preset threshold can be 10; or, the first preset threshold is 10, and the second preset threshold is 15.

[0077] Optionally, scene switching information can be determined using the following feasible formula:

[0078] |p_max n -p_max n_1 |>B

[0079] Among them, p_max n p_max is the value of the second pixel. n-1 The value of the fourth pixel; n is the sequence number of the first image frame in the first video; B is the second preset threshold; if |p_max n -p_max n-1If |p_max is greater than B, then a scene switch has occurred between the first image frame and the previous image frame. n -p_max n-1 If | is less than or equal to B, then it is determined that no scene switching occurred between the first image frame and the previous image frame.

[0080] Optionally, based on scene switching information, the first pixel value, the second pixel value, the third pixel value, and the fourth pixel value, the first weighting parameter and the second weighting parameter are determined, with the following two cases:

[0081] Case 1: Scene switching information indicates that a scene switch has occurred between the first image frame and the image frame preceding the first image frame.

[0082] If the scene transition information indicates a scene transition between the first image frame and the previous image frame, then the first pixel value is determined as the first weighting parameter, and the second pixel value is determined as the second weighting parameter. For example, if a scene transition occurs between the first image frame and the previous image frame, and the first pixel value of the first image frame is 10 and the second pixel value is 200, then the first weighting parameter is determined to be 10, and the second weighting parameter is determined to be 200. For example, the first and second weighting parameters can be determined using the following formula:

[0083] p_min_ExpW n =p_min n

[0084] p_max_ExpW n =p_max n

[0085] Among them, p_min_ExpW n p_max_ExpW is the first weighting parameter. n p_min is the second weighting parameter. n p_max is the value of the first pixel. n is the second pixel value; n is the sequence number of the first image frame in the first video.

[0086] Scenario 2: Scene switching information indicates that no scene switching occurred in the first image frame and the image frame preceding the first image frame.

[0087] If the scene switching information indicates that no scene switching has occurred in the first image and the previous image frame of the first image frame, then the third weighted parameter and the fourth weighted parameter of the previous image frame are obtained, and the first weighted parameter and the second weighted parameter are determined based on the first pixel value, the second pixel value, the third weighted parameter and the fourth weighted parameter.

[0088] Optionally, the third and fourth weighting parameters are used to perform image enhancement processing on the previous image frame. For example, the stretching curve corresponding to the previous image frame can be obtained through the third and fourth weighting parameters, and then the previous image frame can be enhanced using the stretching curve.

[0089] Optionally, the third and fourth weighted parameters can be obtained according to the following feasible implementation: when a scene switch occurs between the previous image frame and the previous two image frames, the third pixel value is determined as the third weighted parameter, and the fourth pixel value is determined as the fourth weighted parameter. For example, when determining the second image frame corresponding to the third frame in the video, if a scene switch occurs between the first and second frames, the third weighted parameter is determined to be the third pixel value corresponding to the second frame, and the fourth weighted parameter is determined to be the fourth pixel value corresponding to the second frame.

[0090] When no scene transition occurs between the previous two image frames, the third and fourth weighting parameters are determined based on the weighting parameters of the previous two image frames and the third and fourth pixel values ​​corresponding to the previous image frame. It should be noted that since the first frame of the video does not include the previous frame, a scene transition is determined to have occurred in the first frame. The weighting parameters corresponding to the first frame include the pixel values ​​at the left and right endpoints of the pixel distribution interval of the first frame.

[0091] Optionally, the first weighting parameter and the second weighting parameter can be determined using the following formula:

[0092] p_min_ExpW n =α×p_min_ExpW n-1 +β×p_min n

[0093] p_max_ExpW n =α×p_max_ExpW n_1 +β×p_max n

[0094] Among them, p_min_ExpW n p_min is the first weighting parameter; α and β are weighting coefficients; n p_min_ExpW is the value of the first pixel. n-1 The third weighting parameter; n is the sequence number of the first image frame in the first video; p_max_ExpW n p_max is the second weighting parameter. n The second pixel value; p_max_ExpW n_1 This is the fourth weighted parameter.

[0095] S602. Based on the first weighting parameter and the second weighting parameter, process the first image frame to obtain the second image frame.

[0096] Optionally, the first image frame can be processed to obtain the second image frame according to the following feasible implementation: obtaining the first difference between the first weighting parameter and the second weighting parameter. For example, if the first weighting parameter is 100 and the second weighting parameter is 40, then the first difference is 60.

[0097] A second difference is obtained between the pixel value associated with each pixel and the first weighting parameter, resulting in multiple second differences. For example, for each pixel in the first image frame, the second difference between each pixel and the first weighting parameter is obtained. For example, if the pixel value of a pixel in the first image frame is 100 and the first weighting parameter is 200, then the second difference is 100.

[0098] A second image frame is obtained based on a first difference, a preset value, and multiple second differences. For example, the preset value can be 255. The pixels corresponding to each second difference are adjusted using the first difference, the preset value, and each second difference to obtain the second image frame.

[0099] Optionally, the electronic device can adjust the pixel value of each pixel in the first image frame using the following formula to obtain the second image frame:

[0100] I out =(I_sat-P_min_Expw)×C / (p_max_Expw-p_min_Expw)

[0101] Where I_sat is the pixel value corresponding to the pixel in the first image frame; I out P_min_Expw is the adjusted pixel value; P_max_Expw is the first weighting parameter; C is the second weighting parameter; and C is the preset value.

[0102] It should be noted that the above formula can be used to smoothly adjust the pixel value of each pixel in the first image frame, thereby adaptively stretching the first image frame to obtain the second image frame. For example, if the first image frame includes pixel A and pixel B, the pixel values ​​of pixel A and pixel B can be adjusted using the above method to obtain the second image frame.

[0103] This disclosure provides a method for obtaining a second image frame. Scene switching information is determined based on a first pixel value and a third pixel value, or based on a second pixel value and a fourth pixel value. If the scene switching information indicates a scene switch between the first image frame and its predecessor, the first image frame is processed based on the first and second pixel values ​​to obtain the second image frame. If the scene switching information indicates no scene switch between the first image frame and its predecessor, a weighted parameter of the predecessor is obtained based on the third and fourth pixel values, and the second image frame is determined based on the first pixel value, the second pixel value, and the weighted parameter. In this way, when the scene switching information differs, the electronic device can adjust the pixel values ​​in the first image frame in different ways, improving the flexibility of video enhancement processing. Furthermore, the electronic device can combine the pixel distribution information between video frames to smoothly enhance the brightness, contrast, and color of the current frame. Therefore, when adjusting pixels, flickering between adjacent video frames with large differences in pixel distribution can be avoided after image enhancement processing, thereby improving the display effect after video enhancement.

[0104] Based on any of the above embodiments, the following, in conjunction with Figure 7 The process of the above video processing method will be explained.

[0105] Figure 7 This is a schematic diagram illustrating a video processing method provided in an embodiment of this disclosure. Please refer to [link / reference]. Figure 7 The process includes a first video. The first video includes image A and image B, where image A is the first frame and image B is the second frame. Image distribution information for image A is obtained, and pixel distribution curve A is derived from this information. Similarly, image distribution information for image B is obtained, and pixel distribution curve B is derived from this information.

[0106] Please see Figure 7 In pixel distribution curve A, the third pixel value is determined at the position corresponding to 5% of the total number of pixels, and the fourth pixel value is determined at the position corresponding to 95% of the total number of pixels. Similarly, in pixel distribution curve B, the first pixel value is determined at the position corresponding to 5% of the total number of pixels, and the second pixel value is determined at the position corresponding to 95% of the total number of pixels.

[0107] Please see Figure 7Based on the first and third pixel values, it is determined that no scene transition occurred between image A and image B. Therefore, the stretching curve of image B is determined using the first, second, third, and fourth pixel values. The horizontal and vertical coordinates of the stretching curve represent the bit depth of the color. It should be noted that the process of determining the stretching curve can refer to step S602, and will not be elaborated further in this embodiment.

[0108] Please see Figure 7 The second video is obtained by processing image B through a stretching curve. The second video includes images A and C, where image C is the enhanced version of image B. In this way, when enhancing each frame of the first video, the electronic device can combine the pixel distribution information between adjacent video frames, thus avoiding flickering between adjacent video frames with large differences in pixel distribution after image enhancement, and improving the display effect of the enhanced video.

[0109] Figure 8 This is a schematic diagram of the structure of a video processing apparatus provided in an embodiment of this disclosure. Please refer to [link / reference]. Figure 8 The video processing device 80 includes an acquisition module 81, a determination module 82, and a generation module 83, wherein:

[0110] The acquisition module 81 is used to acquire image distribution information of multiple first image frames in the first video;

[0111] The determining module 82 is used to determine, for any first image frame, a second image frame associated with the first image frame based on the image distribution information of the first image frame and the image distribution information of the previous N image frames of the first image frame, where N is an integer greater than or equal to 1.

[0112] The generation module 83 is used to generate a second video based on the second image frames associated with the plurality of first image frames, wherein the second video is a video after enhancement processing of the first video.

[0113] In one possible implementation, the determining module 82 is specifically used for:

[0114] Based on the image distribution information of the first image frame, the first pixel distribution range of the first image frame is determined;

[0115] Based on the image distribution information of the first N image frames, determine the N second pixel distribution intervals of the N image frames;

[0116] Based on the first pixel distribution interval and the N second pixel distribution intervals, the first image frame is processed to obtain the second image frame.

[0117] In one possible implementation, the determining module 82 is specifically used for:

[0118] Obtain the first pixel value at the left endpoint and the second pixel value at the right endpoint of the first pixel distribution interval;

[0119] Obtain the third pixel value at the left endpoint and the fourth pixel value at the right endpoint of the second pixel distribution interval;

[0120] Based on the first pixel value, the second pixel value, the third pixel value, and the fourth pixel value, the first image frame is processed to obtain the second image frame.

[0121] In one possible implementation, the determining module 82 is specifically used for:

[0122] Based on the first pixel value, the second pixel value, the third pixel value, and the fourth pixel value, a first weighting parameter and a second weighting parameter are determined. The first weighting parameter and the second weighting parameter are used to perform image enhancement processing on the first image frame.

[0123] Based on the first weighting parameter and the second weighting parameter, the first image frame is processed to obtain the second image frame.

[0124] In one possible implementation, the determining module 82 is specifically used for:

[0125] Scene switching information is determined based on the first pixel value and the third pixel value, or scene switching information is determined based on the second pixel value and the fourth pixel value, wherein the scene switching information indicates whether a scene switch has occurred between the first image frame and the previous image frame of the first image frame;

[0126] Based on the scene switching information, the first pixel value, the second pixel value, the third pixel value, and the fourth pixel value, the first weighting parameter and the second weighting parameter are determined.

[0127] In one possible implementation, the determining module 82 is specifically used for:

[0128] If the scene switching information indicates that a scene switch has occurred between the first image frame and the previous image frame of the first image frame, then the first pixel value is determined as the first weighting parameter, and the second pixel value is determined as the second weighting parameter;

[0129] If the scene switching information indicates that no scene switching has occurred in the first image and the previous image frame of the first image frame, then the third weighted parameter and the fourth weighted parameter of the previous image frame are obtained, and the first weighted parameter and the second weighted parameter are determined based on the first pixel value, the second pixel value, the third weighted parameter and the fourth weighted parameter. The third weighted parameter and the fourth weighted parameter are used to perform image enhancement processing on the previous image frame.

[0130] In one possible implementation, the determining module 82 is specifically used for:

[0131] Obtain the first difference between the first weighted parameter and the second weighted parameter;

[0132] Obtain the second difference between the pixel value associated with each pixel and the first weighting parameter, and obtain multiple second differences;

[0133] The second image frame is obtained based on the first difference, the preset value, and the plurality of second differences.

[0134] The video processing apparatus provided in this embodiment can be used to execute the technical solutions of the above method embodiments. Its implementation principle and technical effects are similar, and will not be described again here.

[0135] Figure 9 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this disclosure. Please refer to [link / reference]. Figure 9 The diagram illustrates a structural schematic of an electronic device 900 suitable for implementing embodiments of the present disclosure. The electronic device 900 can be a terminal device or a server. The terminal device can include, but is not limited to, mobile terminals such as mobile phones, laptops, digital radio receivers, personal digital assistants (PDAs), portable Android devices (PADs), portable media players (PMPs), and in-vehicle terminals (e.g., in-vehicle navigation terminals), as well as fixed terminals such as digital TVs and desktop computers. Figure 9 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments disclosed herein.

[0136] like Figure 9As shown, the electronic device 900 may include a processing unit (e.g., a central processing unit, a graphics processing unit, etc.) 901, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 902 or a program loaded from a storage device 908 into a random access memory (RAM) 903. The RAM 903 also stores various programs and data required for the operation of the electronic device 900. The processing unit 901, ROM 902, and RAM 903 are interconnected via a bus 904. An input / output (I / O) interface 905 is also connected to the bus 904.

[0137] Typically, the following devices can be connected to I / O interface 905: input devices 906 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 907 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 908 including, for example, magnetic tapes, hard disks, etc.; and communication devices 909. Communication device 909 allows electronic device 900 to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 9 An electronic device 900 with various devices is shown; however, it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed alternatively.

[0138] In particular, according to embodiments of this disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this disclosure include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device 909, or installed from a storage device 908, or installed from a ROM 902. When the computer program is executed by a processing device 901, it performs the functions defined in the methods of embodiments of this disclosure.

[0139] It should be noted that the computer-readable medium described in this disclosure can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this disclosure, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in connection with an instruction execution system, apparatus, or device. In this disclosure, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium can be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wires, optical fibers, RF (radio frequency), etc., or any suitable combination thereof.

[0140] The aforementioned computer-readable medium may be included in the aforementioned electronic device; or it may exist independently and not assembled into the electronic device.

[0141] The aforementioned computer-readable medium carries one or more programs, which, when executed by the electronic device, cause the electronic device to perform the methods shown in the above embodiments.

[0142] Computer program code for performing the operations of this disclosure can be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, and C++, and conventional procedural programming languages ​​such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a Local Area Network (LAN) or a Wide Area Network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0143] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0144] The units described in the embodiments of this disclosure can be implemented in software or in hardware. The name of a unit does not necessarily limit the unit itself; for example, the first acquisition unit can also be described as "a unit that acquires at least two Internet Protocol addresses".

[0145] The functions described above in this document can be performed, at least in part, by one or more hardware logic components. For example, exemplary types of hardware logic components that can be used, without limitation, include: Field Programmable Gate Arrays (FPGAs), Application-Specific Integrated Circuits (ASICs), Application Standard Products (ASSPs), System-on-Chip (SoCs), Complex Programmable Logic Devices (CPLDs), and so on.

[0146] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0147] It should be noted that the terms "a" and "a plurality of" used in this disclosure are illustrative rather than restrictive, and those skilled in the art should understand that, unless otherwise expressly indicated in the context, they should be understood as "one or more".

[0148] The names of messages or information exchanged between multiple devices in the embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of such messages or information.

[0149] It is understood that before using the technical solutions disclosed in the various embodiments of this disclosure, users should be informed of the types, scope of use, and usage scenarios of the personal information involved in this disclosure in an appropriate manner in accordance with relevant laws and regulations, and user authorization should be obtained.

[0150] For example, upon receiving a user's active request, a prompt message is sent to the user to explicitly inform them that the requested operation will require the acquisition and use of the user's personal information. This allows the user to independently choose whether to provide personal information to the software or hardware, such as the electronic device, application, server, or storage medium performing the operations of this disclosed technical solution, based on the prompt message.

[0151] As an optional but non-limiting implementation, in response to a user's active request, sending a prompt message to the user can be done via a pop-up window, where the prompt message can be presented in text format. Furthermore, the pop-up window can also include a selection control allowing the user to choose "agree" or "disagree" to provide personal information to the electronic device.

[0152] It is understood that the above notification and user authorization process are merely illustrative and do not constitute a limitation on the implementation of this disclosure. Other methods that comply with relevant laws and regulations may also be applied to the implementation of this disclosure.

[0153] It is understood that the data involved in this technical solution (including but not limited to the data itself, its acquisition, or its use) shall comply with the requirements of relevant laws, regulations, and provisions. Data may include information, parameters, and messages, such as flow control instructions.

[0154] The above description is merely a preferred embodiment of this disclosure and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of this disclosure is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the above-described concept. For example, technical solutions formed by substituting the above features with (but not limited to) technical features disclosed in this disclosure that have similar functions.

[0155] Furthermore, while the operations are described in a specific order, this should not be construed as requiring these operations to be performed in the specific order shown or in a sequential order. In certain environments, multitasking and parallel processing may be advantageous. Similarly, while several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of this disclosure. Certain features described in the context of individual embodiments may also be implemented in combination in a single embodiment. Conversely, various features described in the context of a single embodiment may also be implemented individually or in any suitable sub-combination in multiple embodiments.

[0156] Although the subject matter has been described using language specific to structural features and / or methodological logic, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. Rather, the specific features and actions described above are merely illustrative examples of implementing the claims.

Claims

1. A video processing method, characterized in that, include: Obtain the image distribution information of multiple first image frames in the first video; For any given first image frame, the first pixel distribution range of the first image frame is determined based on the image distribution information of the first image frame. Based on the image distribution information of the first N image frames, N second pixel distribution intervals of the N image frames are determined; where N is an integer greater than or equal to 1. Obtain the first pixel value at the left endpoint and the second pixel value at the right endpoint of the first pixel distribution interval; Obtain the third pixel value at the left endpoint and the fourth pixel value at the right endpoint of the second pixel distribution interval; If no scene switch occurs between the first image frame and the previous image frame, then the third weighting parameter and the fourth weighting parameter of the previous image frame are obtained, and the first weighting parameter and the second weighting parameter are determined based on the first pixel value, the second pixel value, the third weighting parameter and the fourth weighting parameter; the first weighting parameter and the second weighting parameter are used to determine the first stretching curve corresponding to the first image frame, and the first stretching curve is used to perform image enhancement processing on the first image frame; The third weighting parameter and the fourth weighting parameter are used to determine the second stretching curve corresponding to the previous image frame, and the second stretching curve is used to perform image enhancement processing on the previous image frame; wherein, when a scene switch occurs between the previous image frame and the previous two image frames, the third weighting parameter is the third pixel value, and the fourth weighting parameter is the fourth pixel value; when no scene switch occurs between the previous image frame and the previous two image frames, the third weighting parameter and the fourth weighting parameter are determined based on the weighting parameters of the previous two image frames and the third pixel value and the fourth pixel value corresponding to the previous image frame; Based on the first weighting parameter and the second weighting parameter, the first image frame is subjected to adaptive curve stretching processing to obtain the second image frame associated with the first image frame; A second video is generated based on the second image frames associated with the plurality of first image frames, and the second video is a video enhanced by the first video.

2. The method according to claim 1, characterized in that, The method further includes: Scene switching information is determined based on the first pixel value and the third pixel value, or scene switching information is determined based on the second pixel value and the fourth pixel value, wherein the scene switching information indicates whether a scene switch has occurred between the first image frame and the previous image frame of the first image frame; If the scene switching information indicates that a scene switch has occurred between the first image frame and the previous image frame, then the first pixel value is determined as the first weighting parameter, and the second pixel value is determined as the second weighting parameter.

3. The method according to claim 1 or 2, characterized in that, The step of performing adaptive curve stretching processing on the first image frame based on the first weighting parameter and the second weighting parameter to obtain the second image frame includes: Obtain the first difference between the first weighted parameter and the second weighted parameter; Obtain the second difference between the pixel value associated with each pixel and the first weighting parameter, and obtain multiple second differences; Based on the first difference, the preset value, and the plurality of second differences, the first image frame is subjected to adaptive curve stretching processing to obtain the second image frame.

4. A video processing apparatus, characterized in that, It includes an acquisition module, a determination module, and a generation module, among which: The acquisition module is used to acquire image distribution information of multiple first image frames in the first video; The determining module is used to determine the first pixel distribution range of any first image frame based on the image distribution information of the first image frame. Based on the image distribution information of the first N image frames, N second pixel distribution intervals of the N image frames are determined; where N is an integer greater than or equal to 1. Obtain the first pixel value at the left endpoint and the second pixel value at the right endpoint of the first pixel distribution interval; Obtain the third pixel value at the left endpoint and the fourth pixel value at the right endpoint of the second pixel distribution interval; If no scene switch occurs between the first image frame and the previous image frame, then the third weighting parameter and the fourth weighting parameter of the previous image frame are obtained, and a first weighting parameter and a second weighting parameter are determined based on the first pixel value, the second pixel value, the third weighting parameter, and the fourth weighting parameter. The first weighting parameter and the second weighting parameter are used to determine the first stretching curve corresponding to the first image frame, and the first stretching curve is used to perform image enhancement processing on the first image frame. The third weighting parameter and the fourth weighting parameter are used to determine the second stretching curve corresponding to the previous image frame, and the second stretching curve is used to perform image enhancement processing on the previous image frame. Wherein, when a scene switch occurs between the previous image frame and the previous two image frames, the third weighting parameter is the third pixel value, and the fourth weighting parameter is the fourth pixel value. When no scene switch occurs between the previous image frame and the previous two image frames, the third weighting parameter and the fourth weighting parameter are determined based on the weighting parameters of the previous two image frames and the third pixel value and the fourth pixel value corresponding to the previous image frame. Based on the first weighting parameter and the second weighting parameter, the first image frame is subjected to adaptive curve stretching processing to obtain the second image frame associated with the first image frame; The generation module is used to generate a second video based on the second image frames associated with the plurality of first image frames, wherein the second video is a video enhanced by the first video.

5. An electronic device, characterized in that, include: Processor and memory; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory, causing the processor to perform the video processing method as described in any one of claims 1 to 3.

6. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, implement the video processing method as described in any one of claims 1 to 3.

7. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the video processing method as described in any one of claims 1 to 3.