Video mask processing method and device, medium, electronic equipment and program product

By dynamically adjusting the transparency of the mask layer during video playback, the problem of poor readability of visual elements due to fixed transparency of the mask layer in the prior art is solved, and the readability and viewing experience of video content are improved.

CN119996759APending Publication Date: 2025-05-13BEIJING YOUZHUJU NETWORK TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510186711.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-19
Publication Date
2025-05-13

AI Technical Summary

Technical Problem

In the prior art, the transparency of the mask layer of the video mask is usually a fixed value, resulting in poor readability of visual elements in the mask layer, especially when the video brightness is low or the background color is similar to the mask color.

Method used

During the video playback process, by determining the display area, target color, color brightness and color difference in the video frame, the transparency of the mask is dynamically adjusted to adapt to the different color brightness and color difference of the video frame.

Benefits of technology

By dynamically adjusting the transparency of the mask, the readability of the target content and the brightness of the video color are improved, and the consistency of the video display brightness is maintained, thereby improving the user's video viewing experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119996759A_ABST
    Figure CN119996759A_ABST
Patent Text Reader

Abstract

The invention discloses a video mask processing method and device, a medium, electronic equipment and a program product, and the method comprises the steps: determining a display region for displaying target content through a mask in a video frame in a video playing process; determining a target color of the display area; determining the color brightness of the target color, and determining the color difference between the target color and the display color of the target content; and determining the target transparency of the mask layer in the display area according to the color brightness and / or the color difference. Therefore, in the video playing process, the transparency of the mask layer in the display area can be dynamically adjusted in real time according to the color brightness and / or the color difference corresponding to each video frame, and on one hand, the readability of the target content and / or the brilliance of the video color can be increased; and on the other hand, by dynamically adjusting the transparency of the mask layer, the display brightness of the video can be basically kept consistent in different playing time periods of the video, so that the video watching experience of the user is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technology, and in particular, to a video mask processing method, device, medium, electronic device and program product. Background Art

[0002] A video mask is a semi-transparent layer superimposed on a video to display text, icons, watermarks or other visual elements. However, in the related art, the transparency of the video mask is usually fixed, which causes problems such as poor readability of the visual elements in the mask. Summary of the invention

[0003] This summary is provided to introduce concepts in a brief form that will be described in detail in the detailed description below. This summary is not intended to identify key features or essential features of the claimed technical solution, nor is it intended to limit the scope of the claimed technical solution.

[0004] In a first aspect, the present disclosure provides a video mask processing method, the video mask processing method comprising: During video playback, determining a display area for displaying target content through a mask in a video frame; Determine a target color of the display area, wherein the target color is a primary color of the display area or is obtained by blending a plurality of colors in the display area whose color proportion is greater than a preset proportion; Determining the color brightness of the target color, and determining the color difference between the target color and the display color of the target content; A target transparency of the mask in the display area is determined according to the color brightness and / or the color difference.

[0005] In a second aspect, the present disclosure provides a video mask processing device, the video mask processing device comprising: A first determination module is used to determine a display area for displaying target content through a mask in a video frame during video playback; A second determination module is used to determine a target color of the display area, wherein the target color is a primary color of the display area or is obtained by blending a plurality of colors in the display area whose color proportion is greater than a preset proportion; A third determination module, configured to determine the color brightness of the target color and determine the color difference between the target color and the display color of the target content; A fourth determination module is used to determine a target transparency of the mask layer in the display area according to the color brightness and / or the color difference.

[0006] In a third aspect, the present disclosure provides a computer-readable medium having a computer program stored thereon, which implements the steps of the method described in the first aspect when the computer program is executed by a processing device.

[0007] In a fourth aspect, the present disclosure provides an electronic device, including: a storage device having a computer program stored thereon; A processing device is used to execute the computer program in the storage device to implement the steps of the method in the first aspect.

[0008] In a fifth aspect, the present disclosure provides a computer program product, comprising a computer program, which implements the steps of the method described in the first aspect when executed by a processor.

[0009] Through the above technical solution, during the video playback process, the display area of ​​the target content displayed through the mask can be determined, and the target color of the display area, the color brightness of the target color, and the color difference between the target color and the display color of the target content can be determined, and then the target transparency of the mask in the display area can be determined according to the color brightness and / or color difference. Therefore, during the video playback process, the transparency of the mask in the display area can be dynamically adjusted in real time according to the color brightness and / or color difference corresponding to each video frame. On the one hand, the readability of the target content and / or the vividness of the video color can be increased; on the other hand, by dynamically adjusting the transparency of the mask, the display brightness of the video can be kept basically consistent during different playback periods of the video, thereby increasing the user's video viewing experience. In addition, since only the display area is processed, the data processing amount can be reduced, and the mask processing speed and processing results can be improved.

[0010] Other features and advantages of the present disclosure will be described in detail in the following detailed description. BRIEF DESCRIPTION OF THE DRAWINGS

[0011] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and the originals and elements are not necessarily drawn to scale. In the drawings: Figure 1 is a flow chart of a video mask processing method according to an exemplary embodiment of the present disclosure; Figure 2 is a schematic diagram showing a comparison of a display area before and after processing according to an exemplary embodiment of the present disclosure; Figure 3 is a structural block diagram of another video mask processing device according to an exemplary embodiment of the present disclosure; Figure 4 It is a schematic structural diagram of an electronic device according to an exemplary embodiment of the present disclosure. DETAILED DESCRIPTION

[0012] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments described herein, which are instead provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.

[0013] It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.

[0014] The term "including" and its variations used herein are open inclusions, i.e., "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". The relevant definitions of other terms will be given in the following description.

[0015] It should be noted that the concepts such as "first" and "second" mentioned in the present disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.

[0016] It should be noted that the modifications of "one" and "plurality" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".

[0017] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.

[0018] It is understandable that before using the technical solutions disclosed in the embodiments of the present disclosure, the types, scope of use, usage scenarios, etc. of the personal information involved in the present disclosure should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations.

[0019] For example, in response to receiving an active request from a user, a prompt message is sent to the user to clearly prompt the user that the operation requested to be performed will require obtaining and using the user's personal information. Thus, the user can autonomously choose whether to provide personal information to software or hardware such as an electronic device, application, server, or storage medium that performs the operation of the technical solution of the present disclosure according to the prompt message.

[0020] As an optional but non-limiting implementation, in response to receiving an active request from the user, the prompt information may be sent to the user in the form of a pop-up window, in which the prompt information may be presented in text form. In addition, the pop-up window may also carry a selection control for the user to choose "agree" or "disagree" to provide personal information to the electronic device.

[0021] It is understandable that the above notification and the process of obtaining user authorization are merely illustrative and do not constitute a limitation on the implementation of the present disclosure. Other methods that meet the relevant laws and regulations may also be applied to the implementation of the present disclosure.

[0022] At the same time, it is understandable that the data involved in this technical solution (including but not limited to the data itself, the acquisition or use of the data) shall comply with the requirements of relevant laws, regulations and relevant provisions.

[0023] As mentioned in the background art, in the related art, the transparency of the video mask is usually set to a fixed value, which causes problems such as poor readability of visual elements in the mask.

[0024] For example, in short video applications, a bottom mask is usually set at the bottom of the video playback page to display the user's published information. However, since the transparency of the bottom mask is generally a fixed value, when the brightness of the video in the video playback page is low, the mask will further reduce the brightness of the video, making the video look darker or less vivid, which not only affects the user's viewing experience, but also reduces the readability of the published information due to the low brightness of the video, thereby affecting the user's efficiency in obtaining information from the video. In addition, when the background color of the video is similar to the color of the published information in the mask, the published information is easily submerged by the background, thereby affecting the readability of the published information.

[0025] In order to overcome the above technical problems, the transparency of the mask can be adjusted in the related technology based on fixed frame extraction and brightness evaluation. For example, for a video, a certain number of video frames can be extracted at fixed time intervals. For example, for a 40-second video, a video frame can be extracted every 4 seconds until 10 video frames are extracted. Then, the video brightness is calculated based on the 10 extracted video frames, and the video brightness is scored based on preset rules to obtain the overall brightness score of the video. Finally, the transparency of the bottom mask is adjusted based on the brightness score. For example, if the brightness score is low, the transparency of the mask can be increased to make the video look brighter; if the brightness score is high, the transparency can be reduced to prevent the mask from being too prominent.

[0026] In this way, since the transparency of the mask is determined based on the fixed frame extraction result, and the transparency of the mask is fixed during the entire video playback process, while the video content changes dynamically, this method cannot adapt to changes in video content in real time and has certain limitations. For example, when there is video content with light and dark changes in the video, the fixed transparency of the mask will cause the display brightness of the video to change dynamically, thus affecting the user's video viewing experience.

[0027] In view of this, the present disclosure provides a video mask processing method, device, medium, electronic device and program product to solve the above technical problems.

[0028] The embodiments of the present disclosure are further explained below with reference to the accompanying drawings.

[0029] Figure 1 is a flowchart of a video mask processing method according to an exemplary embodiment of the present disclosure, referring to Figure 1 , the method may include the following steps: S101: During video playback, determine a display area for displaying target content through a mask in a video frame.

[0030] In this embodiment, the target content may be text, icon, watermark, interactive control or other, which is determined according to actual conditions, and the embodiment of the present disclosure does not impose any limitation on this.

[0031] S102: Determine a target color of the display area, wherein the target color is a main color of the display area or is obtained by blending a plurality of colors whose color proportions in the display area are greater than a preset proportion.

[0032] For example, the display area of ​​the target content displayed through the mask in the video frame can be intercepted to obtain the target image, and then the number of times each color appears in the target image can be counted, and the color with the most appearances can be determined as the target color of the display area. Alternatively, the number of times each color appears in the target image can be counted, and then for each color, the corresponding color proportion can be calculated; then, according to the preset proportion threshold and the color proportion of each color, the colors that meet the conditions are screened out; finally, the screened colors are merged by weighted averaging or median mixing to obtain the target color of the display area.

[0033] It should be understood that the colors in the image are generally represented by the RGB (Red, Green, Blue) color space. Each color is composed of three components of red (R), green (G) and blue (B) in different proportions, and the value range of each component is usually 0 to 255, which results in a very large color space. If the number of occurrences of each color is directly counted, the amount of data may be too large and the processing efficiency may be low. Therefore, in order to improve the statistical efficiency, the target image can be compressed before the color statistics are performed to reduce the amount of data to be processed. At the same time, since there may be many similar or close colors in the target image, if the number of occurrences of each color is directly counted, the statistical results may be too complicated. Therefore, in order to further reduce the amount of data processing and improve the efficiency of color determination, some similar colors can be counted as the same color. For example, colors with similar RGB values ​​can be classified into one category, that is, a threshold can be set in advance, and if the RGB difference of two colors is within the threshold, they are considered to be the same color.

[0034] S103: Determine the color brightness of the target color, and determine the color difference between the target color and the display color of the target content.

[0035] It should be understood that color brightness refers to the lightness or darkness of a color, which can be measured by a simple average method (i.e. L ) or weighted average method (i.e. ) can be calculated, or it can be calculated by other methods, and the embodiments of the present disclosure do not impose any restrictions on this. In view of the fact that the L channel in the LAB color space represents brightness, it is possible to more accurately describe the brightness of the color and more accurately determine the color difference between different colors. Therefore, in a possible way, after obtaining the target color, the target color can be converted from the RGB color mode to the Lab color mode, and then the color brightness of the target color and the color difference between the target color and the display color of the target content are calculated.

[0036] Among them, the LAB color space consists of brightness (L), color channel a and color channel b. The color range included in color channel a is: dark green to pink, and the color range included in color channel b is: bright blue to yellow.

[0037] In addition, it should be understood that color difference, also known as color distance, can be obtained by calculating the Euclidean distance in the color difference space, or by a color difference calculation formula, for example, it can be obtained by the color difference calculation formula CIEDE2000 (Colordifference formula CIE Delta E 2000). Of course, it can also be calculated by other methods, and the embodiments of the present disclosure do not impose any restrictions on this.

[0038] In this step, the color brightness and color difference are determined by first determining the color brightness and then determining the color difference, or by first determining the color difference and then determining the color brightness, or by simultaneously determining the color brightness and color difference. The embodiments of the present disclosure do not impose any limitations on this.

[0039] S104: Determine the target transparency of the mask layer in the display area according to the color brightness and / or color difference.

[0040] Through the above technical solution, during the video playback, the display area of ​​the target content displayed through the mask layer can be determined, and the target color of the display area, the color brightness of the target color, and the color difference between the target color and the display color of the target content can be determined, and then the target transparency of the mask layer in the display area can be determined according to the color brightness and / or color difference. Therefore, during the video playback, the transparency of the mask layer in the display area can be dynamically adjusted in real time according to the color brightness and / or color difference corresponding to each video frame. On the one hand, the readability of the target content and / or the vividness of the video color can be increased; on the other hand, by dynamically adjusting the transparency of the mask layer, the display brightness of the video can be kept basically consistent during different playback periods of the video, thereby increasing the user's video viewing experience. In addition, since only the display area is processed, the data processing amount can be reduced, and the mask layer processing speed and processing results can be improved.

[0041] For example, Figure 2 As shown, Figure 2 (a) and Figure 2 (b) is a schematic diagram showing the comparison of the display area in the same video frame before and after processing, where: Figure 2 (a) is a schematic diagram of the display area before processing. Figure 2 (b) is a schematic diagram of a display area after being processed by the video mask processing method provided in this embodiment, according to Figure 2 (a) and Figure 2(b) It can be seen that by adjusting the transparency of the video mask through the video mask processing method provided in this embodiment, not only the vividness of the video color can be improved, but also the readability of the target content can be increased, so that users can quickly obtain information from the video content, thereby improving the user's video viewing experience.

[0042] To facilitate understanding of the content display method provided by the present disclosure, possible implementation methods in the present disclosure are described below.

[0043] In a possible manner, determining the target transparency of the mask in the display area according to the color brightness and / or color difference may include: According to the color brightness and / or color difference, the adjustment amplitude of the mask transparency in the display area is determined; according to the preset mask transparency threshold and the adjustment amplitude, the target transparency of the mask in the display area is determined, wherein the mask transparency threshold includes the minimum mask transparency and the maximum mask transparency pre-set for the display area.

[0044] In this embodiment, the minimum mask transparency and the maximum mask transparency can be determined according to actual conditions, and the embodiment of the present disclosure does not impose any restrictions on this. For example, the minimum mask transparency can be in the range of [0~1]; the maximum mask transparency can be in the range of [0~1].

[0045] In this embodiment, the minimum mask transparency and the maximum mask transparency can be fixed or dynamically changed. When the minimum mask transparency and the maximum mask transparency are dynamically changed, the minimum mask transparency and the maximum mask transparency can be flexibly adjusted according to historical browsing data, time, ambient light and / or video content importance. For example, the ambient light intensity can be obtained through a light sensor in a terminal device. When the ambient light is strong, the minimum mask transparency is set to 0.5 and the maximum mask transparency is set to 1; when the ambient light is dark, the minimum mask transparency is set to 0.2 and the maximum mask transparency is set to 0.8.

[0046] In a possible manner, the video is played in the terminal device through the target application, and the mask transparency threshold is obtained by the terminal device in the following manner: In response to the start of the target application, an acquisition request for obtaining a mask transparency threshold is generated; the acquisition request is transmitted to the server, so that after receiving the acquisition request, the server determines the mask transparency threshold based on the historical browsing data of the target application in the terminal device, and feeds back the mask transparency threshold to the terminal device.

[0047] In this embodiment, the terminal device may be a mobile terminal device, such as a mobile phone or a tablet, or a non-mobile terminal device, such as a desktop computer, etc. The target application may be a short video application, a social application, or other applications, and the embodiment of the disclosure does not impose any restrictions on this.

[0048] For example, the terminal device is a smart phone, and the target application is a short video application. Therefore, when the user opens the short video application in the smart phone, the processor in the smart phone can generate an acquisition request for obtaining the mask transparency threshold, and transmit the acquisition request to the server. After receiving the acquisition request, the server can obtain historical browsing data in the short video application from the smart phone with the authorization of the user, such as browsing time, browsing time period, and type of browsed video, and then determine the mask transparency threshold based on the historical browsing data, and feed back the mask transparency threshold to the smart phone, thereby obtaining the mask transparency threshold.

[0049] By the above method, when the target application is started, the mask transparency threshold can be obtained from the server. Compared with storing the mask transparency threshold in the target application, the mask transparency threshold can be updated without updating the program version of the target application, thereby not only simplifying the complexity of the mask transparency threshold update operation, but also improving the update speed of the mask transparency threshold. In addition, since the mask transparency threshold is determined based on the historical browsing data of the target application in the terminal device, the user's historical behavior and preference can be determined based on the historical browsing data, and then the mask transparency threshold can be dynamically adjusted according to the user's historical behavior and preference to adapt to the visual needs and usage habits of different users.

[0050] In a possible manner, determining the adjustment amplitude of the transparency of the mask in the display area according to the color brightness and / or color difference may include: When the color difference is less than a first preset color difference, or when the color brightness is greater than or equal to the first preset color brightness, the adjustment amplitude of the mask transparency in the display area is determined to be the first adjustment amplitude; when the color brightness is less than the first preset color brightness and greater than the second preset color brightness, and the color difference is greater than or equal to the first preset color difference, the adjustment amplitude of the mask transparency in the display area is determined based on the color brightness, the first preset threshold value and the second preset threshold value, wherein the first preset color brightness is greater than the second preset color brightness, and the first preset threshold value and the second preset threshold value are positive integers; when the color brightness is less than or equal to the second preset color brightness, the adjustment amplitude of the mask transparency in the display area is determined to be the second adjustment amplitude.

[0051] In this embodiment, the first preset color difference, the first preset color brightness, the second preset color brightness, the first adjustment amplitude, the second adjustment amplitude, the first preset threshold and the second preset threshold can all be determined according to actual conditions, and the embodiment of the present disclosure does not impose any restrictions on this. For example, the first preset color difference can be set to 8, the first preset color brightness can be set to 90, the second preset color brightness can be set to 80, the first adjustment amplitude can be set to 1, the second adjustment amplitude can be set to 0, the first preset threshold can be set to 90, and the second preset threshold can be set to 80.

[0052] In a possible manner, in order to enable a relatively dark video to have an obvious brightening effect of the text; for a relatively bright video, the contrast color of the mask can be retained to improve the efficiency of information transmission. The first preset color difference, the first preset color brightness, the second preset color brightness, the first adjustment amplitude, the second adjustment amplitude, the first preset threshold and the second preset threshold can be determined according to the readability of the text in videos of different brightness levels.

[0053] In this embodiment, based on the color brightness, the first preset threshold and the second preset threshold, the adjustment amplitude of the transparency of the mask in the display area can be determined by pre-constructing a linear calculation formula or a non-linear calculation formula between the color brightness, the first preset threshold and the second preset threshold, so that after obtaining the color brightness, the color brightness can be substituted into the pre-constructed calculation formula to obtain the adjustment amplitude of the transparency of the mask in the display area. It can also be that the color brightness, the first preset threshold and the second preset threshold are pre-used as the input of the model, and the adjustment amplitude of the transparency of the mask in the display area is used as the output of the model, so as to train the machine learning model based on the input and output to obtain the adjustment amplitude prediction model, so that after obtaining the color brightness, the color brightness can be substituted into the adjustment amplitude prediction model to obtain the adjustment amplitude of the transparency of the mask in the display area. Of course, it can also be obtained by other means, and this public embodiment does not impose any restrictions on this.

[0054] In a possible manner, determining the adjustment amplitude of the transparency of the mask in the display area based on the color brightness, the first preset threshold and the second preset threshold may include: Determine a first value obtained by subtracting a second preset threshold from the color brightness; determine a second value obtained by subtracting the second preset threshold from the first preset threshold, wherein the first preset threshold is greater than the second preset threshold; and determine a third value obtained by dividing the first value by the second value as an adjustment amplitude of the mask transparency in the display area.

[0055] For example, continuing to refer to the above example, if the second preset threshold is set to 80 and the first preset threshold is set to 90, the adjustment amplitude of the transparency of the mask layer in the display area can be determined by the following formula:

[0056] in, Indicates the adjustment amplitude, Indicates the color brightness.

[0057] That is to say, in a possible manner, the adjustment amplitude of the transparency of the mask in the display area can be determined by the following formula: when or hour, ,in, Indicates color difference; when hour, ; when and hour, .

[0058] As mentioned above, the first preset color difference, the first preset color brightness, the second preset color brightness, the first adjustment amplitude, the second adjustment amplitude, the first preset threshold and the second preset threshold can be determined according to the readability of the text in videos of different brightness levels. The inventors have found through a large number of experiments that when the color brightness is greater than or equal to 90, the entire video is relatively bright, which will reduce the readability of the target content in the mask layer. Therefore, the adjustment amplitude can be set to 1, so that the transparency of the mask layer can be adjusted to the maximum extent, so that the mask layer is as opaque as possible, thereby improving the readability of the target content. When the color difference between the target content and the mask display area is small, for example, when the color difference is less than 8, since the display color of the target content is close to the display color of the mask display area, the readability of the target content in the mask layer is also poor. Therefore, the adjustment amplitude can also be set to 1, so that the mask layer is as opaque as possible, thereby improving the readability of the target content. When the color brightness is less than or equal to 80, the entire video is relatively dim, and the readability of the displayed content is relatively good. Therefore, in order to reduce the amount of data processing, the adjustment amplitude can be set to 0, that is, the transparency of the mask is not adjusted. When the color brightness is between 80 and 90 and the color difference is large, in order to avoid dynamic changes in the readability of the displayed content, this embodiment determines the adjustment amplitude in a linear change manner, so that when the video brightness is close to 90, the adjustment amplitude can be larger, and when the video brightness is closer to 80, the adjustment amplitude can be smaller, so that a smooth transition can be performed, thereby improving the readability of the content and the video viewing experience.

[0059] In a possible manner, determining the target transparency of the mask layer in the display area according to a preset mask layer transparency threshold and adjustment amplitude may include: Determine a fourth value obtained by subtracting the minimum mask transparency from the maximum mask transparency; determine the product of the fourth value and the adjustment amplitude to obtain a candidate mask transparency; and determine the sum of the candidate mask transparency and the minimum mask transparency as the target transparency of the mask in the display area.

[0060] That is to say, after obtaining the adjustment amplitude, the adjustment amplitude can be substituted into the following formula to obtain the target transparency of the mask in the display area:

[0061] in, Indicates target transparency, Indicates the minimum mask transparency. Indicates the maximum transparency of the mask.

[0062] Through the above method, the target transparency can be determined according to the maximum mask transparency, the minimum mask transparency and the adjustment amplitude, so that the target transparency of the mask can be dynamically adjusted between the maximum mask transparency and the minimum mask transparency to adapt to different display requirements, thereby improving the user experience.

[0063] In a possible manner, the video mask processing method may further include: After determining the target transparency of the mask layer in the display area, the transparency of the mask layer in the display area is transitioned to the target transparency through a preset animation.

[0064] In this embodiment, the preset animation may be a UIView animation, or a Spring animation, or of course other animations, and the present disclosure embodiment does not impose any limitation on this.

[0065] For example, when the preset animation is a UIView animation, the target playback duration of the UIView animation may be preset, whereby the transparency of the mask layer may be transitioned from the current transparency to the target transparency within the target playback duration through the UIView animation.

[0066] In the above manner, the transparency of the mask layer can be smoothly transitioned through a preset animation. Compared with directly jumping from the current transparency to the target transparency, the jumping effect between different transparencies can be avoided, thereby improving the user's viewing experience of the video.

[0067] Based on the same concept, the embodiment of the present disclosure also provides a video mask processing device, such as Figure 3 As shown, the video mask processing device 300 may include: A first determination module 301 is used to determine a display area for displaying target content through a mask in a video frame during video playback; A second determination module 302 is used to determine a target color of the display area, wherein the target color is a main color of the display area or is obtained by blending multiple colors whose color proportions in the display area are greater than a preset proportion; A third determination module 303 is used to determine the color brightness of the target color and determine the color difference between the target color and the display color of the target content; The fourth determination module 304 is used to determine the target mask transparency in the display area according to the color brightness and / or color difference.

[0068] Through the above-mentioned video mask processing device 300, during the video playback process, the display area of ​​the target content displayed through the mask can be determined, and the target color of the display area, the color brightness of the target color, and the color difference between the target color and the display color of the target content can be determined, and then the target transparency of the mask in the display area can be determined according to the color brightness and / or color difference. Therefore, during the video playback process, the transparency of the mask in the display area can be dynamically adjusted in real time according to the color brightness and / or color difference corresponding to each video frame. On the one hand, the readability of the target content and / or the vividness of the video color can be increased; on the other hand, by dynamically adjusting the transparency of the mask, the display brightness of the video can be kept basically consistent during different playback periods of the video, thereby increasing the user's video viewing experience. In addition, since only the display area is processed, the data processing amount can be reduced, and the mask processing speed and processing results can be improved.

[0069] In a possible manner, the fourth determining module 304 may include: A first determination submodule, used to determine the adjustment amplitude of the transparency of the mask layer in the display area according to the color brightness and / or color difference; The second determination submodule is used to determine the target transparency of the mask in the display area according to a preset mask transparency threshold and an adjustment amplitude, wherein the mask transparency threshold includes a minimum mask transparency and a maximum mask transparency pre-set for the display area.

[0070] In a possible manner, the first determining submodule may include: A first determining unit, configured to determine that the adjustment amplitude of the transparency of the mask layer in the display area is a first adjustment amplitude when the color difference is less than a first preset color difference or when the color brightness is greater than or equal to the first preset color brightness; A second determining unit is used to determine an adjustment amplitude of the transparency of the mask in the display area based on the color brightness, a first preset threshold, and a second preset threshold when the color brightness is less than a first preset color brightness and greater than a second preset color brightness, and the color difference is greater than or equal to the first preset color difference, wherein the first preset color brightness is greater than the second preset color brightness, and the first preset threshold and the second preset threshold are positive integers; The third determining unit is configured to determine that the adjustment amplitude of the transparency of the mask layer in the display area is a second adjustment amplitude when the color brightness is less than or equal to a second preset color brightness.

[0071] In a possible manner, the second determining unit may include: A first determination subunit, used to determine a first value obtained by subtracting a second preset threshold from the color brightness; A second determining subunit, configured to determine a second value obtained by subtracting a second preset threshold from a first preset threshold, wherein the first preset threshold is greater than the second preset threshold; The third determining subunit is used to determine a third value obtained by dividing the first value by the second value as an adjustment amplitude of the transparency of the mask layer in the display area.

[0072] In a possible manner, the second determining submodule may include: A fourth determining unit, used to determine a fourth value obtained by subtracting the minimum mask layer transparency from the maximum mask layer transparency; a fifth determining unit, configured to determine a product of the fourth value and the adjustment amplitude to obtain a candidate mask transparency; The sixth determining unit is used to determine the sum of the candidate mask transparency and the minimum mask transparency as the target transparency of the mask in the display area.

[0073] In a possible manner, the video is played in the terminal device through a target application, and accordingly, the mask transparency threshold is obtained by the terminal device in the following manner: In response to the target application being started, generating a request for obtaining a mask transparency threshold; The acquisition request is transmitted to the server, so that after receiving the acquisition request, the server determines the mask transparency threshold based on the historical browsing data of the target application in the terminal device, and feeds back the mask transparency threshold to the terminal device.

[0074] In a possible manner, the video mask processing device 300 may further include: The processing module is used to transition the transparency of the mask layer in the display area to the target transparency through a preset animation after determining the target transparency of the mask layer in the display area.

[0075] Based on the same concept, an embodiment of the present disclosure further provides a computer-readable medium on which a computer program is stored. When the program is executed by a processing device, the steps of any of the above-mentioned video mask processing methods are implemented.

[0076] Based on the same concept, the present disclosure also provides an electronic device, which may include: a storage device having a computer program stored thereon; The processing device is used to execute the computer program in the storage device to implement the steps of any of the above-mentioned video mask processing methods.

[0077] Based on the same concept, an embodiment of the present disclosure further provides a computer program product, including a computer program, which implements the steps of any of the above-mentioned video mask processing methods when executed by a processor.

[0078] Reference below Figure 4 , which shows a schematic diagram of the structure of an electronic device 400 suitable for implementing the embodiment of the present disclosure. The terminal device in the embodiment of the present disclosure may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle terminals (such as vehicle navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 4 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.

[0079] like Figure 4 As shown, the electronic device 400 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 401, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 402 or a program loaded from a storage device 408 into a random access memory (RAM) 403. In the RAM 403, various programs and data required for the operation of the electronic device 400 are also stored. The processing device 401, the ROM 402, and the RAM 403 are connected to each other via a bus 404. An input / output (I / O) interface 405 is also connected to the bus 404.

[0080] Typically, the following devices may be connected to the I / O interface 405: an input device 406 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 407 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 408 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 409. The communication device 409 may allow the electronic device 400 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 4 The electronic device 400 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.

[0081] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication device 409, or installed from the storage device 408, or installed from the ROM 402. When the computer program is executed by the processing device 401, the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.

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

[0083] In some embodiments, any currently known or future developed network protocol such as HTTP (HyperText Transfer Protocol) can be used for communication, and can be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or future developed network.

[0084] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.

[0085] The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device: during video playback, determines a display area for displaying target content through a mask in a video frame; determines a target color of the display area, wherein the target color is the primary color of the display area or is obtained by blending multiple colors in the display area whose color proportions are greater than a preset proportion; determines the color brightness of the target color, and determines the color difference between the target color and the display color of the target content; and determines the transparency of the target mask in the display area based on the color brightness and / or color difference.

[0086] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages ​​or a combination thereof, including, but not limited to, object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).

[0087] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0088] The modules involved in the embodiments described in the present disclosure may be implemented by software or hardware, wherein the name of a module does not, in some cases, limit the module itself.

[0089] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.

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

[0091] According to one or more embodiments of the present disclosure, Example 1 provides a video mask processing method, which includes: during video playback, determining a display area for displaying target content through a mask in a video frame; determining a target color of the display area, wherein the target color is the primary color of the display area or is a fusion of multiple colors in the display area whose color proportion is greater than a preset proportion; determining the color brightness of the target color, and determining the color difference between the target color and the display color of the target content; determining the target transparency of the mask in the display area based on the color brightness and / or color difference.

[0092] According to one or more embodiments of the present disclosure, Example 2 provides the video mask processing method of Example 1, which determines the target transparency of the mask in the display area based on the color brightness and / or color difference, including: determining the adjustment amplitude of the mask transparency in the display area based on the color brightness and / or color difference; determining the target transparency of the mask in the display area based on a preset mask transparency threshold and the adjustment amplitude, wherein the mask transparency threshold includes a minimum mask transparency and a maximum mask transparency pre-set for the display area.

[0093] According to one or more embodiments of the present disclosure, Example 3 provides the video mask processing method of Example 2, which determines the adjustment amplitude of the mask transparency in the display area according to the color brightness and / or color difference, including: when the color difference is less than a first preset color difference, or when the color brightness is greater than or equal to the first preset color brightness, determining that the adjustment amplitude of the mask transparency in the display area is the first adjustment amplitude; when the color brightness is less than the first preset color brightness and greater than the second preset color brightness, and the color difference is greater than or equal to the first preset color difference, determining the adjustment amplitude of the mask transparency in the display area based on the color brightness, the first preset threshold and the second preset threshold, wherein the first preset color brightness is greater than the second preset color brightness, and the first preset threshold and the second preset threshold are positive integers; when the color brightness is less than or equal to the second preset color brightness, determining that the adjustment amplitude of the mask transparency in the display area is the second adjustment amplitude.

[0094] According to one or more embodiments of the present disclosure, Example 4 provides the video mask processing method of Example 3, which determines the adjustment amplitude of the mask transparency in the display area based on color brightness, a first preset threshold, and a second preset threshold, including: determining a first value obtained by subtracting the second preset threshold from the color brightness; determining a second value obtained by subtracting the second preset threshold from the first preset threshold, wherein the first preset threshold is greater than the second preset threshold; and determining a third value obtained by dividing the first value by the second value as the adjustment amplitude of the mask transparency in the display area.

[0095] According to one or more embodiments of the present disclosure, Example 5 provides a video mask processing method of any one of Examples 2-4, which determines the target transparency of the mask in the display area according to a preset mask transparency threshold and an adjustment amplitude, including: determining a fourth value obtained by subtracting the minimum mask transparency from the maximum mask transparency; determining the product between the fourth value and the adjustment amplitude to obtain a candidate mask transparency; and determining the sum of the candidate mask transparency and the minimum mask transparency as the target transparency of the mask in the display area.

[0096] According to one or more embodiments of the present disclosure, Example 6 provides a video mask processing method of any one of Examples 2-4, wherein the video is played in a terminal device through a target application, and the mask transparency threshold is obtained by the terminal device in the following manner: in response to the start of the target application, an acquisition request for obtaining the mask transparency threshold is generated; the acquisition request is transmitted to a server, so that after receiving the acquisition request, the server determines the mask transparency threshold based on the historical browsing data of the target application in the terminal device, and feeds back the mask transparency threshold to the terminal device.

[0097] According to one or more embodiments of the present disclosure, Example 7 provides a video mask processing method of any one of Examples 1-4, and the video mask processing method also includes: after determining the target transparency of the mask in the display area, transitioning the transparency of the mask in the display area to the target transparency through a preset animation.

[0098] According to one or more embodiments of the present disclosure, Example 8 provides a video mask processing device, which includes: a first determination module, used to determine a display area for displaying target content through a mask in a video frame during video playback; a second determination module, used to determine a target color of the display area, wherein the target color is the main color of the display area or is a fusion of multiple colors in the display area whose color proportion is greater than a preset proportion; a third determination module, used to determine the color brightness of the target color and determine the color difference between the target color and the display color of the target content; a fourth determination module, used to determine the target transparency of the mask in the display area based on the color brightness and / or color difference.

[0099] According to one or more embodiments of the present disclosure, Example 9 provides a computer-readable medium having a computer program stored thereon, which, when executed by a processing device, implements the steps of any one of the video mask processing methods in Examples 1-7.

[0100] According to one or more embodiments of the present disclosure, Example 10 provides an electronic device, comprising: a storage device on which a computer program is stored; and a processing device for executing the computer program in the storage device to implement the steps of any one of the video mask processing methods in Examples 1-7.

[0101] According to one or more embodiments of the present disclosure, Example 11 provides a computer program product, including a computer program, which implements the steps of any one of the video mask processing methods in Examples 1-7 when executed by a processor.

[0102] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present disclosure (but not limited to) by each other to form a technical solution.

[0103] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details are included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.

[0104] Although the subject matter has been described in language specific to structural features and / or method logic actions, 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. On the contrary, the specific features and actions described above are merely example forms of implementing the claims. Regarding the device in the above embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.

Claims

1. A video mask processing method, characterized in that: The video mask processing method comprises: During video playback, determining a display area for displaying target content through a mask in a video frame; Determine a target color of the display area, wherein the target color is a primary color of the display area or is obtained by blending a plurality of colors in the display area whose color proportion is greater than a preset proportion; Determining the color brightness of the target color, and determining the color difference between the target color and the display color of the target content; A target transparency of the mask in the display area is determined according to the color brightness and / or the color difference.

2. The video mask processing method according to claim 1, characterized in that: Determining the target transparency of the mask layer in the display area according to the color brightness and / or the color difference includes: Determining an adjustment amplitude of transparency of the mask layer in the display area according to the color brightness and / or the color difference; The target transparency of the mask in the display area is determined according to a preset mask transparency threshold and the adjustment amplitude, wherein the mask transparency threshold includes a minimum mask transparency and a maximum mask transparency pre-set for the display area.

3. The video mask processing method according to claim 2, characterized in that: Determining the adjustment amplitude of the transparency of the mask in the display area according to the color brightness and / or the color difference includes: When the color difference is less than a first preset color difference, or when the color brightness is greater than or equal to the first preset color brightness, determining that the adjustment amplitude of the transparency of the mask layer in the display area is a first adjustment amplitude; When the color brightness is less than the first preset color brightness and greater than the second preset color brightness, and the color difference is greater than or equal to the first preset color difference, determining the adjustment amplitude of the mask transparency in the display area based on the color brightness, the first preset threshold value, and the second preset threshold value, wherein the first preset color brightness is greater than the second preset color brightness, and the first preset threshold value and the second preset threshold value are positive integers; When the color brightness is less than or equal to the second preset color brightness, the adjustment amplitude of the mask transparency in the display area is determined to be the second adjustment amplitude.

4. The video mask processing method according to claim 3, characterized in that: The step of determining the adjustment amplitude of the transparency of the mask layer in the display area based on the color brightness, the first preset threshold and the second preset threshold comprises: Determine a first value obtained by subtracting the second preset threshold from the color brightness; Determine a second value obtained by subtracting the second preset threshold from the first preset threshold, wherein the first preset threshold is greater than the second preset threshold; A third value obtained by dividing the first value by the second value is determined as the adjustment amplitude of the transparency of the mask layer in the display area.

5. The video mask processing method according to any one of claims 2 to 4, characterized in that: The step of determining the target transparency of the mask layer in the display area according to the preset mask layer transparency threshold and the adjustment amplitude includes: Determine a fourth value obtained by subtracting the minimum mask layer transparency from the maximum mask layer transparency; Determine the product of the fourth value and the adjustment amplitude to obtain a candidate mask transparency; The sum of the candidate mask layer transparency and the minimum mask layer transparency is determined as the target transparency of the mask layer in the display area.

6. The video mask processing method according to any one of claims 2 to 4, characterized in that: The video is played in the terminal device through the target application, and the mask transparency threshold is obtained by the terminal device in the following manner: In response to the target application being started, generating an acquisition request for acquiring the mask transparency threshold; The acquisition request is transmitted to the server, so that after receiving the acquisition request, the server determines the mask transparency threshold based on the historical browsing data of the target application in the terminal device, and feeds back the mask transparency threshold to the terminal device.

7. The video mask processing method according to any one of claims 1 to 4, characterized in that: The video mask processing method also includes: After determining the target transparency of the mask layer in the display area, the transparency of the mask layer in the display area is transitioned to the target transparency through a preset animation.

8. A video mask processing device, characterized in that: The video mask processing device comprises: A first determination module is used to determine a display area for displaying target content through a mask in a video frame during video playback; A second determination module is used to determine a target color of the display area, wherein the target color is a primary color of the display area or is obtained by blending a plurality of colors in the display area whose color proportion is greater than a preset proportion; A third determination module, configured to determine the color brightness of the target color and determine the color difference between the target color and the display color of the target content; A fourth determination module is used to determine a target transparency of the mask layer in the display area according to the color brightness and / or the color difference.

9. A computer readable medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processing device, the steps of the method according to any one of claims 1 to 7 are implemented.

10. An electronic device, characterized in that: include: a storage device having a computer program stored thereon; A processing device, configured to execute the computer program in the storage device to implement the steps of the method according to any one of claims 1 to 7.

11. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.