CN114299266B - Color adjustment method and device for model and storage medium - Google Patents

Color adjustment method and device for model and storage medium Download PDF

Info

Publication number
CN114299266B
CN114299266B CN202111611572.XA CN202111611572A CN114299266B CN 114299266 B CN114299266 B CN 114299266B CN 202111611572 A CN202111611572 A CN 202111611572A CN 114299266 B CN114299266 B CN 114299266B
Authority
CN
China
Prior art keywords
boundary
color adjustment
adjustment amount
mesh
grid
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
CN202111611572.XA
Other languages
Chinese (zh)
Other versions
CN114299266A (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.)
Seashell Housing Beijing Technology Co Ltd
Original Assignee
Seashell Housing Beijing 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 Seashell Housing Beijing Technology Co Ltd filed Critical Seashell Housing Beijing Technology Co Ltd
Priority to CN202111611572.XA priority Critical patent/CN114299266B/en
Publication of CN114299266A publication Critical patent/CN114299266A/en
Application granted granted Critical
Publication of CN114299266B publication Critical patent/CN114299266B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The disclosure provides a color adjustment method, a color adjustment device and a storage medium of a model, which relate to the technical field of image processing, wherein the method comprises the following steps: sampling processing is carried out on a boundary between two adjacent models, a boundary sampling point is obtained, a grid boundary vertex on the boundary and a grid non-boundary vertex belonging to the same grid with the grid boundary vertex are obtained, a first color adjustment quantity of the grid boundary vertex and a second color adjustment quantity of the boundary sampling point are determined, a third color adjustment quantity of the grid non-boundary vertex is determined according to the first color adjustment quantity and the second color adjustment quantity, and texture colors of the two models are adjusted; the method, the device, the electronic equipment and the storage medium can adjust the color of the grid, and have simple and convenient operation and higher processing speed; by adding sampling points on the boundary, the color difference of model splicing is reduced, and the quality of model splicing is improved.

Description

Color adjustment method and device for model and storage medium
Technical Field
The present disclosure relates to the field of image processing technologies, and in particular, to a color adjustment method and apparatus for a model, and a storage medium.
Background
When the scene three-dimensional reconstruction is performed, if the data volume of the model is large, the reconstruction and rendering need to adopt a Level of detail (LOD) technology. In the LOD technique, the "original layer" needs to be reconstructed in blocks, and after reconstruction in blocks, there will be severe color difference when the model is displayed as a whole due to different illumination and other reasons. At present, there are two general techniques for performing color adjustment: the first is to adjust the color of all images, and the method has the advantages that the more accurate corresponding of the feature points can be found through feature matching; the disadvantages are higher complexity and lower speed; the second method is to calculate the color adjustment amount of the boundary (seam) based on the seam connection information between different models, and then interpolate the color adjustment amount inside by using MVC (mean value coordinates); the method has the advantages that the speed is high because the color of the mapping part is only adjusted; the disadvantages are that: 1) The MVC is adopted for interpolation, the required condition is that the mapping of the model is completely expanded into a continuous polygon, but in practical application, the condition is often not met; 2) As the vertexes on the joints are sparse, the sampling rate is insufficient. Therefore, a new color adjustment solution for the model is needed.
Disclosure of Invention
The present disclosure is proposed to solve the above technical problems. The embodiment of the disclosure provides a color adjustment method and device of a model, an electronic device and a storage medium.
According to a first aspect of an embodiment of the present disclosure, there is provided a color adjustment method for a model, including: sampling is carried out on the boundary between two adjacent models to obtain boundary sampling points; acquiring a mesh boundary vertex positioned on the boundary and a mesh non-boundary vertex belonging to the same mesh with the mesh boundary vertex; determining a first color adjustment amount of the grid boundary vertex and a second color adjustment amount of the boundary sampling point based on the texture color information of the two models; determining a third color adjustment amount of the non-boundary vertex of the mesh according to the first color adjustment amount and the second color adjustment amount; and adjusting the texture colors of the two models according to the first color adjustment amount, the second color adjustment amount and the third color adjustment amount.
Optionally, the determining the first color adjustment amount for the mesh boundary vertex comprises: acquiring all first connecting grids connected with the grid boundary vertexes in the two models; determining an average value of texture colors of the entire first connection meshes at the mesh boundary vertices as the first color adjustment amount.
Optionally, the determining the second color adjustment amount of the boundary sample point includes: and determining the average value of the texture colors of the boundary sampling points in the two models as the second color adjustment quantity.
Optionally, the determining, according to the first color adjustment amount and the second color adjustment amount, a third color adjustment amount of the non-boundary vertex of the mesh includes: acquiring all second connection grids connected with the non-boundary vertexes of the grids; acquiring all grid boundary vertexes and all boundary sampling points corresponding to all second connection grids; determining the third color adjustment amount based on the first color adjustment amount of all the mesh boundary vertices and the second color adjustment amount of all the boundary sample points.
Optionally, the determining the third color adjustment amount based on the first color adjustment amounts of all the mesh boundary vertices and the second color adjustment amounts of all the boundary sample points comprises: determining a first weighting factor corresponding to each mesh boundary vertex of the total mesh boundary vertices; determining a second weighting coefficient corresponding to each boundary sample point in all the grid boundary vertexes; and performing weighted average calculation based on the first color adjustment amount and the corresponding first weighting coefficient of each grid boundary vertex in all the grid boundary vertices, and the second color adjustment amount and the corresponding second weighting coefficient of each boundary sampling point in all the grid boundary vertices, so as to determine the third color adjustment amount.
Optionally, the determining the first weighting factor corresponding to each mesh boundary vertex of the all mesh boundary vertices includes: determining a first distance between each mesh boundary vertex of the total mesh boundary vertices and a corresponding mesh non-boundary vertex, and determining the first weighting coefficient based on the first distance; the determining the second weighting coefficients corresponding to the boundary sample points in the entire mesh boundary vertices includes: and determining a second distance between each boundary sampling point in all the grid boundary vertexes and the corresponding grid non-boundary vertex, and determining the second weighting coefficient based on the second distance.
Optionally, the first distance is inversely proportional to the first weighting factor; the second distance is inversely proportional to the second weighting factor.
Optionally, the performing sampling processing on the boundary between two adjacent models, and acquiring boundary sampling points includes: acquiring the boundary side length between two adjacent grid boundary vertexes on the boundary; and if the boundary side length is greater than the length threshold, sampling in the boundary side length based on the acquisition step length to obtain the boundary sampling point.
Optionally, segmenting the whole point cloud to generate a plurality of local point clouds; generating the mesh based on the local point cloud for constructing the model; wherein the grid comprises: and (5) polygonal meshes.
Optionally, the first, second and third color adjustment amounts comprise: color adjustment amounts on the R color channel, the G color channel, and the B color channel.
According to a second aspect of the embodiments of the present disclosure, there is provided a color adjustment apparatus of a model, including: the sampling processing module is used for carrying out sampling processing on the boundary between the two adjacent models to obtain boundary sampling points; the vertex acquisition module is used for acquiring a mesh boundary vertex positioned on the boundary and a mesh non-boundary vertex belonging to the same mesh with the mesh boundary vertex; a first adjustment amount determining module, configured to determine, based on texture color information of the two models, a first color adjustment amount of a vertex of the boundary of the mesh and a second color adjustment amount of the boundary sampling point; a second adjustment amount determining module, configured to determine a third color adjustment amount of the non-boundary vertex of the mesh according to the first color adjustment amount and the second color adjustment amount; and the model color adjusting module is used for adjusting the texture colors of the two models according to the first color adjustment amount, the second color adjustment amount and the third color adjustment amount.
Optionally, the first adjustment amount determining module is configured to obtain, in the two models, all first connection meshes connected to the mesh boundary vertices; determining an average value of texture colors of the entire first connection meshes at the mesh boundary vertices as the first color adjustment amount.
Optionally, the first adjustment amount determining module is configured to determine an average value of texture colors of the boundary sample points in the two models as the second color adjustment amount.
Optionally, the second adjustment amount determining module includes: a mesh determining unit configured to acquire all second connected meshes connected to the mesh non-boundary vertices; an adjustment amount determining unit, configured to obtain all the mesh boundary vertices and all the boundary sampling points corresponding to all the second connected meshes; determining the third color adjustment amount based on the first color adjustment amount of all the mesh boundary vertices and the second color adjustment amount of all the boundary sample points.
Optionally, the adjustment amount determining unit is configured to determine a first weighting coefficient corresponding to each mesh boundary vertex in the all mesh boundary vertices; determining a second weighting coefficient corresponding to each boundary sample point in all the grid boundary vertexes; and performing weighted average calculation based on the first color adjustment amount and the corresponding first weighting coefficient of each grid boundary vertex in all the grid boundary vertices, and the second color adjustment amount and the corresponding second weighting coefficient of each boundary sampling point in all the grid boundary vertices, so as to determine the third color adjustment amount.
Optionally, the adjustment amount determining unit is further configured to determine a first distance between each mesh boundary vertex of the all mesh boundary vertices and a corresponding mesh non-boundary vertex, and determine the first weighting coefficient based on the first distance; determining a second distance between each boundary sample point in all the mesh boundary vertices and the corresponding mesh non-boundary vertex, and determining the second weighting coefficient based on the second distance.
Optionally, the first distance is inversely proportional to the first weighting factor; the second distance is inversely proportional to the second weighting factor.
Optionally, the sampling processing module is configured to obtain a boundary side length between two adjacent grid boundary vertices located on a boundary; and if the side length of the boundary is greater than the length threshold, sampling in the side length of the boundary based on the acquisition step length to obtain the boundary sampling point.
Optionally, the model building module is configured to segment the entire point cloud to generate a plurality of local point clouds; generating the mesh based on the local point cloud for constructing the model; wherein the grid comprises: and (5) polygonal meshes.
Optionally, the first color adjustment amount, the second color adjustment amount, and the third color adjustment amount comprise: color adjustment amounts on the R color channel, the G color channel, and the B color channel.
According to a third aspect of the embodiments of the present disclosure, there is provided an electronic apparatus including: a processor; a memory for storing the processor-executable instructions; the processor is used for executing the method.
According to a fourth aspect of embodiments of the present disclosure, there is provided a computer-readable storage medium storing a computer program for executing the above-mentioned method.
According to a fifth aspect of embodiments of the present disclosure, there is provided a computer program comprising computer readable code which, when run on a device, a processor in the device executes a method for implementing the above.
Based on the method and the device for adjusting the color of the model, the electronic equipment and the storage medium, which are provided by the embodiment of the disclosure, the color of the grid in any expansion form can be adjusted, the operation is simple and convenient, and the processing speed is high; by adding the sampling points on the boundary, the problem of sparse sampling points is solved, the color difference of model splicing is reduced, the quality of model splicing is improved, and the user experience is effectively improved.
The technical solution of the present disclosure is further described in detail by the accompanying drawings and examples.
Drawings
The above and other objects, features and advantages of the present disclosure will become more apparent by describing in more detail embodiments of the present disclosure with reference to the attached drawings. The accompanying drawings are included to provide a further understanding of the embodiments of the disclosure, and are incorporated in and constitute a part of this specification, illustrate embodiments of the disclosure and together with the description serve to explain the principles of the disclosure and not to limit the disclosure. In the drawings, like reference numbers generally represent like parts or steps. FIG. 1 is a flow chart of one embodiment of a color adjustment method of a model of the present disclosure;
FIG. 1 is a flow chart of one embodiment of a color adjustment method of a model of the present disclosure;
FIGS. 2A to 2C are schematic diagrams of generative models;
FIGS. 3A to 3D are schematic views illustrating a model subjected to a mapping process;
FIG. 4 is a schematic diagram of grid boundary vertices and boundary sample points;
FIG. 5 is a schematic diagram of determining color adjustment amounts for non-boundary vertices of a mesh in one embodiment of a color adjustment method of a model of the present disclosure;
FIG. 6 is a schematic diagram of determining a third color adjustment amount in one embodiment of a color adjustment method of a model of the present disclosure;
FIG. 7 is a schematic diagram of mesh boundary vertices and mesh non-boundary vertices;
FIG. 8A is a schematic representation of a model reconstruction without color adjustment for two models; FIG. 8B is a schematic diagram of model reconstruction with color adjustment for two models;
FIG. 9 is a schematic structural diagram of one embodiment of a color adjustment apparatus of the model of the present disclosure;
fig. 10 is a schematic structural diagram of a second adjustment amount determining module in an embodiment of the color adjustment apparatus of the model of the present disclosure;
FIG. 11 is a block diagram of one embodiment of an electronic device of the present disclosure.
Detailed Description
Example embodiments according to the present disclosure will be described in detail below with reference to the accompanying drawings. It is to be understood that the described embodiments are merely a subset of the embodiments of the present disclosure and not all embodiments of the present disclosure, with the understanding that the present disclosure is not limited to the example embodiments described herein.
It should be noted that: the relative arrangement of the components and steps, the numerical expressions, and numerical values set forth in these embodiments do not limit the scope of the present disclosure unless specifically stated otherwise.
It will be understood by those of skill in the art that the terms "first," "second," and the like in the embodiments of the present disclosure are used merely to distinguish one element from another, and are not intended to imply any particular technical meaning, nor is the necessary logical order between them.
It is also understood that in embodiments of the present disclosure, "a plurality" may refer to two or more than two and "at least one" may refer to one, two or more than two.
It is also to be understood that any reference to any component, data, or structure in the embodiments of the disclosure, may be generally understood as one or more, unless explicitly defined otherwise or stated otherwise.
In addition, the term "and/or" in the present disclosure is only one kind of association relationship describing the associated object, and means that there may be three kinds of relationships, such as a and/or B, and may mean: a exists alone, A and B exist simultaneously, and B exists alone. In addition, the character "/" in the present disclosure generally indicates that the former and latter associated objects are in an "or" relationship.
It should also be understood that the description of the various embodiments of the present disclosure emphasizes the differences between the various embodiments, and the same or similar parts may be referred to each other, so that the descriptions thereof are omitted for brevity.
Meanwhile, it should be understood that the sizes of the respective portions shown in the drawings are not drawn in an actual proportional relationship for the convenience of description.
The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit the disclosure, its application, or uses.
Techniques, methods, and apparatus known to those of ordinary skill in the relevant art may not be discussed in detail but are intended to be part of the specification where appropriate.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, further discussion thereof is not required in subsequent figures.
Embodiments of the present disclosure may be implemented in electronic devices such as terminal devices, computer systems, servers, etc., which are operational with numerous other general purpose or special purpose computing system environments or configurations. Examples of well known terminal devices, computing systems, environments, and/or configurations that may be suitable for use with an electronic device, such as a terminal device, computer system, or server, include, but are not limited to: personal computer systems, server computer systems, thin clients, thick clients, hand-held or laptop devices, microprocessor-based systems, set-top boxes, programmable consumer electronics, network pcs, minicomputer systems, mainframe computer systems, distributed cloud computing environments that include any of the above, and the like.
Electronic devices such as terminal devices, computer systems, servers, etc. may be described in the general context of computer system-executable instructions, such as program modules, being executed by a computer system. Generally, program modules may include routines, programs, objects, components, logic, data structures, etc. that perform particular tasks or implement particular abstract data types. The computer system/server may be implemented in a distributed cloud computing environment. In a distributed cloud computing environment, tasks may be performed by remote processing devices that are linked through a communications network. In a distributed cloud computing environment, program modules may be located in both local and remote computer system storage media including memory storage devices.
Summary of the application
In the process of implementing the present disclosure, the inventor finds that, in the existing color adjustment method for the model, the chartlet of the model needs to be completely expanded into a continuous polygon, and the operation is complex and difficult; moreover, the vertexes on the seams are sparse, so that the sampling rate is insufficient, and the models have obvious color difference.
The color adjustment method of the model provided by the disclosure performs sampling processing on a boundary between two adjacent models to obtain a boundary sampling point, obtains a grid boundary vertex on the boundary and a grid non-boundary vertex belonging to the same grid as the grid boundary vertex, determines a first color adjustment amount of the grid boundary vertex and a second color adjustment amount of the boundary sampling point, determines a third color adjustment amount of the grid non-boundary vertex according to the first color adjustment amount and the second color adjustment amount, and adjusts texture colors of the two models. The color adjustment method of the model can adjust the color of the grid in any expansion form, is simple and convenient to operate and has high processing speed; by adding sampling points on the boundary, the color difference of model splicing is reduced, and the quality of model splicing is improved.
Exemplary method
Fig. 1 is a flowchart of an embodiment of a color adjustment method of a model of the present disclosure, the method shown in fig. 1 includes the steps of: S101-S105. The following will explain each step.
S101, sampling processing is carried out on the boundary between two adjacent models, and boundary sampling points are obtained.
S102, obtaining a grid boundary vertex positioned on the boundary and a grid non-boundary vertex belonging to the same grid with the grid boundary vertex.
In one embodiment, the meshes constituting the two models include polygonal meshes and the like, and the polygonal meshes may be triangular meshes, quadrangular meshes, pentagonal meshes and the like. And acquiring boundary sampling points and grid boundary vertexes on the boundaries of the two models, acquiring a grid where the grid boundary vertexes are positioned, and determining vertexes which belong to the grid and are not positioned on the boundary as non-boundary vertexes of the grid.
S103, determining a first color adjustment amount of the grid boundary vertex and a second color adjustment amount of the boundary sampling point based on the texture color information of the two models.
And S104, determining a third color adjustment amount of the non-boundary vertex of the mesh according to the first color adjustment amount and the second color adjustment amount.
And S105, adjusting the texture colors of the two models according to the first color adjustment amount, the second color adjustment amount and the third color adjustment amount.
In one embodiment, the first, second, and third color adjustment amounts comprise color adjustment amounts on an R color channel, a G color channel, and a B color channel. The texture colors of the two models can be adjusted in the R color channel, the G color channel, and the B color channel, respectively, according to the first color adjustment amount, the second color adjustment amount, and the third color adjustment amount by using various existing methods, and a texture atlas after color adjustment is output. For example, the texture color adjustment amount inside the mesh is interpolated according to the first color adjustment amount, the second color adjustment amount, and the third color adjustment amount to perform color adjustment on the map (texture atlas) of the model.
In one embodiment, the global point cloud is sliced to generate a plurality of local point clouds. And generating a triangular grid, a quadrilateral grid or a pentagonal grid and the like based on the local point cloud so as to construct a model and splice a larger model. For example, the whole point cloud is segmented to generate two partial point clouds, the two partial point clouds are separately reconstructed, and a mesh (mesh) is generated from the point clouds to construct two corresponding models, as shown in fig. 2A and 2B; the two models are spliced to generate a model, as shown in fig. 2C. The generated grid can be reconstructed by various methods, such as poisson reconstruction or delaynay + graph cut reconstruction. The meshes of the two models and the one model generated after stitching are subjected to mapping (without color adjustment), as shown in fig. 3A, 3B and 3C.
Texture in computer graphics includes both grooves, which in the usual sense appear uneven on the surface of an object, and color patterns on smooth surfaces of objects. When rendering each frame of image is realized, the graphics engine needs to create textures for a plurality of image data included in each frame of image.
To reduce the waste of video memory by textures, the textures may be pieced together into a large Texture map called Texture Atlas (Texture Atlas), which is composed of multiple patterns, as shown in fig. 3D. When the model is displayed (rasterized), the vertices of the mesh correspond to the texture atlas, so as to obtain color information of the model, wherein the color information is color information on an R color channel, a G color channel, and a B color channel.
In one embodiment, determining the first color adjustment amount for the mesh boundary vertices may employ a variety of methods. And acquiring all first connecting grids connected with the grid boundary vertexes in the two models, and determining the average value of texture colors of all the first connecting grids at the grid boundary vertexes as a first color adjustment quantity. For example, the two models are model a and model B, respectively, in which all the first connected meshes connected to the mesh boundary vertex C are acquired, and the average value of the texture colors of all the first connected meshes at the mesh boundary vertex C is calculated as the first color adjustment amount.
The sampling process on the boundary between two adjacent models may employ various methods. And acquiring the boundary side length between two adjacent grid boundary vertexes on the boundary, and if the boundary side length is greater than a length threshold, sampling in the boundary side length based on the acquisition step length to acquire a boundary sampling point. As shown in FIG. 4, the open dots are the mesh boundary vertices A1-A4 on the boundary between the two models, and the intersection dots are the vertex boundary sample points on the boundary. For example, the boundary side length between two adjacent grid boundary vertices A1 and A2 on the boundary is obtained, and if the boundary side length is greater than the length threshold, sampling processing is performed in the boundary side length based on the acquisition step length to obtain boundary sampling points. The number and position of the boundary sample points are calculated as follows:
sample_num=round(dis/KSampleStep)–1 (1-1);
wherein sample _ num is the number of boundary sampling points, KSampleStep is the acquisition step length, dis is the boundary side length between two adjacent grid boundary vertexes on the boundary, and round represents the calculation of rounding.
pos_i=start+i*KSampleStep+normlize(end-start) (1-2);
The pos _ i is the position of the ith boundary sampling point, and the start and the end are the positions of two adjacent grid boundary vertexes on the boundary respectively and are respectively used as a starting point and an end point; norm () is a unit vector that normalizes vectors, i.e., represents edges.
The second color adjustment amount for determining the boundary sample points may take various forms. And determining the average value of the texture colors of the boundary sampling points in the two models as a second color adjustment quantity. For example, the two models are model a and model B, respectively, two texture colors at the boundary sampling point D are determined in model a and model B, respectively, and an average value of the two texture colors is calculated as the first color adjustment amount.
In one embodiment, determining the third amount of color adjustment for the non-boundary vertices of the mesh may employ a variety of methods. Fig. 5 is a schematic diagram of determining a color adjustment amount of a mesh non-boundary vertex in an embodiment of a color adjustment method of a model of the present disclosure, where the method shown in fig. 5 includes the steps of: S501-S503. The following describes each step.
S501, all second connected grids connected with the non-boundary vertex of the grid are obtained.
And S502, acquiring all grid boundary vertexes and all boundary sampling points corresponding to all second connected grids.
S503, determining a third color adjustment amount based on the first color adjustment amounts of all the mesh boundary vertices and the second color adjustment amounts of all the boundary sample points.
Various methods may be employed to determine the third color adjustment amount based on the first color adjustment amounts of all the mesh boundary vertices and the second color adjustment amounts of all the boundary sample points. Fig. 6 is a schematic diagram of determining a third color adjustment amount in an embodiment of the color adjustment method of the model of the present disclosure, and the method shown in fig. 6 includes the steps of: S601-S603. The following describes each step.
S601, a first weighting coefficient corresponding to each mesh boundary vertex of all the mesh boundary vertices is determined.
In one embodiment, a first distance between each mesh boundary vertex of the total mesh boundary vertices and the corresponding mesh non-boundary vertex is determined, and a first weighting factor is determined based on the first distance. The first weighting factor may be calculated by an inverse scaling function based on the first distance, the first distance being inversely proportional to the first weighting factor.
And S602, determining second weighting coefficients corresponding to each boundary sampling point in all the grid boundary vertexes.
In one embodiment, a second distance between each boundary sample point in all mesh boundary vertices and the corresponding mesh non-boundary vertex is determined, and a second weighting factor is determined based on the second distance. The second weighting factor may be calculated by an inverse scaling function based on the second distance, the second distance being inversely proportional to the second weighting factor.
S603, performing weighted average calculation based on the first color adjustment amount and the corresponding first weighting coefficient of each grid boundary vertex in all grid boundary vertices, and the second color adjustment amount and the corresponding second weighting coefficient of each boundary sampling point in all grid boundary vertices, and determining a third color adjustment amount.
As shown in FIG. 7, there are 10 vertices, V, in FIG. 7 1 ……V 8 As mesh boundary vertices, V 9 And V 10 Are mesh non-boundary vertices (interior vertices). A third color adjustment amount is calculated for all mesh non-boundary vertices inside the mesh. Supposing that n vertexes are provided, wherein the vertexes from 0 to i are marked as grid boundary vertexes, the vertexes from i to n-1 are marked as grid non-boundary vertexes, and the first color adjustment quantity of the kth grid boundary vertex is marked as c k Assuming that there are m boundary samples, let the second color adjustment amount of the k-th boundary sample be s k (ii) a If the ith mesh boundary vertex is on the boundary, the first color adjustment amount of the mesh boundary vertex is the average value of the texture colors of all meshes (distributed in two adjacent models) connected by the mesh boundary vertex at the mesh boundary vertex; the boundary sample point located on the boundary is the average of the texture colors of this boundary sample point in the two models.
In one embodiment, the third color adjustment to computationally determine the non-boundary vertices of the mesh is:
Figure BDA0003435570710000101
wherein, c i A third color adjustment amount for the ith mesh non-boundary vertex; obtaining all second connected meshes, adj _ num, connected to the ith mesh non-boundary vertex i Is the number of all mesh boundary vertices and all boundary sample points (i.e., adj _ num) corresponding to all second connected meshes i The number of the grid boundary vertexes and the boundary sampling points corresponding to the ith grid non-boundary vertex); NV (non-volatile memory) I And NS I A set of mesh boundary vertices and a boundary sample corresponding to the ith mesh non-boundary vertex, respectivelySampling point set;
Figure BDA0003435570710000102
and
Figure BDA0003435570710000103
respectively corresponding to the ith mesh non-boundary vertex j Non-boundary vertex of each mesh and the ns j A first color adjustment amount and a second color adjustment amount of the boundary sample points;
Figure BDA0003435570710000111
is equal to n j A first weighting coefficient corresponding to each mesh non-boundary vertex;
Figure BDA0003435570710000112
is the ns j And a second weighting coefficient corresponding to each boundary sample point.
The number of the equations (1-3) may be n, and a linear equation system AX = b may be obtained, where X is a third color adjustment amount of non-boundary vertices of the solved mesh, a is a weight coefficient and is a sparse matrix, and b is a boundary color adjustment amount and has a unique solution. The texture colors of the two models may be adjusted according to the first color adjustment amount, the second color adjustment amount, and the third color adjustment amount using an existing method. For example, the conventional interpolation method is used to interpolate the color adjustment amount of the grid on the texture according to the first color adjustment amount, the second color adjustment amount, and the third color adjustment amount for pixels on three channels of R, G, and B, and a texture atlas with the color adjusted is output.
When large scene three-dimensional reconstruction is performed, the two models are spliced by using the existing method, and the two models have obvious color difference, as shown in fig. 8A. After color adjustment using the color adjustment method of the model of the present disclosure, as shown in fig. 8B, it can be seen that the color difference between the models is substantially eliminated.
According to the color adjustment method of the model, the model is not required to be completely unfolded into a continuous polygon, and the color adjustment can be performed on the grid in any unfolding form; by adding sampling points on the boundary, the problem of sparse sampling points is solved.
Exemplary devices
In one embodiment, as shown in fig. 9, the present disclosure provides a color adjustment apparatus of a model, including: a sampling processing module 91, a vertex obtaining module 92, a first adjustment amount determining module 93, a second adjustment amount determining module 94, a model color adjusting module 95, and a model building model 96.
The sampling processing module 91 performs sampling processing on the boundary between two adjacent models to obtain boundary sampling points. For example, the sampling processing module 91 obtains the boundary side length between two adjacent grid boundary vertices located on the boundary, and if the boundary side length is greater than the length threshold, performs sampling processing in the boundary side length based on the acquisition step length to obtain the boundary sampling point.
The vertex acquisition module 92 acquires mesh boundary vertices located on the boundary and mesh non-boundary vertices belonging to the same mesh as the mesh boundary vertices. The first adjustment amount determining module 93 determines a first color adjustment amount of a vertex of a boundary of the mesh and a second color adjustment amount of a sample point of the boundary based on texture color information of the two models.
The second adjustment amount determining module 94 determines a third color adjustment amount for the non-boundary vertices of the mesh according to the first color adjustment amount and the second color adjustment amount. The model color adjustment module 95 adjusts the texture colors of the two models according to the first color adjustment amount, the second color adjustment amount, and the third color adjustment amount. The model building module 96 segments the entire point cloud to generate a plurality of local point clouds and a mesh is generated based on the local point clouds to build a model, wherein the mesh includes a polygonal mesh.
In one embodiment, the first adjustment amount determining module 93 obtains all first connected meshes connected to the mesh boundary vertices in the two models; the first adjustment amount determining module 93 determines an average value of texture colors of all the first connection grids at the grid boundary vertices as a first color adjustment amount; the first adjustment amount determining module 93 determines an average value of texture colors of the boundary sample points in the two models as a second color adjustment amount.
As shown in fig. 10, the second adjustment amount determining module 94 includes a mesh determining unit 941 and an adjustment amount determining unit 942. The mesh determination unit 941 acquires all the second connected meshes connected to mesh non-boundary vertices. The adjustment amount determining unit 942 obtains all the mesh boundary vertices and all the boundary sample points corresponding to all the second connected meshes; the adjustment amount determination unit 942 determines a third color adjustment amount based on the first color adjustment amounts of all the mesh boundary vertices and the second color adjustment amounts of all the boundary sample points.
In one embodiment, the adjustment amount determining unit 942 determines first weighting coefficients corresponding to respective mesh boundary vertices of all mesh boundary vertices and determines second weighting coefficients corresponding to respective boundary sampling points of all mesh boundary vertices. The adjustment amount determination unit 942 performs weighted average calculation based on the first color adjustment amount and the corresponding first weighting coefficient of each mesh boundary vertex in all mesh boundary vertices, the second color adjustment amount and the corresponding second weighting coefficient of each boundary sample point in all mesh boundary vertices, and determines the third color adjustment amount.
The adjustment amount determination unit 942 determines a first distance between each mesh boundary vertex of all the mesh boundary vertices and the corresponding mesh non-boundary vertex, and determines a first weighting coefficient based on the first distance. The adjustment amount determining unit 942 determines a second distance between each boundary sample point of all mesh boundary vertices and the corresponding mesh non-boundary vertex, and determines a second weighting coefficient based on the second distance. The first distance is inversely proportional to the first weighting factor and the second distance is inversely proportional to the second weighting factor.
FIG. 11 is a block diagram of one embodiment of an electronic device of the present disclosure, as shown in FIG. 11, electronic device 111 includes one or more processors 1111 and memory 1112.
The processor 1111 may be a Central Processing Unit (CPU) or other form of processing unit having data processing capabilities and/or instruction execution capabilities, and may control other components in the electronic device 111 to perform desired functions.
Memory 1112 may include one or more computer program products that may include various forms of computer-readable storage media, such as volatile memory and/or non-volatile memory. Volatile memory, for example, may include: random Access Memory (RAM) and/or cache memory (cache), etc. The nonvolatile memory, for example, may include: read Only Memory (ROM), hard disk, flash memory, and the like. One or more computer program instructions may be stored on a computer-readable storage medium and executed by the processor 1111 to implement the color adjustment methods of the models of the various embodiments of the present disclosure described above and/or other desired functions. Various contents such as an input signal, a signal component, a noise component, etc. may also be stored in the computer-readable storage medium.
In one example, the electronic device 111 may further include: an input device 1113, and an output device 1114, among other components, interconnected by a bus system and/or other form of connection mechanism (not shown). The input device 1113 may also include, for example, a keyboard, mouse, or the like. The output device 1114 can output various information to the outside. The output devices 1114 may include, for example, a display, speakers, a printer, and a communication network and remote output devices connected thereto, among others.
Of course, for simplicity, only some of the components of the electronic device 111 relevant to the present disclosure are shown in fig. 11, and components such as buses, input/output interfaces, and the like are omitted. In addition, electronic device 111 may include any other suitable components, depending on the particular application.
In addition to the above-described methods and apparatus, embodiments of the present disclosure may also be a computer program product comprising computer program instructions that, when executed by a processor, cause the processor to perform the steps in the color adjustment method of a model according to various embodiments of the present disclosure described in the "exemplary methods" section of this specification above.
The computer program product may write program code for performing the operations of embodiments of the present disclosure in any combination of one or more programming languages, including an object oriented programming language such as Java, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computing device, partly on the user's device, as a stand-alone software package, partly on the user's computing device and partly on a remote computing device, or entirely on the remote computing device or server.
Furthermore, embodiments of the present disclosure may also be a computer-readable storage medium having stored thereon computer program instructions that, when executed by a processor, cause the processor to perform the steps in the color adjustment method of a model according to various embodiments of the present disclosure described in the "exemplary methods" section above in this specification.
The computer-readable storage medium may take any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may include, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples (a non-exhaustive list) of the readable storage medium may include: an electrical connection having one or more wires, a portable disk, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
In one embodiment, the present disclosure provides a computer program comprising computer readable code, characterized in that when the computer readable code is run on a device, a processor in the device executes a color adjustment method for implementing a model as in any of the above embodiments.
The foregoing describes the general principles of the present disclosure in conjunction with specific embodiments, however, it is noted that the advantages, effects, etc. mentioned in the present disclosure are merely examples and are not limiting, and they should not be considered essential to the various embodiments of the present disclosure. Furthermore, the foregoing disclosure of specific details is for the purpose of illustration and description and is not intended to be limiting, since the disclosure is not intended to be limited to the specific details so described.
The color adjustment method and device of the model, the electronic device and the storage medium in the embodiment do not need to completely expand the model into a continuous polygon, can adjust the color of the grid in any expansion form, and have simple operation and high processing speed; by adding the sampling points on the boundary, the problem of sparse sampling points is solved, the color difference of model splicing is reduced, the quality of model splicing is improved, and the user experience is effectively improved.
In the present specification, the embodiments are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same or similar parts in the embodiments are referred to each other. For the system embodiment, since it basically corresponds to the method embodiment, the description is relatively simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
The block diagrams of devices, apparatuses, systems referred to in this disclosure are only given as illustrative examples and are not intended to require or imply that the connections, arrangements, configurations, etc. must be made in the manner shown in the block diagrams. These devices, apparatuses, devices, and systems may be connected, arranged, configured in any manner, as will be appreciated by those skilled in the art. Words such as "including," comprising, "having," and the like are open-ended words that mean "including, but not limited to," and are used interchangeably therewith. The words "or" and "as used herein mean, and are used interchangeably with, the word" and/or, "unless the context clearly dictates otherwise. The word "such as" is used herein to mean, and is used interchangeably with, the phrase "such as but not limited to".
The methods and apparatus of the present disclosure may be implemented in a number of ways. For example, the methods and apparatus of the present disclosure may be implemented by software, hardware, firmware, or any combination of software, hardware, and firmware. The above-described order for the steps of the method is for illustration only, and the steps of the method of the present disclosure are not limited to the order specifically described above unless specifically stated otherwise. Further, in some embodiments, the present disclosure may also be embodied as programs recorded in a recording medium, the programs including machine-readable instructions for implementing the methods according to the present disclosure. Thus, the present disclosure also covers a recording medium storing a program for executing the method according to the present disclosure.
It is also noted that in the devices, apparatuses, and methods of the present disclosure, each component or step can be decomposed and/or recombined. Such decomposition and/or recombination should be considered as equivalents of the present disclosure.
The previous description of the disclosed aspects is provided to enable any person skilled in the art to make or use the present disclosure. Various modifications to these aspects, and the like, will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other aspects without departing from the scope of the disclosure. Thus, the present disclosure is not intended to be limited to the aspects shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
The foregoing description has been presented for purposes of illustration and description. Furthermore, the description is not intended to limit embodiments of the disclosure to the form disclosed herein. While a number of example aspects and embodiments have been discussed above, those of skill in the art will recognize certain variations, modifications, alterations, additions and sub-combinations thereof.

Claims (7)

1. A method for color adjustment of a model, comprising:
sampling is carried out on the boundary between two adjacent models to obtain boundary sampling points;
acquiring a grid boundary vertex positioned on the boundary and a grid non-boundary vertex belonging to the same grid with the grid boundary vertex;
determining a first color adjustment amount of the grid boundary vertex and a second color adjustment amount of the boundary sampling point based on the texture color information of the two models, comprising:
acquiring all first connecting grids connected with the grid boundary vertexes in the two models;
determining an average value of texture colors of all the first connection grids at the grid boundary vertex as the first color adjustment amount;
determining an average value of texture colors of the boundary sampling points in the two models as the second color adjustment quantity;
determining a third color adjustment amount for the non-boundary vertices of the mesh based on the first and second color adjustment amounts, comprising:
acquiring all second connection grids connected with the non-boundary vertexes of the grids;
acquiring all grid boundary vertexes and all boundary sampling points corresponding to all second connection grids;
determining the third color adjustment amount based on the first color adjustment amount of all the grid boundary vertexes and the second color adjustment amount of all the boundary sampling points;
and adjusting the texture colors of the two models according to the first color adjustment amount, the second color adjustment amount and the third color adjustment amount.
2. The method of claim 1, wherein the determining the third color adjustment amount based on the first color adjustment amounts of all of the mesh boundary vertices and the second color adjustment amounts of all of the boundary sample points comprises:
determining a first weighting factor corresponding to each mesh boundary vertex of the total mesh boundary vertices;
determining a second weighting coefficient corresponding to each boundary sample point in all the grid boundary vertexes;
and performing weighted average calculation based on the first color adjustment amount and the corresponding first weighting coefficient of each grid boundary vertex in all the grid boundary vertices, and the second color adjustment amount and the corresponding second weighting coefficient of each boundary sampling point in all the grid boundary vertices, so as to determine the third color adjustment amount.
3. The method of claim 2, the determining first weighting coefficients corresponding to respective ones of the total number of mesh boundary vertices comprising:
determining a first distance between each mesh boundary vertex of the total mesh boundary vertices and a corresponding mesh non-boundary vertex, and determining the first weighting coefficient based on the first distance;
the determining the second weighting coefficients corresponding to the boundary sample points in the entire mesh boundary vertices includes:
determining a second distance between each boundary sample point in all the mesh boundary vertices and the corresponding mesh non-boundary vertex, and determining the second weighting coefficient based on the second distance.
4. The method of claim 3, wherein,
the first distance is in inverse proportional relation with the first weighting coefficient; the second distance is inversely proportional to the second weighting factor.
5. The method of claim 1, wherein the sampling process is performed on a boundary between two adjacent models, and obtaining boundary sampling points comprises:
acquiring the boundary side length between two adjacent grid boundary vertexes on the boundary;
and if the boundary side length is greater than the length threshold, sampling in the boundary side length based on the acquisition step length to obtain the boundary sampling point.
6. An apparatus for color adjustment of a model, comprising:
the sampling processing module is used for carrying out sampling processing on the boundary between the two adjacent models to obtain a boundary sampling point;
the vertex acquisition module is used for acquiring a mesh boundary vertex positioned on the boundary and a mesh non-boundary vertex belonging to the same mesh with the mesh boundary vertex;
a first adjustment amount determining module, configured to determine, based on texture color information of the two models, a first color adjustment amount of a vertex of the mesh boundary and a second color adjustment amount of the boundary sample point; wherein all first connected meshes connected with the mesh boundary vertices are obtained in the two models; determining an average value of texture colors of all the first connection grids at the grid boundary vertex as the first color adjustment amount; determining an average value of texture colors of the boundary sampling points in the two models as the second color adjustment quantity;
a second adjustment amount determining module, configured to determine a third color adjustment amount of the non-boundary vertex of the mesh according to the first color adjustment amount and the second color adjustment amount; acquiring all second connection grids connected with the non-boundary vertexes of the grids; acquiring all grid boundary vertexes and all boundary sampling points corresponding to all second connection grids; determining the third color adjustment amount based on the first color adjustment amount of all the grid boundary vertexes and the second color adjustment amount of all the boundary sampling points;
and the model color adjusting module is used for adjusting the texture colors of the two models according to the first color adjustment amount, the second color adjustment amount and the third color adjustment amount.
7. A computer-readable storage medium, characterized in that the storage medium stores a computer program for performing the method of any of the preceding claims 1-5.
CN202111611572.XA 2021-12-27 2021-12-27 Color adjustment method and device for model and storage medium Active CN114299266B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111611572.XA CN114299266B (en) 2021-12-27 2021-12-27 Color adjustment method and device for model and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111611572.XA CN114299266B (en) 2021-12-27 2021-12-27 Color adjustment method and device for model and storage medium

Publications (2)

Publication Number Publication Date
CN114299266A CN114299266A (en) 2022-04-08
CN114299266B true CN114299266B (en) 2023-02-28

Family

ID=80969443

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111611572.XA Active CN114299266B (en) 2021-12-27 2021-12-27 Color adjustment method and device for model and storage medium

Country Status (1)

Country Link
CN (1) CN114299266B (en)

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110832548A (en) * 2018-11-08 2020-02-21 深圳市大疆创新科技有限公司 Method and device for simplifying three-dimensional grid model
CN112785674A (en) * 2021-01-22 2021-05-11 北京百度网讯科技有限公司 Texture map generation method, rendering method, device, equipment and storage medium
CN113093903B (en) * 2021-03-18 2023-02-07 聚好看科技股份有限公司 Image display method and display equipment
CN113538562B (en) * 2021-07-16 2022-05-13 贝壳找房(北京)科技有限公司 Indoor area determination method and device, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN114299266A (en) 2022-04-08

Similar Documents

Publication Publication Date Title
US8665258B2 (en) Generating a depth map based on a single image
EP3789964A1 (en) Three-dimensional (3d) rendering method and apparatus
US7450758B2 (en) Stylization of video
Spencer et al. Evenly spaced streamlines for surfaces: An image‐based approach
EP0875860B1 (en) Precise gradient calculation system and method for a texture mapping system of a computer graphics system
EP1564687A2 (en) Method and apparatus for high speed visualization of depth image-based 3D graphic data
WO2008013605A1 (en) Real-time gpu rendering of piecewise algebraic surfaces
US20150022525A1 (en) Triangle rasterization
US10296664B2 (en) Scalable and precise fitting of NURBS surfaces to large-size mesh representations
US11450078B2 (en) Generating height maps from normal maps based on virtual boundaries
Hurtado et al. Enveloping CAD models for visualization and interaction in XR applications
EP4287134A1 (en) Method and system for generating polygon meshes approximating surfaces using root-finding and iteration for mesh vertex positions
US8049753B2 (en) Computer graphics methods and systems for generating images with rounded corners
CN114299266B (en) Color adjustment method and device for model and storage medium
US20220375152A1 (en) Method for Efficiently Computing and Specifying Level Sets for Use in Computer Simulations, Computer Graphics and Other Purposes
CN113592994B (en) Method, apparatus and storage medium for texture mapping
Froumentin et al. A Vector‐based Representation for Image Warping
CN116503562B (en) Method for determining space building information model and fusing three-dimensional space model images
CN117173371A (en) Method and system for generating polygonal mesh approximating curved surface using root finding and iteration for mesh vertex position
Hjelmervik et al. Interactive exploration of big scientific data: new representations and techniques
US20230394767A1 (en) Method and system for generating polygon meshes approximating surfaces using root-finding and iteration for mesh vertex positions
Li Design of 3D Image Visual Communication System for Automatic Reconstruction of Digital Images
KR100512567B1 (en) Displaced Subdivision Mesh restoration method for face animation
Ran et al. Image retargeting based on spring analogy
CN117876214A (en) Apparatus and method for two-dimensional scene reconstruction of dynamic three-dimensional space

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