CN111680758A - Image training sample generation method and device - Google Patents

Image training sample generation method and device Download PDF

Info

Publication number
CN111680758A
CN111680758A CN202010543613.5A CN202010543613A CN111680758A CN 111680758 A CN111680758 A CN 111680758A CN 202010543613 A CN202010543613 A CN 202010543613A CN 111680758 A CN111680758 A CN 111680758A
Authority
CN
China
Prior art keywords
model
dimensional
texture
transformation
target object
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202010543613.5A
Other languages
Chinese (zh)
Other versions
CN111680758B (en
Inventor
许娅彤
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou Hikvision Digital Technology Co Ltd
Original Assignee
Hangzhou Hikvision Digital Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hangzhou Hikvision Digital Technology Co Ltd filed Critical Hangzhou Hikvision Digital Technology Co Ltd
Priority to CN202010543613.5A priority Critical patent/CN111680758B/en
Publication of CN111680758A publication Critical patent/CN111680758A/en
Application granted granted Critical
Publication of CN111680758B publication Critical patent/CN111680758B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/214Generating training patterns; Bootstrap methods, e.g. bagging or boosting
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T17/00Three-dimensional [3D] modelling for computer graphics
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T19/00Manipulating three-dimensional [3D] models or images for computer graphics
    • G06T19/20Editing of three-dimensional [3D] images, e.g. changing shapes or colours, aligning objects or positioning parts

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Software Systems (AREA)
  • Computer Graphics (AREA)
  • General Engineering & Computer Science (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Evolutionary Computation (AREA)
  • Evolutionary Biology (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Artificial Intelligence (AREA)
  • Geometry (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Architecture (AREA)
  • Computer Hardware Design (AREA)
  • Image Generation (AREA)

Abstract

The application discloses an image training sample generation method and device, and belongs to the field of computer vision. According to the method and the device, a plurality of three-dimensional transformation models can be obtained by performing model transformation on the obtained three-dimensional texture model of the target object, and one or more two-dimensional images corresponding to each three-dimensional transformation model are generated, so that a large number of image training samples similar to the target object can be obtained. That is, the scheme can quickly and automatically generate a large number of image training samples meeting the requirements, and saves labor and time cost. And because the image training samples in the scheme are obtained according to the three-dimensional texture model of the target object, the image training samples and the target object belong to the same type and have higher fidelity. Therefore, compared with an image training sample captured from the Internet, the method can simplify the sample processing process, reduce the problem of quality reduction of the sample introduced by manual operation, and is beneficial to subsequent training of a deep learning network.

Description

图像训练样本生成方法和装置Image training sample generation method and device

技术领域technical field

本申请涉及计算机视觉(Computer Vision,CV)领域,特别涉及一种图像训练样本生成方法和装置。The present application relates to the field of Computer Vision (CV), and in particular, to a method and apparatus for generating image training samples.

背景技术Background technique

当前深度学习技术广泛应用于CV领域,为了增强深度学习网络的泛化能力、降低深度学习网络的过拟合性,通常需要使用海量的图像训练样本对深度学习网络进行训练,而如何获取海量的图像训练样本成为深度学习技术应用于CV领域中亟待解决的问题。At present, deep learning technology is widely used in the field of CV. In order to enhance the generalization ability of deep learning networks and reduce the overfitting of deep learning networks, it is usually necessary to use massive image training samples to train deep learning networks. Image training samples have become an urgent problem to be solved in the application of deep learning technology in the field of CV.

在相关技术中,可以通过相机采集图像或者从互联网上抓取图像的方法获取图像训练样本。但是,由于相机采集的方法受限于硬件、人力成本等,因此想要获取足够量级的图像,获取周期漫长。而从互联网上抓取的图像,大部分无法直接使用,需要依赖人工对抓取的图像进行清洗、标注等样本增强工作,时间成本和人力成本也很高,且人工操作可能会导致样本质量下降,影响深度学习网络的训练。In the related art, image training samples can be obtained by a method of collecting images with a camera or grabbing images from the Internet. However, since the method of camera acquisition is limited by hardware and labor costs, it takes a long time to acquire images of sufficient magnitude. However, most of the images captured from the Internet cannot be used directly, and need to rely on manual sample enhancement work such as cleaning and labeling of the captured images. The time cost and labor cost are also high, and manual operation may lead to a decrease in sample quality. , which affects the training of deep learning networks.

发明内容SUMMARY OF THE INVENTION

本申请提供了一种图像训练样本生成方法和装置,可以节省获取图像训练样本的时间成本和人力成本,且可以提高样本质量。所述技术方案如下:The present application provides a method and device for generating image training samples, which can save the time cost and labor cost of acquiring image training samples, and can improve the quality of the samples. The technical solution is as follows:

一方面,提供了一种图像训练样本生成方法,所述方法包括:In one aspect, a method for generating image training samples is provided, the method comprising:

获取目标对象的三维纹理模型;Obtain the 3D texture model of the target object;

对所述三维纹理模型进行模型变换,得到多个三维变换模型,所述模型变换包括模型形变和纹理变换中的至少一种;Perform model transformation on the three-dimensional texture model to obtain a plurality of three-dimensional transformation models, where the model transformation includes at least one of model deformation and texture transformation;

生成所述多个三维变换模型中每个三维变换模型对应的一个或多个二维图像,将生成的二维图像作为图像训练样本。One or more 2D images corresponding to each 3D transformation model in the plurality of 3D transformation models are generated, and the generated 2D images are used as image training samples.

可选地,所述获取目标对象的三维纹理模型,包括:Optionally, the acquisition of the three-dimensional texture model of the target object includes:

创建所述目标对象的三维模型;creating a three-dimensional model of the target object;

根据所述目标对象的纹理,对所述三维模型进行纹理映射,得到所述三维纹理模型。According to the texture of the target object, texture mapping is performed on the three-dimensional model to obtain the three-dimensional texture model.

可选地,当所述模型变换包括所述纹理变换时,所述对所述三维纹理模型进行模型变换,得到多个三维变换模型,包括:Optionally, when the model transformation includes the texture transformation, performing model transformation on the three-dimensional texture model to obtain a plurality of three-dimensional transformation models, including:

对所述三维纹理模型进行语义分割,得到多个局部特征区域,所述多个局部特征区域中的每个局部特征区域对应一个语义;Semantic segmentation is performed on the three-dimensional texture model to obtain a plurality of local feature regions, and each local feature region in the plurality of local feature regions corresponds to a semantic;

根据所述多个局部特征区域对应的语义,从存储的多个纹理素材中,获取每个局部特征区域对应的多个目标纹理素材;According to the semantics corresponding to the multiple local feature regions, from the stored multiple texture materials, obtain multiple target texture materials corresponding to each local feature region;

根据所述多个局部特征区域分别对应的多个目标纹理素材,对所述三维纹理模型进行纹理变换,得到所述多个三维变换模型。According to a plurality of target texture materials corresponding to the plurality of local feature regions, texture transformation is performed on the three-dimensional texture model to obtain the plurality of three-dimensional transformation models.

可选地,当所述模型变换包括所述模型形变时,所述对所述三维纹理模型进行模型变换,得到多个三维变换模型,包括:Optionally, when the model transformation includes the model deformation, the model transformation is performed on the three-dimensional texture model to obtain a plurality of three-dimensional transformation models, including:

获取多组结构编辑参数;Get multiple groups of structure editing parameters;

根据所述多组结构编辑参数,分别对所述三维纹理模型的几何结构进行编辑,得到所述多个三维变换模型。According to the multiple sets of structure editing parameters, the geometric structures of the three-dimensional texture models are edited respectively to obtain the multiple three-dimensional transformation models.

可选地,所述生成所述多个三维变换模型中的每个三维变换模型对应的一个或多个二维图像,包括:Optionally, generating one or more two-dimensional images corresponding to each of the three-dimensional transformation models in the plurality of three-dimensional transformation models includes:

获取参考相机参数;Get reference camera parameters;

根据所述参考相机参数,从一个或多个不同的视角方向,对每个三维变换模型进行投影,得到相应三维变换模型对应的一个或多个二维图像。According to the reference camera parameters, each 3D transformation model is projected from one or more different viewing directions to obtain one or more 2D images corresponding to the corresponding 3D transformation model.

另一方面,提供了一种图像训练样本生成装置,所述装置包括:In another aspect, an image training sample generating apparatus is provided, the apparatus comprising:

获取模块,用于获取目标对象的三维纹理模型;an acquisition module for acquiring the 3D texture model of the target object;

变换模块,用于对所述三维纹理模型进行模型变换,得到多个三维变换模型,所述模型变换包括模型形变和纹理变换中的至少一种;a transformation module, configured to perform model transformation on the three-dimensional texture model to obtain a plurality of three-dimensional transformation models, where the model transformation includes at least one of model deformation and texture transformation;

生成模块,用于生成所述多个三维变换模型中每个三维变换模型对应的一个或多个二维图像,将生成的二维图像作为图像训练样本。A generating module is configured to generate one or more two-dimensional images corresponding to each three-dimensional transform model in the plurality of three-dimensional transform models, and use the generated two-dimensional images as image training samples.

可选地,所述获取模块包括:Optionally, the obtaining module includes:

创建子模块,用于创建所述目标对象的三维模型;Create a submodule for creating a three-dimensional model of the target object;

映射子模块,用于根据所述目标对象的纹理,对所述三维模型进行纹理映射,得到所述三维纹理模型。The mapping sub-module is configured to perform texture mapping on the three-dimensional model according to the texture of the target object to obtain the three-dimensional texture model.

可选地,当所述模型变换包括所述纹理变换时,所述变换模块包括:Optionally, when the model transformation includes the texture transformation, the transformation module includes:

语��分割子模块,用于对所述三维纹理模型进行语义分割,得到多个局部特征区域,所述多个局部特征区域中的每个局部特征区域对应一个语义;a semantic segmentation sub-module, configured to perform semantic segmentation on the three-dimensional texture model to obtain a plurality of local feature regions, and each local feature region in the plurality of local feature regions corresponds to a semantic;

第一获取子模块,用于根据所述多个局部特征区域对应的语义,从存储的多个纹理素材中,获取每个局部特征区域对应的多个目标纹理素材;a first acquisition sub-module, configured to acquire a plurality of target texture materials corresponding to each local feature region from a plurality of stored texture materials according to the semantics corresponding to the plurality of local feature regions;

变换子模块,用于根据所述多个局部特征区域分别对应的多个目标纹理素材,对所述三维纹理模型进行纹理变换,得到所述多个三维变换模型。The transformation sub-module is configured to perform texture transformation on the three-dimensional texture model according to multiple target texture materials corresponding to the multiple local feature regions respectively, to obtain the multiple three-dimensional transformation models.

可选地,当所述模型变换包括所述模型形变时,所述变换模块包括:Optionally, when the model transformation includes the model deformation, the transformation module includes:

第二获取子模块,用于获取多组结构编辑参数;The second acquisition sub-module is used to acquire multiple groups of structure editing parameters;

编辑子模块,用于根据所述多组结构编辑参数,分别对所述三维纹理模型的几何结构进行编辑,得到所述多个三维变换模型。The editing sub-module is configured to edit the geometric structure of the three-dimensional texture model according to the plurality of sets of structural editing parameters to obtain the plurality of three-dimensional transformation models.

可选地,所述生成模块包括:Optionally, the generation module includes:

第三获取子模块,用于获取参考相机参数;The third acquisition sub-module is used to acquire the reference camera parameters;

投影子模块,用于根据所述参考相机参数,从一个或多个不同的视角方向,对每个三维变换模型进行投影,得到相应三维变换模型对应的一个或多个二维图像。The projection sub-module is used for projecting each 3D transformation model from one or more different viewing angles according to the reference camera parameters to obtain one or more 2D images corresponding to the corresponding 3D transformation model.

另一方面,提供了一种计算机设备,所述计算机设备包括处理器、通信接口、存储器和通信总线,所述处理器、所述通信接口和所述存储器通过所述通信总线完成相互间的通信,所述存储器用于存放计算机程序,所述处理器用于执行所述存储器上所存放的程序,以实现上述所述图像训练样本生成方法的步骤。In another aspect, a computer device is provided, the computer device includes a processor, a communication interface, a memory and a communication bus, and the processor, the communication interface and the memory communicate with each other through the communication bus , the memory is used for storing a computer program, and the processor is used for executing the program stored in the memory, so as to realize the steps of the above-mentioned image training sample generation method.

另一方面,提供了一种计算机可读存储介质,所述存储介质内存储有计算机程序,所述计算机程序被处理器执行时实现上述所述图像训练样本生成方法的步骤。In another aspect, a computer-readable storage medium is provided, and a computer program is stored in the storage medium, and when the computer program is executed by a processor, the steps of the above-mentioned image training sample generation method are implemented.

另一方面,提供了一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机执行上述所述的图像训练样本生成方法的步骤。In another aspect, there is provided a computer program product comprising instructions which, when run on a computer, cause the computer to perform the steps of the above-described image training sample generation method.

本申请提供的技术方案至少可以带来以下有益效果:The technical solution provided by this application can at least bring the following beneficial effects:

通过对获取的目标对象的三维纹理模型进行模型变换,可以得到多个三维变换模型,再生成每个三维变换模型对应的一个或多个二维图像,这样,可以得到大量的与目标对象类似的图像训练样本。也即是,本申请提供的方案可以快速地自动生成大量满足需求的图像训练样本,相比于实际相机采集样本,节省了设备投入、人力成本和时间成本,在相同时间内可以产生数万倍甚至更多的样本。并且由于本方案中的图像训练样本是根据目标对象的三维纹理模型得到的,因此,这些图像训练样本与目标对象属于同一类型且逼真度较高。这样,相比于从互联网上抓取的图像训练样本,可以简化样本处理过程,从而减轻在样本处理过程中由于人工操作所导致的样本质量下降的问题,有利于后续对深度学习网络的训练。By performing model transformation on the acquired 3D texture model of the target object, multiple 3D transformation models can be obtained, and then one or more 2D images corresponding to each 3D transformation model can be generated. Image training samples. That is, the solution provided in this application can quickly and automatically generate a large number of image training samples that meet the needs. Compared with the actual camera collection samples, it saves equipment investment, labor costs and time costs, and can generate tens of thousands of times in the same time. even more samples. And since the image training samples in this solution are obtained according to the three-dimensional texture model of the target object, these image training samples belong to the same type as the target object and have high fidelity. In this way, compared with the image training samples captured from the Internet, the sample processing process can be simplified, thereby reducing the problem of sample quality degradation caused by manual operations during the sample processing process, which is beneficial to the subsequent training of the deep learning network.

附图说明Description of drawings

为了更清楚地说明本申请实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来��,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to illustrate the technical solutions in the embodiments of the present application more clearly, the following briefly introduces the drawings that are used in the description of the embodiments. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, other drawings can also be obtained from these drawings without creative effort.

图1是本申请实施例提供的一种图像训练样本生成方法的流程图;1 is a flowchart of a method for generating an image training sample provided by an embodiment of the present application;

图2是本申请实施例中创建的目标对象的三维模型的示意图;2 is a schematic diagram of a three-dimensional model of a target object created in an embodiment of the present application;

图3是本申请实施例采集的目标对象的纹理的示意图;3 is a schematic diagram of a texture of a target object collected by an embodiment of the present application;

图4是本申请实施例获取的目标对象的三维纹理模型的示意图;4 is a schematic diagram of a three-dimensional texture model of a target object obtained in an embodiment of the present application;

图5是本申请实施例中对图4所示的三维纹理模型进行模型形变得到的一个三维变换模型的示意图;5 is a schematic diagram of a three-dimensional transformation model obtained by performing model deformation on the three-dimensional texture model shown in FIG. 4 in an embodiment of the present application;

图6是本申请实施例提供的一种对三维变换模型进行投影得到二维图像的示意图;6 is a schematic diagram of obtaining a two-dimensional image by projecting a three-dimensional transformation model according to an embodiment of the present application;

图7是本申请实施例提供的一种图像训练样本生成装置的结构示意图;FIG. 7 is a schematic structural diagram of an apparatus for generating an image training sample provided by an embodiment of the present application;

图8是本申请实施例提供的一种计算机设备的结构示意图。FIG. 8 is a schematic structural diagram of a computer device provided by an embodiment of the present application.

具体实施方式Detailed ways

为使本申请的目的、技术方案和优点更加清楚,下面将结合附图对本申请实施方式作进一步地详细描述。In order to make the objectives, technical solutions and advantages of the present application clearer, the embodiments of the present application will be further described in detail below with reference to the accompanying drawings.

当前深度学习技术广泛应用于CV领域,为了增强深度学习网络的泛化能力、降低深度学习网络的过拟合性,通常需要使用海量的图像训练样本对深度学习网络进行训练,而如何获取海量的图像训练样本成为深度学习技术应用于CV领域中亟待解决的问题。通过本申请实施例提供的技术方案可以快速地生成大量满足需求的图像训练样本。例如,快速地生成大量的人的图像训练样本,可以用于对深度学习网络进行训练,得到可以用于人物识别等的深度学习模型,又如,可以生成大量的汽车的图像训练样本,用于对深度学习网络训练得到可以用于车辆检测等的深度学习模型,再如,可以生成大量的室内装饰的图像训练样本,用于对深度学习网络进行训练得到可以用于环境结构检测等的深度学习模型。At present, deep learning technology is widely used in the field of CV. In order to enhance the generalization ability of deep learning networks and reduce the overfitting of deep learning networks, it is usually necessary to use massive image training samples to train deep learning networks. Image training samples have become an urgent problem to be solved in the application of deep learning technology in the field of CV. With the technical solutions provided by the embodiments of the present application, a large number of image training samples that meet the requirements can be quickly generated. For example, quickly generating a large number of human image training samples can be used to train a deep learning network to obtain a deep learning model that can be used for character recognition, etc., for example, a large number of car image training samples can be generated for The deep learning network can be trained to obtain a deep learning model that can be used for vehicle detection. For another example, a large number of image training samples of interior decoration can be generated, which can be used to train the deep learning network to obtain deep learning that can be used for environmental structure detection, etc. Model.

接下来对本申请实施例提供的图像训练样本生成方法进行详细的解释说明。Next, the method for generating image training samples provided by the embodiments of the present application will be explained in detail.

图1是本申请实施例提供的一种图像训练样本生成方法的流程图。请参考图1,该方法包括如下步骤。FIG. 1 is a flowchart of a method for generating an image training sample provided by an embodiment of the present application. Please refer to FIG. 1 , the method includes the following steps.

步骤101:获取目标对象的三维纹理模型。Step 101: Acquire a three-dimensional texture model of the target object.

在本申请实施例��,为了扩充生成大量的指定类型的图像训练样本,可以先采集目标对象的一个或多个二维图像,通过三维重建的方法来获取目标对象的三维纹理模型。其中,指定类型可以根据实际需求来指定,目标对象即为指定类型的一个实际对象,例如,如果当前需要训练深度学习网络用于车辆识别,指定类型可以为车辆,目标对象可以是一个实际的汽车。In the embodiment of the present application, in order to generate a large number of image training samples of specified types, one or more two-dimensional images of the target object can be collected first, and the three-dimensional texture model of the target object can be obtained by a three-dimensional reconstruction method. The specified type can be specified according to actual needs, and the target object is an actual object of the specified type. For example, if a deep learning network needs to be trained for vehicle recognition, the specified type can be a vehicle, and the target object can be an actual car. .

需要说明的是,在本申请实施例中,指定类型可以是任意一种对象类型,例如,人体、车辆、桌椅、风景、室内装饰等类型。It should be noted that, in this embodiment of the present application, the specified type may be any object type, such as a human body, a vehicle, a table and chair, a landscape, an interior decoration, and the like.

在一些实施例中,在采集到目标对象的一个或多个二维图像之后,可以先创建目标对象的三维模型,再根据该目标对象的纹理,对该三维模型进行纹理映射,得到三维纹理模型。In some embodiments, after collecting one or more two-dimensional images of the target object, a three-dimensional model of the target object may be created first, and then texture mapping is performed on the three-dimensional model according to the texture of the target object to obtain a three-dimensional texture model .

在本申请实施例中,可以通过三维重建算法,来重建目标对象的三维模型,也即重构目标对象的三维的几何结构。例如,可以通过目标对象的轮廓重建三维模型。其中,三维重建算法可以是多视点立体几何(Multi-View Stereo,MVS)重建、基于轮廓的形状恢复(Shape from Silhouette,SfS)等,本申请实施例对此不作限定。In this embodiment of the present application, a three-dimensional reconstruction algorithm can be used to reconstruct the three-dimensional model of the target object, that is, to reconstruct the three-dimensional geometric structure of the target object. For example, a three-dimensional model can be reconstructed from the contours of the target object. The 3D reconstruction algorithm may be multi-view stereo geometry (Multi-View Stereo, MVS) reconstruction, contour-based shape recovery (Shape from Silhouette, SfS), etc., which is not limited in this embodiment of the present application.

在创建目标对象的三维模型之后,可以再根据采集的目标对象各个区域的纹理,对该三维模型相应区域进行纹理映射,得到目标对象的三维纹理模型。After the three-dimensional model of the target object is created, texture mapping can be performed on the corresponding regions of the three-dimensional model according to the acquired textures of various regions of the target object to obtain a three-dimensional texture model of the target object.

例如,假设目标对象为一辆车,在创建该车的三维模型之后,可以根据采集的该车的纹理,对该车的三维模型进行纹理映射,得到该车的三维纹理模型。For example, assuming that the target object is a car, after the three-dimensional model of the car is created, texture mapping can be performed on the three-dimensional model of the car according to the collected texture of the car to obtain the three-dimensional texture model of the car.

又如,假设目标对象为一个人,图2为根据采集的该目标对象的多个二维图像创建的三维模型,图3为采集的该目标对象的多个纹理,图4为将图3所示的纹理映射在图2所示的三维模型的相应区域,得到的该目标对象的三维纹理模型。For another example, assuming that the target object is a person, FIG. 2 is a three-dimensional model created according to a plurality of two-dimensional images of the target object collected, FIG. 3 is a plurality of textures of the target object collected, and FIG. The texture shown in Figure 2 is mapped to the corresponding area of the 3D model shown in Figure 2, and the 3D texture model of the target object is obtained.

在另一些实施例中,可以直接根据目标对象的一个或多个二维图像,得到该目标对象的三维纹理模型。例如,可以将目标对象的一个或多个二维图像输入端到端的深度学习模型中,该深度学习模型可以直接输出目标对象的三维纹理模型。In other embodiments, the three-dimensional texture model of the target object can be obtained directly according to one or more two-dimensional images of the target object. For example, one or more 2D images of the target object can be input into an end-to-end deep learning model, which can directly output a 3D texture model of the target object.

在其他一些实施例中,可以从三维纹理模型库中获取指定类型的三维纹理模型。例如,可以从三维纹理模型库中获取一辆车的三维纹理模型。In some other embodiments, a specified type of 3D texture model can be obtained from a 3D texture model library. For example, a 3D texture model of a car can be obtained from a 3D texture model library.

在本申请实施例中,除了上述采集目标对象的一个或多个二维图像,来重建目标对象的三维纹理模型之外,也可以采集目标对象的一个或多个深度图像,以及目标对象的纹理,对采集的深度图像进行三维重建,得到目标对象的三维模型,再根据目标对象的纹理对该三维模型进行纹理映射,得到目标对象的三维纹理模型。其中,对深度图像进行三维重建的方法可以是基于深度学习的三维重建方法,也可以是其他方法,本申请对此不作限定。In the embodiment of the present application, in addition to collecting one or more two-dimensional images of the target object to reconstruct the three-dimensional texture model of the target object, one or more depth images of the target object and the texture of the target object may also be collected. , performing three-dimensional reconstruction on the acquired depth image to obtain a three-dimensional model of the target object, and then performing texture mapping on the three-dimensional model according to the texture of the target object to obtain a three-dimensional texture model of the target object. The method for performing 3D reconstruction on the depth image may be a 3D reconstruction method based on deep learning, or may be other methods, which are not limited in this application.

或者,还可以通过激光设备采集目标对象的三维点云,通过相机采集目标对象的纹理,然后,对采集的三维点云进行三维重建,得到目标对象的三维模型,再根据目标对象的纹理对该三维模型进行纹理映射。其中,对三维点云进行三维重建的方法可以是基于深度学习的三维重建方法,也可以是其他方法,本申请对此不作限定。Alternatively, the 3D point cloud of the target object can also be collected by a laser device, the texture of the target object can be collected by a camera, and then 3D reconstruction of the collected 3D point cloud can be performed to obtain a 3D model of the target object, and then the 3D model of the target object can be obtained according to the texture of the target object. 3D model for texture mapping. The method for performing 3D reconstruction on a 3D point cloud may be a 3D reconstruction method based on deep learning, or may be other methods, which are not limited in this application.

步骤102:对该三维纹理模型进行模型变换,得到多个三维变换模型。其中,模型变换包括模型形变和纹理变换中的至少一种。Step 102: Perform model transformation on the three-dimensional texture model to obtain a plurality of three-dimensional transformation models. The model transformation includes at least one of model deformation and texture transformation.

在本申请实施例中,在获取目标对象的三维纹理模型之后,可以对该三维纹理模型进行模型变换,其中,模型变换包括模型形变和纹理变换中的至少一种。接下来将介绍本申请实施例提供的对三维纹理模型进行模型变换的四种实现方式。In this embodiment of the present application, after acquiring the three-dimensional texture model of the target object, model transformation may be performed on the three-dimensional texture model, wherein the model transformation includes at least one of model deformation and texture transformation. Next, four implementation manners for performing model transformation on a three-dimensional texture model provided by the embodiments of the present application will be introduced.

第一种实现方式,当模型变换包括纹理变换时,可以先对该三维纹理模型进行语义分割,得到多个局部特征区域,多个局部特征区域中的每个局部特征区域对应一个语义。然后再根据多个局部特征区域对应的语义,从存储的多个纹理素材中,获取每个局部特征区域对应的多个目标纹理素材。之后根据多个局部特征区域分别对应的多个目标纹理素材,对该三维纹理模型进行纹理变换,得到多个三维变换模型。In the first implementation manner, when the model transformation includes texture transformation, the three-dimensional texture model can be semantically segmented to obtain multiple local feature regions, and each local feature region in the multiple local feature regions corresponds to a semantic. Then, according to the semantics corresponding to the multiple local feature regions, from the stored multiple texture materials, multiple target texture materials corresponding to each local feature region are obtained. Then, according to multiple target texture materials corresponding to multiple local feature regions, texture transformation is performed on the 3D texture model to obtain multiple 3D transformation models.

在本申请实施例中,可以仅对目标对象的三维纹理模型进行纹理变换,得到多个三维变换模型。示例性地,首先,可以对该三维纹理模型进行语义分割,得到多个对应有语义的局部特征区域,也即是将该三维纹理模型划分为多个不同语义的局部特征区域。其中,语义特征提取的方法可以是基于深度学习的语义特征提取、语义分割、模型参数化等方法,也可以是其他的语义分割方法。In this embodiment of the present application, only the three-dimensional texture model of the target object may be subjected to texture transformation to obtain multiple three-dimensional transformation models. Exemplarily, first, semantic segmentation may be performed on the 3D texture model to obtain a plurality of corresponding local feature regions with semantics, that is, the 3D texture model is divided into a plurality of local feature regions with different semantics. Among them, the method of semantic feature extraction may be deep learning-based semantic feature extraction, semantic segmentation, model parameterization, etc., or may be other semantic segmentation methods.

需要说明的是,在本申请实施例中,可以直接对目标对象的三维纹理模型进行语义分割,例如,可以直接对人体的三维纹理模型进行语义分割,得到头发、面部、四肢等局部特征区域,对三维纹理模型上的这些区域进行语义标注,从而得到多个对应有语义的局部特征区域。另外,本申请实施例中也可以先将目标对象的三维纹理模型投影到多个视角方向得到多个二维图像,再对这些二维图像进行语义分割,得到多个对应有语义的局域特征区域,再根据该多个局部特征区域,对三维纹理模型的对应区域进行语义标注。例如,可以先将一辆车的三维纹理模型投影到6个不同的视角方向,得到6个不同的二维图像,再对这6个二维图像分别进行语义分割,得到多个对应有语义的局域特征区域,再根据该多个局部特征区域,对三维纹理模型的对应区域进行语义标注,这样,每个局部特征区域将对应有一个语义。It should be noted that, in this embodiment of the present application, the 3D texture model of the target object can be directly semantically segmented. For example, the 3D texture model of the human body can be directly semantically segmented to obtain local feature regions such as hair, face, and limbs. These regions on the 3D texture model are semantically labeled, so as to obtain a plurality of corresponding semantic local feature regions. In addition, in the embodiment of the present application, the three-dimensional texture model of the target object can also be projected to multiple viewing directions to obtain multiple two-dimensional images, and then these two-dimensional images are semantically segmented to obtain multiple corresponding semantic local features The corresponding regions of the three-dimensional texture model are semantically marked according to the multiple local feature regions. For example, you can first project the 3D texture model of a car to 6 different viewing directions to obtain 6 different 2D images, and then perform semantic segmentation on the 6 2D images respectively to obtain multiple corresponding semantic images. Then, according to the multiple local feature regions, the corresponding regions of the three-dimensional texture model are semantically marked, so that each local feature region will have a corresponding semantic.

在进行语义分割得到多个对应有语义的局部特征区域之后,可以再根据该多个局部特征区域对应的语义,从存储的多个纹理素材中,获��每个局部特征区域对应的多个目标纹理素材。After semantic segmentation is performed to obtain multiple local feature regions corresponding to semantics, multiple target textures corresponding to each local feature region can be obtained from the stored multiple texture materials according to the semantics corresponding to the multiple local feature regions. material.

在本申请实施例中,计算机设备上可以存储多个纹理素材,且存储的纹理素材可以是按照语义进行存储的,每一种语义对应存储有一个或多个纹理素材,例如,可以按照眼睛、眉毛、桌面、皮革等语义进行存储,语义为桌面时,可以对应存储有多个不同桌面的纹理素材,每个桌面的颜色、大小、高光、纹理图案、亮度等均可以不同。In this embodiment of the present application, a plurality of texture materials may be stored on a computer device, and the stored texture materials may be stored according to semantics, and one or more texture materials are stored corresponding to each semantic. Eyebrows, desktop, leather and other semantics are stored. When the semantics is desktop, there can be correspondingly stored texture materials of multiple different desktops. The color, size, highlight, texture pattern, brightness, etc. of each desktop can be different.

在本申请实施例中,可以根据前述确定的多个局部特征区域对应的语义,从存储的多个纹理素材中,获取每个局部特征区域对应的多个目标纹理素材,对于任一局部特征区域来说,获取的多个目标纹理素材的语义可以与该局部特征区域的语义相同,也可以与该局部特征区域的语义相关。In this embodiment of the present application, multiple target texture materials corresponding to each local feature region may be acquired from the stored multiple texture materials according to the semantics corresponding to the plurality of local feature regions determined above. For any local feature region In other words, the semantics of the acquired multiple target texture materials may be the same as the semantics of the local feature area, or may be related to the semantics of the local feature area.

需要说明的是,获取的任意两个局部特征区域对应的目标纹理素材的数量可以相同或不同。另外,对于任一局部特征区域来说,可以从存储的多个纹理素材中获取所有语义相同或相关的目标纹理素材,也可以获取不超过预设数量的目标纹理素材。It should be noted that the quantity of target texture materials corresponding to any two acquired local feature regions may be the same or different. In addition, for any local feature area, all target texture materials with the same semantics or relatedness may be obtained from the stored multiple texture materials, or a target texture material not exceeding a preset number may be obtained.

在获取每个局部特征区域对应的多个目标纹理素材之后,可以用该多个局部特征区域分别对应的多个目标纹理素材,对该三维纹理模型的对应区域进行纹理变换,得到多个三维变换模型。After acquiring multiple target texture materials corresponding to each local feature area, you can use the multiple target texture materials corresponding to the multiple local feature areas respectively to perform texture transformation on the corresponding area of the 3D texture model to obtain multiple 3D transformations Model.

其中,对于每个局部特征区域,可以用获取的对应的多个目标纹理素材中的每个目标纹理素材,对该局部特征区域进行一��纹理变换,得到该局部特征区域的一种纹理变换,这样,可以得到该局部特征区域的多种纹理变换。在本申请实施例中,可以将多个局部特征区域中的任一局部特征区域的每种纹理变换,与除该局部特征区域之外剩余的局部特征区域的多种纹理变换进行随意组合,得到多个三维变换模型。Among them, for each local feature region, a texture transformation can be performed on the local feature region by using each target texture material in the obtained corresponding multiple target texture materials to obtain a texture transformation of the local feature region, so that , a variety of texture transformations of the local feature area can be obtained. In this embodiment of the present application, each texture transformation of any one of the multiple local feature regions can be arbitrarily combined with multiple texture transformations of the remaining local feature regions except the local feature region to obtain Multiple 3D transformation models.

示例性地,假设确定该三维纹理模型有5个对应有语义的局部特征区域,每个局部特征区域均可以对应有3个目标纹理素材,这样则可以组合得到3的5次方,也即243个三维变换模型。假设确定该三维纹理模型有4个对应有语义的局部特征区域,这4个局部特征区域分别对应有2、3、3、5个目标纹理素材,这样则可以组合得到2×3×3×5=90个三维变换模型。Exemplarily, it is assumed that the 3D texture model has 5 local feature regions corresponding to semantics, and each local feature region can correspond to 3 target texture materials, so that the 5th power of 3 can be obtained by combination, that is, 243 A three-dimensional transformation model. Suppose it is determined that the 3D texture model has 4 local feature regions corresponding to semantics, and these 4 local feature regions correspond to 2, 3, 3, and 5 target texture materials respectively, so that 2 × 3 × 3 × 5 can be combined to obtain = 90 3D transformation models.

第二种实现方式,当模型变换包括模型形变时,可以先获取多组结构编辑参数,再根据该多组结构编辑参数,分别对该三维纹理模型的几何结构进行编辑,得到多个三维变换模型。In the second implementation manner, when the model transformation includes model deformation, multiple sets of structural editing parameters can be obtained first, and then the geometric structure of the 3D texture model can be edited according to the multiple sets of structural editing parameters to obtain multiple 3D transformation models. .

在本申请实施例中,可以仅对目标对象的三维纹理模型进行多种不同的模型形变,以得到多个三维变换模型。In the embodiment of the present application, only the three-dimensional texture model of the target object may be subjected to various model deformations to obtain a plurality of three-dimensional transformation models.

在本申请实施例中,可以预设多组结构编辑参数,每组结构编辑参数均可以用于对该三维纹理模型的几何结构进行一次编辑,得到一个三维变换模型。例如,根据任意一组结构编辑参数,可以改变三维纹理模型的顶点坐标、法向、面片拓扑等,得到一个三维变换模型。In the embodiment of the present application, multiple sets of structural editing parameters can be preset, and each set of structural editing parameters can be used to edit the geometric structure of the three-dimensional texture model once to obtain a three-dimensional transformation model. For example, according to any set of structural editing parameters, the vertex coordinates, normal direction, patch topology, etc. of the 3D texture model can be changed to obtain a 3D transformation model.

其中,模型形变的方法可以是光流法、迭代最近点、参数化模板驱动等方法,也可以是其他的方法,本申请实施例对此不作限定。The method for model deformation may be an optical flow method, an iterative closest point, parameterized template driving, or other methods, and may also be other methods, which are not limited in this embodiment of the present application.

示例性地,根据一组结构编辑参数对图4所示的三维纹理模型进行模型形变之后,可以得到如图5所示的一个三维变换模型。Exemplarily, after performing model deformation on the three-dimensional texture model shown in FIG. 4 according to a set of structural editing parameters, a three-dimensional transformation model as shown in FIG. 5 can be obtained.

第三种实现方式,当模型变换包括模型形变和纹理变换时,可以先对该三维纹理模型进行纹理变换,得到多个纹理变换模型,再对该多个纹理变换模型中的每个纹理变换模型进行模型形变,得到每个纹理变换模型对应的三维变换模型。In the third implementation manner, when the model transformation includes model deformation and texture transformation, the three-dimensional texture model can be texture transformed to obtain multiple texture transformation models, and then each texture transformation model in the multiple texture transformation models can be obtained. Perform model deformation to obtain a three-dimensional transformation model corresponding to each texture transformation model.

在本申请实施例中,可以对三维纹理模型进行纹理变换之后再进行模型形变,以得到更多的三维变换模型。其中,纹理变换和模型形变的方法可以参考前述相关介绍,这里不再赘述。In this embodiment of the present application, the three-dimensional texture model may be subjected to texture transformation and then model deformation to obtain more three-dimensional transformed models. The methods of texture transformation and model deformation may refer to the above-mentioned related introductions, which will not be repeated here.

第四种实现方式,当模型变换包括模型形变和纹理变换时,可以先对该三维纹理模型进行模型形变,得到多个三维形变模型,再对该多个三维形变模型中的每个三维形变模型进行纹理变换,得到每个三维形变模型对应的三维变换模型。In the fourth implementation manner, when the model transformation includes model deformation and texture transformation, the 3D texture model can be first subjected to model deformation to obtain multiple 3D deformation models, and then each 3D deformation model in the multiple 3D deformation models can be obtained. Perform texture transformation to obtain a 3D transformation model corresponding to each 3D deformation model.

在本申请实施例中,可以对三维纹理模型进行模型形变之后再进行纹理变换,以得到更多的三维变换模型。其中,纹理变换和模型形变的方法可以参考前述相关介绍,这里不再赘述。In this embodiment of the present application, the three-dimensional texture model can be deformed and then texture transformed to obtain more three-dimensional transformed models. The methods of texture transformation and model deformation may refer to the above-mentioned related introductions, which will not be repeated here.

步骤103:生成该多个三维变换模型中每个三维变换模型对应的一个或多个二维图像,将生成的二维图像作为图像训练样本。Step 103: Generate one or more two-dimensional images corresponding to each of the three-dimensional transformation models in the plurality of three-dimensional transformation models, and use the generated two-dimensional images as image training samples.

在本申请实施例中,在得到多个三维变换模型之后,可以将每个三维变换模型投影到一个或多个不同的视角方向,生成对应的一个或多个二维图像,将生成的二维图像作为图像训练样本。In this embodiment of the present application, after obtaining multiple 3D transformation models, each 3D transformation model can be projected to one or more different viewing directions to generate corresponding one or more 2D images, and the generated 2D transformation models can be Images are used as image training samples.

在本申请实施例中,可以获取参考相机参数,根据参考相机参数,从一个或多个不同的视角方向,对每个三维变换模型进行投影,得到相应三维变换模型对应的一个或多个二维图像。其中,参考相机参数可以是指创建三维纹理模型时所采用的相机参数,也可以是由用户指定的其他相机参数。In this embodiment of the present application, reference camera parameters may be obtained, and each 3D transformation model may be projected from one or more different viewing angles according to the reference camera parameters, to obtain one or more 2D transformation models corresponding to the corresponding 3D transformation model. image. The reference camera parameters may refer to the camera parameters used when creating the 3D texture model, or may be other camera parameters specified by the user.

需要说明的是,为了保证投影得到的二维图像的逼真度,对三维变换模型的投影是模拟相机拍摄的方式进行的投影,也即是根据参考相机参数,对三维变换模型进行投影,得到的二维图像的逼真度很高。其中,参考相机参数可以包括一组或多组相机参数,每组相机参数可以包括相机内参、畸变系数、图像分辨率、视角范围等。另外,投影的视角方向可以是一个或多个,每个视角方向可以是经过一个相机视点的射线的方向。当投影的视角方向有多个时,各个视角方向可以分别对应一组相机参数,由于一组相机参数可以确定一个视角范围,这样,每个视角方向也就对应一个视角范围,且各个视角方向对应的视角范围可以存在重叠或不存在重叠,各个视角方向对应的视角范围的大小可以相同或者不同。It should be noted that, in order to ensure the fidelity of the 2D image obtained by projection, the projection of the 3D transformation model is the projection performed by simulating the camera shooting, that is, the 3D transformation model is projected according to the reference camera parameters, and the obtained The fidelity of 2D images is high. The reference camera parameters may include one or more groups of camera parameters, and each group of camera parameters may include camera intrinsic parameters, distortion coefficients, image resolution, viewing angle range, and the like. In addition, the projected viewing angle direction may be one or more, and each viewing angle direction may be the direction of a ray passing through a camera viewpoint. When there are multiple viewing angle directions for projection, each viewing angle direction can correspond to a set of camera parameters. Since a set of camera parameters can determine a viewing angle range, each viewing angle direction also corresponds to a viewing angle range, and each viewing angle direction corresponds to The viewing angle ranges may overlap or not overlap, and the sizes of the viewing angle ranges corresponding to each viewing angle direction may be the same or different.

需要说明的是,根据参考相机参数中的相机内参和图像分辨率,即可以确定相应视角方向对应的视角范围,基于此,在本申请实施例中,各个视角范围可以指定,也可以无需指定。It should be noted that the viewing angle range corresponding to the corresponding viewing angle direction can be determined according to the camera internal parameters and image resolution in the reference camera parameters. Based on this, in this embodiment of the present application, each viewing angle range may or may not be specified.

示例性地,如图6所示,假设从图示的6个相机视点到该三维变换模型的中心点为6个视角方向,图示的6个相机视点位于同一水平面上,且这6个视角方向对应的视角范围是将水平面的360度进行了平分,也即每个视角方向对应的视角范围均为60度,这6个视角范围不存在重叠,将一个三维变换模型向这6个视角方向进行投影,可以得到6个不同的二维图像。在本申请实施例中,视角方向的个数、相机视点的位置、视线方向、相机内参、畸变系数、图像分辨率等是可以根据需求来指定的。例如,一个视角方向也可以是从上到下的一个方向,对应的视角范围可以指定30度或者120度等。Exemplarily, as shown in FIG. 6 , it is assumed that there are six perspective directions from the six camera viewpoints shown in the figure to the center point of the 3D transformation model, the six camera viewpoints shown in the figure are located on the same horizontal plane, and the six viewpoints are The viewing angle range corresponding to the direction is divided into 360 degrees of the horizontal plane, that is, the viewing angle range corresponding to each viewing angle direction is 60 degrees, and the six viewing angle ranges do not overlap. Projection, you can get 6 different two-dimensional images. In this embodiment of the present application, the number of viewing angle directions, the position of the camera viewpoint, the line of sight direction, the camera internal parameters, the distortion coefficient, and the image resolution can be specified according to requirements. For example, a viewing angle direction may also be a direction from top to bottom, and the corresponding viewing angle range may be specified as 30 degrees or 120 degrees.

在本申请实施例中,模型形变可以生成不同三维几何结构的各种模型,从三维几何结构的维度极大地扩充了图像训练样本的数量。纹理变换可以对三维纹理模型进行语义化结构分析,用相同语义的纹理素材替换相应区域,并进行各种纹理替换的组合变换,从纹理内容的维度极大地扩充了图像训练样本的数量。最后根据相机投影的方式生成二维图像,并将该二维图像作为图像训练样本,这样,生成的图像训练样本的逼真度很高,较实际相机采集样本的性价比高,且可灵活应对用户需求。In the embodiment of the present application, the deformation of the model can generate various models of different three-dimensional geometric structures, which greatly expands the number of image training samples from the dimensions of the three-dimensional geometric structures. Texture transformation can perform semantic structure analysis on 3D texture models, replace corresponding areas with texture materials with the same semantics, and perform combined transformations of various texture replacements, which greatly expands the number of image training samples from the dimension of texture content. Finally, a two-dimensional image is generated according to the camera projection method, and the two-dimensional image is used as an image training sample. In this way, the generated image training sample has high fidelity, is more cost-effective than actual camera samples, and can flexibly respond to user needs. .

综上所述,在本申请实施例中,通过对获取的目标对象的三维纹理模型进行模型变换,可以得到多个三维变换模型,再生成每个三维变换模型对应的一个或多个二维图像,这样,可以得到大量的与目标对象类似的图像训练样本。也即是,本申请提供的方案可以快速地自动生成大量满足需求的图像训练样本,相比于实际相机采集样本,节省了设备投入、人力成本和时间成本,在相同时间内可以产生数万倍甚至更多的样本。并且由于本方案中的图像训练样本是根据目标对象的三维纹理模型得到的,因此,这些图像训练样本与目标对象属于同一类型且逼真度较高。这样,相比于从互联网上抓取的图像训练样本,可以简化样本处理过程,从而减轻在样本处理过程中由于人工操作所导致的样本质量下降的问题,有利于后续对深度学习网络的训练。To sum up, in the embodiment of the present application, by performing model transformation on the acquired 3D texture model of the target object, multiple 3D transformation models can be obtained, and then one or more 2D images corresponding to each 3D transformation model are generated. , in this way, a large number of training samples of images similar to the target object can be obtained. That is, the solution provided in this application can quickly and automatically generate a large number of image training samples that meet the needs. Compared with the actual camera collection samples, it saves equipment investment, labor costs and time costs, and can generate tens of thousands of times in the same time. even more samples. And since the image training samples in this solution are obtained according to the three-dimensional texture model of the target object, these image training samples belong to the same type as the target object and have high fidelity. In this way, compared with the image training samples captured from the Internet, the sample processing process can be simplified, thereby reducing the problem of sample quality degradation caused by manual operations during the sample processing process, which is beneficial to the subsequent training of the deep learning network.

在通过上述方式基于目标对象的三维纹理模型构建完样本库后,可以采用这些样本对深度学习网络进行训练,训练好的深度学习网络用来进行人脸、车辆、动作等识别。由于通过三维纹理模型生成的二维图像样本更接近实物,且节省抓拍过程,因此,训练成本更低,且训练出的深度学习网络识别的准确率更高。After the sample library is constructed based on the 3D texture model of the target object in the above manner, these samples can be used to train the deep learning network, and the trained deep learning network can be used to recognize faces, vehicles, and actions. Since the two-dimensional image samples generated by the three-dimensional texture model are closer to the real object, and the capture process is saved, the training cost is lower, and the trained deep learning network has a higher recognition accuracy.

图7是本申请实施例提供的一种图像训练样本生成装置的结构示意图,该图像训练样本生成装置可以由软件、硬件或者两者的结合实现成为计算机设备的部分或者全部。请参考图7,该装置包括:获取模块701、变换模块702和生成模块703。7 is a schematic structural diagram of an image training sample generating apparatus provided by an embodiment of the present application. The image training sample generating apparatus may be implemented as part or all of computer equipment by software, hardware, or a combination of the two. Referring to FIG. 7 , the apparatus includes: an acquisition module 701 , a transformation module 702 and a generation module 703 .

获取模块701,用于获取目标对象的三维纹理模型;an acquisition module 701, configured to acquire a three-dimensional texture model of a target object;

变换模块702,用于对三维纹理模型进行模型变换,得到多个三维变换模型,模型变换包括模型形变和纹理变换中的至少一种;A transformation module 702, configured to perform model transformation on the three-dimensional texture model to obtain multiple three-dimensional transformation models, where the model transformation includes at least one of model deformation and texture transformation;

生成模块703,用于生成多个三维变换模型中每个三维变换模型对应的一个或多个二维图像,将生成的二维图像作为图像训练样本。The generating module 703 is configured to generate one or more 2D images corresponding to each 3D transformation model in the multiple 3D transformation models, and use the generated 2D images as image training samples.

可选地,获取模块701包括:Optionally, the obtaining module 701 includes:

创建子模块,用于创建目标对象的三维模型;Create a submodule for creating a 3D model of the target object;

映射子模块,用于根据目标对象的纹理,对三维模型进行纹理映射,得到三维纹理模型。The mapping sub-module is used to perform texture mapping on the 3D model according to the texture of the target object to obtain a 3D texture model.

可选地,当模型变换包括纹理变换时,变换模块702包括:Optionally, when the model transformation includes texture transformation, the transformation module 702 includes:

语义分��子模块,用于对三维纹理模型进行语义分割,得到多个局部特征区域,多个局部特征区域中的每个局部特征区域对应一个语义;The semantic segmentation sub-module is used to perform semantic segmentation on the three-dimensional texture model to obtain multiple local feature regions, and each local feature region in the multiple local feature regions corresponds to a semantic;

第一获取子模块,用于根据多个局部特征区域对应的语义,从存储的多个纹理素材中,获取每个局部特征区域对应的多个目标纹理素材;The first acquisition sub-module is configured to acquire multiple target texture materials corresponding to each local feature region from the stored multiple texture materials according to the semantics corresponding to the multiple local feature regions;

变换子模块,用于根据多个局部特征区域分别对应的多个目标纹理素材,对三维纹理模型进行纹理变换,得到多个三维变换模型。The transformation sub-module is used for performing texture transformation on the 3D texture model according to the multiple target texture materials corresponding to the multiple local feature regions respectively to obtain multiple 3D transformation models.

可选地,当模型变换包括模型形变时,变换模块702包括:Optionally, when the model transformation includes model deformation, the transformation module 702 includes:

第二获取子模块,用于获取多组结构编辑参数;The second acquisition sub-module is used to acquire multiple groups of structure editing parameters;

编辑子模块,用于根据多组结构编辑参数,分别对三维纹理模型的几何结构进行编辑,得到多个三维变换模型。The editing sub-module is used to edit the geometric structure of the 3D texture model according to multiple sets of structural editing parameters to obtain multiple 3D transformation models.

可选地,生成模块703包括:Optionally, the generating module 703 includes:

第三获取子模块,用于获取参考相机参数,参考相机参数是指创建三维纹理模型时所采用的相机参数;The third acquisition sub-module is used to acquire reference camera parameters, and the reference camera parameters refer to the camera parameters used when creating the 3D texture model;

投影子模块,用于根据参考相机参数,从一个或多个不同的视角方向,对每个三维变换模型进行投影,得到相应三维变换模型对应的一个或多个二维图像。The projection sub-module is used to project each 3D transformation model from one or more different viewing angles according to the reference camera parameters to obtain one or more 2D images corresponding to the corresponding 3D transformation model.

在本申请实施例中,通过对获取的目标对象的三维纹理模型进行模型变换,可以得到多个三维变换模型,再生成每个三维变换模型对应的一个或多个二维图像,这样,可以得到大量的与目标对象类似的图像训练样本。也即是,本申请提供的方案可以快速地自动生成大量满足需求的图像训练样本,相比于实际相机采集样本,节省了设备投入、人力成本和时间成本,在相同时间内可以产生数万倍甚至更多的样本。并且由于本方案中的图像训练样本是根据目标对象的三维纹理模型得到的,因此,这些图像训练样本与目标对象属于同一类型且逼真度较高。这样,相比于从互联网上抓取的图像训练样本,可以简化样本处理过程,从而减轻在样本处理过程中由于人工操作所导致的样本质量下降的问题,有利于后续对深度学习网络的训练。In the embodiment of the present application, by performing model transformation on the acquired 3D texture model of the target object, multiple 3D transformation models can be obtained, and then one or more 2D images corresponding to each 3D transformation model can be generated. In this way, one can obtain A large number of training samples of images similar to the target object. That is, the solution provided in this application can quickly and automatically generate a large number of image training samples that meet the needs. Compared with the actual camera collection samples, it saves equipment investment, labor costs and time costs, and can generate tens of thousands of times in the same time. even more samples. And since the image training samples in this solution are obtained according to the three-dimensional texture model of the target object, these image training samples belong to the same type as the target object and have high fidelity. In this way, compared with the image training samples captured from the Internet, the sample processing process can be simplified, thereby reducing the problem of sample quality degradation caused by manual operations during the sample processing process, which is beneficial to the subsequent training of the deep learning network.

需要说明的是:上述实施例提供的图像训练样本生成装置在生成图像训练样本时,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将装置的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。另外,上述实施例提供的图像训练样本生成装置与图像训练样本生成方法实施例属于同一构思,其具体实现过程详见方法实施例,这里不再赘述。It should be noted that when the image training sample generating apparatus provided in the above embodiment generates image training samples, only the division of the above functional modules is used as an example. Module completion means dividing the internal structure of the device into different functional modules to complete all or part of the functions described above. In addition, the image training sample generating apparatus provided in the above embodiments and the image training sample generating method embodiments belong to the same concept, and the specific implementation process thereof is detailed in the method embodiments, which will not be repeated here.

图8是本申请实施例提供的一种计算机设备800的结构框图。该计算机设备800可以是智能手机、平板电��、笔记本电脑或台式电脑等。FIG. 8 is a structural block diagram of a computer device 800 provided by an embodiment of the present application. The computer device 800 may be a smart phone, a tablet computer, a notebook computer or a desktop computer, and the like.

通常,计算机设备800包括有:处理器801和存储器802。Generally, computer device 800 includes: processor 801 and memory 802 .

处理器801可以包括一个或多个处理核心,比如4核心处理器、8核心处理器等。处理器801可以采用DSP(Digital Signal Processing,数字信号处理)、FPGA(Field-Programmable Gate Array,现场可编程门阵列)、PLA(Programmable Logic Array,可编程逻辑阵列)中的至少一种硬件形式来实现。处理器801也可以包括主处理器和协处理器,主处理器是用于对在唤醒状态下的数据进行处理的处理器,也称CPU(Central ProcessingUnit,中央处理器);协处理器是用于对在待机状态下的数据进行处理的低功耗处理器。在一些实施例中,处理器801可以在集成有GPU(Graphics Processing Unit,图像处理器),GPU用于负责显示屏所需要显示的内容的渲染和绘制。一些实施例中,处理器801还可以包括AI(Artificial Intelligence,人工智能)处理器,该AI处理器用于处理有关机器学习的计算操作。The processor 801 may include one or more processing cores, such as a 4-core processor, an 8-core processor, and the like. The processor 801 may adopt at least one hardware form among DSP (Digital Signal Processing, digital signal processing), FPGA (Field-Programmable Gate Array, field programmable gate array), PLA (Programmable Logic Array, programmable logic array) accomplish. The processor 801 may also include a main processor and a coprocessor. The main processor is a processor used to process data in a wake-up state, also called a CPU (Central Processing Unit, central processing unit); A low-power processor for processing data in a standby state. In some embodiments, the processor 801 may be integrated with a GPU (Graphics Processing Unit, image processor), and the GPU is used for rendering and drawing the content that needs to be displayed on the display screen. In some embodiments, the processor 801 may further include an AI (Artificial Intelligence, artificial intelligence) processor, where the AI processor is used to process computing operations related to machine learning.

存储器802可以包括一个或多个计算机可读存储介质,该计算机可读存储介质可以是非暂态的。存储器802还可包括高速随机存取存储器,以及非易失性存储器,比如一个或多个磁盘存储设备、闪存存储设备。在一些实施例中,存储器802中的非暂态的计算机可读存储介质用于存储至少一个指令,该至少一个指令用于被处理器801所执行以��现本申请中方法实施例提供的图像训练样本生成方法。Memory 802 may include one or more computer-readable storage media, which may be non-transitory. Memory 802 may also include high-speed random access memory, as well as non-volatile memory, such as one or more disk storage devices, flash storage devices. In some embodiments, a non-transitory computer-readable storage medium in the memory 802 is used to store at least one instruction, and the at least one instruction is used to be executed by the processor 801 to implement the image training provided by the method embodiments in this application. Sample generation method.

在一些实施例中,计算机设备800还可选包括有:外围设备接口803和至少一个外围设备。处理器801、存储器802和外围设备接口803之间可以通过总线或信号线相连。各个外围设备可以通过总线、信号线或电路板与外围设备接口803相连。具体地,外围设备包括:射频电路804、触摸显示屏805、摄像头806、音频电路807、定位组件808和电源809中的至少一种。In some embodiments, the computer device 800 may also optionally include: a peripheral device interface 803 and at least one peripheral device. The processor 801, the memory 802 and the peripheral device interface 803 may be connected by a bus or a signal line. Each peripheral device can be connected to the peripheral device interface 803 through a bus, a signal line or a circuit board. Specifically, the peripheral device includes: at least one of a radio frequency circuit 804 , a touch display screen 805 , a camera 806 , an audio circuit 807 , a positioning component 808 and a power supply 809 .

外围设备接口803可被用于将I/O(Input/Output,输入/输出)相关的至少一个外围设备连接到处理器801和存储器802。在一些实施例中,处理器801、存储器802和外围设备接口803被集成在同一芯片或电路板上;在一些其他实施例中,处理器801、存储器802和外围设备接口803中的任意一个或两个可以在单独的芯片或电路板上实现,本实施例对此不加以限定。The peripheral device interface 803 may be used to connect at least one peripheral device related to I/O (Input/Output) to the processor 801 and the memory 802 . In some embodiments, processor 801, memory 802, and peripherals interface 803 are integrated on the same chip or circuit board; in some other embodiments, any one of processor 801, memory 802, and peripherals interface 803 or The two can be implemented on a separate chip or circuit board, which is not limited in this embodiment.

射频电路804用于接收和发射RF(Radio Frequency,射频)信号,也称电磁信号。射频电路804通过电磁信号与通信网络以及其他通信设备进行通信。射频电路804将电信号转换为电磁信号进行发送,或者,将接收到的电磁信号转换为电信号。可选地,射频电路804包括:天线系统、RF收发器、一个或多个放大器、���谐器、振荡器、数字信号处理器、编解码芯片组、用户身份模块卡等等。射频电路804可以通过至少一种������通信协议来与其它计算机设备进行通信。该无线通信协议包括但不限于:万维网、城域网、内联网、各代移动通信网络(2G、3G、4G及5G)、无线局域网和/或WiFi(Wireless Fidelity,无线保真)网络。在一些实施例中,射频电路804还可以包括NFC(Near Field Communication,近距离无线通信)有关的电路,本申请对此不加以限定。The radio frequency circuit 804 is used for receiving and transmitting RF (Radio Frequency, radio frequency) signals, also called electromagnetic signals. The radio frequency circuit 804 communicates with the communication network and other communication devices via electromagnetic signals. The radio frequency circuit 804 converts electrical signals into electromagnetic signals for transmission, or converts received electromagnetic signals into electrical signals. Optionally, the radio frequency circuit 804 includes an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, a subscriber identity module card, and the like. Radio frequency circuitry 804 may communicate with other computer devices through at least one wireless communication protocol. The wireless communication protocol includes but is not limited to: World Wide Web, Metropolitan Area Network, Intranet, various generations of mobile communication networks (2G, 3G, 4G and 5G), wireless local area network and/or WiFi (Wireless Fidelity, Wireless Fidelity) network. In some embodiments, the radio frequency circuit 804 may further include a circuit related to NFC (Near Field Communication, short-range wireless communication), which is not limited in this application.

显示屏805用于显示UI(User Interface,用户界面)。该UI可以包括图形、文本、图标、视频及其它们的任意组合。当显示屏805是触摸显示屏时,显示屏805还具有采集在显示屏805的表面或表面上方的触摸信号的能力。该触摸信号可以作为控制信号输入至处理器801进行处理。此时,显示屏805还可以用于提供虚拟按钮和/或虚拟键盘,也称软按钮和/或软键盘。在一些实施例中,显示屏805可以为一个设置于计算机设备800的前面板;在另一些实施例中,显示屏805可以为至少两个分别设置在计算机设备800的不同表面或呈折叠设计;在其他一些实施例中,显示屏805可以是柔性显示屏,设置在计算机设备800的弯曲表面上或折叠面上。甚至,显示屏805还可以设置成非矩��的不规则图形,也即异形屏。显示屏805可以采用LCD(Liquid Crystal Display,液晶显示屏)、OLED(Organic Light-EmittingDiode,有机发光二极管)等材质制备。The display screen 805 is used to display a UI (User Interface). The UI can include graphics, text, icons, video, and any combination thereof. When the display screen 805 is a touch display screen, the display screen 805 also has the ability to acquire touch signals on or above the surface of the display screen 805 . The touch signal can be input to the processor 801 as a control signal for processing. At this time, the display screen 805 may also be used to provide virtual buttons and/or virtual keyboards, also referred to as soft buttons and/or soft keyboards. In some embodiments, the display screen 805 may be one disposed on the front panel of the computer device 800; in other embodiments, the display screen 805 may be at least two disposed on different surfaces of the computer device 800 or in a folded design; In other embodiments, display screen 805 may be a flexible display screen disposed on a curved or folded surface of computer device 800 . Even, the display screen 805 can also be set as a non-rectangular irregular figure, that is, a special-shaped screen. The display screen 805 can be made of materials such as LCD (Liquid Crystal Display, liquid crystal display), OLED (Organic Light-Emitting Diode, organic light emitting diode).

摄像头组件806用于采集图像或视频。可选地,摄像头组件806包括前置摄像头和后置摄像头。通常,前置摄像头设置在计算机设备的前面板,后置摄像头设置在计算机设备的背面。在一些实施例中,后置摄像头为至少两个,分别为主摄像头、景深摄像头、广角摄像头、长焦摄像头中的任意一种,以实现主摄像头和景深摄像头融合实现背景虚化功能、主摄像头和广角摄像头融合实现全景拍摄以及VR(Virtual Reality,虚拟现实)拍摄功能或者其它融合拍摄功能。在一些实施例中,摄像头组件806还可以包括闪光灯。闪光灯可以是单色温闪光灯,也可以是双色温闪光灯。双色温闪光灯是指暖光闪光灯和冷光闪光灯的组合,可以用于不同色温下的光线补偿。The camera assembly 806 is used to capture images or video. Optionally, the camera assembly 806 includes a front camera and a rear camera. Usually, the front camera is arranged on the front panel of the computer device, and the rear camera is arranged on the back of the computer device. In some embodiments, there are at least two rear cameras, which are any one of a main camera, a depth-of-field camera, a wide-angle camera, and a telephoto camera, so as to realize the fusion of the main camera and the depth-of-field camera to realize the background blur function, the main camera It is integrated with the wide-angle camera to achieve panoramic shooting and VR (Virtual Reality, virtual reality) shooting functions or other integrated shooting functions. In some embodiments, camera assembly 806 may also include a flash. The flash can be a single color temperature flash or a dual color temperature flash. Dual color temperature flash refers to the combination of warm light flash and cold light flash, which can be used for light compensation under different color temperatures.

���频电路807可以包括麦克风和扬声器。麦克风用于采集用户及环境的声波,并将声波转换为电信号输入至处理器801进行处理,或者输入至射频电路804以实现语音通信。出于立体声采集或降噪的目的,麦克风可以为多个,分别设置在计算机设备800的不同部位。麦克风还可以是阵列麦克风或全向采集型麦克风。扬声器则用于将来自处理器801或射频电路804的电信号转换为声波。扬声器可以是传统的薄膜扬声器,也可以是压电陶瓷扬声器。当扬声器是压电陶瓷扬声器时,不仅可以将电信号转换为人类可听见的声波,也可以将电信号转换为人类听不见的声波以进行测距等用途。在一些实施例中,音频电路807还可以包括耳机插孔。Audio circuitry 807 may include a microphone and speakers. The microphone is used to collect the sound waves of the user and the environment, convert the sound waves into electrical signals, and input them to the processor 801 for processing, or to the radio frequency circuit 804 to realize voice communication. For the purpose of stereo acquisition or noise reduction, there may be multiple microphones, which are respectively disposed in different parts of the computer device 800 . The microphone may also be an array microphone or an omnidirectional collection microphone. The speaker is used to convert the electrical signal from the processor 801 or the radio frequency circuit 804 into sound waves. The loudspeaker can be a traditional thin-film loudspeaker or a piezoelectric ceramic loudspeaker. When the speaker is a piezoelectric ceramic speaker, it can not only convert electrical signals into sound waves audible to humans, but also convert electrical signals into sound waves inaudible to humans for distance measurement and other purposes. In some embodiments, audio circuitry 807 may also include a headphone jack.

定位组件808用于定位计算机设备800的当前地理位置,以实现导航或LBS(Location Based Service,基于位置的服务)。定位组件808可以是基于美国的GPS(GlobalPositioning System,全球定位系统)、中国的北斗系统或俄罗斯的伽利略系统的定位组件。The positioning component 808 is used to locate the current geographic location of the computer device 800 to implement navigation or LBS (Location Based Service). The positioning component 808 may be a positioning component based on the GPS (Global Positioning System, global positioning system) of the United States, the Beidou system of China, or the Galileo system of Russia.

电源809用于为计算机设备800中的各个组件进行供电。电源809可以是交流电、直流电、一次性电池或可充电电池。当电源809包括可充电电池时,该可充电电池可以是有线充电电池或无线充电电池。有线充电电池是通过有线线路充电的电池,无线充电电池是通过无线线圈充电的电池。该可充电电池还可以用于支持快充技术。Power supply 809 is used to power various components in computer device 800 . The power source 809 may be alternating current, direct current, disposable batteries or rechargeable batteries. When the power source 809 includes a rechargeable battery, the rechargeable battery may be a wired rechargeable battery or a wireless rechargeable battery. Wired rechargeable batteries are batteries that are charged through wired lines, and wireless rechargeable batteries are batteries that are charged through wireless coils. The rechargeable battery can also be used to support fast charging technology.

在一些实施例中,计算机设备800还包括有一个或多个传感器810。该一个或多个传感器810包括但不限于:加速度传感器811、陀螺仪传感器812、压力传感器813、指纹传感器814、光学传感器815以及接近传感器816。In some embodiments, computer device 800 also includes one or more sensors 810 . The one or more sensors 810 include, but are not limited to, an acceleration sensor 811 , a gyro sensor 812 , a pressure sensor 813 , a fingerprint sensor 814 , an optical sensor 815 , and a proximity sensor 816 .

加速度传感器811可以检测以计算机设备800建立的坐标系的三个坐标轴上的加速度大小。比如,加速度传感器811可以用于检测重力加速度在三个坐标轴上的分量。处理器801可以根据加速度传感器811采集的重力加速度信号,控制触摸显示屏805以横向视图或纵向视图进行用户界面的显示。加速度传感器811还可以用于游戏或者用户的运动数据的采集。The acceleration sensor 811 can detect the magnitude of acceleration on the three coordinate axes of the coordinate system established by the computer device 800 . For example, the acceleration sensor 811 can be used to detect the components of the gravitational acceleration on the three coordinate axes. The processor 801 can control the touch display screen 805 to display the user interface in a landscape view or a portrait view according to the gravitational acceleration signal collected by the acceleration sensor 811 . The acceleration sensor 811 can also be used for game or user movement data collection.

陀螺仪传感器812可以检测计算机设备800的机体方向及转动角度,陀螺仪传感器812可以与加速度传感器811协同采集用户对计算机设备800的3D动作。处理器801根据陀螺仪传感器812采集的数据,可以实现如下功能:动作感应(比如根据用户的倾斜操作来改变UI)、拍摄时的图像稳定、游戏控制以及惯性导航。The gyroscope sensor 812 can detect the body direction and rotation angle of the computer device 800 , and the gyroscope sensor 812 can cooperate with the acceleration sensor 811 to collect the 3D actions of the user on the computer device 800 . The processor 801 can implement the following functions according to the data collected by the gyroscope sensor 812 : motion sensing (such as changing the UI according to the user's tilt operation), image stabilization during shooting, game control, and inertial navigation.

压力传感器813可以设置在计算机设备800的侧边框和/或触摸显示屏805的下层。当压力传感器813设置在计算机设备800的侧边框时,可以检测用户对计算机设备800的握持信号,由处理器801根据压力传感器813采集的握持信号进行左右手识别或快捷操作。当压力传感器813设置在触摸显示屏805的下层时,由处理器801根据用户对触摸显示屏805的压力操作,实现对UI界面上的可操作性控件进行控制。可操作性控件包括按钮控件、滚动条控件、图标控件、菜单控件中的至少一种。The pressure sensor 813 may be disposed on the side frame of the computer device 800 and/or on the lower layer of the touch display screen 805 . When the pressure sensor 813 is disposed on the side frame of the computer device 800 , the user's holding signal of the computer device 800 can be detected, and the processor 801 can perform left and right hand identification or shortcut operations according to the holding signal collected by the pressure sensor 813 . When the pressure sensor 813 is disposed on the lower layer of the touch display screen 805 , the processor 801 controls the operability controls on the UI interface according to the user's pressure operation on the touch display screen 805 . The operability controls include at least one of button controls, scroll bar controls, icon controls, and menu controls.

指纹传感器814用于采集用户的指纹,由处理器801根据指纹传感器814采集到的指纹识别用户的身份,或者,由指纹传感器814根据采集到的指纹识别用户的身份。在识别出用户的身份为可信身份时,由处理器801授权该用户执行相关的敏感操作,该敏感操作包括解锁屏幕、查看加密信息、下载软件、支付及更改设置等。指纹传感器814可以被设置计算机设备800的正面、背面或侧面。当计算机设备800上设置有物理按键或厂商Logo时,指纹传感器814可以与物理按键或厂商Logo集成在一起。The fingerprint sensor 814 is used to collect the user's fingerprint, and the processor 801 identifies the user's identity according to the fingerprint collected by the fingerprint sensor 814 , or the fingerprint sensor 814 identifies the user's identity according to the collected fingerprint. When the user's identity is identified as a trusted identity, the processor 801 authorizes the user to perform related sensitive operations, including unlocking the screen, viewing encrypted information, downloading software, making payments, and changing settings. Fingerprint sensor 814 may be provided on the front, back, or side of computer device 800 . When the computer device 800 is provided with physical buttons or a manufacturer's logo, the fingerprint sensor 814 can be integrated with the physical buttons or the manufacturer's logo.

光学传感器815用于采集环境光强度。在一个实施例中,处理器801可以根据光学传感器815采集的环境光强度,控制触摸显示屏805的显示亮度。具体地,当环境光强度较高时,调高触摸显示屏805的显示亮度;当环境光强度较低时,调低触摸显示屏805的显示亮度。在另一个实施例中,处理器801还可以根据光学传感器815采集的环境光强度,动态调整摄像头组件806的拍摄参数。Optical sensor 815 is used to collect ambient light intensity. In one embodiment, the processor 801 may control the display brightness of the touch display screen 805 according to the ambient light intensity collected by the optical sensor 815 . Specifically, when the ambient light intensity is high, the display brightness of the touch display screen 805 is increased; when the ambient light intensity is low, the display brightness of the touch display screen 805 is decreased. In another embodiment, the processor 801 may also dynamically adjust the shooting parameters of the camera assembly 806 according to the ambient light intensity collected by the optical sensor 815 .

接近传感器816,也称距离传感器,通常设置在计算机设备800的前面板。接近传感器816用于采集用户与计算机设备800的正面之间的距离。在一个实施例中,当接近传感器816检测到用户与计算机设备800的正面之间的距离逐渐变小时,由处理器801控制触摸显示屏805从亮屏状态切换为息屏状态;当接近传感器816检测到用户与计算机设备800的正面之间的距离逐渐变大时,由处理器801控制触摸显示屏805从息屏状态切换为亮屏状态。Proximity sensor 816 , also referred to as a distance sensor, is typically provided on the front panel of computer device 800 . Proximity sensor 816 is used to collect the distance between the user and the front of computer device 800 . In one embodiment, when the proximity sensor 816 detects that the distance between the user and the front of the computer device 800 gradually decreases, the processor 801 controls the touch display screen 805 to switch from the bright screen state to the off screen state; when the proximity sensor 816 When it is detected that the distance between the user and the front of the computer device 800 gradually increases, the processor 801 controls the touch display screen 805 to switch from the off-screen state to the bright-screen state.

本领域技术人员可以理解,图8中示出的结构并不构成对计算机设备800的限定,可以包括比图示更多或更少的组件,或者组合某些组件,或者采用不同的组件布置。Those skilled in the art can understand that the structure shown in FIG. 8 does not constitute a limitation to the computer device 800, and may include more or less components than the one shown, or combine some components, or adopt different component arrangements.

在一些实施例中,还提供了一种计算机可读存储介质,该存储介质内存储有计算机程序,所述计算机程序被处理器执行时实现上述实施例中图像训练样本生成方法的步骤。例如,所述计算机可读存储介质可以是ROM、RAM、CD-ROM、磁带、软盘和光数据存储设备等。In some embodiments, a computer-readable storage medium is also provided, and a computer program is stored in the storage medium, and when the computer program is executed by a processor, the steps of the image training sample generation method in the above-mentioned embodiments are implemented. For example, the computer-readable storage medium may be ROM, RAM, CD-ROM, magnetic tape, floppy disk, optical data storage device, and the like.

值得注意的是,本申请提到的计算机可读存储介质可以为非易失性存储介质,换句话说,可以是非瞬时性存储介质。It should be noted that the computer-readable storage medium mentioned in this application may be a non-volatile storage medium, in other words, may be a non-transitory storage medium.

应当理解的是,实现上述实施例的全部或部分步骤可以通过软件、硬件、固件或者其任意结合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。所述计算机程序产品包括一个或多个计算机指令。所述计算机指令可以存储在上述计算机可读存储介质中。It should be understood that, all or part of the steps of implementing the above embodiments may be implemented by software, hardware, firmware or any combination thereof. When implemented in software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. The computer instructions may be stored in the computer-readable storage medium described above.

也即是,在一些实施例中,还提供了一种������指令的计算机程序产品,当其在计算机上运行时,使得计算机执行上述所述的图像训练样本生成方法的步骤。That is, in some embodiments, there is also provided a computer program product containing instructions, which, when executed on a computer, cause the computer to perform the steps of the above-described image training sample generation method.

以上所述为本申请提供的实施例,并不用以限制本申请,凡在本申请的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本申请的保护范围之内。The above-mentioned examples provided for this application are not intended to limit this application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of this application shall be included in the protection scope of this application. Inside.

Claims (10)

1. An image training sample generation method, characterized in that the method comprises:
acquiring a three-dimensional texture model of a target object;
performing model transformation on the three-dimensional texture model to obtain a plurality of three-dimensional transformation models, wherein the model transformation comprises at least one of model deformation and texture transformation;
and generating one or more two-dimensional images corresponding to each three-dimensional transformation model in the plurality of three-dimensional transformation models, and taking the generated two-dimensional images as image training samples.
2. The method of claim 1, wherein obtaining the three-dimensional texture model of the target object comprises:
creating a three-dimensional model of the target object;
and performing texture mapping on the three-dimensional model according to the texture of the target object to obtain the three-dimensional texture model.
3. The method of claim 1, wherein when the model transformation comprises the texture transformation, the model transforming the three-dimensional texture model to obtain a plurality of three-dimensional transformation models comprises:
performing semantic segmentation on the three-dimensional texture model to obtain a plurality of local feature regions, wherein each local feature region in the plurality of local feature regions corresponds to a semantic;
according to the semantics corresponding to the local feature regions, acquiring a plurality of target texture materials corresponding to each local feature region from a plurality of stored texture materials;
and performing texture transformation on the three-dimensional texture model according to a plurality of target texture materials corresponding to the plurality of local characteristic regions respectively to obtain a plurality of three-dimensional transformation models.
4. The method of claim 1, wherein when the model transformation comprises the model deformation, the model transforming the three-dimensional texture model to obtain a plurality of three-dimensional transformation models comprises:
acquiring a plurality of groups of structure editing parameters;
and editing the geometric structures of the three-dimensional texture models respectively according to the multiple groups of structure editing parameters to obtain the multiple three-dimensional transformation models.
5. The method of any of claims 1-4, wherein generating one or more two-dimensional images corresponding to each of the plurality of three-dimensional transformation models comprises:
acquiring reference camera parameters;
and projecting each three-dimensional transformation model from one or more different view angle directions according to the reference camera parameters to obtain one or more two-dimensional images corresponding to the corresponding three-dimensional transformation models.
6. An image training sample generation apparatus, characterized in that the apparatus comprises:
the acquisition module is used for acquiring a three-dimensional texture model of the target object;
the transformation module is used for carrying out model transformation on the three-dimensional texture model to obtain a plurality of three-dimensional transformation models, and the model transformation comprises at least one of model deformation and texture transformation;
and the generating module is used for generating one or more two-dimensional images corresponding to each three-dimensional transformation model in the plurality of three-dimensional transformation models and taking the generated two-dimensional images as image training samples.
7. The apparatus of claim 6, wherein the obtaining module comprises:
a creating submodule for creating a three-dimensional model of the target object;
and the mapping submodule is used for performing texture mapping on the three-dimensional model according to the texture of the target object to obtain the three-dimensional texture model.
8. The apparatus of claim 6, wherein when the model transform comprises the texture transform, the transform module comprises:
the semantic segmentation submodule is used for performing semantic segmentation on the three-dimensional texture model to obtain a plurality of local feature areas, and each local feature area in the plurality of local feature areas corresponds to a semantic;
the first obtaining submodule is used for obtaining a plurality of target texture materials corresponding to each local characteristic region from a plurality of stored texture materials according to the semantics corresponding to the local characteristic regions;
and the transformation submodule is used for carrying out texture transformation on the three-dimensional texture model according to a plurality of target texture materials respectively corresponding to the local feature areas to obtain a plurality of three-dimensional transformation models.
9. The apparatus of claim 6, wherein when the model transformation comprises the model deformation, the transformation module comprises:
the second obtaining submodule is used for obtaining a plurality of groups of structure editing parameters;
and the editing submodule is used for respectively editing the geometric structures of the three-dimensional texture models according to the multiple groups of structure editing parameters to obtain the multiple three-dimensional transformation models.
10. The apparatus according to any one of claims 6-9, wherein the generating means comprises:
the third acquisition sub-module is used for acquiring reference camera parameters;
and the projection submodule is used for projecting each three-dimensional transformation model from one or more different view angle directions according to the reference camera parameters to obtain one or more two-dimensional images corresponding to the corresponding three-dimensional transformation models.
CN202010543613.5A 2020-06-15 2020-06-15 Image training sample generation method and device Active CN111680758B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010543613.5A CN111680758B (en) 2020-06-15 2020-06-15 Image training sample generation method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010543613.5A CN111680758B (en) 2020-06-15 2020-06-15 Image training sample generation method and device

Publications (2)

Publication Number Publication Date
CN111680758A true CN111680758A (en) 2020-09-18
CN111680758B CN111680758B (en) 2024-03-05

Family

ID=72435820

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010543613.5A Active CN111680758B (en) 2020-06-15 2020-06-15 Image training sample generation method and device

Country Status (1)

Country Link
CN (1) CN111680758B (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112232385A (en) * 2020-09-27 2021-01-15 北京五八信息技术有限公司 Image processing method and device
CN113240784A (en) * 2021-05-25 2021-08-10 北京达佳互联信息技术有限公司 Image processing method, device, terminal and storage medium
CN113658345A (en) * 2021-08-18 2021-11-16 杭州海康威视数字技术股份有限公司 A kind of sample labeling method and device
CN114067041A (en) * 2022-01-14 2022-02-18 深圳大学 Material generation method and device of three-dimensional model, computer equipment and storage medium
CN114327718A (en) * 2021-12-27 2022-04-12 北京百度网讯科技有限公司 Interface display method and device, equipment and medium
CN116977790A (en) * 2023-07-31 2023-10-31 联想(北京)有限公司 An image data set construction method and device

Citations (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002165757A (en) * 2000-11-30 2002-06-11 Olympus Optical Co Ltd Diagnostic supporting system
CN101283911A (en) * 2008-06-05 2008-10-15 华北电力大学 A Four-dimensional Reconstruction Method of Coronary Artery Axis
CN101346743A (en) * 2005-12-29 2009-01-14 卡尔斯特里姆保健公司 Medical diagnosis across time and modality
CN102737480A (en) * 2012-07-09 2012-10-17 广州市浩云安防科技股份有限公司 Abnormal voice monitoring system and method based on intelligent video
CA2889217A1 (en) * 2015-04-23 2016-10-23 Wu QIU Method for determining volume of irregulary-shaped space
CN106548679A (en) * 2016-02-03 2017-03-29 北京易驾佳信息科技有限公司 A kind of intelligent driving training system
CN107403201A (en) * 2017-08-11 2017-11-28 强深智能医疗科技(昆山)有限公司 Tumour radiotherapy target area and jeopardize that organ is intelligent, automation delineation method
CN109145788A (en) * 2018-08-08 2019-01-04 北京云舶在线科技有限公司 Attitude data method for catching and system based on video
WO2019019019A1 (en) * 2017-07-25 2019-01-31 深圳前海达闼云端智能科技有限公司 Training data generation method and generation apparatus, and image semantics segmentation method therefor
US20190138786A1 (en) * 2017-06-06 2019-05-09 Sightline Innovation Inc. System and method for identification and classification of objects
CN109829969A (en) * 2018-12-27 2019-05-31 北京奇艺世纪科技有限公司 A kind of data capture method, device and storage medium
WO2020010979A1 (en) * 2018-07-10 2020-01-16 腾讯科技(深圳)有限公司 Method and apparatus for training model for recognizing key points of hand, and method and apparatus for recognizing key points of hand
CN110837858A (en) * 2019-11-01 2020-02-25 腾讯科技(深圳)有限公司 Network model training method and device, computer equipment and storage medium
CN110852332A (en) * 2019-10-29 2020-02-28 腾讯科技(深圳)有限公司 Method, device, storage medium and electronic device for generating training samples

Patent Citations (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002165757A (en) * 2000-11-30 2002-06-11 Olympus Optical Co Ltd Diagnostic supporting system
CN101346743A (en) * 2005-12-29 2009-01-14 卡尔斯特里姆保健公司 Medical diagnosis across time and modality
CN101283911A (en) * 2008-06-05 2008-10-15 华北电力大学 A Four-dimensional Reconstruction Method of Coronary Artery Axis
CN102737480A (en) * 2012-07-09 2012-10-17 广州市浩云安防科技股份有限公司 Abnormal voice monitoring system and method based on intelligent video
CA2889217A1 (en) * 2015-04-23 2016-10-23 Wu QIU Method for determining volume of irregulary-shaped space
CN106548679A (en) * 2016-02-03 2017-03-29 北京易驾佳信息科技有限公司 A kind of intelligent driving training system
US20190138786A1 (en) * 2017-06-06 2019-05-09 Sightline Innovation Inc. System and method for identification and classification of objects
WO2019019019A1 (en) * 2017-07-25 2019-01-31 深圳前海达闼云端智能科技有限公司 Training data generation method and generation apparatus, and image semantics segmentation method therefor
CN107403201A (en) * 2017-08-11 2017-11-28 强深智能医疗科技(昆山)有限公司 Tumour radiotherapy target area and jeopardize that organ is intelligent, automation delineation method
WO2020010979A1 (en) * 2018-07-10 2020-01-16 腾讯科技(深圳)有限公司 Method and apparatus for training model for recognizing key points of hand, and method and apparatus for recognizing key points of hand
CN109145788A (en) * 2018-08-08 2019-01-04 北京云舶在线科技有限公司 Attitude data method for catching and system based on video
CN109829969A (en) * 2018-12-27 2019-05-31 北京奇艺世纪科技有限公司 A kind of data capture method, device and storage medium
CN110852332A (en) * 2019-10-29 2020-02-28 腾讯科技(深圳)有限公司 Method, device, storage medium and electronic device for generating training samples
CN110837858A (en) * 2019-11-01 2020-02-25 腾讯科技(深圳)有限公司 Network model training method and device, computer equipment and storage medium

Non-Patent Citations (8)

* Cited by examiner, † Cited by third party
Title
MUMTAZ HUSSAIN SOOMRO*,: "Automatic Segmentation of Colorectal Cancer in 3D MRI by Combining Deep Learning and 3D Level-Set Algorithm–A Preliminary Study", 2018 IEEE 4TH MIDDLE EAST CONFERENCE ON BIOMEDICAL ENGINEERING (MECBME, 31 December 2018 (2018-12-31) *
XU YATONG(AUTHOR: "Comparative transmembrane transports of four typical lipophilic organic chemicals", BIORESOURCE TECHNOLOGY, 1 November 2010 (2010-11-01) *
YATONG XU: "Spatial-temporal Depth De-noising for Kinect based on Texture Edge-assisted Depth Classification", PROCEEDINGS OF THE 19TH INTERNATIONAL CONFERENCE ON DIGITAL SIGNAL PROCESSING 20-23 AUGUST 2014, 23 August 2014 (2014-08-23) *
YUN GE: "Expansion of 3D face sample set based on genetic algorithm", SPRINGER SCIENCE+BUSINESS MEDIA, 15 May 2012 (2012-05-15) *
刘懿;王敏;: "基于时空域3D-SIFT算子的动作识别", 华中科技大学学报(自然科学版), no. 2, 15 November 2011 (2011-11-15) *
李抵非;陈赫;冯志刚;赵科佳;刘争;高鸿营;: "一种双目立体视觉系统的校准方法", 计量学报, no. 04, 22 July 2018 (2018-07-22) *
董西伟: "基于虚拟样本图像集的多流形鉴别学习算法", 计算机应用研究, vol. 35, no. 6, 30 June 2018 (2018-06-30) *
薛峰;丁晓青;: "形状约束的三维人脸组件形变模型", 计算机应用, no. 03, 10 March 2007 (2007-03-10) *

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112232385A (en) * 2020-09-27 2021-01-15 北京五八信息技术有限公司 Image processing method and device
CN113240784A (en) * 2021-05-25 2021-08-10 北京达佳互联信息技术有限公司 Image processing method, device, terminal and storage medium
CN113240784B (en) * 2021-05-25 2024-01-02 北京达佳互联信息技术有限公司 Image processing method, device, terminal and storage medium
CN113658345A (en) * 2021-08-18 2021-11-16 杭州海康威视数字技术股份有限公司 A kind of sample labeling method and device
CN113658345B (en) * 2021-08-18 2024-12-06 杭州海康威视数字技术股份有限公司 A sample labeling method and device
CN114327718A (en) * 2021-12-27 2022-04-12 北京百度网讯科技有限公司 Interface display method and device, equipment and medium
CN114067041A (en) * 2022-01-14 2022-02-18 深圳大学 Material generation method and device of three-dimensional model, computer equipment and storage medium
CN116977790A (en) * 2023-07-31 2023-10-31 联想(北京)有限公司 An image data set construction method and device

Also Published As

Publication number Publication date
CN111680758B (en) 2024-03-05

Similar Documents

Publication Publication Date Title
US11205282B2 (en) Relocalization method and apparatus in camera pose tracking process and storage medium
US11678734B2 (en) Method for processing images and electronic device
US11436779B2 (en) Image processing method, electronic device, and storage medium
US11978219B2 (en) Method and device for determining motion information of image feature point, and task performing method and device
EP3955212A1 (en) Shadow rendering method and apparatus, computer device and storage medium
CN111680758B (en) Image training sample generation method and device
WO2020140832A1 (en) Three-dimensional facial reconstruction method and apparatus, and electronic device and storage medium
CN110555839A (en) Defect detection and identification method and device, computer equipment and storage medium
CN110599593B (en) Data synthesis method, device, equipment and storage medium
CN112308103B (en) Methods and devices for generating training samples
CN111754386B (en) Image area shielding method, device, equipment and storage medium
CN111541907A (en) Item display method, device, equipment and storage medium
CN112581358B (en) Training method of image processing model, image processing method and device
CN110335224B (en) Image processing method, image processing device, computer equipment and storage medium
CN111784841B (en) Method, device, electronic device and medium for reconstructing three-dimensional image
CN113706678A (en) Method, device and equipment for acquiring virtual image and computer readable storage medium
CN112135191A (en) Video editing method, device, terminal and storage medium
CN111325220A (en) Image generation method, device, device and storage medium
CN110675413B (en) Three-dimensional face model construction method and device, computer equipment and storage medium
WO2021027890A1 (en) License plate image generation method and device, and computer storage medium
CN112967261B (en) Image fusion method, device, equipment and storage medium
CN113763531A (en) Three-dimensional face reconstruction method and device, electronic equipment and storage medium
CN109472855A (en) A volume rendering method, device and intelligent device
CN111639639A (en) Method, device, device and storage medium for detecting text area
CN111583375B (en) Virtual picture display method, device, equipment and storage medium

Legal Events

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