Texture mapping method, device and storage medium
By obtaining the texture coordinates of each triangle face sheet of the three-dimensional model and using KD-Tree to judge the occlusion, the problem of inability to effectively judge the target being occluded in the prior art is solved, and a better texture mapping effect is achieved.
Patent Information
- Application Number
- CN202210126341.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-02-10
- Publication Date
- 2025-05-13
- Estimated Expiration
- 2042-02-10
AI Technical Summary
The existing texture mapping scheme cannot effectively determine whether the target in the texture image is blocked, resulting in poor mapping effect.
By obtaining the texture coordinates projected on each photo of each triangle patch on the three-dimensional model, and using the KD-Tree data structure to store these coordinates, we can determine whether there is occlusion in the triangle patch, and select the best mapped photo among the triangle patches where there is no occlusion.
It realizes effective judgment and optimization of three-dimensional model texture mapping, improves the mapping effect, especially when dealing with occlusion areas.
Smart Images

Figure CN114612601B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer graphics, and in particular to a texture mapping method, device and storage medium. Background Art
[0002] Texture mapping, also known as texture mapping, is the process of mapping texture pixels in texture space to pixels in screen space, that is, the process of defining the correspondence between pixel coordinates of a 3D object model and a 2D image space. Texture mapping of a 3D model is to map a texture image with color information onto the surface of a 3D model in space, giving the 3D model surface texture features.
[0003] Existing texture mapping schemes include: obtaining multiple texture images corresponding to a three-dimensional model, wherein the multiple texture images contain targets corresponding to the three-dimensional model, such as vehicle targets, personnel targets, etc.; selecting an image with the closest viewpoint, or selecting the clearest image, from the multiple texture images; and mapping the texture features of the target in the selected texture image to the three-dimensional model based on the mapping relationship between the pixel points in the selected texture image and the grid points in the three-dimensional model.
[0004] When applying the above solution, if the target in the selected texture image is blocked, the texture features of the blocked area cannot be mapped to the three-dimensional model, and the mapping effect is poor. Summary of the invention
[0005] Based on this, it is necessary to propose a texture mapping method, device and storage medium to address the above problems, which solves the problem of how to determine whether the target in the texture image is occluded and select the best mapping photo from the triangular patches without occlusion to achieve texture mapping of the three-dimensional model.
[0006] A texture mapping method, the method comprising:
[0007] Get the texture coordinates of each triangle patch of the 3D model projected onto each photo;
[0008] Determine whether the triangular face is occluded according to an occlusion judgment method, wherein the occlusion judgment method uses a KD-Tree data structure to store the texture coordinates of each triangular face of the three-dimensional model projected onto each photo;
[0009] Select the best mapping photo among the triangle patches where no occlusion occurs.
[0010] A texture mapping device, comprising:
[0011] The first acquisition module is used to obtain the texture coordinates of each triangular face of the three-dimensional model projected onto each photo;
[0012] A first determination module is used to determine whether a triangular face is occluded according to an occlusion determination method, wherein the occlusion determination method uses a KD-Tree data structure to store texture coordinates of each triangular face of the three-dimensional model projected onto each photo;
[0013] The first selection module is used to select the best mapping photo from the triangular patches without occlusion.
[0014] A computer-readable storage medium stores a computer program, which, when executed by a processor, causes the processor to perform the following steps:
[0015] Get the texture coordinates of each triangle patch of the 3D model projected onto each photo;
[0016] Determine whether the triangular face is occluded according to an occlusion judgment method, wherein the occlusion judgment method uses a KD-Tree data structure to store the texture coordinates of each triangular face of the three-dimensional model projected onto each photo;
[0017] Select the best mapping photo among the triangle patches where no occlusion occurs.
[0018] The above-mentioned texture mapping method, device and storage medium obtain the texture coordinates of each triangular facet of the three-dimensional model projected onto each photo; determine whether the triangular facet is occluded according to the occlusion judgment method, wherein the occlusion judgment method uses a KD-Tree data structure to store the texture coordinates of each triangular facet of the three-dimensional model projected onto each photo; select the best mapping photo from the triangular facets without occlusion, thereby solving the problem of judging whether the target in the texture image is occluded and selecting the best mapping photo from the triangular facets without occlusion. When judging whether a certain triangular facet is occluded, the KD-Tree data structure is used to improve the efficiency of finding the texture coordinates near the triangular facet, so as to judge whether the triangular facet is occluded more quickly and realize texture mapping of the three-dimensional model. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0020] in:
[0021] Figure 1 is a flowchart of a texture mapping method in one embodiment;
[0022] Figure 2is a structural block diagram of a texture mapping device in one embodiment;
[0023] Figure 3 FIG. 4 is a structural block diagram of a computer device in one embodiment. DETAILED DESCRIPTION
[0024] It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0025] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0026] It should be noted that the terms "include", "comprises" and "have" and any variations thereof in the specification and claims of the present application and the above-mentioned drawings are intended to cover non-exclusive inclusions. For example, a process, method, terminal, product or device that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units that are not listed, or may optionally include other steps or units that are inherent to these processes, methods, products or devices. In the claims, specification and drawings of the present application, relational terms such as "first" and "second" are merely used to distinguish one entity / operation / object from another entity / operation / object, and do not necessarily require or imply any such actual relationship or order between these entities / operations / objects.
[0027] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0028] like Figure 1 As shown, the present invention proposes a texture mapping method, which specifically includes the following steps:
[0029] Step 100, obtaining the texture coordinates of each triangular face of the three-dimensional model projected onto each photo.
[0030] Among them, the smallest unit constituting a three-dimensional model is called a patch, and patches include triangular patches, rectangular patches, etc. The present invention obtains triangular patches of a three-dimensional model. After determining the internal parameters of the camera and the external parameters of the camera when taking each photo, projection calculation is performed for each triangular patch of the three-dimensional model, and the two-dimensional coordinate value (in pixels) projected onto each photo is calculated from the three-dimensional coordinate value.
[0031] To project each triangular face of the 3D model onto the texture coordinates of each photo, it is necessary to transform the 3D model coordinates from the world coordinate system to the camera coordinate system, and then from the camera coordinate system to the pixel coordinate system.
[0032] First, convert the three-dimensional vertex coordinates from the world coordinate system to the camera coordinate system:
[0033]
[0034] Where (X, Y, Z) is the three-dimensional coordinate in the world coordinate system, [R|T] is the rotation and translation matrix of the camera, and (x, y, z) is the coordinate in the camera coordinate system.
[0035] Then convert from the camera coordinate system to the pixel coordinate system:
[0036] x′=x / z
[0037] y′=y / z
[0038] r 2 = x′ 2 +y′ 2
[0039] x″=x′*(1+k1*r 2 +k2*r 4 )+2*p1*x′*y′+p2*(r 2 +2x′ 2 )
[0040] y″=y′*(1+k1*r 2 +k2*r 4 )+p1*(r 2 +2*y′ 2 )+2*p2*x′*y′
[0041] u=f x *x″+c x
[0042] v=f y *y″+c y
[0043] Where k1, k2 are radial distortion coefficients, p1, p2 are tangential distortion coefficients, and f x,f y is the focal length in pixels, c x ,c y is the principal point of the image. The calculation result (u, v) is the coordinate in the pixel coordinate system, in pixels. The projection coordinates of each triangle patch are calculated in each photo, and the area of each triangle patch on the photo after projection is calculated.
[0044] Step 102, determining whether the triangular face is occluded according to an occlusion determination method, wherein the occlusion determination method uses a KD-Tree data structure to store the texture coordinates of each triangular face of the three-dimensional model projected onto each photo.
[0045] KD-Tree is a tree data structure that stores instance points in k-dimensional space for fast retrieval. It is mainly used for searching key data in multidimensional space, such as range search and nearest neighbor search. The KD-Tree algorithm can be divided into two parts. One part is the algorithm for establishing the KD-Tree data structure itself, and the other part is the algorithm for performing nearest neighbor search on the established KD-Tree. The KD-Tree data structure can be used to quickly search for two-dimensional spatial data, that is, the texture coordinates obtained by projecting each triangular face of a three-dimensional model.
[0046] There are many methods for occlusion judgment in the prior art, which will not be described in detail here. However, when calculating the texture coordinates of each triangle face of the 3D model projected onto each photo, these texture coordinates are stored in the KD-Tree data structure. When judging whether a certain triangle face is occluded, the efficiency of finding the texture coordinates near the triangle face is improved, and it is faster to judge whether the triangle face is occluded.
[0047] Step 104: Select the best mapping photo from the triangular patches without occlusion.
[0048] Among them, since there are multiple triangular patches without occlusion, it is impossible to map all of these triangular patches, so it is necessary to select one triangular patch from the multiple triangular patches without occlusion as the best mapping photo. The conditions for selecting the best mapping photo can be set according to actual needs.
[0049] In one embodiment, the method of selecting the best mapping photo from triangular patches without occlusion includes: calculating the angle between the normal of the triangular patch and the direction of the camera when the photo was taken, if the angle is less than a preset first threshold, it is considered that the front of the triangular patch is visible to the camera, otherwise the back of the triangular patch is visible to the camera and the triangular patch is discarded; and selecting the triangular patch with the largest projection area in the photo from the remaining photos that meet the conditions as the best mapping photo.
[0050] Specifically, since the front or back of the triangle patch may be visible to the camera, the triangle patches without occlusion are screened and the front of the triangle patch visible to the camera is selected considering the above two situations. Since there are usually multiple remaining photos, in order to better perform texture mapping, the triangle patch with the largest projection area in the photo is selected as the best mapping photo, thereby reducing unnecessary resource waste and improving the effect of texture mapping.
[0051] Preferably, the preset first threshold is 60 degrees.
[0052] In one embodiment, the method of determining whether a triangular patch is occluded according to the occlusion judgment method includes: using a KD-Tree data structure to store the texture coordinates of each triangular patch of the three-dimensional model projected onto each photo; calculating each triangular patch in turn, taking three point coordinates of the triangular patch in a pixel coordinate system, which are respectively a first pixel coordinate, a second pixel coordinate, and a third pixel coordinate, and calculating the circumscribed circle and the centroid of the triangular patch; then taking three point coordinates of the triangular patch in a camera coordinate system, which are respectively a first camera coordinate, a second camera coordinate, and a third camera coordinate, and calculating the normal vector of the triangular patch through a first vector and a second vector, wherein the first vector is a vector between the first camera coordinate and the second camera coordinate, and the second vector is a vector between the first camera coordinate and the third camera coordinate; in the KD-Tree data structure, the texture coordinates of each triangular patch are stored in a KD-Tree data structure; calculating the texture coordinates of each triangular patch in turn, and calculating the texture coordinates of each triangular patch in turn; ... Search the coordinates of other points within the circumscribed circle of the triangle patch in the ree data structure, and take out the fourth camera coordinates corresponding to the point coordinates in the pixel coordinate system in the camera coordinate system; calculate the dot product of the third vector formed by the fourth camera coordinate and the origin of the camera coordinate system and the normal vector of the triangle patch; if the result is 0, it means that the normal vector of the triangle patch is perpendicular to the third vector, and no occlusion is formed, and the following steps are not performed; if the result is not 0, calculate the first intersection point of the third vector formed by the fourth camera coordinate and the origin of the camera coordinate system and the plane where the triangle patch is located; if the first intersection point is inside the triangle patch, and the distance from the first intersection point to the origin of the camera coordinate system is smaller than the distance from the fourth camera coordinate to the origin of the camera coordinate system, it means that the triangle patch is closer to the camera than the fourth camera coordinate, and the triangle patch occludes other triangle patches associated with the fourth camera coordinate.
[0053] Among them, the three points of the triangular patch determine a plane. The first intersection point of the third vector formed by the fourth camera coordinate and the origin of the camera coordinate system and the plane where the triangular patch is located is obtained in the camera coordinate system. When the triangular patch occludes other triangular patches associated with the fourth camera coordinate, the visible state of the triangle associated with the fourth camera coordinate is set to an invisible state. By calculating the dot product between the third vector and the normal vector of the triangular patch, it is accurately determined whether the triangular patch is occluded, and by calculating the first intersection point of the third vector and the plane where the triangular patch is located, it is determined that the triangular patch occludes other triangular patches.
[0054] The above-mentioned texture mapping method obtains the texture coordinates of each triangular facet of the three-dimensional model projected onto each photo; determines whether the triangular facet is occluded according to the occlusion judgment method, wherein the occlusion judgment method uses a KD-Tree data structure to store the texture coordinates of each triangular facet of the three-dimensional model projected onto each photo; selects the best mapping photo from the triangular facets without occlusion, solves the problem of judging whether the target in the texture image is occluded and selecting the best mapping photo from the triangular facets without occlusion, and when judging whether a certain triangular facet is occluded, the KD-Tree data structure is used to improve the efficiency of finding the texture coordinates near the triangular facet, so as to judge whether the triangular facet is occluded more quickly and realize texture mapping of the three-dimensional model.
[0055] like Figure 2 As shown, the present invention proposes a texture mapping device, comprising:
[0056] A first acquisition module 200 is used to acquire the texture coordinates of each triangular face of the three-dimensional model projected onto each photo;
[0057] A first determination module 202 is used to determine whether a triangular face is occluded according to an occlusion determination method, wherein the occlusion determination method uses a KD-Tree data structure to store texture coordinates of each triangular face of the three-dimensional model projected onto each photo;
[0058] The first selection module 204 is used to select the best mapping photo from the triangular patches without occlusion.
[0059] In one embodiment, the first selection module is also used to: calculate the angle between the normal of the triangle face and the direction of the camera when the photo was taken. If the angle is less than a preset first threshold, it is considered that the front of the triangle face is visible to the camera, otherwise the back of the triangle face is visible to the camera and the triangle face is discarded; and select the triangle face with the largest projection area in the photo from the remaining photos that meet the conditions as the best mapping photo.
[0060] In one embodiment, the preset first threshold is 60 degrees.
[0061] In one embodiment, the first determination module is further used to: use a KD-Tree data structure to store the texture coordinates of each triangular patch of the three-dimensional model projected onto each photo; calculate each triangular patch in turn, take the coordinates of three points of the triangular patch in the pixel coordinate system, which are the first pixel coordinate, the second pixel coordinate and the third pixel coordinate, and calculate the circumscribed circle and the centroid of the triangular patch; then take the coordinates of three points of the triangular patch in the camera coordinate system, which are the first camera coordinate, the second camera coordinate and the third camera coordinate, and calculate the normal vector of the triangular patch through the first vector and the second vector, wherein the first vector is a vector between the first camera coordinate and the second camera coordinate, and the second vector is a vector between the first camera coordinate and the third camera coordinate; search in the KD-Tree data structure. Search for coordinates of other points within the circumscribed circle of the triangular patch, and take out the fourth camera coordinates corresponding to the coordinates of the points in the pixel coordinate system in the camera coordinate system; calculate the dot product of the third vector formed by the fourth camera coordinate and the origin of the camera coordinate system and the normal vector of the triangular patch; if the result is 0, it means that the normal vector of the triangular patch is perpendicular to the third vector, and no occlusion is formed, and the following steps are not performed; if the result is not 0, calculate the first intersection point of the third vector formed by the fourth camera coordinate and the origin of the camera coordinate system and the plane where the triangular patch is located; if the first intersection point is inside the triangular patch, and the distance from the first intersection point to the origin of the camera coordinate system is smaller than the distance from the fourth camera coordinate to the origin of the camera coordinate system, it means that the triangular patch is closer to the camera than the fourth camera coordinate, and the triangular patch occludes other triangular patches associated with the fourth camera coordinate.
[0062] It should be noted that, for the parts not described in detail in this application, reference can be made to the description of the aforementioned embodiments.
[0063] The above-mentioned texture mapping device obtains the texture coordinates of each triangular facet of the three-dimensional model projected onto each photo; determines whether the triangular facet is occluded according to an occlusion judgment method, wherein the occlusion judgment method uses a KD-Tree data structure to store the texture coordinates of each triangular facet of the three-dimensional model projected onto each photo; selects the best mapping photo from the triangular facets without occlusion, thereby solving the problem of judging whether the target in the texture image is occluded and selecting the best mapping photo from the triangular facets without occlusion. When judging whether a certain triangular facet is occluded, the KD-Tree data structure is used to improve the efficiency of finding the texture coordinates near the triangular facet, so as to judge whether the triangular facet is occluded more quickly and realize texture mapping of the three-dimensional model.
[0064] Figure 3 FIG. 1 shows an internal structure diagram of a computer device in an embodiment. The computer device may be a terminal or a server. Figure 3As shown, the computer device includes a processor, a memory and a network interface connected via a system bus. The memory includes a non-volatile storage medium and an internal memory. The non-volatile storage medium of the computer device stores an operating system and may also store a computer program. When the computer program is executed by the processor, the processor can implement the texture mapping method. The internal memory may also store a computer program. When the computer program is executed by the processor, the processor can implement the texture mapping method. Those skilled in the art will understand that Figure 3 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0065] In one embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of the above texture mapping method.
[0066] In one embodiment, a computer-readable storage medium is provided, which stores a computer program. When the computer program is executed by a processor, the processor executes the steps of the above-mentioned texture mapping method.
[0067] It can be understood that the above-mentioned texture mapping method, device and computer-readable storage medium belong to a general inventive concept, and the embodiments are applicable to each other.
[0068] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the program can be stored in a non-volatile computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0069] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0070] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A texture mapping method, characterized in that: The method comprises: Get the texture coordinates of each triangle patch of the 3D model projected onto each photo; Determine whether the triangular face is occluded according to an occlusion judgment method, wherein the occlusion judgment method uses a KD-Tree data structure to store the texture coordinates of each triangular face of the three-dimensional model projected onto each photo; Select the best mapping photo among the triangle patches without occlusion; Wherein, determining whether a triangular facet is occluded according to an occlusion judgment method includes: Use KD-Tree data structure to store the texture coordinates of each triangle face of the 3D model projected onto each photo; Calculate each triangular patch in turn, take the coordinates of three points of the triangular patch in the pixel coordinate system, which are the first pixel coordinate, the second pixel coordinate and the third pixel coordinate, and calculate the circumscribed circle and the centroid of the triangular patch; Then, coordinates of three points of the triangular face in the camera coordinate system are obtained, which are the first camera coordinate, the second camera coordinate and the third camera coordinate, and the normal vector of the triangular face is calculated by the first vector and the second vector, where the first vector is a vector between the first camera coordinate and the second camera coordinate, and the second vector is a vector between the first camera coordinate and the third camera coordinate; Search the KD-Tree data structure for other point coordinates within the circumscribed circle of the triangle patch, and retrieve the fourth camera coordinates corresponding to the point coordinates in the pixel coordinate system in the camera coordinate system; The third vector formed by the fourth camera coordinate and the origin of the camera coordinate system is multiplied by the normal vector of the triangle patch; If the result is 0, it means that the normal vector of the triangle patch is perpendicular to the third vector, and does not constitute occlusion, so the following steps are not performed; If the result is not 0, the first intersection point is calculated between the third vector formed by the fourth camera coordinate and the origin of the camera coordinate system and the plane where the triangle patch is located; if the first intersection point is inside the triangle patch, and the distance from the first intersection point to the origin of the camera coordinate system is smaller than the distance from the fourth camera coordinate to the origin of the camera coordinate system, it means that the triangle patch is closer to the camera than the fourth camera coordinate, and the triangle patch occludes other triangle patches associated with the fourth camera coordinate.
2. The method according to claim 1, characterized in that The step of selecting the best mapping photo from the triangle patch without occlusion comprises: Calculate the angle between the normal of the triangle patch and the direction of the camera when the photo was taken. If the angle is less than a preset first threshold, it is considered that the front of the triangle patch is visible to the camera. Otherwise, the back of the triangle patch is visible to the camera and the triangle patch is discarded. From the remaining photos that meet the conditions, the photo with the largest projection area of the triangular face in the photo is selected as the best mapping photo.
3. The method according to claim 2, characterized in that The preset first threshold is 60 degrees.
4. A texture mapping device, characterized in that: For applying the method according to any one of claims 1 to 3, the texture mapping device comprises: The first acquisition module is used to obtain the texture coordinates of each triangular face of the three-dimensional model projected onto each photo; A first determination module is used to determine whether a triangular face is occluded according to an occlusion determination method, wherein the occlusion determination method uses a KD-Tree data structure to store texture coordinates of each triangular face of the three-dimensional model projected onto each photo; The first selection module is used to select the best mapping photo from the triangular patches without occlusion.
5. The device according to claim 4, characterized in that The first selection module is specifically used for: Calculate the angle between the normal of the triangle patch and the direction of the camera when the photo was taken. If the angle is less than a preset first threshold, it is considered that the front of the triangle patch is visible to the camera. Otherwise, the back of the triangle patch is visible to the camera and the triangle patch is discarded. From the remaining photos that meet the conditions, the photo with the largest projection area of the triangular face in the photo is selected as the best mapping photo.
6. The device according to claim 5, characterized in that The preset first threshold is 60 degrees.
7. The device according to claim 4, characterized in that The first determination module is specifically used for: Use KD-Tree data structure to store the texture coordinates of each triangle face of the 3D model projected onto each photo; Calculate each triangular patch in turn, take the coordinates of three points of the triangular patch in the pixel coordinate system, which are the first pixel coordinate, the second pixel coordinate and the third pixel coordinate, and calculate the circumscribed circle and the centroid of the triangular patch; Then, coordinates of three points of the triangular face in the camera coordinate system are obtained, which are the first camera coordinate, the second camera coordinate and the third camera coordinate, and the normal vector of the triangular face is calculated by the first vector and the second vector, where the first vector is a vector between the first camera coordinate and the second camera coordinate, and the second vector is a vector between the first camera coordinate and the third camera coordinate; Search the KD-Tree data structure for other point coordinates within the circumscribed circle of the triangle patch, and retrieve the fourth camera coordinates corresponding to the point coordinates in the pixel coordinate system in the camera coordinate system; The third vector formed by the fourth camera coordinate and the origin of the camera coordinate system is multiplied by the normal vector of the triangle patch; If the result is 0, it means that the normal vector of the triangle patch is perpendicular to the third vector, and does not constitute occlusion, so the following steps are not performed; If the result is not 0, the first intersection point is calculated between the third vector formed by the fourth camera coordinate and the origin of the camera coordinate system and the plane where the triangle patch is located; if the first intersection point is inside the triangle patch, and the distance from the first intersection point to the origin of the camera coordinate system is smaller than the distance from the fourth camera coordinate to the origin of the camera coordinate system, it means that the triangle patch is closer to the camera than the fourth camera coordinate, and the triangle patch occludes other triangle patches associated with the fourth camera coordinate.
8. A computer-readable storage medium storing a computer program, wherein when the computer program is executed by a processor, the processor is caused to perform the steps of the method according to any one of claims 1 to 3.
Citation Information
Patent Citations
Novel visibility generation method for large-scale three-dimensional scene
CN105389850A
Texture mapping strategy determination method and device and computer readable storage medium
CN111563950A
Building model generation method and device based on unmanned aerial vehicle image
CN113689535A