CN109102565B - Method for automatically generating virtual terrain - Google Patents

Method for automatically generating virtual terrain Download PDF

Info

Publication number
CN109102565B
CN109102565B CN201810729619.4A CN201810729619A CN109102565B CN 109102565 B CN109102565 B CN 109102565B CN 201810729619 A CN201810729619 A CN 201810729619A CN 109102565 B CN109102565 B CN 109102565B
Authority
CN
China
Prior art keywords
sketch
sample
small blocks
original
small block
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201810729619.4A
Other languages
Chinese (zh)
Other versions
CN109102565A (en
Inventor
卢国明
刘贵松
罗光春
秦科
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Neijiang Xiayidai Internet Data Processing Technology Research Institute
University of Electronic Science and Technology of China
Original Assignee
Neijiang Xiayidai Internet Data Processing Technology Research Institute
University of Electronic Science and Technology of China
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Neijiang Xiayidai Internet Data Processing Technology Research Institute, University of Electronic Science and Technology of China filed Critical Neijiang Xiayidai Internet Data Processing Technology Research Institute
Priority to CN201810729619.4A priority Critical patent/CN109102565B/en
Publication of CN109102565A publication Critical patent/CN109102565A/en
Application granted granted Critical
Publication of CN109102565B publication Critical patent/CN109102565B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T17/00Three dimensional [3D] modelling, e.g. data description of 3D objects
    • G06T17/05Geographic models
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/23Clustering techniques
    • G06F18/232Non-hierarchical techniques
    • G06F18/2321Non-hierarchical techniques using statistics or function optimisation, e.g. modelling of probability density functions
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • G06F18/243Classification techniques relating to the number of classes
    • G06F18/24323Tree-organised classifiers
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T11/002D [Two Dimensional] image generation
    • G06T11/20Drawing from basic elements, e.g. lines or circles
    • G06T11/203Drawing of straight lines or curves
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/50Image enhancement or restoration using two or more images, e.g. averaging or subtraction
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/11Region-based segmentation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20021Dividing image into blocks, subimages or windows
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20212Image combination
    • G06T2207/20221Image fusion; Image merging

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Evolutionary Biology (AREA)
  • Evolutionary Computation (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • General Engineering & Computer Science (AREA)
  • Artificial Intelligence (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Geometry (AREA)
  • Software Systems (AREA)
  • Probability & Statistics with Applications (AREA)
  • Remote Sensing (AREA)
  • Computer Graphics (AREA)
  • Processing Or Creating Images (AREA)

Abstract

The invention discloses a method for automatically generating a virtual terrain, which is characterized by respectively extracting characteristic curves of a sketch and a sample DEM to obtain a sketch characteristic image and a sample characteristic image; dividing the sketch feature image into sketch small blocks, wherein the sketch small blocks correspond to sketch original small blocks on a sketch; dividing the sample characteristic image into sample small blocks, wherein the sample small blocks correspond to the original sample small blocks on the sample DEM, and performing cluster analysis on the sketch small blocks and the sample small blocks to obtain a cluster result; obtaining the matching relation between the original small blocks of the draft and the original small blocks of the sample according to the clustering result; synthesizing a result terrain image by using the matching relation; the invention realizes the automatic generation of the virtual terrain by using the clustering method, can establish all matching relations by adopting the clustering method to realize one-time traversal of the sketch small blocks, and avoids repeatedly searching a huge sample space, thereby improving the synthesis efficiency.

Description

Method for automatically generating virtual terrain
Technical Field
The invention relates to the field of virtual terrains, in particular to a method for automatically generating a virtual terrains.
Background
The virtual outdoor scene has wide application requirements in the aspects of games, movie special effects, battlefield simulation, landscape design and the like, and the terrain serving as a key component in the virtual scene greatly influences the real experience effect of the virtual scene. Although real terrain models can be conveniently retrieved from the internet (e.g., digital Elevation Models (DEMs) of real terrain are provided by u.s.geographic Survey, which can be downloaded without charge), and can be directly added to 3D scenes as needed, the diversity of terrain is limited by the very limited real terrain and the need to control terrain generation cannot be met, so computer or artificially generated terrain is mostly used in practical applications. The method of manually generating a terrain requires a professional to manually create a three-dimensional terrain or draw a 2D grayscale image (height map) using a 3D modeling tool. As the demand for larger and more realistic terrain grows, manual modeling becomes more complex and time consuming, and the skill requirements for personnel also become higher, which greatly increases the development cost of related applications, and finding ways to obtain target terrain that is lower cost and efficient is an urgent issue to be solved. The automatic generation of virtual landforms by computers can solve the problems caused by manual generation, and is increasingly becoming an important link for constructing virtual scenes. The virtual environment is mainly constructed to realize immersive user experience, and in order to achieve the experience effect, the terrain is required to have high reality; in the application scene of the virtual terrain, the biggest problem of directly using the easily obtained real terrain is that the style of the real terrain is limited, and realizing the control and recombination of terrain features is a big problem to be solved by terrain synthesis calculation; one of the main objectives of developing computer-generated terrain is to pursue higher efficiency, which includes two aspects, one is to demand a terrain synthesis technology that can rapidly obtain a target terrain in terms of time cost, and the other is to demand a terrain synthesis technology that is simple and convenient to use and does not have high learning cost for users. Therefore, the terrain synthesis technology always aims at more real results, more convenient and flexible control and more efficient process, which is a standard for measuring the advancement of the terrain synthesis technology.
The terrain synthesis technology successively presents a terrain synthesis method based on a fractal model, a terrain synthesis method based on a physical erosion model and a terrain synthesis method based on a sample. The terrain synthesis method based on the fractal model generates terrain in a random generation mode, the speed of generating the terrain is high, but the result lacks physical erosion effect in the real terrain, the difference from the visual effect of the real terrain is large, meanwhile, the adjustment of synthesis parameters of the method has no rule on the influence of the synthesis result, and the synthesis result is difficult to control. The terrain synthesis method based on the physical erosion model is used for simulating erosion effects such as water bodies, sunshine and the like in the natural environment on the basis of the existing rough terrain to improve the authenticity of a synthesis result, for example, on the basis of obtaining a rough terrain by the terrain synthesis method based on the fractal model, the method is used for simulating the erosion effects in the natural environment. Compared with a synthetic result of a fractal model, the method has the advantages that the reality is greatly improved due to the addition of the physical erosion effect, but the method is high in calculation cost, and meanwhile, a user is required to be familiar with and master various physical erosion models, so that the learning cost is high. The terrain synthesis method based on the samples uses the DEM of the real terrain as the samples, uses the user sketch as the control to generate the result which is in line with the user sketch control and has the sample terrain style. According to the synthesis method, the small blocks in the synthesis result are from the DEM of the real terrain, the synthesis result has high reality sense, and meanwhile, the user control interface is provided in a sketch mode, so that the synthesis can be conveniently controlled. Compared with the first two methods, the sample-based terrain synthesis method has great improvement on the synthesis effect and control of the result terrain. The method is favored by researchers after being proposed, and the existing research mainly focuses on controlling the synthesis more conveniently and flexibly so that the obtained result terrain is more in line with the expectation of users; the feature matching is more accurate, mainly the improvement on the calculation method of the matching cost, so that the control that the obtained terrain is more fit with a sketch is realized. But this method requires searching the sample space for matching blocks from the sketch, and the process is very time consuming due to the large search space. In the aspect of efficiency, researchers also propose to improve the synthesis efficiency by adopting a hardware acceleration mode and achieve better effects, but the basis of the hardware acceleration is still based on repeated search of a sample space to find a proper matching block, and excessive improvement is not performed in the aspect of algorithm design.
Disclosure of Invention
The invention aims to: the method for automatically generating the virtual terrain solves the technical problems that in the existing terrain synthesis method based on the sample, the search space is huge and the time is consumed in the terrain generation process.
The technical scheme adopted by the invention is as follows:
a method of automatically generating a virtual terrain, comprising the steps of:
step 1: respectively extracting characteristic curves of the sketch and the sample DEM to obtain a sketch characteristic image and a sample characteristic image;
step 2: dividing the sketch feature image into sketch small blocks, wherein the sketch small blocks correspond to sketch original small blocks on a sketch; dividing the sample characteristic image into sample small blocks, wherein the sample small blocks correspond to the original sample small blocks on the sample DEM, and performing cluster analysis on the sketch small blocks and the sample small blocks to obtain a cluster result;
and step 3: obtaining the matching relation between the original small blocks of the draft and the original small blocks of the sample according to the clustering result;
and 4, step 4: and synthesizing a result terrain image by using the matching relation.
Further, the specific steps of obtaining the sketch feature image and the sample feature image in the step 1 are as follows:
step 11: respectively carrying out candidate characteristic point identification on a sketch (or a sample DEM);
step 12: connecting the identified adjacent candidate feature points to obtain a feature line;
step 13: converting the candidate characteristic points and the characteristic lines into a graph;
step 14: extracting a minimum forest from the graph by using a Kruskal algorithm;
step 15: and constructing a sketch feature image (or a sample feature image) by using the minimum forest.
Further, in the step 11, a local maximum of elevation values at fixed length positions in the sketch (or the sample DEM) is used as a candidate feature value.
Further, in the step 12, if the line segments are short and intersected during the connection, the elevation values at the two ends of the line segments are used to determine the weight of the short and intersected line segments, the line segments with high weight are retained during the extraction of ridge lines, and the line segments with low weight are retained during the extraction of valleys.
Further, step 2 specifically comprises:
step 21: dividing the sketch feature image into a sketch small block set S { S } 1 ,s 2 ,...,s m Dividing the sample characteristic image into a sample small block set E { E } 1 ,e 2 ,...,e n M represents the number of elements in the sketch small block set, and n represents the number of elements in the sample small block set;
step 22: merging the sketch small block set S and the sample small block set E, and obtaining k +1 clusters by using the branch number B {0,1..,.., k } of the characteristic lines in all the small blocks, wherein k represents the number of the branch of the characteristic lines;
step 23: traversing the k +1 clusters, and removing clusters which do not contain any element in the sketch small block set S; fusing clusters without any elements in the sample small block set E into clusters smaller than the current branch number; get a new set M M 1 ,m 2 ,...,m j And the set C C 1 ,c 2 ,...,c j The elements in the set M contain elements from the draft small block set S and the sample small block set E at the same time, the elements in the set C are from the draft small block set S, and j represents the number of the elements in the set M and the set C;
step 24: and performing cluster analysis on the set M by taking the set C as a central set to obtain a cluster set corresponding to each cluster central point in the central set.
Further, step 3 specifically comprises:
step 31: searching the sketch small block a of the unmatched sample small block in the clustering result;
step 32: g nearest neighbor sample small blocks of the chart small block a in the clustering result are obtained to form a candidate set c;
step 33: acquiring a corresponding original sketch small block Ra of the sketch small block a in the sketch; obtaining sample original small blocks corresponding to the sample small blocks in the candidate set c in the sample DEM to form a set Rc;
step 34: respectively calculating the distance between the original small block Ra and each sample original small block in the set Rc, and selecting the sample original small block with small distance as a matching block of the sketch original small block Ra, wherein the calculation formula of the distance is as follows:
D=∑(x i -y i ) 2 x represents the elevation value of the coordinate corresponding to the original small block of the draft, y represents the elevation value of the coordinate corresponding to the original small block of the sample, and i represents the serial number of the coordinate point.
Further, step 4 specifically includes:
step 41: creating a blank canvas Q with the same size as the sketch, and establishing a coordinate system with the same size as the sketch;
step 42: placing the matched sample original small blocks in the blank canvas Q according to the coordinates of the corresponding sketch original small blocks;
step 43: and (4) carrying out fusion processing on gaps among original small blocks of the samples in the blank canvas Q to obtain a final result terrain image.
In summary, due to the adoption of the technical scheme, the invention has the beneficial effects that:
the invention realizes the automatic generation of the virtual terrain by using the clustering method, can establish all matching relations by adopting the clustering method to realize one-time traversal of the sketch small blocks, and avoids repeatedly searching a huge sample space, thereby improving the synthesis efficiency.
Drawings
The invention will now be described, by way of example, with reference to the accompanying drawings, in which:
FIG. 1 is an overall flow diagram of the present invention;
FIG. 2 is a flow chart of a feature curve extraction algorithm in the present invention;
fig. 3 is an overall framework diagram of the present invention.
Detailed Description
All of the features disclosed in this specification, or all of the steps in any method or process so disclosed, may be combined in any combination, except combinations of features and/or steps that are mutually exclusive.
The present invention is described in detail below with reference to fig. 1-3.
A method of automatically generating a virtual terrain, comprising the steps of:
step 1: respectively extracting characteristic curves of the sketch and the sample DEM to obtain a sketch characteristic image and a sample characteristic image;
step 2: dividing the sketch feature image into sketch small blocks, wherein the sketch small blocks correspond to sketch original small blocks on a sketch; dividing the sample characteristic image into sample small blocks, wherein the sample small blocks correspond to the original sample small blocks on the sample DEM, and performing cluster analysis on the sketch small blocks and the sample small blocks to obtain a cluster result;
and step 3: obtaining the matching relation between the original small blocks of the draft and the original small blocks of the sample according to the clustering result;
and 4, step 4: and synthesizing a result terrain image by utilizing the matching relation.
Further, the specific steps of obtaining the sketch feature image and the sample feature image in the step 1 are as follows:
step 11: respectively carrying out candidate characteristic point identification on a sketch (or a sample DEM);
step 12: connecting the identified adjacent candidate feature points to obtain a feature line;
step 13: converting the candidate characteristic points and the characteristic lines into a graph;
step 14: extracting a minimum forest from the graph by using a Kruskal algorithm;
step 15: and constructing a sketch feature image (or feature image) by using the minimum forest.
Further, in step 11, a local maximum of elevation values at fixed length positions in the sketch (or sample DEM) is used as a candidate feature value.
Further, in step 12, if the line segments are short and intersected during the connection, the height values of the two ends of the line segments are used to determine the weight of the short and intersected line segments, the line segments with high weight are retained during the extraction of ridge lines, and the line segments with low weight are retained during the extraction of valleys.
Further, step 2 specifically comprises:
step 21: dividing the sketch feature image into a sketch small block set S { S } 1 ,s 2 ,...,s m Dividing the sample characteristic image into a sample small block set E { E } 1 ,e 2 ,...,e n M represents the number of elements in the sketch small block set, and n represents the number of elements in the sample small block set;
step 22: merging the sketch small block set S and the sample small block set E, and obtaining k +1 clusters by using the branch number B {0,1..,.., k } of the characteristic lines in all the small blocks, wherein k represents the number of the branch of the characteristic lines;
step 23: traversing the k +1 clusters, and removing clusters which do not contain any element in the sketch small block set S; fusing clusters without any elements in the sample small block set E into clusters smaller than the current branch number; get a new set M M 1 ,m 2 ,...,m j And the set C C 1 ,c 2 ,...,c j The elements in the set M simultaneously contain elements from a sketch small block set S and a sample small block set E, the elements in the set C are from elements in the sketch small block set S, and j represents the number of the elements in the set M and the set C;
step 24: and performing cluster analysis on the set M by taking the set C as a central set to obtain a cluster set corresponding to each cluster central point in the central set.
Further, step 3 specifically comprises:
step 31: searching the sketch small block a of the unmatched sample small block in the clustering result;
step 32: obtaining g nearest neighbor sample small blocks of the chart small block a in the clustering result to form a candidate set c;
step 33: acquiring a corresponding original sketch small block Ra of the sketch small block a in the sketch; obtaining sample original small blocks corresponding to the sample small blocks in the candidate set c in the sample DEM to form a set Rc;
step 34: respectively calculating the distance between the original small block Ra and each sample original small block in the set Rc, and selecting the sample original small block with small distance as a matching block of the sketch original small block Ra, wherein the calculation formula of the distance is as follows:
D=∑(x i -y i ) 2 x represents the elevation value of the corresponding coordinate of the original small block of the draft, y represents the elevation value of the corresponding coordinate of the original small block of the sample, and i represents the serial number of the coordinate point.
Further, step 4 specifically includes:
step 41: creating a blank canvas Q with the same size as the sketch, and establishing a coordinate system with the same size as the sketch;
step 42: placing the matched sample original small blocks in the blank canvas Q according to the coordinates of the corresponding sketch original small blocks;
step 43: and (4) carrying out fusion processing on gaps among original small blocks of the samples in the blank canvas Q to obtain a final result terrain image.
DETAILED DESCRIPTION OF EMBODIMENT (S) OF INVENTION
The terrain generating method adopted by the invention adopts the DEM of the real terrain as a sample, simultaneously provides a sketch drawing function as a user control interface, and automatically generates the virtual terrain which accords with the user control sketch and keeps the terrain style of the 0 sample. The method has the greatest characteristic that repeated retrieval operation on the sample library is avoided through a clustering method, and the method is favorable for improving the terrain synthesis efficiency. In the method, the draft and the DEM of the real terrain both represent the altitude value by the pixel value, and the synthetic result is also represented in the same form. In the virtual terrain, large-scale characteristic curves are key factors influencing visual experience, a user sketch mainly controls the distribution, the trend, the altitude and the like of the characteristic curves of the result terrain, the coincidence degree of the characteristic curves in the result terrain and the characteristic curves drawn in the user sketch directly influences the visual experience of a synthetic effect, and therefore matching of the characteristic curves is preferentially ensured. In order to remove the influence of other factors, before the matching relationship is constructed, the method firstly extracts the characteristic curves of the sketch and the sample graph to obtain respective characteristic curve images, and constructs the matching relationship between the sketch and the sample graph by clustering analysis on small blocks obtained after the characteristic images are segmented.
On one hand, in order to preferentially match the features, the feature curve is the most significant factor influencing visual experience in the terrain, and the matching of the features should be preferentially ensured during synthesis; on the other hand, the sketch provided by the user is often simpler, only rough definition is performed from the distribution and trend of the features, and a region without the features is likely to be blank, so that the difference between the original image of the sketch of the user and the original image of the sample map is larger, and the sketch and the sample map are completely attributed to different clusters by directly cutting the original images of the sketch and the sample map and then clustering, so that the construction of the matching relationship between the sketch and the sample map is difficult to realize. After the features are extracted, only the feature curves of the draft image and the sample image are reserved, so that the difference of the draft image and the sample image is reduced, and mixed clustering can be realized. Because only the classification of the feature images is realized in the clustering result, the clustering relation can only find the matching relation between the feature images, but the matching blocks required in the synthesis result must come from the original images, and the matching of the feature small blocks corresponds to the original images and new influence factors may appear, the matching relation between the sketch and the sample original images is realized in two steps: firstly, k sample feature blocks matched with the sketch feature blocks are found out through clustering results to serve as candidate sets, then original blocks corresponding to the sketch feature blocks and the sample feature candidate block sets are found out, and the matched original blocks of the sketch are determined by calculating the matching degree of the original blocks of the sketch and the original blocks of the corresponding sample feature block sets.
After each small block in the draft image establishes a matching relationship with a small block in the sample, the matching small blocks in the sample images are spliced according to the position relationship of the matched draft image small blocks to obtain a result terrain required by a synthesis target. However, the sample matching blocks cannot be simply spliced, and because gaps may occur between small blocks, the gaps need to be processed through fusion operation so as to ensure that the small blocks have reasonable smooth transition, and the visual experience is not influenced by the occurrence of obvious artificial traces.
The method comprises the following specific steps:
step 1: respectively extracting characteristic curves of the sketch and the sample DEM to obtain a sketch characteristic image and a sample characteristic image;
the specific steps of obtaining the sketch characteristic image and the sample characteristic image are as follows:
step 11: respectively identifying candidate characteristic points on a sketch (or a sample DEM), and taking a local maximum value of a height value at a fixed length position in the sketch (or the sample DEM) as a candidate characteristic value, wherein the method specifically comprises the following steps: for a position p of a sketch (or a sample DEM), if a point lower than the elevation value of the point p can be found on both sides of the bisector direction of the axis direction and the axis included angle of the position p by taking the length specified by a user as a radius around the position p, determining the point p as a characteristic candidate point;
step 12: connecting the identified adjacent candidate feature points to obtain a feature line; and if the line segments are short and intersected during connection, determining the weight of the short intersected line segments by using the elevation values at the two ends of the line segments, reserving the line segments with high weight when extracting ridge lines, and reserving the line segments with low weight when extracting valleys.
Step 13: converting the candidate characteristic points and the characteristic lines into a graph, storing characteristic information by adopting a data structure of the graph, and performing subsequent operations mainly aiming at the graph;
step 14: extracting a minimum forest from the graph by using a Kruskal algorithm, wherein the process is also calculated according to the weight used in the situation of line segment intersection when candidate points are connected;
step 15: and constructing a sketch feature image (or a sample feature image) by using the minimum forest, and if the distances of the feature points are very uneven, selecting a middle position on a connecting line of the feature points to optimize the structure of the minimum forest so as to ensure that the feature points on the final feature forest are uniformly distributed.
And 2, step: dividing the sketch feature image into sketch small blocks, wherein the sketch small blocks correspond to sketch original small blocks on a sketch; dividing the sample characteristic image into sample small blocks, wherein the sample small blocks correspond to the original sample small blocks on the sample DEM, and performing cluster analysis on the sketch small blocks and the sample small blocks to obtain a cluster result;
the method comprises the following specific steps:
step 21: dividing the sketch feature image into a sketch small block set S { S } 1 ,s 2 ,...,s m Dividing the sample characteristic image into a sample small block set E { E } 1 ,e 2 ,...,e n M represents the number of elements in the sketch small block set, and n represents the number of elements in the sample small block set;
step 22: merging the sketch small block set S and the sample small block set E, and obtaining k +1 clusters by using the branch number B {0,1,.. So, k } of the characteristic lines in all the small blocks, wherein k represents the number of the branches of the characteristic lines;
step 23: traversing the k +1 clusters, and removing clusters which do not contain any elements in the sketch small block set S; fusing clusters without any elements in the sample small block set E into clusters smaller than the current branch number; get a new set M M 1 ,m 2 ,...,m j And the set C C 1 ,c 2 ,...,c j The elements in the set M simultaneously contain elements from a sketch small block set S and a sample small block set E, the elements in the set C are from elements in the sketch small block set S, and j represents the number of the elements in the set M and the set C;
step 24: performing cluster analysis on the set M by taking the set C as a central set to obtain a cluster set corresponding to each cluster central point in the central set; the method comprises the following specific steps: traversing each clustering center point in the center set C for each element in the set M once, determining the clustering center point with the shortest distance between each element and the clustering center set, and dividing each element point into the set corresponding to the clustering center point with the shortest distance in the clustering center set to obtain the clustering set corresponding to each clustering center point in the clustering center set;
and step 3: obtaining the matching relation between the original small blocks of the draft and the original small blocks of the sample according to the clustering result;
the method specifically comprises the following steps:
step 31: searching the sketch small block a of the unmatched sample small block in the clustering result;
step 32: obtaining g nearest neighbor sample small blocks of the chart small block a in the clustering result to form a candidate set c;
step 33: acquiring a corresponding original sketch small block Ra of the sketch small block a in the sketch; obtaining sample original small blocks corresponding to the sample small blocks in the candidate set c in the sample DEM to form a set Rc;
step 34: respectively calculating the distance between the original small block Ra and each sample original small block in the set Rc, and selecting the sample original small block with small distance as a matching block of the sketch original small block Ra, wherein the calculation formula of the distance is as follows:
D=∑(x i -y i ) 2 x represents the elevation value of the corresponding coordinate of the original small block of the draft, y represents the elevation value of the corresponding coordinate of the original small block of the sample, and i represents.
And 4, step 4: and synthesizing a result terrain image by using the matching relation.
The method specifically comprises the following steps:
step 41: creating a blank canvas Q with the same size as the sketch, and establishing a coordinate system with the same size as the sketch; creating the same coordinate system refers to: for a certain point A on the sketch and a certain point B on the canvas Q, assuming that the relative positions of A and B on the sketch and Q are consistent, the coordinate values of A and B in the respective coordinate systems should be consistent;
step 42: placing the matched sample original small blocks in the blank canvas Q according to the coordinates of the corresponding sketch original small blocks; the method specifically comprises the following steps: the coordinate of the matched sample original small block in the result image is the coordinate of the matched draft original small block; for example, the matching sample original tile corresponding to the tile at the coordinate of (64, 64) position in the sketch is P64, then P64 is placed at the coordinate position of (64, 64) of the canvas Q, and so on, until the canvas Q is filled; the original small blocks of the sample matched with the sketch are all from the sample image, and the characteristic control of the sketch on the synthesis is realized through the matching relation constructed in the previous step.
Step 43: carrying out fusion processing on gaps among original small blocks of the samples in the blank canvas Q to obtain a final result terrain image; the method specifically comprises the following steps: and combining two interpolation methods of Graph Cut and Shepard for interblock fusion. For convenience of description, it is assumed that two blocks overlapped are Pa and Pb, respectively, and their overlapped regions are referred to as O. An optimal joint is first found between Pa and Pb by performing Graph Cut. In order to execute the Graph Cut, the overlap region O needs to be converted into a Graph to be operated. The weights of the edges in the graph are determined by the height values of the two blocks in O and their directional derivatives. After the graph corresponding to the overlap area O is constructed, a partition needs to be found according to the weight in the graph, and the height value of which block should be reserved at the end of each pixel point is determined. The method for finding the graph minimal cut is generally implemented by using a well-known minimal cut or maximum flow algorithm in graph theory. After the GraphCut is finished, a dividing line can be found in the overlapped area of the two small blocks, the elevation value of one of the two overlapped blocks is reserved on the two sides of the dividing line, but an artificial trace still appears on the dividing line, and in order to eliminate the gap, shepard interpolation is successively carried out in the subsequent processing. By interpolation, the elevation values on the two sides of the dividing line can be ensured to be the same, so that gaps are eliminated, and the images are further fused.

Claims (6)

1. A method of automatically generating a virtual terrain, characterized by: the method comprises the following steps:
step 1: respectively extracting characteristic curves of the sketch and the sample DEM to obtain a sketch characteristic image and a sample characteristic image;
step 2: dividing the sketch feature image into sketch small blocks, wherein the sketch small blocks correspond to sketch original small blocks on a sketch; dividing the sample characteristic image into sample small blocks, wherein the sample small blocks correspond to the original sample small blocks on the sample DEM, and performing cluster analysis on the sketch small blocks and the sample small blocks to obtain a cluster result;
and step 3: obtaining the matching relation between the original sketch small blocks and the original sample small blocks according to the clustering result;
and 4, step 4: synthesizing a result terrain image by using the matching relation;
the step 2 specifically comprises the following steps:
step 21: dividing the sketch feature image into a sketch small block set S { S } 1 ,s 2 ,…,s m Dividing the sample characteristic image into a sample small block set E { E } 1 ,e 2 ,…,e n M represents the number of elements in the sketch small block set, and n represents the number of elements in the sample small block set;
step 22: merging the sketch small block set S and the sample small block set E, and obtaining k +1 clusters by using the branch number B {0,1, …, k } of the characteristic lines in all the small blocks, wherein k represents the number of the characteristic line branches;
step 23: traversing the k +1 clusters, and removing clusters which do not contain any element in the sketch small block set S; fusing clusters without any elements in the sample small block set E into clusters smaller than the current branch number; get a new set M M 1 ,m 2 ,…,m j And the set C C 1 ,c 2 ,…,c j The elements in the set M simultaneously contain elements from a sketch small block set S and a sample small block set E, the elements in the set C are from elements in the sketch small block set S, and j represents the number of the elements in the set M and the set C;
step 24: and performing cluster analysis on the set M by taking the set C as a central set to obtain a cluster set corresponding to each cluster central point in the central set.
2. A method of automatically generating a virtual terrain according to claim 1, characterized by:
the specific steps of obtaining the sketch characteristic image and the sample characteristic image in the step 1 are as follows:
step 11: respectively identifying candidate characteristic points on a sketch or a sample DEM;
step 12: connecting the identified adjacent candidate feature points to obtain a feature line;
step 13: converting the candidate characteristic points and the characteristic lines into a graph;
step 14: extracting a minimum forest from the graph by using a Kruskal algorithm;
step 15: and constructing a sketch feature image or a sample feature image by using the minimum forest.
3. A method of automatically generating a virtual terrain according to claim 2, characterized in that: in the step 11, the local maximum value of the elevation value at the fixed length position in the sketch or the sample DEM is used as the candidate feature value.
4. A method of automatically generating a virtual terrain according to claim 2, characterized in that: in the step 12, if the line segments are short and intersected during connection, the weights of the short and intersected line segments are determined by using the elevation values at the two ends of the line segments, the line segment with high weight is reserved when the ridge line is extracted, and the line segment with low weight is reserved when the valley line is extracted.
5. A method of automatically generating a virtual terrain as claimed in claim 1, characterized in that: the step 3 specifically comprises the following steps:
step 31: searching the sketch small block a of the unmatched sample small block in the clustering result;
step 32: g nearest neighbor sample small blocks of the chart small block a in the clustering result are obtained to form a candidate set c;
step 33: acquiring a corresponding original sketch small block Ra of the sketch small block a in the sketch; obtaining sample original small blocks corresponding to the sample small blocks in the candidate set c in the sample DEM to form a set Rc;
step 34: respectively calculating the distance between the original small block Ra and each sample original small block in the set Rc, and selecting the sample original small block with small distance as a matching block of the sketch original small block Ra, wherein the calculation formula of the distance is as follows:
D=∑(x i -y i ) 2 x represents the elevation value of the corresponding coordinate of the original small block of the draft, and y represents the elevation of the corresponding coordinate of the original small block of the sampleThe value i represents the number of coordinate points.
6. A method of automatically generating a virtual terrain according to claim 1, characterized in that: the step 4 specifically comprises the following steps:
step 41: creating a blank canvas Q with the same size as the sketch, and establishing a coordinate system with the same size as the sketch;
step 42: placing the matched sample original small blocks in the blank canvas Q according to the coordinates of the corresponding sketch original small blocks;
step 43: and (4) carrying out fusion processing on gaps among original small blocks of the samples in the blank canvas Q to obtain a final result terrain image.
CN201810729619.4A 2018-07-05 2018-07-05 Method for automatically generating virtual terrain Active CN109102565B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810729619.4A CN109102565B (en) 2018-07-05 2018-07-05 Method for automatically generating virtual terrain

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810729619.4A CN109102565B (en) 2018-07-05 2018-07-05 Method for automatically generating virtual terrain

Publications (2)

Publication Number Publication Date
CN109102565A CN109102565A (en) 2018-12-28
CN109102565B true CN109102565B (en) 2022-10-14

Family

ID=64845759

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810729619.4A Active CN109102565B (en) 2018-07-05 2018-07-05 Method for automatically generating virtual terrain

Country Status (1)

Country Link
CN (1) CN109102565B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110009035B (en) * 2019-04-03 2020-10-27 中南大学 Wind measuring station cluster space clustering method based on image matching
CN112132213A (en) * 2020-09-23 2020-12-25 创新奇智(南京)科技有限公司 Sample image processing method and device, electronic equipment and storage medium

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102707332A (en) * 2012-05-11 2012-10-03 北京科技大学 Interpretation and evaluation method for reservoir area engineering geological survey

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7660441B2 (en) * 2004-07-09 2010-02-09 Southern California, University System and method for fusing geospatial data
WO2010029553A1 (en) * 2008-09-11 2010-03-18 Netanel Hagbi Method and system for compositing an augmented reality scene
KR101706206B1 (en) * 2013-05-13 2017-02-15 한국전자통신연구원 Method for describing terrain, method for creating terrain primitives, and apparatus using the methods
CN107633065B (en) * 2017-09-21 2020-06-02 天津大学 Identification method based on hand-drawn sketch

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102707332A (en) * 2012-05-11 2012-10-03 北京科技大学 Interpretation and evaluation method for reservoir area engineering geological survey

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
基于特征草图的地形生成方法研究;于健;《中国优秀硕士学位论文全文数据库 (信息科技辑)》;20170315;I138-4778 *
山脉图像轮廓线引导的三维虚拟地形合成;李伟 等;《计算机辅助设计与图形学学报》;20171231;第29卷(第12期);2235-2244 *

Also Published As

Publication number Publication date
CN109102565A (en) 2018-12-28

Similar Documents

Publication Publication Date Title
CN109658445A (en) Network training method, increment build drawing method, localization method, device and equipment
US6128019A (en) Real-time multi-sensor synthetic environment created from a feature and terrain database using interacting and updatable abstract models
Xie et al. Tree modeling with real tree-parts examples
CN105354883A (en) 3ds Max fast and precise three-dimensional modeling method and system based on point cloud
CN106846392A (en) The method and apparatus of three-dimensional modeling
CN102663800A (en) City building complex and rendering method considering city image
CN111028335B (en) Point cloud data block surface patch reconstruction method based on deep learning
Sugihara et al. Automatic generation of 3D building models from complicated building polygons
CN113192200B (en) Method for constructing urban real scene three-dimensional model based on space-three parallel computing algorithm
CN109102565B (en) Method for automatically generating virtual terrain
KR20070099298A (en) Method and apparatus for three-dimensional form generation for mobile navigation
CN111402415B (en) Object body elevation map generation method and device, storage medium and terminal equipment
Williams et al. A time-line approach for the generation of simulated settlements
Knott et al. Towards mesh-based deep learning for semantic segmentation in photogrammetry
Hu et al. Parallel BVH construction using locally density clustering
CN113838199B (en) Three-dimensional terrain generation method
CN107221027A (en) A kind of method that User Defined content is embedded in oblique photograph threedimensional model
CN109147032B (en) Distributed large-scale grid optimizing method
CN109509249B (en) Virtual scene light source intelligent generation method based on components
Xiong Reconstructing and correcting 3d building models using roof topology graphs
CN116152446B (en) Geological model subdivision method, device, terminal and medium based on UE4
CN115239890B (en) Skeleton construction method, skeleton construction device, storage medium and electronic equipment
Ryoo et al. Simulation of 3D Virtual Space Model Based on Texture Image & Structure Analysis
Yu et al. Three-dimensional design of architectural appearance in coastal areas based on digital media technology
Sugihara et al. Knowledge-based system for automatic 3D building generation from building footprint

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant