CN114708375A - Texture mapping method, system, computer and readable storage medium - Google Patents

Texture mapping method, system, computer and readable storage medium Download PDF

Info

Publication number
CN114708375A
CN114708375A CN202210627375.5A CN202210627375A CN114708375A CN 114708375 A CN114708375 A CN 114708375A CN 202210627375 A CN202210627375 A CN 202210627375A CN 114708375 A CN114708375 A CN 114708375A
Authority
CN
China
Prior art keywords
texture
grid
triangular
image
triangular surface
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
CN202210627375.5A
Other languages
Chinese (zh)
Other versions
CN114708375B (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.)
Jiangxi Booway New Technology Co ltd
Original Assignee
Jiangxi Booway New 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 Jiangxi Booway New Technology Co ltd filed Critical Jiangxi Booway New Technology Co ltd
Priority to CN202210627375.5A priority Critical patent/CN114708375B/en
Publication of CN114708375A publication Critical patent/CN114708375A/en
Application granted granted Critical
Publication of CN114708375B publication Critical patent/CN114708375B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T15/003D [Three Dimensional] image rendering
    • G06T15/04Texture mapping
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/23Clustering techniques
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T17/00Three dimensional [3D] modelling, e.g. data description of 3D objects
    • G06T17/20Finite element generation, e.g. wire-frame surface description, tesselation
    • G06T17/205Re-meshing

Landscapes

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

Abstract

The invention provides a texture mapping method, a texture mapping system, a computer and a readable storage medium, wherein the method comprises the steps of carrying out plane clustering on each grid triangular surface; respectively calculating the texture quality of the projection area of each grid triangular surface on the candidate image list corresponding to the grid triangular surface, and listing a corresponding optimization energy equation; optimizing through an optimization energy equation to obtain a corresponding texture block; determining difference constraint between each texture block and barycentric coordinates inside a triangular surface of the grid according to the vertex color on the boundary of each texture block so as to construct a corresponding sparse linear equation; fusing the boundary color of each texture block according to a preset linear equation; and splicing the fused texture blocks into a texture picture, and outputting a target mesh model with the texture picture. By the method, the problems of distortion and chromatic aberration of large-scale complex model texture mapping can be effectively solved, and more real three-dimensional model reconstruction can be realized.

Description

Texture mapping method, system, computer and readable storage medium
Technical Field
The present invention relates to the field of data processing technologies, and in particular, to a texture mapping method, system, computer, and readable storage medium.
Background
The texture mapping is a process of establishing a corresponding relation between the three-dimensional object surface and the two-dimensional image space pixel coordinates. In three-dimensional reconstruction, texture mapping uses a plurality of frames of real natural scene photos collected by a user as two-dimensional texture data, but each frame of image can capture only one local area of a natural scene, so that a complete texture map of a three-dimensional model needs to be created by combining the plurality of frames of images.
However, most of the texture mapping in the prior art can only process a smoother original mesh model or image data of a medium or small scale, cannot process a significant color difference, and does not eliminate the phenomenon that images in a texture part area are inconsistent due to the fact that the images are taken at different times.
Disclosure of Invention
Based on this, the present invention provides a texture mapping method, system, computer and readable storage medium to solve the problems of obvious color difference of texture of the texture mapping generation model, difficulty in smoothing texture seams and inconsistency of regional texture images in the prior art.
A first aspect of an embodiment of the present invention provides a texture mapping method, where the method includes:
acquiring an input original grid model and an image sequence, wherein the original grid model comprises a plurality of grid triangular surfaces, and the image sequence comprises a plurality of image lists;
respectively establishing a corresponding candidate image list for each grid triangular surface based on preset space projection and depth test, and carrying out plane clustering on each grid triangular surface so as to enable the clustered grid triangular surfaces to belong to the same approximate plane;
respectively calculating the texture quality of the projection area of each grid triangular surface on the candidate image list corresponding to the grid triangular surface, and using the included angle of the adjacent grid triangular surfaces and the cluster of the plane as constraint conditions to list a corresponding optimization energy equation;
obtaining an optimal texture image of each grid triangular surface through optimization of the optimization energy equation, and clustering the same optimal texture images and adjacent grid triangular surfaces together to form corresponding texture blocks;
determining difference constraints among the texture blocks and barycentric coordinates inside a triangular surface of the grid according to the vertex colors on the boundary of each texture block so as to construct a corresponding sparse linear equation;
obtaining color differences among pixels in a projection area of a grid triangular surface in each texture block according to the sparse linear equation, updating the colors of the pixels to adjust the color differences among the texture blocks, and fusing the boundary colors of the texture blocks according to a preset linear equation;
and splicing the fused texture blocks into a texture picture, and outputting a target mesh model with the texture picture.
The invention has the beneficial effects that: the method comprises the steps of firstly obtaining grid triangular surfaces and a corresponding candidate image list, further respectively establishing a corresponding candidate image list for each grid triangular surface based on preset space projection and depth test, and carrying out plane clustering on each grid triangular surface so as to enable the clustered grid triangular surfaces to belong to the same approximate plane; respectively calculating the texture quality of the projection area of each grid triangular surface on the candidate image list corresponding to the grid triangular surface, and using the included angle of the adjacent grid triangular surfaces and the cluster of the plane as constraint conditions to list the corresponding optimized energy equation; obtaining an optimal texture image of each grid triangular surface through optimization of an optimization energy equation, and clustering the same optimal texture images and adjacent grid triangular surfaces together to form a corresponding texture block; determining difference constraint between each texture block and barycentric coordinates inside a triangular surface of the grid according to the vertex color on the boundary of each texture block so as to construct a corresponding sparse linear equation; obtaining the color difference among all pixels in the projection area of the grid triangular surface in each texture block according to a sparse linear equation, updating the color of each pixel to adjust the color difference among the texture blocks, and fusing the boundary color of each texture block according to a preset linear equation; and splicing the fused texture blocks into a texture picture, and outputting a target mesh model with the texture picture. By the method, the texture consistency on the plane can be effectively restrained, and the energy function is optimized, so that the problems of distortion and chromatic aberration of texture mapping of a large-scale complex model are effectively solved, and more real three-dimensional model reconstruction can be realized.
Preferably, the step of respectively establishing a corresponding candidate image list for each mesh triangular surface based on the preset spatial projection and the depth test includes:
setting the sequence of triangular faces of each grid
Figure 127454DEST_PATH_IMAGE001
And the input sequence of aerial images
Figure 191838DEST_PATH_IMAGE002
Wherein n represents the number of the triangular surfaces of the grid, and m represents the number of aerial images;
calculating the pixel position of the vertex of the sequence of the mesh triangular surface on the sequence of the aerial images through the transformation matrix of the aerial image corresponding to the camera so as to obtain the projection area S of the mesh triangular surface on the aerial image
Figure 209472DEST_PATH_IMAGE003
Wherein, in the step (A),
Figure 766355DEST_PATH_IMAGE004
representing said mesh triangle plane FiIn picture IjNumber of pixels passing said depth test, FiRepresents the ith mesh triangular surface, IjRepresenting the jth aerial image;
And eliminating abnormal images in the candidate image list corresponding to each grid triangular surface.
Preferably, the step of performing plane clustering on each of the triangular faces of the grids so that the triangular faces of the grids to be clustered belong to the same approximate plane includes:
when the original grid model is obtained, performing surface smoothing and noise reduction processing on the original grid model M based on a preset grid bilateral filtering algorithm to obtain the original grid model Ms
Region-growth-based pair of the original mesh model MsClustering to obtain the original grid model MsThe triangular surface of the grid in (1) belongs to a plane.
Preferably, the step of obtaining the optimal texture image of each mesh triangular surface through the optimization of the optimization energy equation, and clustering the same optimal texture image and adjacent mesh triangular surfaces together to form the corresponding texture block includes:
according to the triangular surface F of the gridiAnd a corresponding aerial image sequence ImConstructing a weighted undirected graph
Figure 298968DEST_PATH_IMAGE005
And defining a corresponding energy equation, wherein V represents nodes in the undirected graph, the nodes comprise public nodes and terminal nodes, the number of the public nodes is equal to that of the grid triangular faces, the nodes are in one-to-one correspondence with the grid triangular faces, the number of the terminal nodes is m, the terminal nodes correspond to the aerial images, and the aerial images are used in a sequence ImThe middle index is represented as a label, E represents an edge connecting the nodes in the undirected graph, wherein the edge connecting the terminal node and the common node is
Figure 701130DEST_PATH_IMAGE006
Representing the visibility of the triangular surface of the mesh on the aerial image, and the edges between the common nodes are
Figure 838851DEST_PATH_IMAGE007
And expressing the topological relation of the triangular surfaces of the adjacent grids, wherein the expression of the energy equation is as follows:
Figure 566635DEST_PATH_IMAGE008
wherein the content of the first and second substances,E data representing said mesh triangle plane FiIn the imageI l(i) The sharpness of the texture of the projected area of (a),E smooth representing the consistency of the projected areas from different images adjacent to the triangular faces of said mesh, Fi,FjIs a triangular face of an adjacent gridi,ljRespectively represent Fi,FjVisible image tag of pi,pjIs represented by Fi,FjA planar cluster label of (a);
undirected graph weighted according to the above based on a cyclic belief propagation algorithm
Figure 258648DEST_PATH_IMAGE009
Energy message transmission is carried out to obtain the optimal texture image label of each grid triangular surface;
and generating a corresponding texture block according to the optimal texture image label of each grid triangular surface.
Preferably, the step of splicing the fused texture blocks into a texture picture and outputting the target mesh model with the texture picture includes:
creating a texture mask for each texture block with the same size as the texture image
Figure 730080DEST_PATH_IMAGE010
Setting the projection area of the mesh triangular surface in the texture block in the texture image to be visible
Figure 519045DEST_PATH_IMAGE011
By detecting the texture mask
Figure 152151DEST_PATH_IMAGE012
To obtain the texture mask
Figure 597039DEST_PATH_IMAGE013
Bounding box rectangle of connected component in (1)
Figure 872163DEST_PATH_IMAGE014
The bounding box rectangle according to the input
Figure 718896DEST_PATH_IMAGE015
And packing pixels in the rectangular area of the texture image into a new texture image by a preset algorithm, and calculating texture coordinates of the triangular surface of the grid to generate a corresponding texture atlas.
A second aspect of the present invention provides a texture mapping system, including:
the system comprises an acquisition module, a display module and a display module, wherein the acquisition module is used for acquiring an input original grid model and an image sequence, the original grid model comprises a plurality of grid triangular surfaces, and the image sequence comprises a plurality of image lists;
the clustering module is used for respectively establishing a corresponding candidate image list for each grid triangular surface based on preset space projection and depth test, and carrying out plane clustering on each grid triangular surface so as to enable the clustered grid triangular surfaces to belong to the same approximate plane;
the calculation module is used for calculating the texture quality of the projection area of each grid triangular surface on the candidate image list corresponding to the grid triangular surface respectively, and clustering the included angle of the adjacent grid triangular surfaces and the plane to which the adjacent grid triangular surfaces belong as constraint conditions to list the corresponding optimized energy equation;
the optimization module is used for obtaining the optimal texture image of each grid triangular surface through optimization of the optimization energy equation, and clustering the same optimal texture image and adjacent grid triangular surfaces together to form a corresponding texture block;
the construction module is used for determining difference constraint between every two texture blocks and barycentric coordinates inside a triangular surface of a grid according to the color of a vertex on the boundary of every two texture blocks so as to construct a corresponding sparse linear equation;
the fusion module is used for obtaining color differences among pixels in a projection area of a grid triangular surface in each texture block according to the sparse linear equation, updating the colors of the pixels to adjust the color differences among the texture blocks, and fusing the boundary colors of the texture blocks according to a preset linear equation;
and the output module is used for splicing the fused texture blocks into a texture picture and outputting a target mesh model with the texture picture.
In the texture mapping system, the clustering module is specifically configured to:
setting a sequence of triangular faces of each of the meshes
Figure 788483DEST_PATH_IMAGE001
And the input sequence of aerial images
Figure 720667DEST_PATH_IMAGE002
Wherein n represents the number of the triangular surfaces of the grid, and m represents the number of aerial images;
calculating the pixel position of the vertex of the sequence of the mesh triangular surface on the sequence of the aerial images through the transformation matrix of the aerial image corresponding to the camera so as to obtain the projection area S of the mesh triangular surface on the aerial image
Figure 533902DEST_PATH_IMAGE003
Wherein, in the step (A),
Figure 497792DEST_PATH_IMAGE003
representing said mesh triangle plane FiIn picture IjNumber of pixels passing said depth test, FiRepresents the ith mesh triangular surface, IjRepresentsThe jth aerial image;
and eliminating abnormal images in the candidate image list corresponding to each grid triangular surface.
In the texture mapping system, the clustering module is further specifically configured to:
when the original grid model is obtained, performing surface smoothing and noise reduction processing on the original grid model M based on a preset grid bilateral filtering algorithm to obtain the original grid model Ms
Region-growth-based pair of the original mesh model MsClustering to obtain the original grid model MsThe triangular surface of the grid in (1) belongs to a plane.
In the texture mapping system, the optimization module is specifically configured to:
according to the triangular surface F of the gridiAnd corresponding aerial image sequence ImConstructing a weighted undirected graph
Figure 472701DEST_PATH_IMAGE005
And defining a corresponding energy equation, wherein V represents nodes in the undirected graph, the nodes comprise public nodes and terminal nodes, the number of the public nodes is equal to that of the grid triangular faces, the nodes are in one-to-one correspondence with the grid triangular faces, the number of the terminal nodes is m, the terminal nodes correspond to the aerial images, and the aerial images are used in a sequence ImThe middle index is represented as a label, E represents an edge connecting the nodes in the undirected graph, wherein the edge connecting the terminal node and the common node is
Figure 157760DEST_PATH_IMAGE006
Representing the visibility of the triangular surface of the mesh on the aerial image, and the edges between the common nodes are
Figure 509107DEST_PATH_IMAGE007
And expressing the topological relation of the triangular surfaces of the adjacent grids, wherein the expression of the energy equation is as follows:
Figure 330433DEST_PATH_IMAGE008
wherein the content of the first and second substances,E data representing said mesh triangle plane FiIn the imageI l(i) The sharpness of the texture of the projected area of (a),E smooth representing the consistency of the projected areas from different images adjacent to the triangular faces of said mesh, Fi,FjIs a triangular face of an adjacent gridi,ljRespectively represent Fi,FjVisible image tag of pi,pjIs represented by Fi,FjA planar cluster label of (a);
undirected graph weighted according to the above based on a cyclic belief propagation algorithm
Figure 476243DEST_PATH_IMAGE009
Energy message transmission is carried out to obtain the optimal texture image label of each grid triangular surface;
and generating a corresponding texture block according to the optimal texture image label of each grid triangular surface.
In the texture mapping system, the output module is specifically configured to:
creating a texture mask for each texture block with the same size as the texture image
Figure 383019DEST_PATH_IMAGE016
Setting the projection area of the mesh triangular surface in the texture block in the texture image to be visible
Figure 538057DEST_PATH_IMAGE017
By detecting the texture mask
Figure 213889DEST_PATH_IMAGE018
To obtain the texture mask
Figure 999442DEST_PATH_IMAGE019
Bounding box rectangle of connected component in (1)
Figure 393515DEST_PATH_IMAGE020
The bounding box rectangle according to input
Figure 352243DEST_PATH_IMAGE021
And packing pixels in the rectangular area of the texture image into a new texture image by a preset algorithm, and calculating texture coordinates of the triangular surface of the grid to generate a corresponding texture atlas.
A third aspect of the embodiments of the present invention provides a computer, including a memory, a processor, and a computer program stored on the memory and executable on the processor, where the processor implements the texture mapping method as described above when executing the computer program.
A fourth aspect of the embodiments of the present invention provides a readable storage medium, on which a computer program is stored, which when executed by a processor implements a texture mapping method as described above.
Additional aspects and advantages of the invention will be set forth in part in the description which follows and, in part, will be obvious from the description, or may be learned by practice of the invention.
Drawings
FIG. 1 is a flowchart of a texture mapping method according to a first embodiment of the present invention;
fig. 2 is a block diagram of a texture mapping system according to a third embodiment of the present invention.
The following detailed description will further illustrate the invention in conjunction with the above-described figures.
Detailed Description
To facilitate an understanding of the invention, the invention will now be described more fully with reference to the accompanying drawings. Several embodiments of the invention are presented in the drawings. This invention may, however, be embodied in many different forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete.
It will be understood that when an element is referred to as being "secured to" another element, it can be directly on the other element or intervening elements may also be present. When an element is referred to as being "connected" to another element, it can be directly connected to the other element or intervening elements may also be present. The terms "vertical," "horizontal," "left," "right," and the like are used herein for purposes of illustration only.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs. The terminology used in the description of the invention herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used herein, the term "and/or" includes any and all combinations of one or more of the associated listed items.
Most of texture mapping in the prior art can only process smoother original grid models or image data of medium and small scales, can not process obvious color difference, and does not eliminate the phenomenon that images of texture part areas are inconsistent due to the fact that images are shot at different times.
Referring to fig. 1, a texture mapping method according to a first embodiment of the present invention is shown, and the texture mapping method according to this embodiment can effectively constrain the consistency of textures on a plane, and simultaneously optimize an energy function, thereby effectively eliminating distortion and color difference problems of texture mapping of a large-scale complex model, and further realizing more real three-dimensional model reconstruction.
Specifically, the texture mapping method provided in this embodiment specifically includes the following steps:
step S10, obtaining an input original grid model and an image sequence, wherein the original grid model comprises a plurality of grid triangular surfaces, and the image sequence comprises a plurality of image lists;
specifically, in this embodiment, it needs to be first described that the texture mapping method provided in this embodiment first needs to acquire an original mesh model and an image sequence in a picture to be processed, where the original mesh model includes a plurality of mesh triangular surfaces, and the image sequence includes a plurality of image lists.
Step S20, respectively establishing a corresponding candidate image list for each grid triangular surface based on preset space projection and depth test, and carrying out plane clustering on each grid triangular surface so as to enable the clustered grid triangular surfaces to belong to the same approximate plane;
furthermore, in this step, it should be noted that, in the texture mapping method provided in this embodiment, a space projection and depth test program is preset, and after the original mesh model and the image sequence are obtained through the above steps, in this step, a corresponding candidate image list is respectively established for each mesh triangular surface based on the space projection and the depth test, and planar clustering is performed on each mesh triangular surface, so that the clustered mesh triangular surfaces belong to the same approximate plane.
Step S30, calculating texture quality of the projection area of each grid triangular surface on the candidate image list corresponding to the grid triangular surface, and clustering the included angle of the adjacent grid triangular surfaces and the plane to which the grid triangular surfaces belong as constraint conditions to list a corresponding optimized energy equation;
furthermore, in this step, it should be noted that, this step further calculates texture quality of a projection area of each mesh triangular surface on the candidate image list corresponding to the mesh triangular surface, and uses an included angle of adjacent mesh triangular surfaces and a belonging plane cluster as constraint conditions to list a corresponding optimization energy equation. The purpose of this step is to list the optimization energy equations to facilitate the optimization process of the image data in the subsequent steps.
Step S40, obtaining the optimal texture image of each grid triangular surface through the optimization of the optimization energy equation, and clustering the adjacent grid triangular surfaces which are the same in the optimal texture image to form a corresponding texture block;
further, in this step, it should be noted that, after the optimization energy equation is obtained in the above step, this step performs optimization processing on each mesh triangular surface in the above step S30 through the optimization energy equation to obtain an optimal texture image of each mesh triangular surface, and clusters adjacent mesh triangular surfaces that are the same in the optimal texture image to form a corresponding texture block.
Step S50, determining difference constraint between each texture block and barycentric coordinates inside a grid triangular surface according to the vertex color on the boundary of each texture block so as to construct a corresponding sparse linear equation;
after the mesh triangular surfaces are converted into the corresponding texture blocks through the steps, the step immediately determines the difference constraint between the texture blocks and the barycentric coordinates inside the mesh triangular surfaces according to the vertex colors on the boundary of each texture block so as to construct a corresponding sparse linear equation.
Step S60, obtaining color differences among pixels in a projection area of a grid triangular surface in each texture block according to the sparse linear equation, updating the colors of the pixels to adjust the color differences among the texture blocks, and fusing the boundary colors of the texture blocks according to a preset linear equation;
on the basis of constructing a sparse linear equation, the step further obtains the color difference between each pixel in the projection area of the grid triangular surface in each texture block according to the sparse linear equation, updates the color of each pixel to adjust the color difference between each texture block, and fuses the boundary color of each texture block according to a preset linear equation, so that the processing of each texture block can be completed.
And step S70, splicing the texture blocks after being fused into a texture picture, and outputting a target mesh model with the texture picture.
Finally, in this step, it should be noted that, on the basis of the above step S60, this step further splices the texture blocks that have been subjected to the fusion processing into corresponding texture pictures, and outputs the target mesh model with the texture pictures.
It should be noted that the implementation process described above is only for illustrating the applicability of the present application, but this does not represent that the texture mapping method of the present application has only the above-mentioned implementation flow, and on the contrary, the texture mapping method of the present application can be incorporated into the feasible embodiments of the present application as long as the implementation of the texture mapping method of the present application is possible.
In summary, the texture mapping method provided by the embodiments of the present invention can effectively constrain the consistency of the texture on the plane, and simultaneously optimize the energy function, thereby effectively eliminating the problems of distortion and chromatic aberration of texture mapping of large-scale complex models, and further realizing more real three-dimensional model reconstruction.
A second embodiment of the present invention also provides a texture mapping method, where the texture mapping method provided in this embodiment specifically includes the following steps:
step S11, acquiring an input original grid model and an image sequence;
specifically, in this embodiment, it should be noted that, in this embodiment, an original mesh model to be processed and an image sequence are also obtained first, and the obtained original mesh model and the obtained image sequence are processed, where the original mesh model includes a plurality of mesh triangular surfaces, and the image sequence includes a plurality of image lists.
Step S21, setting the sequence of each grid triangular surface
Figure 148161DEST_PATH_IMAGE001
And the input sequence of aerial images
Figure 901353DEST_PATH_IMAGE002
Wherein n represents the number of the triangular surfaces of the grid, and m represents the number of aerial images; calculating the pixel position of the vertex of the sequence of the mesh triangular surface on the sequence of the aerial images through the transformation matrix of the aerial image corresponding to the camera so as to obtain the projection area S of the mesh triangular surface on the aerial image
Figure 717475DEST_PATH_IMAGE022
Wherein, in the step (A),
Figure 214316DEST_PATH_IMAGE023
representing said mesh triangle plane FiIn picture IjNumber of pixels passing said depth test, FiRepresents the ith mesh triangular surface, IjRepresents the jth aerial image; and eliminating abnormal images in the candidate image list corresponding to each grid triangular surface.
Specifically, in this step, it should be noted that, in this step, the sequence of the acquired triangular faces of each mesh is first set
Figure 130319DEST_PATH_IMAGE024
And the input sequence of aerial images
Figure 54413DEST_PATH_IMAGE002
Wherein n represents the number of the triangular surfaces of the grid, and m represents the number of aerial images.
Further, in this step, the pixel position of the vertex of the sequence of the mesh triangular surface on the aerial image sequence is calculated through the transformation matrix of the aerial image corresponding to the camera, so as to obtain the projection area S calculation of the mesh triangular surface on the aerial image
Figure 423077DEST_PATH_IMAGE022
Wherein, in the step (A),
Figure 458029DEST_PATH_IMAGE022
representing said mesh triangle plane FiIn picture IjNumber of pixels passing said depth test, FiRepresents the ith mesh triangular surface, IjRepresenting the jth aerial image, and, in addition, using
Figure 962960DEST_PATH_IMAGE025
Denotes an invisible triangular surface, which means a triangular surface in which the number of pixels of the projection area S is not 0 but does not pass the depth test.
On the basis, the abnormal images in the candidate image list corresponding to the triangular surfaces of each grid are removed.
Specifically, in this step, F is setiR, F of the image listiThe average color of the projected area of the images in the image list is
Figure 57955DEST_PATH_IMAGE026
. Using bases based on CkFiltering outliers in the image list by using a mean shift algorithm of covariance, and removing occluded images, wherein the mean shift algorithm of covariance is defined as follows:
Figure 648336DEST_PATH_IMAGE027
for FiOf the image list of (1), the average color C of the projected areakIf the above formula condition is satisfied, the image is an outlier and should be rejected. Wherein, CmeanRepresents a correspondence FiAll C of the image listkIs determined by the average value of (a) of (b),
Figure 486979DEST_PATH_IMAGE028
is represented by FiThe covariance of the set of mean colors C of the projection area,
Figure 111996DEST_PATH_IMAGE029
represents a filtering threshold, here the value 6x10-3
Step S31, when the original grid model is obtained, performing surface smoothing noise reduction processing on the original grid model M based on a preset grid bilateral filtering algorithm to obtain the original grid model Ms(ii) a Region-growth-based pair of the original mesh model MsClustering to obtain the original grid model MsThe triangular surface of the grid in (1) belongs to the plane.
Further, in this step, when the original mesh model is obtained, the original mesh model M is subjected to surface smoothing noise reduction processing based on a preset bilateral filtering algorithm to obtain the original mesh model MTo the original mesh model MsAnd smoothing the low-curvature plane part by using a high-curvature part as an edge on the surface of the bilateral filter enhanced model. Bilateral filtering does not change the topology of the original mesh model, only changes the position and normal direction of the vertices.
Further, the step clusters the original mesh model Ms based on region growing to obtain the original mesh model MsThe triangular surface of the middle grid belongs to the plane
Figure 377892DEST_PATH_IMAGE030
. Wherein, assuming a total of n planes, PiRepresenting the value of the ith plane i from 1 to n, P1The 1 st plane is shown. The plane of the corresponding patch in the original model M is also Pi. And (4) after the grid planes are clustered, dividing triangular patches belonging to the same plane, wherein the purpose of the triangular patches is to restrict texture blocks on the plane to be from the same image as much as possible.
Step S41, calculating texture quality of the projection area of each grid triangular surface on the candidate image list corresponding to the grid triangular surface, and clustering the included angle of the adjacent grid triangular surfaces and the plane to which the grid triangular surfaces belong as constraint conditions to list a corresponding optimized energy equation;
in this step, it should be noted that, in order to obtain the optimal texture image of each mesh triangle, the selection of the optimal texture image of the mesh triangle may be converted into the markov random field energy minimization problem.
Supposing a triangular surface of a grid
Figure 455569DEST_PATH_IMAGE031
Is that ofI l(i) Image label thereof
Figure 566745DEST_PATH_IMAGE032
Is a labeling function for i. The result of the optimal texture image of the mesh triangular patch is the set of the optimal texture image sequence numbers of all the mesh triangular patches
Figure 46268DEST_PATH_IMAGE033
. The selection of the texture map optimal texture image is thus considered as solving the L-tag problem.
In addition, in the step, texture quality of a projection area of each grid triangular surface on the candidate image list corresponding to the grid triangular surface is calculated respectively, and an included angle of the adjacent grid triangular surfaces and a cluster of the planes are used as constraint conditions to list a corresponding optimization energy equation.
Step S51, according to the mesh triangular surface FiAnd corresponding aerial image sequence ImConstructing a weighted undirected graph
Figure 279803DEST_PATH_IMAGE034
And defining a corresponding energy equation, wherein V represents nodes in the undirected graph, the nodes comprise public nodes and terminal nodes, the number of the public nodes is equal to that of the grid triangular faces, the nodes are in one-to-one correspondence with the grid triangular faces, the number of the terminal nodes is m, the terminal nodes correspond to the aerial images, and the aerial images are used in a sequence ImThe middle index is represented as a label, E represents an edge connecting the nodes in the undirected graph, wherein the edge connecting the terminal node and the common node is
Figure 844776DEST_PATH_IMAGE035
Representing the visibility of the triangular surface of the mesh on the aerial image, and the edges between the common nodes are
Figure 22292DEST_PATH_IMAGE007
And expressing the topological relation of the triangular surfaces of the adjacent grids, wherein the expression of the energy equation is as follows:
Figure 621901DEST_PATH_IMAGE036
wherein, the first and the second end of the pipe are connected with each other,E data representing said mesh triangle plane FiIn the imageI l(i) The sharpness of the texture of the projected area of (a),E smooth representing the correspondence of projection areas from different images adjacent to the triangular faces of said mesh, Fi,FjTriangular faces of adjacent grids, /)i,ljRespectively represent Fi,FjVisible image label of pi,pjIs represented by Fi,FjA planar cluster label of (a); according to the weighted undirected graph based on a cyclic belief propagation algorithm
Figure 964021DEST_PATH_IMAGE034
Energy message transmission is carried out to obtain the optimal texture image label of each grid triangular surface; and generating a corresponding texture block according to the optimal texture image label of each grid triangular surface.
In this step, it should be noted that, among others,E data the calculation formula of (2) is as follows:
Figure 750711DEST_PATH_IMAGE037
wherein p represents pixel coordinates and s represents FiIn that
Figure 734848DEST_PATH_IMAGE038
The area of projection of (a) is,
Figure 985700DEST_PATH_IMAGE039
is shown in
Figure 764300DEST_PATH_IMAGE040
The normalization on the maximum value of the sum of the values,
Figure 38287DEST_PATH_IMAGE041
indicating use of
Figure 294956DEST_PATH_IMAGE042
The gradient amplitude value calculated by an operator is
Figure 603578DEST_PATH_IMAGE043
Wherein
Figure 553079DEST_PATH_IMAGE044
For invisible triangular surface
Figure 376679DEST_PATH_IMAGE025
, FiIn the image
Figure 437038DEST_PATH_IMAGE038
OnE data Is composed of
Figure 865746DEST_PATH_IMAGE045
. Optimized, it will be as "close" as possible to the nearest texture block.
Wherein the content of the first and second substances,E smooth the calculation formula of (2) is as follows:
Figure 720569DEST_PATH_IMAGE046
wherein, Fi,FjIs a triangular face of an adjacent gridi,ljRespectively represent Fi,FjVisible image tag of pi,pjIs represented by Fi,FjThe plane cluster label of (1).
Further, the step is based on a circulation belief propagation algorithm according to the weighted undirected graph
Figure 969148DEST_PATH_IMAGE005
Energy message transmission is carried out to obtain the optimal texture image label of each grid triangular surface; and generating a corresponding texture block according to the optimal texture image label of each grid triangular surface.
Wherein weighted undirected graph is
Figure 98778DEST_PATH_IMAGE009
Operate to delete someAnd the optimal texture image labels of the triangular surfaces represented by the nodes at the two ends of the edges are different. Obtaining weighted undirected graph after edge deletion
Figure 381992DEST_PATH_IMAGE009
Each connected component is a texture block, and the deleted edge is the boundary of the texture block, so as to finally obtain the texture block area and the texture block boundary.
Step S61, determining difference constraint between each texture block and barycentric coordinates inside a grid triangular surface according to the vertex color on the boundary of each texture block so as to construct a corresponding sparse linear equation;
specifically, in this step, it should be noted that, after the texture blocks are obtained through the above steps, the step immediately determines the difference constraint between the texture blocks and the barycentric coordinates inside the triangular surface of the mesh according to the vertex colors on the boundary of each texture block, so as to construct the corresponding sparse linear equation.
Step S71, obtaining color differences among pixels in a projection area of a grid triangular surface in each texture block according to the sparse linear equation, updating the colors of the pixels to adjust the color differences among the texture blocks, and fusing the boundary colors of the texture blocks according to a preset linear equation;
specifically, in this step, it should be noted that, in this embodiment, two texture blocks are assumed
Figure 670366DEST_PATH_IMAGE047
Figure 406241DEST_PATH_IMAGE048
Vertex v on the boundary of the texture0、v1、v2. Adjusting texture blocks
Figure 73983DEST_PATH_IMAGE049
And
Figure 211703DEST_PATH_IMAGE050
to make their previous colors smoothly transition, eliminating visual differences.
For v1Point, it is at
Figure 673908DEST_PATH_IMAGE051
C for color (A)1 leftIs shown in
Figure 897079DEST_PATH_IMAGE052
For color of (C)1 rightRepresents; by g1 leftDenotes v1In that
Figure 368512DEST_PATH_IMAGE053
Color value of g to be adjusted1 rightDenotes v1In that
Figure 95159DEST_PATH_IMAGE048
The color value to be adjusted; adjusting the vertex v1Such that the following values are as small as possible:
Figure 728266DEST_PATH_IMAGE054
corresponding to any triangular surface F on the three-dimensional modeliThe pixel color adjustment value g in its projected triangle corresponding to the texture block is derived from F according to the triangle barycentric coordinate systemiThe color adjustment values on the three vertices of (1).
Meanwhile, on any edge of the triangular surface in the same texture block, the difference of the color adjustment values of adjacent vertexes needs to be as small as possible:
Figure 235471DEST_PATH_IMAGE055
in combination with the above constraints, C is knownv left、Cv rightConstructing a linear equation system for solving g, and calculating each vertex of the three-dimensional model by using a Conjugate Gradient method (CG)Color difference g and update color into all texture blocks.
4.2 texture boundary color fusion
In order to fuse colors on both sides of the texture boundary, it is necessary to minimize the gradient of pixels on both sides of the boundary. And controlling the range of solving the gradient change of the pixel within the width of 20 pixels on two sides of the texture boundary through image expansion corrosion.
Figure 245015DEST_PATH_IMAGE056
A system of solution equations is constructed to obtain the color adjustment value, as shown in the above equation,
Figure 91748DEST_PATH_IMAGE057
is the gradient of the original image around the texture boundary,
Figure 161336DEST_PATH_IMAGE058
representing the color adjusted target image.
Step S81, creating a texture mask having the same size as the texture image for each texture block
Figure 827940DEST_PATH_IMAGE059
Setting the projection area of the mesh triangular surface in the texture block in the texture image to be visible
Figure 641176DEST_PATH_IMAGE060
(ii) a By detecting the texture mask
Figure 139153DEST_PATH_IMAGE059
To obtain the texture mask
Figure 379641DEST_PATH_IMAGE059
Bounding box rectangle of connected component in (1)
Figure 533542DEST_PATH_IMAGE061
(ii) a The bounding box rectangle according to the input
Figure 881959DEST_PATH_IMAGE062
And packing pixels in the rectangular area of the texture image into a new texture image by a preset algorithm, and calculating texture coordinates of the triangular surface of the grid to generate a corresponding texture atlas.
Finally, in this step, it should be noted that, the texture blocks generated in step S71 are further processed, and this step creates a texture mask with the same size as the texture image for each texture block
Figure 703285DEST_PATH_IMAGE059
At the same time, setting the projection area of the mesh triangular surface in each texture block in the texture image to be visible
Figure 114675DEST_PATH_IMAGE060
Further, in this step, the texture mask is further detected
Figure 818188DEST_PATH_IMAGE059
To obtain the texture mask
Figure 973226DEST_PATH_IMAGE059
Bounding box rectangle of connected component in (1)
Figure 383479DEST_PATH_IMAGE063
(ii) a Bounding box rectangle according to input
Figure 965770DEST_PATH_IMAGE061
And packing pixels in the rectangular area of the texture image into a new texture image by a preset container algorithm, and calculating texture coordinates of each grid triangular surface, so that a corresponding texture atlas can be finally generated.
It should be noted that the method provided by the second embodiment of the present invention, which implements the same principle and produces some technical effects as the first embodiment, can be referred to the first embodiment for providing corresponding contents for the sake of brief description, where this embodiment is not mentioned.
In summary, the texture mapping method provided by the above embodiment of the present invention can effectively constrain the consistency of the texture on the plane, and simultaneously optimize the energy function, thereby effectively eliminating the problems of distortion and chromatic aberration of texture mapping of large-scale complex models, and further realizing more real three-dimensional model reconstruction.
Referring to fig. 2, a texture mapping system according to a third embodiment of the present invention is shown, the system including:
an obtaining module 12, configured to obtain an input original mesh model and an image sequence, where the original mesh model includes a plurality of mesh triangular surfaces, and the image sequence includes a plurality of image lists;
the clustering module 22 is configured to respectively establish a corresponding candidate image list for each grid triangular surface based on preset spatial projection and depth test, and perform plane clustering on each grid triangular surface, so that the clustered grid triangular surfaces belong to the same approximate plane;
the calculation module 32 is used for calculating the texture quality of the projection area of each grid triangular surface on the candidate image list corresponding to the grid triangular surface, and clustering the included angle between the adjacent grid triangular surfaces and the plane to which the adjacent grid triangular surfaces belong as constraint conditions to list a corresponding optimized energy equation;
the optimization module 42 is configured to obtain an optimal texture image of each grid triangular surface through the optimization of the optimization energy equation, and cluster the same optimal texture image and adjacent grid triangular surfaces together to form a corresponding texture block;
the building module 52 is configured to determine a difference constraint between each texture block and a barycentric coordinate inside a triangular surface of a mesh according to a vertex color on a boundary of each texture block, so as to build a corresponding sparse linear equation;
a fusion module 62, configured to obtain color differences between pixels in a projection area of a mesh triangular surface inside each texture block according to the sparse linear equation, update the colors of the pixels to adjust the color differences between the texture blocks, and fuse the boundary colors of the texture blocks according to a preset linear equation;
and the output module 72 is configured to splice the fused texture blocks into a texture picture, and output a target mesh model with the texture picture.
In the texture mapping system, the clustering module 22 is specifically configured to:
setting a sequence of triangular faces of each of the meshes
Figure 359842DEST_PATH_IMAGE064
And a sequence of aerial images input
Figure 52992DEST_PATH_IMAGE002
Wherein n represents the number of the triangular surfaces of the grid, and m represents the number of aerial images;
calculating the pixel position of the vertex of the sequence of the grid triangular surface on the aerial image sequence through the transformation matrix of the camera corresponding to the aerial image so as to obtain the projection area S calculation of the grid triangular surface on the aerial image
Figure 645647DEST_PATH_IMAGE022
Wherein, in the step (A),
Figure 133260DEST_PATH_IMAGE022
representing said mesh triangle plane FiIn picture IjNumber of pixels passing said depth test, FiRepresents the ith mesh triangular surface, IjRepresents the jth aerial image;
and eliminating abnormal images in the candidate image list corresponding to each grid triangular surface.
In the texture mapping system, the clustering module 22 is further specifically configured to:
when the original grid model is obtained, performing surface smoothing noise reduction processing on the original grid model M based on a preset grid bilateral filtering algorithm to obtain the original grid modelType Ms
Region-growth-based pair of the original mesh model MsClustering to obtain the original grid model MsThe triangular surface of the grid in (1) belongs to a plane.
In the texture mapping system, the optimization module 42 is specifically configured to:
according to the triangular surface F of the gridiAnd corresponding aerial image sequence ImConstructing a weighted undirected graph
Figure 14629DEST_PATH_IMAGE005
And defining a corresponding energy equation, wherein V represents nodes in the undirected graph, the nodes comprise public nodes and terminal nodes, the number of the public nodes is equal to that of the grid triangular faces, the nodes are in one-to-one correspondence with the grid triangular faces, the number of the terminal nodes is m, the terminal nodes correspond to the aerial images, and the aerial images are used in a sequence ImThe middle index is represented as a label, E represents an edge connecting the nodes in the undirected graph, wherein the edge connecting the terminal node and the common node is
Figure 245890DEST_PATH_IMAGE006
Representing the visibility of the triangular surface of the mesh on the aerial image, and the edges between the common nodes are
Figure 896314DEST_PATH_IMAGE007
And expressing the topological relation of the triangular surfaces of the adjacent grids, wherein the expression of the energy equation is as follows:
Figure 617145DEST_PATH_IMAGE065
wherein, the first and the second end of the pipe are connected with each other,E data representing the triangular face F of the gridiIn the imageI l(i) The sharpness of the texture of the projected area of (a),E smooth representing projections from different images adjacent to the triangular faces of the meshConsistency of shadow areas, Fi,FjIs a triangular face of an adjacent gridi,ljRespectively represent Fi,FjVisible image tag of pi,pjIs represented by Fi,FjA planar cluster label of (a);
undirected graph weighted according to the above based on a cyclic belief propagation algorithm
Figure 720231DEST_PATH_IMAGE009
Energy message transmission is carried out to obtain the optimal texture image label of each grid triangular surface;
and generating a corresponding texture block according to the optimal texture image label of each grid triangular surface.
In the texture mapping system, the output module 72 is specifically configured to:
creating a texture mask for each texture block with the same size as the texture image
Figure 755183DEST_PATH_IMAGE059
Setting the projection area of the mesh triangular surface in the texture block in the texture image to be visible
Figure 260113DEST_PATH_IMAGE066
By detecting the texture mask
Figure 151846DEST_PATH_IMAGE059
To obtain the texture mask
Figure 742227DEST_PATH_IMAGE059
Bounding box rectangle of connected component in (1)
Figure 601378DEST_PATH_IMAGE067
The bounding box rectangle according to input
Figure 226395DEST_PATH_IMAGE063
And packing pixels in the rectangular area of the texture image into a new texture image by a preset algorithm, and calculating texture coordinates of the triangular surface of the grid to generate a corresponding texture atlas.
A fourth embodiment of the present invention provides a computer, which includes a memory, a processor, and a computer program stored on the memory and executable on the processor, and the processor implements the texture mapping method as provided in the first embodiment or the second embodiment when executing the computer program.
A fifth embodiment of the present invention provides a readable storage medium, on which a computer program is stored, which when executed by a processor, implements the texture mapping method provided in the above first or second embodiment.
In summary, the texture mapping method, system, computer and readable storage medium provided in the embodiments of the present invention can effectively constrain the consistency of textures on a plane, and optimize an energy function, thereby effectively eliminating the problems of distortion and chromatic aberration of texture mapping of a large-scale complex model, and further realizing more real three-dimensional model reconstruction.
The above modules may be functional modules or program modules, and may be implemented by software or hardware. For a module implemented by hardware, the modules may be located in the same processor; or the modules may be located in different processors in any combination.
The logic and/or steps represented in the flowcharts or otherwise described herein, e.g., an ordered listing of executable instructions that can be considered to implement logical functions, can be embodied in any computer-readable medium for use by or in connection with an instruction execution system, apparatus, or device, such as a computer-based system, processor-containing system, or other system that can fetch the instructions from the instruction execution system, apparatus, or device and execute the instructions. For the purposes of this description, a "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device.
More specific examples (a non-exhaustive list) of the computer-readable medium would include the following: an electrical connection (electronic device) having one or more wires, a portable computer diskette (magnetic device), a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disc read-only memory (CDROM). Additionally, the computer-readable medium could even be paper or another suitable medium upon which the program is printed, as the program can be electronically captured, via for instance optical scanning of the paper or other medium, then compiled, interpreted or otherwise processed in a suitable manner if necessary, and then stored in a computer memory.
It should be understood that portions of the present invention may be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, the various steps or methods may be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, any one or combination of the following techniques, which are known in the art, may be used: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, an application specific integrated circuit having an appropriate combinational logic gate circuit, a Programmable Gate Array (PGA), a Field Programmable Gate Array (FPGA), or the like.
In the description herein, references to the description of the term "one embodiment," "some embodiments," "an example," "a specific example," or "some examples," etc., mean that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. In this specification, the schematic representations of the terms used above do not necessarily refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
The above-mentioned embodiments only express several embodiments of the present invention, and the description thereof is more specific and detailed, but not construed as limiting the scope of the present invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the inventive concept, which falls within the scope of the present invention. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (10)

1. A method of texture mapping, the method comprising:
acquiring an input original grid model and an image sequence, wherein the original grid model comprises a plurality of grid triangular surfaces, and the image sequence comprises a plurality of image lists;
respectively establishing a corresponding candidate image list for each grid triangular surface based on preset space projection and depth test, and carrying out plane clustering on each grid triangular surface so as to enable the clustered grid triangular surfaces to belong to the same approximate plane;
respectively calculating the texture quality of the projection area of each grid triangular surface on the candidate image list corresponding to the grid triangular surface, and using the included angle of the adjacent grid triangular surfaces and the cluster of the plane as constraint conditions to list a corresponding optimization energy equation;
obtaining an optimal texture image of each grid triangular surface through optimization of the optimization energy equation, and clustering the same optimal texture images and adjacent grid triangular surfaces together to form corresponding texture blocks;
determining difference constraints among the texture blocks and barycentric coordinates inside a triangular surface of the grid according to the vertex colors on the boundary of each texture block so as to construct a corresponding sparse linear equation;
obtaining color differences among pixels in a projection area of a grid triangular surface in each texture block according to the sparse linear equation, updating the colors of the pixels to adjust the color differences among the texture blocks, and fusing the boundary colors of the texture blocks according to a preset linear equation;
and splicing the fused texture blocks into a texture picture, and outputting a target mesh model with the texture picture.
2. The texture mapping method according to claim 1, wherein: the step of respectively establishing a corresponding candidate image list for each grid triangular surface based on preset spatial projection and depth test comprises the following steps:
setting a sequence of triangular faces of each of the meshes
Figure 813011DEST_PATH_IMAGE001
And a sequence of aerial images input
Figure 78907DEST_PATH_IMAGE002
Wherein n represents the number of the triangular surfaces of the grid, and m represents the number of aerial images;
calculating the pixel position of the vertex of the sequence of the mesh triangular surface on the sequence of the aerial images through the transformation matrix of the aerial image corresponding to the camera so as to obtain the projection area S of the mesh triangular surface on the aerial image
Figure 156585DEST_PATH_IMAGE003
Wherein, in the step (A),
Figure 795989DEST_PATH_IMAGE004
representing said mesh triangle plane FiIn picture IjNumber of pixels passing said depth test, FiRepresents the ith mesh triangular surface, IjRepresents the jth aerial image;
and eliminating abnormal images in the candidate image list corresponding to each grid triangular surface.
3. The texture mapping method according to claim 1, wherein: the step of performing plane clustering on each grid triangular surface to enable the clustered grid triangular surfaces to belong to the same approximate plane comprises the following steps of:
when the original grid model is obtained, performing surface smoothing and noise reduction processing on the original grid model M based on a preset grid bilateral filtering algorithm to obtain the original grid model Ms
Region-growth-based pair of the original mesh model MsClustering to obtain the original grid model MsThe triangular surface of the grid in (1) belongs to a plane.
4. A texture mapping method as claimed in claim 2, characterized in that: the step of obtaining the optimal texture image of each grid triangular surface through the optimization of the optimization energy equation, and clustering the same optimal texture image and the adjacent grid triangular surfaces together to form the corresponding texture block comprises the following steps:
according to the triangular surface F of the gridiAnd corresponding aerial image sequence ImConstructing a weighted undirected graph
Figure 275512DEST_PATH_IMAGE005
And defining a corresponding energy equation, wherein V represents nodes in the undirected graph, the nodes comprise public nodes and terminal nodes, the number of the public nodes is equal to that of the grid triangular surfaces, the nodes correspond to the grid triangular surfaces one by one, the number of the terminal nodes is m, the terminal nodes correspond to the aerial images, and the aerial images are used in a sequence ImThe middle index is represented as a label, E represents an edge connecting the nodes in the undirected graph, wherein the edge connecting the terminal node and the common node is
Figure 712309DEST_PATH_IMAGE006
Representing said triangular faces of said grid on an aerial imageVisibility, edges between the common nodes are
Figure 277283DEST_PATH_IMAGE007
And expressing the topological relation of the triangular surfaces of the adjacent grids, wherein the expression of the energy equation is as follows:
Figure 192149DEST_PATH_IMAGE008
wherein the content of the first and second substances,
Figure 791758DEST_PATH_IMAGE009
representing the mesh triangular surface Fi in the image
Figure 399457DEST_PATH_IMAGE010
The sharpness of the texture of the projected area of (a),
Figure 248464DEST_PATH_IMAGE011
representing the consistency of the projected areas from different images adjacent to the triangular faces of said mesh, Fi,FjIs a triangular face of an adjacent gridi,ljRespectively represent Fi,FjVisible image tag of pi,pjIs shown as Fi,FjA planar cluster label of (a);
undirected graph weighted according to the above based on a cyclic belief propagation algorithm
Figure 967021DEST_PATH_IMAGE012
Energy message transmission is carried out to obtain the optimal texture image label of each grid triangular surface;
and generating a corresponding texture block according to the optimal texture image label of each grid triangular surface.
5. The texture mapping method according to claim 1, wherein: the step of splicing the fused texture blocks into a texture picture and outputting a target mesh model with the texture picture comprises the following steps:
creating a texture mask for each texture block with the same size as the texture image
Figure 421137DEST_PATH_IMAGE013
Setting the projection area of the mesh triangular surface in the texture block in the texture image to be visible
Figure 199737DEST_PATH_IMAGE014
By detecting the texture mask
Figure 473723DEST_PATH_IMAGE013
To obtain the texture mask
Figure 995971DEST_PATH_IMAGE013
Bounding box rectangle of connected component in (1)
Figure 304593DEST_PATH_IMAGE015
The bounding box rectangle according to input
Figure 50832DEST_PATH_IMAGE015
And packing pixels in the rectangular area of the texture image into a new texture image by a preset algorithm, and calculating texture coordinates of the triangular surface of the grid to generate a corresponding texture atlas.
6. A texture mapping system, the system comprising:
the system comprises an acquisition module, a display module and a display module, wherein the acquisition module is used for acquiring an input original grid model and an image sequence, the original grid model comprises a plurality of grid triangular surfaces, and the image sequence comprises a plurality of image lists;
the clustering module is used for respectively establishing a corresponding candidate image list for each grid triangular surface based on preset space projection and depth test, and carrying out plane clustering on each grid triangular surface so as to enable the clustered grid triangular surfaces to belong to the same approximate plane;
the calculation module is used for calculating the texture quality of the projection area of each grid triangular surface on the candidate image list corresponding to the grid triangular surface respectively, and clustering the included angle of the adjacent grid triangular surfaces and the plane to which the adjacent grid triangular surfaces belong as constraint conditions to list the corresponding optimized energy equation;
the optimization module is used for obtaining the optimal texture image of each grid triangular surface through optimization of the optimization energy equation and clustering the adjacent grid triangular surfaces which are the same in the optimal texture image to form a corresponding texture block;
the construction module is used for determining difference constraint between the texture blocks and barycentric coordinates inside a triangular surface of a grid according to the top point colors on the boundary of each texture block so as to construct a corresponding sparse linear equation;
the fusion module is used for obtaining the color difference among all pixels in a projection area of a grid triangular surface in each texture block according to the sparse linear equation, updating the color of all pixels to adjust the color difference among all texture blocks, and fusing the boundary color of each texture block according to a preset linear equation;
and the output module is used for splicing the fused texture blocks into a texture picture and outputting a target mesh model with the texture picture.
7. The texture mapping system of claim 6 wherein: the clustering module is specifically configured to:
setting a sequence of triangular faces of each of the meshes
Figure 812115DEST_PATH_IMAGE016
And the input sequence of aerial images
Figure 138054DEST_PATH_IMAGE017
Wherein n represents the number of the triangular surfaces of the grid, and m represents the number of aerial images;
calculating the pixel position of the vertex of the sequence of the mesh triangular surface on the sequence of the aerial images through the transformation matrix of the aerial image corresponding to the camera so as to obtain the projection area S of the mesh triangular surface on the aerial image
Figure 301182DEST_PATH_IMAGE018
Wherein, in the step (A),
Figure 418655DEST_PATH_IMAGE019
representing said mesh triangle plane FiIn picture IjNumber of pixels passing said depth test, FiRepresents the ith mesh triangular surface, IjRepresents the jth aerial image;
and eliminating abnormal images in the candidate image list corresponding to each grid triangular surface.
8. The texture mapping system of claim 6 wherein: the clustering module is further specifically configured to:
when the original grid model is obtained, performing surface smoothing and noise reduction processing on the original grid model M based on a preset grid bilateral filtering algorithm to obtain the original grid model Ms
Region growing based on the original mesh model MsClustering to obtain the original grid model MsThe triangular surface of the grid in (1) belongs to a plane.
9. A computer comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the texture mapping method according to any one of claims 1 to 5 when executing the computer program.
10. A readable storage medium on which a computer program is stored which, when being executed by a processor, carries out the texture mapping method according to any one of claims 1 to 5.
CN202210627375.5A 2022-06-06 2022-06-06 Texture mapping method, system, computer and readable storage medium Active CN114708375B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210627375.5A CN114708375B (en) 2022-06-06 2022-06-06 Texture mapping method, system, computer and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210627375.5A CN114708375B (en) 2022-06-06 2022-06-06 Texture mapping method, system, computer and readable storage medium

Publications (2)

Publication Number Publication Date
CN114708375A true CN114708375A (en) 2022-07-05
CN114708375B CN114708375B (en) 2022-08-26

Family

ID=82177667

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210627375.5A Active CN114708375B (en) 2022-06-06 2022-06-06 Texture mapping method, system, computer and readable storage medium

Country Status (1)

Country Link
CN (1) CN114708375B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114972612A (en) * 2022-07-18 2022-08-30 深圳大学 Image texture generation method based on three-dimensional simplified model and related equipment
CN114998551A (en) * 2022-08-03 2022-09-02 江西博微新技术有限公司 Grid reconstruction quality optimization method, system, computer and readable storage medium
CN117315196A (en) * 2023-10-08 2023-12-29 广州中望龙腾软件股份有限公司 Model construction method, device, equipment and storage medium

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2013174671A1 (en) * 2012-05-22 2013-11-28 Telefonica, S.A. A method and a system for generating a realistic 3d reconstruction model for an object or being
EP3504685A1 (en) * 2016-12-14 2019-07-03 Samsung Electronics Co., Ltd. Method and apparatus for rendering object using mipmap including plurality of textures
CN110148146A (en) * 2019-05-24 2019-08-20 重庆大学 A kind of plant leaf blade dividing method and system using generated data
CN110163947A (en) * 2019-05-24 2019-08-23 北京华捷艾米科技有限公司 A kind of method and relevant apparatus of texture mapping
CN111369660A (en) * 2020-03-02 2020-07-03 中国电子科技集团公司第五十二研究所 Seamless texture mapping method for three-dimensional model
US20200334890A1 (en) * 2019-04-22 2020-10-22 University Of Kentucky Research Foundation Systems and Methods for Fast Texture Mapping of 3D Models
CN113327315A (en) * 2021-06-11 2021-08-31 武汉天远视科技有限责任公司 Multi-level detail model generation method and device
CN113781621A (en) * 2020-11-05 2021-12-10 北京沃东天骏信息技术有限公司 Three-dimensional reconstruction processing method, device, equipment and storage medium
US11282277B1 (en) * 2020-09-28 2022-03-22 Adobe Inc. Systems for shading vector objects

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2013174671A1 (en) * 2012-05-22 2013-11-28 Telefonica, S.A. A method and a system for generating a realistic 3d reconstruction model for an object or being
EP3504685A1 (en) * 2016-12-14 2019-07-03 Samsung Electronics Co., Ltd. Method and apparatus for rendering object using mipmap including plurality of textures
US20200334890A1 (en) * 2019-04-22 2020-10-22 University Of Kentucky Research Foundation Systems and Methods for Fast Texture Mapping of 3D Models
CN110148146A (en) * 2019-05-24 2019-08-20 重庆大学 A kind of plant leaf blade dividing method and system using generated data
CN110163947A (en) * 2019-05-24 2019-08-23 北京华捷艾米科技有限公司 A kind of method and relevant apparatus of texture mapping
CN111369660A (en) * 2020-03-02 2020-07-03 中国电子科技集团公司第五十二研究所 Seamless texture mapping method for three-dimensional model
US11282277B1 (en) * 2020-09-28 2022-03-22 Adobe Inc. Systems for shading vector objects
CN113781621A (en) * 2020-11-05 2021-12-10 北京沃东天骏信息技术有限公司 Three-dimensional reconstruction processing method, device, equipment and storage medium
CN113327315A (en) * 2021-06-11 2021-08-31 武汉天远视科技有限责任公司 Multi-level detail model generation method and device

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
RONGJUN QIN: "Analysis of critical parameters of satellite stereo images for 3D reconstruction and mapping", 《ASPRS ANNUAL CONFERENCE 2018》 *
万燕等: "基于三角网格模型的纹理映射研究", 《计算机应用与软件》 *
刘彬 等: "多参数加权的无缝纹理映射算法", 《中国图象图形学报》 *

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114972612A (en) * 2022-07-18 2022-08-30 深圳大学 Image texture generation method based on three-dimensional simplified model and related equipment
CN114972612B (en) * 2022-07-18 2022-11-11 深圳大学 Image texture generation method based on three-dimensional simplified model and related equipment
CN114998551A (en) * 2022-08-03 2022-09-02 江西博微新技术有限公司 Grid reconstruction quality optimization method, system, computer and readable storage medium
CN114998551B (en) * 2022-08-03 2022-11-18 江西博微新技术有限公司 Grid reconstruction quality optimization method, system, computer and readable storage medium
CN117315196A (en) * 2023-10-08 2023-12-29 广州中望龙腾软件股份有限公司 Model construction method, device, equipment and storage medium
CN117315196B (en) * 2023-10-08 2024-06-11 广州中望龙腾软件股份有限公司 Model construction method, device, equipment and storage medium

Also Published As

Publication number Publication date
CN114708375B (en) 2022-08-26

Similar Documents

Publication Publication Date Title
CN114708375B (en) Texture mapping method, system, computer and readable storage medium
US11410320B2 (en) Image processing method, apparatus, and storage medium
CN115082639B (en) Image generation method, device, electronic equipment and storage medium
CN110458932B (en) Image processing method, device, system, storage medium and image scanning apparatus
US11263356B2 (en) Scalable and precise fitting of NURBS surfaces to large-size mesh representations
CN113781621A (en) Three-dimensional reconstruction processing method, device, equipment and storage medium
CN115082699B (en) Contour shape extraction method and device, electronic equipment and storage medium
CN113593033A (en) Three-dimensional model feature extraction method based on grid subdivision structure
CN112200906B (en) Entity extraction method and system for inclined three-dimensional model
CN112802186A (en) Dynamic scene real-time three-dimensional reconstruction method based on binarization characteristic coding matching
Frommholz et al. Inlining 3d reconstruction, multi-source texture mapping and semantic analysis using oblique aerial imagery
CN115421509B (en) Unmanned aerial vehicle flight shooting planning method, unmanned aerial vehicle flight shooting planning device and storage medium
CN115033972B (en) Method and system for unitizing building main body structures in batches and readable storage medium
CN116503577A (en) Method and system for quickly collecting three-dimensional model of virtual simulation scene
CN114758087B (en) Method and device for constructing urban information model
JP3928016B2 (en) Triangular mesh generation method and program using maximum angle method
CN113763558A (en) Information processing method and device, equipment and storage medium
CN112215959A (en) Three-dimensional model mapping system using picture cutting
CN111445585B (en) Three-dimensional shape corresponding method and device based on dual convex hull domain
CN116402984B (en) Three-dimensional model processing method and device and electronic equipment
JPH07160898A (en) Texture data generating device
CN113596432B (en) Visual angle variable 3D video production method, visual angle variable 3D video production device, visual angle variable 3D video production equipment and storage medium
JP2004227095A (en) Texture map formation method, program for texture map formation, and texture map formation device
Jankó et al. Creating entirely textured 3d models of real objects using surface flattening
JP2022082020A (en) Image processing apparatus, image processing method, and program

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