Image generation method and device, image display method
By directly extracting and converting vector data into Cartesian coordinates to generate map images, the problem of low efficiency in map image generation in existing technologies is solved, and fast and efficient image generation is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- ALIBABA GROUP HOLDING LTD
- Filing Date
- 2020-07-28
- Publication Date
- 2026-07-24
AI Technical Summary
Existing technologies cannot quickly and efficiently generate map images based on vector data, especially in machine learning model training and recognition classification. Traditional tile segmentation methods are inefficient and consume a lot of manpower and resources.
By acquiring road data from electronic maps, receiving image generation instructions, extracting road data within the selected area, and converting it into coordinates in a Cartesian coordinate system, a road image is generated, avoiding the tile-cutting process.
It enables the rapid and efficient generation of map images, improves generation efficiency, and solves the problem of low efficiency in map image generation in existing technologies.
Smart Images

Figure CN114003670B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of image processing, and more specifically, to an image generation method and apparatus, and an image display method. Background Technology
[0002] In related technologies, when converting road data in map data to different formats, the inventors discovered that machine learning techniques can improve conversion efficiency. One approach involves using machine learning-based image recognition technology to extract road lines from road data of format A (usually vector data), and then using these road lines to obtain road data of format B (also usually vector data). However, this technique requires converting the road data into images for training and classification of machine learning models. The challenge lies in efficiently and accurately generating images for machine learning based on road data. Summary of the Invention
[0003] This application provides an image generation method and apparatus, and an image display method, to at least solve the technical problem in the prior art that it is impossible to quickly and efficiently generate map images based on vector data.
[0004] According to one aspect of the embodiments of this application, an image generation method is provided, comprising: acquiring road data for generating an electronic map, wherein the road data of the electronic map is vector data; receiving an image generation instruction, the image generation instruction carrying a selected area in a road network; extracting road data within the selected area from the road data of the electronic map; converting the position coordinates in the road data within the selected area into coordinates in a Cartesian coordinate system, and generating a road image of the selected area based on the coordinates in the Cartesian coordinate system.
[0005] According to another aspect of the embodiments of this application, an image generation apparatus is also provided, comprising: an acquisition module for acquiring road data for generating an electronic map, wherein the road data of the electronic map is vector data; a receiving module for receiving an image generation instruction, wherein the image generation instruction carries a selected area in a road network; an extraction module for extracting road data within the selected area from the road data of the electronic map; and a generation module for converting the position coordinates in the road data within the selected area into coordinates in a Cartesian coordinate system, and generating a road image of the selected area based on the coordinates in the Cartesian coordinate system.
[0006] According to another aspect of the embodiments of this application, a storage medium is also provided, the storage medium including a stored program, wherein, when the program is running, it controls the device where the storage medium is located to execute any of the above-described image generation methods.
[0007] According to another aspect of the embodiments of this application, a computing device is also provided, including: a processor; and a memory connected to the processor, configured to provide the processor with instructions for processing the following processing steps: acquiring road data for generating an electronic map, wherein the road data of the electronic map is vector data; receiving an image generation instruction, the instruction carrying a selected area in a road network; extracting road data within the selected area from the road data of the electronic map; converting the position coordinates in the road data within the selected area into coordinates in a Cartesian coordinate system, and generating a road image of the selected area based on the coordinates in the Cartesian coordinate system.
[0008] In this embodiment of the application, road data for generating an electronic map is obtained, wherein the road data of the electronic map is vector data; an image generation instruction is received, wherein the image generation instruction carries a selected area in the road network; road data within the selected area is extracted from the road data of the electronic map; the position coordinates in the road data within the selected area are converted into coordinates in a rectangular coordinate system, and a road image of the selected area is generated based on the coordinates in the rectangular coordinate system.
[0009] It is noteworthy that, in this embodiment of the application, there is no need to tile the road data (vector data) of the generated electronic map. The road data within the selected area can be extracted from the road data according to the user's needs (i.e., according to the image range specified by the user), and the position coordinates in the road data within the selected area can be converted into coordinates in a Cartesian coordinate system to generate a road image of the selected area based on the coordinates in the Cartesian coordinate system.
[0010] Therefore, the embodiments of this application achieve the goal of generating map images quickly and efficiently based on vector data, thereby realizing the technical effect of improving the generation efficiency of map images, and thus solving the technical problem that the prior art cannot generate map images quickly and efficiently based on vector data. Attached Figure Description
[0011] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:
[0012] Figure 1 This is a hardware structure block diagram of a computer terminal (or mobile device) for implementing an image generation method according to an embodiment of this application;
[0013] Figure 2 This is a flowchart of an image generation method according to an embodiment of this application;
[0014] Figure 3 This is a scene illustration of an image generation method according to an embodiment of this application;
[0015] Figure 4a This is an optional schematic diagram of a road image corresponding to the first vector data according to an embodiment of this application;
[0016] Figure 4b This is a schematic diagram illustrating an optional display of images in an electronic map according to an embodiment of this application;
[0017] Figure 5 This is a flowchart of an image display method according to an embodiment of this application;
[0018] Figure 6 This is a schematic diagram of the structure of an image generation apparatus according to an embodiment of the present invention;
[0019] Figure 7 This is a schematic diagram of the structure of an electronic device according to an embodiment of the present invention;
[0020] Figure 8 This is a structural block diagram of another computer terminal according to an embodiment of this application. Detailed Implementation
[0021] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.
[0022] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0023] First, some nouns or terms that appear in the description of the embodiments of this application shall be interpreted as follows:
[0024] Vector data: a format for recording spatial data. The basic graphic elements on a map can be summarized as points, lines, and polygons, as well as combinations thereof.
[0025] Mapnik is a toolkit for developing GIS applications. At its core is a C++ shared library that provides algorithms and patterns for spatial data access and visualization, particularly including geographic objects such as maps, layers, data sources, features, and geographic geometry.
[0026] In related technologies, when performing specification conversion processing on road data in map data, machine learning is used to process a portion of the vector data. This vector data needs to be converted into images for machine learning model training and classification. Because machine learning requires a large number of images, the traditional method of manually taking screenshots of vector data is too inefficient and cannot meet the requirements.
[0027] In related technologies, vector data can be divided into tiles, such as using the Mapnik method. Mapnik divides vector data into tiles and converts them into raster tile maps. The main disadvantages are as follows: 1. The size and range of a single tile are fixed and cannot be customized; 2. The scaling scale is fixed and cannot be automatically adjusted; 3. If the data spans multiple tiles, the tile map needs to be stitched, cropped, or processed; 4. The functionality is complex and deployment requires a lot of manpower and resources.
[0028] Example 1
[0029] According to an embodiment of this application, an embodiment of an image generation method is also provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.
[0030] The methods and embodiments provided in this application can be executed on mobile terminals, computer terminals, or similar computing devices. Figure 1 A hardware structure block diagram of a computer terminal (or mobile device) for implementing an image generation method is shown, such as... Figure 1As shown, the computer terminal 10 (or mobile device 10) may include one or more processors 102 (shown as 102a, 102b, ..., 102n in the figure) 102 (processor 102 may include, but is not limited to, a microprocessor MCU or a programmable logic device FPGA, etc.), a memory 104 for storing data, and a transmission module 106 for communication functions. In addition, it may also include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of the I / O interface), a network interface, a power supply, and / or a camera. Those skilled in the art will understand that... Figure 1 The structure shown is for illustrative purposes only and does not limit the structure of the aforementioned electronic device. For example, computer terminal 10 may also include... Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown.
[0031] It should be noted that the aforementioned one or more processors 102 and / or other data processing circuits are generally referred to herein as "data processing circuits". These data processing circuits may be embodied, in whole or in part, in software, hardware, firmware, or any other combination thereof. Furthermore, the data processing circuits may be a single, independent processing module, or may be integrated, in whole or in part, into any other element within the computer terminal 10 (or mobile device). As involved in the embodiments of this application, the data processing circuits serve as a processor control mechanism (e.g., selection of a variable resistor termination path connected to an interface).
[0032] The memory 104 can be used to store software programs and modules of application software, such as the program instructions / data storage device corresponding to the image generation method in this embodiment. The processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, thereby realizing the above-mentioned image generation method. The memory 104 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include memory remotely located relative to the processor 102, and these remote memories can be connected to the computer terminal 10 via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0033] The transmission device 106 is used to receive or send data via a network. Specific examples of the network described above may include a wireless network provided by the communication provider of the computer terminal 10. In one example, the transmission device 106 includes a Network Interface Controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the transmission device 106 may be a Radio Frequency (RF) module, used for wireless communication with the Internet.
[0034] The display can be, for example, a touchscreen liquid crystal display (LCD) that allows the user to interact with the user interface of the computer terminal 10 (or mobile device).
[0035] Under the above operating environment, the embodiments of this application provide the following: Figure 2 An image generation method is shown. Figure 2 This is a flowchart of an image generation method according to an embodiment of this application, such as... Figure 2 As shown, the method includes the following steps:
[0036] Step S102: Obtain road data for generating an electronic map, wherein the road data of the electronic map is vector data;
[0037] Step S104: Receive an image generation instruction, which carries the selected area in the road network;
[0038] Step S106: Extract road data within the selected area from the road data of the electronic map;
[0039] Step S108: Convert the location coordinates in the road data within the selected area into coordinates in a Cartesian coordinate system, and generate a road image of the selected area based on the coordinates in the Cartesian coordinate system.
[0040] The road data used to generate images in electronic maps is vector data. This vector data includes, but is not limited to, the longitude and latitude information of each sampling point. It should be noted that vector data is a format for recording spatial data. The basic graphic elements on a map can be summarized as three elements: points, lines, and surfaces, as well as their combinations.
[0041] As an optional embodiment, an instruction from a user is received, a target vector data type is determined based on the user's instruction, and vector data is retrieved from the storage location corresponding to the target vector data type to obtain the road data used to generate the electronic map. Then, vector data corresponding to the area range specified by the user can be extracted from the road data used to generate the electronic map. This vector data is spatial coordinate data. By converting this vector data into coordinate information in a simple Cartesian coordinate system, the road image can be easily generated based on this coordinate information using the open-source artificial intelligence platform (GDIopengl) software.
[0042] It should be noted that the execution order of the above steps S102 and S104 can be interchanged under appropriate circumstances, and does not need to be used to describe a specific order or sequence. The first instruction from the user can be received first, and then the road data (which is vector data, hereinafter referred to as the first vector data) used to generate the image in the electronic map can be obtained. Alternatively, the first vector data used to generate the image in the electronic map can be obtained at the same time as receiving the first instruction from the user, or the first instruction from the user can be received at the same time as obtaining the first vector data used to generate the image in the electronic map.
[0043] As an optional embodiment, Figure 3 This is a scene illustration of an image generation method according to an embodiment of this application, such as... Figure 3 The electronic device shown renders a human-computer interaction interface 30 for displaying images in an electronic map, i.e., a map interface. This human-computer interaction interface 30 includes a receiving control 32 for receiving a first command from the user; such as... Figure 3 As shown, the receiving control 32 can receive a first instruction input by the user via touch, wherein the first instruction carries a region range. The map interface can, when generating the image, rely on... Figure 3 The process is generated on the right.
[0044] In this embodiment of the application, road vector data (i.e., first vector data) used to generate images in an electronic map is obtained; an image generation instruction is received, wherein the image generation instruction carries a region range; vector data (hereinafter referred to as second vector data) within the selected region is extracted from the road vector data; the second vector data is converted into coordinate information in a rectangular coordinate system, and the image is generated based on the coordinate information.
[0045] It is noteworthy that, in this embodiment of the application, there is no need to tile the first vector data. The corresponding second vector data can be extracted from the first vector data according to the user's needs (i.e., according to the image range specified by the user), and the second vector data can be converted into coordinate information in a rectangular coordinate system to generate map images in electronic maps based on the coordinate information.
[0046] Therefore, the embodiments of this application achieve the goal of generating map images quickly and efficiently based on vector data, thereby realizing the technical effect of improving the generation efficiency of map images, and thus solving the technical problem that the prior art cannot generate map images quickly and efficiently based on vector data.
[0047] In some embodiments of this application, obtaining first vector data for generating images in an electronic map includes:
[0048] Step S202: Receive a second instruction from the user;
[0049] Step S204: Determine the target vector data type according to the second instruction mentioned above;
[0050] Step S206: Retrieve vector data from the storage location corresponding to the target vector data type to obtain the first vector data.
[0051] Optionally, the second instruction may carry a target vector data type. Specifically, the target vector data type may be determined based on spatial coordinate information, data feature information, data type information, etc., and the storage location of the vector data may be determined based on the target vector data type to obtain the first vector data corresponding to the target vector data type.
[0052] In some embodiments of this application, extracting road data within a selected area from road data in an electronic map can be achieved through the following process: determining a first reference point in the selected area; using the first reference point as the center of the selected area, determining a target area based on the size information of the selected area; determining an associated area that is related to the target area; and determining the road data within the selected area based on the road data in the associated area and the target area.
[0053] The target area includes a designated area in the road network; obtaining the road topology information of the target area includes: determining the roads connected to the road segment where the designated area is located, and using the roads connected to the road segment where the designated area is located as the road topology information.
[0054] For example, the center point of the selected area is used as the first reference point, the boundary of the selected area is determined according to the size of the selected area, and the road data in the area enclosed by the boundary is used as the road data in the selected area.
[0055] The target area mentioned above can be a region of interest or a selected area when generating an image in an electronic map, such as a road segment area or an intersection area, specifically a crossroads area. The first reference point mentioned above can be a reference point carried in the image generation instruction. Based on the information of the first reference point, the region of interest of the generated image, i.e., the target area, can be determined.
[0056] Furthermore, after determining the target area, the associated area corresponding to the target area can also be determined. Optionally, the associated area is the area associated with the target area. If the target area is an intersection, the associated area can be multiple roads connected to the intersection. After determining the associated area corresponding to the target area, the second vector data can be determined in the vector data corresponding to the image range based on the associated area.
[0057] In some embodiments of this application, determining the associated regions that are related to the target region includes:
[0058] Step S402: Obtain the topology information of the target area mentioned above;
[0059] Step S404: Based on the above topological information, determine the first type of region that has a topological relationship with the target region;
[0060] Step S406: Select a region with a specified road attribute from the first type of region, and use the region with the specified road attribute as the associated region. The specified road attribute can be obtained from user instructions, for example, from an image generation instruction.
[0061] Optionally, the topological information of the target area refers to all road information connected to the current road segment or the current intersection, and the attributes of the image can be road information, such as road level information like expressway or national highway; or detailed road information such as road width, length and number of lanes.
[0062] In other words, after obtaining the above topological information, the first type of region with a topological relationship with the target region can be determined based on the topological information. If the target region is an intersection, the first type of region is multiple roads connected to the intersection. Then, based on the obtained road attribute information, the corresponding region can be selected from the first type of region to obtain the associated region with the target region.
[0063] In other embodiments of this application, the aforementioned associated regions can also be determined in the following ways:
[0064] Step S502: Obtain the center point of the selected area;
[0065] Step S504: Using the aforementioned center point as the center of the target area and a preset radius as the radius of the target area, determine the aforementioned target area, and then determine the associated areas that are related to the aforementioned target area.
[0066] In some embodiments of this application, when converting the location coordinates in the road data within the selected area to coordinates in a Cartesian coordinate system, the following steps can also be used:
[0067] Step S602: Obtain the location point information corresponding to the road data within the selected area;
[0068] Step S604: Determine the bounding rectangle region of the selected area based on the above location point information;
[0069] Step S606: Construct a rectangular coordinate system using the vector data of any one vertex from any pair of diagonal vertices in the above-mentioned bounded rectangular region as the origin.
[0070] Step S606: Determine the coordinates of the road data within the selected area in the rectangular coordinate system.
[0071] In step S606, the relative distance between the vector data corresponding to the origin and the vector data of the road data in the selected area can be determined first. Based on the coordinates of the origin in the rectangular coordinate system and the relative distance, the coordinate values of the vector data of the road data in the selected area in the rectangular coordinate system can be determined.
[0072] Figure 4a This is a schematic diagram of an optional embodiment of the present application for displaying vector data in a human-computer interaction interface. The first vector data displayed in the human-computer interaction interface of the electronic map platform can be as follows. Figure 4a As shown; because by default, only images in electronic maps are generated when... Figure 4a If the road associated with the middle rectangle shown in the image (i.e., the second vector data) is of interest, then the road of interest can be determined based on topology and attributes, and other roads can be filtered out. The image corresponding to the filtered vector data is shown below. Figure 4b As shown.
[0073] Specifically, in this embodiment, after obtaining the location point information of the second vector data and determining an intermediate rectangular frame region (i.e., the region corresponding to the second vector data), the center point of the intermediate rectangular frame region can be calculated, and an outer rectangular frame region of the intermediate rectangular frame can be generated according to the region range specified by the user (the region range includes size, etc.). After determining the outer rectangular frame region of the region corresponding to the second vector data, the outer rectangular frame region is divided by inner lines to obtain any vertex of any pair of diagonal vertices in the outer rectangular frame region. After the division process, coordinate transformation is performed. The vector data of any vertex of any pair of diagonal vertices in the outer rectangular frame region is used as the origin, and the two sides of the outer rectangular frame region intersecting with the origin are used as the horizontal and vertical coordinates to establish the above-mentioned rectangular coordinate system. The relative distance between the vector data corresponding to the origin and other vector data in the second vector data is determined. The coordinate information of the second vector data in the above-mentioned rectangular coordinate system is determined based on the relative distance, and the image in the electronic map is generated based on the coordinate information.
[0074] In some embodiments of this application, extracting road data within the selected area from the road data of the aforementioned electronic map includes:
[0075] Step S702: The road data of the above electronic map is grouped according to preset rules to obtain multiple groups;
[0076] Step S704: Select the group corresponding to the image generation instruction from the plurality of groups; and
[0077] Step S706: Extract vector data corresponding to the selected area from the selected group to obtain road data within the selected area.
[0078] Specifically, the aforementioned predetermined rules can be grouping rules based on spatial coordinates or topological relationships. Furthermore, based on the received instruction (which can be an image generation instruction or other instruction carrying user requirements, and the corresponding grouping can be determined based on these requirements), a corresponding group can be selected from multiple groups. For example, the instruction may also carry indication information such as a group number or group name. Based on the indication information carried in the instruction, a corresponding group can be selected from multiple groups, and vector data corresponding to the selected area can be extracted from the selected group.
[0079] In this embodiment, by extracting the vector data to be converted from the first vector data, namely the second vector data corresponding to the selected area, the purpose of filtering out other vector data that do not need to be converted can be achieved; the first vector data is grouped according to predetermined rules such as spatial coordinates and topological relationships so that the vector data can be better aggregated and redundant images can be avoided.
[0080] In some embodiments of this application, the road data of the aforementioned electronic map is grouped according to preset rules to obtain multiple groups, including:
[0081] Step S802: According to the type of each vector data in the road data used to generate the electronic map, the road data used to generate the electronic map is divided into different sets, where each set corresponds to a region and there is no overlap between different sets;
[0082] For example, the number of road vectors of type 6 lanes in the first region is divided into one set, and the road vector data of type 4 lanes is divided into another set. It should be noted that the road data in different sets belongs to different types, and there is no identical road data in different sets, that is, there is no overlap between different sets.
[0083] Step S804: Group the different sets according to the association relationship between them to obtain multiple groups.
[0084] Optionally, the type of each vector data can be determined based on its spatial coordinates or topological relationships in the electronic map, and the first vector data can be divided into different sets based on its type. Then, the different sets can be grouped according to the relationships between them to obtain the multiple groups.
[0085] There are several ways to group the different sets mentioned above, for example:
[0086] Step S902: Obtain the topological relationships of the different sets in the electronic map; the topological relationships include, but are not limited to, the road connectivity relationships between the areas corresponding to the different sets.
[0087] Step S904: Cut the different sets according to the above topological relationship to obtain the above multiple groups.
[0088] As an optional embodiment, the different sets can be grouped according to the association between them. For example, the different sets can be grouped according to their topological relationships in the electronic map to obtain the multiple groups.
[0089] For example, sets can also be grouped in the following ways:
[0090] Step S1002: Obtain the location information of each vector data in the above-mentioned different sets in the above-mentioned electronic map;
[0091] Step S1004: Select at least one reference vector data from the various vector data in the different sets mentioned above;
[0092] Step S1006: Based on the location information of the aforementioned reference vector data on the aforementioned electronic map and the area of a preset region, the different sets are grouped. Wherein, the preset...
[0093] As another optional embodiment, the location information of each vector data in different sets in the electronic map can be obtained, and at least one reference vector data can be selected from the vector data in different sets. Since the reference vector data in different sets are different, the location information and the area of the preset area of the different reference vector data in the electronic map are different. For example, if the coordinate location information of a certain reference vector data in the above electronic map is (a, b), the set corresponding to the area covered by the preset area in the electronic map with (a, b) as the center of the preset area is divided into a group.
[0094] To understand the image generation method embodiments provided in this application, the following specific embodiment is used as an example. This optional image generation method includes the following implementation steps:
[0095] First, the system acquires first vector data for generating images in the electronic map and receives a first instruction from the user. Based on the image range carried in the first instruction, it locates the second vector data within the first vector data that is needed to generate the image. For example, the target vector data type can be determined using information such as spatial coordinates, data characteristics, and data type to locate the storage location corresponding to the target vector data type. The second vector data that needs to be converted into an image is then extracted, and other vector data that does not need to be converted can be filtered out. Specifically, the first vector data can be grouped, for example, based on spatial coordinates, topological relationships, etc., to obtain multiple groups. The group corresponding to the first instruction is selected from these groups. Vector data corresponding to the aforementioned image range is extracted from the selected group to obtain the aforementioned second vector data.
[0096] After obtaining the second vector data, based on the position point information corresponding to the second vector data, the circumscribed rectangular region corresponding to the region of the second vector data is determined; and the vector data of any one vertex of any pair of diagonal vertices in the circumscribed rectangular region is used as the origin, and the two sides of the circumscribed rectangular region intersecting the origin are used as the x and y coordinates to establish the rectangular coordinate system; the relative distance between the vector data corresponding to the origin and other vector data in the second vector data is determined; and the coordinate information of the second vector data in the rectangular coordinate system is determined based on the relative distance, and the image is generated using GDIopengl software based on the coordinate information.
[0097] It should be noted that, as an optional embodiment, in order to facilitate the rapid location of the source of an image in an electronic map, spatial coordinates and data features can be used as the image name, making it easier to trace the source of the image's generation.
[0098] Example 2
[0099] According to the embodiments of this application, another embodiment of the image display method is also provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.
[0100] Under the same or similar operating environment as in Example 1, this application also provides, for example... Figure 5 The image display method shown is as follows: Figure 5 This is a flowchart of an image display method according to an embodiment of this application, such as... Figure 5 As shown, the method for displaying the image of the socket may include the following steps:
[0101] Step S1102: Display road data used to generate an electronic map in the human-computer interaction interface, wherein the road data of the electronic map is vector data;
[0102] Step S1104: Display the received image generation instruction in the above human-computer interaction interface. The image generation instruction carries the selected area in the road network.
[0103] Step S1106: Display the road data of the selected area extracted from the road data of the electronic map in the human-computer interaction interface.
[0104] Step S1108: Display the coordinates determined by the following steps in the above human-computer interaction interface: convert the position coordinates in the road data of the selected area into coordinates in a rectangular coordinate system;
[0105] Step S1110: Display the road image of the selected area generated based on coordinates in the Cartesian coordinate system in the human-computer interaction interface.
[0106] Optionally, the vector data used to generate electronic maps includes longitude and latitude information. It should be noted that vector data is a format for recording spatial data. The basic graphic elements on a map can be summarized as points, lines, and polygons, as well as combinations thereof.
[0107] As an optional embodiment, the image range can be determined according to the user's first instruction (which may be an image generation instruction or other instructions), and the target vector data type can be determined according to the user's second instruction. The first vector data (i.e., the road data used to generate the electronic map in step S1102) can be retrieved from the storage location corresponding to the target vector data type. The second vector data corresponding to the image range specified by the user can be extracted from the first vector data. The second vector data is spatial coordinate data. By converting the second vector data into coordinate information in a simple Cartesian coordinate system, the above-mentioned image can be easily generated using GDIopengl software based on the coordinate information.
[0108] It should be noted that the execution order of the above steps S1102 and S1104 can be interchanged under appropriate circumstances, and does not need to be used to describe a specific order or sequence. The image generation instruction from the user can be received first, and then the first vector data for generating the electronic map (i.e., the road data for generating the electronic map mentioned above) can be obtained. Alternatively, the road data for generating the electronic map can be obtained at the same time as receiving the image generation instruction from the user, or the image generation instruction from the user can be received at the same time as obtaining the vector data for generating the electronic map.
[0109] In this embodiment of the application, road data for generating an electronic map is acquired; an image generation instruction from a user is received, wherein the image generation instruction carries regional range information, which is used to indicate a selected area in the road network; vector data corresponding to the aforementioned regional range, i.e., road data within the selected area, is extracted from the road data for generating the electronic map; the road data within the selected area is converted into coordinate information in a Cartesian coordinate system, and the image is generated based on the coordinate information.
[0110] It is noteworthy that, in this embodiment of the application, there is no need to tile the vector data used to generate the electronic map. The vector data within the selected area can be extracted from the vector data used to generate the electronic map according to the user's needs (i.e., according to the image range specified by the user). The vector data within the selected area is then converted into coordinate information in a Cartesian coordinate system, and the map image in the electronic map is generated based on this coordinate information.
[0111] Therefore, the embodiments of this application achieve the goal of generating map images quickly and efficiently based on vector data, thereby realizing the technical effect of improving the generation efficiency of map images, and thus solving the technical problem that the prior art cannot generate map images quickly and efficiently based on vector data.
[0112] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, as some steps may be performed in other orders or simultaneously according to this application. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions and modules involved are not necessarily essential to this application.
[0113] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of this application.
[0114] It should be noted that the preferred implementation of this embodiment can be found in the relevant description in Embodiment 1, and will not be repeated here.
[0115] Example 3
[0116] According to an embodiment of this application, an apparatus embodiment for implementing the above-described image generation method is also provided. Figure 6 This is a schematic diagram of the structure of an image generation apparatus according to an embodiment of the present invention, such as... Figure 6 As shown, the image generation device includes: an acquisition module 500, a receiving module 502, an extraction module 504, and a generation module 506, wherein,
[0117] The acquisition module 500 is used to acquire road data for generating an electronic map, wherein the road data of the electronic map is vector data; the receiving module 502 is used to receive an image generation instruction, which carries the selected area in the road network; the extraction module 504 is used to extract road data within the selected area from the road data of the electronic map; and the generation module 506 is used to convert the position coordinates in the road data within the selected area into coordinates in a rectangular coordinate system, and generate a road image of the selected area based on the coordinates in the rectangular coordinate system.
[0118] It should be noted that the acquisition module 500, receiving module 502, extraction module 504, and generation module 506 mentioned above correspond to steps S102 to S108 in Embodiment 1. The four modules and their corresponding steps implement the same instances and application scenarios, but are not limited to the content disclosed in the above embodiments. It should also be noted that the above modules, as part of the device, can run in the computer terminal 10 provided in the embodiment.
[0119] Example 4
[0120] According to an embodiment of this application, an embodiment of an electronic device is also provided. Figure 7 This is a schematic diagram of the structure of a computing device according to an embodiment of the present invention, such as... Figure 7 As shown, the computing device includes: a processor 600 and a memory 602, wherein,
[0121] A processor 600 and a memory 602, connected to the processor 600, are configured to provide the processor with instructions to perform the following processing steps: acquiring road data for generating an electronic map, wherein the road data of the electronic map is vector data; receiving an image generation instruction, the image generation instruction carrying a selected area in the road network; extracting road data within the selected area from the road data of the electronic map; converting the position coordinates in the road data within the selected area into coordinates in a Cartesian coordinate system, and generating a road image of the selected area based on the coordinates in the Cartesian coordinate system.
[0122] It is noteworthy that, in this embodiment of the application, there is no need to tile the road vector data. The corresponding vector data can be extracted from the road vector data according to the user's needs (i.e., according to the area range specified by the user), and the extracted vector data can be converted into coordinate information in a rectangular coordinate system to generate map images in the electronic map based on the coordinate information.
[0123] Therefore, the embodiments of this application achieve the goal of generating map images quickly and efficiently based on vector data, thereby realizing the technical effect of improving the generation efficiency of map images, and thus solving the technical problem that the prior art cannot generate map images quickly and efficiently based on vector data.
[0124] Example 5
[0125] According to an embodiment of this application, an embodiment of a computer terminal is also provided. This computer terminal can be any one of a group of computer terminal devices. Optionally, in this embodiment, the aforementioned computer terminal can also be replaced with a mobile terminal or other terminal device.
[0126] Optionally, in this embodiment, the computer terminal may be located in at least one of a plurality of network devices in a computer network.
[0127] In this embodiment, the computer terminal can execute the program code for the following steps in the image generation method: acquiring road data for generating an electronic map, wherein the road data of the electronic map is vector data; receiving an image generation instruction, wherein the image generation instruction carries a selected area in the road network; extracting road data within the selected area from the road data of the electronic map; converting the position coordinates in the road data within the selected area into coordinates in a Cartesian coordinate system, and generating a road image of the selected area based on the coordinates in the Cartesian coordinate system.
[0128] Optionally, Figure 8 This is a structural block diagram of another computer terminal according to an embodiment of this application, such as... Figure 8 As shown, the computer terminal may include: one or more (only one is shown in the figure) processors 702, memory 704, and peripheral interfaces 706.
[0129] The memory can be used to store software programs and modules, such as the program instructions / modules corresponding to the socket power-off control method and device in this embodiment. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory, thereby realizing the aforementioned socket power-off control method. The memory may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory may further include memory remotely located relative to the processor, and these remote memories can be connected to a computer terminal via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0130] The processor can invoke information and application programs stored in memory via a transmission device to perform the following steps: acquiring road data for generating an electronic map, wherein the road data of the electronic map is vector data; receiving an image generation instruction, wherein the image generation instruction carries a selected area in the road network; extracting road data within the selected area from the road data of the electronic map; converting the position coordinates in the road data within the selected area into coordinates in a Cartesian coordinate system, and generating a road image of the selected area based on the coordinates in the Cartesian coordinate system.
[0131] Optionally, the processor may also execute program code that performs the following steps: determining a first reference point in the selected area; using the first reference point as the center of the selected area, determining a target area based on the size information of the selected area; determining an associated area that is related to the target area; and determining road data in the selected area based on the associated area and the road data in the target area.
[0132] Optionally, the processor may also execute program code that performs the following steps: obtaining road topology information of the target area; determining a first type of area with a topological relationship to the target area based on the road topology information; selecting roads with specified road attributes from the first type of area, and using the area with the specified road attributes as the associated area.
[0133] Optionally, the processor may also execute program code that performs the following steps: obtaining location point information corresponding to the road data within the selected area; determining the circumscribed rectangular area of the selected area based on the location point information; constructing a rectangular coordinate system using the vector data of any vertex in any pair of diagonal vertices within the circumscribed rectangular area as the origin; and determining the coordinates of the road data within the selected area in the rectangular coordinate system.
[0134] Optionally, the processor may also execute program code that performs the following steps: grouping the road data of the electronic map according to a preset rule to obtain multiple groups; selecting the group corresponding to the image generation instruction from the multiple groups; and extracting vector data corresponding to the selected area from the selected group to obtain the road data within the selected area.
[0135] Optionally, the processor may also execute program code that performs the following steps: dividing the road data used to generate the electronic map into different sets according to the type of each vector data in the road data, wherein each set corresponds to a region and there is no overlap between the different sets; grouping the different sets according to the association between the different sets to obtain the multiple groups.
[0136] Optionally, the processor may also execute program code that performs the following steps: obtaining the topological relationships of the different sets in the electronic map; and cutting the different sets according to the topological relationships to obtain the multiple groups.
[0137] Optionally, the processor may also execute program code that performs the following steps: obtaining the location information of each vector data in the different sets in the electronic map; selecting at least one reference vector data from each vector data in the different sets; and grouping the different sets based on the location information of the reference vector data in the electronic map and a preset area.
[0138] Optionally, the processor may also execute program code that performs the following steps: receiving instructions from a user; determining the target vector data type based on the instructions; retrieving vector data from the storage location corresponding to the target vector data type to obtain the road data used to generate the electronic map.
[0139] The processor described above can invoke information and application programs stored in the memory via a transmission device to perform the following steps: displaying road data for generating an electronic map in a human-computer interaction interface, wherein the road data of the electronic map is vector data; displaying a received image generation instruction in the human-computer interaction interface, the image generation instruction carrying a selected area in the road network; displaying road data within the selected area extracted from the road data of the electronic map in the human-computer interaction interface; displaying coordinates determined by the following steps in the human-computer interaction interface: converting the position coordinates in the road data within the selected area into coordinates in a rectangular coordinate system; and displaying a road image of the selected area generated based on the coordinates in the rectangular coordinate system in the human-computer interaction interface.
[0140] It is noteworthy that, in this embodiment of the application, there is no need to tile the first vector data. The corresponding second vector data can be extracted from the first vector data according to the user's needs (i.e., according to the image range specified by the user), and the second vector data can be converted into coordinate information in a rectangular coordinate system to generate map images in electronic maps based on the coordinate information.
[0141] Therefore, the embodiments of this application achieve the goal of generating map images quickly and efficiently based on vector data, thereby realizing the technical effect of improving the generation efficiency of map images, and thus solving the technical problem that the prior art cannot generate map images quickly and efficiently based on vector data.
[0142] Those skilled in the art will understand that Figure 8 The structure shown is for illustrative purposes only. The computer terminal can also be a smartphone (such as an Android phone, an iOS phone, etc.), a tablet computer, a mobile internet device (MID), a PAD, and other terminal devices. Figure 8 This does not limit the structure of the aforementioned electronic devices. For example, a computer terminal may also include components that are more... Figure 8 The more or fewer components shown (such as network interfaces, display devices, etc.), or having the same Figure 8 The different configurations shown.
[0143] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be implemented by a program instructing the hardware related to the terminal device. The program can be stored in a computer-readable storage medium, which may include: flash drive, read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.
[0144] Example 6
[0145] According to an embodiment of this application, an embodiment of a storage medium is also provided. Optionally, in this embodiment, the storage medium can be used to store the program code executed by the image generation method provided in the above embodiment.
[0146] Optionally, in this embodiment, the storage medium may be located in any computer terminal in a group of computer terminals in a computer network, or in any mobile terminal in a group of mobile terminals.
[0147] Optionally, in this embodiment, the storage medium is configured to store program code for performing the following steps: acquiring road data for generating an electronic map, wherein the road data of the electronic map is vector data; receiving an image generation instruction, wherein the image generation instruction carries a selected area in the road network; extracting road data within the selected area from the road data of the electronic map; converting the position coordinates in the road data within the selected area into coordinates in a Cartesian coordinate system, and generating a road image of the selected area based on the coordinates in the Cartesian coordinate system.
[0148] Optionally, in this embodiment, the storage medium is configured to store program code for performing the following steps: determining a first reference point in the selected area; using the first reference point as the center of the selected area, determining a target area based on the size information of the selected area; determining an associated area that is related to the target area; and determining road data in the selected area based on the associated area and the road data in the target area.
[0149] Optionally, in this embodiment, the storage medium is configured to store program code for performing the following steps: obtaining road topology information of the target area; determining a first type of area with a topological relationship to the target area based on the road topology information; selecting roads with specified road attributes from the first type of area, and using the area with specified road attributes as the associated area.
[0150] Optionally, in this embodiment, the storage medium is configured to store program code for performing the following steps: obtaining location point information corresponding to the road data within the selected area; determining the circumscribed rectangular area of the selected area based on the location point information; constructing a rectangular coordinate system using the vector data of any one vertex from any pair of diagonal vertices within the circumscribed rectangular area as the origin; and determining the coordinates of the road data within the selected area in the rectangular coordinate system.
[0151] Optionally, in this embodiment, the storage medium is configured to store program code for performing the following steps: grouping the road data of the above-mentioned electronic map according to a preset rule to obtain multiple groups; selecting the group corresponding to the above-mentioned image generation instruction from the multiple groups; and extracting vector data corresponding to the above-mentioned selected area from the selected group to obtain road data information within the above-mentioned selected area.
[0152] Optionally, in this embodiment, the storage medium is configured to store program code for performing the following steps: dividing the road data used to generate the electronic map into different sets according to the type of each vector data in the road data used to generate the electronic map, wherein each set corresponds to a region and there is no overlap between the different sets; grouping the different sets according to the association relationship between the different sets to obtain the multiple groups.
[0153] Optionally, in this embodiment, the storage medium is configured to store program code for performing the following steps: obtaining the topological relationships of the different sets in the electronic map; and cutting the different sets according to the topological relationships to obtain the multiple groups.
[0154] Optionally, in this embodiment, the storage medium is configured to store program code for performing the following steps: obtaining the location information of each vector data in the different sets in the electronic map; selecting at least one reference vector data from each vector data in the different sets; and grouping the different sets based on the location information of the reference vector data in the electronic map and a preset area.
[0155] Optionally, in this embodiment, the storage medium is configured to store program code for performing the following steps: receiving instructions from the user; determining the target vector data type according to the instructions; retrieving vector data from the storage location corresponding to the target vector data type to obtain the road data used to generate the electronic map.
[0156] Optionally, in this embodiment, the storage medium is configured to store program code for performing the following steps: displaying road data for generating an electronic map in a human-computer interaction interface, wherein the road data of the electronic map is vector data; displaying a received image generation instruction in the human-computer interaction interface, the image generation instruction carrying a selected area in the road network; displaying road data within the selected area extracted from the road data of the electronic map in the human-computer interaction interface; displaying coordinates determined by the following steps in the human-computer interaction interface: converting the position coordinates in the road data within the selected area into coordinates in a rectangular coordinate system; and displaying a road image of the selected area generated based on the coordinates in the rectangular coordinate system in the human-computer interaction interface.
[0157] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0158] In the above embodiments of this application, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0159] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual coupling, direct coupling, or communication connection may be through some interfaces; the indirect coupling or communication connection between units or modules may be electrical or other forms.
[0160] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0161] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0162] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard drive, magnetic disk, or optical disk.
[0163] The above description is only a preferred embodiment of this application. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of this application, and these improvements and modifications should also be considered within the scope of protection of this application.
Claims
1. An image generation method, wherein, include: Obtain road data for generating an electronic map, wherein the road data of the electronic map is vector data; Receive an image generation instruction, wherein the image generation instruction carries a selected area in the road network; Extract road data within the selected area from the road data of the electronic map; The location coordinates in the road data within the selected area are converted into coordinates in a Cartesian coordinate system, and a road image of the selected area is generated based on the coordinates in the Cartesian coordinate system. The road image is used for machine learning.
2. The method according to claim 1, wherein, Extracting road data within the selected area from the road data of the electronic map includes: Determine the first reference point in the selected area; Using the first reference point as the center of the selected area, the target area is determined based on the size information of the selected area; Identify associated regions that are related to the target region; The road data within the selected area is determined based on the road data within the associated area and the target area.
3. The method according to claim 2, wherein, Identifying associated regions that are related to the target region includes: Obtain the road topology information of the target area; Based on the road topology information, a first type of region with a topological relationship to the target region is determined; Select roads with specified road attributes from the first type of region, and use the regions with specified road attributes as the associated regions.
4. The method according to claim 3, wherein, The target area includes a designated area in the road network; obtaining the road topology information of the target area includes: determining the roads connected to the road segment where the designated area is located, and using the roads connected to the road segment where the designated area is located as the road topology information.
5. The method according to claim 1, wherein, Converting the location coordinates in the road data within the selected area to coordinates in a Cartesian coordinate system includes: Obtain the location point information corresponding to the road data within the selected area; The bounding rectangle region of the selected area is determined based on the location point information; A rectangular coordinate system is constructed using the vector data of any one vertex from any pair of diagonal vertices in the circumscribed rectangular region as the origin. Determine the coordinates of the road data within the selected area in the Cartesian coordinate system.
6. The method according to claim 1, wherein, Extracting road data within the selected area from the road data of the electronic map includes: The road data of the electronic map is grouped according to preset rules to obtain multiple groups; Select the group corresponding to the image generation instruction from the plurality of groups; and Extract vector data corresponding to the selected area from the selected group to obtain road data within the selected area.
7. The method according to claim 6, wherein, The road data of the electronic map is grouped according to preset rules to obtain multiple groups, including: According to the type of each vector data in the road data used to generate the electronic map, the road data used to generate the electronic map is divided into different sets, wherein each set corresponds to a region, and there is no overlap between the different sets; The different sets are grouped according to the relationships between them, resulting in multiple groups.
8. The method according to claim 7, wherein, The different sets are grouped according to the relationships between them, including: Obtain the topological relationships of the different sets in the electronic map; The different sets are cut according to the topological relationship to obtain the multiple groups.
9. The method according to claim 7, wherein, The different sets are grouped according to the relationships between them, including: Obtain the location information of each vector data in the different sets within the electronic map; Select at least one reference vector data from the various vector data in the different sets; The different sets are grouped based on the location information of the reference vector data on the electronic map and the area of the preset region.
10. The method according to any one of claims 1 to 9, wherein, Obtain road data for generating electronic maps, including: Receive instructions from the user; The target vector data type is determined according to the instructions; Vector data is retrieved from the storage location corresponding to the target vector data type to obtain the road data used to generate the electronic map.
11. An image generation apparatus, wherein, include: The acquisition module is used to acquire road data for generating an electronic map, wherein the road data of the electronic map is vector data; The receiving module is used to receive an image generation instruction, wherein the image generation instruction carries the selected area in the road network; The extraction module is used to extract road data within the selected area from the road data of the electronic map; The generation module is used to convert the location coordinates in the road data within the selected area into coordinates in a Cartesian coordinate system, and generate a road image of the selected area based on the coordinates in the Cartesian coordinate system. The road image is used for machine learning.
12. A computer program product for generating images, wherein, When the program product is run, it executes the image generation method according to any one of claims 1 to 10.
13. A computing device, wherein, include: processor; as well as A memory, connected to the processor, for providing the processor with instructions to perform the following processing steps: Obtain road data for generating an electronic map, wherein the road data of the electronic map is vector data; Receive an image generation instruction, the instruction carrying a selected area in the road network; Extract road data within the selected area from the road data of the electronic map; The location coordinates in the road data within the selected area are converted into coordinates in a Cartesian coordinate system, and a road image of the selected area is generated based on the coordinates in the Cartesian coordinate system. The road image is used for machine learning.