Three, summary of the invention
1, purpose: the object of the invention is based on Gestalt psychology and city image theoretical; Adopt the strand clustering procedure that extensive BUILDINGS MODELS is carried out cluster; And the method that adopts Delaunay triangulation and polyline merges fast classification results and simplifies; Set up urban architecture detail model with this, realize that the interactive three-dimensional of large scene, high density urban architecture is visual.
2, technical scheme: a kind of techniqueflow of the large scene urban architecture real-time three-dimensional visualization method based on spatial cognition is as shown in Figure 1, and concrete steps are following:
Step 1: utilize Gestalt psychology and city image theory to carry out the BUILDINGS MODELS cluster
Theoretical according to Gestalt psychology, figure is done as a whole by consciousness, and has certain correlativity between the each several part.People's vision is merged into an integral body according to certain organization rule with each several part, and these combination rules comprise proximity, similarity, good continuity and closure etc.
In building is comprehensive, in order to obtain to meet the result of cognitive law, also need analyzes distance relation, position relation and similarity and continuity etc. between building, and confirm Merge Scenarios according to analysis result.The key of building merge algorithm also is how to obtain its morphological feature and spatial relationship each other.On the other hand, when building merges, not only to consider the relation of adjacent building, also will consider the vision shape characteristic on the yardstick of city simultaneously.City image is meant the image of the high level overview of in people's brains outside urban environment being summarized, and it comprises five dvielements: road, border, zone, node and sign.Road is the subject element of city image perception; The border is meant except unexpected other boundary line of road, like the river etc.; The zone is meant the difference in functionality district in city, like central business district etc.; Node can be a tie point, like the road node, also can be the centrostigma of some characteristic, like square etc.; The characteristics of sign are to have uniqueness and significant in a certain respect.The simplification of urban architecture should keep this five dvielement as far as possible, makes that the building after simplifying meets the image of people to the city, helps people's effective identification spatial information, remains on the direction feeling when browsing.In this five dvielement, road be most important also be should be preferentially maintained.The present invention has combined city image theory and Gestalt psychology when building is comprehensively with simplification on a large scale, effectively kept road information, also takes into account zone and node information simultaneously to a certain extent.
Cluster has two effects, at first is the distribution pattern of identification building target, and the essential characteristic that building will keep and give prominence in simplifying is the characteristic of groups of building; Next is in order to raise the efficiency, and each type is considered to independently, merges and simplifies and will in class, carry out, and the data of other type need not to participate in calculating, and computing velocity is improved.Therefore cluster is one step of key of building shortcut calculation on a large scale.
The present invention adopts Monotone Chain hierarchical clustering method to guarantee that city image key elements such as road are able to preserve after cluster, with adjacency N as the cluster criterion, with the spatial relationship of better reflection buildings on two dimensional surface.
For the convenience of narrating, at first provide one group of definition.
Point arrives the distance on limit (line segment): for a v and straight-line segment s, cross a some v, do the vertical line of s.If intersection point v
tDrop on the line segment s, then v and v
tDistance be the distance (be referred to as vertical range) of a v to line segment s; Otherwise, get the minimum value of a v in the l two-end-point distance as the distance of a v to s.(being referred to as end-point distances).
Put polygonal distance: the bee-line of putting each limit of polygon.
Bee-line between the polygon: do not have polygon p crossing and relation of inclusion for two
1And p
2,
● calculate p
1All summits to p
2Minimum value in the distance is designated as d
1
● same, ask and calculate p
2All summits are to p
1Bee-line d
2
● get d
1, d
2In smaller value as polygon p
1And p
2Between bee-line d
Min, i.e. d
Min=min (d
1, d
1);
Two polygonal adjacent edge:
● ask the bee-line of calculating between two polygons, and in asking the calculation process, record d
MinCorresponding summit and limit and classification (being vertical range or end-point distances);
● if d
MinBe vertical range, suppose d
MinPairing polygon vertex is v
i, corresponding limit does
Ask v respectively
iThe limit at place
With
Angle (just ask the angle of calculating place, both sides straight line, span is between 0 to 90 degree).
In, with
The angle smaller is designated as s
1, the limit
Be designated as s
2, s
1, s
2Be called as one group of adjacent edge.
● if d
MinBe end-point distances, i.e. a polygonal vertex v
iWith another polygonal vertex v
iAt a distance of recently, then show adjacent edge will
The middle generation.Ask
and the angle of
; And
angle with
, two minimum limit of angle is adjacent edge.
Adjacency between the polygon: calculate s
1, s
2Length be respectively l
1And l
2, with s
2Project to s
1On, trying to achieve its projected length is l
1'; In like manner, s
1At s
2On projected length be respectively l
1' and l
2', polygon P then
1And P
2Between adjacency d
NearCan be expressed as:
d
near=d
min×(1-N×λ) (1)
N=(l
1′/l
1+l
2′/l
2)/2 (2)
Here, N is used for representing the position relation of adjacent edge, works as s
1And s
2When parallel and relative fully, l
1'=l
1, l
2'=l
2, N=1, λ are as weight factor, and value is between 0 to 1., d definite at λ
MinUnder the identical situation, N is big more, d
NearMore little, should preferentially be gathered is one type.Adopt adjacency, not only can reflect the distance relation between the buildings, also reflected the relative direction relation of relative orientation relation and adjacent edge to a certain extent, λ is used for confirming apart from N at d
NearIn the ratio that accounts for, λ is big more, it is big more that N accounts for weight, just means that also the position relation of adjacent edge should be paid the utmost attention to; λ is more little, and it is more little that N accounts for weight, and promptly minor increment d plays a leading role between polygon.The λ value is comparatively desirable at 0.6 o'clock.
In order to calculate polygon p
iAnd p
jBetween adjacency, asking for of adjacent edge is crucial.In order to raise the efficiency, at first foundation comprises this two convex closures that polygon is new.Adopt the Graham-Scan algorithm when convex closure is set up, its time complexity is O (nlogn).Through convex closure, can reduce and to carry out the number of vertex that distance is asked calculation.
If the convex closure of finally trying to achieve is made up of two polygonal summits, the limit of convex closure can be divided into two types: one type of connection be same polygonal summit, two another kind of end points belong to two polygons, such limit is known as the border.Convex closure comprises two borders, and four summits on these two borders are with p
iAnd p
jThe summit be divided into two groups, one group of calculating of participating in adjacent edge, another group then can not participated in the calculating of adjacent edge.Shown in the figure on Fig. 2 left side,
and
is one group of border.v
1-1And v
1-6With p
1The summit be divided into two groups.First group comprises vertex v
1-1, v
1-2..., v
1-5And v
1-6, these summits are apart from p
2Nearer, should participate in calculating; And another group vertex v
1-7And v
1-8Then away from p
2, when calculating, can not consider.Same p
2Vertex v
2-2And v
2-3Also can not participate in calculating.So there is p on the summit of participating at last calculating
1V
1-1, v
1-2..., v
1-5And v
1-6, and p
2V
2-4, v
2-5..., v
2-8, v
2-1, final calculating is p
1The limit
And p
2The limit
It is one group of adjacent edge
If the convex closure of finally trying to achieve is made up of a polygonal summit fully, show that this polygonal convex closure has comprised another polygon.Shown in the figure on Fig. 2 the right, p
2Be positioned at polygon p fully
1Convex closure in, so big that polygonal convex closure will surround one or more slits with this polygon, and little polygon must be positioned at a slit.The calculating of adjacent edge is participated on the point and the little polygonal summit that form this slit.In the figure of Fig. 2 the right, vertex v is arranged
1-7, v
1-8, v
1-9, v
1-10Slit that surrounds and vertex v
1-5, v
1-1, v
1-6The another one slit that surrounds.Through judging p
2Be positioned at { v
1-7, v
1-8, v
1-9, v
1-10In, so find the solution adjacent edge, only need use p
2Summit and p
1Vertex v
1-7, v
1-8, v
1-9, v
1-10
Step 2: the merging of BUILDINGS MODELS is with comprehensive between cluster
(1) merging of building on the two-dimensional projection plane between the class
After cluster, the polygon in every type is merged into a polygon, the polygon after being combined carries out comprehensively.When two polygons were merged into a new polygon, inevitable white space was included in the newly-generated polygon.At merging phase, utilize the summit of participating in adjacent edge again, generate the Delaunay triangulation network of belt restraining condition, then, definition connects triangle to (T
1, T
2), a diabolo (T
1, T
2) being known as that to connect triangle right, and if only if this triangle is to satisfying following three conditions:
● T1 and T2 share a limit, and this limit connects p
1And p
2
● another of T1 limit s
1Connect p
1Two summits;
● another of T2 limit s
2Connect p
2Two summits.
For one right in abutting connection with triangle, its limit s
1And s
2Adjacency be d by note
PairrEach triangle of adjacent triangle centering all has a limit connecting to belong to same leg-of-mutton two summits.For this limit, two situation are arranged: a kind of situation is that these two summits are adjacent, and promptly this edge overlaps with former polygonal limit, otherwise then is second kind of situation.If two triangles all satisfy first kind of situation, it is right then to be referred to as strict adjacent triangle, otherwise it is right to be referred to as non-strict adjacent triangle.If have one or more strictnesses right between two polygons to be combined, then calculate the right d of these triangles in abutting connection with triangle
Pairr, with having minimum d
PairrStrictness connect two polygons to be combined to produce new polygon in abutting connection with triangle to being used for.If do not have strict adjacent triangle right between two polygons, then choose and have minimum d
PairNon-strict contiguous triangle to connecting polygon.
(2) two-dimensional projection plane amalgamation result is comprehensive
The polygon that is formed by connecting through above-mentioned way has comprised too much detailed information, and it is further comprehensive to be combined the result.Adopt the Visvalingam-Whyatt polyline reduction algorithm, remove tiny sunk part.For narrating conveniently, define one type of triangle and be the depression triangle: according to counterclockwise direction, vertex v on the polygon
iWith its former and later two vertex v
I-1, v
I+1, form triangle { v
I-1, v
i, v
I+1, if along from v
I-1Through v
iAnd v
I+1Come back to v
I-1Direction be CW, then this triangle is defined as the depression triangle.Summit to two polygon portion other than connected portion travels through judgement successively, and the set of vertices triangularity that each point is adjacent with its front and back judges whether this triangle is the depression triangle.If, then write down its area, after traversal finishes, the corresponding summit of depression triangle that the deletion area is minimum.The process on reference area and deletion summit occurs up to the triangle that do not cave in above repeating, and perhaps all leg-of-mutton areas that cave in are all greater than till the given threshold value.Area threshold δ a tries to achieve through formula (3):
δa=a
avg/λ (3)
Suppose that two polygons of tape merge are positioned at the l layer of tree, a
AvgBe the mean value of all area of a polygon of this layer.λ is the weight of user's appointment, and λ is set to 50.After having removed tiny concave polygon, the result after simplifying is further traveled through, this time the purpose of traversal is to be reduced to a limit to essentially identical two adjacent edges of direction.Calculate each to adjacent edge, if its angle is greater than certain angle threshold (this threshold value is set to 175 °), then these two limits can be reduced to a limit.
The present invention also meets visual law simultaneously reducing detailed information and keeping between the profile information of original building and obtained balance preferably, and promptly contiguous object is done as a whole by cognitive.Simultaneously, also avoided too much blank ground to be comprised in the newly-generated building, so city image information such as square can be able to preserve.
3) by 2.5 new dimension BUILDINGS MODELSs of comprehensive generation
For newly-generated polygon, the roof height of the BUILDINGS MODELS that it is corresponding equals to add the original two BUILDINGS MODELSs average height separately behind the weight coefficient, shown in formula (4):
In formula (4), h is the height after merging, h
iBe the height of child node, a
iBe the projected area of child node building on two dimensional surface xoy.
For the crossing situation in the class, then, two polygons are merged through asking the calculation intersection point, remove initiate intersection point then, adopt the Visvalingam-Whyatt algorithm synthesis again, high computational is the same.For the situation that comprises in the class, directly to get the bigger polygon of area and go up final amalgamation result as two dimensional surface xoy, height recomputates according to formula (4) and gets final product.
Step 3: make up the multiresolution urban architecture model
After pretreatment stage is accomplished, adopt the model after the tree structure storage is simplified.Because there is not the introducing on new summit, apex coordinate stores separately, each node of tree structure, and the numbering of only storing its corresponding vertex, rather than the storage node coordinate is as shown in Figure 3.Can avoid same summit to be repeated storage like this, can reduce storage space.In addition, each node also needs information such as storing highly, area.
The strand clustering procedure can be so that road be able to preserve after cluster with other boundary informations.But the strand clustering procedure only merges two buildings at every turn.The clustering tree level of so final generation is dark excessively, if will contain n the final cluster of data set of building for having only a node, the clustering tree that then generates will have the n layer.To take more storage space like this.For n initial node, be lg (n) by its degree of depth that generates the binary tree of complete equipilibrium.If with the degree of depth of tree be reduced to n ' (n ' can be provided as lg (n) or lg (n)/λ), can pass through n '-1 threshold value, the degree of depth of setting is compressed to n '.
In the process of cluster, when running to certain step,, then produce a threshold value herein if the used adjacency d of this step cluster is far longer than the adjacency in several steps.Based on such thought, when cluster, note used adjacency of each step; And be stored in the array; This array is referred to as distance sequence, according to the character of strand clustering procedure, in distance sequence; D is tactic by from small to large, the rate of growth r of adjacency
iFor
r
i=(d
i+1-d
i)/d
i (5)
D wherein
iAnd d
I+12 adjacent adjacencies among the expression distance sequence.
Because hope the number of plies of tree is reduced to n ', so need n '-1 threshold value.So choose maximum n '-1 r,, generate a threshold value D for each r.By r
iWhen generating D, be worth desirable (d
I+1+ d
i)/2, perhaps any one greater than d
iAnd d
I+1Value.Then with this n '-1 threshold value according to from small to large sequential storage in array threshold sequence, as shown in Figure 4, to be used for that the number of plies of tree is reduced to n '.
But the tree that generates like this is not a balance, promptly some node have a too much child node, promptly a lot of buildings can be in viewpoint when far away, unexpected quilt is merged into building.In order to avoid the generation of this situation as far as possible, the maximum child node that each node can have is set counts δ p.For the bearing-age tree of n ' the layer complete equipilibrium that has n building to generate, for each non-leaf node, the child node number that it has is p:
Therefore, δ p can be arranged to a value greater than p, like 2p.For certain one deck of tree, if this layer has m node, the always total m of these nodes
ChIndividual child node, m so
ChShould be less than or equal to m * δ p.According to this condition, inspection is by the node of each layer of the tree of threshold sequence compression generation and the number of its child node.When by D
lWhen the compression several layers becomes one new layer, the m if this layer does not satisfy condition
Ch≤m * δ p then means D
lAnd D
L-1Span too big, to such an extent as to a lot of building is merged into a building suddenly.So in threshold value, D
L-1And D
lBetween insert a new threshold value D
NewD
NewGenerative process following: at first, in distance sequence, extract and be positioned at interval [D
L-1, D
l] an interior cross-talk array, maximum r place produces new threshold value D in this subnumber group then
NewUse D
NewProduce new layer, check this new layer of m that whether satisfies condition
Ch≤m * δ p.If do not satisfy, then use interval [D
L-1, D
New] in distance sequence, extract new subnumber group, upgrade D with producing new threshold value
NewOld value.Repeat said process, up to by D
NewThe new layer of m that satisfies condition that produces
Ch≤m * δ p is then with D
NewBe inserted into D
L-1And D
lBetween.
Step 4: Interactive Visualization
Set up the BUILDINGS MODELS of detail, higher along with moving of viewpoint from the level of detail of the near BUILDINGS MODELS of viewpoint distance, and the model rendering of the available lower level of building at a distance.Be that standard is different with the distance in the classic method, the present invention is the standard that level of detail is divided to merge the projected size of error on screen that produces.The distance of model apart from viewpoint not only considered in the division of this standard, also considered the size of the error of model own.
In visualization process, the error that human eye can obviously be experienced mainly can be divided into two types, and one type relevant with highly, though the child node height is different, after merging, its father node has only an elevation information; Another kind of relevant with area, in the BUILDINGS MODELS merging process, originally blank zone can be included in the polygon after the merging between the building, causes on the two-dimensional level face, and the area of father node is greater than the area of its child node.After generating three-dimensional model, the building roof area also can correspondingly increase.
These two types of errors all need be considered.But the roaming mode is not simultaneously, and the influence to visual effect of these two types of errors is different.When the building internetwork roaming; The basic along continuous straight runs of sight line, this moment, building was at a distance often blocked by building nearby, so the long-pending variation of building surface at a distance is difficult for coming to light; And person walks is between building; Perception to the building roof is positioned at backseat, but the height change of building can indicate the height of buildings especially at a distance by strong by perception.So should stress to consider height error this moment.When the roaming mode changed top-down looking down into, the profile on building roof was the information of primary significance that human eye gets access to, and elevation information is positioned at backseat.So should mainly consider the distortion of roof contour this moment.
To with non-leaf node, circulation is asked for it and is comprised the high building height H in the child node
Max, and the height H of minimum building
MinStep is following:
If leaf node is positioned at the n layer, then ask in the n-1 layer H of each node earlier
MaxAnd H
Min, and then ask and calculate the n-2 layer, in all child nodes of each node, maximum H
MaxH as this node
Max, minimum H
MinH as this node
MinRepeat this process, up to having calculated till the 0th layer.Definition discrepancy in elevation Δ H=H
Max-H
Min, represent the discrepancy in elevation between the high building and minimum building in the pairing primitive architecture of each node.Obviously, for leaf node, Δ H=0.The roof area of definition father node deducts its pairing primitive architecture crowd's roof area sum, as newly-increased roof area Δ A.The process of resolving also is to adopt bottom-up circulation, confirms two threshold value δ thus
H, δ
A, its meaning does, and the corresponding original groups of building of child node project on the screen, and its high building and minimum building height difference should be less than δ
HIndividual pixels tall, newly-increased roof area project to should be less than δ on the screen
AIndividual pixel.
Adopt the difference in height of high building and minimum building height under the following method approximate expression screen coordinate system.If the vertical field of view angle FOV of video camera, and nearly cutting identity distance is from being D
Near, then can try to achieve nearly cutting face height H
Near
H
near=D
near×tan(FOV)×2 (7)
The viewport height is H
ViewIndividual pixel, n on the corresponding screen of unit length on the then near cutting face
ScaleIndividual pixel, n
Scale=H
View/ H
NearProject on the nearly cutting face discrepancy in elevation Δ H is approximate, for each node, the distance of establishing this node center and video camera is D
Node, considering has the angle theta of sight line and surface level,
ΔH′=ΔH×(D
near/D
node)×cos(θ)
ΔH
view=ΔH′×n
scale (8)
Δ H
ViewBe the pixel count of discrepancy in elevation Δ H correspondence on screen.Same, for Δ A, be similar to earlier and try to achieve its projection on nearly cutting face, try to achieve its projected size Δ A on screen again
View
ΔA′=ΔA×(D
near/D
node)
2×sin(θ)
ΔA
view=ΔA′×n
scale (9)
In the process of scene walkthrough, the angle of direction of visual lines and video camera are apart from the position real-time change of node.Calculate Δ Hview and Δ Aview in real time, if Δ Hview<δ H, and Δ Aview<δ A, then play up this node; Otherwise this node is not played up, and recurrence is judged its child node.
3, advantage and effect: (1) the present invention combines city image and Gestalt psychology theory; Standard when a kind of new distance metric mode is provided as the building cluster; BUILDINGS MODELS is merged the factor to be improved; Make it more meet human cognitive law; And the extensive building of the method that combines the Delaunay triangulation after to cluster comprehensively simplify, and makes amalgamation result reducing detailed information and approaching and obtain balance preferably between these two targets of original building profile, improved large-scale city architectural rendering and visual efficient.(2) method provided by the invention met in the Gestalt psychology theory approaching, similar, wait principle in the same way, kept key elements such as urban road, border, significant city image simultaneously.
Five, embodiment
The present invention relates to a kind of large scene urban architecture real-time three-dimensional visualization method based on spatial cognition, the concrete steps of this method are following:
Step 1: utilize Gestalt psychology and city image theory to carry out the BUILDINGS MODELS cluster
Theoretical according to Gestalt psychology, figure is done as a whole by consciousness, and has certain correlativity between the each several part.People's vision is merged into an integral body according to certain organization rule with each several part, and these combination rules comprise proximity, similarity, good continuity and closure etc.
In building is comprehensive, in order to obtain to meet the result of cognitive law, also need analyzes distance relation, position relation and similarity and continuity etc. between building, and confirm Merge Scenarios according to analysis result.The key of building merge algorithm also is how to obtain its morphological feature and spatial relationship each other.On the other hand, when building merges, not only to consider the relation of adjacent building, also will consider the vision shape characteristic on the yardstick of city simultaneously.City image is meant the image of the high level overview of in people's brains outside urban environment being summarized, and it comprises five dvielements: road, border, zone, node and sign.Road is the subject element of city image perception; The border is meant except unexpected other boundary line of road, like the river etc.; The zone is meant the difference in functionality district in city, like central business district etc.; Node can be a tie point, like the road node, also can be the centrostigma of some characteristic, like square etc.; The characteristics of sign are to have uniqueness and significant in a certain respect.The simplification of urban architecture should keep this five dvielement as far as possible, makes that the building after simplifying meets the image of people to the city, helps people's effective identification spatial information, remains on the direction feeling when browsing.In this five dvielement, road be most important also be should be preferentially maintained.The present invention has combined city image theory and Gestalt psychology when building is comprehensively with simplification on a large scale, effectively kept road information, also takes into account zone and node information simultaneously to a certain extent.
Cluster has two effects, at first is the distribution pattern of identification building target, and the essential characteristic that building will keep and give prominence in simplifying is the characteristic of groups of building; Next is in order to raise the efficiency, and each type is considered to independently, merges and simplifies and will in class, carry out, and the data of other type need not to participate in calculating, and computing velocity is improved.Therefore cluster is one step of key of building shortcut calculation on a large scale.
The present invention adopts Monotone Chain hierarchical clustering method to guarantee that city image key elements such as road are able to preserve after cluster, with adjacency N as the cluster criterion, with the spatial relationship of better reflection buildings on two dimensional surface.
For the convenience of narrating, at first provide one group of definition.
Point arrives the distance on limit (line segment): for a v and straight-line segment s, cross a some v, do the vertical line of s.If intersection point v
tDrop on the line segment s, then v and v
tDistance be the distance (be referred to as vertical range) of a v to line segment s; Otherwise, get the minimum value of a v in the l two-end-point distance as the distance of a v to s.(being referred to as end-point distances).
Put polygonal distance: the bee-line of putting each limit of polygon.
Bee-line between the polygon: do not have polygon p crossing and relation of inclusion for two
1And p
2,
● calculate p
1All summits to p
2Minimum value in the distance is designated as d
1
● same, ask and calculate p
2All summits are to p
1Bee-line d
2
● get d
1, d
2In smaller value as polygon p
1And p
2Between bee-line d
Min, i.e. d
Min=min (d
1, d
1);
Two polygonal adjacent edge:
● ask the bee-line of calculating between two polygons, and in asking the calculation process, record d
MinCorresponding summit and limit and classification (being vertical range or end-point distances);
● if d
MinBe vertical range, suppose d
MinPairing polygon vertex is v
i, corresponding limit does
Ask v respectively
iThe limit at place
With
Angle (just ask the angle of calculating place, both sides straight line, span is between 0 to 90 degree).
In, with
The angle smaller is designated as s
1, the limit
Be designated as s
2, s
1, s
2Be called as one group of adjacent edge.
● if d
MinBe end-point distances, i.e. a polygonal vertex v
iWith another polygonal vertex v
iAt a distance of recently, then show adjacent edge will
The middle generation.Ask
and the angle of
; And
angle with
, two minimum limit of angle is adjacent edge.
Adjacency between the polygon: calculate s
1, s
2Length be respectively l
1And l
2, with s
2Project to s
1On, trying to achieve its projected length is l
1'; In like manner, s
1At s
2On projected length be respectively l
1' and l
2', polygon P then
1And P
2Between adjacency d
NearCan be expressed as:
d
near=d
min×(1-N×λ) (1)
N=(l
1′/l
1+l
2′/l
2)/2 (2)
Here, N is used for representing the position relation of adjacent edge, works as s
1And s
2When parallel and relative fully, l
1'=l
1, l
2'=l
2, N=1, λ are as weight factor, and value is between 0 to 1., d definite at λ
MinUnder the identical situation, N is big more, d
NearMore little, should preferentially be gathered is one type.Adopt adjacency, not only can reflect the distance relation between the buildings, also reflected the relative direction relation of relative orientation relation and adjacent edge to a certain extent, λ is used for confirming apart from N at d
NearIn the ratio that accounts for, λ is big more, it is big more that N accounts for weight, just means that also the position relation of adjacent edge should be paid the utmost attention to; λ is more little, and it is more little that N accounts for weight, and promptly minor increment d plays a leading role between polygon.The λ value is comparatively desirable at 0.6 o'clock.
In order to calculate polygon p
iAnd p
jBetween adjacency, asking for of adjacent edge is crucial.In order to raise the efficiency, at first foundation comprises this two convex closures that polygon is new.Adopt the Graham-Scan algorithm when convex closure is set up, its time complexity is O (nlog n).Through convex closure, can reduce and to carry out the number of vertex that distance is asked calculation.
If the convex closure of finally trying to achieve is made up of two polygonal summits, the limit of convex closure can be divided into two types: one type of connection be same polygonal summit, two another kind of end points belong to two polygons, such limit is known as the border.Convex closure comprises two borders, and four summits on these two borders are with p
iAnd p
jThe summit be divided into two groups, one group of calculating of participating in adjacent edge, another group then can not participated in the calculating of adjacent edge.Shown in the figure on Fig. 2 left side,
and
is one group of border.v
1-1And v
1-6With p
1The summit be divided into two groups.First group comprises vertex v
1-1, v
1-2..., v
1-5And v
1-6, these summits are apart from p
2Nearer, should participate in calculating; And another group vertex v
1-7And v
1-8Then away from p
2, when calculating, can not consider.Same p
2Vertex v
2-2And v
2-3Also can not participate in calculating.So there is p on the summit of participating at last calculating
1V
1-1, v
1-2..., v
1-5And v
1-6, and p
2V
2-4, v
2-5..., v
2-8, v
2-1, final calculating is p
1The limit
And p
2The limit
It is one group of adjacent edge
If the convex closure of finally trying to achieve is made up of a polygonal summit fully, show that this polygonal convex closure has comprised another polygon.Shown in the figure on Fig. 2 the right, p
2Be positioned at polygon p fully
1Convex closure in, so big that polygonal convex closure will surround one or more slits with this polygon, and little polygon must be positioned at a slit.The calculating of adjacent edge is participated on the point and the little polygonal summit that form this slit.In the figure of Fig. 2 the right, vertex v is arranged
1-7, v
1-8, v
1-9, v
1-10Slit that surrounds and vertex v
1-5, v
1-1, v
1-6The another one slit that surrounds.Through judging p
2Be positioned at { v
1-7, v
1-8, v
1-9, v
1-10In, so find the solution adjacent edge, only need use p
2Summit and p
1Vertex v
1-7, v
1-8, v
1-9, v
1-10
Step 2: the merging of BUILDINGS MODELS is with comprehensive between cluster
(1) merging of building on the two-dimensional projection plane between the class
After cluster, the polygon in every type is merged into a polygon, the polygon after being combined carries out comprehensively.When two polygons were merged into a new polygon, inevitable white space was included in the newly-generated polygon.At merging phase, utilize the summit of participating in adjacent edge again, generate the Delaunay triangulation network of belt restraining condition, then, definition connects triangle to (T
1, T
2), a diabolo (T
1, T
2) being known as that to connect triangle right, and if only if this triangle is to satisfying following three conditions:
● T1 and T2 share a limit, and this limit connects p
1And p
2
● another of T1 limit s
1Connect p
1Two summits;
● another of T2 limit s
2Connect p
2Two summits.
For one right in abutting connection with triangle, its limit s
1And s
2Adjacency be d by note
PairrEach triangle of adjacent triangle centering all has a limit connecting to belong to same leg-of-mutton two summits.For this limit, two situation are arranged: a kind of situation is that these two summits are adjacent, and promptly this edge overlaps with former polygonal limit, otherwise then is second kind of situation.If two triangles all satisfy first kind of situation, it is right then to be referred to as strict adjacent triangle, otherwise it is right to be referred to as non-strict adjacent triangle.If have one or more strictnesses right between two polygons to be combined, then calculate the right d of these triangles in abutting connection with triangle
Pairr, with having minimum d
PairrStrictness connect two polygons to be combined to produce new polygon in abutting connection with triangle to being used for.If do not have strict adjacent triangle right between two polygons, then choose and have minimum d
PairNon-strict contiguous triangle to connecting polygon.
(2) two-dimensional projection plane amalgamation result is comprehensive
The polygon that is formed by connecting through above-mentioned way has comprised too much detailed information, and it is further comprehensive to be combined the result.Adopt the Visvalingam-Whyatt polyline reduction algorithm, remove tiny sunk part.For narrating conveniently, define one type of triangle and be the depression triangle: according to counterclockwise direction, vertex v on the polygon
iWith its former and later two vertex v
I-1, v
I+1, form triangle { v
I-1, v
i, v
I+1, if along from v
I-1Through v
iAnd v
I+1Come back to v
I-1Direction be CW, then this triangle is defined as the depression triangle.Summit to two polygon portion other than connected portion travels through judgement successively, and the set of vertices triangularity that each point is adjacent with its front and back judges whether this triangle is the depression triangle.If, then write down its area, after traversal finishes, the corresponding summit of depression triangle that the deletion area is minimum.The process on reference area and deletion summit occurs up to the triangle that do not cave in above repeating, and perhaps all leg-of-mutton areas that cave in are all greater than till the given threshold value.Area threshold δ a tries to achieve through formula (3):
δa=a
avg/λ (3)
Suppose that two polygons of tape merge are positioned at the l layer of tree, a
AvgBe the mean value of all area of a polygon of this layer.λ is the weight of user's appointment, and λ is set to 50.After having removed tiny concave polygon, the result after simplifying is further traveled through, this time the purpose of traversal is to be reduced to a limit to essentially identical two adjacent edges of direction.Calculate each to adjacent edge, if its angle is greater than certain angle threshold (this threshold value is set to 175 °), then these two limits can be reduced to a limit.
The present invention also meets visual law simultaneously reducing detailed information and keeping between the profile information of original building and obtained balance preferably, and promptly contiguous object is done as a whole by cognitive.Simultaneously, also avoided too much blank ground to be comprised in the newly-generated building, so city image information such as square can be able to preserve.
3) by 2.5 new dimension BUILDINGS MODELSs of comprehensive generation
For newly-generated polygon, the roof height of the BUILDINGS MODELS that it is corresponding equals to add the original two BUILDINGS MODELSs average height separately behind the weight coefficient, shown in formula (4):
In formula (4), h is the height after merging, h
iBe the height of child node, a
iBe the projected area of child node building on two dimensional surface xoy.
For the crossing situation in the class, then, two polygons are merged through asking the calculation intersection point, remove initiate intersection point then, adopt the Visvalingam-Whyatt algorithm synthesis again, high computational is the same.For the situation that comprises in the class, directly to get the bigger polygon of area and go up final amalgamation result as two dimensional surface xoy, height recomputates according to formula (4) and gets final product.
Step 3: make up the multiresolution urban architecture model
After pretreatment stage is accomplished, adopt the model after the tree structure storage is simplified.Because there is not the introducing on new summit, apex coordinate stores separately, each node of tree structure, and the numbering of only storing its corresponding vertex, and the storage node coordinate is not as shown in Figure 3.Can avoid same summit to be repeated storage like this, can reduce storage space.In addition, each node also needs information such as storing highly, area.
The strand clustering procedure can be so that road be able to preserve after cluster with other boundary informations.But the strand clustering procedure only merges two buildings at every turn.The clustering tree level of so final generation is dark excessively, if will contain n the final cluster of data set of building for having only a node, the clustering tree that then generates will have the n layer.To take more storage space like this.For n initial node, be lg (n) by its degree of depth that generates the binary tree of complete equipilibrium.If with the degree of depth of tree be reduced to n ' (n ' can be provided as lg (n) or lg (n)/λ), can pass through n '-1 threshold value, the degree of depth of setting is compressed to n '.
In the process of cluster, when running to certain step,, then produce a threshold value herein if the used adjacency d of this step cluster is far longer than the adjacency in several steps.Based on such thought, when cluster, note used adjacency of each step; And be stored in the array; This array is referred to as distance sequence, according to the character of strand clustering procedure, in distance sequence; D is tactic by from small to large, the rate of growth r of adjacency
iFor
r
i=(d
i1-d
i)/d
i (5)
D wherein
iAnd d
I+12 adjacent adjacencies among the expression distance sequence.
Because hope the number of plies of tree is reduced to n ', so need n '-1 threshold value.So choose maximum n '-1 r,, generate a threshold value D for each r.By r
iWhen generating D, be worth desirable (d
I+1+ d
i)/2, perhaps any one greater than d
iAnd d
I+1Value.Then with this n '-1 threshold value according to from small to large sequential storage in array threshold sequence, as shown in Figure 4, to be used for that the number of plies of tree is reduced to n '.
But the tree that generates like this is not a balance, promptly some node have a too much child node, promptly a lot of buildings can be in viewpoint when far away, unexpected quilt is merged into building.In order to avoid the generation of this situation as far as possible, the maximum child node that each node can have is set counts δ p.For the bearing-age tree of n ' the layer complete equipilibrium that has n building to generate, for each non-leaf node, the child node number that it has is p:
Therefore, δ p can be arranged to a value greater than p, like 2p.For certain one deck of tree, if this layer has m node, the always total m of these nodes
ChIndividual child node, m so
ChShould be less than or equal to m * δ p.According to this condition, inspection is by the node of each layer of the tree of threshold sequence compression generation and the number of its child node.When by D
lWhen the compression several layers becomes one new layer, the m if this layer does not satisfy condition
Ch≤m * δ p then means D
lAnd D
L-1Span too big, to such an extent as to a lot of building is merged into a building suddenly.So in threshold value, D
L-1And D
lBetween insert a new threshold value D
NewD
NewGenerative process following: at first, in distance sequence, extract and be positioned at interval [D
L-1, D
l] an interior cross-talk array, maximum r place produces new threshold value D in this subnumber group then
NewUse D
NewProduce new layer, check this new layer of m that whether satisfies condition
Ch≤m * δ p.If do not satisfy, then use interval [D
L-1, D
New] in distance sequence, extract new subnumber group, upgrade D with producing new threshold value
NewOld value.Repeat said process, up to by D
NewThe new layer of m that satisfies condition that produces
Ch≤m * δ p is then with D
NewBe inserted into D
L-1And D
lBetween.
Step 4: Interactive Visualization
Set up the BUILDINGS MODELS of detail, higher along with moving of viewpoint from the level of detail of the near BUILDINGS MODELS of viewpoint distance, and the model rendering of the available lower level of building at a distance.Be that standard is different with the distance in the classic method, the present invention is the standard that level of detail is divided to merge the projected size of error on screen that produces.The distance of model apart from viewpoint not only considered in the division of this standard, also considered the size of the error of model own.
In visualization process, the error that human eye can obviously be experienced mainly can be divided into two types, and one type relevant with highly, though the child node height is different, after merging, its father node has only an elevation information; Another kind of relevant with area, in the BUILDINGS MODELS merging process, originally blank zone can be included in the polygon after the merging between the building, causes on the two-dimensional level face, and the area of father node is greater than the area of its child node.After generating three-dimensional model, the building roof area also can correspondingly increase.
These two types of errors all need be considered.But the roaming mode is not simultaneously, and the influence to visual effect of these two types of errors is different.When the building internetwork roaming; The basic along continuous straight runs of sight line, this moment, building was at a distance often blocked by building nearby, so the long-pending variation of building surface at a distance is difficult for coming to light; And person walks is between building; Perception to the building roof is positioned at backseat, but the height change of building can indicate the height of buildings especially at a distance by strong by perception.So should stress to consider height error this moment.When the roaming mode changed top-down looking down into, the profile on building roof was the information of primary significance that human eye gets access to, and elevation information is positioned at backseat.So should mainly consider the distortion of roof contour this moment.
To with non-leaf node, circulation is asked for it and is comprised the high building height H in the child node
Max, and the height H of minimum building
MinStep is following:
If leaf node is positioned at the n layer, then ask in the n-1 layer H of each node earlier
MaxAnd H
Min, and then ask and calculate the n-2 layer, in all child nodes of each node, maximum H
MaxH as this node
Max, minimum H
MinH as this node
MinRepeat this process, up to having calculated till the 0th layer.Definition discrepancy in elevation Δ H=H
Max-H
Min, represent the discrepancy in elevation between the high building and minimum building in the pairing primitive architecture of each node.Obviously, for leaf node, Δ H=0.The roof area of definition father node deducts its pairing primitive architecture crowd's roof area sum, as newly-increased roof area Δ A.The process of resolving also is to adopt bottom-up circulation, confirms two threshold value δ thus
H, δ
A, its meaning does, and the corresponding original groups of building of child node project on the screen, and its high building and minimum building height difference should be less than δ
HIndividual pixels tall, newly-increased roof area project to should be less than δ on the screen
AIndividual pixel.
Adopt the difference in height of high building and minimum building height under the following method approximate expression screen coordinate system.If the vertical field of view angle FOV of video camera, and nearly cutting identity distance is from being D
Near, then can try to achieve nearly cutting face height H
Near
H
near=D
near×tan(FOV)×2 (7)
The viewport height is H
ViewIndividual pixel, n on the corresponding screen of unit length on the then near cutting face
ScaleIndividual pixel, n
Scale=H
View/ H
NearProject on the nearly cutting face discrepancy in elevation Δ H is approximate, for each node, the distance of establishing this node center and video camera is D
Node, considering has the angle theta of sight line and surface level,
ΔH′=ΔH×(D
near/D
node)×cos(θ)
ΔH
view=ΔH′×n
scale (8)
Δ H
ViewBe the pixel count of discrepancy in elevation Δ H correspondence on screen.Same, for Δ A, be similar to earlier and try to achieve its projection on nearly cutting face, try to achieve its projected size Δ A on screen again
View
ΔA′=ΔA×(D
near/D
node)
2×sin(θ)
ΔA
view=ΔA′×n
scale (9)
In the process of scene walkthrough, the angle of direction of visual lines and video camera are apart from the position real-time change of node.Calculate Δ Hview and Δ Aview in real time, if Δ Hview<δ H, and Δ Aview<δ A, then play up this node; Otherwise this node is not played up, and recurrence is judged its child node.
Embodiment 1:
Dispose 3.00GHz Intel (R) Pentium (R) 4CPU at one, the 2GB internal memory is implemented on the computing machine of ATI mobility radeon X300 video card.
At first contrasted the cluster result that adopts adjacency and Euclidean distance.Fig. 5 (a) is the original building polygon, and it contains 37 buildings, and the degree of depth of the hierachy number after hoping to compress is int (lg (37)/1.5); Cluster result when Fig. 5 (b), (c), (d) are clustering criteria for adopting adjacency, and the merging degree increases successively gradually; Fig. 5 (e), (f), (g) adopt Euclidean distance as the simplification result apart from the factor.Can find out that through contrast the present invention adopts adjacency, better, better keep road information simultaneously with respect to trend and the similarity between building of groups of building.
To the efficient that building is simplified, the present invention and document " Chang, R., Butkiewicz; T., Ziemkiewicz, C., Wartell; z., Ribarsky, W.and Pollard, N.; 2008.Legible Simplification of Textured Urban Models, IEEEComputer Graphics and Applications, 28 (3), 27-36. " contrast.The algorithm complex of the document is O (n under the worst situation
3), it is O (n that the present invention asks the time complexity of calculating the Delaunay triangulation
2), adopt the convex closure algorithm that it is reduced to O (m
2), same, the time complexity that adjacency is asked for also is O (m
2).M be two adjacent triangles do not have disallowablely, participate in the number of vertex of Delaunay triangulation, and the algorithm time complexity of convex closure is O (nlogn).The complexity of polyline of the present invention is O (n log n).Therefore, in the whole process, time complexity of the present invention will be lower than O (n
2).Fig. 6 has shown the relation between the number of vertex on simplification time and BUILDINGS MODELS number and the 2 d plane picture; Dotted portion is the quafric curve that is simulated by experimental data among the figure; It is thus clear that along with the increase of data volume, the simplification time approximately increases with the speed of quadratic power.
Merging integrated approach of the present invention also compares with people's such as Article document Chang method.The document adopts the method for convex closure evolution, at first generates polygonal convex closure to be combined, and the limit to convex closure splits then, up to the limit of convex closure number count greater than two child node limits summation 75% till.Because the shape of building often differs greatly, split when finishing, most detailed information is deleted in possible some type, and most detailed information still is retained in other types, so cause the degree of integration meeting of different cluster results different.Compare; The present invention is to the node that is positioned at same layer when comprehensive; Adopt the area identical threshold value,, make amalgamation result reduce detailed information and approach between these two targets of original building profile and obtain balance preferably so can guarantee with the degree of integration of the node of one deck approximately basically.
For further proving advantage of the present invention, build data as check with the part of Haidian District Beijing.These data comprise 35,138 buildings, totally 913,603 building projection summits.The degree of depth of hierarchical tree is compressed to int (lg1809)/1.5), promptly 9 layers.When visual, discrepancy in elevation threshold value δ
HBe set at 20 pixels, newly-increased roof area threshold value δ
ABe set at 200 pixels, its display effect is as shown in Figure 7.The present invention has reduced the level of detail of building at a distance, has effectively reduced to play up consuming timely, has kept city images such as groups of building, road, sign atural object preferably simultaneously, between rendering efficiency and rendering effect, has kept balance preferably.