CN112257731B - Virtual data set generation method and device - Google Patents

Virtual data set generation method and device Download PDF

Info

Publication number
CN112257731B
CN112257731B CN201910604847.3A CN201910604847A CN112257731B CN 112257731 B CN112257731 B CN 112257731B CN 201910604847 A CN201910604847 A CN 201910604847A CN 112257731 B CN112257731 B CN 112257731B
Authority
CN
China
Prior art keywords
card
dimensional
virtual
card number
model
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
Application number
CN201910604847.3A
Other languages
Chinese (zh)
Other versions
CN112257731A (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
Filing date
Publication date
Application filed by Hangzhou Hikvision Digital Technology Co Ltd filed Critical Hangzhou Hikvision Digital Technology Co Ltd
Priority to CN201910604847.3A priority Critical patent/CN112257731B/en
Publication of CN112257731A publication Critical patent/CN112257731A/en
Application granted granted Critical
Publication of CN112257731B publication Critical patent/CN112257731B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The application provides a method and a device for generating a virtual data set, wherein the method comprises the following steps: generating a plurality of three-dimensional virtual card models based on the real cards; rendering the plurality of three-dimensional virtual card models to obtain a plurality of different three-dimensional virtual cards; generating a picture of each three-dimensional virtual card, and forming the pictures of the plurality of different three-dimensional virtual cards into a virtual data set. By the method, training samples can be enriched, and the recognition accuracy of the trained intelligent recognition model is improved.

Description

Virtual data set generation method and device
Technical Field
The present application relates to the field of machine learning technologies, and in particular, to a method and an apparatus for generating a virtual data set.
Background
With the rapid development of artificial intelligence and machine learning technologies, big data based machine learning technologies have been widely used in various industries, wherein the number and quality of training samples have a crucial influence on the recognition effect of a trained intelligent recognition model.
In the traditional method, the training samples are collected and calibrated manually, so that more manpower and material resources are consumed, and the collected training samples have limitations on the quantity and quality due to the limitation of a plurality of factors, such as the limitation of an actual scene environment, so that the recognition effect of the trained intelligent recognition model is influenced.
Disclosure of Invention
In view of the above, the application provides a method and a device for generating a virtual data set, so as to solve the problem that the number and the quality of the acquired training samples are limited by manually acquiring and calibrating the training samples, thereby influencing the recognition effect of a trained intelligent recognition model.
According to a first aspect of an embodiment of the present application, there is provided a method for generating a virtual data set, the method including:
generating a plurality of three-dimensional virtual card models based on the real cards;
Rendering the plurality of three-dimensional virtual card models to obtain a plurality of different three-dimensional virtual cards;
Generating a picture of each three-dimensional virtual card, and forming the pictures of the plurality of different three-dimensional virtual cards into a virtual data set.
According to a second aspect of an embodiment of the present application, there is provided an apparatus for generating a virtual data set, the apparatus including:
the model generation module is used for generating a plurality of three-dimensional virtual card models based on the real cards;
the model rendering module is used for rendering the plurality of three-dimensional virtual card models to obtain a plurality of different three-dimensional virtual cards;
And the picture generation module is used for generating pictures of each three-dimensional virtual card and forming the pictures of the plurality of different three-dimensional virtual cards into a virtual data set.
According to a third aspect of embodiments of the present application, there is provided an electronic device comprising a processor, a communication interface, a memory and a communication bus;
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;
the processor is configured to execute a computer program stored on the memory, where the steps of the virtual data set generating method provided by the embodiment of the present application are implemented when the processor executes the computer program.
According to a fourth aspect of the embodiments of the present application, there is provided a computer readable storage medium having stored therein a computer program which, when executed by a processor, implements the steps of the method for generating a virtual data set provided by the embodiments of the present application.
By applying the embodiment of the application, the plurality of three-dimensional virtual card models are generated based on the real cards, the plurality of three-dimensional virtual card models are rendered to obtain the plurality of different three-dimensional virtual cards, the pictures of each three-dimensional virtual card are generated, the pictures of the plurality of different three-dimensional virtual cards form the virtual data set, and then the virtual data set and the training sample set can be used for training the intelligent recognition model together.
Drawings
FIG. 1 is a flowchart of an embodiment of a method for generating a virtual data set according to an exemplary embodiment of the present application;
FIG. 2 is an example of a three-dimensional virtual card model;
FIG. 3 is a block diagram of an embodiment of a virtual data set generating apparatus according to an exemplary embodiment of the present application;
Fig. 4 is a hardware configuration diagram of an electronic device according to an exemplary embodiment of the present application.
Detailed Description
Reference will now be made in detail to exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, the same numbers in different drawings refer to the same or similar elements, unless otherwise indicated. The implementations described in the following exemplary examples do not represent all implementations consistent with the application. Rather, they are merely examples of apparatus and methods consistent with aspects of the application as detailed in the accompanying claims.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in this specification and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used herein refers to and encompasses any or all possible combinations of one or more of the associated listed items.
It should be understood that although the terms first, second, third, etc. may be used herein to describe various information, these information should not be limited by these terms. These terms are only used to distinguish one type of information from another. For example, first information may also be referred to as second information, and similarly, second information may also be referred to as first information, without departing from the scope of the application. The word "if" as used herein may be interpreted as "at … …" or "at … …" or "in response to a determination" depending on the context.
In the traditional method, the training samples are manually collected and calibrated, so that more manpower and material resources are consumed, and the collected training samples do not have multiple properties due to the limitation of the actual scene environment. Taking bank card identification as an example, the number of issuing banks is also numerous, and for some unusual bank cards, such as foreign bank cards, the acquisition of the bank card image has a certain difficulty, so that a complete and multiple bank card image cannot be acquired by using a traditional method, and the identification effect of the trained bank card intelligent identification model is affected.
In order to solve the above problems, the present application provides a method for generating a virtual data set, in which a plurality of three-dimensional virtual cards with different card numbers are generated, each three-dimensional virtual card is photographed in a simulated virtual environment, a virtual data set is formed from photographed virtual card images, and the virtual data set is supplemented into a training sample set for training an intelligent recognition model, so that the training sample set is enriched, and the recognition accuracy of the trained intelligent recognition model is improved. The smart identification model may be a neural network for one or more card identifications, such as a neural network for identifying a bank card, a neural network for identifying an identity document, etc., without limitation.
Referring to fig. 1, a flowchart of an embodiment of a method for generating a virtual data set according to an exemplary embodiment of the present application is provided, and the method includes the following steps:
Step 101: a plurality of three-dimensional virtual card models are generated based on the real cards.
In the embodiment of the application, taking a real bank card as an example, the bank card can be firstly subjected to three-dimensional modeling on the whole to generate a three-dimensional card model of the bank card, and the three-dimensional card model has no card number; modeling the card numbers of the bank card to generate a plurality of three-dimensional card number models with different card numbers; finally, based on the positions of the card numbers on the real card, combining each three-dimensional card number model with the three-dimensional card model to obtain a plurality of three-dimensional virtual card models corresponding to the real bank card, wherein the card numbers on different three-dimensional virtual card models are different, for example, as shown in fig. 2, and are an example of the three-dimensional virtual card models.
Specifically, in an embodiment, modeling software such as 3dMax (3D Studio Max), maya, etc. may be used to model the bank card in three dimensions as a whole, so as to generate a three-dimensional card model of the bank card.
In an embodiment, the specific process of modeling the card number of the bank card and generating the three-dimensional card number model of a plurality of different card numbers may include:
Firstly, based on the card number combination rule of the real bank card, generating a plurality of different card numbers, for example, the card number combination rule of the real bank card is: the card number includes 19 digits in total, the first 5 digits of which are fixed to 12345 and the last 14 digits of which may be any of 0 to 9.
Then, based on the font format of the card number on the real bank card, the character data of each character in the card number corresponding to the font format is obtained from a preset font library, wherein the font library stores the character data of a plurality of characters corresponding to a plurality of font formats, for example, the font format of the card number on the real bank card is 'Song Ti', and the character data of each character in the card number corresponding to 'Song Ti' can be obtained from the preset font library for each generated card number.
And modeling the character data of each character in the card number corresponding to the font format based on the bulge degree of the card number on the real silver card relative to the card background, so as to obtain a three-dimensional character model of each character in the card number. For example, in practical application, the real card number on the bank card may be in the same plane as the background of the bank card, or may be raised relative to the background of the bank card, and if the real card number on the bank card is in the same plane as the background of the bank card, the height of the three-dimensional character model may be 0, and if the real card number on the bank card is in the same plane as the background of the bank card, the height of the three-dimensional character model may not be 0, and the specific height may be determined by the degree of raised of the real card number on the bank card relative to the background of the card.
And finally, combining the three-dimensional character models of the characters in the card number according to the arrangement sequence of the characters in the card number to obtain a three-dimensional card number model of the card number.
Step 102: rendering the three-dimensional virtual card models to obtain a plurality of different three-dimensional virtual cards.
In the embodiment of the application, the target texture for rendering can be determined based on the texture pattern of the real bank card, and each three-dimensional virtual card model is rendered by using the target texture to obtain the three-dimensional virtual card.
Specifically, in practical application, the texture of the card number on the bank card may be independent of the background texture of the bank card, or may be integrated with the background texture of the bank card, so in an embodiment, the target textures determined based on the real texture pattern of the bank card may be one or two. If the texture of the card number on the bank card and the background texture of the bank card are integrated, the three-dimensional virtual card model can be rendered integrally by utilizing the target texture when the three-dimensional virtual card model is rendered; if the texture of the card number on the bank card is independent of the background texture of the bank card, the three-dimensional card model and the three-dimensional card number model in the three-dimensional virtual card model can be respectively rendered by utilizing the two target textures when the three-dimensional virtual card model is rendered.
In addition, considering that in practical application, the situation that a real bank card has stains or is damaged sometimes occurs, in the embodiment of the application, the stain simulation or damage simulation can be performed on the three-dimensional virtual card.
Specifically, in an embodiment, after each three-dimensional virtual card model is rendered by using the target texture, a specified number of three-dimensional virtual card models may also be rendered by using a preset effect texture, where the effect texture may include at least one of a stain effect texture, a breakage effect texture, and a halo effect texture.
In addition, as those skilled in the art will appreciate, after each three-dimensional virtual card model is rendered, material information may be set on the three-dimensional virtual card model, which may specifically include setting diffuse reflection, refraction, metaliness, roughness, high light coefficient, and the like, which will not be described in detail in the present application.
Step 103: and generating a picture of each three-dimensional virtual card, and forming a virtual data set from the pictures of a plurality of different three-dimensional virtual cards.
In the embodiment of the application, a plurality of different virtual environments can be simulated based on a plurality of sets of preset environment data and shooting angle data, wherein the different virtual environments can have different environment data and shooting angle data, and for each three-dimensional virtual card generated in step 102, the three-dimensional virtual card is respectively shot in the plurality of different virtual environments, and the shot pictures form a virtual data set.
After the virtual data set is obtained, the virtual data set and a training sample set formed by the photographed images of the real bank card can be used for training the intelligent recognition model.
In addition, in the embodiment of the application, the corresponding relation between the three-dimensional virtual card image of each three-dimensional virtual card and the card number of each three-dimensional virtual card can be stored, so that the virtual training sample with the label can be obtained later.
In addition, it should be noted that the above description is only given by taking a bank card as an example, and in practical application, the steps may be implemented based on a real card including a card number, such as a public transport card, a membership card, and the like, which is not limited in this aspect of the present application.
According to the embodiment, the plurality of three-dimensional virtual card models are generated based on the real cards, the plurality of three-dimensional virtual card models are rendered, a plurality of different three-dimensional virtual cards are obtained, the picture of each three-dimensional virtual card is generated, the pictures of the plurality of different three-dimensional virtual cards form a virtual data set, the virtual data set and the training sample set can be used for training the intelligent recognition model, training samples can be enriched through the processing, and recognition accuracy of the trained intelligent recognition model is improved.
The application also provides an embodiment of the virtual data set generating device corresponding to the embodiment of the virtual data set generating method.
Referring to fig. 3, a block diagram of an embodiment of an apparatus for generating a virtual data set according to an exemplary embodiment of the present application may include: a model generation module 31, a model rendering module 32, and a picture generation module 33.
Wherein, the model generating module 31 can be used for generating a plurality of three-dimensional virtual card models based on the real cards;
the model rendering module 32 may be configured to render the plurality of three-dimensional virtual card models to obtain a plurality of different three-dimensional virtual cards;
The picture generation module 33 may be configured to generate a picture of each of the three-dimensional virtual cards, and form a virtual data set from the pictures of the plurality of different three-dimensional virtual cards.
In one embodiment, the model generation module 31 may include (not shown in fig. 3):
The card model generation sub-module is used for generating a three-dimensional card model based on the real card, wherein the three-dimensional card model is not provided with a card number;
The card number model generation sub-module is used for generating a plurality of different card numbers based on the card number combination rule of the real card, and generating a three-dimensional card number model of each card number based on the font format of the card number on the real card;
And the model combination sub-module is used for respectively combining each three-dimensional card number model with the three-dimensional card model based on the position of the card number on the real card to obtain a plurality of three-dimensional virtual card models corresponding to the real card, wherein the card numbers on different three-dimensional virtual card models are different.
In one embodiment, the model rendering module 32 may include (not shown in fig. 3):
A texture determination sub-module for determining a target texture for rendering based on a texture pattern of the real card;
and the texture rendering sub-module is used for rendering each three-dimensional virtual card model by utilizing the target texture.
In an embodiment, the picture generation module 33 may include (not shown in fig. 3):
The environment simulation sub-module is used for simulating a plurality of different virtual environments based on a plurality of groups of preset environment data and shooting angle data, wherein the different virtual environments have different environment data and shooting angle data;
and the shooting simulation sub-module is used for shooting the three-dimensional virtual cards under the plurality of different virtual environments respectively aiming at each three-dimensional virtual card, and forming a virtual data set from the shot pictures.
In one embodiment, the card number model generation sub-module may include (not shown in fig. 3):
the data acquisition sub-module is used for acquiring character data of each character in the card number corresponding to the font format from a preset font library based on the font format of the card number on the real card for each generated card number, wherein the font library stores character data of a plurality of characters corresponding to a plurality of font formats;
The character modeling module is used for modeling the character data of each character in the card number corresponding to the font format based on the protruding degree of the card number on the real card relative to the card background, so as to obtain a three-dimensional character model of each character in the card number;
And the character combination sub-module is used for combining the three-dimensional character models of the characters in the card number according to the arrangement sequence of the characters in the card number to obtain a three-dimensional card number model of the card number.
In an embodiment, the apparatus may further comprise (not shown in fig. 3):
And the simulation rendering module is used for rendering the specified number of three-dimensional virtual card models by utilizing preset effect textures, wherein the effect textures comprise at least one of stain effect textures, breakage effect textures and halation effect textures.
In an embodiment, the apparatus may further comprise (not shown in fig. 3):
And the storage module is used for storing the corresponding relation between the picture of each three-dimensional virtual card and the card number of each three-dimensional virtual card.
With continued reference to fig. 4, the present application also provides a computer device including a processor 401, a communication interface 402, a memory 403, and a communication bus 404.
Wherein the processor 401, the communication interface 402 and the memory 403 communicate with each other through the communication bus 404;
A memory 403 for storing a computer program;
the processor 401 is configured to execute a computer program stored in the memory 403, where the processor 401 implements the steps of the method for generating a virtual data set according to the embodiment of the present application when executing the computer program.
The present application also provides a computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of the method for generating a virtual data set provided by the embodiments of the present application. The implementation process of the functions and roles of each unit in the above device is specifically shown in the implementation process of the corresponding steps in the above method, and will not be described herein again.
For the device embodiments, reference is made to the description of the method embodiments for the relevant points, since they essentially correspond to the method embodiments. The apparatus embodiments described above are merely illustrative, wherein the elements illustrated as separate elements may or may not be physically separate, and the elements shown as elements may or may not be physical elements, may be located in one place, or may be distributed over a plurality of network elements. Some or all of the modules may be selected according to actual needs to achieve the purposes of the present application. Those of ordinary skill in the art will understand and implement the present application without undue burden.
The foregoing description of the preferred embodiments of the application is not intended to be limiting, but rather to enable any modification, equivalent replacement, improvement or the like to be made within the spirit and principles of the application.

Claims (6)

1. A method of generating a virtual dataset, the method comprising:
Generating a three-dimensional card model based on the real card, wherein the three-dimensional card model is not provided with a card number;
based on the card number combination rule of the real card, generating a plurality of different card numbers;
for each generated card number, based on the font format of the card number on the real card, acquiring character data of each character in the card number corresponding to the font format from a preset font library, wherein the font library stores character data of a plurality of characters corresponding to a plurality of font formats;
Modeling character data of each character in the card number corresponding to the font format based on the protruding degree of the card number on the real card relative to the card background to obtain a three-dimensional character model of each character in the card number;
Combining the three-dimensional character models of the characters in the card number according to the arrangement sequence of the characters in the card number to obtain a three-dimensional card number model of the card number;
based on the position of the card number on the real card, combining each three-dimensional card number model with the three-dimensional card model to obtain a plurality of three-dimensional virtual card models corresponding to the real card, wherein the card numbers on different three-dimensional virtual card models are different;
determining a target texture for rendering based on the texture style of the real card;
Rendering each three-dimensional virtual card model by utilizing the target texture;
Rendering a specified number of three-dimensional virtual card models by using preset effect textures to obtain a plurality of different three-dimensional virtual cards; the effect texture includes at least one of a stain effect texture, a break effect texture, and a halo effect texture;
Simulating a plurality of different virtual environments based on a plurality of sets of preset environment data and shooting angle data, wherein the different virtual environments have different environment data and shooting angle data;
And shooting the three-dimensional virtual card under the plurality of different virtual environments for each three-dimensional virtual card, and forming a virtual data set from the shot pictures.
2. The method according to claim 1, wherein after the capturing of the three-dimensional virtual card under the plurality of different virtual environments, respectively, for each of the three-dimensional virtual cards, the capturing of the pictures forming the virtual data set, the method further comprises:
And storing the corresponding relation between the picture of each three-dimensional virtual card and the card number of each three-dimensional virtual card.
3. An apparatus for generating a virtual data set, the apparatus comprising:
the model generation module is used for generating a three-dimensional card model based on the real card, wherein the three-dimensional card model is not provided with a card number;
based on the card number combination rule of the real card, generating a plurality of different card numbers;
for each generated card number, based on the font format of the card number on the real card, acquiring character data of each character in the card number corresponding to the font format from a preset font library, wherein the font library stores character data of a plurality of characters corresponding to a plurality of font formats;
Modeling character data of each character in the card number corresponding to the font format based on the protruding degree of the card number on the real card relative to the card background to obtain a three-dimensional character model of each character in the card number;
Combining the three-dimensional character models of the characters in the card number according to the arrangement sequence of the characters in the card number to obtain a three-dimensional card number model of the card number;
based on the position of the card number on the real card, combining each three-dimensional card number model with the three-dimensional card model to obtain a plurality of three-dimensional virtual card models corresponding to the real card, wherein the card numbers on different three-dimensional virtual card models are different;
A model rendering module for determining a target texture for rendering based on a texture style of the real card;
Rendering each three-dimensional virtual card model by utilizing the target texture;
Rendering a specified number of three-dimensional virtual card models by using preset effect textures to obtain a plurality of different three-dimensional virtual cards; the effect texture includes at least one of a stain effect texture, a break effect texture, and a halo effect texture;
The image generation module is used for simulating a plurality of different virtual environments based on a plurality of groups of preset environment data and shooting angle data, wherein the different virtual environments have different environment data and shooting angle data;
And shooting the three-dimensional virtual card under the plurality of different virtual environments for each three-dimensional virtual card, and forming a virtual data set from the shot pictures.
4. A device according to claim 3, characterized in that the device further comprises:
And the storage module is used for storing the corresponding relation between the picture of each three-dimensional virtual card and the card number of each three-dimensional virtual card.
5. An electronic device comprising a processor, a communication interface, a memory, and a communication bus;
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;
the processor is configured to execute a computer program stored on the memory, where the processor implements the steps of the method according to claim 1 or 2 when the processor executes the computer program.
6. A computer-readable storage medium, characterized in that the computer-readable storage medium has stored therein a computer program which, when executed by a processor, implements the steps of the method of claim 1 or 2.
CN201910604847.3A 2019-07-05 Virtual data set generation method and device Active CN112257731B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910604847.3A CN112257731B (en) 2019-07-05 Virtual data set generation method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910604847.3A CN112257731B (en) 2019-07-05 Virtual data set generation method and device

Publications (2)

Publication Number Publication Date
CN112257731A CN112257731A (en) 2021-01-22
CN112257731B true CN112257731B (en) 2024-06-28

Family

ID=

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107452060A (en) * 2017-06-27 2017-12-08 西安电子科技大学 Full angle automatic data collection generates virtual data diversity method
CN108460414A (en) * 2018-02-27 2018-08-28 北京三快在线科技有限公司 Generation method, device and the electronic equipment of training sample image

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107452060A (en) * 2017-06-27 2017-12-08 西安电子科技大学 Full angle automatic data collection generates virtual data diversity method
CN108460414A (en) * 2018-02-27 2018-08-28 北京三快在线科技有限公司 Generation method, device and the electronic equipment of training sample image

Similar Documents

Publication Publication Date Title
CN111354079B (en) Three-dimensional face reconstruction network training and virtual face image generation method and device
US11417130B2 (en) System and method for facilitating graphic-recognition training of a recognition model
CN110807451B (en) Face key point detection method, device, equipment and storage medium
CN109859305B (en) Three-dimensional face modeling and recognizing method and device based on multi-angle two-dimensional face
CN109242961A (en) A kind of face modeling method, apparatus, electronic equipment and computer-readable medium
Albarelli et al. Fast and accurate surface alignment through an isometry-enforcing game
CN109086798A (en) A kind of data mask method and annotation equipment
CN109948397A (en) A kind of face image correcting method, system and terminal device
EP3905194A1 (en) Pose estimation method and apparatus
CN112132213A (en) Sample image processing method and device, electronic equipment and storage medium
CN106408037A (en) Image recognition method and apparatus
CN110275968A (en) Image processing method and device
CN110276804B (en) Data processing method and device
CN112085835A (en) Three-dimensional cartoon face generation method and device, electronic equipment and storage medium
CN109816634A (en) Detection method, model training method, device and equipment
CN115131492A (en) Target object relighting method and device, storage medium and background replacement method
CN112802081A (en) Depth detection method and device, electronic equipment and storage medium
KR102342738B1 (en) Method and apparatus for generating mega size augmented reality image information
CN111382791A (en) Deep learning task processing method, image recognition task processing method and device
CN113763307B (en) Sample data acquisition method and device
CN112488137A (en) Sample acquisition method and device, electronic equipment and machine-readable storage medium
CN113570615A (en) Image processing method based on deep learning, electronic equipment and storage medium
CN112257731B (en) Virtual data set generation method and device
CN113012030A (en) Image splicing method, device and equipment
CN113378864B (en) Method, device and equipment for determining anchor frame parameters and readable storage medium

Legal Events

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