CN112788254B - Camera image matting method, device, equipment and storage medium - Google Patents
Camera image matting method, device, equipment and storage medium Download PDFInfo
- Publication number
- CN112788254B CN112788254B CN202011554962.3A CN202011554962A CN112788254B CN 112788254 B CN112788254 B CN 112788254B CN 202011554962 A CN202011554962 A CN 202011554962A CN 112788254 B CN112788254 B CN 112788254B
- Authority
- CN
- China
- Prior art keywords
- human body
- image
- transparency
- body image
- camera
- 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.)
- Active
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N5/00—Details of television systems
- H04N5/222—Studio circuitry; Studio devices; Studio equipment
- H04N5/262—Studio circuits, e.g. for mixing, switching-over, change of character of image, other special effects ; Cameras specially adapted for the electronic generation of special effects
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/10—Segmentation; Edge detection
- G06T7/194—Segmentation; Edge detection involving foreground-background segmentation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/70—Determining position or orientation of objects or cameras
- G06T7/73—Determining position or orientation of objects or cameras using feature-based methods
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/80—Analysis of captured images to determine intrinsic or extrinsic camera parameters, i.e. camera calibration
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/40—Extraction of image or video features
- G06V10/48—Extraction of image or video features by mapping characteristic values of the pattern into a parameter space, e.g. Hough transformation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/70—Arrangements for image or video recognition or understanding using pattern recognition or machine learning
- G06V10/74—Image or video pattern matching; Proximity measures in feature spaces
- G06V10/75—Organisation of the matching processes, e.g. simultaneous or sequential comparisons of image or video features; Coarse-fine approaches, e.g. multi-scale approaches; using context analysis; Selection of dictionaries
- G06V10/751—Comparing pixel values or logical combinations thereof, or feature values having positional relevance, e.g. template matching
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computer Vision & Pattern Recognition (AREA)
- General Physics & Mathematics (AREA)
- Physics & Mathematics (AREA)
- Multimedia (AREA)
- Computing Systems (AREA)
- General Health & Medical Sciences (AREA)
- Medical Informatics (AREA)
- Software Systems (AREA)
- Evolutionary Computation (AREA)
- Databases & Information Systems (AREA)
- Artificial Intelligence (AREA)
- Health & Medical Sciences (AREA)
- Signal Processing (AREA)
- Image Processing (AREA)
- Studio Devices (AREA)
Abstract
The invention relates to the technical field of artificial intelligence, and discloses a method, a device, equipment and a storage medium for image matting of a camera, wherein the method comprises the following steps: acquiring a human body image sample, wherein the human body image sample is acquired through a camera arranged on a television; performing image matting on the human body image sample to obtain a target human body mask; and acquiring the transparency of the human body image sample, and setting the target human body mask according to the transparency of the human body image sample to acquire a target human body image. The method comprises the steps of collecting a human body image sample through a camera arranged on a television, matting the collected human body image to obtain a corresponding human body image sample, obtaining a target human body mask according to the corresponding human body image sample, obtaining the transparency of the human body image sample, setting the transparency on the target human body mask to obtain a target human body image, and compared with the prior art that matting is carried out through a green curtain, the method can effectively improve the matting quality.
Description
Technical Field
The invention relates to the technical field of artificial intelligence, in particular to a camera matting method, a camera matting device, camera matting equipment and a storage medium.
Background
In recent years, with the rapid development of internet technology, artificial intelligence technology is increasingly becoming a topic concerned by people, image matting technology is widely applied to various industries in the information age, plays an important role in numerous scientific and technological industries such as store picture display, video clip, film production, live broadcast platform, virtual reality, augmented reality and the like, and can help people to realize a lot of things which cannot be done in a short time, for example, people take pictures with polar bears in extreme environments, at the moment, the picture can be taken by matting human body images, but the quality of the matting human body images is different, so that the synthesized pictures can have larger difference.
The above is only for the purpose of assisting understanding of the technical aspects of the present invention, and does not represent an admission that the above is prior art.
Disclosure of Invention
The invention mainly aims to provide a camera image matting method, a camera image matting device, camera image matting equipment and a storage medium, and aims to solve the technical problem that image matting quality cannot be effectively improved.
In order to achieve the purpose, the invention provides a camera image matting method, which comprises the following steps:
acquiring a human body image sample, wherein the human body image sample is acquired through a camera arranged on a television;
performing image matting on the human body image sample to obtain a target human body mask;
and acquiring the transparency of the human body image sample, and setting the target human body mask according to the transparency of the human body image sample to acquire a target human body image.
Optionally, the matting the human body image sample to obtain a target human body mask includes:
analyzing the human body image sample to obtain a human body contour;
and acquiring a preset AI algorithm, and identifying the human body contour according to the preset AI algorithm to obtain a target human body mask.
Optionally, the obtaining a preset AI algorithm, and identifying the human body contour according to the preset AI algorithm to obtain a target human body mask includes:
acquiring the algorithm capability of a preset control chip, and acquiring a foreground image of the human body image sample according to the preset AI algorithm, the algorithm capability of the preset control chip and the human body contour;
obtaining a background image of the human body image sample according to the human body image sample;
and scratching the foreground image from the background image to obtain a target human body mask.
Optionally, the matting the foreground image from the background image to obtain the target human mask includes:
the foreground image is scratched from a background image, and the scratched foreground image is subjected to imaging processing to obtain an edge anchor point of the foreground image;
and acquiring a preset data training set, and calibrating the edge anchor points according to the preset data training set to obtain the target human body mask.
Optionally, the acquiring a preset data set training, and calibrating the edge anchor point according to the preset data training set to obtain the target human mask includes:
acquiring a preset data set training, and calibrating the edge anchor point according to the preset data training set;
obtaining corresponding human body image information according to the calibrated edge anchor points;
and passivating the human body image information to obtain a target human body mask.
Optionally, the acquiring a human body image sample includes:
acquiring an internal camera and an external camera with AI functions;
respectively establishing connection between the built-in camera and the external camera and a user side;
if the built-in camera and the external camera are connected with the user side successfully respectively, capturing a human head portrait of the user side according to the built-in camera and the external camera to obtain a human body image sample.
Optionally, the obtaining the transparency of the human body image sample, and setting the target human body mask according to the transparency of the human body image sample to obtain the target human body image include:
acquiring the transparency of the human body image sample, and acquiring the transparency of a current image according to the target human body mask;
adjusting the transparency of the current image according to the transparency of the human body image sample to obtain the transparency of a target human body image;
and setting the target human body mask according to the transparency of the target human body image to obtain the target human body image.
In addition, in order to achieve the above object, the present invention further provides a camera matting device, including:
the system comprises an acquisition module, a display module and a display module, wherein the acquisition module is used for acquiring a human body image sample, and the human body image sample is acquired through a camera arranged on a television;
the image matting module is used for matting the human body image sample to obtain a target human body mask;
and the setting module is used for acquiring the transparency of the human body image sample, and setting the target human body mask according to the transparency of the human body image sample to acquire a target human body image.
In addition, in order to achieve the above object, the present invention further provides a camera matting device, including: the system comprises a memory, a processor and a camera matting program stored on the memory and operable on the processor, wherein the camera matting program is configured to implement the steps of the camera matting method as described above.
In addition, in order to achieve the above object, the present invention further provides a storage medium, where a camera matting program is stored, and when being executed by a processor, the camera matting program implements the steps of the camera matting method as described above.
The invention provides a camera image matting method, which comprises the steps of obtaining a human body image sample, wherein the human body image sample is acquired through a camera arranged on a television; performing image matting on the human body image sample to obtain a target human body mask; and acquiring the transparency of the human body image sample, and setting the target human body mask according to the transparency of the human body image sample to acquire a target human body image. The method comprises the steps of collecting a human body image sample through a camera arranged on a television, matting the collected human body image sample to obtain a corresponding human body image sample, obtaining a target human body mask according to the corresponding human body image sample, obtaining the transparency of the human body image sample according to the collected human body image sample, setting the transparency of the human body image sample on the target human body mask to obtain a target human body image, obtaining the target human body image, and effectively improving the matting quality.
Drawings
Fig. 1 is a schematic structural diagram of a camera matting device in a hardware operating environment according to an embodiment of the present invention;
FIG. 2 is a schematic flow chart of a first embodiment of a camera matting method according to the present invention;
FIG. 3 is a schematic flow chart of a second embodiment of a camera matting method according to the invention;
FIG. 4 is an AI matting processing logic diagram according to an embodiment of a camera matting method of the invention;
FIG. 5 is a schematic flow chart of a camera matting method according to a third embodiment of the present invention;
fig. 6 is a functional module schematic diagram of the first embodiment of the camera matting device of the invention.
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
Referring to fig. 1, fig. 1 is a schematic structural diagram of a camera image matting device in a hardware operating environment according to an embodiment of the present invention.
As shown in fig. 1, the camera matting device may include: a processor 1001, such as a Central Processing Unit (CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. Wherein a communication bus 1002 is used to enable connective communication between these components. The user interface 1003 may include a Display screen (Display), an input unit such as a Keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface, a wireless interface. The network interface 1004 may optionally include a standard wired interface, a WIreless interface (e.g., a WIreless-FIdelity (WI-FI) interface). The Memory 1005 may be a Random Access Memory (RAM) Memory, or a Non-Volatile Memory (NVM), such as a disk Memory. The memory 1005 may alternatively be a storage device separate from the processor 1001.
Those skilled in the art will appreciate that the configuration shown in fig. 1 does not constitute a limitation of a camera matting device and can include more or fewer components than shown, or some components in combination, or a different arrangement of components.
As shown in fig. 1, a memory 1005, which is a storage medium, may include therein an operating system, a network communication module, a user interface module, and a camera matting program.
In the camera matting device shown in fig. 1, the network interface 1004 is mainly used for data communication with a network server; the user interface 1003 is mainly used for data interaction with a user; the processor 1001 and the memory 1005 in the camera matting device can be arranged in the camera matting device, the camera matting device calls a camera matting program stored in the memory 1005 through the processor 1001, and the camera matting method provided by the embodiment of the invention is executed.
Based on the hardware structure, the embodiment of the image matting method for the camera is provided.
Referring to fig. 2, fig. 2 is a schematic flow chart of a first embodiment of a camera image matting method according to the present invention.
In a first embodiment, the camera matting method includes the following steps:
and S10, obtaining a human body image sample, wherein the human body image sample is acquired through a camera arranged on a television.
It should be noted that the execution main body in this embodiment may be a camera image matting device, and may also be other devices that can implement the same or similar functions.
It should be understood that the human body image sample refers to an image acquired by a camera arranged on a television, the acquired image is a human body image sample, and the acquired human body image sample is composed of two parts, one part is a foreground image, and the other part is a background image. The camera arranged on the television comprises two parts, one part is an internal camera, the other part is an external camera, and clear human body image samples can be captured only when the internal camera and the external camera are matched with each other for shooting.
It can be understood that the internal camera refers to a camera located inside the television, the internal camera belongs to a video input device and is mainly used for capturing and monitoring images, the external camera refers to a camera located outside the television and visible to the naked eye, both the internal camera and the external camera have an AI function, so that the television also has an AI function, the internal camera and the external camera cooperate with each other to mean that when the external camera takes a picture, a part of pixels in the picture which may be captured are not high, so that the picture is blurred, at this time, the picture captured by the internal camera is complemented, and the picture captured by the internal camera and the picture captured by the external camera are processed through an AI preset algorithm to obtain a clear human body image, which is a human body image sample.
In specific implementation, the camera image matting device acquires a human body image sample, wherein the human body image sample is acquired through a camera arranged on a television.
And S20, matting the human body image sample to obtain a target human body mask.
It should be understood that the matting of the human body image sample refers to matting a foreground image in the human body image sample from a background image, and the background image in the human body image sample may be different according to image contents, and if only the background image and the human body image are in the human body image sample, the background image is the human body image sample; if the human body image sample comprises other images besides the background image and the human body image, at the moment, the background image is not only the human body image sample, and when the foreground image is extracted from the human body image sample, corresponding processing is required to be carried out according to the image information of the human body image sample, for example, when only the human body image and the background image exist, only the human body image is extracted from the background image.
It can be understood that the target human body mask refers to an edge portion of the human body image, an edge inside of the human body image is a selected area, an edge outside of the human body image is a mask, after the foreground image is extracted, the current foreground image can be processed into a corresponding human body image mask through a data processing method, the human body image mask is used more in a PS, the human body image processing is performed through a preset AI algorithm and is similar to a human body image processing process by manually utilizing the PS, therefore, according to different functions, the mask can be divided into a layer mask, a cut-and-pasted mask and a vector mask, and the mask mainly has the effect that when color change, a filter and other effects are applied to a certain specific area of the image, the unselected area (namely, a black area) can be protected and isolated without being edited.
In specific implementation, the image matting device of the camera carries out image matting on the human body image sample to obtain a target human body mask.
And S30, obtaining the transparency of the human body image sample, and setting the target human body mask according to the transparency of the human body image sample to obtain a target human body image.
It should be understood that the human image sample transparency refers to the value of alpha in the pixels of the human image sample, said alpha being the alpha channel, for example using a bitmap stored with 16 bits per pixel, for each pixel in the graph it is possible to represent red with 5 bits, green with 5 bits, blue with 5 bits, and alpha with the last bit, in which case it represents either transparent or non-transparent, since the alpha bits have the possibility of two different representations, 0 or 1, said alpha value being of different size, so that the transparency percentage of the human image sample is also different, wherein the alpha channel may also represent 256 levels of translucency, since there are 8 bits of the alpha channel that may have 256 different data representation possibilities.
It can be understood that the setting of the target human body mask according to the transparency of the human body image sample refers to a situation that an alpha value in the target human body mask is inconsistent with an alpha value in the human body image sample when the human body image sample is processed, so that image content in the human body mask is blurred, at this time, the corresponding transparency of the human body image sample needs to be obtained according to the human body image sample, the transparency of the target human body mask is set to be the corresponding transparency of the human body image sample, and a target human body image can be obtained according to the target human body mask and the image content.
In specific implementation, the transparency of the human body image sample is obtained by the camera image matting device, and the target human body mask is set according to the transparency of the human body image sample to obtain a target human body image.
In the embodiment, a human body image sample is obtained, wherein the human body image sample is acquired through a camera arranged on a television; performing image matting on the human body image sample to obtain a target human body mask; and acquiring the transparency of the human body image sample, and setting the target human body mask according to the transparency of the human body image sample to acquire a target human body image. The method comprises the steps of collecting a human body image sample through a camera arranged on a television, carrying out image matting processing on the collected human body image sample to obtain a corresponding human body image sample, obtaining a target human body mask according to the corresponding human body image sample, obtaining the transparency of the human body image sample according to the collected human body image sample, setting the transparency of the human body image sample on the target human body mask to obtain a target human body image, obtaining the target human body image, and effectively improving the image matting quality.
In an embodiment, as shown in fig. 3, a second embodiment of the method for matting an image of a camera according to the present invention is provided based on the first embodiment, and the step S20 includes:
step S201, analyzing the human body image sample to obtain a human body outline.
Further, in order to improve image matting efficiency, the algorithm capability of a preset control chip needs to be acquired, and a foreground image of the human body image sample is acquired according to the AI algorithm, the algorithm capability of the preset control chip and the human body contour; obtaining a background image of the human body image sample according to the human body image sample; and matting the foreground image from the background image to obtain a target human body mask.
It can be understood that the human body outline refers to a shape after analyzing the human body image sample, the human body outline is divided into an objective human body outline and a subjective human body outline according to whether the human body image has the shape, the outline has rich information, the part with the steepest change or the largest curvature of the outline is the place where the information is most concentrated, and the human body outline can depict the edge of the human body image.
It should be understood that the preset AI algorithm refers to a calculation method for researching and developing theories, methods, techniques and application systems for simulating, extending and expanding human intelligence, in this embodiment, the preset AI algorithm is mainly used for obtaining foreground images of human body image samples, and the AI algorithm is generally divided into the following: the human body image sample can be obtained by mutually matching the AI algorithm, such as a decision tree algorithm, a random forest algorithm, a logistic regression algorithm, a naive Bayes algorithm, a nearest neighbor algorithm, a mean value algorithm, a neural network algorithm, a Markov algorithm and the like.
It can be understood that the algorithm capability of the preset control chip refers to the algorithm capability of an SOC chip, the SOC chip is an integrated circuit chip, and can effectively reduce the development cost of electronic and information system products, shorten the development period, and improve the competitiveness of products, the logic core includes a CPU, a clock circuit, a timer, an interrupt controller, a serial-parallel interface, other peripheral devices, an input/output port, and an adhesive logic used between various IP cores, and the memory core includes various volatile, nonvolatile, and Cache memories; the analog core includes analog circuitry used in high speed circuits.
In specific implementation, the human body image sample is analyzed by the camera image matting device to obtain a human body outline.
And S202, acquiring a preset AI algorithm, and identifying the human body contour according to the preset AI algorithm to obtain a target human body mask.
It can be understood that the identification of the human body contour according to the preset AI algorithm refers to extracting a foreground image in a human body image sample from a background image to realize the separation of the foreground image from the background image, and when only the human body image and the background image exist in the human body image sample, the foreground image is the human body image.
In specific implementation, the camera image matting device acquires a preset AI algorithm, and the human body outline is identified according to the preset AI algorithm to obtain a target human body mask.
Referring to fig. 4, the fig. 4 is an AI matting processing logic diagram of an embodiment of a camera matting method of the present invention, and specifically, a human body image sample is captured by a camera disposed at a television end, the human body image sample is identified by a preset AI algorithm to obtain a human body contour, the human body contour is processed according to an algorithm capability of a preset control chip to obtain a current human body mask, the current mask is subjected to edge imaging to obtain a corresponding edge anchor point, the edge anchor point is calibrated to obtain a calibrated edge anchor point, the calibrated edge anchor point is subjected to passivation to obtain a target human body mask, the target human body mask is set according to a transparency of the human body image sample to obtain a target human body image, and thus image matting is completed and image output is performed.
In this embodiment, a human body image sample is analyzed to obtain a human body contour, the algorithm capability of a preset control chip is obtained, and a foreground image of the human body image sample is obtained according to the preset AI algorithm, the algorithm capability of the preset control chip and the human body contour; obtaining a background image of the human body image sample according to the human body image sample; and matting the foreground image from the background image to obtain a target human body mask. This embodiment predetermines the algorithm and predetermine control chip through the AI and will the foreground image is scratched, and is right the foreground image after scratching carries out AI and predetermines algorithm processing, obtains target human image, thereby has improved the efficiency of scratching the image.
In an embodiment, as shown in fig. 5, a third embodiment of the camera image matting method according to the present invention is proposed based on the first embodiment, and the step S30 includes:
and S301, obtaining the transparency of the human body image sample, and obtaining the transparency of the current image according to the target human body mask.
Furthermore, in order to effectively improve the quality of image matting, an internal camera and an external camera with an AI function are required to be obtained; respectively establishing connection between the built-in camera and the external camera and a user side; if the built-in camera and the external camera are connected with the user side successfully respectively, capturing a human head portrait of the user side according to the built-in camera and the external camera to obtain a human body image sample.
It can be understood that, the connection of the internal camera and the external camera to the user side respectively means that the internal camera and the external camera can perform information interaction with the user side, and the internal camera and the external camera capture data of the user side and do not cause distortion of the captured human body image sample before the data is transmitted to the television side processor for processing.
It should be understood that the transparency of the human body image sample refers to a value of α in pixels of the human body image sample, where α is an alpha channel, and the transparency is expressed by a percentage, and the stages of picture and colorless transparency can be divided into 100 parts, for example, the current transparency of the human body image sample is 60%.
In specific implementation, the transparency of the human body image sample is obtained by the camera image matting device, and the current image transparency is obtained according to the target human body mask.
And S302, adjusting the transparency of the current image according to the transparency of the human body image sample to obtain the transparency of the target human body image.
It can be understood that the adjusting of the transparency of the current image according to the transparency of the human body image sample refers to adjusting the transparency of the human body image processed according to a preset AI algorithm and the algorithm capability of a preset control chip, so as to improve a real-time frame rate, for example, the transparency of the human body image sample is 99%, the transparency of the current image is 30%, at this time, the transparency of the current image needs to be adjusted, so that the transparency of the current image approaches to 99%, and when the transparency of the target human body image is 99%, the human body image becomes clearer, so as to improve the clarity of the human body image.
In specific implementation, the camera image matting device adjusts the transparency of the current image according to the transparency of the human body image sample to obtain the transparency of the target human body image.
And step S303, setting the target human body mask according to the transparency of the target human body image to obtain the target human body image.
It can be understood that, the setting of the target human mask according to the transparency of the target human image means that after the transparency of the target human image is obtained, the transparency of the target human image is set on the target human mask, the image content in the edge of the target human mask can be clearly displayed, and the target human image is obtained by combining the set target human mask, so that the television camera realizes the separation of a character foreground image and a background by utilizing an AI algorithm, and the image matting is completed.
In specific implementation, the camera image matting device sets the target human body mask according to the transparency of the target human body image to obtain the target human body image.
In the embodiment, an internal camera and an external camera with an AI function are obtained; respectively establishing connection between the built-in camera and the external camera and a user side; if the built-in camera and the external camera are successfully connected with the user side respectively, capturing a human head portrait of the user side according to the built-in camera and the external camera to obtain a human body image sample; performing image matting on the human body image sample to obtain a target human body mask; acquiring the transparency of the human body image sample, and acquiring the transparency of a current image according to the target human body mask; adjusting the transparency of the current image according to the transparency of the human body image sample to obtain the transparency of a target human body image; and setting the target human body mask according to the transparency of the target human body image to obtain the target human body image. In the embodiment, the human body image sample is processed through a preset AI algorithm to obtain a target human body mask, the current image transparency is obtained according to the target human body mask, the human body image sample transparency is obtained, the human body image sample transparency is adjusted according to the human body image sample transparency to obtain the target human body image transparency, and the target human body image transparency is used for setting the target human body mask to obtain the target human body image, so that the image matting quality is effectively improved.
In addition, an embodiment of the present invention further provides a storage medium, where the storage medium stores a camera matting program, and the camera matting program, when executed by a processor, implements the steps of the camera matting method described above.
Since the storage medium adopts all technical solutions of all the embodiments, at least all the beneficial effects brought by the technical solutions of the embodiments are achieved, and no further description is given here.
In addition, referring to fig. 6, an embodiment of the present invention further provides a camera image matting device, where the camera image matting device includes:
the acquisition module 10 is configured to acquire a human body image sample, where the human body image sample is acquired by a camera disposed on a television.
It should be understood that the human body image sample refers to an image acquired by a camera arranged on a television, the acquired image is the human body image sample, and the acquired human body image sample is composed of two parts, one part is a foreground image, and the other part is a background image. The camera arranged on the television comprises two parts, one part is an internal camera, the other part is an external camera, and clear human body image samples can be captured only when the internal camera and the external camera are matched with each other for shooting.
It can be understood that the internal camera refers to a camera located inside the television, the internal camera belongs to a video input device and is mainly used for capturing and monitoring images, the external camera refers to a camera located outside the television and can be seen by naked eyes, the internal camera and the external camera both have AI functions, therefore, the television also has AI functions, the internal camera and the external camera cooperate with each other to mean that when the external camera takes pictures, a part of pixels in the pictures which may be captured are not high, so that the pictures are blurred, at this time, the pictures captured by the internal camera are complemented, and the pictures captured by the internal camera and the pictures captured by the external camera are processed through an AI preset algorithm to obtain clear human body images, which are human body image samples.
In specific implementation, the camera image matting device acquires a human body image sample, wherein the human body image sample is acquired through a camera arranged on a television.
And the image matting module 20 is used for matting the human body image sample to obtain a target human body mask.
It should be understood that the matting of the human body image sample refers to matting a foreground image in the human body image sample from a background image, and the background image in the human body image sample may be different according to image content, and if only the background image and the human body image are in the human body image sample, the background image is the human body image sample; if the human body image sample comprises other images besides the background image and the human body image, at the moment, the background image is not only the human body image sample, and when the foreground image is extracted from the human body image sample, corresponding processing is required to be carried out according to the image information of the human body image sample, for example, when only the human body image and the background image exist, only the human body image is extracted from the background image.
It can be understood that the target human body mask refers to an edge portion of the human body image, an edge inside of the human body image is a selected area, an edge outside of the human body image is a mask, after the foreground image is extracted, the current foreground image can be processed into a corresponding human body image mask through a data processing method, the human body image mask is used more in a PS, the human body image processing is performed through a preset AI algorithm and is similar to a human body image processing process by manually utilizing the PS, therefore, according to different functions, the mask can be divided into a layer mask, a cut-and-pasted mask and a vector mask, and the mask mainly has the effect that when color change, a filter and other effects are applied to a certain specific area of the image, the unselected area (namely, a black area) can be protected and isolated without being edited.
In specific implementation, the image matting device of the camera carries out image matting on the human body image sample to obtain a target human body mask.
And the setting module 30 is used for acquiring the transparency of the human body image sample, and setting the target human body mask according to the transparency of the human body image sample to acquire a target human body image.
It should be understood that the human image sample transparency refers to the value of alpha in the pixels of the human image sample, said alpha being the alpha channel, for example using a bitmap stored with 16 bits per pixel, for each pixel in the graph it is possible to represent red with 5 bits, green with 5 bits, blue with 5 bits, and alpha with the last bit, in which case it represents either transparent or non-transparent, since the alpha bits have the possibility of two different representations, 0 or 1, said alpha value being of different size, so that the transparency percentage of the human image sample is also different, wherein the alpha channel may also represent 256 levels of translucency, since there are 8 bits of the alpha channel that may have 256 different data representation possibilities.
It can be understood that the setting of the target human body mask according to the transparency of the human body image sample refers to a situation that an alpha value in the target human body mask is inconsistent with an alpha value in the human body image sample when the human body image sample is processed, so that image content in the human body mask is blurred, at this time, the corresponding transparency of the human body image sample needs to be obtained according to the human body image sample, the transparency of the target human body mask is set to be the corresponding transparency of the human body image sample, and a target human body image can be obtained according to the target human body mask and the image content.
In specific implementation, the transparency of the human body image sample is obtained by the camera image matting device, and the target human body mask is set according to the transparency of the human body image sample to obtain a target human body image.
The invention provides a camera image matting method, which comprises the steps of obtaining a human body image sample, wherein the human body image sample is acquired through a camera arranged on a television; performing image matting on the human body image sample to obtain a target human body mask; and acquiring the transparency of the human body image sample, and setting the target human body mask according to the transparency of the human body image sample to acquire a target human body image. The method comprises the steps of collecting a human body image sample through a camera arranged on a television, matting the collected human body image sample to obtain a corresponding human body image sample, obtaining a target human body mask according to the corresponding human body image sample, obtaining the transparency of the human body image sample according to the collected human body image sample, setting the transparency of the human body image sample on the target human body mask to obtain a target human body image, obtaining the target human body image, and effectively improving the matting quality.
It should be noted that the above-described work flows are only exemplary, and do not limit the scope of the present invention, and in practical applications, a person skilled in the art may select some or all of them to achieve the purpose of the solution of the embodiment according to actual needs, and the present invention is not limited herein.
In addition, details of the technique that are not elaborated in this embodiment may refer to a method for matting an image of a camera provided in any embodiment of the present invention, and are not described herein again.
In an embodiment, the obtaining module 10 is further configured to obtain an internal camera and an external camera having an AI function; respectively establishing connection between the built-in camera and the external camera and a user side; if the built-in camera and the external camera are successfully connected with the user side respectively, capturing a human head portrait of the user side according to the built-in camera and the external camera to obtain a human body image sample.
In an embodiment, the matting module 20 is further configured to analyze the human body image sample to obtain a human body contour; and acquiring a preset AI algorithm, and identifying the human body contour according to the preset AI algorithm to obtain a target human body mask.
In an embodiment, the image matting module 20 is further configured to obtain an algorithm capability of a preset control chip, and obtain a foreground image of the human body image sample according to the preset AI algorithm, the algorithm capability of the preset control chip, and the human body contour; obtaining a background image of the human body image sample according to the human body image sample; and matting the foreground image from the background image to obtain a target human body mask.
In an embodiment, the matting module 20 is further configured to perform matting on the foreground image from a background image, and perform imaging processing on the scratched foreground image to obtain an edge anchor point of the foreground image; and acquiring a preset data training set, and calibrating the edge anchor point according to the preset data training set to obtain the target human body mask.
In an embodiment, the matting module 20 is further configured to obtain a preset data set training, and calibrate the edge anchor point according to the preset data training set; obtaining corresponding human body image information according to the calibrated edge anchor points; and passivating the human body image information to obtain a target human body mask.
In an embodiment, the setting module 30 is further configured to obtain transparency of the human body image sample, and obtain transparency of a current image according to the target human body mask; adjusting the transparency of the current image according to the transparency of the human body image sample to obtain the transparency of a target human body image; and setting the target human body mask according to the transparency of the target human body image to obtain the target human body image.
Other embodiments or methods of implementing the camera matting device according to the present invention can refer to the above embodiments, and are not redundant herein.
Furthermore, it should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or system. Without further limitation, an element defined by the phrases "comprising a," "...," or "comprising" does not exclude the presence of other like elements in a process, method, article, or system comprising the element.
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.
Through the description of the foregoing embodiments, it is clear to those skilled in the art that the method of the foregoing embodiments may be implemented by software plus a necessary general hardware platform, and certainly may also be implemented by hardware, but in many cases, the former is a better implementation. Based on such understanding, the technical solution of the present invention or portions thereof that contribute to the prior art may be embodied in the form of a software product, where the computer software product is stored in a storage medium (e.g. Read Only Memory (ROM)/RAM, magnetic disk, optical disk), and includes several instructions for enabling a terminal device (e.g. a mobile phone, a computer, a server, or a network device) to execute the method according to the embodiments of the present invention.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.
Claims (9)
1. A camera image matting method is characterized by comprising the following steps:
acquiring a human body image sample, wherein the human body image sample is acquired through a camera arranged on a television;
performing image matting on the human body image sample to obtain a target human body mask;
acquiring the transparency of the human body image sample, and setting the target human body mask according to the transparency of the human body image sample to obtain a target human body image;
the obtaining of the transparency of the human body image sample, and the setting of the target human body mask according to the transparency of the human body image sample to obtain the target human body image comprise:
acquiring the transparency of the human body image sample, and acquiring the transparency of a current image according to the target human body mask;
adjusting the transparency of the current image according to the transparency of the human body image sample to obtain the transparency of a target human body image;
setting the target human body mask according to the transparency of the target human body image to obtain a target human body image;
the adjusting the transparency of the current image according to the transparency of the human body image sample to obtain the transparency of the target human body image comprises the following steps:
adjusting the transparency of the current image according to the transparency of the human body image sample through a preset AI algorithm and a preset control chip to obtain the transparency of the target human body image;
the setting the target human body mask according to the transparency of the target human body image to obtain the target human body image comprises the following steps:
setting the transparency of the target human body mask according to the transparency of the target human body image to obtain the set target human body mask, and acquiring the current image content;
and obtaining a target human body image according to the set target human body mask and the current image content.
2. The camera image matting method according to claim 1, wherein the matting the human body image sample to obtain a target human body mask includes:
analyzing the human body image sample to obtain a human body outline;
and acquiring a preset AI algorithm, and identifying the human body contour according to the preset AI algorithm to obtain a target human body mask.
3. The camera matting method according to claim 2, wherein the obtaining a preset AI algorithm, identifying the human body contour according to the preset AI algorithm, and obtaining a target human body mask includes:
acquiring the algorithm capability of a preset control chip, and acquiring a foreground image of the human body image sample according to the preset AI algorithm, the algorithm capability of the preset control chip and the human body contour;
obtaining a background image of the human body image sample according to the human body image sample;
and matting the foreground image from the background image to obtain a target human body mask.
4. The camera image matting method according to claim 3, wherein the matting the foreground image from a background image to obtain a target human mask comprises:
matting the foreground image from a background image, and performing imaging processing on the scratched foreground image to obtain an edge anchor point of the foreground image;
and acquiring a preset data training set, and calibrating the edge anchor points according to the preset data training set to obtain the target human body mask.
5. The camera matting method according to claim 4, wherein the obtaining a preset data training set, and calibrating the edge anchor point according to the preset data training set to obtain a target human mask includes:
acquiring a preset data training set, and calibrating the edge anchor point according to the preset data training set;
obtaining corresponding human body image information according to the calibrated edge anchor points;
and passivating the human body image information to obtain a target human body mask.
6. The camera matting method according to any one of claims 1 to 5, wherein the obtaining of a human body image sample comprises:
acquiring an internal camera and an external camera with AI functions;
respectively establishing connection between the built-in camera and the external camera and a user side;
if the built-in camera and the external camera are connected with the user side successfully respectively, capturing a human head portrait of the user side according to the built-in camera and the external camera to obtain a human body image sample.
7. The utility model provides a camera device of scratching an image, its characterized in that, camera device of scratching an image includes:
the system comprises an acquisition module, a display module and a display module, wherein the acquisition module is used for acquiring a human body image sample, and the human body image sample is acquired through a camera arranged on a television;
the image matting module is used for matting the human body image sample to obtain a target human body mask;
the setting module is used for acquiring the transparency of the human body image sample, and setting the target human body mask according to the transparency of the human body image sample to obtain a target human body image;
the setting module is also used for acquiring the transparency of the human body image sample and acquiring the transparency of the current image according to the target human body mask; adjusting the transparency of the current image according to the transparency of the human body image sample to obtain the transparency of a target human body image; setting the target human body mask according to the transparency of the target human body image to obtain a target human body image;
the setting module is also used for adjusting the transparency of the current image according to the transparency of the human body image sample through a preset AI algorithm and a preset control chip to obtain the transparency of the target human body image;
the setting module is also used for setting the transparency of the target human body mask according to the transparency of the target human body image to obtain the set target human body mask and obtain the current image content; and obtaining a target human body image according to the set target human body mask and the current image content.
8. A camera image matting device, characterized in that the camera image matting device comprises: a memory, a processor, and a camera matting program stored on the memory and executable on the processor, the camera matting program being configured with steps to implement the camera matting method as claimed in any one of claims 1 to 6.
9. A storage medium, wherein a camera matting program is stored on the storage medium, and when executed by a processor, the camera matting program implements the steps of the camera matting method according to any one of claims 1 to 6.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011554962.3A CN112788254B (en) | 2020-12-23 | 2020-12-23 | Camera image matting method, device, equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011554962.3A CN112788254B (en) | 2020-12-23 | 2020-12-23 | Camera image matting method, device, equipment and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN112788254A CN112788254A (en) | 2021-05-11 |
CN112788254B true CN112788254B (en) | 2023-04-18 |
Family
ID=75752263
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202011554962.3A Active CN112788254B (en) | 2020-12-23 | 2020-12-23 | Camera image matting method, device, equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112788254B (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113379665A (en) * | 2021-06-28 | 2021-09-10 | 展讯通信(天津)有限公司 | Matting correction method and apparatus |
CN115278080A (en) * | 2022-07-28 | 2022-11-01 | 北京五八信息技术有限公司 | Mask generation method, mask generation equipment and storage medium |
-
2020
- 2020-12-23 CN CN202011554962.3A patent/CN112788254B/en active Active
Also Published As
Publication number | Publication date |
---|---|
CN112788254A (en) | 2021-05-11 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP6688277B2 (en) | Program, learning processing method, learning model, data structure, learning device, and object recognition device | |
CN105049718A (en) | Image processing method and terminal | |
US20210406305A1 (en) | Image deformation control method and device and hardware device | |
CN111985281B (en) | Image generation model generation method and device and image generation method and device | |
CN103679767A (en) | Image generation apparatus and image generation method | |
CN109035147B (en) | Image processing method and device, electronic device, storage medium and computer equipment | |
CN110062157B (en) | Method and device for rendering image, electronic equipment and computer readable storage medium | |
WO2019015477A1 (en) | Image correction method, computer readable storage medium and computer device | |
CN113658065B (en) | Image noise reduction method and device, computer readable medium and electronic equipment | |
CN112788254B (en) | Camera image matting method, device, equipment and storage medium | |
CN113221767B (en) | Method for training living body face recognition model and recognizing living body face and related device | |
RU2697627C1 (en) | Method of correcting illumination of an object on an image in a sequence of images and a user's computing device which implements said method | |
CN112839167B (en) | Image processing method, device, electronic equipment and computer readable medium | |
CN108574803B (en) | Image selection method and device, storage medium and electronic equipment | |
CN107705279B (en) | Image data real-time processing method and device for realizing double exposure and computing equipment | |
CN107154046A (en) | A kind of method of video background processing and secret protection | |
CN115115552B (en) | Image correction model training method, image correction device and computer equipment | |
US20220398704A1 (en) | Intelligent Portrait Photography Enhancement System | |
CN113724282A (en) | Image processing method and related product | |
US8971636B2 (en) | Image creating device, image creating method and recording medium | |
Fang et al. | Single image dehazing and denoising with variational method | |
CN115967823A (en) | Video cover generation method and device, electronic equipment and readable medium | |
CN112489144A (en) | Image processing method, image processing apparatus, terminal device, and storage medium | |
CN104935805B (en) | Image processing apparatus, image processing method and recording medium | |
CN117409463A (en) | Live broadcast strategy management system |
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 |