CN113763411A - Image processing method, client and storage medium - Google Patents

Image processing method, client and storage medium Download PDF

Info

Publication number
CN113763411A
CN113763411A CN202110321434.1A CN202110321434A CN113763411A CN 113763411 A CN113763411 A CN 113763411A CN 202110321434 A CN202110321434 A CN 202110321434A CN 113763411 A CN113763411 A CN 113763411A
Authority
CN
China
Prior art keywords
image
processed
control
client
pixel information
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.)
Pending
Application number
CN202110321434.1A
Other languages
Chinese (zh)
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.)
Beijing Jingdong Tuoxian Technology Co Ltd
Original Assignee
Beijing Jingdong Tuoxian Technology 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 Beijing Jingdong Tuoxian Technology Co Ltd filed Critical Beijing Jingdong Tuoxian Technology Co Ltd
Priority to CN202110321434.1A priority Critical patent/CN113763411A/en
Publication of CN113763411A publication Critical patent/CN113763411A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/194Segmentation; Edge detection involving foreground-background segmentation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10004Still image; Photographic image

Abstract

The embodiment of the invention discloses an image processing method, a client and a storage medium, wherein the image processing method is applied to the client, the client comprises a matting control, and the image processing method comprises the following steps: acquiring an image to be processed; extracting pixel information of the image to be processed by utilizing the matting control; screening out first pixel information meeting a preset pixel threshold range from the pixel information, and taking a pixel range corresponding to the first pixel information as a range to be scratched in the image to be processed; extracting a first transparency corresponding to the range of the image to be scratched; and adjusting the first transparency to a preset transparency to obtain the cutout image.

Description

Image processing method, client and storage medium
Technical Field
The present invention relates to the field of image processing technologies, and in particular, to an image processing method, a client, and a storage medium.
Background
In World wide Web (Web) applications, it is often necessary to scratch and remove a solid background in a picture to display other backgrounds or contents behind the picture, for example, in a live video scene, live video contents are original videos with green backgrounds, and the green backgrounds need to be scratched and removed to perform background replacement, special effect addition and other processing on the video contents.
In the prior art, designers use image processing software such as Photoshop to scratch out the background in each picture, so that the time for scratching is prolonged and the speed for scratching is reduced under the condition that the number of pictures is large.
Disclosure of Invention
In order to solve the above technical problems, embodiments of the present invention are intended to provide an image processing method, a client, and a storage medium, which can improve the speed of matting.
The technical scheme of the invention is realized as follows:
the embodiment of the application provides an image processing method, which is applied to a client, wherein the client comprises a matting control, and the image processing method comprises the following steps:
acquiring an image to be processed; extracting pixel information of the image to be processed by utilizing the matting control;
screening out first pixel information meeting a preset pixel threshold range from the pixel information, and taking a pixel range corresponding to the first pixel information as a range to be subjected to matting in the image to be processed;
extracting a first transparency corresponding to the range to be subjected to matting; and adjusting the first transparency to a preset transparency to obtain a cutout image.
The embodiment of the application provides a client, the client includes a scratch control, the client includes:
the acquisition unit is used for acquiring an image to be processed;
the extraction unit is used for extracting the pixel information of the image to be processed by utilizing the matting control; extracting a first transparency corresponding to the range of the image to be scratched;
the screening unit is used for screening out first pixel information meeting a preset pixel threshold range from the pixel information, and taking a pixel range corresponding to the first pixel information as the range to be scratched in the image to be processed;
and the adjusting unit is used for adjusting the first transparency to a preset transparency to obtain the cutout image.
An embodiment of the present application provides a client, where the client includes:
the image processing system comprises a memory, a processor and a communication bus, wherein the memory is communicated with the processor through the communication bus, the memory stores an image processing program executable by the processor, and when the image processing program is executed, the processor executes the image processing method.
The embodiment of the present application provides a storage medium, on which a computer program is stored, and is applied to a client, wherein the computer program is implemented by a processor to implement the image processing method described above when the computer program is executed by the processor.
The embodiment of the invention provides an image processing method, a client and a storage medium, wherein the image processing method is applied to the client, the client comprises a matting control, and the image processing method comprises the following steps: acquiring an image to be processed; extracting pixel information of the image to be processed by utilizing the matting control; screening out first pixel information meeting a preset pixel threshold range from the pixel information, and taking a pixel range corresponding to the first pixel information as a range to be scratched in the image to be processed; extracting a first transparency corresponding to the range of the image to be scratched; and adjusting the first transparency to a preset transparency to obtain the cutout image. By adopting the implementation scheme of the method, the cutout control is arranged in the client, the pixel information of the image to be processed is extracted by the cutout control, so that the client can screen out the first pixel information meeting the preset pixel threshold range from the pixel information, the pixel range corresponding to the first pixel information is used as the range to be cutout in the image to be processed, the first transparency of the range to be cutout is adjusted to be the preset transparency, the cutout image is obtained, even under the condition that the number of the image to be processed is large, the client can still utilize the cutout control to quickly perform cutout processing on the image to be processed, and the speed of the cutout processing on the image to be processed is improved.
Drawings
Fig. 1 is a flowchart of an image processing method according to an embodiment of the present application;
FIG. 2 is a flowchart of an exemplary image processing method provided in an embodiment of the present application;
fig. 3 is a first schematic structural diagram of a client according to an embodiment of the present disclosure;
fig. 4 is a schematic structural diagram of a client according to an embodiment of the present application.
Detailed Description
The technical solution in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
Example one
An embodiment of the present application provides an image processing method, and fig. 1 is a flowchart of the image processing method provided in the embodiment of the present application, and as shown in fig. 1, the image processing method may include:
s101, acquiring an image to be processed; and extracting pixel information of the image to be processed by utilizing the matting control.
The image processing method provided by the embodiment of the application is suitable for the scene of matting the image to be processed.
In the present embodiment, the client may be implemented in various forms. For example, the client described in this application may include, for example, a web client, and may also be other clients, which may be determined according to practical situations, and this is not limited in this application.
In the embodiment of the application, the image processing method is applied to the client, and the client comprises a matting control.
In the embodiment of the application, the scratch control comprises a picture control and a video control. The video control is used for carrying out cutout processing on each frame of image in the video and displaying the frame of image.
In the embodiment of the present application, the picture control and the video control may be the same, or the picture control and the video control may also be different, which may be determined specifically according to the actual situation, and the embodiment of the present application does not limit this.
It should be noted that the sectional control may be a canvas control, or may be another control having a canvas control function, which may be determined specifically according to an actual situation, and this is not limited in the embodiment of the present application.
In the embodiment of the application, a Canvas control can be added on a Web page and set with an id attribute so as to be obtained in a js script.
In the embodiment of the application, in order to conveniently and quickly show the effect after the picture is scratched, the original image control or the video control on the Web end page can be hidden, then the Canvas control is placed at the position of the original picture or the video, and the same width and height are set, so that the scratched pixel data can be drawn by the Canvas.
In the embodiment of the application, if the image is subjected to matting, the image can be subjected to matting processing in an onload callback function of the image; if the video is subjected to matting, each frame of image in the video can be subjected to matting processing in a timeupdate callback function of the video.
In this embodiment of the application, the pixel information of the image to be processed specifically refers to a plurality of pixel information, the image to be processed includes a plurality of pixel points, one pixel point corresponds to one pixel information, and the plurality of pixel points correspond to a plurality of pixel information.
In the embodiment of the present application, the pixel information is specifically RGB color values.
In this embodiment of the application, the image to be processed may be an image that needs to be displayed on a web page, and may also be an image of each frame in a live video, which may be determined specifically according to an actual situation, and this is not limited in this embodiment of the application.
In the embodiment of the present application, the client may obtain the image to be processed by using the matting control, and the client may also obtain the image to be processed by using other manners, which may be specifically determined according to actual conditions.
In the embodiment of the application, a client acquires an image to be processed; and the process of extracting the pixel information of the image to be processed by utilizing the matting control comprises the following steps: acquiring an image to be processed from a client webpage; the client draws the image to be processed on a canvas of the cutout control based on a preset initial position in the cutout control to obtain a drawn image; and the client extracts the pixels for drawing the image by using the matting control to obtain pixel information.
In this embodiment of the present application, the client may obtain the image to be processed from the client webpage by using the matting control, and the client may also obtain the image to be processed in other manners, which may be specifically determined according to actual situations, and this is not limited in this embodiment of the present application.
In this embodiment of the present application, the preset initial position may be a position of an upper left corner of the matting control, may also be a center position of the matting control, and may also be any position in the matting control, which can be specifically determined according to an actual situation, and this embodiment of the present application does not limit this.
In the embodiment of the application, the client can use the position of the upper left corner of the matting control as a preset initial position, determine the width and the height of the image to be processed, determine the drawing area of the image to be processed according to the width and the height of the image to be processed at the preset initial position, and draw the image to be processed in the drawing area of the canvas, so as to obtain the matting image.
In the embodiment of the application, a text's drawImage (image, x, y) method is called, a two-dimensional drawing API provides a capability of drawing image content on a Web page on a Canvas control, a parameter image is a target image control to be drawn, the parameter image may also be a Web video control, a parameter x and a parameter y of the drawImage method represent a coordinate position at which the target image is drawn on the Canvas control, and an origin of the coordinate system is an upper left corner and may be set to 0, 0.
It should be noted that, because the Canvas can draw the content of the video control, the client can also perform the matting processing on the video content, and by detecting the change event of the playing frame, the picture of each frame can be processed in the video playing process, thereby achieving the dynamic matting effect of the video.
In the embodiment of the application, after the draw image method of context is called, the picture content of the picture control or the video control is already displayed on the Canvas control of the Web page at this time. The client side continuously calls the getImageData (x, y, width, height) method of context, and the two-dimensional drawing API provides the capability of extracting the pixel data of the content currently displayed by the Canvas control, wherein the parameter x and the parameter y represent the coordinates of the starting point of the pixel content to be extracted, and the parameter width and the parameter height represent the width and the height of the pixel content to be extracted. In the process of performing matting processing on the picture of the whole image to be processed, the values of the several parameters can be set as follows: 0, 0, width value of Canvas control, height value of Canvas control. The two-dimensional drawing API method is called to return an array containing all the pixel data of the Canvas display.
It should be noted that every four values in the array are a group, and each group represents R, G, B, A (alpha channel, i.e. transparency) of a pixel point.
In this embodiment of the present application, a process in which a client extracts pixels of a drawn image by using a matting control to obtain pixel information includes: and under the condition that the attribute of the matting control is extractable pixel attribute, extracting pixels for drawing the image by using the matting control to obtain pixel information.
In the embodiment of the present application, the attribute of the scratch control is a crosssort attribute of the scratch control, and when the attribute value of the crosssort attribute is anonymous, the attribute of the scratch control is an extractable pixel attribute.
It can be understood that by setting the attribute of the scratch control, the scratch control does not receive the limitation of the browser when the scratch control performs pixel extraction on the cross-domain picture.
In the embodiment of the present application, the process of setting the attribute value of the crosslogic attribute as anonymous may be that a document getElementById method of document is used to obtain a dom element that has been rendered on a Web page, and then the crosslogic attribute of the dom element is accessed and assigned as anonymous.
It should be noted that, if the video image is subjected to matting, the attribute of the video control on the Web end page also needs to be set as anonymous.
In the embodiment of the application, the client draws the image to be processed on the canvas of the scratch control based on the preset initial position in the scratch control, and before the drawing image is obtained, the client also determines the drawing environment of the scratch control; correspondingly, the client draws the image to be processed on the canvas of the cutout control based on the preset initial position in the cutout control, and the process of drawing the image is obtained, which comprises the following steps: and the client draws the image to be processed on the canvas of the scratch control based on the preset initial position in the scratch control in the drawing environment to obtain a drawn image.
In the embodiment of the present application, the drawing environment may be a 2d drawing environment or a 3d drawing environment, which may be determined specifically according to an actual situation, and the embodiment of the present application does not limit this.
In this embodiment, the Canvas object may be retrieved from the js script by the id of the scratch control, and then returned to an environment for drawing on the Canvas by the getContext (contextID) method. The parameter contextID specifies the type to be drawn on the canvas. The only current legal value is "2d", which specifies a two-dimensional drawing, and causes the method to return an environment object that exports a two-dimensional drawing API.
In this embodiment of the present application, a process of extracting pixel information of an image to be processed by a client using a matting control includes: under the condition that a client detects that an image to be processed is loaded and finishes an event, extracting pixel information of the image to be processed by using a matting control; or, the client extracts the pixel information of the image to be processed by using the matting control under the condition that the playing frame change event is detected.
In the embodiment of the application, when the matting control is specifically a picture control, the client may detect a to-be-processed image loading completion event in the process of acquiring the to-be-processed image, and when the client detects the to-be-processed image loading completion event, the client may extract pixel information of the to-be-processed image by using the matting control.
In this embodiment of the application, when the matting control is specifically a video control, the client may detect a play frame change event in a process of acquiring each frame of image (to-be-processed image) in a video, and when the client detects the play frame change event, the client may extract pixel information of the to-be-processed image by using the matting control.
In the embodiment of the application, when the remote picture is not loaded, the client cannot acquire complete pixel information in the image to be processed, so that the loading process of the remote picture needs to be monitored, the client can complete an onload event by monitoring the loading of the picture control, the client can determine to acquire the complete image to be processed under the condition that the client detects the onload event, and then the client can extract the pixel information of the image to be processed by using the matting control.
In the embodiment of the application, the process that the client monitors the onload event of the picture control after loading comprises the steps that the client acquires a dom object of an image to be processed and assigns a callback function to onload attributes of the image to be processed so as to ensure accurate monitoring of the loading behavior of the picture.
In the embodiment of the present application, if the matting processing is performed on a video image, the playing frame change event timeupdate of a video control needs to be monitored.
It should be noted that the playing frame change event timeupdate indicates that the current frame of the video has changed (the video picture has changed), and the client needs to perform the matting processing on the frame of video image each time the video picture changes.
In the embodiment of the application, the process of monitoring the playing frame change event timeupdate of the video control by the client includes acquiring a dom object of a video image, and assigning a callback function to the timeupdate attribute of the video image to ensure that the picture change of the video is monitored accurately.
S102, screening out first pixel information meeting a preset pixel threshold range from the pixel information, and taking a pixel range corresponding to the first pixel information as a range to be scratched in the image to be processed.
In the embodiment of the application, a client acquires an image to be processed; after the pixel information of the image to be processed is extracted by using the matting control, the client can screen out first pixel information meeting a preset pixel threshold range from the pixel information, and a pixel range corresponding to the first pixel information is used as a range to be matting in the image to be processed.
In this embodiment of the application, the preset pixel threshold range may be a pixel threshold range corresponding to the first pixel information of the client.
Illustratively, green is a color to be scratched out in an image to be processed, and RGB color values (target color values) of green are: if the target color threshold of green is 10, the client adds or subtracts 10 to the RGB color value to obtain a corresponding pixel threshold range, that is, a corresponding pixel information threshold range of green: r is 0-10, G is 245-255 and B is 0-10, namely the client determines the pixel information of the RGB color value of the pixel in the image to be processed in the pixel information threshold range of green to be green.
Note that, since the maximum value of the RGB color values is 255 and the minimum value is 0, the range of R is 0 to 10 after addition or subtraction of 10 on the basis that R is 0; after 10 is added or subtracted on the basis that G is 255, the range of G is 245-255; after adding or subtracting 10 on the basis that B is 0, the range of B is 0-10.
In this application embodiment, the client can determine the target RGB color value to be scratched out according to the target color value instruction, and if the target RGB color value to be scratched out is green, the green RGB color value is respectively: r is 0, G is 255 and B is 0.
In the embodiment of the present application, due to the reason such as light and image quality when the to-be-processed image is shot, the color value of the image pixel of the to-be-processed image cannot be absolutely equal to the target color value, so a target color value range (preset pixel threshold range) needs to be set, as long as the pixel point in the range all belongs to the pixel capable of being scratched.
The target color threshold is an integer greater than 0, and the threshold may be any value between 10 and 32.
S103, extracting a first transparency corresponding to the range to be scratched; and adjusting the first transparency to a preset transparency to obtain the cutout image.
In the embodiment of the application, after the client screens out first pixel information meeting a preset pixel threshold range from the pixel information and takes a pixel range corresponding to the first pixel information as a range to be subjected to matting in an image to be processed, the client can extract a first transparency corresponding to the range to be subjected to matting; and the first transparency is adjusted to be the preset transparency, so that the cutout image is obtained.
Note that the transparency is preset to be a transparency at a transparency value of 0.
In the embodiment of the application, after the client adjusts the transparency of the range to be subjected to matting to be preset transparency, the client removes the range to be subjected to matting in the image to be processed, so that the matting image is obtained.
In the embodiment of the present application, the first transparency may be a value of an alpha channel corresponding to the range to be scratched.
In the embodiment of the application, the client adjusts the first transparency to be the preset transparency, and after the cutout image is obtained, the client can also display the cutout image.
In the embodiment of the application, after a client scratches a to-be-scratched range in a drawn image on a scratch control, namely after the client obtains a scratch image, the client can directly display the scratch image; the client may also add other images to the range to be subjected to matting in the drawn image directly for synthesis after obtaining the matting image, which may be specifically determined according to the actual situation, and this is not limited in the embodiment of the present application.
In the embodiment of the application, the processed pixel array is transferred to the parameter imageData by calling a putImageData (x, y) method of context, wherein the parameter x and the parameter y represent initial coordinates and are directly transferred to 0, namely 0. The API re-renders the content displayed by the Canvas into pixel data in the parameter imageData, so that the Canvas control at the Web end is displayed as a target color value to present a completely transparent effect, namely, a cutout image is displayed.
An exemplary image processing method is provided in an embodiment of the present application, as shown in fig. 2:
1. and the client acquires the image to be processed from the webpage.
It should be noted that the web page is specifically a client-side web page.
2. Under the condition that the loading completion event of the image to be processed is detected, the client draws the image to be processed on a canvas of the cutout control based on a preset initial position in the cutout control to obtain a drawn image.
3. Under the condition that a play frame change event is detected, the client draws the image to be processed on a canvas of the scratch control based on a preset initial position in the scratch control to obtain a drawn image.
In the embodiment of the present application, after the client performs step 1, step 2 may be directly performed; after the client executes step 1, step 3 may also be directly executed, which may be specifically determined according to an actual situation, and this is not limited in this embodiment of the application.
4. And the client extracts the pixels for drawing the image by using the matting control to obtain pixel information.
5. The client screens out first pixel information meeting a preset pixel threshold range from the pixel information.
6. And the client takes the pixel range corresponding to the first pixel information as the range to be subjected to matting in the image to be processed.
7. The client extracts a first transparency corresponding to the range of the image to be scratched.
8. And the client adjusts the first transparency to a preset transparency to obtain the cutout image.
9. And the client displays the sectional image.
In this embodiment of the present application, the client may display the cutout image by using the cutout control, and the client may also display the cutout image by using other manners, which may be specifically determined according to actual situations, and this embodiment of the present application does not limit this.
It can be understood that, through setting up the scratch control in the client, utilize the scratch control to extract the pixel information of pending image, make the client can select the first pixel information that satisfies preset pixel threshold value scope from the pixel information, and regard the pixel scope that first pixel information corresponds as the scope of waiting to scratch in the pending image, adjust the first transparency of the scope of waiting to scratch to preset transparency, thereby obtain the scratch image, even under the big circumstances of the quantity of pending image, the client still can utilize the quick pending image of scratch control to carry out the scratch processing, the speed when having improved the pending image and carrying out the scratch is improved.
Example two
Based on the same inventive concept of the embodiments, the embodiments of the present application provide a client 1, corresponding to an image processing method; the client includes a matting control, fig. 3 is a schematic diagram of a composition structure of the client provided in the embodiment of the present application, where the client 1 may include:
an acquisition unit 11 configured to acquire an image to be processed;
an extracting unit 12, configured to extract pixel information of the image to be processed by using the matting control; extracting a first transparency corresponding to the range of the image to be scratched;
the screening unit 13 is configured to screen out first pixel information that meets a preset pixel threshold range from the pixel information, and use a pixel range corresponding to the first pixel information as the range to be scratched in the image to be processed;
and the adjusting unit 14 is configured to adjust the first transparency to a preset transparency, so as to obtain a cutout image.
In some embodiments of the present application, the client further comprises a rendering unit;
the acquiring unit 11 is configured to acquire the image to be processed from a client webpage;
the drawing unit is used for drawing the image to be processed on the canvas of the matting control based on a preset initial position in the matting control to obtain a drawn image;
the extracting unit 12 is configured to extract the pixels of the drawn image by using the matting control, so as to obtain the pixel information.
In some embodiments of the present application, the extracting unit 12 is configured to, when the attribute of the matting control is an extractable pixel attribute, extract a pixel of the drawing image by using the matting control, so as to obtain the pixel information.
In some embodiments of the present application, the extracting unit 12 is configured to, in a case that a loading completion event of the to-be-processed image is detected, extract pixel information of the to-be-processed image by using the matting control; or, under the condition that a play frame change event is detected, extracting the pixel information of the image to be processed by using the matting control.
In some embodiments of the present application, the client further comprises a determining unit;
the determining unit is used for determining the drawing environment of the scratch control;
correspondingly, the drawing unit is used for drawing the to-be-processed image on the canvas of the cutout control based on the preset initial position in the cutout control under the drawing environment to obtain the drawing image.
In some embodiments of the present application, the pixel information is RGB color values.
In some embodiments of the present application, the client further comprises a display unit;
the display unit is used for displaying the sectional image.
In practical applications, the obtaining Unit 11, the extracting Unit 12, the screening Unit 13, and the adjusting Unit 14 may be implemented by a processor 15 on the client 1, specifically implemented by a CPU (Central Processing Unit), an MPU (Microprocessor Unit), a DSP (Digital Signal Processing), a Field Programmable Gate Array (FPGA), or the like; the above data storage may be implemented by the memory 16 on the client 1.
An embodiment of the present invention further provides a client 1, and as shown in fig. 4, the client 1 includes: a processor 15, a memory 16 and a communication bus 17, the memory 16 communicating with the processor 15 via the communication bus 17, the memory 16 storing a program executable by the processor 15, the program, when executed, performing the image processing method as described above via the processor 15.
In practical applications, the Memory 16 may be a volatile Memory (volatile Memory), such as a Random-Access Memory (RAM); or a non-volatile Memory (non-volatile Memory), such as a Read-Only Memory (ROM), a flash Memory (flash Memory), a Hard Disk (Hard Disk Drive, HDD) or a Solid-State Drive (SSD); or a combination of the above types of memories and provides instructions and data to the processor 15.
An embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored, which when executed by the processor 15 implements the image processing method as described above.
It can be understood that, through setting up the scratch control in the client, utilize the scratch control to extract the pixel information of pending image, make the client can select the first pixel information that satisfies preset pixel threshold value scope from the pixel information, and regard the pixel scope that first pixel information corresponds as the scope of waiting to scratch in the pending image, adjust the first transparency of the scope of waiting to scratch to preset transparency, thereby obtain the scratch image, even under the big circumstances of the quantity of pending image, the client still can utilize the quick pending image of scratch control to carry out the scratch processing, the speed when having improved the pending image and carrying out the scratch is improved.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of a hardware embodiment, a software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
The above description is only a preferred embodiment of the present invention, and is not intended to limit the scope of the present invention.

Claims (10)

1. An image processing method, applied to a client, wherein the client comprises a matting control, and the method comprises:
acquiring an image to be processed; extracting pixel information of the image to be processed by utilizing the matting control;
screening out first pixel information meeting a preset pixel threshold range from the pixel information, and taking a pixel range corresponding to the first pixel information as a range to be subjected to matting in the image to be processed;
extracting a first transparency corresponding to the range to be subjected to matting; and adjusting the first transparency to a preset transparency to obtain a cutout image.
2. The method of claim 1, wherein the obtaining an image to be processed; and extracting the pixel information of the image to be processed by utilizing the matting control, wherein the pixel information comprises:
acquiring the image to be processed from a client webpage;
drawing the image to be processed on a canvas of the cutout control based on a preset initial position in the cutout control to obtain a drawn image;
and extracting the pixels of the drawn image by using the matting control to obtain the pixel information.
3. The method of claim 2, wherein the extracting pixels of the rendered image using the matting control to obtain the pixel information comprises:
and under the condition that the attribute of the matting control is an extractable pixel attribute, extracting the pixel of the drawn image by using the matting control to obtain the pixel information.
4. The method of claim 1, wherein the extracting pixel information of the image to be processed by using the matting control comprises:
under the condition that the loading completion event of the image to be processed is detected, extracting pixel information of the image to be processed by utilizing the matting control;
or, under the condition that a play frame change event is detected, extracting the pixel information of the image to be processed by using the matting control.
5. The method of claim 2, wherein before the drawing the image to be processed on the canvas of the matting control based on the preset initial position in the matting control to obtain the drawing image, the method further comprises:
determining a drawing environment of the scratch control;
correspondingly, based on the preset initial position in the cutout control, the to-be-processed image is drawn on the canvas of the cutout control to obtain a drawing image, which includes:
under the drawing environment, based on a preset initial position in the cutout control, the image to be processed is drawn on a canvas of the cutout control, and a drawing image is obtained.
6. The method according to any one of claims 1 to 4, wherein the pixel information is an RGB color value.
7. The method of claim 1, wherein after adjusting the first transparency to a preset transparency to obtain the matte image, the method further comprises:
and displaying the sectional image.
8. A client, the client comprising a scratch control, the client comprising:
the acquisition unit is used for acquiring an image to be processed;
the extraction unit is used for extracting the pixel information of the image to be processed by utilizing the matting control; extracting a first transparency corresponding to the range of the image to be scratched;
the screening unit is used for screening out first pixel information meeting a preset pixel threshold range from the pixel information, and taking a pixel range corresponding to the first pixel information as the range to be scratched in the image to be processed;
and the adjusting unit is used for adjusting the first transparency to a preset transparency to obtain the cutout image.
9. A client, the client comprising:
a memory, a processor, and a communication bus, the memory in communication with the processor through the communication bus, the memory storing a program of image processing executable by the processor, the program of image processing when executed performing the method of any of claims 1 to 7 by the processor.
10. A storage medium on which a computer program is stored for application to a client, characterized in that the computer program realizes the method of any one of claims 1 to 7 when executed by a processor.
CN202110321434.1A 2021-03-25 2021-03-25 Image processing method, client and storage medium Pending CN113763411A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110321434.1A CN113763411A (en) 2021-03-25 2021-03-25 Image processing method, client and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110321434.1A CN113763411A (en) 2021-03-25 2021-03-25 Image processing method, client and storage medium

Publications (1)

Publication Number Publication Date
CN113763411A true CN113763411A (en) 2021-12-07

Family

ID=78786769

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110321434.1A Pending CN113763411A (en) 2021-03-25 2021-03-25 Image processing method, client and storage medium

Country Status (1)

Country Link
CN (1) CN113763411A (en)

Similar Documents

Publication Publication Date Title
EP2174293B1 (en) Computing a depth map
RU2664415C2 (en) Image processing system and machine readable recording medium
US10762649B2 (en) Methods and systems for providing selective disparity refinement
US9727984B2 (en) Electronic device and method for processing an image
CN113126937B (en) Display terminal adjusting method and display terminal
KR102084343B1 (en) Background removal
US20210358088A1 (en) Video compression stream
CN110942427A (en) Image noise reduction method and device, equipment and storage medium
US9007394B2 (en) Method and system for dynamic brightness correction in digital images
US11373279B2 (en) Image processing method and device
CN101304483A (en) Method and apparatus for image processing by using stored image
EP3206387B1 (en) Image dynamic range adjustment method, terminal, and storage media
CN112822413B (en) Shooting preview method, shooting preview device, terminal and computer readable storage medium
US9076207B1 (en) Image processing method, system and electronic device
US20140056517A1 (en) Method, system and apparatus for applying histogram equalization to an image
CN113763411A (en) Image processing method, client and storage medium
US10311550B2 (en) Image processing device for eliminating graininess of image
JP5593515B2 (en) Image enhancement method, image enhancer, image rendering system, and computer program
US20150381870A1 (en) Dynamic Noise Reduction For High Dynamic Range In Digital Imaging
WO2022111269A1 (en) Method and device for enhancing video details, mobile terminal, and storage medium
CN115049572A (en) Image processing method, image processing device, electronic equipment and computer readable storage medium
JP2016046701A (en) Image processing apparatus, image processing method and program
US20170372495A1 (en) Methods and systems for color processing of digital images
US10552970B2 (en) Efficient guide filter for depth refinement
CN113115109B (en) Video processing method, device, electronic equipment and storage medium

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