A texture mapping method, system and medium for three-dimensional building model
By obtaining the model information and texture library pictures of the building's 3D model, and using the filling coefficient calculation method to perform automatic texture filling, the problem of low texture information filling efficiency of the building's 3D model is solved, and fast and high-realistic texture information filling efficiency is achieved. Cost reduction.
Patent Information
- Application Number
- CN202410451971.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-16
- Publication Date
- 2024-08-27
- Estimated Expiration
- 2044-04-16
AI Technical Summary
In the existing technology, the texture information filling efficiency of three-dimensional building models is low, and high-realistic texture information filling cannot be quickly realized, especially for building models of different heights and different orientations.
By obtaining the model information of the three-dimensional building model, the size characteristics and floor type of the patch are determined, matching texture pictures are obtained based on the texture library, and the filling coefficient calculation method is used to automatically fill the building model with texture, including column and Row-wise padding, and adjacent or spaced padding.
It realizes fast and highly realistic texture information filling for three-dimensional building models of different heights and different orientations, improves the texture information filling efficiency and reduces labor cost investment.
Smart Images

Figure CN118071913B
Abstract
Description
Technical Field
[0001] The present application belongs to the field of geographic surveying and mapping technology, and in particular, relates to a texture mapping method, system and medium for a three-dimensional model of a building. Background Art
[0002] The initially constructed 3D model of a building is a white model with no texture information filled in and a blank surface. In order to improve the realism and interactivity of the scene effect presented by the 3D model of the building, texture information is usually filled on the white model to enhance the visual effect presented by the final 3D model of the building.
[0003] At present, the document "Technical Regulations for Rapid Construction of Realistic 3D China Urban 3D Model (LOD1.3 Level) (Trial)" issued by the Ministry of Natural Resources points out that "textures should be selected from pictures with the same color as the real texture of the building, and the texture should be as consistent as possible with the real material of the building (wood, stone, glass, metal, etc.). The number of floors of the texture should be as consistent or close to the number of floors of the building as possible. " Therefore, it is necessary to match the corresponding texture pictures to fill the texture information of the white film at different heights and different orientations. In the existing technology, manual mapping is usually relied on, but the manual mapping method not only requires the staff to have certain texture matching experience and mapping skills, but also when it comes to large-scale 3D models of buildings, this type of method has low work efficiency and cannot quickly achieve high-realistic texture information filling of large-scale 3D models of buildings.
[0004] Therefore, there is an urgent need for a method for quickly achieving highly realistic automated texture information filling for three-dimensional building models of different heights and orientations. Summary of the invention
[0005] In view of the above-mentioned shortcomings of the prior art, the purpose of the present application is to provide a texture mapping method for a three-dimensional building model, which is used to solve the problems of low authenticity and slow filling speed of the filled texture information for three-dimensional building models of different heights and orientations.
[0006] To achieve the above object and other related objects, the present invention provides a texture mapping method for a three-dimensional building model, comprising the following steps:
[0007] Acquire model information of an initial three-dimensional building model; the initial three-dimensional building model includes various facets; the model information includes: size characteristics and floor types corresponding to each of the facets;
[0008] Acquire a texture image corresponding to each of the face patches in a texture library; the texture image has a size feature;
[0009] Determine a corresponding filling factor calculation method according to the floor type corresponding to the face patch; obtain a corresponding filling factor of the texture image according to the corresponding filling factor calculation method based on the size characteristics of the face patch and the size characteristics of the texture image;
[0010] Based on each of the texture images, the initial building three-dimensional model is filled with the corresponding filling coefficient to obtain a target building three-dimensional model.
[0011] In one embodiment of the present invention, the filling factor includes a column filling factor and a row filling factor; when the floor type corresponding to the patch is a wall, the size feature of the patch includes a first size and a second size, or the size feature of the patch includes a first size and a third size; based on the size feature of the patch and the size feature of the texture image, according to the corresponding filling factor calculation method, obtaining the corresponding filling factor of the texture image includes:
[0012] Based on the first size of the patch and a preset single-floor height, obtaining the number of floors corresponding to the patch, and using the number of floors as a column-wise filling factor of the texture image;
[0013] Obtaining a first ratio based on the second size of the patch and the first size of the patch, or obtaining a first ratio based on the third size of the patch and the first size of the patch;
[0014] Based on the picture height and the picture width of the texture picture, a second ratio is obtained; based on the column-wise filling factor, the first ratio and the second ratio, a row-wise filling factor of the texture picture is constructed;
[0015] Among them, the first size is the building height of the initial building three-dimensional model corresponding to the face patch; the second size is the building width of the initial building three-dimensional model corresponding to the face patch; and the third size is the building depth of the initial building three-dimensional model corresponding to the face patch.
[0016] In one embodiment of the present invention, when the floor type corresponding to the patch is a top surface, the size feature of the patch includes a second size and a third size; the filling factor includes a column-wise filling factor and a row-wise filling factor, then based on the size feature of the patch and the size feature of the texture image, according to the corresponding filling factor calculation method, obtaining the filling factor of the texture image includes:
[0017] Using the ratio of the third size of the patch to the image height of the texture image as a column-wise filling coefficient of the texture image, so as to achieve filling of the texture image along the depth direction of the building;
[0018] The ratio of the second size of the patch to the image width of the texture image is used as a row-wise filling coefficient of the texture image to achieve filling of the texture image along the building width direction.
[0019] In one embodiment of the present invention, when the floor type corresponding to the patch is a wall, the size feature of the patch includes a first size and a second size, or the size feature of the patch includes a first size and a third size, and a method for acquiring the size feature corresponding to the patch includes:
[0020] Constructing a local coordinate system of the patch, obtaining a first rectangular projection of the patch on a second horizontal plane, extracting a height and a width of the first rectangular projection, using the height of the first rectangular projection as a first size of the patch, using the width of the first rectangular projection as a second size of the patch, or using the height of the first rectangular projection as a first size of the patch, using the width of the first rectangular projection as a third size of the patch; the second horizontal plane is a coordinate plane in the local coordinate system that is parallel to the patch;
[0021] Among them, the height direction of the first rectangular projection is the same as the building height direction of the initial building three-dimensional model; the width direction of the first rectangular projection is the same as the building width direction of the initial building three-dimensional model, or the width direction of the first rectangular projection is the same as the building depth direction of the initial building three-dimensional model.
[0022] In one embodiment of the present invention, the method for acquiring the texture image matching the texture matching parameter includes:
[0023] According to the texture matching parameters, each texture information matching the texture matching parameters is obtained, and according to each texture information, each texture image matching the texture matching parameters is searched in the texture library respectively, and each texture image is used as the texture image of the corresponding face patch.
[0024] In one embodiment of the present invention, the local coordinate system is constructed by:
[0025] Obtain the direction of the intersection line between the plane where the face patch is located and the second horizontal plane, and use the direction of the intersection line as the first coordinate axis direction of the local coordinate system of the face patch; obtain the normal direction of the face patch, and use the normal direction of the face patch as the second coordinate axis direction of the local coordinate system of the face patch; determine the third coordinate axis direction of the local coordinate system of the face patch based on the first coordinate axis direction and the second coordinate axis direction; construct the local coordinate system of the face patch based on the first coordinate axis direction, the second coordinate axis direction and the third coordinate axis direction; the second horizontal plane is a coordinate plane in the global coordinate system that is parallel to the face patch of the top surface type.
[0026] In one embodiment of the present invention, the filling coefficient includes: a column filling coefficient and a row filling coefficient, and the filling of the initial building three-dimensional model using the corresponding filling coefficient based on each of the texture images includes:
[0027] Acquire a face patch to be filled; align a vertex of the face patch to be filled with a corresponding vertex of the corresponding texture image, and fill the texture image into the face patch along the column direction and the row direction respectively according to the column-wise filling coefficient and the row-wise filling coefficient to obtain a filled face patch; perform the above-mentioned filling process on other face patches to be filled, obtain each filled face patch, and realize the filling of the initial three-dimensional building model.
[0028] In one embodiment of the present invention, when the floor type corresponding to the face patch is a wall, after obtaining the fill factor of the texture image, the method further includes:
[0029] Based on the filling coefficient, determine whether the texture image is fully filled, if so, perform texture filling on the patch using an adjacent filling method according to the filling coefficient; if not, perform texture filling on the patch using an interval filling method based on the filling coefficient;
[0030] Among them, the texture filling of the surface patch by adopting the interval filling method based on the filling coefficient includes: based on the filling coefficient, obtaining the number of the completely filled texture pictures, based on the number of the completely filled texture pictures, the picture height and the picture width and the first size and the second size of the surface patch, or based on the number of the completely filled texture pictures, the picture height and the picture width and the first size and the third size of the surface patch, calculating the uniform spacing distance between each of the completely filled texture pictures, and based on the uniform spacing distance, setting the spacing between each of the completely filled texture pictures to be filled with the uniform spacing distance; obtaining the background picture corresponding to the completely filled texture picture, and filling the corresponding background picture into the spacing area between the completely filled texture pictures based on the uniform spacing distance and the picture height and the picture width of the background picture.
[0031] Correspondingly, the present invention provides a texture mapping system for a three-dimensional building model, characterized by comprising:
[0032] An acquisition module is used to acquire model information of an initial building three-dimensional model; and calculate texture matching parameters of the initial building three-dimensional model according to the model information; the initial building three-dimensional model includes various facets;
[0033] A texture image matching module is used to obtain a texture image corresponding to each of the face patches in a texture library; the texture image has a size feature;
[0034] A filling factor calculation module, used to determine a corresponding filling factor calculation method according to the floor type corresponding to the face patch; based on the size characteristics of the face patch and the size characteristics of the texture image, obtain the corresponding filling factor of the texture image according to the corresponding filling factor calculation method;
[0035] A filling module is used to fill the initial building three-dimensional model based on each of the texture images using the corresponding filling coefficient to obtain a target building three-dimensional model.
[0036] In one embodiment of the present invention, the texture mapping system for the three-dimensional building model provided by the present invention further includes:
[0037] The uniform filling submodule is used to determine whether the texture image is fully filled based on the filling coefficient. If so, the adjacent filling method is used to perform texture filling on the patch according to the filling coefficient; if not, the interval filling method is used to perform texture filling on the patch based on the filling coefficient, including:
[0038] Based on the filling coefficient, the number of the completely filled texture images is obtained, and based on the number of the completely filled texture images, the image height and the image width, and the first size and the second size of the surface patch, or based on the number of the completely filled texture images, the image height and the image width, and the first size and the third size of the surface patch, the uniform spacing distance between each of the completely filled texture images is calculated, and based on the uniform spacing distance, the spacing between each of the completely filled texture images is set to be filled with the uniform spacing distance; the background image corresponding to the completely filled texture image is obtained, and based on the uniform spacing distance and the image height and the image width of the background image, the corresponding background image is filled into the spacing area between the completely filled texture images.
[0039] Correspondingly, the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method described above is implemented.
[0040] As described above, the texture mapping method, system and medium of a three-dimensional building model described in the present application have the following beneficial effects:
[0041] By acquiring model information of the initial building three-dimensional model, determining the size characteristics and floor type corresponding to each of the facets, and acquiring the texture image corresponding to each of the facets in the texture library, and filling the texture information of the corresponding facets based on the texture image, a target building three-dimensional model with texture information is obtained. This method can quickly realize highly realistic automatic texture information filling for building three-dimensional models of different orientations and different floor heights, thereby improving the efficiency of texture information filling of the initial building three-dimensional model and greatly reducing the investment in manpower costs. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] Figure 1 Shown is a flow chart of a texture mapping method for a three-dimensional building model according to an embodiment of the present application.
[0043] Figure 2 Shown is a schematic diagram of the direction angle range of a wall-type surface patch shown in an embodiment of the present application.
[0044] Figure 3 Shown is a schematic diagram of an initial three-dimensional building model according to an embodiment of the present application.
[0045] Figure 4 Shown is a schematic diagram of a three-dimensional model of a target building according to an embodiment of the present application.
[0046] Figure 5 Shown is a module schematic diagram of a texture mapping system for a three-dimensional building model according to an embodiment of the present application.
[0047] Figure 6 Shown is a module schematic diagram of the texture mapping system for the three-dimensional building model shown in another embodiment of the present application.
[0048] Description of Reference Numerals
[0049] Steps S1~S4; 300 texture mapping system; 301 acquisition module; 302 texture image matching module; 303 filling coefficient calculation module; 304 filling module; 3041 uniform filling submodule. DETAILED DESCRIPTION
[0050] The following describes the embodiments of the present application through specific examples, and those skilled in the art can easily understand other advantages and effects of the present application from the contents disclosed in this specification. The present application can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present application. It should be noted that the following embodiments and features in the embodiments can be combined with each other without conflict.
[0051] It should be noted that the illustrations provided in the following embodiments are only schematic illustrations of the basic concept of the present application, and thus the drawings only show components related to the present application rather than being drawn according to the number, shape and size of components in actual implementation. In actual implementation, the type, quantity and proportion of each component may be changed at will, and the component layout may also be more complicated.
[0052] Explanation of terms:
[0053] White model: refers to a 3D model that has not yet been filled with texture information. The model consists of basic geometric shapes and vertices.
[0054] The following embodiments of the present application provide a texture mapping method for a three-dimensional model of a building, by obtaining model information of an initial three-dimensional model of the building, determining the size features and floor types corresponding to each of the facets, and obtaining a texture image corresponding to each of the facets in a texture library, so as to fill the texture information of the corresponding facets based on the texture image, so as to obtain a target three-dimensional model of the building with texture information. This method can quickly realize highly realistic automated texture information filling for three-dimensional models of buildings in different orientations and at different floor heights, thereby improving the efficiency of texture information filling of the initial three-dimensional model of the building and greatly reducing the investment in manpower costs.
[0055] See also Figure 1 , showing a flow chart of a texture mapping method for a three-dimensional building model provided by the present invention in one embodiment;
[0056] like Figure 1 As shown, in this embodiment, the texture mapping method of the three-dimensional building model provided by the present invention comprises the following steps:
[0057] Step S1, obtaining model information of an initial three-dimensional building model; the initial three-dimensional building model includes various facets; the model information includes: size characteristics and floor types corresponding to each of the facets;
[0058] Wherein, the initial building three-dimensional model is a building three-dimensional model without filling texture information;
[0059] The face patch is a spatial surface having a boundary line on the same plane of the initial building three-dimensional model;
[0060] The floor types include: top surface and wall surface;
[0061] In one implementation, the method for obtaining the floor type includes:
[0062] Obtain the normal vector of each facet of the initial building three-dimensional model and the unit vector of the vertical axis; based on the normal vector of the corresponding facet and the unit vector of the vertical axis, calculate the angle between the corresponding facet and the second horizontal plane; the second horizontal plane is a coordinate plane parallel to the top surface of the initial building three-dimensional model in the global coordinate system; the vertical axis is a coordinate axis perpendicular to the top surface of the initial building three-dimensional model in the global coordinate system;
[0063] Obtain preset floor type judgment conditions, and perform floor type judgment based on the angle and the preset floor type judgment conditions. When the angle satisfies the corresponding floor type judgment conditions, use the floor type corresponding to the floor type judgment conditions as the floor type corresponding to the face piece.
[0064] Exemplarily, the angle between the face piece and the second horizontal plane is calculated by the following formula:
[0065]
[0066] In the above formula, α represents the angle between the face sheet and the second horizontal plane; represents the normal vector of the face patch; Represents the unit vector of the vertical axis.
[0067] Exemplarily, the preset floor type judgment condition includes: when the angle between the face piece and the second horizontal plane is less than a preset angle threshold, the floor type corresponding to the face piece is determined to be a top surface; when the angle between the face piece and the second horizontal plane is greater than a preset first angle threshold, the floor type corresponding to the face piece is determined to be a wall; exemplary, the preset angle threshold is 45 degrees.
[0068] In one implementation, the model information further includes: the wall orientation corresponding to the face piece of the wall type; the wall orientation includes: east, west, south and north;
[0069] In one embodiment, when the floor type corresponding to the face piece is a wall, the size feature of the face piece includes a first size and a second size, or the size feature of the face piece includes a first size and a third size, and a method for obtaining the size feature corresponding to the face piece includes:
[0070] Constructing a local coordinate system of the patch, obtaining a first rectangular projection of the patch on a first horizontal plane, extracting a height and a width of the first rectangular projection, using the height of the first rectangular projection as a first size of the patch, using the width of the first rectangular projection as a second size of the patch, or using the height of the first rectangular projection as a first size of the patch, using the width of the first rectangular projection as a third size of the patch; the first horizontal plane is a coordinate plane in the local coordinate system that is parallel to the corresponding patch;
[0071] Among them, the height direction of the first rectangular projection is the same as the building height direction of the initial three-dimensional building model; when the size feature of the facet includes the second size, the width direction of the first rectangular projection is the same as the building width direction of the initial three-dimensional building model; when the size feature of the facet includes the third size, the width direction of the first rectangular projection is the same as the building depth direction of the initial three-dimensional building model.
[0072] In this embodiment, when the floor type corresponding to the facet is a wall, a local coordinate system of the corresponding facet is constructed to obtain accurate size features of the corresponding facet based on the local coordinate system, and based on the accurate size features, a filling coefficient that is more closely matched with the corresponding facet is obtained, so as to achieve high-realistic texture filling of the corresponding facet based on the filling coefficient.
[0073] It should be noted that, in order to obtain the size characteristics of the corresponding facets based on the global coordinate system, a lot of time needs to be invested in selecting appropriate projection coordinate planes for each of the facets of the wall type. For example, when the facet of the wall type is projected onto the second horizontal plane, only a projection line is formed on the second horizontal plane, and the size characteristics of the facet cannot be obtained; and, when the facet is not parallel to the projection coordinate plane, it is necessary to perform coordinate value correction on the coordinates of the projection points of the vertices of the facet projected onto the projection coordinate plane based on the angle between the facet and the corresponding projection coordinate plane, so as to obtain the accurate size characteristics of the facet based on the coordinates of the projection points after the coordinate value correction. The coordinate value correction calculation for the coordinate values of each projection point not only results in a huge amount of calculated data, but also easily results in calculation errors during the correction calculation process, thereby reducing the accuracy of the size characteristics of the obtained facets.
[0074] In one implementation, when the floor type corresponding to the face piece is a wall, the first size of the face piece is the same as the height of the initial three-dimensional building model, and the height of the initial three-dimensional building model is obtained by:
[0075] Acquire the vertex coordinates of the initial building three-dimensional model, and determine the highest point and the lowest point of the building three-dimensional model based on the vertex coordinates; acquire the height difference between the highest point and the lowest point, and use the height difference as the height of the initial building three-dimensional model; the highest point is the point among the vertices of the initial building three-dimensional model with the largest vertical distance to the second horizontal plane; the lowest point is the point among the vertices of the initial building three-dimensional model with the smallest vertical distance to the second horizontal plane; the height difference between the highest point and the lowest point is the difference between the vertical distance between the highest point and the second horizontal plane and the vertical distance between the lowest point and the second horizontal plane;
[0076] In one implementation, the local coordinate system is constructed by:
[0077] Obtain the direction of the intersection line between the plane where the face patch is located and the second horizontal plane, and use the direction of the intersection line as the first coordinate axis direction of the local coordinate system of the face patch; obtain the normal direction of the face patch, and use the normal direction of the face patch as the second coordinate axis direction of the local coordinate system of the face patch; determine the third coordinate axis direction of the local coordinate system of the face patch based on the first coordinate axis direction and the second coordinate axis direction; construct the local coordinate system of the face patch based on the first coordinate axis direction, the second coordinate axis direction and the third coordinate axis direction; the first coordinate axis, the second coordinate axis and the third coordinate axis are perpendicular to each other.
[0078] Exemplarily, the floor type corresponding to the patch is a wall, and the patch includes a first size and a second size. When the first coordinate axis is an X-axis, the second coordinate axis is a Z-axis, and the third coordinate axis is a Y-axis, the calculation formulas for the first size and the second size of the patch are respectively as follows:
[0079]
[0080]
[0081] In the above formula, h A first size of the patch, which is characterized by the height of the first rectangular projection; Vy The ordinates of the projection points representing the vertices of the patch projected onto the second horizontal plane; Max({Vy}) represents the maximum ordinate of the vertices of the patch; Min({Vy}) represents the minimum ordinate of the vertex of the patch; w A second size of the patch, which is characterized by a width of the first rectangular projection; Vx represents the horizontal coordinates of the projection points formed by projecting each vertex of the patch onto the second horizontal plane; Max({Vx}) Represents the maximum horizontal coordinate of the vertex of the patch; Min ({Vx}) Indicates the minimum horizontal coordinate of the vertices of the patch.
[0082] Among them, the maximum horizontal coordinate is the horizontal coordinate of the projection point with the maximum horizontal coordinate among the corresponding projection points formed by projecting the vertices of the face patch on the second horizontal plane; the minimum horizontal coordinate is the horizontal coordinate of the projection point with the minimum horizontal coordinate among the corresponding projection points formed by projecting the vertices of the face patch on the second horizontal plane; the maximum vertical coordinate is the vertical coordinate of the projection point with the maximum vertical coordinate among the corresponding projection points formed by projecting the vertices of the face patch on the second horizontal plane; the minimum vertical coordinate is the vertical coordinate of the projection point with the minimum vertical coordinate among the corresponding projection points formed by projecting the vertices of the face patch on the second horizontal plane.
[0083] Exemplarily, when the first coordinate axis is the X axis, the second coordinate axis is the Z axis, and the third coordinate axis is the Y axis, the origin coordinates of the local coordinate system are , the unit vector of the X axis is , the unit vector of the Y axis is , the unit vector of the Z axis is When , the transformation matrix between the global coordinate system and the local coordinate system is as follows:
[0084]
[0085] In the above formula, R is the transformation matrix between the global coordinate system and the local coordinate system; then the conversion formula of each vertex of each facet of the initial building three-dimensional model to the coordinate of the local coordinate system is , is the vertex before transformation, is the converted vertex; the projection point of each vertex of each facet of the initial building three-dimensional model on the second horizontal plane is The second horizontal plane is X Axis and Y The coordinate plane formed by the axes.
[0086] In one implementation, when the floor type corresponding to the face piece is a top surface, the size feature of the face piece includes a second size and a third size, and the method for obtaining the size feature corresponding to the face piece includes:
[0087] Obtain a second rectangular projection of the patch on the second horizontal plane, extract the height and width of the second rectangular projection, use the width of the second rectangular projection as the second size of the patch, and use the height of the second rectangular projection as the third size of the patch;
[0088] The width direction of the second rectangular projection is the same as the building width direction of the initial three-dimensional building model, and the height direction of the second rectangular projection is the same as the building depth direction of the initial three-dimensional building model.
[0089] In one embodiment, the method for obtaining the wall orientation of the face piece includes:
[0090] Calculating the direction angle of the face patch based on the normal vector of the face patch and the projection line vector of the normal vector on the second horizontal plane;
[0091] Obtain a preset wall orientation judgment condition, and perform wall orientation judgment based on the direction angle and the preset wall orientation judgment condition. When the direction angle satisfies the corresponding wall orientation judgment condition, the wall orientation corresponding to the wall orientation judgment condition is used as the wall orientation corresponding to the face piece.
[0092] Exemplarily, when the second horizontal plane is a coordinate plane formed by an X-axis and a Y-axis in the global coordinate system, the calculation formula for the direction angle of the facet is as follows:
[0093]
[0094] In the above formula, represents the direction angle of the projection line formed by projecting the normal line of the face patch onto the second horizontal plane in the second horizontal plane; A represents the X-axis coordinate value of the normal vector of the face patch; A projection line vector representing the normal vector of the face patch on the second horizontal plane.
[0095] For example, see Figure 2 , showing a schematic diagram of the direction angle range of the face piece of the wall type; Figure 2 As shown, in this embodiment, the preset wall orientation judgment condition includes: when the direction angle of the face piece is within the preset first angle range, the wall orientation corresponding to the face piece is determined to be north; the preset first angle range is 45 degrees to 135 degrees (including 45 degrees, excluding 135 degrees); when the direction angle of the face piece is within the preset second angle range, the wall orientation corresponding to the face piece is determined to be west; the preset second angle range is 135 degrees to 225 degrees (including 135 degrees, excluding 225 degrees); when the direction angle of the face piece is within the preset third angle range, the wall orientation corresponding to the face piece is determined to be south; the preset third angle range is 225 degrees to 315 degrees (including 225 degrees, excluding 315 degrees); when the direction angle of the face piece is within the preset fourth angle range, the wall orientation corresponding to the face piece is determined to be east; the preset fourth angle range is 315 degrees to 45 degrees (including 315 degrees, excluding 45 degrees).
[0096] Step S2, obtaining a texture image corresponding to each of the face patches in a texture library; each of the texture images has a corresponding size feature;
[0097] Wherein, the texture library is a pre-built database storing texture images;
[0098] The texture image includes identification information; when the texture image is used to fill the surface patch of the top surface type, the identification information of the texture image includes: the floor height range and floor type to which the texture image is applicable; when the texture image is used to fill the surface patch of the wall surface type, the identification information of the texture image includes: the floor height range, floor type and wall orientation to which the texture image is applicable.
[0099] Specifically, the floor height range corresponding to the face patch is determined according to the height of the initial building three-dimensional model corresponding to the face patch; based on the floor height range, floor type and / or wall orientation corresponding to the face patch, corresponding identification information is obtained, and based on the identification information, a texture image corresponding to each face patch is obtained in a texture library.
[0100] Exemplarily, the floor height ranges include 0-10 meters, 10-24 meters, 24-60 meters and above 60 meters; the floor types include: top surface and wall surface; the wall orientation includes: east, south, west and north directions.
[0101] Optionally, the identification information is the image name of the texture image.
[0102] In one implementation, the method for acquiring the texture image corresponding to each of the face patches includes:
[0103] Based on the floor height range corresponding to the initial three-dimensional building model, the floor type corresponding to each of the face patches, and the wall orientation of the wall type of the face patches, the identification information corresponding to each of the face patches is determined, and based on the identification information, a texture image matching the identification information is queried in the texture library, and the matching texture image is used as the texture image corresponding to the face patch.
[0104] In this embodiment, by predetermining the floor height range to which the initial building three-dimensional model belongs, the floor type corresponding to each of the facets, and the wall orientation of the facets of the wall type, and pre-constructing the identification information of the texture image, the identification information corresponding to each of the facets is determined, so that the matching operation of the texture image is directly performed in the texture library based on the identification information, thereby avoiding multiple screening of texture images in the texture library according to the floor height range, floor type and wall type, respectively, and improving the speed of obtaining the texture image corresponding to the facet.
[0105] It should be noted that the method for obtaining the texture image corresponding to each of the patches in the texture library is not limited to the acquisition method described above in the present application. The method for obtaining the texture image corresponding to the patch described above in the present application is a better implementation method. Those skilled in the art can obtain the texture image corresponding to the patch based on other existing technologies.
[0106] Step S3, determining a corresponding filling factor calculation method according to the floor type corresponding to the face patch; obtaining a corresponding filling factor of the texture image according to the corresponding filling factor calculation method based on the size characteristics of the face patch and the size characteristics of the texture image;
[0107] In one implementation, when the floor type corresponding to the patch is a wall, the size feature of the patch includes a first size and a second size, or the size feature of the patch includes a first size and a third size; the filling factor includes a column-wise filling factor and a row-wise filling factor, then based on the size feature of the patch and the size feature of the texture image, according to the corresponding filling factor calculation method, obtaining the corresponding filling factor of the texture image includes:
[0108] Based on the first size of the patch and a preset single-floor height, obtaining the number of floors corresponding to the patch, and using the number of floors as a column-wise filling factor of the texture image;
[0109] Obtaining a first ratio based on the second size of the patch and the first size of the patch, or obtaining a first ratio based on the third size of the patch and the first size of the patch;
[0110] Based on the height of the texture picture and the width of the texture picture, a second ratio is obtained; based on the column-wise filling factor, the first ratio and the second ratio, a row-wise filling factor of the texture picture is constructed;
[0111] Among them, the first size is the building height of the initial building three-dimensional model corresponding to the face patch; the second size is the building width of the initial building three-dimensional model corresponding to the face patch; and the third size is the building depth of the initial building three-dimensional model corresponding to the face patch.
[0112] Optionally, the row filling coefficient of the texture image is the product of the column filling coefficient, the first ratio and the second ratio in sequence; the first ratio is the ratio of the second size of the patch to the first size of the patch, or the first ratio is the ratio of the third size of the patch to the first size of the patch; the second ratio is the ratio of the image height of the texture image to the image width of the texture image.
[0113] Exemplarily, when the floor type corresponding to the patch is a wall, the calculation formulas for the column-wise filling coefficient and the row-wise filling coefficient of the texture image corresponding to the patch are respectively as follows:
[0114]
[0115]
[0116]
[0117] In the above formula, V Indicates the column-wise filling factor of the texture image corresponding to the patch; l Indicates the number of floors of the initial three-dimensional building model; h represents the first size of the patch; hs Indicates the preset single-floor height; U Indicates the row filling factor of the texture image corresponding to the patch; w represents the second size of the patch, or the third size of the patch; th Indicates the image height of the texture image; tw Indicates the image width of the texture image.
[0118] In one implementation, when the floor type corresponding to the patch is a top surface, the size feature of the patch includes a second size and a third size; the filling factor includes a column-wise filling factor and a row-wise filling factor, then based on the size feature of the patch and the size feature of the texture image, according to the corresponding filling factor calculation method, obtaining the filling factor of the texture image includes:
[0119] Using the ratio of the third size of the patch to the height of the texture image as a column-wise filling coefficient of the texture image, so as to achieve filling of the texture image along the depth direction of the building;
[0120] The ratio of the second size of the patch to the width of the texture image is used as a row-wise filling coefficient of the texture image to achieve filling of the texture image along the building width direction.
[0121] Exemplarily, when the floor type corresponding to the patch is the top surface, the calculation formulas for the column-wise filling coefficient and the row-wise filling coefficient of the texture image corresponding to the patch are respectively as follows:
[0122]
[0123]
[0124] In the above formula, V Indicates the column-wise filling factor of the texture image corresponding to the patch; h represents the third size of the patch; th Indicates the image height of the texture image; U Indicates the row filling factor of the texture image corresponding to the patch; w represents the second size of the patch; tw Indicates the image width of the texture image.
[0125] Step S4: Based on each of the texture images, the initial building three-dimensional model is filled with the corresponding filling coefficient to obtain a target building three-dimensional model with texture information.
[0126] Specifically, a patch to be filled is obtained; a vertex of the patch to be filled is aligned with a corresponding vertex of the corresponding texture image, and the texture image is filled into the patch along the column direction and the row direction according to the column filling coefficient and the row filling coefficient, so as to obtain a filled patch; the above filling process is performed on other patches to be filled, and each filled patch is obtained to achieve filling of the initial building three-dimensional model;
[0127] Among them, the corresponding vertices between the surface patch to be filled and the texture image refer to: vertices with the same orientation in the surface patch to be filled and the texture image; for example: the lower left corner vertex of the surface patch to be filled and the lower left corner vertex of the texture image are corresponding vertices.
[0128] In another embodiment, when the floor type corresponding to the to-be-filled surface is a wall, after obtaining the filling coefficient of the texture image, the method further includes:
[0129] Based on the filling coefficient, determining whether the texture image is completely filled, if so, using an adjacent filling method according to the filling coefficient to perform texture information filling on the patch; if not, using an interval filling method based on the filling coefficient, including:
[0130] Based on the filling coefficient, the number of the completely filled texture images is obtained, and based on the number of the completely filled texture images, the image height and the image width, and the first size and the second size of the surface patch, or based on the number of the completely filled texture images, the image height and the image width, and the first size and the third size of the surface patch, the uniform spacing distance between each of the completely filled texture images is calculated; based on the uniform spacing distance, the spacing between each of the completely filled texture images is set to be filled with the uniform spacing distance; the background image corresponding to the completely filled texture image is obtained, and based on the uniform spacing distance and the image height and the image width of the background image, the corresponding background image is filled into the spacing area between the completely filled texture images; the adjacent filling method means that when each of the texture images is filled, there is no spacing area between adjacent texture images.
[0131] In one implementation, the calculation method of the uniformly spaced distance includes:
[0132] Based on the number of completely filled texture images, the image height and the image width, obtain the total image height in the column filling direction and the total image width in the row filling direction of each of the completely filled texture images; based on the total image height, the total image width, and the first size and the second size of the patch, obtain the height difference between the first size of the patch and the total image height, and the width difference between the second size of the patch and the total image width, or based on the total image height, the total image width, and the first size and the third size of the patch, obtain the height difference between the first size of the patch and the total image height, and the width difference between the third size of the patch and the total image width; based on the height difference, the width difference and the number of completely filled texture images, calculate the uniform spacing distance in the column filling direction and the uniform spacing distance in the row filling direction of the completely filled texture images in the corresponding patch.
[0133] In one embodiment, based on the fill coefficient, determining whether the texture image is completely filled includes: determining whether the column-wise fill coefficient of the texture image is an integer; if not, determining that the texture image is not completely filled in the column direction; and determining whether the row-wise fill coefficient of the texture image is an integer; if not, determining that the texture image is not completely filled in the row direction.
[0134] Optionally, the background image is a pre-constructed image with the same size and background as the texture image; or the background image is a rectangular image extracted from the texture image based on a preset ratio threshold and with a vertex of the texture image as the starting point; the background image is an image showing the wall material, that is, an image that does not include textures such as windows.
[0135] In this embodiment, it is determined in advance based on the filling coefficient whether the texture image is completely filled, and when it is determined that the texture image is not completely filled, the background image of the texture image is obtained, and the background image is evenly filled in the interval area of the completely filled texture image, so as to avoid the wall-type face patch, when it is directly filled based on the filling coefficient, resulting in incomplete filled texture information, thereby further improving the realism of the texture information filled by the face patch.
[0136] It should be noted that, in the above embodiment, the image height direction of the texture image corresponds to the column filling direction of the corresponding patch, and the image width direction of the texture image corresponds to the row filling direction of the corresponding patch.
[0137] See also Figure 3~Figure 4 , respectively shown as a schematic diagram of the initial building three-dimensional model and a schematic diagram of the target building three-dimensional model; Figure 3~Figure 4 As shown, each facet in the initial building three-dimensional model only contains geometric figures. In the target building three-dimensional model obtained by the texture mapping method of the building three-dimensional model provided in the present application, faces at different heights and orientations respectively contain corresponding texture information, thereby obtaining a building three-dimensional model with highly realistic texture information.
[0138] A texture mapping method for a three-dimensional building model is provided in the above embodiment, which obtains model information of the initial three-dimensional building model, determines the size characteristics and floor type corresponding to each of the facets, and obtains the texture image corresponding to each of the facets in the texture library, so as to fill the texture information of the corresponding facets based on the texture image, so as to obtain a target building three-dimensional model with texture information. This method can quickly realize highly realistic automatic texture information filling for building three-dimensional models of different orientations and different floor heights, improves the efficiency of texture information filling of the initial three-dimensional building model, and greatly reduces the investment in manpower costs.
[0139] like Figure 5 As shown, in this embodiment, the present invention provides a texture mapping system for a three-dimensional building model, comprising:
[0140] The acquisition module 301 is used to acquire model information of an initial three-dimensional building model; the initial three-dimensional building model includes various facets; the model information includes: size characteristics and floor types corresponding to each of the facets;
[0141] The texture image matching module 302 is used to obtain the texture image corresponding to each of the face patches in the texture library; the texture image has a size feature;
[0142] The filling factor calculation module 303 is used to determine a corresponding filling factor calculation method according to the floor type corresponding to the face patch; based on the size characteristics of the face patch and the size characteristics of the texture image, obtain the filling factor of the corresponding texture image according to the corresponding filling factor calculation method;
[0143] The filling module 304 is used to fill the initial building three-dimensional model based on each of the texture images using the corresponding filling coefficient to obtain a target building three-dimensional model.
[0144] like Figure 6 As shown, in this embodiment, the texture mapping system of the three-dimensional building model provided by the present invention further includes:
[0145] The uniform filling submodule 3041 is used to determine whether the texture image is completely filled based on the filling coefficient. If so, the adjacent filling method is used to perform texture filling on the surface patch according to the filling coefficient; if not, the interval filling method is used to perform texture filling on the surface patch based on the filling coefficient, including: based on the filling coefficient, obtaining the number of completely filled texture images, based on the number of completely filled texture images, the picture height and picture width, and the first size and second size of the surface patch, or based on the number of completely filled texture images, the picture height and picture width, and the first size and third size of the surface patch, calculating the uniform spacing distance between each of the completely filled texture images, and based on the uniform spacing distance, setting the spacing between each of the completely filled texture images to be filled with the uniform spacing distance; obtaining the background image corresponding to the completely filled texture image, and filling the corresponding background image into the interval area between the completely filled texture images based on the uniform spacing distance and the picture height and picture width of the background image.
[0146] The embodiment of the present application also provides a computer-readable storage medium. A person of ordinary skill in the art can understand that all or part of the steps in the method for implementing the above embodiment can be completed by instructing the processor through a program, and the program can be stored in a computer-readable storage medium, and the storage medium is a non-transitory medium, such as a random access memory, a read-only memory, a flash memory, a hard disk, a solid-state hard disk, a magnetic tape, a floppy disk, an optical disc, and any combination thereof. The above storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or a data center that includes one or more available media integrated. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a digital video disc (DVD)), or a semiconductor medium (e.g., a solid-state disk (SSD)), etc.
[0147] The embodiment of the present application may also provide a computer program product, which includes one or more computer instructions. When the computer instructions are loaded and executed on a computing device, the process or function described in the embodiment of the present application is generated in whole or in part. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from one website, computer or data center to another website, computer or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means.
[0148] When the computer program product is executed by a computer, the computer executes the method described in the above method embodiment. The computer program product may be a software installation package, and when the above method is required, the computer program product may be downloaded and executed on a computer.
[0149] The descriptions of the processes or structures corresponding to the above-mentioned figures have different emphases. For parts that are not described in detail in a certain process or structure, please refer to the relevant descriptions of other processes or structures.
[0150] The above embodiments are merely illustrative of the principles and effects of the present application and are not intended to limit the present application. Anyone familiar with the technology may modify or change the above embodiments without violating the spirit and scope of the present application. Therefore, all equivalent modifications or changes made by a person of ordinary skill in the art without departing from the spirit and technical ideas disclosed in the present application shall still be covered by the claims of the present application.
Claims
1. A texture mapping method for a three-dimensional building model, characterized in that: The method comprises: Acquire model information of an initial three-dimensional building model; the initial three-dimensional building model includes various facets; the model information includes: size characteristics and floor types corresponding to each of the facets; Based on the identification information of the texture image, a texture image corresponding to each of the face patches is obtained in a texture library; the texture image has a size feature; when the texture image is used to fill the face patch of a wall type, the identification information of the texture image includes: a floor height range, a floor type, and a wall orientation to which the texture image is applicable; Determine a corresponding filling factor calculation method according to the floor type corresponding to the face patch; obtain a corresponding filling factor of the texture image according to the corresponding filling factor calculation method based on the size characteristics of the face patch and the size characteristics of the texture image; Based on each of the texture images, fill the initial building three-dimensional model with the corresponding filling coefficient to obtain a target building three-dimensional model; The filling factor includes a column filling factor and a row filling factor. When the floor type corresponding to the patch is a wall, the size feature of the patch includes a first size and a second size, or the size feature of the patch includes a first size and a third size. Based on the size feature of the patch and the size feature of the texture image, according to the corresponding filling factor calculation method, obtaining the filling factor of the corresponding texture image includes: Based on the first size of the patch and a preset single-floor height, obtaining the number of floors corresponding to the patch, and using the number of floors as a column-wise filling factor of the texture image; Obtaining a first ratio based on the second size of the patch and the first size of the patch, or obtaining a first ratio based on the third size of the patch and the first size of the patch; Based on the picture height and the picture width of the texture picture, a second ratio is obtained; based on the column-wise filling factor, the first ratio and the second ratio, a row-wise filling factor of the texture picture is constructed; Among them, the first size is the building height of the initial building three-dimensional model corresponding to the face patch; the second size is the building width of the initial building three-dimensional model corresponding to the face patch; and the third size is the building depth of the initial building three-dimensional model corresponding to the face patch.
2. The method according to claim 1, characterized in that: When the floor type corresponding to the patch is a top surface, the size feature of the patch includes a second size and a third size; the filling factor includes a column-wise filling factor and a row-wise filling factor, then based on the size feature of the patch and the size feature of the texture image, and according to the corresponding filling factor calculation method, obtaining the filling factor of the texture image includes: Using the ratio of the third size of the patch to the image height of the texture image as a column-wise filling coefficient of the texture image, so as to achieve filling of the texture image along the depth direction of the building; The ratio of the second size of the patch to the image width of the texture image is used as a row-wise filling coefficient of the texture image to achieve filling of the texture image along the building width direction.
3. The method according to claim 1, characterized in that When the floor type corresponding to the face piece is a wall, the size feature of the face piece includes a first size and a second size, or the size feature of the face piece includes a first size and a third size, and a method for acquiring the size feature corresponding to the face piece includes: Constructing a local coordinate system of the patch, obtaining a first rectangular projection of the patch on a first horizontal plane, extracting a height and a width of the first rectangular projection, using the height of the first rectangular projection as a first size of the patch, using the width of the first rectangular projection as a second size of the patch, or using the height of the first rectangular projection as a first size of the patch, using the width of the first rectangular projection as a third size of the patch; the first horizontal plane is a coordinate plane in the local coordinate system that is parallel to the patch; Among them, the height direction of the first rectangular projection is the same as the building height direction of the initial building three-dimensional model; the width direction of the first rectangular projection is the same as the building width direction of the initial building three-dimensional model, or the width direction of the first rectangular projection is the same as the building depth direction of the initial building three-dimensional model.
4. The method according to claim 3, characterized in that The local coordinate system is constructed in the following manner: Obtain the direction of the intersection line between the plane where the face patch is located and the second horizontal plane, and use the direction of the intersection line as the first coordinate axis direction of the local coordinate system of the face patch; obtain the normal direction of the face patch, and use the normal direction of the face patch as the second coordinate axis direction of the local coordinate system of the face patch; determine the third coordinate axis direction of the local coordinate system of the face patch based on the first coordinate axis direction and the second coordinate axis direction; construct the local coordinate system of the face patch based on the first coordinate axis direction, the second coordinate axis direction and the third coordinate axis direction; the second horizontal plane is a coordinate plane in the global coordinate system that is parallel to the face patch of the top surface type.
5. The method according to claim 1, characterized in that The filling coefficient includes: a column filling coefficient and a row filling coefficient. Based on each of the texture images, filling the initial building three-dimensional model with the corresponding filling coefficient includes: Acquire a face patch to be filled; align a vertex of the face patch to be filled with a corresponding vertex of the corresponding texture image, and fill the texture image into the face patch along the column direction and the row direction respectively according to the column-wise filling coefficient and the row-wise filling coefficient to obtain a filled face patch; perform the above-mentioned filling process on other face patches to be filled, obtain each filled face patch, and realize the filling of the initial three-dimensional building model.
6. The method according to claim 1, characterized in that When the floor type corresponding to the face patch is a wall, after obtaining the fill factor of the texture image, the method further includes: Based on the filling coefficient, determine whether the texture image is fully filled, if so, perform texture filling on the patch using an adjacent filling method according to the filling coefficient; if not, perform texture filling on the patch using an interval filling method based on the filling coefficient; Among them, based on the filling coefficient, the texture filling is performed on the surface patch in an interval filling manner, including: based on the filling coefficient, obtaining the number of the completely filled texture pictures, based on the number of the completely filled texture pictures, the picture height and the picture width and the first size and the second size of the surface patch, or based on the number of the completely filled texture pictures, the picture height and the picture width and the first size and the third size of the surface patch, calculating the uniform spacing distance between each of the completely filled texture pictures, based on the uniform spacing distance, setting the spacing between each of the completely filled texture pictures to be filled with the uniform spacing distance; obtaining the background picture corresponding to the completely filled texture picture, and filling the corresponding background picture into the interval area between the completely filled texture pictures based on the uniform spacing distance and the picture height and the picture width of the background picture.
7. A texture mapping system for a three-dimensional building model, characterized in that: include: An acquisition module, used for acquiring model information of an initial building three-dimensional model; The initial building three-dimensional model includes various facets; the model information includes: the size characteristics and floor types corresponding to each of the facets; A texture image matching module is used to obtain a texture image corresponding to each of the face patches in a texture library based on the identification information of the texture image; the texture image has a size feature; when the texture image is used to fill the face patch of the wall type, the identification information of the texture image includes: the floor height range, floor type and wall orientation to which the texture image is applicable; A filling factor calculation module is used to determine a corresponding filling factor calculation method according to the floor type corresponding to the face patch; based on the size characteristics of the face patch and the size characteristics of the texture image, obtain the filling factor of the corresponding texture image according to the corresponding filling factor calculation method; wherein, The filling factor includes a column filling factor and a row filling factor. When the floor type corresponding to the patch is a wall, the size feature of the patch includes a first size and a second size, or the size feature of the patch includes a first size and a third size. Based on the size feature of the patch and the size feature of the texture image, according to the corresponding filling factor calculation method, obtaining the corresponding filling factor of the texture image includes: Based on the first size of the patch and a preset single-floor height, obtaining the number of floors corresponding to the patch, and using the number of floors as a column-wise filling factor of the texture image; Obtaining a first ratio based on the second size of the patch and the first size of the patch, or obtaining a first ratio based on the third size of the patch and the first size of the patch; Based on the picture height and the picture width of the texture picture, a second ratio is obtained; based on the column-wise filling factor, the first ratio and the second ratio, a row-wise filling factor of the texture picture is constructed; The first size is the building height of the initial three-dimensional building model corresponding to the face patch; the second size is the building width of the initial three-dimensional building model corresponding to the face patch; the third size is the building depth of the initial three-dimensional building model corresponding to the face patch; A filling module is used to fill the initial building three-dimensional model based on each of the texture images using the corresponding filling coefficient to obtain a target building three-dimensional model.
8. The system according to claim 7, characterized in that When the floor type corresponding to the surface piece is a wall, the filling module further includes: A uniform filling submodule is used to determine whether the texture image is completely filled based on the filling coefficient. If so, the adjacent filling method is used to perform texture filling on the surface patch according to the filling coefficient; if not, the interval filling method is used to perform texture filling on the surface patch based on the filling coefficient, including: based on the filling coefficient, obtaining the number of completely filled texture images, based on the number of completely filled texture images, the picture height and the picture width, and the first size and the second size of the surface patch, or based on the number of completely filled texture images, the picture height and the picture width, and the first size and the third size of the surface patch, calculating the uniform spacing distance between each of the completely filled texture images, and based on the uniform spacing distance, setting the spacing between each of the completely filled texture images to be filled with the uniform spacing distance; obtaining the background image corresponding to the completely filled texture image, and filling the corresponding background image into the interval area between the completely filled texture images based on the uniform spacing distance and the picture height and the picture width of the background image.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed, the method according to any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Consistency considered section modeling method of complex 3D building model
CN105825550A
Building template instantiation modeling method based on point cloud data
CN115033967A
Building three-dimensional model construction method and system and electronic equipment
CN115546422A
Virtual building construction method and device, electronic equipment and storage medium
CN117095143A
Process for constructing a three dimensional model of the living space or interior space of a house or building from a floor-plan drawing of the house or building for use in sizing HVAC systems, sizing air ducting systems, or other energy modeling for the house or building
US20210248279A1
