CN112165631A - Media resource processing method and device, storage medium and electronic equipment - Google Patents

Media resource processing method and device, storage medium and electronic equipment Download PDF

Info

Publication number
CN112165631A
CN112165631A CN202010990007.8A CN202010990007A CN112165631A CN 112165631 A CN112165631 A CN 112165631A CN 202010990007 A CN202010990007 A CN 202010990007A CN 112165631 A CN112165631 A CN 112165631A
Authority
CN
China
Prior art keywords
color
media resource
pixel point
target
parameter
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202010990007.8A
Other languages
Chinese (zh)
Other versions
CN112165631B (en
Inventor
黄剑鑫
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN202010990007.8A priority Critical patent/CN112165631B/en
Publication of CN112165631A publication Critical patent/CN112165631A/en
Application granted granted Critical
Publication of CN112165631B publication Critical patent/CN112165631B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/234Processing of video elementary streams, e.g. splicing of video streams, manipulating MPEG-4 scene graphs
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/235Processing of additional data, e.g. scrambling of additional data or processing content descriptors
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/435Processing of additional data, e.g. decrypting of additional data, reconstructing software from modules extracted from the transport stream
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/44Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream, rendering scenes according to MPEG-4 scene graphs
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/80Generation or processing of content or additional data by content creator independently of the distribution process; Content per se
    • H04N21/81Monomedia components thereof
    • H04N21/8146Monomedia components thereof involving graphical data, e.g. 3D object, 2D graphics
    • H04N21/8153Monomedia components thereof involving graphical data, e.g. 3D object, 2D graphics comprising still images, e.g. texture, background image
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/80Generation or processing of content or additional data by content creator independently of the distribution process; Content per se
    • H04N21/81Monomedia components thereof
    • H04N21/816Monomedia components thereof involving special video data, e.g 3D video

Abstract

The invention discloses a media resource processing method and device, a storage medium and electronic equipment. Wherein, the method comprises the following steps: acquiring a first media resource and a second media resource to be processed, wherein the color of the image background of each image frame in the first media resource is a target color; acquiring a color filtering processing request triggered by the execution of an operation on a processing operation panel under the condition that a first media resource and a second media resource are drawn to a resource processing area and the first media resource is superposed and displayed on the second media resource; responding to the color filtering processing request, and performing color filtering processing on the target color of the image background in the first media resource according to the color filtering condition so as to enable the adjusted image background of the first media resource to be presented as a transparent background; and displaying the first media resource and the second media resource which are adjusted to be transparent backgrounds in the webpage. The invention solves the technical problem of low media processing efficiency.

Description

Media resource processing method and device, storage medium and electronic equipment
Technical Field
The present invention relates to the field of image processing, and in particular, to a method and an apparatus for processing media resources, a storage medium, and an electronic device.
Background
In the prior art, in order to meet the requirement of playing, the background color of a video with a specific background color is usually removed and then overlaid on another video for playing. For example, green in a section of video with green background is removed, and the remaining video of the object is overlaid on another video to form a new video.
However, in the prior art, in the process of removing the green background, a user is usually required to perform frame-by-frame processing on a video of the green background by using matting software, then add the video with the green background scratched off to another video, and finally combine the two videos, which requires a large amount of time to perform matting of the green background and needs to combine the two videos into one video, resulting in low media processing efficiency.
In view of the above problems, no effective solution has been proposed.
Disclosure of Invention
The embodiment of the invention provides a media resource processing method and device, a storage medium and electronic equipment, and aims to at least solve the technical problem of low media processing efficiency.
According to an aspect of an embodiment of the present invention, there is provided a media resource processing method, including: acquiring a first media resource and a second media resource to be processed, wherein the color of the image background of each image frame in the first media resource is a target color; acquiring a color filtering processing request triggered by executing an operation on a processing operation panel under the condition that the first media resource and the second media resource are drawn to a resource processing area and the first media resource is superposed and displayed on the second media resource, wherein the color filtering processing request carries a color filtering condition for filtering the target color of the image background in the first media resource; responding to the color filtering processing request, and performing color filtering processing on the target color of the image background in the first media resource according to the color filtering condition so as to enable the adjusted image background of the first media resource to be presented as a transparent background; and displaying the first media resource and the second media resource which are adjusted to the transparent background in a webpage.
According to another aspect of the embodiments of the present invention, there is also provided a media resource processing apparatus, including: the device comprises a first acquisition unit, a second acquisition unit and a processing unit, wherein the first acquisition unit is used for acquiring a first media resource and a second media resource to be processed, and the color of the image background of each image frame in the first media resource is a target color; a second obtaining unit, configured to obtain a color filter processing request triggered by an operation performed on a processing operation panel when the first media asset and the second media asset are drawn in an asset processing region and the first media asset is overlappingly displayed on the second media asset, where the color filter processing request carries a color filter condition for performing a filter process on the target color of the image background in the first media asset; a processing unit, configured to perform, in response to the color filtering processing request, color filtering processing on the target color of the image background in the first media resource according to the color filtering condition, so that the adjusted image background of the first media resource appears as a transparent background; and a display unit, configured to display the first media resource and the second media resource adjusted to the transparent background in a webpage.
As an optional example, the apparatus further includes: and a drawing unit, configured to draw the first media resource and the second media resource to the resource processing area through an application interface of the web page before the color filter processing request triggered by the operation performed on the processing operation panel is acquired.
According to still another aspect of the embodiments of the present invention, there is also provided a computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to execute the above media resource processing method when running.
According to another aspect of the embodiments of the present invention, there is also provided an electronic device, including a memory and a processor, where the memory stores a computer program, and the processor is configured to execute the above media resource processing method through the computer program.
In the embodiment of the invention, a first media resource and a second media resource to be processed are obtained, wherein the color of the image background of each image frame in the first media resource is a target color; acquiring a color filtering processing request triggered by executing an operation on a processing operation panel under the condition that the first media resource and the second media resource are drawn to a resource processing area and the first media resource is superposed and displayed on the second media resource, wherein the color filtering processing request carries a color filtering condition for filtering the target color of the image background in the first media resource; responding to the color filtering processing request, and performing color filtering processing on the target color of the image background in the first media resource according to the color filtering condition so as to enable the adjusted image background of the first media resource to be presented as a transparent background; in the method, after the first media resource and the second media resource are acquired, the target color of the image background of the first media resource can be subjected to color filtering processing according to the color filtering conditions in the resource processing region, so that the first media resource with a transparent image background is obtained, and then the first media resource is displayed on the second media resource, so that the effect that the image background of the first media resource is automatically processed through the color filtering conditions, and the video can be played without synthesizing the video is realized, the video processing efficiency is improved, and the technical problem of low media processing efficiency is solved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the invention and together with the description serve to explain the invention without limiting the invention. In the drawings:
FIG. 1 is a schematic diagram of an application environment of an alternative media asset processing method according to an embodiment of the invention;
FIG. 2 is a schematic diagram of an application environment of another alternative media asset processing method according to an embodiment of the invention;
FIG. 3 is a flow chart illustrating an alternative media asset processing method according to an embodiment of the invention;
FIG. 4 is a resource display diagram of an alternative media resource processing method according to an embodiment of the invention;
FIG. 5 is a resource display diagram of another alternative media resource processing method according to an embodiment of the invention;
fig. 6 is a schematic diagram of determining a region of a target pixel point according to an optional media resource processing method according to an embodiment of the present invention;
FIG. 7 is a schematic diagram of a selected video file of an alternative media asset processing method according to an embodiment of the invention;
FIG. 8 is a schematic diagram of an alternative media asset processing method for capturing background color using a filtered straw in accordance with an embodiment of the present invention;
FIG. 9 is a schematic illustration of color filtering a designated area according to an alternative media asset processing method in accordance with an embodiment of the present invention;
FIG. 10 is a flow chart illustrating another alternative media asset processing method according to an embodiment of the present invention;
FIG. 11 is a block diagram of an alternative media resource processing device according to an embodiment of the invention;
fig. 12 is a schematic structural diagram of an alternative electronic device according to an embodiment of the invention.
Detailed Description
In order to make the technical solutions of the present invention better understood, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
According to an aspect of the embodiments of the present invention, a media resource processing method is provided, and optionally, as an optional implementation manner, the media resource processing method may be applied, but not limited, to an application environment as shown in fig. 1.
As shown in fig. 1, the terminal device 102 includes a memory 104 for storing various data generated during the operation of the terminal device 102, a processor 106 for processing and computing the various data, and a display 108 for displaying the first media resource and the second media resource. The terminal device 102 may run a web page and display the web page. Terminal device 102 may interact with server 112 via network 110. The terminal device 102 may send the first media asset to the server 112, and the server 112 may process the first media asset and return the first media asset. The server 112 includes a database 114 for storing the first media asset and a processing engine 116 for processing the first media asset.
Alternatively, the media resource processing method described above may be applied, but not limited, to the application environment shown in fig. 2.
As shown in fig. 2, the terminal device 202 includes a memory 204 for storing various data generated during the operation of the terminal device 202, a processor 206 for processing and operating the various data, and a display 208 for displaying the first media resource and the second media resource. The terminal device 202 may run a web page and display a web page, and the terminal device 202 may perform steps S202 to S208, acquire a first media resource and a second media resource, acquire a color filtering processing request triggered by an operation performed on a processing operation panel in response to the color filtering processing request, perform color filtering processing on a target color of an image background in the first media resource according to a color filtering condition, so that the adjusted image background of the first media resource is presented as a transparent background, and display the processed first media resource and the processed second media resource in the web page, in a case that the first media resource and the second media resource are drawn into a resource processing region and the first media resource is displayed on the second media resource in an overlapping manner.
Optionally, in this embodiment, the terminal device may be a terminal device configured with a target client, and may include, but is not limited to, at least one of the following: mobile phones (such as Android phones, iOS phones, etc.), notebook computers, tablet computers, palm computers, MID (Mobile Internet Devices), PAD, desktop computers, smart televisions, etc. The target client may be a video client, an instant messaging client, a browser client, an educational client, etc. Such networks may include, but are not limited to: a wired network, a wireless network, wherein the wired network comprises: a local area network, a metropolitan area network, and a wide area network, the wireless network comprising: bluetooth, WIFI, and other networks that enable wireless communication. The server may be a single server, a server cluster composed of a plurality of servers, or a cloud server. The above is merely an example, and this is not limited in this embodiment.
Optionally, as an optional implementation manner, as shown in fig. 3, the media resource processing method includes:
s302, a first media resource and a second media resource to be processed are obtained, wherein the color of the image background of each image frame in the first media resource is a target color;
s304, under the condition that a first media resource and a second media resource are drawn to a resource processing area and the first media resource is superposed and displayed on the second media resource, acquiring a color filtering processing request triggered by the execution of an operation on a processing operation panel, wherein the color filtering processing request carries color filtering conditions for filtering the target color of the image background in the first media resource;
s306, responding to the color filtering processing request, and performing color filtering processing on the target color of the image background in the first media resource according to the color filtering condition so as to enable the adjusted image background of the first media resource to be presented as a transparent background;
s308, the first media resource and the second media resource which are adjusted to be transparent backgrounds are displayed in the webpage.
Optionally, the embodiment of the present application may be, but is not limited to, applied to a process in which two or more media assets are simultaneously displayed. For example, during picture and video composition, picture and video overlay, or live broadcast. When the first media resource and the second media resource are displayed simultaneously, the content of the second media resource can be shielded due to the image background of the target color of the first media resource. Accordingly, the image background of the first media asset may be color filtered. In the case where the first media asset and the second media asset are drawn to the asset processing region and the first media asset is displayed superimposed on the second media asset, a color filtering processing request triggered by an operation performed on the processing operation panel is acquired, the color filtering processing request carrying a color filtering condition. And processing the target color in the image background according to the color filtering condition to ensure that the target color is transparent and a transparent background is presented. Therefore, the image background of the first media resource can be processed to be transparent, the image background of the first media resource can not shield the second media resource, and the residual objects of the first media resource are normally displayed.
In the method, after the first media resource and the second media resource are acquired, the target color of the image background of the first media resource can be subjected to color filtering processing in the resource processing region according to the color filtering conditions, so that the first media resource with a transparent image background is obtained, and then the first media resource is displayed on the second media resource, so that the image background of the first media resource is automatically processed according to the color filtering conditions, and the video processing efficiency is improved.
Optionally, the first media resource and the second media resource may be pictures, videos, live video streams, page contents of webpages, or the like. The picture can be a picture or a plurality of pictures, and the picture or the plurality of pictures form a video. For example, a picture is played for 3 seconds to form a video, but the content of the video is the picture. The page content of the web page may be a picture, a video or content that is presented on the web page according to a web page frame.
Alternatively, the size of the display range of the first media asset and the second media asset may be the same or different. If the two are the same, the first media resource will be overlapped with the second media resource, and displayed on the second media resource, and completely block the second media resource. If the display range of the first media resource is smaller than that of the second media resource, the second media resource can be partially covered, and the rest part of the second media resource is not shielded and is normally displayed. For example, as shown in FIG. 4, the display range of the first media asset 404 is smaller than the display range of the second media asset 402, the object 404-2 in the first media asset 404 is the object to be displayed, and the remaining background 404-1 obscures the content on the second media asset 402. Accordingly, the first media asset 404 may be color filtered.
Alternatively, the target color may be a single color. Such as green, blue, etc., the color of the image background of the first media asset being the target color.
Since the color of the image background of the first media resource is the target color, the second media resource is blocked, and therefore, if the target color of the image background of the first media resource is subjected to color filtering processing and converted into a transparent background color, the blocked second media resource can be displayed.
Alternatively, the process operation panel may be a panel for triggering a color filter process request, and a dummy button may be included in the panel, and the color filter process request may be triggered by triggering the dummy button. The filter condition in the filter processing request may be an attribute of a color that needs to be filtered.
The above-described colour filtering processing request may be triggered by user interaction with the terminal device. For example, the user may input a control instruction through an input device, such as a mouse, a keyboard, a touch display screen, or other input devices, and after the terminal device receives the instruction input by the user and determines the color filtering condition, the terminal device may trigger a color filtering processing request, and perform color filtering processing on a target color of an image background of the first media asset according to the color filtering processing request. And the image background of the first media resource is adjusted to be a transparent background, and the first media resource and the second media resource which are adjusted to be the transparent background are displayed in the webpage.
Alternatively, in the process of performing color filtering processing on the first media asset, color filtering processing may be performed on the first media asset frame by frame. And carrying out color filtering processing on each frame of the first media resource according to the color filtering condition to obtain processed images, and splicing the processed images together to form the color-filtered first media resource.
Alternatively, the color filtering condition in the embodiment of the present application may be a constraint condition, such as belonging to an interval, or should be more than a numerical value.
For example, taking the first media resource and the second media resource as videos, the first media resource is covered on the second media resource, the first media resource and the second media resource are drawn in the resource management area, and the background color of the image background of the first media resource is obtained, where the background color is the target color. And acquiring a color filtering processing request triggered by the operation executed on the processing operation panel, wherein the color filtering processing request carries the target color of the image background of the first media resource. After the color filtering processing request is acquired, the color filtering processing may be performed on the image background of the first media resource according to the target color of the image background of the first media resource in the color filtering processing request, and the background color may be adjusted to be a transparent background. The background color of the image background of each frame of the first media asset is adjusted to be transparent when processed. At this time, when the first media resource and the second media resource are displayed in the webpage, the first media resource and the second media resource are played, and the background of the first media resource does not block the second media resource. In the playing process, the first media resource and the second media resource are directly displayed, and the two resources do not need to be synthesized into one resource. For example, as shown in fig. 5. The image background 504-1 of the first media asset 504 on the second media asset 502 is transparentized and does not obscure the second media asset 502, while the displayed object 504-2 of the first media asset 504 is normally displayed, obscuring the second media asset 502.
According to the embodiment, after the first media resource and the second media resource are acquired, the target color of the image background of the first media resource can be subjected to color filtering processing in the resource processing region according to the color filtering conditions, so that the first media resource with a transparent image background is obtained, the first media resource is displayed on the second media resource, the image background of the first media resource is automatically processed according to the color filtering conditions, and the processing efficiency of the media resource is improved.
As an optional implementation, the color filtering processing of the target color of the image background in the first media asset according to the color filtering condition includes:
acquiring image color parameter information corresponding to each pixel point in a first media resource;
determining a target pixel point meeting the color filtering condition according to the image color parameter information of each pixel point;
and adjusting the transparency of the target pixel point to realize color filtering processing.
Optionally, the first media resource in this embodiment of the application may include the displayed object and an image background other than the object. When the first media resource is subjected to color filtering processing, the image background of the first media resource needs to be subjected to color filtering processing, but the object in the first media resource cannot be subjected to color filtering processing. Therefore, all the pixel points of the first media resource need to be acquired, then the color parameter information of each pixel point is acquired, and the target pixel point needing color filtering processing is determined.
Optionally, the color parameter information may be, but is not limited to, a color mode of the pixel. Colors are represented by numbers. For example, color modes include, but are not limited to: RED GREEN BLUE (RGB) color mode, and Hue, Saturation, brightness (Hue, brightness, HSL) color mode.
For example, the description is continued in conjunction with the above-described example. After two videos are drawn into the resource processing area, video 1 is overlaid on video 2, which may be a video on a web page. The video 1 includes an object and a background, and when the video 2 is occluded, a color filter processing request triggered by an operation performed on the processing operation panel can be acquired. The background of the video 1 is subjected to color filtering processing by the color filtering condition in the color filtering processing request. In the process of the color filtering process, it is necessary to determine which portions of the image of each frame of the video 1 need to be subjected to the color filtering process, and which portions do not need to be subjected to the color filtering process. The judgment is based on the image color parameter information of each pixel point in the image of each frame, namely the data of the color mode. For example, as shown in fig. 6, the positions of two frames of images in video 1, image 602 and image 604, and object 602-2 on image 602 and object 604-2 on image 604 are different, and the areas of determined backgrounds (target pixels) 602-1 and 604-1 are also different.
Through the method, the target pixel point of the first media resource can be accurately determined, so that the color filtering processing is accurately finished, and the accuracy of the color filtering processing is improved.
As an optional implementation manner, the obtaining image color parameter information corresponding to each pixel point in the first media resource includes: traversing each pixel point to execute the following operations: acquiring a first color parameter set of a current pixel point in a first color mode; converting the first color parameter set of the current pixel point into a second color parameter set under a second color mode; acquiring a next pixel point as a current pixel point;
determining a target pixel point meeting the color filtering condition according to the image color parameter information of each pixel point comprises the following steps: traversing each pixel point to execute the following operations: acquiring a parameter value of a target color parameter of the current pixel point in the second color parameter set; reading a color filter parameter interval for filtering a target color from the color filter conditions; and determining the target pixel point according to the comparison result between the parameter value of the target color parameter of the current pixel point and the color filtering parameter interval.
Alternatively, the first color parameter set may be a set of color parameters in an RGB color mode. The second set of color parameters may be a set of color parameters in HSL color mode. That is, a parameter value of each pixel point in each frame of image of the first media resource under one color parameter can be obtained, and then the value is converted into a color parameter under another color mode. The converted color parameters may then be compared to color filtering conditions. The color filtering condition may be a constraint condition of the color parameter, for example, a constraint condition of an interval to which one of the color parameters belongs or a constraint condition of more than one threshold. For example, the color parameter after conversion of each pixel point may be compared with the color filtering parameter interval in the color filtering condition, so as to determine whether a pixel point is a target pixel point.
For example, if the color filtering condition specifies that the interval of the hues of the pixels of the pixel is [0, 50], and after the RGB data of one pixel in the first frame image of the first media resource is converted into Hue, Saturation, and brightness (Hue, Saturation, brightness, abbreviated as HSL) data, the value of the Hue H is 20, and the pixel belongs to the interval, the pixel can be used as a target pixel and then subjected to the color filtering process. And if the hue H of a pixel point is 200 and exceeds the above interval, the pixel point is not used as a target pixel point for subsequent color filtering processing.
It should be noted that the above numerical values are only examples, and the specific numerical values should be based on actual situations, and the embodiments of the present application are not limited.
Through the method, whether each pixel point of each frame of video frame of one media resource is the target pixel point or not can be accurately determined according to the color filtering condition in the process of determining the target pixel point, and the accuracy of color filtering processing on the first media resource is improved.
As an optional implementation manner, determining the target pixel point according to the comparison result between the parameter value of the target color parameter of the current pixel point and the color filtering parameter interval includes:
acquiring a first difference value between a parameter value of a target color parameter of a current pixel point and a parameter value of a reference color parameter of a target color;
and under the condition that the first difference value is positioned in the color filtering parameter interval, determining the current pixel point as a target pixel point.
Optionally, the description is continued with the above example. After the parameter value of the target color parameter of the current pixel point in the frame of image of the first media resource is obtained, not only can the relation between the parameter value and the preset filtering parameter interval be compared to determine whether the pixel point is the target pixel point, but also other judging methods can be used. For example, after obtaining the parameter value of the target color parameter of the current pixel point, the parameter value of the target color parameter and the parameter value of the reference color parameter of the target color may be subtracted to obtain a first difference value. The target color is a color of an image background of the first media asset. The reference color parameter is a value of the color parameter of the target color. And comparing whether the first difference value belongs to the color filtering parameter interval to determine whether the current pixel point is the target pixel point. It can be understood that the difference between the color parameter of the current pixel point and the color parameter of the target color can be checked by subtracting the parameter value of the target color parameter from the parameter value of the reference color parameter of the target color. If the first difference is large, the probability that the current pixel is the target pixel is low. If the first difference is very small, the current pixel point is most likely to be the target pixel point.
Through the method, whether each pixel point of each frame of video frame of one media resource is the target pixel point or not can be accurately determined according to the color filtering condition in the process of determining the target pixel point, and the accuracy of color filtering processing on the first media resource is improved.
As an optional implementation, adjusting the transparency of the target pixel to implement the color filtering process includes:
acquiring a second difference value between the parameter value of the target color parameter of the target pixel point in the second color parameter set and the parameter value of the reference color parameter of the target color;
acquiring the ratio of the second difference value to the color filtering parameter interval;
and determining the transparency of the target pixel point according to the product of the ratio and the color coefficient.
Optionally, the description is continued with the above example. In this embodiment, in the calculating of the ratio between the second difference and the color filter parameter interval, the ratio between the second difference and an upper interval of the color filter parameter interval may be calculated, or the ratio between the second difference and a lower interval of the color filter parameter interval may be calculated. For example, a color filter parameter interval of 0, 60, a ratio of the second difference to 60 may be calculated.
Alternatively, the color parameter may be a preset value, such as 255, or another preset value.
After obtaining the parameter value of the target color parameter of the current pixel point of the frame of image of the first media resource, and determining which pixel points in the frame of image are the target pixel points, the parameter value of the target color parameter of the target pixel point and the parameter value of the reference color parameter of the target color may be subtracted to obtain a second difference value. The magnitude of the second difference may represent a difference between a parameter value of the target color parameter of the target pixel point and a parameter value of the reference color parameter of the target color. The ratio of the second difference to 60 can be calculated by comparing the second difference to a filter parameter interval, for example, a filter parameter interval of [0, 60 ]. After the ratio is calculated, the ratio is multiplied by the color coefficient. If the color coefficient is 255, the ratio is multiplied by 255 to obtain the transparency of the target pixel point.
By the method, after the target pixel point is determined, color filtering processing can be performed on the target pixel point. And during color filtering, the transparency of the target pixel point is determined by using the value of the target color parameter of the target pixel point, so that the color filtering processing of the target pixel point is realized, and the accuracy of the color filtering processing of the target pixel point is improved.
As an optional implementation manner, after determining the transparency of the target pixel according to the product between the ratio and the color coefficient, the method further includes:
calculating a third color parameter set of the target pixel point in the first color mode by using the second difference value;
and drawing according to the third color parameter set in the resource processing area, so that the drawn first media resource is presented as a transparent background.
Optionally, after the transparency of the target pixel point is determined and set, the target pixel point may be drawn together with the RGB data of the target pixel point according to the transparency. The RGB data of the target pixel point is obtained by conversion according to the HSL data, but the H data in the HSL data of the target pixel point is not the initial H data, but is a difference value between the original H data and the H data of the target color, that is, the second difference value. And taking the second difference value as H data of the target pixel point, and converting HSL data of the target pixel point into RGB data. And drawing the target pixel points according to the RGB data. And drawing the pixel points of the non-target pixel points according to the original data. And drawing frame by frame according to the frame rate to obtain the first media resource. The image background of the first media asset is converted to a transparent background.
Through the method, the color filtering operation is performed on the first media resource, the image background of the first media resource is processed into the transparent background, the effect of automatically and efficiently transparentizing the background of the first media resource is achieved, and the processing efficiency of the media is improved.
As an optional implementation manner, before acquiring a color filtering processing request triggered by an operation performed on the processing operation panel, the method further includes:
and drawing the first media resource and the second media resource to the resource processing area through an application interface of the webpage.
The description continues with the above example. After the color filtering processing of the first media asset, the image background of the first media asset is transparentized, the first media asset is drawn on the second media asset, and the first media asset and the second media asset are played synchronously. The drawing is completed through the application interface of the webpage, so that the drawing accuracy can be ensured.
The following description is made with reference to a specific example.
Video tag: the < video > tag defines a video, such as a movie clip or other video stream.
Canvas label: the < canvas > tag defines graphics, such as charts and other images.
RGB: RGB is the color representing the three channels of red, green and blue.
HSL: namely Hue, Saturation, and brightness (Hue, brightness, abbreviated as HSL).
Hue (H): the basic attribute of color is the name of commonly known color, such as red, yellow, etc.
Saturation (S): it means the purity of color, the higher the color is, the more pure the color is, the lower the color gradually becomes grey, and the numerical value of 0-100% is taken.
Luminance (L): taking 0-100%, increasing brightness, and changing color to white; reducing the brightness, the color will change to black.
Green screen video: a video with a green screen as background. For example, when a video is captured, a green background cloth is prepared. After the video is shot, the background of the video is green.
The first media resource is a video, and the second media resource is a webpage of a webpage. In the embodiment of the application, the transparent video is realized by filtering out the green color of the green screen video (the first media resource) and simultaneously adjusting the superimposed colors in some hair edges in the video. The video is added to the page of the webpage, and the green screen video can be shot by inserting the video or opening a camera. As shown in fig. 7, fig. 7 is a schematic diagram of an optional selection of a video file. The video 704 may be selected by the select file button in fig. 7 and inserted onto the page 702 of the web page. When the video 704 is unprocessed, the green background of the video blocks the display of the page content 702 of the web page. By selecting the filter pipette button in fig. 7, the interface shown in fig. 8 is obtained. As shown in fig. 8, after a background color 802 of the video is acquired using a filter-sucker, a sucked background color 804 may be displayed at the filter-sucker, the background color 804 being the same as the background color 802 in the video. While the hue 806 of the background color 804 is displayed. Filtering out the selected color in real time, e.g., green is selected in fig. 7, all green in the video becomes transparent. During the color filtering, a color filtering region may also be provided. For example, as shown in fig. 9, when it is selected in fig. 9 that the color filtering process is performed only on the upper half area of the video 902, the color filtering process is performed only on the content of the designated area, and the color filtering process is not performed on the remaining area of the video 902.
In a specific technical approach, video and canvas labels are created, and the video is drawn into the canvas through an Application Programming Interface (API) of the web page. The pseudo code is this. ctx. drawimage (video,0,0, w, h).
RGB information of each pixel point in each frame image of the video is obtained through canvas, and the pseudo code is this. The above x, y, w, h are parameter values.
And traversing pixel point information, and converting the RGB color mode into the HSL color mode.
The concrete conversion formula is as follows:
Figure BDA0002690547980000151
Figure BDA0002690547980000161
Figure BDA0002690547980000171
the r, g, b are parameter values of RGB data, the h, s, l are parameter values of HSL data, and d is an intermediate parameter.
The background color c1 of the video is obtained, and the background color of the green screen video can be green and can be obtained by a filter suction pipe function. A color filtering range r1 (color filtering parameter interval) is set.
And judging whether the hue value h of the green curtain color c1 subtracted from the hue value h in the HSL value of each pixel is smaller than the color filtering range r1 or not, and if so, setting the transparency of the current pixel as (h-c1)/r1 & lt255'. The hue value h of the HSL value of each pixel minus the hue value of the green screen color c1 is set as a new hue value, and a new HSL value is formed with the s and l values of the original pixel, and the RGB color mode is switched back. The conversion formula is:
Figure BDA0002690547980000172
Figure BDA0002690547980000181
and drawing the acquired new RGB information on canvas to present the effect of the transparent video.
The specific flowchart is shown in steps S1002 to S1014 of fig. 10. First, S1002 obtains a first media resource to be color-filtered, i.e., a video, then S1004 draws the video onto a canvas, then S1006 obtains RGB information of each pixel of each frame of the video, then S1008 converts the RGB information into HSL information, S1010 determines a target pixel point according to the HSL information, processes the target pixel point to be transparent, S1012 converts the HSL information into RGB information, and S1014 draws the RGB carefully onto the canvas. Thereby processing the background image of the video to be transparent.
It should be noted that, for simplicity of description, the above-mentioned method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the present invention is not limited by the order of acts, as some steps may occur in other orders or concurrently in accordance with the invention. Further, those skilled in the art should also appreciate that the embodiments described in the specification are preferred embodiments and that the acts and modules referred to are not necessarily required by the invention.
According to another aspect of the embodiment of the present invention, there is also provided a media resource processing apparatus for implementing the above media resource processing method. As shown in fig. 11, the apparatus includes:
a first obtaining unit 1102, configured to obtain a first media resource and a second media resource to be processed, where a color of an image background of each image frame in the first media resource is a target color;
a second obtaining unit 1104, configured to obtain, in a case where the first media asset and the second media asset are drawn to the asset processing region and the first media asset is displayed in a superimposed manner on the second media asset, a color filtering processing request triggered by an operation performed on the processing operation panel, where the color filtering processing request carries a color filtering condition for performing a filter processing on a target color of an image background in the first media asset;
a processing unit 1106, configured to, in response to the color filtering processing request, perform color filtering processing on a target color of an image background in the first media asset according to a color filtering condition, so that the adjusted image background of the first media asset appears as a transparent background;
a presentation unit 1108, configured to present the first media resource and the second media resource adjusted to the transparent background in the webpage.
Optionally, the media resource processing apparatus in the embodiment of the present application may be, but is not limited to, applied to a process in which two or more media resources are simultaneously displayed. For example, during picture and video composition, picture and video overlay, or live broadcast. When the first media resource and the second media resource are displayed simultaneously, the content of the second media resource can be shielded due to the image background of the target color of the first media resource. Accordingly, the image background of the first media asset may be color filtered. In the case where the first media asset and the second media asset are drawn to the asset processing region and the first media asset is displayed superimposed on the second media asset, a color filtering processing request triggered by an operation performed on the processing operation panel is acquired, the color filtering processing request carrying a color filtering condition. And processing the target color in the image background according to the color filtering condition to ensure that the target color is transparent and a transparent background is presented. Therefore, the image background of the first media resource can be processed to be transparent, the image background of the first media resource can not shield the second media resource, and the residual objects of the first media resource are normally displayed.
In the method, after the first media resource and the second media resource are acquired, the target color of the image background of the first media resource can be subjected to color filtering processing in the resource processing region according to the color filtering conditions, so that the first media resource with a transparent image background is obtained, and then the first media resource is displayed on the second media resource, so that the image background of the first media resource is automatically processed according to the color filtering conditions, and the video processing efficiency is improved.
Optionally, the first media resource and the second media resource may be pictures, videos, live video streams, page contents of webpages, or the like. The picture can be a picture or a plurality of pictures, and the picture or the plurality of pictures form a video. For example, a picture is played for 3 seconds to form a video, but the content of the video is the picture. The page content of the web page may be a picture, a video or content that is presented on the web page according to a web page frame.
Alternatively, the size of the display range of the first media asset and the second media asset may be the same or different. If the two are the same, the first media resource will be overlapped with the second media resource, and displayed on the second media resource, and completely block the second media resource. If the display range of the first media resource is smaller than that of the second media resource, the second media resource can be partially covered, and the rest part of the second media resource is not shielded and is normally displayed. For example, as shown in FIG. 4, the display range of the first media asset 404 is smaller than the display range of the second media asset 402, the object 404-2 in the first media asset 404 is the object to be displayed, and the remaining background 404-1 obscures the content on the second media asset 402. Accordingly, the first media asset 404 may be color filtered.
Alternatively, the target color may be a single color. Such as green, blue, etc., the color of the image background of the first media asset being the target color.
Since the color of the image background of the first media resource is the target color, the second media resource is blocked, and therefore, if the target color of the image background of the first media resource is subjected to color filtering processing and converted into a transparent background color, the blocked second media resource can be displayed.
Alternatively, the process operation panel may be a panel for triggering a color filter process request, and a dummy button may be included in the panel, and the color filter process request may be triggered by triggering the dummy button. The filter condition in the filter processing request may be an attribute of a color that needs to be filtered.
The above-described colour filtering processing request may be triggered by user interaction with the terminal device. For example, the user may input a control instruction through an input device, such as a mouse, a keyboard, a touch display screen, or other input devices, and after the terminal device receives the instruction input by the user and determines the color filtering condition, the terminal device may trigger a color filtering processing request, and perform color filtering processing on a target color of an image background of the first media asset according to the color filtering processing request. And the image background of the first media resource is adjusted to be a transparent background, and the first media resource and the second media resource which are adjusted to be the transparent background are displayed in the webpage.
Alternatively, in the process of performing color filtering processing on the first media asset, color filtering processing may be performed on the first media asset frame by frame. And carrying out color filtering processing on each frame of the first media resource according to the color filtering condition to obtain processed images, and splicing the processed images together to form the color-filtered first media resource.
Alternatively, the color filtering condition in the embodiment of the present application may be a constraint condition, such as belonging to an interval, or should be more than a numerical value.
For example, taking the first media resource and the second media resource as videos, the first media resource is covered on the second media resource, the first media resource and the second media resource are drawn in the resource management area, and the background color of the image background of the first media resource is obtained, where the background color is the target color. And acquiring a color filtering processing request triggered by the operation executed on the processing operation panel, wherein the color filtering processing request carries the target color of the image background of the first media resource. After the color filtering processing request is acquired, the color filtering processing may be performed on the image background of the first media resource according to the target color of the image background of the first media resource in the color filtering processing request, and the background color may be adjusted to be a transparent background. The background color of the image background of each frame of the first media asset is adjusted to be transparent when processed. At this time, when the first media resource and the second media resource are displayed in the webpage, the first media resource and the second media resource are played, and the background of the first media resource does not block the second media resource. For example, as shown in fig. 5. The image background 504-1 of the first media asset 504 on the second media asset 502 is transparentized and does not obscure the second media asset 502, while the displayed object 504-2 of the first media asset 504 is normally displayed, obscuring the second media asset 502.
According to the embodiment, after the first media resource and the second media resource are acquired, the target color of the image background of the first media resource can be subjected to color filtering processing in the resource processing region according to the color filtering conditions, so that the first media resource with a transparent image background is obtained, the first media resource is displayed on the second media resource, the image background of the first media resource is automatically processed according to the color filtering conditions, and the video processing efficiency is improved.
According to another aspect of the embodiment of the present invention, there is also provided an electronic device for implementing the media resource processing method, where the electronic device may be a terminal device or a server shown in fig. 12. The present embodiment takes the electronic device as an example for explanation. As shown in fig. 12, the electronic device comprises a memory 1202 and a processor 1204, the memory 1202 having stored therein a computer program, the processor 1204 being arranged to perform the steps of any of the above-described method embodiments by means of the computer program.
Optionally, in this embodiment, the electronic device may be located in at least one network device of a plurality of network devices of a computer network.
Optionally, in this embodiment, the processor may be configured to execute the following steps by a computer program:
acquiring a first media resource and a second media resource to be processed, wherein the color of the image background of each image frame in the first media resource is a target color;
acquiring a color filtering processing request triggered by executing an operation on a processing operation panel under the condition that the first media resource and the second media resource are drawn to a resource processing area and the first media resource is superposed and displayed on the second media resource, wherein the color filtering processing request carries a color filtering condition for filtering the target color of the image background in the first media resource;
responding to the color filtering processing request, and performing color filtering processing on the target color of the image background in the first media resource according to the color filtering condition so as to enable the adjusted image background of the first media resource to be presented as a transparent background;
and displaying the first media resource and the second media resource which are adjusted to the transparent background in a webpage.
Alternatively, it can be understood by those skilled in the art that the structure shown in fig. 12 is only an illustration, and the electronic device may also be a terminal device such as a smart phone (e.g., an Android phone, an iOS phone, etc.), a tablet computer, a palmtop computer, a Mobile Internet Device (MID), a PAD, and the like. Fig. 12 is a diagram illustrating a structure of the electronic device. For example, the electronics may also include more or fewer components (e.g., network interfaces, etc.) than shown in FIG. 12, or have a different configuration than shown in FIG. 12.
The memory 1202 may be used to store software programs and modules, such as program instructions/modules corresponding to the media resource processing method and apparatus in the embodiments of the present invention, and the processor 1204 executes various functional applications and data processing by running the software programs and modules stored in the memory 1202, that is, implements the media resource processing method. The memory 1202 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 1202 can further include memory located remotely from the processor 1204, which can be connected to a terminal over a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof. The memory 1202 may be, but not limited to, specifically configured to store information such as a first media resource and a second media resource. As an example, as shown in fig. 12, the memory 1202 may include, but is not limited to, a first obtaining unit 1102, a second obtaining unit 1104, a processing unit 1106 and a presenting unit 1108 of the media resource processing device. In addition, the media resource processing apparatus may further include, but is not limited to, other module units in the media resource processing apparatus, which is not described in this example again.
Optionally, the transmitting device 1206 is configured to receive or transmit data via a network. Examples of the network may include a wired network and a wireless network. In one example, the transmitting device 1206 includes a Network adapter (NIC) that can be connected to a router via a Network cable to communicate with the internet or a local area Network. In one example, the transmitting device 1206 is a Radio Frequency (RF) module, which is used to communicate with the internet in a wireless manner.
In addition, the electronic device further includes: a display 1208, configured to display the first media resource and the second media resource; and a connection bus 1210 for connecting the respective module parts in the above-described electronic apparatus.
In other embodiments, the terminal device or the server may be a node in a distributed system, where the distributed system may be a blockchain system, and the blockchain system may be a distributed system formed by connecting a plurality of nodes through a network communication. Nodes can form a Peer-To-Peer (P2P, Peer To Peer) network, and any type of computing device, such as a server, a terminal, and other electronic devices, can become a node in the blockchain system by joining the Peer-To-Peer network.
According to an aspect of the application, a computer program product or computer program is provided, comprising computer instructions, the computer instructions being stored in a computer readable storage medium. A processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions to cause the computer device to execute the media resource processing method, wherein the computer program is configured to execute the steps in any of the method embodiments described above.
Alternatively, in the present embodiment, the above-mentioned computer-readable storage medium may be configured to store a computer program for executing the steps of:
acquiring a first media resource and a second media resource to be processed, wherein the color of the image background of each image frame in the first media resource is a target color;
acquiring a color filtering processing request triggered by executing an operation on a processing operation panel under the condition that the first media resource and the second media resource are drawn to a resource processing area and the first media resource is superposed and displayed on the second media resource, wherein the color filtering processing request carries a color filtering condition for filtering the target color of the image background in the first media resource;
responding to the color filtering processing request, and performing color filtering processing on the target color of the image background in the first media resource according to the color filtering condition so as to enable the adjusted image background of the first media resource to be presented as a transparent background;
and displaying the first media resource and the second media resource which are adjusted to the transparent background in a webpage.
Alternatively, in this embodiment, a person skilled in the art may understand that all or part of the steps in the methods of the foregoing embodiments may be implemented by a program instructing hardware associated with the terminal device, where the program may be stored in a computer-readable storage medium, and the storage medium may include: flash disks, Read-Only memories (ROMs), Random Access Memories (RAMs), magnetic or optical disks, and the like.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
The integrated unit in the above embodiments, if implemented in the form of a software functional unit and sold or used as a separate product, may be stored in the above computer-readable storage medium. Based on such understanding, the technical solution of the present invention may be substantially or partially implemented in the prior art, or all or part of the technical solution may be embodied in the form of a software product stored in a storage medium, and including instructions for causing one or more computer devices (which may be personal computers, servers, or network devices) to execute all or part of the steps of the method according to the embodiments of the present invention.
In the above embodiments of the present invention, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
In the several embodiments provided in the present application, it should be understood that the disclosed client may be implemented in other manners. The above-described embodiments of the apparatus are merely illustrative, and for example, a division of a unit is merely a division of a logic function, and an actual implementation may have another division, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, units or modules, and may be in an electrical or other form.
Units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The foregoing is only a preferred embodiment of the present invention, and it should be noted that it is obvious to those skilled in the art that various modifications and improvements can be made without departing from the principle of the present invention, and these modifications and improvements should also be considered as the protection scope of the present invention.

Claims (15)

1. A method for media resource processing, comprising:
acquiring a first media resource and a second media resource to be processed, wherein the color of the image background of each image frame in the first media resource is a target color;
under the condition that the first media resource and the second media resource are drawn to a resource processing area and the first media resource is superposed and displayed on the second media resource, acquiring a color filtering processing request triggered by the execution of an operation on a processing operation panel, wherein the color filtering processing request carries a color filtering condition for filtering the target color of the image background in the first media resource;
responding to the color filtering processing request, and performing color filtering processing on the target color of the image background in the first media resource according to the color filtering condition so as to enable the adjusted image background of the first media resource to be presented as a transparent background;
and displaying the first media resource and the second media resource which are adjusted to the transparent background in a webpage.
2. The method of claim 1, wherein said color filtering said target color of said image background in said first media asset according to said color filtering conditions comprises:
acquiring image color parameter information corresponding to each pixel point in the first media resource;
determining target pixel points meeting the color filtering conditions according to the image color parameter information of each pixel point;
and adjusting the transparency of the target pixel points to realize color filtering processing.
3. The method of claim 2,
the obtaining of the image color parameter information corresponding to each pixel point in the first media resource includes: traversing each pixel point to execute the following operations: acquiring a first color parameter set of a current pixel point in a first color mode; converting the first color parameter set of the current pixel point into a second color parameter set in a second color mode; acquiring a next pixel point as the current pixel point;
the determining a target pixel point meeting the color filtering condition according to the image color parameter information of each pixel point comprises: traversing each pixel point to execute the following operations: acquiring a parameter value of a target color parameter of the current pixel point in the second color parameter set; reading a color filtering parameter interval for filtering the target color from the color filtering condition; and determining the target pixel point according to the comparison result between the parameter value of the target color parameter of the current pixel point and the color filtering parameter interval.
4. The method of claim 3, wherein the determining the target pixel point according to the comparison result between the parameter value of the target color parameter of the current pixel point and the color filtering parameter interval comprises:
acquiring a first difference value between the parameter value of the target color parameter of the current pixel point and the parameter value of the reference color parameter of the target color;
and under the condition that the first difference value is positioned in the color filtering parameter interval, determining the current pixel point as the target pixel point.
5. The method of claim 3, wherein the adjusting the transparency of the target pixel point to achieve a color filtering process comprises:
acquiring a second difference value between the parameter value of the target color parameter and the parameter value of the reference color parameter of the target color in the second color parameter set by the target pixel point;
acquiring a ratio between the second difference and the color filtering parameter interval;
and determining the transparency of the target pixel point according to the product of the ratio and the color coefficient.
6. The method of claim 5, further comprising, after said determining said transparency of said target pixel based on a product between said ratio and a color coefficient:
calculating a third color parameter set of the target pixel point in the first color mode by using the second difference value;
and drawing in the resource processing area according to the third color parameter set, so that the drawn first media resource is presented as the transparent background.
7. The method of any of claims 1-6, further comprising, prior to said obtaining a color filtering processing request triggered by an operation performed on a processing operations panel:
and drawing the first media resource and the second media resource to the resource processing area through an application interface of the webpage.
8. A media asset processing device, comprising:
the device comprises a first acquisition unit, a second acquisition unit and a processing unit, wherein the first acquisition unit is used for acquiring a first media resource and a second media resource to be processed, and the color of the image background of each image frame in the first media resource is a target color;
a second obtaining unit, configured to obtain a color filtering processing request triggered by an operation performed on a processing operation panel when the first media asset and the second media asset are drawn to an asset processing region and the first media asset is displayed in a superimposed manner on the second media asset, where the color filtering processing request carries a color filtering condition for performing a filtering process on the target color of the image background in the first media asset;
the processing unit is used for responding to the color filtering processing request, and performing color filtering processing on the target color of the image background in the first media resource according to the color filtering condition so that the adjusted image background of the first media resource is presented as a transparent background;
and the display unit is used for displaying the first media resource and the second media resource which are adjusted to be the transparent background in a webpage.
9. The apparatus of claim 8, wherein the processing unit comprises:
the acquisition module is used for acquiring image color parameter information corresponding to each pixel point in the first media resource;
the determining module is used for determining a target pixel point meeting the color filtering condition according to the image color parameter information of each pixel point;
and the adjusting module is used for adjusting the transparency of the target pixel point so as to realize color filtering processing.
10. The apparatus of claim 9,
the acquisition module includes: the first processing submodule is used for traversing each pixel point to execute the following operations: acquiring a first color parameter set of a current pixel point in a first color mode; converting the first color parameter set of the current pixel point into a second color parameter set in a second color mode; acquiring a next pixel point as the current pixel point;
the determining module comprises: the second processing submodule is used for traversing each pixel point to execute the following operations: acquiring a parameter value of a target color parameter of the current pixel point in the second color parameter set; reading a color filtering parameter interval for filtering the target color from the color filtering condition; and determining the target pixel point according to the comparison result between the parameter value of the target color parameter of the current pixel point and the color filtering parameter interval.
11. The apparatus of claim 10, wherein the second processing sub-module is further configured to:
acquiring a first difference value between the parameter value of the target color parameter of the current pixel point and the parameter value of the reference color parameter of the target color;
and under the condition that the first difference value is positioned in the color filtering parameter interval, determining the current pixel point as the target pixel point.
12. The apparatus of claim 10, wherein the adjustment module comprises:
the first obtaining submodule is used for obtaining a second difference value between the parameter value of the target color parameter and the parameter value of the reference color parameter of the target color of the target pixel point in the second color parameter set;
a second obtaining submodule for obtaining a ratio between the second difference and the color filter parameter interval;
and the determining submodule is used for determining the transparency of the target pixel point according to the product of the ratio and the color coefficient.
13. The apparatus of claim 12, wherein the adjustment module further comprises:
the calculation submodule is used for calculating a third color parameter set of the target pixel point in the first color mode by using the second difference value after the transparency of the target pixel point is determined according to the product between the ratio and the color coefficient;
and the drawing sub-module is used for drawing in the resource processing area according to the third color parameter set, so that the drawn first media resource is presented as the transparent background.
14. A computer-readable storage medium, comprising a stored program, wherein the program when executed performs the method of any one of claims 1 to 7.
15. An electronic device comprising a memory and a processor, characterized in that the memory has stored therein a computer program, the processor being arranged to execute the method of any of claims 1 to 7 by means of the computer program.
CN202010990007.8A 2020-09-18 2020-09-18 Media resource processing method and device, storage medium and electronic equipment Active CN112165631B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010990007.8A CN112165631B (en) 2020-09-18 2020-09-18 Media resource processing method and device, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010990007.8A CN112165631B (en) 2020-09-18 2020-09-18 Media resource processing method and device, storage medium and electronic equipment

Publications (2)

Publication Number Publication Date
CN112165631A true CN112165631A (en) 2021-01-01
CN112165631B CN112165631B (en) 2022-04-26

Family

ID=73862569

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010990007.8A Active CN112165631B (en) 2020-09-18 2020-09-18 Media resource processing method and device, storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN112165631B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117710271A (en) * 2024-02-06 2024-03-15 成都戎盛科技有限公司 Transparency processing method and system based on Hai Si 2D acceleration platform
CN117710271B (en) * 2024-02-06 2024-04-19 成都戎盛科技有限公司 Transparency processing method and system based on Hai Si 2D acceleration platform

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030085907A1 (en) * 2001-11-02 2003-05-08 Nippon Telegraph And Telephone Corporation Image processing method and image processing apparatus for obtaining overlaid image
CN106162092A (en) * 2016-07-29 2016-11-23 深圳创维-Rgb电子有限公司 A kind of sport video collection and the method and system of broadcasting
CN110503725A (en) * 2019-08-27 2019-11-26 百度在线网络技术(北京)有限公司 Method, apparatus, electronic equipment and the computer readable storage medium of image procossing
CN111416950A (en) * 2020-03-26 2020-07-14 腾讯科技(深圳)有限公司 Video processing method and device, storage medium and electronic equipment

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030085907A1 (en) * 2001-11-02 2003-05-08 Nippon Telegraph And Telephone Corporation Image processing method and image processing apparatus for obtaining overlaid image
CN106162092A (en) * 2016-07-29 2016-11-23 深圳创维-Rgb电子有限公司 A kind of sport video collection and the method and system of broadcasting
CN110503725A (en) * 2019-08-27 2019-11-26 百度在线网络技术(北京)有限公司 Method, apparatus, electronic equipment and the computer readable storage medium of image procossing
CN111416950A (en) * 2020-03-26 2020-07-14 腾讯科技(深圳)有限公司 Video processing method and device, storage medium and electronic equipment

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117710271A (en) * 2024-02-06 2024-03-15 成都戎盛科技有限公司 Transparency processing method and system based on Hai Si 2D acceleration platform
CN117710271B (en) * 2024-02-06 2024-04-19 成都戎盛科技有限公司 Transparency processing method and system based on Hai Si 2D acceleration platform

Also Published As

Publication number Publication date
CN112165631B (en) 2022-04-26

Similar Documents

Publication Publication Date Title
CN110503725B (en) Image processing method, device, electronic equipment and computer readable storage medium
CN103259989B (en) The display methods and device of screen content
CN104811677B (en) The display control method of mobile terminal and device
CN104010124A (en) Method and device for displaying filter effect, and mobile terminal
US8830251B2 (en) Method and system for creating an image
CN113014803A (en) Filter adding method and device and electronic equipment
CN112037160B (en) Image processing method, device and equipment
CN113132696A (en) Image tone mapping method, device, electronic equipment and storage medium
CN112053417A (en) Image processing method, apparatus and system, and computer-readable storage medium
CN105100870A (en) Screenshot method and terminal equipment
CN113891105A (en) Picture display method and device, storage medium and electronic equipment
CN110149550A (en) A kind of image processing method and device
CN110213640B (en) Virtual article generation method, device and equipment
WO2017013986A1 (en) Information processing device, terminal, and remote communication system
CN111562869B (en) Screenshot method and device, storage medium and electronic device
CN112165631B (en) Media resource processing method and device, storage medium and electronic equipment
CN113284063A (en) Image processing method, image processing apparatus, electronic device, and readable storage medium
CN112419218A (en) Image processing method and device and electronic equipment
CN115348469B (en) Picture display method, device, video processing equipment and storage medium
CN113393391B (en) Image enhancement method, image enhancement device, electronic apparatus, and storage medium
CN107622098A (en) Method to set up and device, the storage medium and electronic installation of web site contents color
CN114339313A (en) Frame insertion method and device and electronic equipment
CN113487497A (en) Image processing method and device and electronic equipment
CN114125319A (en) Image sensor, camera module, image processing method and device and electronic equipment
CN113486693A (en) Video processing method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant