A 3D game scene terrain modeling method and system

By constructing a search comparison matrix and analyzing the grayscale values ​​of pixel points, the BM3D algorithm step size is dynamically adjusted, which solves the problem of improper step size selection in 3D game scene modeling, improves modeling quality and efficiency, and enhances image denoising effect and visual experience.

CN120047637BActive Publication Date: 2025-09-26SHANGRAO XINXIN INFORMATION TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

Existing technologies cannot accurately select the step size of the BM3D algorithm in 3D game scene terrain modeling, resulting in waste of computing resources or poor denoising effect, reducing the quality and efficiency of 3D game scene modeling.

Method used

By constructing a search comparison matrix, analyzing the clustering and consistency index of pixel grayscale values, dynamically calculating and optimizing the processing step size, and adjusting the step size of the BM3D algorithm to adapt to the complexity of different terrain structures, image denoising is performed.

Benefits of technology

It improves the quality and efficiency of 3D game scene modeling, reduces the waste of computing resources, enhances image denoising effects, and provides a richer visual experience and immersion.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120047637B_ABST
    Figure CN120047637B_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of 3D game scene terrain modeling, and specifically to a 3D game scene terrain modeling method and system. The method comprises: determining a consistency index by analyzing the discrete degree and extreme distribution of the grayscale values ​​of all pixels in each cluster, and combining the number of grayscale values ​​of all pixels in each cluster; determining a complexity index by analyzing the difference between the consistency index of each cluster and the extreme distribution of the consistency index of all clusters in each search comparison matrix; determining an optimization processing step size by analyzing the average distribution and variation of the complexity index of all search comparison matrices in each game scene image, and performing denoising processing on each game scene image in combination with an image denoising algorithm to model the 3D game scene terrain. The present application 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] The present application relates to the technical field of 3D game scene terrain modeling, and in particular to a 3D game scene terrain modeling method and system. Background Art

[0002] With the development of network technology, 3D gaming has experienced a breakthrough, occupying an increasingly larger share of the gaming industry. 3D modeling technology, at the core of 3D gaming, has not only enriched visual art but also promoted the development of technology and innovation. 3D modeling plays a crucial role in game development, creating rich visual effects for game worlds and an immersive experience for players. Through 3D modeling, designers can create a variety of characters, scenes, and objects, transforming abstract game concepts into visual entities and delivering a rich user experience.

[0003] For the modeling of 3D game scenes, it is necessary to enhance the collected scene images, and the effect of the denoising image determines the effect of the 3D game scene modeling. Since the 3D block matching filtering (BM3D) algorithm is one of the algorithms with the best denoising effect, it is often used to denoise the terrain images of 3D game scenes. However, since the texture richness of the game scene terrain is different at different locations, if the game scene terrain is relatively simple, using too small a step size will easily increase the running time of the algorithm, resulting in a waste of algorithm computing resources. For complex game terrain scenes, too large a step size will easily lead to poor enhancement effect. Therefore, the existing technology cannot accurately select a suitable step size, thereby reducing the efficiency and quality of denoising the game scene image, and further reducing the quality and efficiency of 3D game scene modeling. Summary of the Invention

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

[0005] In a first aspect, an embodiment of the present application provides a method for modeling terrain in a 3D game scene, the method comprising the following steps:

[0006] During the 3D game scene terrain modeling process, 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;

[0007] Each game scene image is divided into multiple image blocks, and based on the position distribution of pixel points in different image blocks, a search comparison matrix is ​​constructed in each game scene image, whose elements are the grayscale values ​​of the pixel points;

[0008] Cluster the grayscale values ​​of all pixels in each search and comparison matrix to obtain multiple clusters. By analyzing the discrete degree and extreme distribution of the grayscale values ​​of all pixels in each cluster, the intra-cluster difference value of each cluster is constructed. Combined with the number of grayscale values ​​of all pixels in each cluster, the consistency index of each cluster is determined.

[0009] The complexity index of each search comparison matrix is ​​determined 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.

[0010] By analyzing the average distribution and variation of the complex exponents of all search contrast 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.

[0011] Preferably, the search comparison matrix is ​​constructed as follows:

[0012] 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.

[0013] Preferably, the expression of the intra-cluster difference value of each cluster is: BF i =P i ×R i Where, 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 Indicates the range of the grayscale values ​​of all pixels in the cluster.

[0014] Preferably, the consistency index of each cluster is the ratio of the number of grayscale values ​​of all pixels in each cluster to the difference value within the cluster.

[0015] Preferably, the complex index of each search comparison matrix is ​​expressed as: Where hd m represents the structural distribution complexity of the m-th 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 m-th search comparison matrix.

[0016] Preferably, 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 image block length; 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 a three-dimensional block matching BM3D algorithm.

[0018] Preferably, the process of performing denoising processing on each game scene image is:

[0019] 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.

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

[0021] The denoised game scene image is used as the image to be modeled. 3D point cloud data is constructed based on all the images 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.

[0022] In a second aspect, an embodiment of the present application also provides 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, wherein when the processor executes the computer program, the system implements the steps of any one of the above-mentioned 3D game scene terrain modeling methods.

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

[0024] This application divides the collected game scene images into blocks, analyzes the complexity of the grayscale values ​​of pixels in the same image block, and constructs the intra-cluster difference value. When the grayscale values ​​of the pixels are evenly distributed, the step size of the search window can be appropriately increased to speed up the denoising efficiency. When the grayscale values ​​of the pixels are unevenly distributed, it means that the terrain structure in the game scene image is more complex. The step size of the search window can be appropriately reduced to retain more detail information, thereby improving the quality and efficiency of 3D game modeling. Further, by analyzing the distribution of the consistency index of all clusters, a complexity index is constructed, which helps to adjust the image denoising strategy according to the terrain characteristics, improve the denoising efficiency and improve 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, and the BM3D algorithm is improved, thereby improving the efficiency and quality of denoising the game scene image, thereby improving the quality and efficiency of 3D game scene modeling. This application optimizes the processing step size through dynamic calculation, adjusts the BM3D algorithm according to the characteristics of the terrain structure in the game scene, thereby improving 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 of the embodiments of the present application or the prior art, the following is a brief introduction to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0026] Figure 1 A flowchart of a method for modeling terrain for a 3D game scene provided in one embodiment of the present application;

[0027] Figure 2 A schematic diagram of the search comparison matrix construction principle provided in one embodiment of the present application;

[0028] Figure 3 A schematic diagram of the optimization processing step extraction process provided for one embodiment of the present application. DETAILED DESCRIPTION

[0029] To further illustrate the technical means and effects employed by this application to achieve the intended invention objectives, the following, in conjunction with the accompanying drawings and preferred embodiments, describes in detail a 3D game scene terrain modeling method and system proposed in this application, including its specific implementation, structure, features, and effects. In the following description, different references to "one embodiment" or "another embodiment" do not necessarily refer to the same embodiment. Furthermore, specific features, structures, or characteristics of one or more embodiments may be combined in any suitable manner.

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

[0031] The following describes in detail a 3D game scene terrain modeling method and system provided by the present application with reference to the accompanying drawings.

[0032] See also Figure 1 , which shows a flowchart of a method for modeling terrain of a 3D game scene provided by an embodiment of the present application, the method comprising the following steps:

[0033] Step S1: During the 3D game scene terrain modeling process, 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.

[0034] When modeling 3D game scene terrain, the actual terrain model is first photographed from multiple angles to ensure every detail and feature is captured. These images include not only front views, but also side and top views to fully demonstrate the terrain's three-dimensional features. Once the images are captured, they are then fed into the terrain modeling library.

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

[0036] Step S2: Divide each game scene image into multiple image blocks, and construct a search comparison matrix in each game scene image whose elements are pixel grayscale values ​​according to the position distribution of pixel points in different image blocks; cluster all pixel grayscale values ​​in each search comparison matrix to obtain multiple clusters, and construct the intra-cluster difference value of each cluster by analyzing the discrete degree and extreme distribution of the grayscale values ​​of all pixels in each cluster, and determine the consistency index of each cluster in combination with the number of all pixel grayscale values ​​in each cluster.

[0037] 3D games require capturing different scene and terrain images for different plots. For example, a palace scene requires capturing images of the palace, while a mountain scene requires capturing images of forests, rivers, grasslands, and other scenes. Images from different scenes have varying degrees of local similarity. Therefore, when using the BM3D algorithm for image denoising on different terrain images, the step size of the search window in the BM3D algorithm should also vary.

[0038] Since the principle of the BM3D algorithm is to search for similar image blocks and perform image denoising based on the degree of similarity between similar image blocks, each scene grayscale image is first divided into n×n image blocks. Furthermore, in each game scene image, the pixels in each image block are numbered in order from left to right and from top to bottom. The grayscale values ​​of the pixels with the same number in all image blocks are used to form a search comparison matrix. The schematic diagram of the construction principle of the search comparison matrix is ​​shown below. Figure 2 As shown, Figure 2 Serial number 1 represents the game scene image, serial number 2 represents the image block, and serial number 3 represents the pixel point.

[0039] It should be noted that the value of n is artificially set. In this embodiment, the value of n is 3. The implementer can also set it by himself according to the specific situation. This embodiment does not impose any special restrictions.

[0040] Different 3D game terrain scenes have varying degrees of local similarity. For example, desert terrain scenes have a high degree of similarity within each scene, while forest terrain scenes have a low degree of similarity. The pixel distribution in the search and comparison matrix varies for each terrain scene. When the degree of similarity within the terrain scenes is high, the grayscale values ​​of the pixels in the search and comparison matrix are closely distributed, with minimal differences between different pixels. However, when the degree of similarity within the terrain scenes is low, the grayscale values ​​of the pixels in the search and comparison matrix vary significantly.

[0041] Therefore, based on the above analysis, the distribution differences of the grayscale values ​​of pixels in the search comparison matrix are analyzed. The specific process is as follows:

[0042] The grayscale values ​​of all pixels in the search contrast matrix are used as the input of the clustering algorithm, wherein the neighborhood radius is set to r, and multiple clusters of each search contrast matrix are output.

[0043] It should be understood that the value of the neighborhood radius r is artificially set. In this embodiment, the value of the neighborhood radius r is 10. The implementer can also reasonably set it according to the specific situation. This embodiment does not impose any special restrictions. 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, data points that should belong to different clusters may be mistakenly merged into one cluster, and if the neighborhood radius is too small, many data points will be recorded as noise points, and data points that should originally belong to the same cluster may be divided into multiple clusters. Therefore, based on this embodiment, the value of the neighborhood radius r in this embodiment is set to 10.

[0044] It should be noted that there are many commonly used clustering algorithms. In this embodiment, the DBSACN clustering algorithm is used to cluster the grayscale values ​​of pixels in the search comparison matrix. In actual application, as other implementation methods, the implementer can also use the DPC density peak clustering algorithm or the k-means clustering algorithm. This embodiment does not impose any special restrictions on the selection of clustering algorithms.

[0045] Among them, the DBSCAN clustering algorithm is a well-known technology, and its clustering principle and process are not described in detail again.

[0046] The more uniform the grayscale value distribution of the pixels in the cluster is and the smaller the difference between the grayscale values ​​is, the more similar the structure of the part of the grayscale image corresponding to the cluster is. Therefore, when denoising this part, the search window can be appropriately enlarged to speed up the denoising efficiency.

[0047] Therefore, for each search comparison matrix, the histogram of the grayscale values ​​of all pixels in each cluster is counted to obtain the frequency of occurrence of the grayscale value of each pixel;

[0048] The method for obtaining the histogram is a well-known technology, and its specific obtaining principle will not be described in detail.

[0049] Furthermore, by analyzing the discrete degree and extreme distribution of the grayscale values ​​of all pixels in each cluster, the intra-cluster difference value of each cluster is constructed, specifically:

[0050] The intra-cluster difference value BF of cluster i i The expression is: BF i =P i ×R i Where, P i Represents the discrete coefficient of the grayscale value of all pixels in cluster i; R i Indicates the range of the grayscale values ​​of all pixels in the cluster.

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

[0052] According to the intra-cluster difference value of each cluster, it can be understood that when the difference in the grayscale value of the pixels within the cluster is greater, the dispersion coefficient of the grayscale values ​​of all pixels within the cluster is greater, and the range of the grayscale values ​​of all pixels is greater, the intra-cluster difference value of the obtained cluster is greater, indicating that the difference in the structural texture in the region of the cluster corresponding to the game scene image is greater, indicating that the information content in the region is higher. When processing the image, reducing the step size of the search window and keeping the region in the game scene image corresponding to the cluster with high information content can provide users with rich visual and structural information, thereby enhancing the realism and immersion of the scene;

[0053] On the contrary, if the difference in the structure within the cluster is smaller, the discrete coefficient of the grayscale values ​​of all pixels in the cluster is smaller, and the range of the grayscale values ​​of all pixels is smaller, the obtained intra-cluster difference value of the cluster is smaller, indicating that the structural texture difference in the area corresponding to the cluster in the game scene image is smaller, indicating that the difference between the grayscale values ​​of the pixels in the area is smaller, and the terrain structure distribution in the corresponding area is more similar. Therefore, when processing this area in the game scene image, the step size of the search window can be increased to improve the efficiency of image denoising.

[0054] The more pixels in a cluster, the greater the proportion of similar structures in the cluster in the search comparison matrix. In this case, the higher the consistency of the grayscale values ​​of the pixels in the search comparison matrix, the smaller the difference between the pixels in the cluster. This consistency means that when processing game scene images, 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 intra-cluster difference value of each cluster and the number of grayscale values ​​of all pixels in each cluster, the consistency index of each cluster is determined. The denoising efficiency of the BM3D algorithm is adjusted according to the consistency index to improve the quality and efficiency of 3D game scene modeling. Specifically:

[0056] 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.

[0057] According to the consistency index of each cluster, it can be understood that when the number of elements in the cluster is greater, the proportion of the cluster in the image is greater, and if the intra-cluster difference value of the cluster is smaller, it means that the structural texture similarity of the corresponding part of the cluster in the 3D scene grayscale image is greater. When processing this part of the image, a more efficient processing strategy can be adopted to improve the efficiency of 3D game scene construction; conversely, when the number of elements in the cluster is smaller, it means that the proportion of the cluster in the image is smaller, and if the intra-cluster difference value of the cluster is larger, it means that the structural texture similarity of the corresponding part of the cluster in the game scene image is smaller, that is, the structural texture of the game scene terrain is more complex. When processing the image corresponding to 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: Determine the complexity index of each search comparison matrix 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.

[0059] For different clusters of the search contrast matrix, when performing BM3D algorithm image enhancement, the similarity between the data is compared by dividing them into blocks. When the structural distribution of each part of the 3D game scene is closer, it means that the texture features of the pixels in different clusters are very similar. The concentration of these similar elements enables the clusters to better represent the specific structures or features in the image.

[0060] Therefore, 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, thereby further judging the complexity of the terrain features in the game scene image, optimizing the denoising algorithm, improving the denoising efficiency, and further improving the quality and efficiency of 3D game scene modeling. Specifically:

[0061] The structural distribution complexity hd of the mth search comparison matrix m The expression is: Where 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 m-th search comparison matrix.

[0062] Based on the structural distribution complexity of each search comparison matrix, it can be understood that greater differences in texture features between clusters in the search comparison matrix indicate greater structural diversity in the game scene image. Therefore, increasing the complexity of the denoising algorithm should be considered when processing the game scene image. In game terrain modeling, these clusters with complex structural distributions should be processed more meticulously to ensure the richness and diversity of the scene. Maintaining high detail in these clusters with high structural distribution complexity can provide users with a richer and more detailed visual experience, enhancing the realism and immersion of the scene. Conversely, smaller differences in texture features between clusters in the search comparison matrix indicate a simpler and more uniform terrain structure in the game scene image. This can reduce the complexity of the denoising algorithm, improve denoising efficiency, and further enhance the efficiency of 3D game scene modeling.

[0063] Step S4: 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, and each game scene image is denoised in combination with the image denoising algorithm. Based on the denoised game scene image, the 3D game scene terrain is modeled.

[0064] When using the BM3D algorithm to denoise game scene images during 3D game scene modeling, the similarity between image blocks is compared and calculated. Therefore, when the grayscale values ​​of all pixels at the same position between different image blocks are close, it indicates a high degree of similarity between the image blocks, indicating a relatively simple terrain structure in the 3D game scene. The structural distribution complexity of the search comparison matrix represents the structural complexity between pixels at the same position across all image blocks. A larger structural distribution complexity value indicates a lower degree of similarity between the image blocks. When using the BM3D algorithm, the search window should use a smaller step size to ensure that more detailed attributes are retained when processing the image. This ensures that the 3D game scene modeled using this image has richer details and a higher visual experience.

[0065] Therefore, 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, 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 optimization processing step length of the qth game scene image q The expression 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 image block length; ous{} represents the maximum even function; norm() represents the normalization function; a represents the preset minimum image block length.

[0067] Preferably, the schematic diagram of the optimization processing step size extraction process provided in this embodiment is as follows Figure 3 shown.

[0068] It should be noted that the length of the image block is related to the pixel size of the image and the image block segmentation method. In this embodiment, each game scene image is segmented into n×n image blocks, so the length of each image block is 1 / 4 of the length of the game scene image. The value of the preset minimum image block length is artificially set. In this embodiment, the value of the preset minimum image block length is 3.

[0069] The implementer may also reasonably set it according to the specific situation, and this embodiment does not impose any 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 repeated here.

[0070] According to the optimized processing step size of each game scene image, it can be understood that when the mean and average absolute deviation of the structural distribution complexity of all search contrast matrices are larger, the difference between different image blocks in the game scene image is higher, that is, the more complex the terrain features in the game scene image are, a smaller processing step size should be used 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; conversely, if the mean and average absolute deviation of the structural distribution complexity of all search contrast matrices are smaller, 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, so 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, thereby accelerating the denoising efficiency of the game scene image, and thereby improving the efficiency of 3D game scene modeling.

[0071] Furthermore, 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.

[0072] The denoised game scene image is used as the image to be modeled, and the scale-invariant feature transform SIFT algorithm is used to extract the feature points and their descriptors in each image to be modeled. 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 matching feature point pairs are output. All matching feature point pairs are used as the input of the solvePnP function in OpenCV, and the position and direction of all cameras are output. The three-dimensional spatial coordinates of all feature points are further obtained based on the position and direction of all cameras and the triangulation principle. 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 triangulation principle, and the 3D modeling technology are all well-known technologies, and their specific principles and processes are not repeated here.

[0074] At this point, this embodiment optimizes the processing step size through dynamic calculation, and adjusts the step size of the BM3D algorithm according to the structural distribution complexity of the terrain images of different game scenes, so that the image enhancement process can retain image details more finely, 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, this embodiment enhances the image denoising effect while reducing unnecessary waste of computing resources by precisely adjusting the step size. 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 algorithm's running time and resource consumption, 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, the steps of any one of the above-mentioned 3D game scene terrain modeling methods are implemented.

[0076] It should be noted that the order in which the embodiments of the present application are presented is for illustrative purposes only and does not necessarily represent the superiority or inferiority of the embodiments. Furthermore, the foregoing descriptions of specific embodiments of this specification are provided. Furthermore, the processes depicted in the accompanying drawings do not necessarily require the specific order or sequential sequence shown to achieve the desired results. In certain embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0077] The various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referred to each other. Each embodiment focuses on the differences from other embodiments.

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

Claims

1. A 3D game scene terrain modeling method, characterized in that: The method comprises the following steps: During the 3D game scene terrain modeling process, 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 based on the position distribution of pixel points in different image blocks, a search comparison matrix is ​​constructed in each game scene image, whose elements are the grayscale values ​​of the pixel points; Cluster the grayscale values ​​of all pixels in each search and comparison matrix to obtain multiple clusters. By analyzing the discrete degree and extreme distribution of the grayscale values ​​of all pixels in each cluster, the intra-cluster difference value of each cluster is constructed. Combined with the number of grayscale values ​​of all pixels in each cluster, the consistency index of each cluster is determined. The complexity index of each search comparison matrix is ​​determined 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. 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. The expression of the complex index of each search comparison matrix is: Where hd m represents the structural distribution complexity of the m-th 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; Nm represents the number of all clusters in the m-th search comparison matrix; 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 image block length; ous{} represents the maximum even function; norm() represents the normalization function; a represents the preset minimum image block length.

2. A 3D game scene terrain modeling method according to claim 1, characterized in that: The method for constructing 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 according to claim 1, characterized in that: The expression of the intra-cluster difference value of each cluster is: BF i =P i ×R i Where, 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 Indicates the range of the grayscale values ​​of all pixels in the cluster.

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

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

6. A 3D game scene terrain modeling method according to 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.

7. A 3D game scene terrain modeling method according to 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 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.

8. 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 the 3D game scene terrain modeling method as described in any one of claims 1-7 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