3D game scene terrain modeling method and system

By performing block processing and clustering analysis on the images modeled in 3D game scene terrain, dynamically calculate and optimize the processing step size, and adjust the step size of the BM3D algorithm, the problem of denoising efficiency and quality reduction caused by improper step size selection in the existing technology is solved, and more efficient and high-quality 3D game scene modeling is achieved.

CN120047637AActive Publication Date: 2025-05-27SHANGRAO XINXIN INFORMATION TECHNOLOGY CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202510122813.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-26
Publication Date
2025-05-27
Estimated Expiration
2045-01-26

AI Technical Summary

Technical Problem

It is difficult for the prior art to accurately select the appropriate step size of the BM3D algorithm in 3D game scene terrain modeling, resulting in a decrease in denoising efficiency and quality.

Method used

By blocking the image modeled on the 3D game scene terrain, a search comparison matrix with the elements as pixel points grayscale values ​​is constructed, cluster analysis obtains the difference value and consistency index within the cluster, dynamically calculate the optimization processing step size, and adjust the step size of the BM3D algorithm.

Benefits of technology

It improves the quality and efficiency of 3D game scene modeling, enhances the efficiency of image denoising, and reduces the waste of computing resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120047637A_ABST
    Figure CN120047637A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of 3D game scene terrain modeling, in particular to a 3D game scene terrain modeling method and system, and the method comprises the steps: determining a consistency index through analyzing the discrete degree and extreme distribution of the gray values of all pixels in each cluster and combining the number of the gray values of all pixels in each cluster; determining a complex index by analyzing the difference between the consistency index of each cluster in each search comparison matrix and the extreme distribution condition of the consistency indexes of all the clusters; and determining an optimization processing step length by analyzing an average distribution condition and a variation degree of complex indexes of all search comparison matrixes in each game scene image, and performing denoising processing on each game scene image in combination with an image denoising algorithm so as to model a 3D game scene terrain. The invention aims to improve the quality and efficiency of 3D game scene modeling.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the technical field of 3D game scene terrain modeling, and specifically relates to a 3D game scene terrain modeling method and system. Background Art

[0002] With the development of network technology, 3D games have witnessed a breakthrough development, and their proportion in the game industry is increasing. As the core of 3D games, 3D modeling technology not only enriches visual art forms but also promotes the development of technology and innovation. 3D modeling plays a crucial role in game development. It constructs rich visual effects for the game world and creates an immersive experience for players. Through 3D modeling, designers can create various character models, scenes, and objects, transforming abstract game concepts into visual entities and bringing rich experiences to users.

[0003] For the modeling of 3D game scenes, it is necessary to enhance the collected scene images, and the effect of the denoised images determines the effect of 3D game scene modeling. Since the Block-matching and 3D filtering (BM3D) algorithm is one of the algorithms with the best denoising effects, it is often used to perform image denoising on 3D game scene terrain images. However, due to the different texture richness levels at different positions of the game scene terrain, if the game scene terrain is relatively simple, using too small a step size is likely to increase the running time of the algorithm, resulting in waste of algorithm computing resources. For complex game terrain scenes, too large a step size is likely to lead to poor enhancement effects. Therefore, the prior art cannot accurately select an appropriate step size, thereby reducing the efficiency and quality of denoising game scene images, and further reducing the quality and efficiency of 3D game scene modeling. Summary of the Invention

[0004] To solve the above technical problems, the purpose of this application is to provide a 3D game scene terrain modeling method and system, and the specific technical solutions adopted are as follows:

[0005] In the first aspect, an embodiment of this application provides a 3D game scene terrain modeling method, and the method includes the following steps:

[0006] During the 3D game scene terrain modeling process, take pictures of the terrain model from different camera positions to obtain a large number of grayscale images for 3D game scene terrain modeling, and record them as game scene images;

[0007] Divide each game scene image into multiple image blocks, and construct a search and comparison matrix with pixel point grayscale values as elements in each game scene image according to the position distribution of pixel points in different image blocks;

[0008] Cluster the gray values of all pixel points in each search comparison matrix to obtain multiple clusters. By analyzing the dispersion degree and extreme distribution of the gray values of all pixel points in each cluster, construct the within-cluster difference value of each cluster, and combine the number of gray values of all pixel points in each cluster to determine the consistency index of each cluster;

[0009] By analyzing the difference between the consistency index of each cluster in each search comparison matrix and the extreme distribution of the consistency indices of all clusters, determine the complexity index of each search comparison matrix;

[0010] By analyzing the average distribution and variation degree of the complexity indices of all search comparison matrices in each game scene image, determine the optimization processing step size of each game scene image. Combine the image denoising algorithm to perform denoising processing on each game scene image. Based on the denoised game scene image, model the 3D game scene terrain.

[0011] Preferably, the method for constructing the search comparison matrix is as follows:

[0012] In each game scene image, number the pixel points in each image block in sequence from left to right and from top to bottom according to the position, and form each search comparison matrix with the gray values of the pixel points with the same number in all image blocks.

[0013] Preferably, the expression for the within-cluster difference value of each cluster is: BF i =P i ×R i ; In the formula, BF i represents the within-cluster difference value of cluster i; P i represents the dispersion coefficient of the gray values of all pixel points within cluster i; R i represents the range of the gray values of all pixel points within the cluster.

[0014] Preferably, the consistency index of each cluster is the ratio of the number of gray values of all pixel points in each cluster to the within-cluster difference value.

[0015] Preferably, the expression for the complexity index of each search comparison matrix is: In the formula, hd m represents the structural distribution complexity of the mth search comparison matrix; Y m,j represents the consistency index of cluster j in the mth search comparison matrix; X m represents the minimum value among the consistency indices of all clusters in the mth search comparison matrix; N m represents the number of all clusters in the mth search comparison matrix.

[0016] Preferably, the expression of the optimization processing step size for each game scene image is: step q = ous{[1 - norm(m q × mad q )]× L q}+ a; where step q represents the optimization processing step size of the qth game scene image; m q represents the mean of the structural distribution complexity of all search comparison matrices in the qth game scene image; mad q represents the mean absolute deviation of the structural distribution complexity of all search comparison matrices in the qth game scene image; L q represents the difference between half of the length of the qth image and the length of the image block; ous{} represents the maximum even function; norm() represents the normalization function; a represents the preset minimum image block length.

[0017] Preferably, the image denoising algorithm is the three-dimensional block matching BM3D algorithm.

[0018] Preferably, the process of denoising each game scene image is as follows:

[0019] Use the optimization processing step size of each game scene image as the step size of the search window in the BM3D algorithm to denoise the game scene image.

[0020] Preferably, the modeling of the 3D game scene terrain includes:

[0021] Use the denoised game scene image as the image to be modeled, construct 3D point cloud data based on all the images to be modeled of the terrain to be modeled under different camera positions, and use the 3D point cloud data as the input of the 3D modeling algorithm to output the 3D game scene.

[0022] In a second aspect, an embodiment of the present application also provides a 3D game scene terrain modeling system, including a memory, a processor, and a computer program stored in the memory and running on the processor. When the processor executes the computer program, it implements the steps of the above-mentioned 3D game scene terrain modeling method.

[0023] The present application has at least the following beneficial effects:

[0024] In this application, the collected game scene images are processed in blocks, the complexity of the gray values of the pixel points within the same image block is analyzed, and the intra-cluster difference value is constructed. When the gray values of the pixel points are evenly distributed, the step size of the search window can be appropriately increased to accelerate the denoising efficiency. When the gray values of the pixel points are unevenly distributed, it indicates that the terrain structure in the game scene image is more complex, and the step size of the search window can be appropriately reduced to retain more detailed information, thereby improving the quality and efficiency of 3D game modeling. Further, by analyzing the distribution of the consistency indices of all clustering clusters, a complexity index is constructed, which helps to adjust the image denoising strategy according to the terrain features, improving the denoising efficiency while enhancing the quality and efficiency of 3D game scene modeling. Further, by analyzing the differences in the structural complexity between different data blocks, an optimized processing step size is constructed to improve the BM3D algorithm, thereby enhancing the efficiency and quality of denoising the game scene images, and further improving the quality and efficiency of 3D game scene modeling. This application dynamically calculates the optimized processing step size, adjusts the BM3D algorithm according to the characteristics of the terrain structure in the game scene, and thus improves the quality and efficiency of 3D game scene modeling. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] In order to more clearly illustrate the technical solutions and advantages in the embodiments of the present application or the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art. Obviously, the drawings described below are only some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.

[0026] Figure 1 It is a flowchart of the steps of a 3D game scene terrain modeling method provided by an embodiment of the present application;

[0027] Figure 2 It is a schematic diagram of the principle for constructing a search comparison matrix provided by an embodiment of the present application;

[0028] Figure 3 It is a schematic diagram of the process for extracting the optimized processing step size provided by an embodiment of the present application. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0029] In order to further elaborate on the technical means and effects adopted by the present application to achieve the predetermined invention purpose, the following, in combination with the accompanying drawings and preferred embodiments, will describe in detail the specific implementation manners, structures, features, and effects of a 3D game scene terrain modeling method and system proposed according to the present application. In the following description, different "one embodiment" or "another embodiment" do not necessarily refer to the same embodiment. In addition, the specific features, structures, or characteristics in one or more embodiments can be combined in any suitable form.

[0030] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the technical field to which this application belongs.

[0031] The following specifically describes the specific solutions of a 3D game scene terrain modeling method and system provided by this application in conjunction with the accompanying drawings.

[0032] Please refer to Figure 1 , which shows a flowchart of the steps of a 3D game scene terrain modeling method provided by an embodiment of this application. The method includes the following steps:

[0033] Step S1: During the 3D game scene terrain modeling process, take pictures of the terrain model from different camera positions to obtain a large number of grayscale images for 3D game scene terrain modeling, and record them as game scene images.

[0034] During the modeling process of the 3D game scene terrain, first, the actual terrain model will be photographed from multiple angles to ensure that every detail and feature is captured. These images include not only the front view, but also the side view and the top view, so as to comprehensively display the three-dimensional features of the terrain. After the shooting is completed, the image data will be input into the terrain modeling library.

[0035] During the modeling process, the 3D game scene terrain modeling library will call the images in the terrain modeling library, convert the 3D game scene modeling images into grayscale images, and record them as game scene images.

[0036] Step S2: Divide each game scene image into multiple image blocks, and according to the position distribution of pixel points in different image blocks, construct a search and comparison matrix with pixel point grayscale values as elements in each game scene image; cluster all pixel point grayscale values in each search and comparison matrix to obtain multiple clustering clusters, analyze the dispersion degree and extreme distribution of all pixel point grayscale values in each clustering cluster, construct the within-cluster difference value of each clustering cluster, and combine the number of all pixel point grayscale values in each clustering cluster to determine the consistency index of each clustering cluster.

[0037] Since 3D games need to collect different scene terrain images for different game plots. For example, in the scene of a palace, images of the palace need to be collected; in the scene of a mountain, images of forests, rivers, grasslands, etc. need to be collected. For images of different scenes, the local similarity degrees are different. Therefore, when using the three-dimensional block matching BM3D algorithm to denoise different terrain images, the step size of the search window in the BM3D algorithm should also be different.

[0038] Since the principle of the BM3D algorithm is to denoise an image by searching for similar image patches and processing the image according to the similarity degree between the similar image patches. Therefore, each scene grayscale image is first divided into n×n image patches. Further, in each game scene image, the pixel points in each image patch are numbered in the order from left to right and from top to bottom according to their positions. The grayscale values of the pixel points with the same number in all image patches are used to form each search and comparison matrix. The schematic diagram of the construction principle of the search and comparison matrix is shown in Figure 2 as shown Figure 2 where serial number 1 represents the game scene image, serial number 2 represents the image patch, and serial number 3 represents the pixel point.

[0039] It should be noted that the value of n is set artificially. In this embodiment, the value of n is 3. The implementer can also set it according to the specific situation by himself / herself, and there is no special limitation in this embodiment.

[0040] For the terrain scenes of different 3D games, due to the different local similarity degrees of different scenes. For example, in the desert terrain scene, the similarity degree within the scene is relatively high; in the forest terrain scene, the similarity degree within the scene is relatively low. For different terrain scenes, the pixel distribution states in the search and comparison matrix are different. When the similarity degree within the terrain scene is relatively high, the grayscale values of the pixel points in the search and comparison matrix are relatively close, and the differences between different pixel points are relatively small; while when the similarity degree within the terrain scene is relatively small, the differences in the grayscale values of the pixel points in the search and comparison matrix are relatively large.

[0041] Therefore, based on the above analysis, the analysis of the distribution differences of the grayscale values of the pixel points in the search and comparison matrix is carried out, and the specific process is as follows:

[0042] Take all the grayscale values of the pixel points in the search and comparison matrix as the input of the clustering algorithm. Among them, set the neighborhood radius as r, and output multiple clustering clusters of each search and comparison matrix.

[0043] It should be understood that the value of the neighborhood radius r is set artificially. In this embodiment, the value of the neighborhood radius r is 10. The implementer can also set it reasonably according to the specific situation, and there is no special limitation in this embodiment. Among them, the reason why the value of the neighborhood radius r in this embodiment is 10 is that if the neighborhood radius is too large, it may cause data points that should belong to different clusters to be wrongly merged into one cluster, and if the neighborhood radius is too small, many data points will be marked as noise points, and data points that should belong to the same cluster may be divided into multiple clusters. Therefore, considering this embodiment comprehensively, the value of the neighborhood radius r in this embodiment is set to 10.

[0044] It should be noted that there are many common clustering algorithms. In this embodiment, the DBSACN clustering algorithm is used to cluster the grayscale values of the pixel points in the search comparison matrix. In the actual application process, as other implementation manners, the implementer can also use the DPC density peak clustering algorithm or the k-means clustering algorithm. There is no special limitation on the selection of the clustering algorithm in this embodiment.

[0045] Among them, the DBSCAN clustering algorithm is a well-known technology, and its clustering principle and process will not be elaborated here.

[0046] When the distribution of the grayscale values of the pixel points in the clustering cluster is more uniform and the difference between the grayscale values is smaller, it indicates that the structure of the corresponding part in the scene grayscale map of the clustering cluster is more similar. Therefore, when denoising this part, the search window can be appropriately enlarged to improve the denoising efficiency.

[0047] Therefore, for each search comparison matrix, the histogram of all pixel point grayscale values in each clustering cluster is statistically analyzed to obtain the frequency of occurrence of each pixel point grayscale value.

[0048] Among them, the method for obtaining the histogram is a well-known technology, and its specific acquisition principle will not be elaborated here.

[0049] Furthermore, by analyzing the dispersion degree and extreme distribution of all pixel point grayscale values in each clustering cluster, the within-cluster difference value of each clustering cluster is constructed. Specifically:

[0050] The within-cluster difference value BF i of the clustering cluster i is expressed as: BF i =P i ×R i ; In the formula, P i represents the dispersion coefficient of all pixel point grayscale values within the clustering cluster i; R i represents the range of all pixel point grayscale values within the clustering cluster.

[0051] Among them, the calculation method of the dispersion coefficient is a well-known technology, and its specific calculation process will not be elaborated here.

[0052] It can be understood from the within-cluster difference value of each clustering cluster that when the difference between the pixel point grayscale values within the clustering cluster is larger, the dispersion coefficient of all pixel point grayscale values within the clustering cluster is larger, and the range of all pixel point grayscale values is larger, the obtained within-cluster difference value of the clustering cluster is larger, indicating that the structural texture difference within the region corresponding to the clustering cluster in the game scene image is larger, which means that the information content in this region is higher. When processing the image, the step size of the search window is reduced to ensure that the region corresponding to the clustering cluster with high information content in the game scene image can provide users with rich visual and structural information, enhancing the realism and immersion of the scene.

[0053] Conversely, if the difference in the structure within the clustering cluster is smaller, the coefficient of variation of the gray values of all pixel points within the clustering cluster is smaller, and the range of the gray values of all pixel points is smaller, the within-cluster difference value of the obtained clustering cluster is smaller, indicating that the difference in the internal structure texture of the region corresponding to the clustering cluster in the game scene image is smaller, indicating that the difference between the gray values of the pixel points in this region is smaller, and the terrain structure distribution in the corresponding region is more similar. Therefore, when processing this region in the game scene image, the step size of the search window can be increased to improve the efficiency of image denoising.

[0054] If the number of pixel points in the clustering cluster is larger, it indicates that the proportion of this part of the similar structure in the clustering cluster in the search comparison matrix is larger. In this case, the consistency of the gray values of the pixel points in the search comparison matrix is higher, indicating that the difference between the pixel points in the clustering cluster is smaller. This consistency means that when processing the game scene image, the step size of the search window in the BM3D algorithm can be appropriately increased, thereby improving the denoising efficiency.

[0055] Therefore, based on the within-cluster difference value of each clustering cluster and combined with the number of gray values of all pixel points in each clustering cluster, the consistency index of each clustering cluster is determined, so as to adjust the denoising efficiency of the BM3D algorithm according to the consistency index, and improve the quality and efficiency of 3D game scene modeling. Specifically:

[0056] The consistency index of each clustering cluster is the ratio of the number of gray values of all pixel points in each clustering cluster to the within-cluster difference value.

[0057] From the consistency index of each clustering cluster, it can be understood that when the number of elements in the clustering cluster is larger, it means that the proportion of this clustering cluster in the image is larger, and if the within-cluster difference value of this clustering cluster is smaller, it indicates that the structural texture similarity of the corresponding part of the clustering cluster in the 3D scene grayscale image is larger. When processing this part of the image, a more efficient processing strategy can be adopted, thereby improving the efficiency of 3D game scene construction; conversely, when the number of elements in the clustering cluster is smaller, it means that the proportion of this clustering cluster in the image is smaller, and if the within-cluster difference value of this clustering cluster is larger, it indicates that the structural texture similarity of the corresponding part of the clustering cluster in the game scene image is smaller, that is, it indicates that the structural texture of the game scene terrain is more complex. When processing the corresponding image of this part, the size of the search window in the BM3D algorithm can be appropriately reduced to maintain a high level of detail in this part of the image.

[0058] Step S3: By analyzing the difference between the consistency index of each clustering cluster in each search comparison matrix and the extreme distribution of the consistency indices of all clustering clusters, the complexity index of each search comparison matrix is determined.

[0059] For different clustering clusters of the search comparison matrix, when performing BM3D algorithm image enhancement, the similarity between data is compared in blocks. When the structural distributions of various parts of the 3D game scene are closer, it indicates that the texture features of pixel points within different clustering clusters are very similar. The concentration of these similar elements enables the clustering clusters to better represent specific structures or features in the image.

[0060] Therefore, by analyzing the differences between the consistency index of each clustering cluster in each search comparison matrix and the extreme distribution of the consistency indices of all clustering clusters, the complexity index of each search comparison matrix is determined, thereby further judging the complexity of terrain features in the game scene image, optimizing the denoising algorithm, improving the denoising efficiency, and further enhancing the quality and efficiency of 3D game scene modeling. Specifically:

[0061] The structural distribution complexity hd of the m-th search comparison matrix m has the following expression: In the formula, Y m,j represents the consistency index of clustering cluster j in the m-th search comparison matrix; X m represents the minimum value among the consistency indices of all clustering clusters in the m-th search comparison matrix; N m represents the number of all clustering clusters in the m-th search comparison matrix.

[0062] From the structural distribution complexity of each search comparison matrix, it can be understood that when the texture feature differences between different clustering clusters in the search comparison matrix are greater, it indicates a higher diversity of structures in the game scene image. When processing the game scene image, the complexity of the denoising algorithm should be considered for increase. In 3D game terrain scene modeling, these clustering clusters with complex structural distributions should be processed more carefully to ensure the richness and diversity of the scene. Maintaining the high details of these clustering clusters with high structural distribution complexity can provide users with a more rich and detailed visual experience, enhancing the realism and immersion of the scene; conversely, if the texture feature differences between different clustering clusters in the search comparison matrix are smaller, it indicates that the terrain structure in the game scene image is relatively simple and single, and the complexity of the denoising algorithm can be reduced to improve the denoising efficiency and further enhance the efficiency of 3D game scene modeling.

[0063] Step S4: By analyzing the average distribution and variation degree of the complexity indices of all search comparison matrices in each game scene image, determine the optimization processing step size for each game scene image, and combine it with the image denoising algorithm to perform denoising processing on each game scene image. Based on the denoised game scene image, model the 3D game scene terrain.

[0064] When denoising the game scene images during the 3D game scene modeling using the BM3D algorithm, the similarity between image patches is calculated through comparison. Therefore, when the gray values of the pixel points at all the same positions between different image patches are relatively close, it indicates that the similarity between the image patches is relatively high, that is, the terrain structure in the 3D game scene is relatively simple. The structural distribution complexity of the search comparison matrix represents the structural complexity between the pixels at the same positions of all image patches. The larger the value of the structural distribution complexity, the lower the similarity between different image patches. When using the BM3D algorithm, a smaller step size should be used for the search window to ensure that more detailed attributes are retained when processing the image, so that the 3D game scene modeled from this image has richer details and brings a higher visual experience.

[0065] Therefore, by analyzing the average distribution and variation degree of the complexity indices of all search comparison matrices in each game scene image, the optimized processing step size of each game scene image is determined, which improves the denoising efficiency of the game scene image and further improves the quality and efficiency of 3D game scene modeling. Specifically:

[0066] The optimized processing step size step q of the q-th game scene image is expressed as: step q =ous{[1 - norm(m q ×mad q )]×L q}+a; where step q represents the optimized processing step size of the q-th game scene image; m q represents the mean value of the structural distribution complexity of all search comparison matrices in the q-th game scene image; mad q represents the mean absolute deviation of the structural distribution complexity of all search comparison matrices in the q-th game scene image; L q represents the difference between half of the length of the q-th image and the length of the image patch; ous{} represents the maximum even function; norm() represents the normalization function; a represents the preset minimum image patch length.

[0067] Preferably, the schematic diagram of the process for extracting the optimized processing step size provided in this embodiment is as Figure 3 shown.

[0068] It should be noted that the length of the image patch is related to the pixel size of the image and the segmentation method of the image patch. In this embodiment, each game scene image is segmented into n×n image patches. Therefore, the length of each image patch is of the length of the game scene image, and the value of the preset minimum image patch length is set artificially. In this embodiment, the value of the preset minimum image patch length is 3.

[0069] Implementers can also set it reasonably according to specific situations, and this embodiment does not make special restrictions. Among them, the calculation method of the mean absolute deviation is a well-known technology, and its specific calculation process will not be elaborated here.

[0070] It can be understood from the optimization processing step of each game scene image that when the mean value and the mean absolute deviation of the structural distribution complexity of all search comparison matrices are larger, it indicates that the difference between different image blocks in the game scene image is higher, that is, the terrain features in the game scene image are more complex, and a smaller processing step should be adopted to maintain the details of the high-complexity terrain in the game scene image, provide users with rich visual and structural information, and enhance the realism and immersion of the scene; on the contrary, if the mean value and the mean absolute deviation of the structural distribution complexity of all search comparison matrices are smaller, it indicates that the difference between different image blocks in the game scene image is smaller, indicating that the terrain structure in the game scene image is relatively simple and single. Therefore, the complexity of the denoising algorithm can be appropriately reduced, that is, by appropriately increasing the step size of the search window in the BM3D algorithm, so as to accelerate the denoising efficiency of the game scene image, and then improve the efficiency of 3D game scene modeling.

[0071] Furthermore, the optimization processing step of each game scene image is used as the step size of the search window in the BM3D algorithm to denoise the game scene image.

[0072] The denoised game scene image is used as the image to be modeled. The scale-invariant feature transform SIFT algorithm is used to extract the feature points and their descriptors in each image to be modeled, and all the feature points and their descriptors in all the images to be modeled are used as the input of the brute-force matcher BFMatcher and the fast nearest neighbor search matcher FLANNMatcher in OpenCV, and all the matching feature point pairs are output. Then all the matching feature point pairs are used as the input of the solvePnP function in OpenCV to output the positions and directions of all cameras. Further, based on the positions and directions of all cameras and using the principle of triangulation, the three-dimensional spatial coordinates of all feature points are obtained, and a 3D point cloud is constructed according to the three-dimensional spatial coordinates of all feature points. The 3D point cloud data is used as the input of the 3D modeling algorithm to output the 3D game scene.

[0073] Among them, the BM3D algorithm, the scale-invariant feature transform SIFT algorithm, the brute-force matcher BFMatcher, the fast nearest neighbor search matcher FLANNMatcher, the solvePnP function, the principle of triangulation, and the 3D modeling technology are all well-known technologies, and their specific principle processes will not be elaborated here.

[0074] So far, in this embodiment, the optimization processing step size is dynamically calculated, and the step size of the BM3D algorithm is adjusted according to the structural distribution complexity of different game scene terrain images, so that the image enhancement process can more precisely retain image details, especially in areas with different texture richness, effectively improving the quality of the enhanced image and providing clearer original data for 3D game scene modeling. In addition, in this embodiment, by precisely adjusting the step size, while enhancing the image denoising effect, unnecessary waste of computing resources is reduced. A smaller step size is used in areas with high structural distribution complexity, and a larger step size is used in areas with simple structural distribution. This intelligent adjustment strategy optimizes the running time and resource consumption of the algorithm and improves the efficiency of 3D game scene modeling.

[0075] Based on the same inventive concept as the above method, an embodiment of the present application also provides a 3D game scene terrain modeling system, including a memory, a processor, and a computer program stored in the memory and running on the processor. When the processor executes the computer program, it implements the steps of any one of the above-mentioned 3D game scene terrain modeling methods.

[0076] It should be noted that the above sequence of embodiments of the present application is only for description and does not represent the advantages and disadvantages of the embodiments. And the above describes specific embodiments of this specification. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0077] Each embodiment in this specification is described in a progressive manner. The same or similar parts between each embodiment can be referred to each other, and the key point of each embodiment is to illustrate the differences from other embodiments.

[0078] The above are only the preferred embodiments of the present application and are not intended to limit the present application. Any modifications, equivalent replacements, improvements, etc. made within the principle of the present application shall be included in the protection scope of the present application.

Claims

1. A 3D game scene terrain modeling method, characterized in that: The method comprises the following steps: In the process of 3D game scene terrain modeling, the terrain model is photographed from different camera positions to obtain a large number of 3D game scene terrain modeling grayscale images, which are recorded as game scene images; Each game scene image is divided into multiple image blocks, and according to the position distribution of pixel points in different image blocks, a search comparison matrix whose elements are the grayscale values ​​of pixel points is constructed in each game scene image; Cluster the grayscale values ​​of all pixels in each search comparison matrix to obtain multiple clusters. By analyzing the discrete degree and extreme distribution of the grayscale values ​​of all pixels in each cluster, construct the intra-cluster difference value of each cluster, and combine the number of grayscale values ​​of all pixels in each cluster to determine the consistency index of each cluster. By analyzing the difference between the consistency index of each cluster in each search comparison matrix and the extreme distribution of the consistency index of all clusters, the complexity index of each search comparison matrix is ​​determined; By analyzing the average distribution and variation of the complex exponents of all search comparison matrices in each game scene image, the optimized processing step size of each game scene image is determined. Combined with the image denoising algorithm, each game scene image is denoised. Based on the denoised game scene image, the 3D game scene terrain is modeled.

2. A 3D game scene terrain modeling method as claimed in claim 1, characterized in that: The construction method of the search comparison matrix is: In each game scene image, the pixels in each image block are numbered in order from left to right and from top to bottom according to their positions, and the grayscale values ​​of the pixels with the same number in all image blocks are used to form each search comparison matrix.

3. A 3D game scene terrain modeling method as claimed in claim 1, characterized in that: The expression of the intra-cluster difference value of each cluster is: BF i =P i ×R i ; In the formula, BF i represents the intra-cluster difference value of cluster i; P i Represents the discrete coefficient of the grayscale value of all pixels in cluster i; R i Represents the extreme value of the grayscale value of all pixels in the cluster.

4. A 3D game scene terrain modeling method as claimed in claim 1, characterized in that: The consistency index of each cluster is the ratio of the number of gray values ​​of all pixels in each cluster to the difference value within the cluster.

5. A 3D game scene terrain modeling method as claimed in claim 1, characterized in that: The expressions of the complex exponents of the search comparison matrices are: In the formula, hd m represents the structural distribution complexity of the mth search comparison matrix; Y m,j represents the consistency index of cluster j in the mth search comparison matrix; X m represents the minimum value of the consistency index of all clusters in the m-th search comparison matrix; N m Represents the number of all clusters in the mth search comparison matrix.

6. A 3D game scene terrain modeling method as claimed in claim 1, characterized in that: The expression of the optimization processing step length of each game scene image is: step q =ous{[1-norm(m q ×mad q )]×L q }+a; where step q represents the optimization processing step length of the qth game scene image; m q represents the mean of the structural distribution complexity of all search comparison matrices in the qth game scene image; mad q represents the mean absolute deviation of the structural distribution complexity of all search comparison matrices in the qth game scene image; L q represents the difference between half the length of the qth image and the length of the image block; ous{} represents the maximum even function; norm() represents the normalization function; a represents the preset minimum image block length.

7. A 3D game scene terrain modeling method as claimed in claim 1, characterized in that: The image denoising algorithm is a three-dimensional block matching BM3D algorithm.

8. A 3D game scene terrain modeling method as claimed in claim 1, characterized in that: The process of denoising each game scene image is as follows: The optimized processing step size of each game scene image is used as the step size of the search window in the BM3D algorithm to denoise the game scene image.

9. A 3D game scene terrain modeling method as claimed in claim 1, characterized in that: The modeling of the 3D game scene terrain includes: The denoised game scene image is used as the image to be modeled. 3D point cloud data is constructed based on all the images to be modeled of the terrain to be modeled under different camera positions. The 3D point cloud data is used as the input of the 3D modeling algorithm to output the 3D game scene.

10. A 3D game scene terrain modeling system, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that: When the processor executes the computer program, the steps of a 3D game scene terrain modeling method as described in any one of claims 1-9 are implemented.

Citation Information

Patent Citations

  • Variable step size normalized sub-band adaptive filter method applied to acoustic feedback inhibition

    CN107291663A

  • Nonlocal mean denoising method based on shape self-adaptive search window

    CN108921800A

  • Systems and methods for training an active random field for real-time image denoising

    US20100020208A1