Detailed description of the invention
Embodiments provide a kind of three-dimensional navigation display method and relevant apparatus, for peripheral information and the condition of road surface of intuitive and accurate display user position, it is achieved three-dimensional navigation。
Referring to Fig. 1, in the embodiment of the present invention, an embodiment of three-dimensional navigation display method includes:
101, the current location of positioning navigation terminal;
The current location of three-dimensional navigation display device positioning navigation terminal。
The function of this location is completed by positioning unit, and this positioning unit can be that global positioning system (GPS, GlobalPositioningSystem) receives device, it is also possible to is other radio positioner, is specifically not construed as limiting herein。
This current location is the positional information of navigation terminal region on two-dimensional map, it is possible to for accurate latitude and longitude information。
102, three-dimensional information is extracted;
Three-dimensional navigation display device extracts the three-dimensional information that the building in region, current location is corresponding, this three-dimensional information is each summit of building coordinate figure in X-axis, Y-axis, three directions of Z axis in three-dimensional system of coordinate, and X-axis, Y-axis, three directions of Z axis are as shown in Figure 2。
The scope of region, current location is based on user-selected map degree of accuracy and fixed, as: if this map degree of accuracy is 1: 10000 (100 meters of 1 centimetre of expression actual range on map), and the length and width of display screen are all 1 decimeter, then the ranging for of region, current location: 1000 × 1000 square metres。
This building may include that building, viaduct, mountain region, large-scale vegetation and various large-scale marks etc.。
Three-dimensional navigation display device has prestored the three-dimensional information of owned building in navigation area, owing to stored three-dimensional information is coordinate points information, image information relative to prior art storage, the memory headroom taken is relatively small, therefore, substantial amounts of building information can be stored, record the road conditions of periphery in detail, in order to provide a user with more real three-dimensional traffic information。
103, three-dimensional map visual angle is obtained;
Three-dimensional navigation display device obtains three-dimensional map visual angle。
This three-dimensional map visual angle is the viewpoint and direction of visual lines observed, the shape of display screen display 3-D view is determined by viewpoint and direction of visual lines, three-dimensional information accessed by above-mentioned steps 102 is each summit of building coordinate points information of world coordinate system on actual ground, the coordinate points image of these world coordinate systems needs to show on the display screen, must flow through the conversion being tied to eye coordinate from world coordinates, this conversion is coordinate points to be carried out translating according to viewpoint and direction of visual lines, rotate, the process of convergent-divergent and projection。
The process of above-mentioned translation, rotation, convergent-divergent and projection specifically can be divided into four steps:
Geometric transformation, i.e. translation, rotation and transformation of scale;
Projective transformation, namely becomes, three-dimensional body, the process that X-Y scheme represents;
Cutting converts, including the reduction of the reduction of three-dimensional vision body and additional plane;The reduction of what comes into a driver's body may be embodied in projective transformation, six reduction plane (left and right, upper and lower, distal and proximal) except the definition of what comes into a driver's body, user can also define one or more additional reduction plane so that user can delete body unnecessary in scene;
The viewport transform, by through being shown in the formulation region of screen window with the object of up conversion。
104, the visualization computing of building;
The three-dimensional information of building is carried out perspective transform according to three-dimensional map visual angle by three-dimensional navigation display device, obtains the information of each apex coordinate of building after perspective transform;Judge that in viewing area, whether each building is visible according to the vertex point coordinate information after this conversion, add up all visible buildings;Analyze each visible surface of this visible building, obtain the apex coordinate of each visible surface after perspective transform。
Perspective transform refers to the condition utilizing the centre of perspectivity, picture point, impact point three point on a straight line, image-bearing surface (perspective plane) is made to rotate a certain angle around trace (axis of homology) by chasles theorem, destroy original projected light wire harness, remain to keep the conversion that on image-bearing surface, projection geometric figure is constant。
105, drawing three-dimensional map。
The three-dimensional navigation display device apex coordinate drawing three-dimensional map according to this each visible surface。
Three-dimensional navigation display device obtains the apex coordinate of each visible surface, according to this apex coordinate structure stereomodel of building in viewing area in corresponding three-dimensional map visual angle, then each building in this viewing area is painted;Wherein, the color of building can default settings in a device, it is also possible to binds together with this three-dimensional information in advance, extracts when colouring, be specifically not construed as limiting herein。Finally, adding corresponding label (this label may include that icon, road name, building name etc.) for the things in map, three-dimensional map is completed, it is possible to display to the user that this three-dimensional map。
The present invention is the three-dimensional information of owned building in locally stored navigation area in advance, and owing to stored three-dimensional information is coordinate points information, the memory headroom taken is little, it is possible to the actual traffic information that substantial amounts of storage is concrete。When carrying out three-dimensional navigation, extract the current location corresponding three-dimensional information of building, and obtain three-dimensional map visual angle, further according to three-dimensional map visual angle and three-dimensional information, this building is carried out perspective transform, calculate the apex coordinate of each visible surface in visible building, finally according to this apex coordinate drawing three-dimensional map, show thus having provided the user accurate, detailed three-dimensional map。
In the display of three-dimensional things, it is necessary to meeting the principle of " remote little near big ", so needing the building in viewing area is carried out perspective transform, particular content refers to Fig. 3, and in the embodiment of the present invention, another embodiment of three-dimensional navigation display method includes:
301, the current location of positioning navigation terminal;
The content of the step 301 in the present embodiment is identical with the content of step 101 in the embodiment shown in earlier figures 1, repeats no more herein。
302, three-dimensional information is extracted;
The three-dimensional information that in three-dimensional navigation display device extraction local data base, the building in region, current location is corresponding。This three-dimensional information is each summit of building coordinate figure in X-axis, Y-axis, three directions of Z axis in three-dimensional system of coordinate。
In existing online edition navigation system when carrying out three-dimensional navigation, after located the physical location of navigation terminal, navigation terminal requires over network wizards boat server and sends the positional information of navigation terminal, this positional information is carried out computing match query by the resource utilizing server, after obtaining corresponding three-dimensional image information, three-dimensional image information is sent back navigation terminal by server again, although this three-dimensional navigation method also can be detailed, the three-dimensional traffic information of real reflection, but owing to mobile network not yet popularizes comprehensively, the signal intensity in many places (especially mountain area) is all not as, and automobile transmitting-receiving speed of signal data in movement all can be affected (as when running in the guide in tunnel), so not can guarantee that the smoothness of real-time navigation。
In the embodiment of the present invention, three-dimensional navigation display device is the improvement to city edition navigation system, therefore the method optimizing information storage so that under limited memory space, it is possible to store more three-dimensional information。
In the embodiment of the present invention, three-dimensional navigation display device uses efficient spatial data file to store three-dimensional information, this efficient spatial data file is a kind of flexible and efficient data structure, it is possible to be divided into four parts: file header, statistical information, spatial index and solid data。
" efficiently " of this file structure is embodied in this part of spatial index, the design Storage of spatial index take into account the service condition in internal memory, after digital independent to internal memory, have only to the skew of data is converted to structured fingers, data both can load, it is different from the load mode that tradition is read out according to texture field, improves the loading performance of data, and can effectively reduce memory fragmentation。
Owing to this storage method optimizes spatial index, enabling while extracting more related building information, also improve the speed that data are extracted。
303, three-dimensional map visual angle is obtained;
Three-dimensional navigation display device obtains three-dimensional map visual angle。
This three-dimensional map visual angle is the viewpoint and direction of visual lines observed, the shape of display screen display 3-D view is determined by viewpoint and direction of visual lines, above-mentioned accessed three-dimensional information is each summit of building coordinate points information of world coordinate system on actual ground, the coordinate points image of these world coordinate systems needs to show on the display screen, must flow through the conversion being tied to eye coordinate from world coordinates, this conversion is coordinate points to be carried out translating according to viewpoint and direction of visual lines, rotate, the process of convergent-divergent and projection。
The process of above-mentioned translation, rotation, convergent-divergent and projection specifically can be divided into four steps:
Geometric transformation, i.e. translation, rotation and transformation of scale;
Projective transformation, namely becomes, three-dimensional body, the process that X-Y scheme represents;
Cutting converts, including the reduction of the reduction of three-dimensional vision body and additional plane;The reduction of what comes into a driver's body may be embodied in projective transformation, six reduction plane (left and right, upper and lower, distal and proximal) except the definition of what comes into a driver's body, user can also define one or more additional reduction plane so that user can delete body unnecessary in scene;
The viewport transform, by through being shown in the formulation region of screen window with the object of up conversion。
Can giving tacit consent to a viewpoint and direction of visual lines as three-dimensional map visual angle when initializing, can provide the user multiple visual angles option when starting to navigate, user can liking with the corresponding visual angle of demand selection as three-dimensional map visual angle according to self。Such as: mobile terminal provides two kinds of three-dimensional map visual angles, respectively visual angle 1 and visual angle 2;The viewpoint at visual angle 1 is horizontal viewpoint, and the direction of visual lines at visual angle 1 is horizontal direction, specifically as shown in Figure 4;The viewpoint at visual angle 2 is for looking down viewpoint, and the direction of visual lines at visual angle 2 is 45 degree of directions, specifically as shown in Figure 5。
Additionally, the present invention can also bind the direct of travel of navigation terminal as three-dimensional map visual angle, then viewpoint remains in the horizontal direction in front, and direction of visual lines is then consistent with navigation terminal direct of travel, changes with the change of navigation terminal direct of travel。Implement the direct of travel that can use angular-rate sensor or gravity sensor detection navigation terminal, and obtain this direct of travel direction of visual lines as three-dimensional map visual angle。
It is understood that in actual applications, what obtain that three-dimensional map visual angle can also have other realizes method, is specifically not construed as limiting herein。
304, three-dimensional information is carried out perspective transform;
Building in three-dimensional world coordinate system projects in the eye coordinate of two dimension, need the apex coordinate of inhering architecture is translated, rotate and the operation such as convergent-divergent, and these operations are exactly the transformation matrix constructing apex coordinate at the realization rate of computer, then original apex coordinate is multiplied by corresponding transformation matrix, it is possible to the apex coordinate completing building is tied to the conversion of eye coordinate from world coordinates。
The three-dimensional navigation display device big little structure three-dimension varying matrix according to three-dimensional map visual angle and display screen, particularly as follows:
Assuming length and width respectively L and the W of display screen, three-dimensional map visual angle is the horizontal view angle in front, and the rectangular coordinates of display screen is configured to: (0,0), (W, 0), (W, L), (0, L);Utilize Perspective Principles (object is then little away from the eyes of people, closely then big), the rectangular coordinates of display screen is converted to trapezoid coordinate: (0,0), (W, 0), (W+W/2, L), (-W/2, L);Utilize rectangular coordinates and the trapezoid coordinate of display screen, carry out from rectangle to trapezoidal, and from trapezoidal to the graph transformation of rectangle, try to achieve two graph transformation matrix T respectively1And T2:
Then by T1And T2It is multiplied and obtains three-dimension varying matrix TN: TN=T1*T2, three-dimension varying matrix is 4 × 4 matrix (TN=a (i, j), (1 <=i <=4,1 <=j <=4))。If selecting visual angle 1 as three-dimensional map visual angle, when solid does orthographic projection to XZ plane, launches on perspective plane, XZ plane remains stationary as, thus the coordinate of X-axis and Z axis is constant, and Z axis coordinate figure is zero, then the transformation matrix at visual angle 1 is TN1;If selecting visual angle 2 as three-dimensional map visual angle, projecting to X/Y plane, then X/Y plane rotates forward 45 degree together with the projection of gained around X-axis, makes X/Y plane and XZ planes overlapping, and reversely translates a segment distance z along Z axis and obtain the plan view of 3-D view。Now, the coordinate of X-axis and Y-axis is constant, and Y-axis coordinate figure is zero, then the transformation matrix at visual angle 2 is TN2:
After obtaining three-dimension varying matrix, the apex coordinate of each building in viewing area is multiplied by the corresponding three-dimension varying matrix of this building, obtains the information of each apex coordinate of building after perspective transform, complete the perspective transform to three-dimensional information。
305, visible building is added up;
Each apex coordinate of building after the acquisition perspective transform of three-dimensional navigation display device, and extracting the Breadth Maximum of each building, this Breadth Maximum is the difference (i.e. the leftmost apex coordinate of this building and the rightmost apex coordinate difference of coordinate figure in X-axis) of the maxima and minima of X-axis in each apex coordinate in a building;
The building of most proximal end is set in advance as (far and near according to the Distance Judgment in a direction as seen, the selection in concrete direction can be determined according to practical situation, the embodiment of the present invention is judge along Y direction, therefore the minimum building of Y-axis coordinate figure is most proximal end building), the Breadth Maximum of each building is contrasted from the near to the remote one by one along Y-axis distance, if the Breadth Maximum of far-end building is more than the Breadth Maximum of near-end building, then this far-end building of labelling is visible;If the Breadth Maximum of far-end building is less than or equal to the Breadth Maximum of near-end building, then this far-end building of labelling is invisible。
After building in three-dimensional world coordinate system projects to the eye coordinate of two dimension, each visible surface of building is expressed as a plane in eye coordinate, the difference of the maxima and minima of X-axis in each apex coordinate in one building, Breadth Maximum for this building, represent the maximum magnitude that this building covers in X-axis, this Breadth Maximum can in order to judge current building whether blocked after building。After eliminating the building being blocked, no longer the building being blocked is drawn, decrease the data processing amount of navigation terminal。
The determination methods of above-mentioned visible building is only a kind of citing, it is to be understood that in actual applications, there is also other determination methods, is specifically not construed as limiting herein。
306, the apex coordinate of visible building is calculated;
The visible surface of the visible building of three-dimensional navigation display device analysis, calculates the value of each apex coordinate in the visible surface of visible building。
Three-dimensional navigation display device by the value of some or several apex coordinate, can extrapolate the value of each apex coordinate in visible face by this building length and width and high ratio after perspective transform。
As shown in Figure 6, it is assumed that the true form of this building is a cuboid, after perspective transform, the visible surface obtaining this building according to three-dimensional map Perspective Analysis is respectively as follows: visible surface A, visible surface B and visible surface C;Visible surface A is made up of coordinate points a, b, c, d, and visible surface B is made up of coordinate points e, b, c, f, and visible surface C is made up of coordinate points f, d, c, g, coordinate points a, b, c, d, e, f, coordinate figure be respectively as follows: (X1, Y1), (X1+R1, Y1), (X1+R1, Y1+H1,), (X1, Y1+H1), (X2+R2, Y2), (X2+R2, Y2+H2), (X2, Y2+H2);
In Fig. 6, the coordinate figure of the X-axis of coordinate points c and coordinate points f is the same in original world coordinate system, but after perspective transform, project to eye coordinate is possible to different, specifically whether the same, or changed and how much determine according to three-dimensional map visual angle;Difference between each apex coordinate is also as a same reason, and the shape that in these eye coordinates, apex coordinate is constituted all meets the perspective principle of " remote little near big "。
307, drawing three-dimensional map。
Three-dimensional navigation display device obtains the apex coordinate of each visible surface, (by drawing the visible surface of each building in viewing area as far as nearly (descending according to the coordinate figure of Y-axis) first coordinate points is carried out line, then this building is painted;Wherein, the color of building can default settings in a device, it is also possible to binds together with this three-dimensional information in advance, extracts when colouring, be specifically not construed as limiting herein。), by as far as near draw occur when building can be avoided and drawing entanglement (as: the building of far-end has blocked the road of near-end, make that image occurs irrational tomography), after each building has been drawn, set display priority, the display priority that the value of Y-axis is little is more high, and the building image that display priority is high just can cover the image that display priority is low。
Finally, adding corresponding label (this label may include that icon, road name, building name etc.) for the things in map, three-dimensional map is completed, it is possible to display to the user that this three-dimensional map。
Below the embodiment of the three-dimensional navigation display device of the present invention for performing three-dimensional navigation display method being illustrated, its logical structure refer to Fig. 7, and one embodiment of the three-dimensional navigation display device in the embodiment of the present invention includes:
Positioning unit 701, for the current location of positioning navigation terminal;
Extraction unit 702, for extracting the three-dimensional information of the building in this region, current location, three-dimensional information is each summit of building coordinate figure in X-axis, Y-axis, three directions of Z axis in three-dimensional system of coordinate;
Acquiring unit 703, is used for obtaining three-dimensional map visual angle;
Visual arithmetic element 704, for the three-dimensional information of building being carried out perspective transform according to three-dimensional map visual angle, adds up visible building, the apex coordinate of each visible surface in visible building after obtaining perspective transform;
Drawing unit 705, for the apex coordinate drawing three-dimensional map according to each visible surface。
Visual arithmetic element 704 in the embodiment of the present invention can further include:
Acquisition module 7041, for obtaining each apex coordinate of building after perspective transform;
Extraction module 7042, for extracting the Breadth Maximum of each building, Breadth Maximum is the difference of the maxima and minima of each apex coordinate value X-axis in a building;
Comparison module 7043, for contrasting the Breadth Maximum of each building from the near to the remote one by one, if the Breadth Maximum of far-end building is more than the Breadth Maximum of near-end building, then this far-end building is visible;
Statistical module 7044, it is visible for being used for presetting most proximal end building, adds up each visible building。
Drawing unit 705 in the embodiment of the present invention can further include:
Drafting module 7051, for the apex coordinate according to each visible surface by as far as the nearly visible surface drawing each building;
Display module 7052, for setting the priority of visible building so that the visible surface of near-end building covers the visible surface of far-end building。
Acquiring unit 703 in the embodiment of the present invention may include that
First acquisition module 7031, is used for the visual angle obtaining navigation terminal direct of travel as three-dimensional map visual angle;
Or,
Second acquisition module 7032, is used for the ground angle of field obtaining user's selection as three-dimensional map visual angle。
In the embodiment of the present invention, the interaction of the unit of three-dimensional navigation display device is as follows:
The current location of positioning unit 701 positioning navigation terminal, this current location is the positional information of navigation terminal region on two-dimensional map, it is possible to for accurate latitude and longitude information。This positioning unit 701 can be GPS receiver device, it is also possible to is other radio positioner, is specifically not construed as limiting herein。Extraction unit 702 is according to the determined current location of positioning unit 701, the three-dimensional information that each building is corresponding is extracted in region, current location, this three-dimensional information is each summit of building coordinate figure in X-axis, Y-axis, three directions of Z axis in three-dimensional system of coordinate, and X-axis, Y-axis, three directions of Z axis are as shown in Figure 2。
Acquiring unit 703 obtains three-dimensional map visual angle, wherein it is possible to obtained the visual angle of navigation terminal direct of travel as three-dimensional map visual angle by the first acquisition module 7031, or is obtained the ground angle of field of user's selection as three-dimensional map visual angle by the second acquisition module 7032。
After obtaining three-dimensional information and three-dimensional map visual angle, the acquisition module 7041 of the visual arithmetic element 704 big little structure three-dimension varying matrix according to three-dimensional map visual angle and display screen, then the apex coordinate of each building in viewing area is multiplied by the corresponding Y-axis of this building apart from upper three-dimension varying matrix, finally obtains the result after computing;Extraction module 7042 extracts the Breadth Maximum of each building, and this Breadth Maximum is difference (i.e. the leftmost apex coordinate of this building and the rightmost apex coordinate) difference of coordinate figure in X-axis of the maxima and minima of X-axis in a building each apex coordinate interior;Comparison module 7043 contrasts the Breadth Maximum of each building from the near to the remote one by one, if the Breadth Maximum of far-end building is more than the Breadth Maximum of near-end building, then this far-end building is visible;It is visible that statistical module 7044 presets the building of most proximal end, adds up each visible building, and the apex coordinate of each visible surface in visible building after obtaining perspective transform。
The drafting module 7051 of drawing unit 705 obtains the coordinate points of each visible surface, (by drawing the visible surface of each building in viewing area as far as nearly (descending according to the coordinate figure of Y-axis) first coordinate points is carried out line, then this building is painted;Wherein, the color of building can default settings in a device, it is also possible to binds together with this three-dimensional information in advance, extracts when colouring, be specifically not construed as limiting herein);Finally, display module 7052 sets the priority of visible building so that the visible surface of near-end building covers the visible surface of far-end building。
One of ordinary skill in the art will appreciate that all or part of step realizing in above-described embodiment method can be by the hardware that program carrys out instruction relevant and completes, described program can be stored in a kind of computer-readable recording medium, storage medium mentioned above can be read only memory, disk or CD etc.。
Above a kind of three-dimensional navigation display method provided by the present invention and relevant apparatus are described in detail, for one of ordinary skill in the art, thought according to the embodiment of the present invention, all will change in specific embodiments and applications, in sum, this specification content should not be construed as limitation of the present invention。