Map generation method, device and equipment for converting two-dimensional picture into three-dimensional image

By converting two-dimensional images into three-dimensional texture images and performing perspective processing, the problem of distortion and deformation of hand-drawn maps in 3D mode is solved, the drawing steps are simplified, and the display effect and browsing fluency of three-dimensional maps are improved.

CN118710491APending Publication Date: 2024-09-27SHENYANG MXNAVI CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310289724.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-03-22
Publication Date
2024-09-27

AI Technical Summary

Technical Problem

When converting hand-drawn maps from 2D to 3D, the existing technology causes distortion and deformation of the drawing elements, and the 3D modeling method has cumbersome steps, low efficiency, and high hardware configuration, resulting in stuck display effects and poor user experience.

Method used

By obtaining the visual center point and longitude and latitude of the two-dimensional image, convert it into a three-dimensional texture image, and perform perspective processing, so that the distance between the three-dimensional texture image and the virtual camera is sorted from far to near, achieving a near-large and far-small perspective effect and simplifying the drawing. steps to improve efficiency.

Benefits of technology

The three-dimensional map is more beautiful and more observable, and the display effect is close to the real three-dimensional model, simplifying the drawing process and improving browsing fluency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118710491A
    Figure CN118710491A
Patent Text Reader

Abstract

The invention discloses a map generation method, device and equipment for converting a two-dimensional image into a three-dimensional image. The method comprises the following steps: acquiring a visual gravity center point of each two-dimensional picture and longitude and latitude in a two-dimensional map, and setting the visual gravity center point of each two-dimensional picture at the longitude and latitude; in the three-dimensional map, converting the two-dimensional Y coordinate of each vertex of each two-dimensional picture into a three-dimensional Z coordinate, converting the two-dimensional X coordinate into a three-dimensional X coordinate and setting the three-dimensional Y coordinate as 0 to obtain a three-dimensional texture picture corresponding to each two-dimensional picture; rotating each three-dimensional texture picture to be perpendicular to a projection line in the axis direction of the virtual camera; and respectively carrying out perspective processing according to the distance between each three-dimensional texture picture and the virtual camera from far to near, and drawing to obtain a three-dimensional image corresponding to each three-dimensional texture picture. By running the technical scheme provided by the embodiment of the invention, the picture of the map plane can become three-dimensional and spatialized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to a map generation method, device and equipment for converting a two-dimensional picture into a three-dimensional image. Background Art

[0002] In the depiction of characteristic buildings on hand-drawn maps, the current technology, when the navigation software switches the browsing mode to 3D, the hand-drawn maps are 2D pictures drawn on the ground plane, which will cause the depicted elements in these hand-drawn maps to be distorted and deformed under the effect of three-dimensional perspective, and there will be distortion and no three-dimensional display problems when browsing. In addition, these 2D pictures do not have the authenticity of 3D models from the observer's perspective in 3D browsing mode. If each characteristic building is depicted using 3D modeling, the steps in the early modeling processing method are cumbersome, and there are technical problems such as slow software calculation speed and low efficiency during the depiction process. In addition, the map engine will require a high-configuration hardware environment due to too many 3D models, which consumes more time and causes poor user experience such as display lag. Summary of the invention

[0003] Based on the above problems existing in the prior art, the inventors proposed the present invention to provide a map generation method, device and equipment for converting a two-dimensional picture into a three-dimensional image, which overcomes the above problems or at least partially solves the above problems existing in the prior art.

[0004] In a first aspect, an embodiment of the present invention provides a map generation method for converting a two-dimensional picture into a three-dimensional image, the method comprising:

[0005] Obtaining the visual center of gravity of each two-dimensional image and its longitude and latitude in the two-dimensional map, and setting the visual center of gravity of each two-dimensional image at the longitude and latitude;

[0006] In the three-dimensional map, converting the two-dimensional Y coordinates of each vertex of each of the two-dimensional images into three-dimensional Z coordinates, converting the two-dimensional X coordinates into three-dimensional X coordinates, and setting the three-dimensional Y coordinates to 0, to obtain three-dimensional texture images corresponding to each of the two-dimensional images;

[0007] Rotate each of the three-dimensional texture images to be perpendicular to the projection line of the axis direction of the virtual camera;

[0008] Perspective processing is performed respectively according to the distance between each of the three-dimensional texture pictures and the virtual camera in order from far to near, and a three-dimensional image corresponding to each of the three-dimensional texture pictures is obtained by drawing.

[0009] In one or some optional embodiments, the method further includes:

[0010] When the three-dimensional map rotates, the rotation angle of the three-dimensional map is obtained, and each of the three-dimensional texture images is rotated by the rotation angle in a direction opposite to the rotation direction of the three-dimensional map with its own Z axis as the central axis;

[0011] According to the distance between each of the rotated three-dimensional texture pictures and the virtual camera, perspective processing is performed again in order from far to near, and each rotated three-dimensional image is drawn.

[0012] In one or some optional embodiments, the distance between each of the three-dimensional texture images and the virtual camera is determined in the following manner:

[0013] According to the longitude and latitude of the visual center of gravity, the distance between the three-dimensional texture image and the virtual camera is determined in the camera coordinate system.

[0014] In one or some optional embodiments, determining the distance between the three-dimensional texture image and the virtual camera in the camera coordinate system according to the longitude and latitude of the visual center of gravity includes:

[0015] Determining the coordinates of the visual center of gravity of the three-dimensional texture image in the camera coordinate system according to the longitude and latitude of the visual center of gravity;

[0016] Taking the coordinate point of the virtual camera as the origin, in the camera coordinate system, according to the coordinates of the visual center of gravity of the three-dimensional texture image in the camera coordinate system and the origin, the distance between the three-dimensional texture image and the virtual camera is determined.

[0017] In one or some optional embodiments, perspective processing is performed on each of the three-dimensional texture images in the following manner:

[0018] Based on a preset perspective projection matrix, the three-dimensional texture image and the virtual camera are subjected to perspective calculation to obtain a three-dimensional texture image after perspective processing.

[0019] In one or some optional embodiments, the visual center of gravity of each of the two-dimensional images in the two-dimensional map is obtained by:

[0020] The circumscribed rectangle of the bottom surface of the preset main building in the two-dimensional image is determined, and the center point of the circumscribed rectangle is determined as the visual center of gravity.

[0021] In one or some optional embodiments, the longitude and latitude of each of the two-dimensional images in the two-dimensional map are obtained in the following manner:

[0022] The latitude and longitude of the actual geographical location of the two-dimensional image in the two-dimensional map or the latitude and longitude of the preset placement position are obtained as the latitude and longitude of the two-dimensional image in the two-dimensional map.

[0023] In a second aspect, an embodiment of the present invention provides a map generation device for converting a two-dimensional picture into a three-dimensional image, the device comprising:

[0024] A determination module, used for obtaining the visual center of gravity of each two-dimensional image and the longitude and latitude in the two-dimensional map, and setting the visual center of gravity of each two-dimensional image at the longitude and latitude;

[0025] A conversion module, used for converting the two-dimensional Y coordinates of each vertex of each of the two-dimensional images into three-dimensional Z coordinates, converting the two-dimensional X coordinates into three-dimensional X coordinates, and setting the three-dimensional Y coordinates to 0 in the three-dimensional map, so as to obtain a three-dimensional texture image corresponding to each of the two-dimensional images;

[0026] A rotation module, used for rotating each of the three-dimensional texture images to be perpendicular to the projection line in the direction of the axis of the virtual camera;

[0027] The perspective module is used to perform perspective processing respectively according to the distance between each of the three-dimensional texture pictures and the virtual camera in order from far to near, and draw a three-dimensional image corresponding to each of the three-dimensional texture pictures.

[0028] In a third aspect, an embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the map generation method for converting a two-dimensional picture into a three-dimensional image as described above.

[0029] In a fourth aspect, an embodiment of the present invention provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the map generation method for converting a two-dimensional picture into a three-dimensional image as described above is implemented.

[0030] In a fifth aspect, an embodiment of the present invention provides a computer program product comprising instructions, which, when executed on a computer device, enables the computer device to execute the map generation method for converting a two-dimensional picture into a three-dimensional image as described above.

[0031] In a sixth aspect, an embodiment of the present invention provides a chip, the chip including a processor and a communication interface, the communication interface and the processor are coupled, and the processor is used to run a computer program or instruction to implement the map generation method of converting a two-dimensional picture into a three-dimensional image as described above.

[0032] The beneficial effects of the above technical solution provided by the embodiment of the present invention include at least:

[0033] The map generation method for converting a two-dimensional image into a three-dimensional image provided by an embodiment of the present invention, by corresponding the visual center of gravity of the two-dimensional image with the longitude and latitude in its two-dimensional map, converting the two-dimensional image into a three-dimensional texture image with three-dimensional coordinates in the three-dimensional image, and performing sorting and perspective processing according to the direction and distance relationship between the three-dimensional texture image and the virtual camera, so that the three-dimensional image obtained by drawing presents a perspective effect of near big and far small, forming a three-dimensional map with a far and near space effect. The method is simple to operate, makes the plane picture three-dimensional and spatial, presents a beautiful and better observability in the three-dimensional (3D) map mode, and the display effect of the three-dimensional image is close to the real three-dimensional model, which enhances the display effect of the three-dimensional map. In addition, since the picture resource is used instead of the actual 3D model, compared with the use of the conventional three-dimensional model, the drawing steps are simplified, the speed and quality of the drawing are improved, and the browsing fluency of the three-dimensional map is greatly improved.

[0034] The map generation method for converting a two-dimensional image into a three-dimensional image provided by an embodiment of the present invention is that when a three-dimensional (3D) map is rotated, the image texture is also rotated, and the distance relationship is processed in real time to adjust the drawing order of each image texture, so that the three-dimensional image after the map is rotated can always reach a viewing angle directly facing the user. Therefore, in the three-dimensional (3D) map mode, it is ensured that the display effect of the three-dimensional image is always close to the real three-dimensional model, and the display effect of the three-dimensional map is further enhanced.

[0035] Other features and advantages of the present invention will be described in the following description, and partly become apparent from the description, or understood by practicing the present invention. The purpose and other advantages of the present invention can be realized and obtained by the structures particularly pointed out in the written description, claims, and drawings.

[0036] The technical solution of the present invention is further described in detail below through the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] The accompanying drawings are used to provide a further understanding of the present invention and constitute a part of the specification. Together with the embodiments of the present invention, they are used to explain the present invention and do not constitute a limitation of the present invention. In the accompanying drawings:

[0038] Figure 1 A schematic diagram of a flow chart of a map generation method for converting a two-dimensional picture into a three-dimensional image provided by an embodiment of the present invention;

[0039] Figure 2 A schematic diagram of determining a visual center of gravity provided by an embodiment of the present invention;

[0040] Figure 3 A schematic diagram of the relationship between a three-dimensional texture image and a virtual camera provided in an embodiment of the present invention;

[0041] Figure 4 A schematic diagram of the stereoscopic effect of a three-dimensional image before and after the three-dimensional map is rotated according to an embodiment of the present invention;

[0042] Figure 5 A schematic diagram of the distance relationship between two images when the three-dimensional map provided by an embodiment of the present invention is in a first rotation state;

[0043] Figure 6 for Figure 5 The schematic diagram of the distance relationship between the two pictures when the three-dimensional map is in the second rotation state shown;

[0044] Figure 7 A schematic diagram of the structure of a map generating device for converting a two-dimensional picture into a three-dimensional image provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0045] The exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.

[0046] Embodiment 1

[0047] The embodiment of the present invention provides a map generation method for converting a two-dimensional image into a three-dimensional image. Figure 1 As shown, the method includes:

[0048] S101: Obtain the visual center of gravity of each two-dimensional image and its longitude and latitude in a two-dimensional map, and set the visual center of gravity of each two-dimensional image at the longitude and latitude.

[0049] In this embodiment, the visual center of gravity in the above step S101 is obtained by determining the center point of the circumscribed rectangle of the bottom surface of the preset main building in the two-dimensional image as the visual center of gravity. Taking a hand-drawn map as an example, there may be some additional decorations around its characteristic buildings, including flowers, plants, trees, etc. In the embodiment of the present invention, when determining the visual center of gravity, only the main building, i.e., the characteristic building, is considered, and the additional decorations are not considered. By determining the circumscribed rectangle of the bottom surface of the preset main building in the two-dimensional image, the center point of the circumscribed rectangle is obtained, such as Figure 2 Point 2 ( Figure 2 The midpoint 1 is the observation auxiliary point) to obtain the visual center of gravity.

[0050] In the embodiment of the present invention, the longitude and latitude in the two-dimensional map can be selected by the user, and the two-dimensional image can be placed at any longitude and latitude position on the earth; the two-dimensional image can also be placed at the corresponding actual geographical location in the map according to the geographical location of the main building itself in the two-dimensional image. For example, if the main building in the two-dimensional image is the Yellow Crane Tower, then the two-dimensional image should be placed at the actual geographical location corresponding to the Yellow Crane Tower in the map, that is, the longitude and latitude of the main building itself is directly used as the longitude and latitude in the two-dimensional map. Since there is only one main building in the two-dimensional image, after obtaining the longitude and latitude of the main building in the two-dimensional image, the visual center of gravity of the two-dimensional image can be set at the corresponding longitude and latitude in the two-dimensional map.

[0051] S102: In the three-dimensional map, convert the two-dimensional Y coordinate of each vertex of each of the two-dimensional images into a three-dimensional Z coordinate, convert the two-dimensional X coordinate into a three-dimensional X coordinate, and set the three-dimensional Y coordinate to 0, so as to obtain a three-dimensional texture image corresponding to each of the two-dimensional images.

[0052] In this embodiment, the vertices of the two-dimensional image in the above step S102 are vertex coordinates generated when the two-dimensional image is drawn in OpenGL, and are customized in OpenGL. Since two-dimensional images in OpenGL are all rectangular, the vertices of the above two-dimensional image are the four vertices of the two-dimensional image; when the coordinates of each vertex in the two-dimensional map are converted into the three-dimensional map, the two-dimensional Y coordinates of each vertex are converted into three-dimensional Z coordinates, the two-dimensional X coordinates are converted into three-dimensional X coordinates, and the three-dimensional Y coordinates are set to 0. At this time, the texture image obtained does not change in size and is perpendicular to the two-dimensional map. Therefore, the texture image corresponding to the two-dimensional image after the coordinate conversion is called a three-dimensional texture image.

[0053] S103: Rotate each of the three-dimensional texture images to be perpendicular to the projection line in the direction of the axis of the virtual camera.

[0054] In this embodiment, the virtual camera in the above step S103 is used to simulate the viewing angle of the observation map. In the three-dimensional map, a camera coordinate system is established with the center point of the camera as the origin, that is, the coordinates of the center point of the camera are (0,0,0). The axis direction of the camera is the center line direction of the range captured by the camera. In the three-dimensional map, in order to achieve the stereoscopic effect of the three-dimensional texture image, since the three-dimensional texture images are all two-dimensional, all three-dimensional texture images should be perpendicular to the projection line of the axis direction of the camera in the three-dimensional map. The relationship between the three-dimensional texture image and the virtual camera is as follows: Figure 3As shown. In the actual drawing process, the 3D texture image can be rotated with its own Z axis as the central axis, so that the textured plane of the 3D texture image is always perpendicular to the camera line of sight, so that the texture of the 3D texture image always faces the camera. Combining the above methods, it is possible to achieve the effect of 3D display in 3D space with 2D images.

[0055] S104: performing perspective processing respectively according to the distance between each of the three-dimensional texture pictures and the virtual camera in order from far to near, and drawing to obtain a three-dimensional image corresponding to each of the three-dimensional texture pictures.

[0056] In this embodiment, the distance between the three-dimensional texture image and the virtual camera in the above step S104 is calculated as follows: the visual center of gravity of the three-dimensional texture image is placed on the longitude and latitude, and the coordinates of the visual center of gravity of the three-dimensional texture image in the camera coordinate system are determined according to the longitude and latitude of the visual center of gravity, and the coordinate point of the virtual camera is taken as the origin. In the camera coordinate system, the distance between the three-dimensional texture image and the virtual camera is determined according to the coordinates of the visual center of gravity of the three-dimensional texture image in the camera coordinate system and the origin. The distance between each three-dimensional texture image and the virtual camera can be determined according to the above method.

[0057] In this embodiment, after determining the distance relationship between each 3D texture image and the virtual camera according to the distance between each 3D texture image and the virtual camera, perspective processing is performed on each of the texture images in the following manner:

[0058] Based on a preset perspective projection matrix, perspective calculation is performed on each three-dimensional texture image and the virtual camera in order from far to near to obtain a three-dimensional texture image after perspective processing.

[0059] When the three-dimensional map rotates, the rotation angle of the three-dimensional map is obtained, and each of the three-dimensional texture images is rotated by the rotation angle in the direction opposite to the rotation direction of the three-dimensional map with its own Z axis (with the visual center of gravity as the origin) as the central axis. In order to intuitively display the three-dimensional effect, since the three-dimensional texture images obtained by coordinate transformation are actually two-dimensional images, in order to display the stereoscopic effect of the three-dimensional texture images in the three-dimensional map, all three-dimensional texture images can be rotated to be perpendicular to the projection line of the axis direction of the virtual camera. The relationship between the three-dimensional texture image and the camera drawing is as follows Figure 3 As shown. Therefore, from the observer's perspective, the three-dimensional texture image always presents a realistic three-dimensional effect, which improves the user experience.

[0060] In the actual drawing process, in order to achieve the effect of front-viewing, by reading the current map rotation angle, the three-dimensional texture images will be rotated with their respective Z axes as the center during drawing as described above, so that the textured plane is always perpendicular to the camera's line of sight, and these textures always remain facing the camera. According to the distance between each of the rotated three-dimensional texture images and the virtual camera, the perspective processing is re-performed in order from far to near, and each rotated three-dimensional image is drawn. By combining the above method, it is possible to achieve the effect of a three-dimensional model in 3D space using two-dimensional texture images. In the actual application of three-dimensional maps, such as Figure 4 As shown, no matter how the camera rotates, the three-dimensional texture image in the map is always perpendicular to the projection line of the camera axis, and the observer can always see the three-dimensional building image from the perspective.

[0061] In order to achieve a three-dimensional effect, the three-dimensional texture images need to be drawn so that they appear larger when closer and smaller when farther away. During the rotation of the three-dimensional map, the distance between each three-dimensional texture image and the center point of the camera will change. Therefore, each time a three-dimensional texture image is drawn, it needs to be drawn from far to near according to the distance between the three-dimensional texture image and the virtual camera. Figure 5 As shown, when the 3D map rotates to Figure 5 When the 3D map is rotated to the right, the image (1) is closer to the camera than the image (2). Therefore, in the drawing process, the image (2) should be drawn first and then the image (1) to achieve the effect that the image (2) is blocked by the image (1) and the effect that the near is larger and the far is smaller is achieved. Figure 6 , image (2) is closer to the observer than image (1). In this case, during the drawing process, image (1) should be drawn first and then image (2) to achieve the effect that image (1) is blocked by image (2). Similarly, all images must undergo perspective calculations by the camera, and the preset perspective projection matrix will perform perspective calculations on the three-dimensional texture image and the virtual camera to obtain a three-dimensional texture image after perspective processing. The preset perspective projection matrix only needs to arrange the three-dimensional texture images to be drawn in order to calculate on its own, thereby achieving the effect of near being large and far being small. In the embodiments of the present invention, the specific implementation method of the perspective projection matrix can refer to the detailed description in the prior art, and will not be repeated here.

[0062] The map generation method for converting a two-dimensional image into a three-dimensional image provided by an embodiment of the present invention, by corresponding the visual center of gravity of the two-dimensional image with the longitude and latitude in its two-dimensional map, converting the two-dimensional image into a three-dimensional texture image with three-dimensional coordinates in the three-dimensional image, and performing sorting and perspective processing according to the direction and distance relationship between the three-dimensional texture image and the virtual camera, so that the three-dimensional image obtained by drawing presents a perspective effect of near big and far small, forming a three-dimensional map with a far and near space effect. The method is simple to operate, makes the plane picture three-dimensional and spatial, presents a beautiful and better observability in the three-dimensional (3D) map mode, and the display effect of the three-dimensional image is close to the real three-dimensional model, which enhances the display effect of the three-dimensional map. In addition, since the picture resource is used instead of the actual 3D model, compared with the use of the conventional three-dimensional model, the drawing steps are simplified, the speed and quality of the drawing are improved, and the browsing fluency of the three-dimensional map is greatly improved.

[0063] The map generation method for converting a two-dimensional image into a three-dimensional image provided by an embodiment of the present invention is that when a three-dimensional (3D) map is rotated, the image texture is also rotated, and the distance relationship is processed in real time to adjust the drawing order of each image texture, so that the three-dimensional image after the map is rotated can always reach a viewing angle directly facing the user. Therefore, in the three-dimensional (3D) map mode, it is ensured that the display effect of the three-dimensional image is always close to the real three-dimensional model, and the display effect of the three-dimensional map is further enhanced.

[0064] Embodiment 2

[0065] Based on the same inventive concept, the embodiment of the present invention also provides a map generation device for converting a two-dimensional picture into a three-dimensional image, referring to Figure 7 As shown, the device comprises:

[0066] The determination module 201 is used to obtain the visual center of gravity of each two-dimensional image and the longitude and latitude in the two-dimensional map, and set the visual center of gravity of each two-dimensional image at the longitude and latitude;

[0067] The conversion module 202 is used to convert the two-dimensional Y coordinates of each vertex of each of the two-dimensional images into three-dimensional Z coordinates, convert the two-dimensional X coordinates into three-dimensional X coordinates, and set the three-dimensional Y coordinates to 0 in the three-dimensional map, so as to obtain the three-dimensional texture images corresponding to each of the two-dimensional images;

[0068] A rotation module 203, used for rotating each of the three-dimensional texture images to be perpendicular to the projection line of the axis direction of the virtual camera;

[0069] The perspective module 204 is used to perform perspective processing respectively according to the distance between each of the three-dimensional texture pictures and the virtual camera in order from far to near, and draw a three-dimensional image corresponding to each of the texture pictures.

[0070] Embodiment 3

[0071] Based on the same inventive concept, an embodiment of the present invention further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the map generation method for converting a two-dimensional picture into a three-dimensional image as described in the above-mentioned embodiment 1.

[0072] Embodiment 4

[0073] Based on the same inventive concept, an embodiment of the present invention also provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the map generation method for converting a two-dimensional picture into a three-dimensional image as described in the above-mentioned embodiment 1 is implemented.

[0074] Embodiment 5

[0075] Based on the same inventive concept, an embodiment of the present invention also provides a computer program product containing instructions. When the computer program product is run on a computer device, the computer device executes the map generation method of converting a two-dimensional picture into a three-dimensional image as described in the above embodiment 1.

[0076] Embodiment 6

[0077] Based on the same inventive concept, an embodiment of the present invention also provides a chip, the chip includes a processor and a communication interface, the communication interface and the processor are coupled, and the processor is used to run a computer program or instruction to implement the map generation method of converting a two-dimensional picture into a three-dimensional image as described in the above embodiment one.

[0078] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage and optical storage, etc.) containing computer-usable program code.

[0079] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0080] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0081] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0082] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.

Claims

1. A map generation method for converting a two-dimensional picture into a three-dimensional image, characterized in that: include: Obtaining the visual center of gravity of each two-dimensional image and its longitude and latitude in the two-dimensional map, and setting the visual center of gravity of each two-dimensional image at the longitude and latitude; In the three-dimensional map, converting the two-dimensional Y coordinates of each vertex of each of the two-dimensional images into three-dimensional Z coordinates, converting the two-dimensional X coordinates into three-dimensional X coordinates, and setting the three-dimensional Y coordinates to 0, to obtain three-dimensional texture images corresponding to each of the two-dimensional images; Rotate each of the three-dimensional texture images to be perpendicular to the projection line of the axis direction of the virtual camera; Perspective processing is performed respectively according to the distance between each of the three-dimensional texture pictures and the virtual camera in order from far to near, and a three-dimensional image corresponding to each of the three-dimensional texture pictures is obtained by drawing.

2. The method according to claim 1, characterized in that Also includes: When the three-dimensional map rotates, the rotation angle of the three-dimensional map is obtained, and each of the three-dimensional texture images is rotated by the rotation angle in a direction opposite to the rotation direction of the three-dimensional map with its own Z axis as the central axis; According to the distance between each of the rotated three-dimensional texture pictures and the virtual camera, perspective processing is performed again in order from far to near, and each rotated three-dimensional image is drawn.

3. The method according to claim 1 or 2, characterized in that The distance between each of the three-dimensional texture images and the virtual camera is determined in the following manner: According to the longitude and latitude of the visual center of gravity, the distance between the three-dimensional texture image and the virtual camera is determined in the camera coordinate system.

4. The method according to claim 3, characterized in that Determining the distance between the three-dimensional texture image and the virtual camera in a camera coordinate system according to the longitude and latitude of the visual center of gravity includes: Determining the coordinates of the visual center of gravity of the three-dimensional texture image in the camera coordinate system according to the longitude and latitude of the visual center of gravity; Taking the coordinate point of the virtual camera as the origin, in the camera coordinate system, according to the coordinates of the visual center of gravity of the three-dimensional texture image in the camera coordinate system and the origin, the distance between the three-dimensional texture image and the virtual camera is determined.

5. The method according to claim 1 or 2, characterized in that: Each of the three-dimensional texture images is perspective processed in the following manner: Based on a preset perspective projection matrix, the three-dimensional texture image and the virtual camera are subjected to perspective calculation to obtain a three-dimensional texture image after perspective processing.

6. The method according to claim 1, characterized in that The visual center of gravity of each of the two-dimensional images in the two-dimensional map is obtained by: The circumscribed rectangle of the bottom surface of the preset main building in the two-dimensional image is determined, and the center point of the circumscribed rectangle is determined as the visual center of gravity.

7. A map generation device for converting a two-dimensional picture into a three-dimensional image, characterized in that: include: A determination module, used for obtaining the visual center of gravity of each two-dimensional image and the longitude and latitude in the two-dimensional map, and setting the visual center of gravity of each two-dimensional image at the longitude and latitude; A conversion module, used for converting the two-dimensional Y coordinates of each vertex of each of the two-dimensional images into three-dimensional Z coordinates, converting the two-dimensional X coordinates into three-dimensional X coordinates, and setting the three-dimensional Y coordinates to 0 in the three-dimensional map, so as to obtain a three-dimensional texture image corresponding to each of the two-dimensional images; A rotation module, used for rotating each of the three-dimensional texture images to be perpendicular to the projection line in the direction of the axis of the virtual camera; The perspective module is used to perform perspective processing respectively according to the distance between each of the three-dimensional texture pictures and the virtual camera in order from far to near, and draw a three-dimensional image corresponding to each of the three-dimensional texture pictures.

8. A computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the map generation method for converting a two-dimensional picture into a three-dimensional image as claimed in any one of claims 1 to 6.

9. A computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the map generation method for converting a two-dimensional image into a three-dimensional image as described in any one of claims 1 to 6 is implemented.

10. A computer program product comprising instructions, which, when executed on a computer device, enables the computer device to execute the map generation method for converting a two-dimensional picture into a three-dimensional image as claimed in any one of claims 1 to 6.