CN109461167B - Image processing model training method, mapping method, device, medium and terminal - Google Patents
Image processing model training method, mapping method, device, medium and terminal Download PDFInfo
- Publication number
- CN109461167B CN109461167B CN201811302651.0A CN201811302651A CN109461167B CN 109461167 B CN109461167 B CN 109461167B CN 201811302651 A CN201811302651 A CN 201811302651A CN 109461167 B CN109461167 B CN 109461167B
- Authority
- CN
- China
- Prior art keywords
- image
- map
- deep learning
- tripartite
- matting
- 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
- 238000012545 processing Methods 0.000 title claims abstract description 126
- 238000012549 training Methods 0.000 title claims abstract description 108
- 238000000034 method Methods 0.000 title claims abstract description 73
- 238000013507 mapping Methods 0.000 title 1
- 238000013135 deep learning Methods 0.000 claims abstract description 67
- 238000002372 labelling Methods 0.000 claims abstract description 40
- 230000011218 segmentation Effects 0.000 claims description 42
- 230000015654 memory Effects 0.000 claims description 22
- 239000003086 colorant Substances 0.000 claims description 18
- 238000004590 computer program Methods 0.000 claims description 16
- 238000012805 post-processing Methods 0.000 claims description 16
- 238000011156 evaluation Methods 0.000 claims description 14
- 230000006870 function Effects 0.000 claims description 14
- 238000013136 deep learning model Methods 0.000 claims description 7
- 230000000694 effects Effects 0.000 abstract description 20
- 210000004209 hair Anatomy 0.000 abstract description 7
- 238000010586 diagram Methods 0.000 description 10
- 238000003709 image segmentation Methods 0.000 description 8
- 230000002093 peripheral effect Effects 0.000 description 8
- 238000005520 cutting process Methods 0.000 description 6
- 238000013528 artificial neural network Methods 0.000 description 4
- 238000013527 convolutional neural network Methods 0.000 description 4
- 230000001149 cognitive effect Effects 0.000 description 3
- 238000004891 communication Methods 0.000 description 3
- 230000000007 visual effect Effects 0.000 description 3
- 238000012937 correction Methods 0.000 description 2
- 238000013461 design Methods 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 230000003993 interaction Effects 0.000 description 2
- 230000000306 recurrent effect Effects 0.000 description 2
- 238000000926 separation method Methods 0.000 description 2
- 238000000638 solvent extraction Methods 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000005540 biological transmission Effects 0.000 description 1
- 238000012790 confirmation Methods 0.000 description 1
- 238000009434 installation Methods 0.000 description 1
- 238000010801 machine learning Methods 0.000 description 1
- 210000002569 neuron Anatomy 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000000717 retained effect Effects 0.000 description 1
- 238000005070 sampling Methods 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 230000001960 triggered effect Effects 0.000 description 1
- 238000012795 verification Methods 0.000 description 1
Images
Classifications
-
- 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/136—Segmentation; Edge detection involving thresholding
-
- 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/187—Segmentation; Edge detection involving region growing; involving region merging; involving connected component labelling
-
- 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
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/20—Special algorithmic details
- G06T2207/20081—Training; Learning
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/20—Special algorithmic details
- G06T2207/20084—Artificial neural networks [ANN]
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/30—Subject of image; Context of image processing
- G06T2207/30196—Human being; Person
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/30—Subject of image; Context of image processing
- G06T2207/30204—Marker
Landscapes
- Engineering & Computer Science (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Image Analysis (AREA)
- Image Processing (AREA)
Abstract
Description
技术领域technical field
本申请实施例涉及图像处理技术,尤其涉及一种图像处理模型的训练方法、抠图方法、装置、介质及终端。The embodiments of the present application relate to image processing technologies, and in particular, to a training method, a matting method, an apparatus, a medium, and a terminal for an image processing model.
背景技术Background technique
目前,抠图成为图像处理最常做的操作之一。比如越来越多的人选择在网络上购买服装,于是电商的以图搜物功能应运而生。准确的搜索到相似的服装是一件很困难的事情,所以有必要将图片中的人像分割出来。又如,一些人像美化类功能的实现也依赖于对背景与人像的精准分割。At present, matting has become one of the most common operations in image processing. For example, more and more people choose to buy clothes on the Internet, so the e-commerce search function came into being. It is very difficult to accurately search for similar clothing, so it is necessary to segment the portraits in the pictures. For another example, the realization of some portrait beautification functions also depends on the precise segmentation of the background and the portrait.
相关技术中的抠图方案主要基于像素的聚类方法和基于“图划分””(GraphPartitioning)算法等算法实现。此类方法在背景比较复杂或者背景与前景(也可以称为抠图目标)相似度很大的情况下,分割效果不佳,如无法实现头发、细腻的衣服、树枝和其它精美的物品的完美分割等。The matting scheme in the related art is mainly based on the pixel clustering method and the algorithm based on the "Graph Partitioning" (Graph Partitioning) algorithm. This kind of method is more complex in the background or the background is similar to the foreground (also called the matting target). In the case of a large degree, the segmentation effect is not good, such as the perfect segmentation of hair, delicate clothes, branches and other delicate objects cannot be achieved.
发明内容SUMMARY OF THE INVENTION
本申请实施例提供一种图像处理模型的训练方法、抠图方法、装置、介质及终端,可以优化相关技术中的抠图方案。The embodiments of the present application provide a training method, a matting method, an apparatus, a medium, and a terminal for an image processing model, which can optimize the matting scheme in the related art.
第一方面,本申请实施例提供了一种图像处理模型的训练方法,包括:In a first aspect, an embodiment of the present application provides a training method for an image processing model, including:
获取原始图像的三分图;Get a tripartite map of the original image;
根据所述原始图像和所述三分图生成训练样本集;generating a training sample set according to the original image and the tripartite map;
基于所述训练样本集对预设的深度学习网络进行训练,得到图像处理模型,其中,所述图像处理模型用于对原始图像进行标注处理得到三分图。A preset deep learning network is trained based on the training sample set to obtain an image processing model, wherein the image processing model is used for labeling the original image to obtain a tripartite map.
第二方面,本申请实施例还提供了一种抠图方法,包括:In the second aspect, the embodiments of the present application also provide a method for matting, including:
获取待抠图的目标图片;Obtain the target image to be cutout;
通过图像处理模型对所述目标图片进行标注处理,得到所述目标图片的三分图,其中,所述图像处理模型是通过原始图像和三分图构成的训练样本集训练的深度学习网络;An image processing model is used to label the target image to obtain a tripartite map of the target image, wherein the image processing model is a deep learning network trained by a training sample set composed of the original image and the tripartite map;
基于所述目标图片和所述三分图,采用设定抠图算法对所述目标图片进行抠图处理,得到抠图图像。Based on the target picture and the three-part map, a set cutout algorithm is used to perform cutout processing on the target picture to obtain a cutout image.
第三方面,本申请实施例还提供了一种图像处理模型的训练装置,包括:In a third aspect, the embodiments of the present application also provide an apparatus for training an image processing model, including:
三分图获取模块,用于获取原始图像的三分图;Tripartite image acquisition module, used to obtain the tripartite map of the original image;
样本生成模块,用于根据所述原始图像和所述三分图生成训练样本集;a sample generation module, configured to generate a training sample set according to the original image and the tripartite map;
模型训练模块,用于基于所述训练样本集对预设的深度学习网络进行训练,得到图像处理模型,其中,所述图像处理模型用于对原始图像进行标注处理得到三分图。The model training module is used for training a preset deep learning network based on the training sample set to obtain an image processing model, wherein the image processing model is used for labeling the original image to obtain a tripartite map.
第四方面,本申请实施例还提供了一种抠图装置,包括:In a fourth aspect, an embodiment of the present application also provides a drawing device, comprising:
目标图片获取模块,用于获取待抠图的目标图片;The target image acquisition module is used to acquire the target image to be cut out;
图片标注模块,用于通过图像处理模型对所述目标图片进行标注处理,得到所述目标图片的三分图,其中,所述图像处理模型是通过原始图像和三分图构成的训练样本集训练的深度学习网络;The image labeling module is configured to perform labeling processing on the target image through an image processing model to obtain a tripartite image of the target image, wherein the image processing model is trained on a training sample set composed of the original image and the tripartite image. deep learning network;
抠图模块,用于基于所述目标图片和所述三分图,采用设定抠图算法对所述目标图片进行抠图处理,得到抠图图像。The matting module is configured to perform matting processing on the target image based on the target image and the three-part image by using a preset matting algorithm to obtain a matting image.
第五方面,本申请实施例还提供了一种计算机可读存储介质,其上存储有计算机程序;该程序被处理器执行时实现如本申请实施例所述的图像处理模型的训练方法,或者,该程序被处理器执行时实现如本申请实施例所述的抠图方法。In a fifth aspect, the embodiments of the present application further provide a computer-readable storage medium on which a computer program is stored; when the program is executed by the processor, the training method of the image processing model described in the embodiments of the present application is implemented, or , and when the program is executed by the processor, the image matting method described in the embodiments of the present application is implemented.
第六方面,本申请实施例提供了一种终端,包括存储器,处理器及存储在存储器上并可在处理器运行的计算机程序;所述处理器执行所述计算机程序时实现如本申请实施例所述的图像处理模型的训练方法,或者,所述处理器执行所述计算机程序时实现如本申请实施例所述的抠图方法。In a sixth aspect, an embodiment of the present application provides a terminal, including a memory, a processor, and a computer program stored in the memory and running on the processor; when the processor executes the computer program, the implementation is as described in the embodiments of the present application The training method of the image processing model, or, when the processor executes the computer program, implements the image matting method described in the embodiments of the present application.
本申请实施例提供一种图像处理模型的训练方案,获取原始图像的三分图,根据多个原始图像和对应的三分图生成训练样本集;基于该训练样本集对预设的深度学习网络进行训练,以迭代更新该深度学习网络的各项参数值,训练完成后得到图像处理模型,可以通过图像处理模型对原始图像进行标注处理得到三分图。通过采用上述技术方案,可以基于原始图像和对应的三分图训练深度学习网络,使其可以自动对输入的原始图像进行标注处理而得到三分图,无需通过手动标注的方式进行大量的发丝级别的数据标注,可以减少标注的工作量,提高了图像标注效率。此外,采用图像处理模型对原始图像进行标注,避免手动标注可能引入的误差,可以提高优化抠图效果。The embodiment of the present application provides a training scheme for an image processing model, obtaining a tripartite map of an original image, and generating a training sample set according to a plurality of original images and corresponding tripartite maps; based on the training sample set, a preset deep learning network Perform training to iteratively update the parameter values of the deep learning network. After the training is completed, an image processing model is obtained, and the original image can be labeled and processed through the image processing model to obtain a tripartite map. By adopting the above technical solution, the deep learning network can be trained based on the original image and the corresponding tripartite graph, so that it can automatically label the input original image to obtain the tripartite graph, without manually labeling a large number of hairs. Level data annotation can reduce the workload of annotation and improve the efficiency of image annotation. In addition, the image processing model is used to annotate the original image to avoid errors that may be introduced by manual annotation, which can improve the effect of optimizing the matting.
附图说明Description of drawings
图1为本申请实施例提供的一种图像处理模型的训练方法的流程图;1 is a flowchart of a training method for an image processing model provided by an embodiment of the present application;
图2为本申请实施例提供的另一种图像处理模型的训练方法的流程图;2 is a flowchart of another method for training an image processing model provided by an embodiment of the present application;
图3为本申请实施例提供的一种抠图方法的流程图;3 is a flow chart of a method for matting according to an embodiment of the present application;
图4为本申请实施例提供的一种图像处理模型的训练装置的结构示意图;4 is a schematic structural diagram of an apparatus for training an image processing model according to an embodiment of the present application;
图5为本申请实施例提供的一种抠图装置的结构框图;5 is a structural block diagram of a matting device provided by an embodiment of the present application;
图6为本申请实施例提供的一种终端的结构示意图;FIG. 6 is a schematic structural diagram of a terminal according to an embodiment of the present application;
图7为本申请实施例提供的另一种终端的结构示意图;FIG. 7 is a schematic structural diagram of another terminal provided by an embodiment of the present application;
图8为本申请实施例提供的一种智能手机的结构框图。FIG. 8 is a structural block diagram of a smart phone according to an embodiment of the present application.
具体实施方式Detailed ways
下面结合附图和实施例对本申请作进一步的详细说明。可以理解的是,此处所描述的具体实施例仅仅用于解释本申请,而非对本申请的限定。另外还需要说明的是,为了便于描述,附图中仅示出了与本申请相关的部分而非全部结构。The present application will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application, but not to limit the present application. In addition, it should be noted that, for the convenience of description, the drawings only show some but not all the structures related to the present application.
在更加详细地讨论示例性实施例之前应当提到的是,一些示例性实施例被描述成作为流程图描绘的处理或方法。虽然流程图将各步骤描述成顺序的处理,但是其中的许多步骤可以被并行地、并发地或者同时实施。此外,各步骤的顺序可以被重新安排。当其操作完成时所述处理可以被终止,但是还可以具有未包括在附图中的附加步骤。所述处理可以对应于方法、函数、规程、子例程、子程序等等。Before discussing the exemplary embodiments in greater detail, it should be mentioned that some exemplary embodiments are described as processes or methods depicted as flowcharts. Although the flowchart depicts the steps as a sequential process, many of the steps may be performed in parallel, concurrently, or concurrently. Furthermore, the order of the steps can be rearranged. The process may be terminated when its operation is complete, but may also have additional steps not included in the figures. The processes may correspond to methods, functions, procedures, subroutines, subroutines, and the like.
图1为本申请实施例提供的一种图像处理模型的训练方法的流程图,该方法可以由图像处理模型的训练装置来执行,其中,该装置可由软件和/或硬件实现,一般可集成在终端或服务器中。如图1所示,该方法包括:FIG. 1 is a flowchart of an image processing model training method provided by an embodiment of the present application. The method can be performed by a training device for an image processing model, wherein the device can be implemented by software and/or hardware, and can generally be integrated in terminal or server. As shown in Figure 1, the method includes:
步骤110、获取原始图像的三分图。Step 110: Obtain a tripartite map of the original image.
需要说明的是,本申请实施例中的终端可包括手机、平板电脑、笔记本电脑、台式电脑等智能设备。It should be noted that the terminals in the embodiments of the present application may include smart devices such as mobile phones, tablet computers, notebook computers, and desktop computers.
需要说明的是,三分图,又称为trimap图,是标注图像中目标对象边缘的轮廓图像。基于设定抠图算法及用户输入操作对原始图像中的目标对象的轮廓进行手工标注,从而,为抠图操作提供约束信息。例如,采用TRIMAP算法对原始图像进行粗略划分,以将该原始图像划分为前景、背景和待求未知区域,并以白色代表前景、黑色代表背景、并以灰色代表待求未知区域,得到trimap图。It should be noted that a tripartite map, also known as a trimap map, is a contour image that annotates the edges of the target object in the image. The contour of the target object in the original image is manually annotated based on the set cutout algorithm and user input operation, thereby providing constraint information for the cutout operation. For example, the original image is roughly divided by the TRIMAP algorithm to divide the original image into foreground, background and unknown area to be determined, and white represents the foreground, black represents the background, and gray represents the unknown area to be determined, and the trimap image is obtained. .
示例性的,获取对原始图像中像素的标注信息,根据所述标注信息生成所述原始图像的三分图。其中,标注信息可以是手工标注的原始图像中前景与背景之间的轮廓或边界等。Exemplarily, label information for pixels in the original image is acquired, and a tripartite map of the original image is generated according to the label information. Wherein, the annotation information may be the outline or boundary between the foreground and the background in the original image that is manually annotated.
步骤120、根据所述原始图像和所述三分图生成训练样本集。Step 120: Generate a training sample set according to the original image and the tripartite map.
示例性的,将原始图像与对应的trimap图进行关联,作为训练样本,由设定数量的训练样本构成训练样本集。其中,设定数量可以是系统默认数量。Exemplarily, the original image is associated with the corresponding trimap image as a training sample, and a training sample set is formed by a set number of training samples. Wherein, the set quantity can be the default quantity of the system.
由于trimap图是通过对原始图像中的设定区域进行手工标注得到的,可能在手工标注时出现人眼不易察觉的标注错误,而导致基于trimap图进行的抠图操作的效果不佳。鉴于该问题,可以先验证trimap图是否满足设定条件,根据验证结果判断是否将该trimap图和对应的原始图像作为训练样本。其中,设定条件可以是抠图图像的得分超过设定分数阈值等,本申请实施例并不作具体限定。假设trimap图满足设定条件,则将trimap图和对应的原始图像作为训练样本,由设定数量的训练样本构成训练样本集。Since the trimap map is obtained by manually labeling the set area in the original image, there may be labeling errors that are not easily noticed by the human eye during manual labeling, resulting in poor effect of the trimap operation based on the trimap map. In view of this problem, we can first verify whether the trimap map meets the set conditions, and judge whether the trimap map and the corresponding original image are used as training samples according to the verification result. The setting condition may be that the score of the cutout image exceeds the set score threshold, etc., which is not specifically limited in this embodiment of the present application. Assuming that the trimap image satisfies the set conditions, the trimap image and the corresponding original image are used as training samples, and the training sample set is composed of a set number of training samples.
示例性的,基于该原始图像和trimap图,采用设定抠图算法对所述原始图像进行抠图处理,得到抠图图像。获取对抠图图像的评价信息,根据该评价信息判断trimap图是否满足设定条件。本申请实施例中,评价信息可以是评价抠图图像的抠图效果的数据,如为抠图图像打分,或者将抠图图像根据抠图效果进行排序等等。Exemplarily, based on the original image and the trimap image, a preset matting algorithm is used to perform matting processing on the original image to obtain a matting image. Obtain the evaluation information of the cutout image, and judge whether the trimap image satisfies the set condition according to the evaluation information. In this embodiment of the present application, the evaluation information may be data for evaluating the matting effect of the matting image, such as scoring the matting image, or sorting the matting images according to the matting effect, and so on.
评价信息的获取方式有很多种,本申请实施例并不作具体限定。在一些示例中,评价信息可以是分析用户操作得到的。例如,在生成抠图图像后,若检测到用户针对该抠图图像的修正操作,则为该抠图图像打一个较低的分(低于设定阈值的分)。也可以根据用户的修正操作的位置的多少,为该抠图图像打分,即用户修正的位置越多,该抠图图像的得分就越低。将该抠图图像的得分与设定分数阈值进行比较,在得分超过设定分数阈值时,判定trimap图满足设定条件。There are many ways to obtain evaluation information, which are not specifically limited in this embodiment of the present application. In some examples, the evaluation information may be obtained by analyzing user operations. For example, after the matting image is generated, if a user's correction operation on the matting image is detected, a lower score (a score lower than a set threshold) is given to the matting image. The cutout image may also be scored according to the number of positions of the user's correction operation, that is, the more positions the user corrects, the lower the score of the cutout image. The score of the cutout image is compared with the set score threshold, and when the score exceeds the set score threshold, it is determined that the trimap image satisfies the set condition.
步骤130、基于所述训练样本集对预设的深度学习网络进行训练,得到图像处理模型。Step 130: Train a preset deep learning network based on the training sample set to obtain an image processing model.
本申请实施例中,图像处理模型可以自动对输入的原始图像进行标注处理得到三分图。In this embodiment of the present application, the image processing model can automatically perform annotation processing on the input original image to obtain a tripartite map.
需要说明的是,深度学习是指多层神经网络上运用各种机器学习算法解决图像、文本等形式文件中的各种问题的算法集合。深度学习从大类上可以归入神经网络,不过在具体实现上有许多变化。深度学习的核心是特征学习,旨在通过分层网络获取分层次的特征信息,从而解决以往需要人工设计特征的重要难题。深度学习是一个框架,包含多个重要算法,如卷积神经网络(Convolutional Neural Networks,简称为CNN)、自动编码器(AutoEncoder)、稀疏编码(Sparse Coding)、限制玻尔兹曼机(Restricted BoltzmannMachine,简称为RBM)、深信度网络(Deep Belief Networks,简称为DBN)、以及多层反馈循环神经网络(Recurrent neural Network,简称为RNN)。对于不同问题(如图像、语音及文本等),可以选择不同的框架,也可以结合运算速度以及运算准确度等因素进行框架选择等。It should be noted that deep learning refers to a set of algorithms that use various machine learning algorithms on a multi-layer neural network to solve various problems in documents such as images and texts. Deep learning can be classified into neural networks in general, but there are many changes in the specific implementation. The core of deep learning is feature learning, which aims to obtain hierarchical feature information through hierarchical networks, so as to solve the important problems that required manual design of features in the past. Deep learning is a framework that includes several important algorithms, such as Convolutional Neural Networks (CNN), AutoEncoder, Sparse Coding, Restricted BoltzmannMachine , referred to as RBM), deep belief network (Deep Belief Networks, referred to as DBN), and multilayer feedback recurrent neural network (Recurrent neural Network, referred to as RNN). For different problems (such as images, speech, and text, etc.), different frameworks can be selected, or frameworks can be selected based on factors such as computing speed and computing accuracy.
深度学习网络的各项参数包括分层网络中各层之间的边的权重和神经元的偏置θ等等。The parameters of the deep learning network include the weights of the edges between the layers in the hierarchical network and the bias θ of neurons, etc.
示例性的,本申请中的预设的深度学习网络可以是在基于图像语义分割的深度学习网络的输出层之后增加后处理层的深度学习模型。需要说明的是,图像是由许多像素组成,而语义分割的含义就是将像素按照图像中表达语义含义的不同进行分组(Grouping)/分割(Segmentation)。可以采用已分割的样本图像对深度卷积神经网络模型进行训练,得到基于图像语义分割的深度学习网络,以通过该基于语义分割的深度学习网络实现对原始图像进行基于图像语义的分割操作。Exemplarily, the preset deep learning network in this application may be a deep learning model in which a post-processing layer is added after the output layer of the deep learning network based on image semantic segmentation. It should be noted that the image is composed of many pixels, and the meaning of semantic segmentation is to group/segment the pixels according to the different semantic meanings expressed in the image. The deep convolutional neural network model can be trained by using the segmented sample images to obtain a deep learning network based on image semantic segmentation, so as to realize the segmentation operation based on image semantics on the original image through the deep learning network based on semantic segmentation.
以包含人像的原始图像为例,将人像作为目标图像,为了达到将人像与背景分割的目的,可以采用深度卷积神经网络模型对该原始图像进行语义分割,得到的输出图是人像用白色像素表示,背景用黑色像素表示的类别图。Taking the original image containing the portrait as an example, taking the portrait as the target image, in order to achieve the purpose of segmenting the portrait and the background, a deep convolutional neural network model can be used to perform semantic segmentation on the original image, and the obtained output image is a portrait with white pixels. represents the category map with the background represented by black pixels.
后处理层是设置于基于图像语义分割的深度学习网络的输出层之后的一层,该后处理层用于对基于图像语义分割的深度学习网络输出的具有黑和白两种颜色的类别图进行分段阈值化处理,得到具有黑、白和灰三种颜色的三分图。其中,分段阈值化处理可以是基于阈值分割法将类别图中包含的像素点分为若干类的操作。例如,可以是按照灰度级对具有黑和白两种颜色的类别图的像素点进行划分,得到3个像素集合,各个像素集合内部的像素点属于相同的阈值范围区间,而不同像素集合的像素点属于不同的阈值范围区间。The post-processing layer is a layer after the output layer of the deep learning network based on image semantic segmentation. Segmentation thresholding results in a tripartite map with three colors of black, white, and gray. The segmentation thresholding process may be an operation of dividing the pixels included in the category map into several categories based on the threshold segmentation method. For example, the pixel points of the category map with black and white colors can be divided according to the gray level to obtain 3 pixel sets, the pixel points in each pixel set belong to the same threshold range interval, and the pixels of different pixel sets Pixels belong to different threshold ranges.
示例性的,基于训练样本集,采用前向传播算法对上述预设的深度学习网络进行训练(即将原始图像输入到预设的深度学习网络),得到实际输出结果。基于后向传播算法,计算实际输出结果与理想输出结果(即训练样本集中的三分图)的差。按照极小化误差的方法反向传播算法调整该深度学习网络的各项参数值。Exemplarily, based on the training sample set, a forward propagation algorithm is used to train the above-mentioned preset deep learning network (that is, inputting the original image into the preset deep learning network) to obtain an actual output result. Based on the back-propagation algorithm, the difference between the actual output result and the ideal output result (ie, the tripartite graph in the training sample set) is calculated. The parameter values of the deep learning network are adjusted by the back-propagation algorithm according to the method of minimizing the error.
需要说明的是,若由服务器执行上述图像处理模型的训练方法,则在训练完成后,服务器将图像处理模型下发至终端。在模型更新事件被触发时,服务器对图像处理模型进行更新,并将更新后的图像处理模型发送至终端。其中,服务器接收终端反馈的该图像处理模型在执行对原始图像进行标注得到trimap图的标注效果信息。若反馈标注效果不佳的消息数量超过设定阈值,则启动图像处理模型的更新操作。It should be noted that, if the above-mentioned training method for the image processing model is executed by the server, after the training is completed, the server sends the image processing model to the terminal. When the model update event is triggered, the server updates the image processing model and sends the updated image processing model to the terminal. Wherein, the server receives the image processing model fed back by the terminal to obtain the annotation effect information of the trimap image by performing annotation on the original image. If the number of feedback messages with poor labeling effect exceeds the set threshold, the update operation of the image processing model is started.
可选的,若终端的计算能力足够强,也可以由终端执行上述图像处理模型的训练方法。由于用户对抠图效果的评价具有主观性,一些用户认为效果较好的抠图,另一些用户可能并不认同。通过在终端上执行图像处理模型的训练方法,可以根据用户个性化的需求及时更新该图像处理模型,以得到适应终端用户的模型。Optionally, if the computing capability of the terminal is strong enough, the above training method of the image processing model may also be executed by the terminal. Since the user's evaluation of the cutout effect is subjective, some users think that the cutout effect is better, while others may not agree. By executing the training method of the image processing model on the terminal, the image processing model can be updated in time according to the personalized needs of the user, so as to obtain a model suitable for the terminal user.
本申请实施例的技术方案,获取原始图像的三分图,根据多个原始图像和对应的三分图生成训练样本集;基于该训练样本集对预设的深度学习网络进行训练,以迭代更新该深度学习网络的各项参数值,训练完成后得到图像处理模型,可以通过图像处理模型对原始图像进行标注处理得到三分图。通过采用上述技术方案,可以基于原始图像和对应的三分图训练深度学习网络,使其可以自动对输入的原始图像进行标注处理而得到三分图,无需通过手动标注的方式进行大量的发丝级别的数据标注,可以减少标注的工作量,提高了图像标注效率。此外,采用图像处理模型对原始图像进行标注,避免手动标注可能引入的误差,可以提高标注效果。In the technical solution of the embodiment of the present application, a tripartite map of an original image is obtained, and a training sample set is generated according to a plurality of original images and corresponding tripartite maps; based on the training sample set, a preset deep learning network is trained to iteratively update The parameter values of the deep learning network are obtained after training to obtain an image processing model, which can be used to label the original image to obtain a tripartite map. By adopting the above technical solution, the deep learning network can be trained based on the original image and the corresponding tripartite graph, so that it can automatically label the input original image to obtain the tripartite graph, without manually labeling a large number of hairs. Level data annotation can reduce the workload of annotation and improve the efficiency of image annotation. In addition, the image processing model is used to annotate the original image to avoid errors that may be introduced by manual annotation, which can improve the annotation effect.
图2为本申请实施例提供的另一种图像处理模型的训练方法的流程图,如图2所示,该方法包括:FIG. 2 is a flowchart of another image processing model training method provided by an embodiment of the present application. As shown in FIG. 2 , the method includes:
步骤201、获取原始图像的三分图。Step 201: Obtain a tripartite map of the original image.
示例性的,获取用户对原始图像执行的为了分离前景与背景的相关操作,根据该操作生成原始图像的trimap图。Exemplarily, a related operation performed by the user on the original image in order to separate the foreground and the background is obtained, and a trimap map of the original image is generated according to the operation.
步骤202、基于所述原始图像和所述三分图,采用设定抠图算法对所述原始图像进行抠图处理,得到抠图图像。
需要说明的是,抠图通常是将前景从背景中分割(广义的图像分割还可以包括同等地位目标之间的分离等)的超精细的图像分割技术。而抠图算法则是应用于上述图像分割技术中的算法,包括但不限于贝叶斯抠图算法、泊松抠图算法、Grabcut分割算法、基于领域信息的抠图算法(Shared Sampling for Real Time Alpha Matting)、鲁棒抠图算法(robust matting)以及lazysnapping算法。可以根据不同的原始图像选择不同的抠图算法,也可以结合原始图像、抠图效果及抠图效率选择合适的抠图算法。It should be noted that matting is usually an ultra-fine image segmentation technique for segmenting the foreground from the background (generalized image segmentation may also include separation between objects of equal status, etc.). The matting algorithm is an algorithm applied to the above image segmentation technology, including but not limited to Bayesian matting algorithm, Poisson matting algorithm, Grabcut segmentation algorithm, and domain information-based matting algorithm (Shared Sampling for Real Time). Alpha Matting), robust matting algorithm (robust matting) and lazysnapping algorithm. Different matting algorithms can be selected according to different original images, or an appropriate matting algorithm can be selected in combination with the original image, the matting effect and the matting efficiency.
示例性的,将原始图像和trimap图作为选定的抠图算法的输入数据,经过图像分割处理可以得到抠图图像。Exemplarily, the original image and the trimap image are used as input data of the selected matting algorithm, and the matting image can be obtained through image segmentation processing.
步骤203、获取所述原始图像中的目标图像。Step 203: Acquire a target image in the original image.
示例性的,可以记录在生成trimap图过程中的用户标注的像素点,根据该像素点确定用户关注的目标对象,由原始图像中获取该目标对象的目标图像。Exemplarily, the pixel points marked by the user in the process of generating the trimap map may be recorded, the target object that the user pays attention to is determined according to the pixel points, and the target image of the target object is obtained from the original image.
步骤204、确定所述抠图图像与所述目标图像的相似度,根据所述相似度为所述抠图图像进行打分。Step 204: Determine the similarity between the cutout image and the target image, and score the cutout image according to the similarity.
示例性的,将抠图图像与目标图像进行比较,确定抠图图像与目标图像的相似度。可以预先确定相似度与分数区间的对应关系,从而根据该相似度为抠图图像进行打分。诸如,若相似度超过第一阈值,则确定抠图图像的得分是80~100分;若相似度超过第二阈值但小于第一阈值,则确定抠图图像的得分是60~80分;若相似度超过第三阈值但小于第二阈值,则确定抠图图像的得分是50~60分;若相似度超过该第四阈值但小于第三阈值,则确定抠图图像的得分是40~50分;若相似度超过第五阈值但小于第四阈值,则确定抠图图像的得分0~40分。Exemplarily, the cutout image is compared with the target image to determine the similarity between the cutout image and the target image. The correspondence between the similarity and the score interval may be predetermined, so that the matting image is scored according to the similarity. For example, if the similarity exceeds the first threshold, the score of the cutout image is determined to be 80 to 100 points; if the similarity exceeds the second threshold but is less than the first threshold, the score of the cutout image is determined to be 60 to 80 points; If the similarity exceeds the third threshold but is less than the second threshold, the score of the cutout image is determined to be 50 to 60 points; if the similarity exceeds the fourth threshold but is less than the third threshold, the score of the cutout image is determined to be 40 to 50 score; if the similarity exceeds the fifth threshold but is less than the fourth threshold, the cutout image is determined to have a score of 0 to 40.
需要说明的是,本申请实施例中确定相似度的方式可以是:对抠图图像和目标图像进行缩小尺寸的处理,如缩小至8*8的尺寸,将图像缩小至设定尺寸可以去除图像的细节,只保留结构/明暗等基本信息,摒弃不同尺寸/比例带来的图像差异。将缩小后的8*8的图像转化为64级灰度,即像素点总共只有64个颜色。计算所有64个像素的灰度平均值。将抠图图像中每个像素点的灰度值与平均值进行比较,若比较结果大于或等于平均值,则将该像素点记为1,若比较结果小于平均值,则将该像素点记为0;将上述比较结果组合在一起,构成一个64位的整数,记为抠图图像指纹。采用相似的方式,计算目标图像指纹。比较抠图图像指纹与目标图像指纹的汉明距离(Hamming distance,两个等长字符串之间的汉明距离是两个字符串对应位置的不同字符的个数),并将该汉明距离作为两个图像的相似度。即汉明距离较大,则说明两个图像之间差异较大,若汉明距离较小,则说明两个图像之间的差异较小,两个图像越相似。It should be noted that the method for determining the similarity in the embodiment of the present application may be: reducing the size of the cutout image and the target image, such as reducing the size to 8*8, reducing the image to a set size to remove the image details, only basic information such as structure/light and shade are retained, and image differences caused by different sizes/ratios are discarded. Convert the reduced 8*8 image to 64-level grayscale, that is, the pixels have only 64 colors in total. Calculate the grayscale average of all 64 pixels. Compare the gray value of each pixel in the cutout image with the average value. If the comparison result is greater than or equal to the average value, record the pixel point as 1, and if the comparison result is less than the average value, record the pixel point. is 0; the above comparison results are combined to form a 64-bit integer, which is recorded as the matting image fingerprint. In a similar manner, the target image fingerprint is calculated. Compare the Hamming distance between the fingerprint of the cutout image and the fingerprint of the target image (the Hamming distance between two strings of equal length is the number of different characters in the corresponding positions of the two strings), and calculate the Hamming distance. as the similarity of the two images. That is, if the Hamming distance is large, the difference between the two images is large, and if the Hamming distance is small, the difference between the two images is small, and the two images are more similar.
需要说明的是,为抠图图像打分的方式有很多种,并不限于本申请实施例所列举的方式。例如,还可以根据抠图图像的完整度为抠图图像打分等等。其中,完整度可以根据抠图图像中相邻区域的像素是否连续来确定,还可以根据抠图图像的边界是否完整来确定等等。It should be noted that there are many ways to score the cutout image, which are not limited to the ways listed in the embodiments of the present application. For example, the cutout image may also be scored according to the completeness of the cutout image, and the like. The completeness may be determined according to whether the pixels of adjacent areas in the cutout image are continuous, and may also be determined according to whether the boundary of the cutout image is complete, and so on.
步骤205、判断所述抠图图像的得分是否超过设定阈值,若是,则执行步骤206,否则执行步骤201。
示例性的,将该抠图图像的得分与设定阈值进行比较,在该抠图图像的得分大于或等于该设定阈值时,执行步骤206。在该抠图图像的得分小于该设定阈值时,判定该抠图图像的抠图效果不佳,从而确定生成本次抠图图像的trimap图不满足设定条件,放弃执行基于该trimap图生成训练样本的操作,返回执行步骤201以重新获取trimap图。Exemplarily, the score of the cutout image is compared with a set threshold, and when the score of the cutout image is greater than or equal to the set threshold,
步骤206、将所述原始图像和所述三分图作为训练样本,根据所述训练样本生成训练样本集。Step 206: Use the original image and the tripartite map as training samples, and generate a training sample set according to the training samples.
示例性的,在trimap图满足设定条件时,建立trimap图与原始图像的关联关系,作为训练样本。在获取到设定数量的训练样本后,确定样本收集操作执行完成,由设定数量的训练样本构成训练样本集。Exemplarily, when the trimap image satisfies the set condition, an association relationship between the trimap image and the original image is established as a training sample. After the set number of training samples are acquired, it is determined that the sample collection operation is completed, and the set number of training samples constitutes a training sample set.
步骤207、基于所述训练样本集对预设的深度学习网络进行训练,得到图像处理模型。Step 207: Train a preset deep learning network based on the training sample set to obtain an image processing model.
需要说明的是,预设的深度学习网络包括基于图像语义分割的深度学习网络和设置在该基于图像语义分割的深度学习网络的输出层之后的后处理层,该后处理层即为图像处理模型的输出层。在后处理层设置设定分段函数,通过该分段函数处理基于图像语义分割的深度学习网络输出的类别图,得到原始图像的trimap图。其中,该设定分段函数定义灰度值区间与目标像素值的关联关系。例如,若类别图中灰度值为a1~a2的像素点为黑色,对应的目标像素值可以为(0,0,0),灰度值为a5~a6的像素点为白色,对应的目标像素值可以为(255,255,255)。需要说明的是,上述范围内包括颜色不是黑色(或白色),但是接近黑色(或白色)的像素点,可以根据灰度值判断其更接近于黑色还是白色,对于接近黑色的像素点,将其对应的目标像素值设置为(0,0,0),对于更接近白色的像素点,将其对应的目标像素值设置为(255,255,255)。灰度值为a3~a4的像素点为灰色(包括既不接近于黑色也不接近于白色的像素点),对应的目标像素值可以为(192,192,192)。可以理解的是,对于目标像素值的取值可以有很多种,并不限于上述示例列举的像素值。例如,冷灰色的像素值是(128,138,135),象牙黑的像素值是(88,87,86)等等。It should be noted that the preset deep learning network includes a deep learning network based on image semantic segmentation and a post-processing layer arranged after the output layer of the deep learning network based on image semantic segmentation, and the post-processing layer is the image processing model. the output layer. The segmentation function is set in the post-processing layer, and the category map output by the deep learning network based on image semantic segmentation is processed by the segmentation function, and the trimap map of the original image is obtained. Wherein, the set piecewise function defines the relationship between the gray value interval and the target pixel value. For example, if the pixels with grayscale values from a1 to a2 in the category map are black, the corresponding target pixel value can be (0,0,0), and the pixels with grayscale values from a5 to a6 are white, and the corresponding target pixel value can be (0,0,0). The pixel value can be (255, 255, 255). It should be noted that the above range includes pixels whose color is not black (or white), but close to black (or white), which can be judged according to the gray value to be closer to black or white. Its corresponding target pixel value is set to (0, 0, 0), and for pixels closer to white, its corresponding target pixel value is set to (255, 255, 255). The pixels with grayscale values of a3 to a4 are gray (including pixels that are neither close to black nor close to white), and the corresponding target pixel values may be (192, 192, 192). It can be understood that, there can be many values for the target pixel value, and it is not limited to the pixel values listed in the above examples. For example, the pixel value of cool gray is (128, 138, 135), the pixel value of ivory black is (88, 87, 86) and so on.
示例性的,获取训练样本集中的一条记录,将该记录中的原始图像输入该深度学习网络,经基于图像语义分割的深度学习网络的处理得到具有黑和白两种颜色的类别图,该类别图被传入后处理层,经设定函数调整该类别图中的像素值得到具有黑、白和灰三种颜色的trimap图。将该trimap图与步骤201中获取的trimap图进行比较,采用反向传播算法调整该深度学习网络的各项参数值,使模型输出的trimap图趋近于步骤201中获取的trimap图。在训练完成后,将该预设的深度学习网络记为图像处理模型。Exemplarily, a record in the training sample set is obtained, the original image in the record is input into the deep learning network, and a category map with black and white colors is obtained through the processing of the deep learning network based on image semantic segmentation. The image is passed to the post-processing layer, and the pixel values in the category image are adjusted by the set function to obtain a trimap image with three colors of black, white and gray. The trimap is compared with the trimap obtained in
本申请实施例的技术方案,基于原始图像与手工标注的trimap图进行抠图操作,得到抠图图像;通过获取原始图像中的目标图像与抠图图像进行比对的方式确定抠图效果,从而,判断trimap图是否满足设定条件,在满足设定条件时,才将原始图像与trimap图关联,作为一条训练样本,提高了样本的标注准确度,从而提升基于训练样本训练的图像处理模型的处理准确度,可以得到更好的抠图效果。另外,采用图像处理模型进行原始图像标注,以自动生成trimap图,可以大大的减少标注的工作量。In the technical solution of the embodiment of the present application, a matting operation is performed based on the original image and the manually marked trimap image to obtain a matting image; the matting effect is determined by comparing the target image in the original image with the matting image, so that the matting effect is determined. , to determine whether the trimap image meets the set conditions, and only when the set conditions are met, the original image is associated with the trimap image as a training sample, which improves the labeling accuracy of the sample, thereby improving the image processing model trained based on the training sample. Processing accuracy, you can get a better cutout effect. In addition, the image processing model is used to label the original image to automatically generate trimap, which can greatly reduce the workload of labeling.
图3为本申请实施例提供的一种抠图方法的流程图,该方法可以由抠图装置来执行,其中,该装置可由软件和/或硬件实现,一般可集成在终端中。如图3所示,该方法包括:FIG. 3 is a flowchart of a method for matting provided by an embodiment of the present application. The method may be performed by a matting device, where the device may be implemented by software and/or hardware, and may generally be integrated in a terminal. As shown in Figure 3, the method includes:
步骤310、获取待抠图的目标图片。Step 310: Obtain the target image to be cut out.
需要说明的是,申请实施例中的终端可包括手机、平板电脑、笔记本电脑、计算机、掌上游戏机以及智能家电等设置安装有操作系统的设备。本申请实施例中对操作系统的类型不做限定,例如可包括安卓(Android)操作系统、窗口(Windows)操作系统以及苹果(ios)操作系统等等。It should be noted that the terminals in the embodiments of the application may include mobile phones, tablet computers, notebook computers, computers, handheld game consoles, smart home appliances, and other devices with operating systems installed. The type of the operating system is not limited in the embodiments of the present application, and may include, for example, an Android (Android) operating system, a Windows (Windows) operating system, and an Apple (ios) operating system, and so on.
目标图片可以是基于用户操作确定的本地图片或互联网平台中的图片。其中,用户操作可以包括触摸操作、语音操作、手势操作或眼睛注视操作等等。例如,用户点击本地图片库中的某一张图片,则可以将该图片确定为目标图片。又如,用户注视互联网平台上的某一图片,则可以弹出提示信息,以询问用户是否需要对该图片进行抠图处理。若检测到用户输入的确认指示,则将该用户注视的图片确定为目标图片。The target picture may be a local picture determined based on a user operation or a picture in an Internet platform. Wherein, the user operation may include a touch operation, a voice operation, a gesture operation, an eye gaze operation, and the like. For example, if the user clicks on a certain picture in the local picture library, the picture can be determined as the target picture. For another example, when the user looks at a certain picture on the Internet platform, a prompt message may pop up to ask the user whether the picture needs to be cut out. If the confirmation instruction input by the user is detected, the picture that the user is looking at is determined as the target picture.
示例性的,检测用户操作,根据该用户操作确定待抠图的目标图片,由该目标图片的存储位置获取该目标图片。Exemplarily, a user operation is detected, a target image to be cutout is determined according to the user operation, and the target image is acquired from a storage location of the target image.
步骤320、通过图像处理模型对所述目标图片进行标注处理,得到所述目标图片的三分图。Step 320: Perform labeling processing on the target picture by using an image processing model to obtain a tripartite map of the target picture.
本申请实施例中,三分图又可称为trimap图。图像处理模型是通过原始图像和trimap图构成的训练样本集训练的深度学习网络,且该图像处理模型用于对原始图像进行标注处理得到trimap图,可以避免手动标注方式中由于个体认知差异而引入的标注误差,大大提高标注精度,从而,提升了基于该trimap图进行抠图的抠图准确度。In this embodiment of the present application, the tripartite graph may also be referred to as a trimap graph. The image processing model is a deep learning network trained by the training sample set composed of the original image and the trimap image, and the image processing model is used to label the original image to obtain the trimap image, which can avoid the manual annotation method due to individual cognitive differences. The introduced annotation error greatly improves the annotation accuracy, thereby improving the matting accuracy of matting based on the trimap image.
示例性的,将目标图片输入图像处理模型,得到该目标图片的trimap图。Exemplarily, the target image is input into the image processing model to obtain a trimap image of the target image.
步骤330、基于所述目标图片和所述三分图,采用设定抠图算法对所述目标图片进行抠图处理,得到抠图图像。Step 330: Based on the target image and the three-part map, use a preset matting algorithm to perform a matting process on the target image to obtain a matting image.
需要说明的是,设定抠图算法是将前景从背景中分割(广义的图像分割还可以包括同等地位目标之间的分离等)的图像分割算法。抠图算法所包括的具体算法见上述实施例,此处不再赘述。It should be noted that it is assumed that the matting algorithm is an image segmentation algorithm for segmenting the foreground from the background (a generalized image segmentation may also include separation between objects of equal status, etc.). The specific algorithm included in the matting algorithm is shown in the above-mentioned embodiment, and details are not repeated here.
示例性的,将目标图片和trimap图作为设定抠图算法的输入数据,经过图像分割处理可以得到抠图图像。假设目标图片包含人像,则将目标图片和对应的trimap图作为抠图算法的输入数据,经过图像分割处理可以得到针对人像的抠图图像,可以实现精确到发丝级的抠图效果。Exemplarily, the target image and the trimap image are used as input data for setting the matting algorithm, and the matting image can be obtained through image segmentation processing. Assuming that the target image contains a portrait, the target image and the corresponding trimap image are used as the input data of the matting algorithm. After image segmentation processing, a matting image for the portrait can be obtained, which can achieve a hair-level matting effect.
本申请实施例的技术方案,在执行抠图操作时,获取待抠图的目标图片;并通过图像处理模型对该目标图片进行标注处理得到trimap图;然后,将该目标图片与trimap图作为设定抠图算法的输入数据,执行抠图操作,得到该目标图片的抠图图像。通过采用上述技术方案,可以避免手动标注方式中由于个体认知差异而引入的标注误差,大大提高标注精度,从而,提升了基于该trimap图进行抠图的抠图准确度。In the technical solution of the embodiment of the present application, when performing a matting operation, a target image to be matted is obtained; and an image processing model is used to label the target image to obtain a trimap image; then, the target image and the trimap image are used as a design The input data of the matting algorithm is determined, and the matting operation is performed to obtain the matting image of the target image. By adopting the above technical solution, the labeling error introduced by the individual cognitive differences in the manual labeling method can be avoided, and the labeling accuracy is greatly improved, thereby improving the map-cutting accuracy based on the trimap map.
在一些示例中,在获取待抠图的目标图片之后,还包括:判断所述目标图片的属性信息是否与所述训练样本集中原始图像的样本属性信息相匹配;在相匹配时,执行通过图像处理模型对所述目标图片进行标注处理的操作;在不匹配时,根据所述样本属性信息调整所述目标图片的属性信息。其中,判断目标图片的属性信息与原始图像的样本属性信息是否相匹配,可以是判断目标图片的颜色空间与样本图片的颜色空间是否相同。颜色空间包括但不限于RGB格式、YUV格式、HSV格式或HIS格式等。采用上述技术方案,由于在将目标图片输入图像处理模型之前,对目标图片的属性信息进行判断,可以确保目标图片与训练样本集中的原始图像的属性信息相匹配,避免因属性信息不匹配引入标注误差而得到不准确的trimap图的情况发生,甚至出现因属性信息不匹配而导致的标注失败而无法生成trimap图的情况,可以有效地提升抠图效率和抠图效果。In some examples, after acquiring the target image to be cutout, the method further includes: judging whether the attribute information of the target image matches the sample attribute information of the original image in the training sample set; The processing model performs an operation of labeling the target picture; when there is no match, the attribute information of the target picture is adjusted according to the sample attribute information. Wherein, judging whether the attribute information of the target image matches the sample attribute information of the original image may be judging whether the color space of the target image and the color space of the sample image are the same. The color space includes but is not limited to RGB format, YUV format, HSV format or HIS format, etc. By adopting the above technical solution, since the attribute information of the target image is judged before inputting the target image into the image processing model, it can be ensured that the attribute information of the target image matches the original image in the training sample set, and the introduction of annotations due to the mismatch of attribute information can be avoided. Inaccurate trimap images can be obtained due to errors, and even a situation in which the trimap image cannot be generated due to the labeling failure caused by the mismatch of attribute information, can effectively improve the matting efficiency and matting effect.
图4为本申请实施例提供的一种图像处理模型的训练装置的结构示意图,该装置可由软件和/或硬件实现,一般集成在终端或服务器中,可通过执行图像处理模型的训练方法对深度学习网络进行训练,得到图像处理模型。如图4所示,该装置包括:4 is a schematic structural diagram of an apparatus for training an image processing model provided by an embodiment of the present application. The apparatus may be implemented by software and/or hardware, and is generally integrated in a terminal or server. The learning network is trained to obtain an image processing model. As shown in Figure 4, the device includes:
三分图获取模块410,用于获取原始图像的三分图;A tripartite
样本生成模块420,用于根据所述原始图像和所述三分图生成训练样本集;a
模型训练模块430,用于基于所述训练样本集对预设的深度学习网络进行训练,得到图像处理模型,其中,所述图像处理模型用于对原始图像进行标注处理得到三分图。The
本申请实施例提供一种图像处理模型的训练装置,通过获取原始图像的三分图,根据多个原始图像和对应的三分图生成训练样本集;基于该训练样本集对预设的深度学习网络进行训练,以迭代更新该深度学习网络的各项参数值,训练完成后得到图像处理模型,可以通过图像处理模型对原始图像进行标注处理得到三分图。通过采用上述技术方案,可以基于原始图像和对应的三分图训练深度学习网络,使其可以自动对输入的原始图像进行标注处理而得到三分图,无需通过手动标注的方式进行大量的发丝级别的数据标注,可以减少标注的工作量,提高了图像标注效率。此外,采用图像处理模型对原始图像进行标注,避免手动标注可能引入的误差,可以提高标注效果。The embodiment of the present application provides a training device for an image processing model, which generates a training sample set according to a plurality of original images and corresponding tripartite graphs by acquiring a tripartite map of an original image; based on the training sample set, a preset deep learning The network is trained to iteratively update the parameter values of the deep learning network. After the training is completed, an image processing model is obtained, and the original image can be labeled and processed through the image processing model to obtain a tripartite map. By adopting the above technical solution, the deep learning network can be trained based on the original image and the corresponding tripartite graph, so that it can automatically label the input original image to obtain the tripartite graph, without manually labeling a large number of hairs. Level data annotation can reduce the workload of annotation and improve the efficiency of image annotation. In addition, the image processing model is used to annotate the original image to avoid errors that may be introduced by manual annotation, which can improve the annotation effect.
可选的,样本生成模块420包括:Optionally, the
预抠图子模块,用于基于所述原始图像和所述三分图,采用设定抠图算法对所述原始图像进行抠图处理,得到抠图图像;A pre-cutting submodule, configured to perform a cut-out process on the original image based on the original image and the three-part image by using a set cut-out algorithm to obtain a cut-out image;
评价子模块,用于获取所述抠图图像的评价信息,根据所述评价信息判断所述三分图是否满足设定条件;an evaluation sub-module, configured to obtain evaluation information of the cutout image, and determine whether the three-part map satisfies a set condition according to the evaluation information;
样本生成子模块,用于若确定所述三分图满足设定条件,则将所述原始图像和所述三分图作为训练样本,根据所述训练样本生成训练样本集。The sample generation sub-module is configured to use the original image and the three-part map as training samples, and generate a training sample set according to the training samples if it is determined that the three-part map satisfies the set condition.
可选的,评价子模块具体用于:Optionally, the evaluation sub-module is specifically used to:
获取所述原始图像中的目标图像;obtaining the target image in the original image;
确定所述抠图图像与所述目标图像的相似度,根据所述相似度为所述抠图图像进行打分;determining the similarity between the matting image and the target image, and scoring the matting image according to the similarity;
在所述抠图图像的得分超过设定阈值时,确定所述三分图满足设定条件。When the score of the cutout image exceeds a set threshold, it is determined that the three-point map satisfies a set condition.
可选的,所述预设的深度学习网络是在基于图像语义分割的深度学习网络的输出层之后增加后处理层的深度学习模型,其中,所述后处理层用于对基于图像语义分割的深度学习网络输出的具有黑和白两种颜色的类别图进行分段阈值化处理,得到具有黑、白和灰三种颜色的三分图。Optionally, the preset deep learning network is a deep learning model in which a post-processing layer is added after the output layer of the deep learning network based on image semantic segmentation, wherein the post-processing layer is used for image semantic segmentation-based deep learning model. The class map with black and white colors output by the deep learning network is subjected to segmentation thresholding to obtain a tripartite map with three colors of black, white and gray.
可选的,对基于图像语义分割的深度学习网络输出的具有黑和白两种颜色的类别图进行分段阈值化处理,包括:Optionally, perform segmentation thresholding on the category map with black and white colors output by the deep learning network based on image semantic segmentation, including:
获取设定分段函数,其中,设定分段函数定义灰度值区间与目标像素值的关联关系;Obtain a set piecewise function, wherein the set piecewise function defines the relationship between the gray value interval and the target pixel value;
获取基于图像语义分割的深度学习网络输出的具有黑和白两种颜色的类别图,采用所述设定分段函数调整所述类别图的像素值。A category map with black and white colors output by a deep learning network based on image semantic segmentation is obtained, and the pixel value of the category map is adjusted by using the set segmentation function.
图5为本申请实施例提供的一种抠图装置的结构框图,该装置可由软件和/或硬件实现,一般可集成在终端中,可通过执行基于图像处理模型的抠图方法对目标图片进行抠图处理。如图5所示,该装置包括:FIG. 5 is a structural block diagram of a matting device provided by an embodiment of the present application. The device can be implemented by software and/or hardware, and can generally be integrated in a terminal, and can perform a matting method based on an image processing model on a target image. Cutout processing. As shown in Figure 5, the device includes:
目标图片获取模块510,用于获取待抠图的目标图片;A target
图片标注模块520,用于通过图像处理模型对所述目标图片进行标注处理,得到所述目标图片的三分图,其中,所述图像处理模型是通过原始图像和三分图构成的训练样本集训练的深度学习网络;The
抠图模块530,用于基于所述目标图片和所述三分图,采用设定抠图算法对所述目标图片进行抠图处理,得到抠图图像。The
本申请实施例提供一种抠图装置,在执行抠图操作时,获取待抠图的目标图片;并通过图像处理模型对该目标图片进行标注处理得到trimap图;然后,将该目标图片与trimap图作为设定抠图算法的输入数据,执行抠图操作,得到该目标图片的抠图图像。通过采用上述技术方案,可以避免手动标注中由于个体认知差异而引入的标注误差,大大提高标注精度,从而,提升了基于该trimap图进行抠图的抠图准确度。An embodiment of the present application provides a matting device, which, when performing a matting operation, acquires a target image to be matted; annotates and processes the target image through an image processing model to obtain a trimap image; and then combines the target image with the trimap image. The image is used as the input data for setting the cutout algorithm, and the cutout operation is performed to obtain the cutout image of the target image. By adopting the above technical solution, the labeling error caused by individual cognitive differences in manual labeling can be avoided, and the labeling accuracy is greatly improved, thereby improving the map-cutting accuracy based on the trimap map.
可选的,该抠图装置还包括:Optionally, the image matting device further includes:
在获取待抠图的目标图片之后,判断所述目标图片的属性信息是否与所述训练样本集中原始图像的样本属性信息相匹配;After acquiring the target image to be cut out, determine whether the attribute information of the target image matches the sample attribute information of the original image in the training sample set;
在相匹配时,执行通过图像处理模型对所述目标图片进行标注处理的操作;When matching, perform the operation of labeling the target picture by the image processing model;
在不匹配时,根据所述样本属性信息调整所述目标图片的属性信息。When there is no match, the attribute information of the target picture is adjusted according to the sample attribute information.
本申请实施例还提供一种包含计算机可执行指令的存储介质,所述计算机可执行指令在由计算机处理器执行时用于执行图像处理模型的训练方法,该方法包括:Embodiments of the present application further provide a storage medium containing computer-executable instructions, where the computer-executable instructions are used to execute a training method for an image processing model when executed by a computer processor, and the method includes:
获取原始图像的三分图;Get a tripartite map of the original image;
根据所述原始图像和所述三分图生成训练样本集;generating a training sample set according to the original image and the tripartite map;
基于所述训练样本集对预设的深度学习网络进行训练,得到图像处理模型,其中,所述图像处理模型用于对原始图像进行标注处理得到三分图。A preset deep learning network is trained based on the training sample set to obtain an image processing model, wherein the image processing model is used for labeling the original image to obtain a tripartite map.
另外,本申请实施例还提供一种包含计算机可执行指令的存储介质,所述计算机可执行指令在由计算机处理器执行时用于执行抠图方法,该方法包括:In addition, an embodiment of the present application also provides a storage medium containing computer-executable instructions, where the computer-executable instructions are used to execute a map-out method when executed by a computer processor, and the method includes:
获取待抠图的目标图片;Obtain the target image to be cutout;
通过图像处理模型对所述目标图片进行标注处理,得到所述目标图片的三分图,其中,所述图像处理模型是通过原始图像和三分图构成的训练样本集训练的深度学习网络;An image processing model is used to label the target image to obtain a tripartite map of the target image, wherein the image processing model is a deep learning network trained by a training sample set composed of the original image and the tripartite map;
基于所述目标图片和所述三分图,采用设定抠图算法对所述目标图片进行抠图处理,得到抠图图像。Based on the target picture and the three-part map, a set cutout algorithm is used to perform cutout processing on the target picture to obtain a cutout image.
存储介质——任何的各种类型的存储器设备或存储设备。术语“存储介质”旨在包括:安装介质,例如CD-ROM、软盘或磁带装置;计算机系统存储器或随机存取存储器,诸如DRAM、DDR RAM、SRAM、EDO RAM,兰巴斯(Rambus)RAM等;非易失性存储器,诸如闪存、磁介质(例如硬盘或光存储);寄存器或其它相似类型的存储器元件等。存储介质可以还包括其它类型的存储器或其组合。另外,存储介质可以位于程序在其中被执行的第一计算机系统中,或者可以位于不同的第二计算机系统中,第二计算机系统通过网络(诸如因特网)连接到第一计算机系统。第二计算机系统可以提供程序指令给第一计算机用于执行。术语“存储介质”可以包括可以驻留在不同位置中(例如在通过网络连接的不同计算机系统中)的两个或更多存储介质。存储介质可以存储可由一个或多个处理器执行的程序指令(例如具体实现为计算机程序)。storage medium - any of various types of memory devices or storage devices. The term "storage medium" is intended to include: installation media, such as CD-ROMs, floppy disks, or tape devices; computer system memory or random access memory, such as DRAM, DDR RAM, SRAM, EDO RAM, Rambus RAM, etc. ; non-volatile memory, such as flash memory, magnetic media (eg hard disk or optical storage); registers or other similar types of memory elements, etc. The storage medium may also include other types of memory or combinations thereof. In addition, the storage medium may be located in the first computer system in which the program is executed, or may be located in a second, different computer system connected to the first computer system through a network such as the Internet. The second computer system may provide program instructions to the first computer for execution. The term "storage medium" may include two or more storage media that may reside in different locations (eg, in different computer systems connected by a network). The storage medium may store program instructions (eg, embodied as a computer program) executable by one or more processors.
当然,本申请实施例所提供的一种包含计算机可执行指令的存储介质,其计算机可执行指令不限于如上所述的图像处理模型的训练操作,还可以执行本申请任意实施例所提供的图像处理模型的训练方法中的相关操作。Of course, a storage medium containing computer-executable instructions provided by the embodiments of the present application is not limited to the training operation of the image processing model as described above, and the computer-executable instructions can also execute images provided by any embodiment of the present application. Handles related operations in the model's training method.
当然,本申请实施例所提供的一种包含计算机可执行指令的存储介质,其计算机可执行指令不限于如上所述的抠图操作,还可以执行本申请任意实施例所提供的抠图方法中的相关操作。Certainly, a storage medium containing computer-executable instructions provided by the embodiments of the present application, the computer-executable instructions of the computer-executable instructions are not limited to the above-mentioned image-cutting operations, and can also perform any of the image-cutting methods provided in any of the embodiments of the present application. related operations.
本申请实施例还提供了一种终端,该终端中可集成本申请实施例提供的图像处理模型的训练装置。图6为本申请实施例提供的一种终端的结构示意图。如图6所示,该终端包括存储器610及处理器620。所述存储器610,用于存储计算机程序等;所述处理器620读取并执行所述存储器610中存储的计算机程序。该处理器620包括三分图获取模块621、样本生成模块622和模型训练模块623等。所述处理器620在执行所述计算机程序时实现以下步骤:获取原始图像的三分图;根据所述原始图像和所述三分图生成训练样本集;基于所述训练样本集对预设的深度学习网络进行训练,得到图像处理模型,其中,所述图像处理模型用于对原始图像进行标注处理得到三分图。The embodiment of the present application also provides a terminal, in which the training device of the image processing model provided by the embodiment of the present application can be integrated. FIG. 6 is a schematic structural diagram of a terminal according to an embodiment of the present application. As shown in FIG. 6 , the terminal includes a
此外,本申请实施例还提供了另一种终端,该终端中可集成本申请实施例提供的抠图装置。图7为本申请实施例提供的另一种终端的结构示意图。如图7所示,该终端包括存储器710及处理器720。所述存储器710,用于存储计算机程序等;所述处理器720读取并执行所述存储器710中存储的计算机程序。其中,所述处理器720包括目标图片获取模块721、图片标注模块722和抠图模块723。所述处理器720在执行所述计算机程序时实现以下步骤:获取待抠图的目标图片;通过图像处理模型对所述目标图片进行标注处理,得到所述目标图片的三分图,其中,所述图像处理模型是通过原始图像和三分图构成的训练样本集训练的深度学习网络;基于所述目标图片和所述三分图,采用设定抠图算法对所述目标图片进行抠图处理,得到抠图图像。In addition, the embodiment of the present application also provides another terminal, and the terminal can integrate the image cutout device provided by the embodiment of the present application. FIG. 7 is a schematic structural diagram of another terminal according to an embodiment of the present application. As shown in FIG. 7 , the terminal includes a
上述示例中列举的存储器及处理器均为终端的部分元器件,所述终端还可以包括其它元器件。以智能手机为例,说明上述终端可能的结构。图8为本申请实施例提供的一种智能手机的结构框图。如图8所示,该智能手机可以包括:存储器801、中央处理器(CentralProcessing Unit,CPU)802(又称处理器,以下简称CPU)、外设接口803、RF(RadioFrequency,射频)电路805、音频电路806、扬声器811、触摸屏812、电源管理芯片808、输入/输出(I/O)子系统809、其他输入/控制设备810以及外部端口804,这些部件通过一个或多个通信总线或信号线807来通信。The memories and processors listed in the above examples are all parts of the terminal, and the terminal may also include other components. Taking a smart phone as an example, the possible structure of the above-mentioned terminal will be described. FIG. 8 is a structural block diagram of a smart phone according to an embodiment of the present application. As shown in FIG. 8, the smart phone may include: a
应该理解的是,图示智能手机800仅仅是终端的一个范例,并且智能手机800可以具有比图中所示出的更多的或者更少的部件,可以组合两个或更多的部件,或者可以具有不同的部件配置。图中所示出的各种部件可以在包括一个或多个信号处理和/或专用集成电路在内的硬件、软件、或硬件和软件的组合中实现。It should be understood that the illustrated
下面就本实施例提供的集成有图像处理模型的训练装置的智能手机进行详细的描述。The following will describe in detail the smart phone provided in this embodiment with the training device integrated with the image processing model.
存储器801,所述存储器801可以被CPU802、外设接口803等访问,所述存储器801可以包括高速随机存取存储器,还可以包括非易失性存储器,例如一个或多个磁盘存储器件、闪存器件、或其他易失性固态存储器件。在存储器801中存储计算机程序,还可以存储预设文件及预设白名单等。
外设接口803,所述外设接口803可以将设备的输入和输出外设连接到CPU802和存储器801。A
I/O子系统809,所述I/O子系统809可以将设备上的输入输出外设,例如触摸屏812和其他输入/控制设备810,连接到外设接口803。I/O子系统809可以包括显示控制器8091和用于控制其他输入/控制设备810的一个或多个输入控制器8092。其中,一个或多个输入控制器8092从其他输入/控制设备810接收电信号或者向其他输入/控制设备810发送电信号,其他输入/控制设备810可以包括物理按钮(按压按钮、摇臂按钮等)、拨号盘、滑动开关、操纵杆、点击滚轮。值得说明的是,输入控制器8092可以与以下任一个连接:键盘、红外端口、USB接口以及诸如鼠标的指示设备。I/
触摸屏812,所述触摸屏812是用户终端与用户之间的输入接口和输出接口,将可视输出显示给用户,可视输出可以包括图形、文本、图标、视频等。The
I/O子系统809中的显示控制器8091从触摸屏812接收电信号或者向触摸屏812发送电信号。触摸屏812检测触摸屏上的接触,显示控制器8091将检测到的接触转换为与显示在触摸屏812上的用户界面对象的交互,即实现人机交互,显示在触摸屏812上的用户界面对象可以是运行游戏的图标、联网到相应网络的图标等。值得说明的是,设备还可以包括光鼠,光鼠是不显示可视输出的触摸敏感表面,或者是由触摸屏形成的触摸敏感表面的延伸。
RF电路805,主要用于建立手机与无线网络(即网络侧)的通信,实现手机与无线网络的数据接收和发送。例如收发短信息、电子邮件等。具体地,RF电路805接收并发送RF信号,RF信号也称为电磁信号,RF电路805将电信号转换为电磁信号或将电磁信号转换为电信号,并且通过该电磁信号与通信网络以及其他设备进行通信。RF电路805可以包括用于执行这些功能的已知电路,其包括但不限于天线系统、RF收发机、一个或多个放大器、调谐器、一个或多个振荡器、数字信号处理器、CODEC(COder-DECoder,编译码器)芯片组、用户标识模块(Subscriber Identity Module,SIM)等等。The
音频电路806,主要用于从外设接口803接收音频数据,将该音频数据转换为电信号,并且将该电信号发送给扬声器811。The
扬声器811,用于将手机通过RF电路805从无线网络接收的语音信号,还原为声音并向用户播放该声音。The
电源管理芯片808,用于为CPU802、I/O子系统及外设接口所连接的硬件进行供电及电源管理。The
本申请实施例提供的终端,可以基于原始图像和对应的三分图训练深度学习网络,使其可以自动对输入的原始图像进行标注处理而得到三分图,无需通过手动标注的方式进行大量的发丝级别的数据标注,可以减少标注的工作量,提高了图像标注效率。此外,采用图像处理模型对原始图像进行标注,避免手动标注可能引入的误差,可以提高标注效果。从而,提升了基于该trimap图进行抠图的抠图准确度。The terminal provided by the embodiment of the present application can train a deep learning network based on the original image and the corresponding tripartite graph, so that it can automatically label the input original image to obtain the tripartite graph, without the need for manual annotation. Hair-level data annotation can reduce the workload of annotation and improve the efficiency of image annotation. In addition, the image processing model is used to annotate the original image to avoid errors that may be introduced by manual annotation, which can improve the annotation effect. Therefore, the matting accuracy of matting based on the trimap image is improved.
上述实施例中提供的图像处理模型的训练装置、抠图装置、存储介质及终端可执行本申请任意实施例所提供的图像处理模型的训练方法或抠图方法,具备执行该方法相应的功能模块和有益效果。未在上述实施例中详尽描述的技术细节,可参见本申请任意实施例所提供的图像处理模型的训练方法或抠图方法。The training device, matting device, storage medium and terminal of the image processing model provided in the above embodiments can execute the training method or the matting method of the image processing model provided by any embodiment of the present application, and have corresponding functional modules for executing the method. and beneficial effects. For technical details not described in detail in the foregoing embodiments, reference may be made to the training method or the matting method of the image processing model provided by any embodiment of the present application.
注意,上述仅为本申请的较佳实施例及所运用技术原理。本领域技术人员会理解,本申请不限于这里所述的特定实施例,对本领域技术人员来说能够进行各种明显的变化、重新调整和替代而不会脱离本申请的保护范围。因此,虽然通过以上实施例对本申请进行了较为详细的说明,但是本申请不仅仅限于以上实施例,在不脱离本申请构思的情况下,还可以包括更多其他等效实施例,而本申请的范围由所附的权利要求范围决定。Note that the above are only preferred embodiments of the present application and applied technical principles. Those skilled in the art will understand that the present application is not limited to the specific embodiments described herein, and various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the protection scope of the present application. Therefore, although the present application has been described in detail through the above embodiments, the present application is not limited to the above embodiments, and can also include more other equivalent embodiments without departing from the concept of the present application. The scope is determined by the scope of the appended claims.
Claims (10)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811302651.0A CN109461167B (en) | 2018-11-02 | 2018-11-02 | Image processing model training method, mapping method, device, medium and terminal |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811302651.0A CN109461167B (en) | 2018-11-02 | 2018-11-02 | Image processing model training method, mapping method, device, medium and terminal |
Publications (2)
Publication Number | Publication Date |
---|---|
CN109461167A CN109461167A (en) | 2019-03-12 |
CN109461167B true CN109461167B (en) | 2020-07-21 |
Family
ID=65609358
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811302651.0A Active CN109461167B (en) | 2018-11-02 | 2018-11-02 | Image processing model training method, mapping method, device, medium and terminal |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109461167B (en) |
Families Citing this family (31)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109409246B (en) * | 2018-09-30 | 2020-11-27 | 中国地质大学(武汉) | Accelerated Robust Feature Bimodal Gesture Intent Understanding Based on Sparse Coding |
CN110188760B (en) * | 2019-04-01 | 2021-10-22 | 上海卫莎网络科技有限公司 | Image processing model training method, image processing method and electronic equipment |
CN110197490B (en) * | 2019-04-15 | 2021-02-26 | 广州像素数据技术股份有限公司 | Automatic portrait matting method based on deep learning |
CN113366420B (en) * | 2019-04-17 | 2024-05-03 | 深圳市欢太科技有限公司 | Image processing method, computer-readable storage medium, and computer device |
CN110110723B (en) * | 2019-05-07 | 2021-06-29 | 艾瑞迈迪科技石家庄有限公司 | Method and device for automatically extracting target area in image |
CN110456960B (en) | 2019-05-09 | 2021-10-01 | 华为技术有限公司 | Image processing method, device and equipment |
CN110599515A (en) * | 2019-08-14 | 2019-12-20 | 北京影谱科技股份有限公司 | Automatic layering processing method, device and system for foreground object and storage medium |
CN110751654B (en) * | 2019-08-30 | 2022-06-28 | 稿定(厦门)科技有限公司 | Image matting method, medium, equipment and device |
CN110717060B (en) * | 2019-09-04 | 2023-08-18 | 平安科技(深圳)有限公司 | Image mask filtering method, device and storage medium |
CN110751655B (en) * | 2019-09-16 | 2021-04-20 | 南京工程学院 | An automatic mapping method based on semantic segmentation and saliency analysis |
CN111784726B (en) * | 2019-09-25 | 2024-09-24 | 北京沃东天骏信息技术有限公司 | Portrait matting method and device |
CN110930296B (en) * | 2019-11-20 | 2023-08-08 | Oppo广东移动通信有限公司 | Image processing method, device, equipment and storage medium |
CN113468350B (en) * | 2020-03-31 | 2024-09-17 | 京东方科技集团股份有限公司 | Image labeling method, device and system |
CN111754521B (en) * | 2020-06-17 | 2024-06-25 | Oppo广东移动通信有限公司 | Image processing method and device, electronic equipment and storage medium |
CN113706372B (en) * | 2020-06-30 | 2024-07-05 | 稿定(厦门)科技有限公司 | Automatic matting model building method and system |
CN111739035B (en) * | 2020-06-30 | 2022-09-30 | 腾讯科技(深圳)有限公司 | Image processing method, device and equipment based on artificial intelligence and storage medium |
CN114205642B (en) * | 2020-08-31 | 2024-04-26 | 北京金山云网络技术有限公司 | Video image processing method and device |
CN112734691B (en) * | 2020-12-17 | 2023-06-16 | 郑州金惠计算机系统工程有限公司 | Industrial product defect detection method and device, terminal equipment and storage medium |
CN112541927A (en) * | 2020-12-18 | 2021-03-23 | Oppo广东移动通信有限公司 | Method, device, equipment and storage medium for training and matting model |
CN114792325A (en) * | 2021-01-25 | 2022-07-26 | 清华大学 | A kind of portrait matting method and system |
CN112990331A (en) * | 2021-03-26 | 2021-06-18 | 共达地创新技术(深圳)有限公司 | Image processing method, electronic device and storage medium |
CN115205307A (en) * | 2021-04-09 | 2022-10-18 | Oppo广东移动通信有限公司 | Image processing method and device and electronic equipment |
CN113034523B (en) * | 2021-04-23 | 2024-11-15 | 腾讯科技(深圳)有限公司 | Image processing method, device, storage medium and computer equipment |
CN113379786B (en) * | 2021-06-30 | 2024-02-02 | 深圳万兴软件有限公司 | Image matting method, device, computer equipment and storage medium |
CN113344910B (en) * | 2021-07-02 | 2022-12-23 | 深圳市燕麦科技股份有限公司 | Defect labeling image generation method and device, computer equipment and storage medium |
CN113592074B (en) * | 2021-07-28 | 2023-12-12 | 北京世纪好未来教育科技有限公司 | Training method, generating method and device and electronic equipment |
CN113657402B (en) * | 2021-10-18 | 2022-02-01 | 北京市商汤科技开发有限公司 | Image matting processing method and device, electronic equipment and storage medium |
CN114155260A (en) * | 2021-12-08 | 2022-03-08 | 广州绿怡信息科技有限公司 | Appearance image matting model training method and matting method for recycling detection |
CN114708276A (en) * | 2022-03-28 | 2022-07-05 | 奥比中光科技集团股份有限公司 | Matting network training method, matting method and matting device |
CN115439720B (en) * | 2022-11-08 | 2023-01-24 | 成都数联云算科技有限公司 | CAM image reconstruction method, training method, device, equipment and medium |
CN116991089B (en) * | 2023-09-28 | 2023-12-05 | 深圳市微琪思网络有限公司 | Intelligent control method and system for electric iron based on wireless connection |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103473780A (en) * | 2013-09-22 | 2013-12-25 | 广州市幸福网络技术有限公司 | Portrait background cutout method |
CN103955918A (en) * | 2014-04-03 | 2014-07-30 | 吉林大学 | Full-automatic fine image matting device and method |
CN106204567A (en) * | 2016-07-05 | 2016-12-07 | 华南理工大学 | A kind of natural background video matting method |
CN108257144A (en) * | 2018-01-25 | 2018-07-06 | 深圳市商汤科技有限公司 | Stingy drawing method, device, equipment, storage medium and program based on neural network |
CN108460770A (en) * | 2016-12-13 | 2018-08-28 | 华为技术有限公司 | Scratch drawing method and device |
CN108537859A (en) * | 2017-03-02 | 2018-09-14 | 奥多比公司 | Use the image masks of deep learning |
-
2018
- 2018-11-02 CN CN201811302651.0A patent/CN109461167B/en active Active
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103473780A (en) * | 2013-09-22 | 2013-12-25 | 广州市幸福网络技术有限公司 | Portrait background cutout method |
CN103955918A (en) * | 2014-04-03 | 2014-07-30 | 吉林大学 | Full-automatic fine image matting device and method |
CN106204567A (en) * | 2016-07-05 | 2016-12-07 | 华南理工大学 | A kind of natural background video matting method |
CN108460770A (en) * | 2016-12-13 | 2018-08-28 | 华为技术有限公司 | Scratch drawing method and device |
CN108537859A (en) * | 2017-03-02 | 2018-09-14 | 奥多比公司 | Use the image masks of deep learning |
CN108257144A (en) * | 2018-01-25 | 2018-07-06 | 深圳市商汤科技有限公司 | Stingy drawing method, device, equipment, storage medium and program based on neural network |
Non-Patent Citations (2)
Title |
---|
交互式前景抠图技术综述;沈洋;《计算机辅助设计与图形学学报》;20140430;第26卷(第4期);全文 * |
数字抠像的最新研究进展;张展鹏;《自动化学报》;20121031;第38卷(第10期);全文 * |
Also Published As
Publication number | Publication date |
---|---|
CN109461167A (en) | 2019-03-12 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109461167B (en) | Image processing model training method, mapping method, device, medium and terminal | |
US11361526B2 (en) | Content-aware selection | |
WO2022027912A1 (en) | Face pose recognition method and apparatus, terminal device, and storage medium. | |
CN112150347B (en) | Image modification patterns learned from a limited set of modified images | |
CN109741281B (en) | Image processing method, image processing device, storage medium and terminal | |
CN109345553B (en) | Palm and key point detection method and device thereof, and terminal equipment | |
WO2020244074A1 (en) | Expression interaction method and apparatus, computer device, and readable storage medium | |
WO2020224115A1 (en) | Picture processing method and apparatus, computer device and storage medium | |
CN107688637A (en) | Information pushing method, device, storage medium and electronic terminal | |
CN108566516A (en) | Image processing method, device, storage medium and mobile terminal | |
WO2022227218A1 (en) | Drug name recognition method and apparatus, and computer device and storage medium | |
CN113627439B (en) | Text structuring processing method, processing device, electronic equipment and storage medium | |
CN109086753B (en) | Traffic sign recognition method and device based on two-channel convolutional neural network | |
CN104966016B (en) | Mobile terminal child user cooperatively judges and the method for limitation operating right | |
CN108876751A (en) | Image processing method, image processing device, storage medium and terminal | |
CN107678823A (en) | Mobile terminal application control method, device and storage medium, and mobile terminal | |
WO2020244160A1 (en) | Terminal device control method and apparatus, computer device, and readable storage medium | |
CN108021905A (en) | Image processing method, device, terminal equipment and storage medium | |
CN111290684A (en) | Image display method, image display device and terminal equipment | |
US20230169785A1 (en) | Method and apparatus for character selection based on character recognition, and terminal device | |
CN110502959A (en) | Gender judgment method, gender judgment device, storage medium and electronic equipment | |
WO2023197648A1 (en) | Screenshot processing method and apparatus, electronic device, and computer readable medium | |
CN111796874A (en) | A device wake-up method, apparatus, computer device and storage medium | |
CN117292384B (en) | Character recognition method, related device and storage medium | |
CN110110010A (en) | Data processing method and device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |