WO2023103980A1 - 三维路径展示方法、装置、可读存储介质及电子设备 - Google Patents
三维路径展示方法、装置、可读存储介质及电子设备 Download PDFInfo
- Publication number
- WO2023103980A1 WO2023103980A1 PCT/CN2022/136643 CN2022136643W WO2023103980A1 WO 2023103980 A1 WO2023103980 A1 WO 2023103980A1 CN 2022136643 W CN2022136643 W CN 2022136643W WO 2023103980 A1 WO2023103980 A1 WO 2023103980A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- path
- dimensional
- preset
- vertices
- area
- Prior art date
Links
- 238000000034 method Methods 0.000 title claims abstract description 59
- 238000005070 sampling Methods 0.000 claims abstract description 121
- 238000013507 mapping Methods 0.000 claims abstract description 39
- 238000004590 computer program Methods 0.000 claims abstract description 26
- 238000003780 insertion Methods 0.000 claims description 2
- 230000037431 insertion Effects 0.000 claims description 2
- 230000000977 initiatory effect Effects 0.000 abstract 1
- 238000010586 diagram Methods 0.000 description 12
- 238000004891 communication Methods 0.000 description 6
- 230000000694 effects Effects 0.000 description 6
- 230000009471 action Effects 0.000 description 4
- 238000012545 processing Methods 0.000 description 4
- 238000005516 engineering process Methods 0.000 description 3
- 230000006870 function Effects 0.000 description 2
- 238000007689 inspection Methods 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 238000007792 addition Methods 0.000 description 1
- 230000003190 augmentative effect Effects 0.000 description 1
- 238000004364 calculation method Methods 0.000 description 1
- 239000004020 conductor Substances 0.000 description 1
- 238000000354 decomposition reaction Methods 0.000 description 1
- 239000000835 fiber Substances 0.000 description 1
- 230000014509 gene expression Effects 0.000 description 1
- 230000007246 mechanism Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 239000013307 optical fiber Substances 0.000 description 1
- 230000000750 progressive effect Effects 0.000 description 1
- 238000005215 recombination Methods 0.000 description 1
- 230000006798 recombination Effects 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 230000000007 visual effect Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G01—MEASURING; TESTING
- G01C—MEASURING DISTANCES, LEVELS OR BEARINGS; SURVEYING; NAVIGATION; GYROSCOPIC INSTRUMENTS; PHOTOGRAMMETRY OR VIDEOGRAMMETRY
- G01C21/00—Navigation; Navigational instruments not provided for in groups G01C1/00 - G01C19/00
- G01C21/005—Navigation; Navigational instruments not provided for in groups G01C1/00 - G01C19/00 with correlation of navigation data from several sources, e.g. map or contour matching
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T17/00—Three dimensional [3D] modelling, e.g. data description of 3D objects
-
- G—PHYSICS
- G01—MEASURING; TESTING
- G01C—MEASURING DISTANCES, LEVELS OR BEARINGS; SURVEYING; NAVIGATION; GYROSCOPIC INSTRUMENTS; PHOTOGRAMMETRY OR VIDEOGRAMMETRY
- G01C21/00—Navigation; Navigational instruments not provided for in groups G01C1/00 - G01C19/00
- G01C21/38—Electronic maps specially adapted for navigation; Updating thereof
- G01C21/3804—Creation or updating of map data
- G01C21/3807—Creation or updating of map data characterised by the type of data
- G01C21/3811—Point data, e.g. Point of Interest [POI]
-
- G—PHYSICS
- G01—MEASURING; TESTING
- G01C—MEASURING DISTANCES, LEVELS OR BEARINGS; SURVEYING; NAVIGATION; GYROSCOPIC INSTRUMENTS; PHOTOGRAMMETRY OR VIDEOGRAMMETRY
- G01C21/00—Navigation; Navigational instruments not provided for in groups G01C1/00 - G01C19/00
- G01C21/20—Instruments for performing navigational calculations
-
- G—PHYSICS
- G01—MEASURING; TESTING
- G01C—MEASURING DISTANCES, LEVELS OR BEARINGS; SURVEYING; NAVIGATION; GYROSCOPIC INSTRUMENTS; PHOTOGRAMMETRY OR VIDEOGRAMMETRY
- G01C21/00—Navigation; Navigational instruments not provided for in groups G01C1/00 - G01C19/00
- G01C21/38—Electronic maps specially adapted for navigation; Updating thereof
- G01C21/3804—Creation or updating of map data
- G01C21/3833—Creation or updating of map data characterised by the source of data
- G01C21/3841—Data obtained from two or more sources, e.g. probe vehicles
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T19/00—Manipulating 3D models or images for computer graphics
- G06T19/006—Mixed reality
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N13/00—Stereoscopic video systems; Multi-view video systems; Details thereof
- H04N13/10—Processing, recording or transmission of stereoscopic or multi-view image signals
- H04N13/106—Processing image signals
- H04N13/15—Processing image signals for colour aspects of image signals
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N13/00—Stereoscopic video systems; Multi-view video systems; Details thereof
- H04N13/20—Image signal generators
- H04N13/275—Image signal generators from 3D object models, e.g. computer-generated stereoscopic image signals
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N13/00—Stereoscopic video systems; Multi-view video systems; Details thereof
- H04N13/30—Image reproducers
- H04N13/324—Colour aspects
Definitions
- the present disclosure relates to the field of computer technology, in particular to a three-dimensional path display method, device, computer-readable storage medium, computer program product and electronic equipment.
- Dynamic path display refers to a technology that displays the path passing through these points in a visual form on the electronic map according to the given starting point information, end point information, and passing point information.
- Embodiments of the present disclosure provide a method and device for displaying a three-dimensional path, a computer-readable storage medium, electronic equipment, and a computer program product.
- An embodiment of the present disclosure provides a method for displaying a three-dimensional path, the method comprising: determining from the target three-dimensional space a first set of sampling points representing the points passed by the three-dimensional path to be generated; based on the first set of sampling points, generating The curve of the generated three-dimensional path; based on the curve, generate a three-dimensional path composed of a path area set; determine the mapping relationship between the vertices in the path area set in the path area set and the pixels in the preset two-dimensional picture; according to the mapping relationship, in Insert pixels included in the corresponding area in the preset two-dimensional image into the path area in the path area set, and initiate display of the three-dimensional path after the pixel is inserted.
- a three-dimensional path display device the device includes: a first determination module, configured to determine from the target three-dimensional space the first sampling point representing the point through which the three-dimensional path to be generated passes Set; the first generation module is used to generate a curve representing the three-dimensional path to be generated based on the first sampling point set; the second generation module is used to generate a three-dimensional path composed of a set of path regions based on the curve; the second determination module , for determining the mapping relationship between the respective vertices of the path areas in the path area set and the pixels in the preset two-dimensional picture; the display module is used for inserting the preset two points into the path areas in the path area set according to the mapping relationship The pixel included in the corresponding area in the dimensional image, and initiate display of the 3D path after the pixel is inserted.
- a computer-readable storage medium stores a computer program, and the computer program is used to execute the above three-dimensional path presentation method.
- an electronic device includes: a processor; a memory for storing instructions executable by the processor; a processor for reading executable instructions from the memory, and The instruction is executed to realize the above three-dimensional path display method.
- a computer program product including computer programs/instructions, and when the computer programs/instructions are executed by a processor, the steps of the above three-dimensional path presentation method are implemented.
- FIG. 1 is a system diagram to which the present disclosure applies.
- Fig. 2 is a schematic flowchart of a three-dimensional path display method provided by an exemplary embodiment of the present disclosure.
- Fig. 3 is a schematic flowchart of a three-dimensional path display method provided by another exemplary embodiment of the present disclosure.
- Fig. 4 is an exemplary schematic diagram of a three-dimensional path composed of triangular meshes provided by another exemplary embodiment of the present disclosure.
- Fig. 5A is an exemplary schematic diagram of a preset two-dimensional picture provided by another exemplary embodiment of the present disclosure.
- Fig. 5B is an exemplary schematic diagram of a three-dimensional path display screen provided by another exemplary embodiment of the present disclosure.
- Fig. 6 is a schematic flowchart of a three-dimensional path display method provided by another exemplary embodiment of the present disclosure.
- Fig. 7 is a schematic structural diagram of a three-dimensional path display device provided by an exemplary embodiment of the present disclosure.
- Fig. 8 is a schematic structural diagram of a three-dimensional path display device provided by another exemplary embodiment of the present disclosure.
- Fig. 9 is a structural diagram of an electronic device provided by an exemplary embodiment of the present disclosure.
- plural may refer to two or more than two, and “at least one” may refer to one, two or more than two.
- the term "and/or" in the present disclosure is only an association relationship describing associated objects, indicating that there may be three relationships, for example, A and/or B may indicate: A exists alone, and A and B exist at the same time , there are three cases of B alone.
- the character "/" in the present disclosure generally indicates that the contextual objects are an "or" relationship.
- the phrase “entity A initiates action B” may mean that entity A issues instructions to perform action B, but entity A does not necessarily perform action B itself.
- the phrase “the display module initiates displaying a three-dimensional path” may mean that the display module causes the display to present a three-dimensional path, and the display module itself does not need to perform the action of "presenting”.
- Embodiments of the present disclosure may be applied to electronic devices such as terminal devices, computer systems, servers, etc., which may operate with numerous other general purpose or special purpose computing system environments or configurations.
- Examples of well known terminal devices, computing systems, environments and/or configurations suitable for use with electronic devices such as terminal devices, computer systems, servers include, but are not limited to: personal computer systems, server computer systems, thin clients, thick client computers, handheld or laptop devices, microprocessor-based systems, set-top boxes, programmable consumer electronics, networked personal computers, minicomputer systems, mainframe computer systems, and distributed cloud computing technology environments including any of the foregoing, among others.
- Electronic devices such as terminal devices, computer systems, servers, etc. may be described in the general context of computer system-executable instructions, such as program modules, being executed by the computer system.
- program modules may include routines, programs, objects, components, logic, data structures, etc., that perform particular tasks or implement particular abstract data types.
- the computer system/server can be practiced in distributed cloud computing environments where tasks are performed by remote processing devices that are linked through a communications network.
- program modules may be located in both local and remote computing system storage media including storage devices.
- Embodiments of the present disclosure aim to solve this problem, that is, according to several three-dimensional points, a three-dimensional path passing through these points can be dynamically drawn.
- FIG. 1 shows an exemplary system architecture 100 of a three-dimensional path presentation method or a three-dimensional path presentation apparatus to which an embodiment of the present disclosure can be applied.
- a system architecture 100 may include a terminal device 101 , a network 102 and a server 103 .
- the network 102 is a medium for providing a communication link between the terminal device 101 and the server 103 .
- Network 102 may include various connection types, such as wires, wireless communication links, or fiber optic cables, among others.
- the user can use the terminal device 101 to interact with the server 103 through the network 102 to receive or send messages and the like.
- Various communication client applications may be installed on the terminal device 101, such as navigation applications, electronic map applications, virtual reality applications, augmented reality applications, web browser applications, instant messaging tools, and the like.
- the terminal device 101 can be various electronic devices, including but not limited to mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle-mounted terminals ( Mobile terminals such as car navigation terminals) and stationary terminals such as digital TVs, desktop computers and the like.
- PDAs personal digital assistants
- PADs tablet computers
- PMPs portable multimedia players
- vehicle-mounted terminals Mobile terminals such as car navigation terminals
- stationary terminals such as digital TVs, desktop computers and the like.
- the server 103 may be a server that provides various services, for example, a background server that supports the 3D scene displayed on the terminal device 101 .
- the background server can use the first set of sampling points to generate a three-dimensional path, and send the three-dimensional path to the terminal device 101, and the terminal device 101 displays the three-dimensional path in the current real three-dimensional scene.
- the three-dimensional path display method provided by the embodiments of the present disclosure may be executed by the server 103 or by the terminal device 101.
- the three-dimensional path display device may be set in the server 103 or in the terminal In the device 101, the three-dimensional path display method can also be jointly executed by the terminal device 101 and the server 103.
- each module included in the three-dimensional path display device can be respectively set in the terminal device 101 and the server 103.
- the numbers of terminal devices, networks and servers in Fig. 1 are only illustrative. According to the implementation needs, there can be any number of terminal devices, networks and servers.
- the above system architecture may not include a network, but only include a server or a terminal device.
- Fig. 2 is a schematic flowchart of a three-dimensional path display method provided by an exemplary embodiment of the present disclosure. This embodiment can be applied to electronic equipment (terminal equipment 101 or server 103 as shown in Figure 1), as shown in Figure 2, the method includes the following steps:
- Step 201 Determine a first set of sampling points representing points passed by a three-dimensional path to be generated from a target three-dimensional space.
- the electronic device may determine from the target three-dimensional space a first set of sampling points representing points passed by the three-dimensional path to be generated.
- the target three-dimensional space may be a three-dimensional space simulated in the above-mentioned electronic device, and the three-dimensional space may correspond to a real three-dimensional space, such as the space in a room, the space corresponding to a certain road section, the space of vehicles, ships, airplanes, etc. Internal space, etc.; the target three-dimensional space may not correspond to the real three-dimensional space, that is, the virtual space.
- the target three-dimensional space is usually represented by a corresponding three-dimensional coordinate system, from which the coordinates of each point in the first set of sampling points can be determined.
- the points in the first sampling point set may be points specified by the user, or points automatically determined by the electronic device according to the specified start point and end point.
- the target three-dimensional space may include preset or user-specified points representing the living room, points representing the bedroom, points representing the bathroom, and the like. Based on these points, the electronic device needs to generate a three-dimensional path from the living room to the bedroom to the bathroom.
- Step 202 Generate a curve representing a three-dimensional path to be generated based on the first set of sampling points.
- the electronic device may generate a curve representing the three-dimensional path to be generated based on the first set of sampling points.
- the electronic device may fit a curve according to the first sampling points included in the first sampling point set as the curve representing the three-dimensional path to be generated.
- the electronic device may use the method CatmullRomCurve3 provided in the existing 3D scene creation engine THREE.js to generate a smooth curve to fit a curve representing the 3D path to be generated.
- Step 203 based on the curve, generate a three-dimensional path composed of a set of path areas.
- the electronic device can generate a three-dimensional path composed of a set of path areas based on the curve.
- the electronic device can extend the curve to both sides or one side of the horizontal plane by a set width to obtain a three-dimensional path, and divide the three-dimensional path into multiple grids or road sections according to the set rules.
- the grid or road segment is the path area.
- the electronic device may generate a three-dimensional path formed by a set of path areas on the curve based on a preset aspect ratio of the two-dimensional picture.
- the path areas in the set of path areas are quadrilateral areas.
- the preset quadrilateral width (ie path width, eg 1 meter) can be multiplied by the preset aspect ratio of the 2D picture to obtain the length of each quadrilateral area (corresponding to the height of the 2D picture). Then divide the above-mentioned curve into multiple line segments with the same length, and then move the end point of each line segment along the side of the normal direction by the same distance as the width of the above path, or move the above-mentioned Half the distance of the path width, and finally connect the moved endpoints to obtain a three-dimensional path composed of multiple quadrangular regions.
- the aspect ratio of each quadrilateral area is the same as that of the preset 2D image, it is possible to quickly determine the quadrilateral area and the preset image when inserting an image into the quadrilateral area.
- the mapping relationship of two-dimensional pictures is set to improve the efficiency of inserting pictures into the quadrilateral area.
- the original proportion of the picture is maintained when inserting pictures into the quadrilateral area, so that the display effect of the three-dimensional path is closer to the real scene.
- Step 204 determining the mapping relationship between the respective vertices of the path areas in the path area set and the pixels in the preset two-dimensional picture.
- the electronic device may determine the mapping relationship between the vertices of the path areas in the path area set and the pixels in the preset two-dimensional picture.
- multiple path areas may respectively correspond to an area in the preset two-dimensional picture (for example, the preset two-dimensional picture is divided into two, each path area corresponds to a part of the preset two-dimensional picture ), according to the positional relationship of multiple path areas, the corresponding part of each path area can be determined in the preset two-dimensional picture, and then the mapping relationship between the vertices of each path area and the pixels in the preset two-dimensional picture can be determined.
- the electronic device may determine the four vertices of each of the path areas in the path area set and the preset two-dimensional picture according to the direction of the curve. The mapping relationship of the corresponding pixels of the four vertices.
- the trend of the curve can be determined according to the starting point and the ending point in the first sampling point set.
- the path area in the path area set may be a rectangular area on a plane, and the aspect ratio of the rectangular area is the same as that of the preset two-dimensional picture.
- the direction of the curve that is, the direction of the three-dimensional path
- the corresponding relationship between the four vertices of the rectangular area and the corresponding pixel points of the four vertices of the preset two-dimensional image can be determined.
- the front side and the back side in the rectangular area corresponds to the upper side of the preset two-dimensional picture
- the back side corresponds to the lower side of the preset two-dimensional picture
- each point in the quadrilateral area can be quickly determined when inserting the preset two-dimensional picture into the quadrilateral area pixels, improving the efficiency of displaying 3D paths.
- Step 205 insert pixels included in corresponding areas in the preset two-dimensional picture into the route areas in the route area set, and display the 3D route after the pixels are inserted.
- the electronic device may insert pixels included in corresponding regions in the preset two-dimensional picture into the path regions in the path region set according to the mapping relationship, and display the three-dimensional path after the pixels are inserted.
- the image area corresponding to the path area can be determined in the preset two-dimensional image, and the image area can be the entire area of the preset two-dimensional image, or it can be a part area, and then the image area may be scaled, and pixels included in the scaled image area may be inserted into the path area.
- the image area can be the entire area of the preset two-dimensional image, or it can be a part area, and then the image area may be scaled, and pixels included in the scaled image area may be inserted into the path area.
- the first sampling point set is determined from the target 3D space, and based on the first sampling point set, a curve representing the 3D path to be generated is generated, and then based on the curve, the resulting path is generated.
- the three-dimensional path formed by the area set and then determine the mapping relationship between the vertices included in each path area and the pixels in the preset two-dimensional picture, and finally according to the mapping relationship, insert the corresponding pixel in the path area in the path area set, and Display the 3D path after inserting the pixels, thereby realizing the dynamic generation and display of the 3D path in the 3D scene.
- the embodiments of the present disclosure can greatly improve the efficiency of generating the 3D path, and can provide users with Display the 3D path in real time to improve the efficiency and accuracy of path display.
- step 203 may include the following substeps:
- Step 2031 determine a second set of sampling points from the curve.
- the second set of sampling points can be determined from the curve according to a preset sampling interval (for example, 1 meter).
- Step 2032 for the second sampling point in the second sampling point set, determine the normal direction of the second sampling point; based on the normal direction, determine the position of the path boundary point corresponding to the second sampling point.
- the number of path boundary points corresponding to the second sampling point may be one or two.
- the position of the path boundary point can be determined according to the set path width. For example, when the second sampling point corresponds to a path boundary point, a point whose distance from the second sampling point is the above-mentioned path width in the normal direction of the second sampling point may be determined as the path boundary point.
- the second sampling points include P0 , P1 , P2 , . . . . Path boundary points include, I0, I1, I2, I3, . . . l represents the generated curve.
- the second sampling point P0 corresponds to the path boundary points I0 and I1, and I0 and I1 are respectively located in the normal direction and the opposite direction of the normal line of P0. The relationship between other second sampling points and the path boundary points is shown in the figure.
- Step 2033 based on the obtained route boundary points, generate a three-dimensional route composed of a set of route regions.
- each path boundary point can be connected in the manner shown in FIG. 4 , and the generated path area is a triangle, thereby obtaining a three-dimensional path composed of a triangular mesh.
- the path boundary points located on both sides of the second sampling point as shown in FIG. 4 may be connected to obtain a three-dimensional path composed of rectangular grids.
- the path boundary point corresponding to each second sampling point is determined based on the normal direction of each second sampling point, and a three-dimensional path is generated according to the path boundary point, so that the generated three-dimensional path is closer to the real path.
- the path boundary points can make the corresponding relationship between the obtained path area and the preset two-dimensional picture more clear, and help to improve the efficiency and accuracy of mapping to the path area.
- step 2033 may be performed as follows:
- a triangular mesh is generated as a path area, and a three-dimensional path composed of a set of triangular meshes is obtained.
- the area between adjacent second sampling points in the three-dimensional path is composed of two triangular meshes with common vertices.
- P0 and P1 are adjacent second sampling points
- the rectangular area between P0 and P1 is composed of triangle A (vertex is I0, I1, I3) and triangle B (vertex is I2, I3, I0) Composition
- points I0 and I3 are common vertices.
- i be the index of the second sampling point, for example, the index of P0 is 0, and the index of P1 is 1.
- the two triangles between adjacent second sampling points can be expressed as i*2+0, i*2+1, i*2+3, and i*2+2, i*2+3, i* 2+0.
- N triangles since there are common vertices, only 2N points are needed to describe them.
- the electronic device may determine the position of the path boundary point corresponding to the second sampling point according to the following steps:
- the path width corresponding to the second sampling point is determined.
- the above-mentioned preset two-dimensional picture is the same picture as the preset two-dimensional picture in step 204 .
- the preset aspect ratio of the two-dimensional picture is r
- the distance between adjacent second sampling points is set as D
- the path width is r*D.
- the position of the path boundary point corresponding to the second sampling point is determined.
- a path boundary point may be determined in the normal direction, and the distance between the path boundary point and the second sampling point is the aforementioned path width.
- the path width is determined based on the aspect ratio of the preset two-dimensional picture, so that the rectangular area between two adjacent second sampling points is in the same proportion as the preset two-dimensional picture, so that the texture in the path area , keep the original ratio of the inserted preset 2D picture, so that the display effect of the 3D path can better match the real 3D scene.
- the rectangular area is in the three-dimensional space, and the proportion of the rectangular area and the preset two-dimensional picture is also the effect in the three-dimensional space.
- the three-dimensional path since the display window is two-dimensional, the three-dimensional path The appearance of the displayed texture when mapped to the display window is not to scale with the preset 2D image. As shown in FIG. 5A , it shows a preset 2D picture with a square shape.
- the preset 2D picture inserted in the 3D path has a 3D display effect.
- the electronic device may determine the position of the path boundary point corresponding to the second sampling point according to the following steps based on the path width and the normal direction:
- two path boundary points at the same distance from the second sampling point are respectively determined in the normal direction and the opposite direction of the normal line of the second sampling point.
- W represents the path width
- the path boundary point I0 is located in the normal direction of P0
- the path boundary point I1 is located in the opposite direction of the normal line of P0 .
- the distances from the second sampling point P0 are both W/2.
- path boundary points that are equal in distance to the second sampling point are respectively set in the normal direction of the second sampling point and in the opposite direction of the normal line. It can make the 3D path better match the generated curve and improve the accuracy of generating the 3D path.
- step 205 may include the following substeps:
- Step 2051 for the path area in the path area set, respectively map the vertices of the path area to the vertices of the preset two-dimensional picture.
- the uv attribute means that the horizontal direction of the preset two-dimensional picture is represented by the u coordinate, and the vertical direction is represented by the v coordinate. As shown in FIG. If uv is (1, 1), it will be mapped to the upper right corner of the preset two-dimensional image.
- the distance between each second sampling point and the starting point of the three-dimensional path and the distance D between two adjacent second sampling points can be subjected to a modulo calculation to determine the corresponding vertex u-coordinate.
- the distance between this point and the starting point is D
- the uv coordinates corresponding to vertices I2, I3, and I5 are (0, 1), (0, 0), (1, 0)
- the uv coordinates corresponding to vertices I4, I5, and I2 are (1, 1), (1, 0), (0, 1) respectively.
- Step 2052 based on the corresponding relationship between the vertices of the path region and the vertices of the preset two-dimensional picture, determine the color value of the pixel where the point in the path region is inserted.
- the corresponding area of the path area and the preset two-dimensional picture may be determined, so that pixels may be inserted into the path area.
- Step 2053 based on the determined color value, insert corresponding pixels in the path area.
- the two-dimensional picture is accurately filled into the three-dimensional path, Improve the accuracy of displaying 3D paths.
- Fig. 7 is a schematic structural diagram of a three-dimensional path display device provided by an exemplary embodiment of the present disclosure. This embodiment can be applied to electronic equipment. As shown in FIG. 7, the three-dimensional path display device includes: a first determination module 701, which is used to determine from the target three-dimensional space the first sampling point representing the point through which the three-dimensional path to be generated passes.
- a first determination module 701 which is used to determine from the target three-dimensional space the first sampling point representing the point through which the three-dimensional path to be generated passes.
- the first generation module 702 is used to generate a curve representing the three-dimensional path to be generated based on the first sampling point set;
- the second generation module 703 is used to generate a three-dimensional path composed of a path area set based on the curve;
- the second The determining module 704 is used to determine the mapping relationship between the respective vertices of the path areas in the path area set and the pixels in the preset two-dimensional picture;
- the display module 705 is used to display in the path areas in the path area set according to the mapping relationship Insert the pixels included in the corresponding area in the preset 2D image, and display the 3D path after the pixels are inserted.
- the first determination module 701 may determine from the target three-dimensional space a first set of sampling points representing points passed by the three-dimensional path to be generated.
- the target three-dimensional space may be a three-dimensional space simulated in the above-mentioned device, and the three-dimensional space may correspond to a real three-dimensional space, such as the space in a room, the space corresponding to a certain road section, the interior of vehicles, ships, airplanes, etc. Space, etc.; the target three-dimensional space may not correspond to the real three-dimensional space, that is, the virtual space.
- the target three-dimensional space is usually represented by a corresponding three-dimensional coordinate system, from which the coordinates of each point in the first set of sampling points can be determined.
- the points in the first set of sampling points may be points specified by the user, or points automatically determined by the first determination module 701 according to the specified start point and end point.
- the target three-dimensional space may include preset or user-specified points representing the living room, points representing the bedroom, points representing the bathroom, and the like.
- the first determination module 701 needs to generate a three-dimensional path from the living room to the bedroom and then to the bathroom according to these points.
- the first generation module 702 may generate a curve representing the three-dimensional path to be generated based on the first set of sampling points. In an example, the first generating module 702 may fit a curve according to the first sampling points included in the first sampling point set as the curve representing the three-dimensional path to be generated. As an example, the first generation module 702 may use the method CatmullRomCurve3 provided in the existing 3D scene creation engine THREE.js to generate a smooth curve to fit a curve representing the 3D path to be generated.
- the second generation module 703 may generate a three-dimensional path composed of a set of path areas based on the curve.
- the second generation module 703 may extend the curve along the horizontal plane to both sides or one side by a set width to obtain a three-dimensional path, and divide the three-dimensional path into multiple grids or multiple road sections according to set rules, Each grid or road segment is a route area.
- the second determination module 704 may determine the mapping relationship between the vertices of the path areas in the path area set and the pixels in the preset two-dimensional picture.
- the path area in the path area set may be a rectangular area on a plane, and the aspect ratio of the rectangular area is the same as that of the preset two-dimensional picture. According to the direction of the three-dimensional path, the corresponding relationship between the four vertices of the rectangular area and the corresponding pixel points of the four vertices of the preset two-dimensional image can be determined.
- the front side and the back side in the rectangular area corresponds to the upper side of the preset two-dimensional picture
- the back side corresponds to the lower side of the preset two-dimensional picture
- determine the apex of the rectangular area and the preset three-dimensional picture The corresponding relationship between the corresponding pixels of the vertices.
- multiple path areas may respectively correspond to an area in the preset two-dimensional picture (for example, the preset two-dimensional picture is divided into two, each path area corresponds to a part of the preset two-dimensional picture ), according to the positional relationship of multiple path areas, the corresponding part of each path area can be determined in the preset two-dimensional picture, and then the mapping relationship between the vertices of each path area and the pixels in the preset two-dimensional picture can be determined.
- the presentation module 705 may insert pixels included in corresponding areas in the preset two-dimensional picture into the path areas in the path area set according to the mapping relationship, and display the three-dimensional path after the pixels are inserted.
- the image area corresponding to the path area can be determined in the preset two-dimensional image, and the image area can be the entire area of the preset two-dimensional image, or it can be a part area, and then the image area may be scaled, and pixels included in the scaled image area may be inserted into the path area.
- the image area can be the entire area of the preset two-dimensional image, or it can be a part area, and then the image area may be scaled, and pixels included in the scaled image area may be inserted into the path area.
- FIG. 8 is a schematic structural diagram of a three-dimensional path display device provided by another exemplary embodiment of the present disclosure.
- the second generating module 703 includes: a first determining unit 7031, configured to determine a second sampling point set from the curve; a second determining unit 7032, configured to determine the second sampling point set in the second sampling point set The sampling point is used to determine the normal direction of the second sampling point; based on the normal direction, the position of the path boundary point corresponding to the second sampling point is determined; the generation unit 7033 is used to generate the path defined by the path based on each obtained path boundary point. A 3D path formed by a collection of regions.
- the generation unit 7033 is further configured to: generate triangular meshes as the path area based on the obtained path boundary points, and obtain a three-dimensional path composed of a set of triangular meshes, wherein the adjacent third in the three-dimensional path The area between two sampling points is composed of two triangular meshes with common vertices.
- the second determining unit 7032 includes: a first determining subunit 70321 configured to preset the aspect ratio of the two-dimensional picture and the distance between adjacent second sampling points in the second sampling point set to determine the path width corresponding to the second sampling point; the second determining subunit 70322 is configured to determine the position of the path boundary point corresponding to the second sampling point based on the path width and the normal direction.
- the second determining subunit 70322 is further configured to: based on the path width, determine two paths with the same distance from the second sampling point in the normal direction and the opposite direction of the normal direction of the second sampling point, respectively. path boundary points.
- the second generation module 703 may be further configured to: generate a three-dimensional path composed of a set of path areas on the curve based on the preset aspect ratio of the two-dimensional picture, wherein the path area The path areas in the collection are quadrilateral areas.
- the second determination module 704 may be further configured to: determine the four vertices of each of the quadrangular path areas in the path area set and the preset two-dimensional The mapping relationship between the corresponding pixels of the four vertices of the picture.
- the presentation module 705 includes: a mapping unit 7051, configured to map the vertices of the path area to the vertices of the preset two-dimensional picture for the path area in the path area set; the third determining unit 7052, It is used to determine the color value of the pixel inserted by the point in the path area based on the corresponding relationship between the vertex of the path area and the vertex of the preset two-dimensional picture; the insertion unit 7053 is used to determine the color value of the pixel on the path based on the determined color value. Insert the corresponding pixels in the region.
- a mapping unit 7051 configured to map the vertices of the path area to the vertices of the preset two-dimensional picture for the path area in the path area set
- the third determining unit 7052 It is used to determine the color value of the pixel inserted by the point in the path area based on the corresponding relationship between the vertex of the path area and the vertex of the preset two-dimensional picture
- the insertion unit 7053 is used
- the three-dimensional path display device determines the first set of sampling points from the target three-dimensional space, and generates a curve representing the three-dimensional path to be generated based on the first set of sampling points, and then generates a path based on the curve
- the three-dimensional path formed by the area set, and then determine the mapping relationship between the vertices included in each path area and the pixels in the preset two-dimensional picture, and finally according to the mapping relationship, insert the corresponding pixel in the path area in the path area set, and Display the 3D path after inserting the pixels, thereby realizing the dynamic generation and display of the 3D path in the 3D scene.
- the embodiments of the present disclosure can greatly improve the efficiency of generating the 3D path, and can provide users with Display the 3D path in real time to improve the efficiency and accuracy of path display.
- the electronic device may be either or both of the terminal device 101 and the server 103 shown in FIG. 1 , or a stand-alone device independent of them. Receive the acquired input signal.
- FIG. 9 illustrates a block diagram of an electronic device according to an embodiment of the present disclosure.
- an electronic device 900 includes one or more processors 901 and a memory 902 .
- the processor 901 may be a central processing unit (CPU) or other form of processing unit having data processing capabilities and/or instruction execution capabilities, and may control other components in the electronic device 900 to perform desired functions.
- CPU central processing unit
- the processor 901 may be a central processing unit (CPU) or other form of processing unit having data processing capabilities and/or instruction execution capabilities, and may control other components in the electronic device 900 to perform desired functions.
- Memory 902 may include one or more computer program products, which may include various forms of computer-readable storage media, such as volatile memory and/or non-volatile memory.
- the volatile memory may include random access memory (RAM) and/or cache memory (cache), etc., for example.
- Non-volatile memory may include, for example, read-only memory (ROM), hard disk, flash memory, and the like.
- One or more computer program instructions may be stored on the computer-readable storage medium, and the processor 901 may execute the program instructions to implement the above three-dimensional path display method and/or other desired functions in various embodiments of the present disclosure.
- Various contents such as the first set of sampling points and the second set of sampling points may also be stored in the computer-readable storage medium.
- the electronic device 900 may further include: an input device 903 and an output device 904, and these components are interconnected through a bus system and/or other forms of connection mechanisms (not shown).
- the input device 903 may be a camera, a mouse, a keyboard and other devices for inputting three-dimensional space data, a set of sampling points, and the like.
- the input device 903 may be a communication network connector for receiving input 3D spatial data, sampling point sets, etc. from the terminal device 101 and the server 103 .
- the output device 904 can output various information to the outside, including the three-dimensional path.
- the output device 904 may include, for example, a display, a speaker, a printer, a communication network and its connected remote output devices, and the like.
- the electronic device 900 may further include any other appropriate components.
- embodiments of the present disclosure may also be computer program products, which include computer program instructions that, when executed by a processor, cause the processor to perform the above-mentioned "exemplary method" of this specification. Steps in the three-dimensional path presentation method according to various embodiments of the present disclosure described in the section.
- the computer program product can be written in any combination of one or more programming languages to execute the program codes for performing the operations of the embodiments of the present disclosure, and the programming languages include object-oriented programming languages, such as Java, C++, etc. , also includes conventional procedural programming languages, such as the "C" language or similar programming languages.
- the program code may execute entirely on the user's computing device, partly on the user's device, as a stand-alone software package, partly on the user's computing device and partly on a remote computing device, or entirely on the remote computing device or server to execute.
- embodiments of the present disclosure may also be a computer-readable storage medium, on which computer program instructions are stored, and the computer program instructions, when executed by a processor, cause the processor to execute the above-mentioned "Exemplary Method" section of this specification.
- the computer readable storage medium may employ any combination of one or more readable media.
- the readable medium may be a readable signal medium or a readable storage medium.
- the readable storage medium may include, but not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or devices, or any combination thereof. More specific examples (non-exhaustive list) of readable storage media include: electrical connection with one or more conductors, portable disk, hard disk, random access memory (RAM), read only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
- An embodiment of the present disclosure also provides a computer program product, including computer programs/instructions.
- the computer programs/instructions are executed by a processor, the method for displaying a three-dimensional path in any of the foregoing possible implementation manners can be implemented.
- the computer program product can be specifically realized by means of hardware, software or a combination thereof.
- the computer program product is embodied as a computer storage medium, and in another optional example, the computer program product is embodied as a software product, such as a software development kit (Software Development Kit, SDK) and the like.
- the methods and apparatus of the present disclosure may be implemented in many ways.
- the methods and apparatuses of the present disclosure may be implemented by software, hardware, firmware or any combination of software, hardware, and firmware.
- the above sequence of steps for the method is for illustration only, and the steps of the method of the present disclosure are not limited to the sequence specifically described above unless specifically stated otherwise.
- the present disclosure can also be implemented as programs recorded in recording media, the programs including machine-readable instructions for realizing the method according to the present disclosure.
- the present disclosure also covers a recording medium storing a program for executing the method according to the present disclosure.
- each component or each step can be decomposed and/or reassembled. These decompositions and/or recombinations should be considered equivalents of the present disclosure.
Landscapes
- Engineering & Computer Science (AREA)
- Remote Sensing (AREA)
- Radar, Positioning & Navigation (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Automation & Control Theory (AREA)
- Signal Processing (AREA)
- Multimedia (AREA)
- Theoretical Computer Science (AREA)
- Software Systems (AREA)
- Computer Graphics (AREA)
- General Engineering & Computer Science (AREA)
- Computer Hardware Design (AREA)
- Geometry (AREA)
- Processing Or Creating Images (AREA)
Abstract
一种三维路径展示方法、装置、计算机可读存储介质、电子设备及计算机程序产品。该方法包括:从目标三维空间中确定表示待生成的三维路径经过的点的第一采样点集合;基于第一采样点集合,生成表示待生成的三维路径的曲线;基于曲线,生成由路径区域集合构成的三维路径;确定路径区域集合中的路径区域各自的顶点与预设二维图片中的像素点的映射关系;根据映射关系,在路径区域集合中的路径区域内插入对应的像素,并发起展示插入像素后的三维路径。
Description
相关申请的交叉引用
本申请要求2021年12月07日提交的中国专利申请第202111486747.9号的优先权,其内容通过引用的方式整体并入本文。
本公开涉及计算机技术领域,尤其是一种三维路径展示方法、装置、计算机可读存储介质、计算机程序产品及电子设备。
动态路径展示,是指根据给定的起点信息、终点信息、途经点信息等,将经过这些点的路径在电子地图上以可视化的形式进行展示的一种技术。
现有技术方案,想要绘制一条动态路径,一般是借助SVG(可缩放矢量图形,Scalable Vector Graphics)图形,比如用贝塞尔曲线描述一个线条路径之后设置线条宽度就可以画出一个二维的路径形状。但是在三维路径展示中,目前没有绘制形状的成熟方案,通常需要手动绘制图形。
发明内容
本公开的实施例提供了一种三维路径展示方法、装置、计算机可读存储介质、电子设备及计算机程序产品。
本公开的实施例提供了一种三维路径展示方法,该方法包括:从目标三维空间中确定表示待生成的三维路径经过的点的第一采样点集合;基于第一采样点集合,生成表示待生成的三维路径的曲线;基于曲线,生成由路径区域集合构成的三维路径;确定路径区域集合中的路径区域各自的顶点与预设二维图片中的像素点的映射关系;根据映射关系,在路径区域集合中的路径区域内插入预设二维图片中的对应区域包括的像素,并发起展示插入像素后的三维路径。
根据本公开实施例的另一个方面,提供了一种三维路径展示装置,该装置包括:第一确定模块,用于从目标三维空间中确定表示待生成的三维路径经过的点的第一采样点集合;第一生成模块,用于基于第一采样点集合,生成表示待生成的三维路径的曲线;第二生成模块,用于基于曲线,生成由路径区域集合构成的三维路径;第二确定模块,用于确定路径区域集合中的路径区域各自的顶点与预设二维图片中的像素点的映射关系;展示模块,用于根据映射关系,在路径区域集合中的路径区域内插入预设二维图片中的对应区域包括的像素,并发起展示插入像素后的三维路径。
根据本公开实施例的另一个方面,提供了一种计算机可读存储介质,计算机可读存储介质存储有计算机程序,计算机程序用于执行上述三维路径展示方法。
根据本公开实施例的另一个方面,提供了一种电子设备,电子设备包括:处理器;用于存储处理器可执行指令的存储器;处理器,用于从存储器中读取可执行指令,并执行指令以实现上述三维路径展示方法。
根据本公开实施例的另一个方面,提供了一种计算机程序产品,包括计算机程序/指令,计算机程序/指令被处理器执行时实现上述三维路径展示方法的步骤。
下面通过附图和实施例,对本公开的技术方案做进一步的详细描述。
通过结合附图对本公开实施例进行更详细的描述,本公开的上述以及其他目的、特征和优势将变得更加明显。附图用来提供对本公开实施例的进一步理解,并且构成说明书的一部分,与本公开实施例一起用于解释本公开,并不构成对本公开的限制。在附图中,相同的参考标号通常代表相同部件或步骤。
图1是本公开所适用的系统图。
图2是本公开一示例性实施例提供的三维路径展示方法的流程示意图。
图3是本公开另一示例性实施例提供的三维路径展示方法的流程示意图。
图4是本公开另一示例性实施例提供的由三角形网格构成的三维路径的示例性示意图。
图5A是本公开另一示例性实施例提供的预设二维图片的示例性示意图。
图5B是本公开另一示例性实施例提供的三维路径展示画面的示例性示意图。
图6是本公开另一示例性实施例提供的三维路径展示方法的流程示意图。
图7是本公开一示例性实施例提供的三维路径展示装置的结构示意图。
图8是本公开另一示例性实施例提供的三维路径展示装置的结构示意图。
图9是本公开一示例性实施例提供的电子设备的结构图。
下面,将参考附图详细地描述根据本公开的示例实施例。显然,所描述的实施例仅仅是本公开的一部分实施例,而不是本公开的全部实施例,应理解,本公开不受这里描述的示例实施例的限制。
应注意到:除非另外具体说明,否则在这些实施例中阐述的部件和步骤的相对布置、数字表达式和数值不限制本公开的范围。
本领域技术人员可以理解,本公开实施例中的“第一”、“第二”等术语仅用于区别不同步骤、设备或模块等,既不代表任何特定技术含义,也不表示它们之间的必然逻辑顺序。
还应理解,在本公开实施例中,“多个”可以指两个或两个以上,“至少一个”可以指一个、两个或两个以上。
还应理解,对于本公开实施例中提及的任一部件、数据或结构,在没有明确限定或者在前后文给出相反启示的情况下,一般可以理解为一个或多个。
另外,本公开中术语“和/或”,仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A, 同时存在A和B,单独存在B这三种情况。另外,本公开中字符“/”,一般表示前后关联对象是一种“或”的关系。
如本文使用的,短语“实体A发起动作B”可以是指实体A发出执行动作B的指令,但实体A本身并不一定执行该动作B。例如,短语“展示模块发起展示三维路径”可以是指展示模块使显示器呈现三维路径,而展示模块本身不需要执行“呈现”的动作。
还应理解,本公开对各个实施例的描述着重强调各个实施例之间的不同之处,其相同或相似之处可以相互参考,为了简洁,不再一一赘述。
同时,应当明白,为了便于描述,附图中所示出的各个部分的尺寸并不是按照实际的比例关系绘制的。
以下对至少一个示例性实施例的描述实际上仅仅是说明性的,决不作为对本公开及其应用或使用的任何限制。
对于相关领域普通技术人员已知的技术、方法和设备可能不作详细讨论,但在适当情况下,所述技术、方法和设备应当被视为说明书的一部分。
应注意到:相似的标号和字母在下面的附图中表示类似项,因此,一旦某一项在一个附图中被定义,则在随后的附图中不需要对其进行进一步讨论。
本公开实施例可以应用于终端设备、计算机系统、服务器等电子设备,其可与众多其它通用或专用计算系统环境或配置一起操作。适于与终端设备、计算机系统、服务器等电子设备一起使用的众所周知的终端设备、计算系统、环境和/或配置的例子包括但不限于:个人计算机系统、服务器计算机系统、瘦客户机、厚客户机、手持或膝上设备、基于微处理器的系统、机顶盒、可编程消费电子产品、网络个人电脑、小型计算机系统、大型计算机系统和包括上述任何系统的分布式云计算技术环境,等等。
终端设备、计算机系统、服务器等电子设备可以在由计算机系统执行的计算机系统可执行指令(诸如程序模块)的一般语境下描述。通常,程序模块可以包括例程、程序、目标程序、组件、逻辑、数据结构等等,它们执行特定的任务或者实现特定的抽象数据类型。计算机系统/服务器可以 在分布式云计算环境中实施,分布式云计算环境中,任务是由通过通信网络链接的远程处理设备执行的。在分布式云计算环境中,程序模块可以位于包括存储设备的本地或远程计算系统存储介质上。
申请概述
目前,在三维路径展示领域,没有绘制形状的成熟方案,必须手动绘制图形。造成三维路径展示的效率较低,无法实现实时、动态地路径展示。本公开实施例旨在解决这个问题,即可以根据几个三维点,动态绘制出一条经过这些点的三维路径。
示例性系统
图1示出了可以应用本公开的实施例的三维路径展示方法或三维路径展示装置的示例性系统架构100。
如图1所示,系统架构100可以包括终端设备101,网络102和服务器103。网络102用于在终端设备101和服务器103之间提供通信链路的介质。网络102可以包括各种连接类型,例如有线、无线通信链路或者光纤电缆等等。
用户可以使用终端设备101通过网络102与服务器103交互,以接收或发送消息等。终端设备101上可以安装有各种通讯客户端应用,例如导航类应用、电子地图应用、虚拟现实应用、增强现实应用、网页浏览器应用、即时通信工具等。
终端设备101可以是各种电子设备,包括但不限于诸如移动电话、笔记本电脑、数字广播接收器、PDA(个人数字助理)、PAD(平板电脑)、PMP(便携式多媒体播放器)、车载终端(例如车载导航终端)等等的移动终端以及诸如数字TV、台式计算机等等的固定终端。
服务器103可以是提供各种服务的服务器,例如对终端设备101上展示的三维场景提供支持的后台服务器。后台服务器可以利用第一采样点集合生成三维路径,并将三维路径发送到终端设备101,终端设备101将三维路径展示在当前现实的三维场景中。
需要说明的是,本公开的实施例所提供的三维路径展示方法可以由服务器103执行,也可以由终端设备101执行,相应地,三维路径展示 装置可以设置于服务器103中,也可以设置于终端设备101中;三维路径展示方法还可以由终端设备101和服务器103联合执行,相应地,三维路径展示装置包括的各模块可以分别设置在终端设备101和服务器103中。
应该理解,图1中的终端设备、网络和服务器的数目仅仅是示意性的。根据实现需要,可以具有任意数目的终端设备、网络和服务器。例如,在表示三维空间的数据、第一采样点集合等数据不需要从远程获取的情况下,上述系统架构可以不包括网络,只包括服务器或终端设备。
示例性方法
图2是本公开一示例性实施例提供的三维路径展示方法的流程示意图。本实施例可应用在电子设备(如图1所示的终端设备101或服务器103)上,如图2所示,该方法包括如下步骤:
步骤201,从目标三维空间中确定表示待生成的三维路径经过的点的第一采样点集合。
在一些实施例中,电子设备可以从目标三维空间中确定表示待生成的三维路径经过的点的第一采样点集合。其中,目标三维空间可以是在上述电子设备中模拟的三维空间,该三维空间可以对应于真实的三维空间,例如房间内的空间、某个路段对应的空间、车、船、飞机等交通工具的内部空间等;目标三维空间也可以不对应于真实的三维空间,即虚拟空间。目标三维空间通常由对应的三维坐标系表示,从该三维坐标系内可以确定第一采样点集合中的每个点的坐标。
第一采样点集合中的点可以是由用户指定的点,也可以是电子设备根据指定的起点和终点自动确定的点。作为示例,在VR(虚拟现实,Virtual Reality)看房的场景中,目标三维空间内可以包括预先设置的或用户指定的表示客厅的点、表示卧室的点、表示卫生间的点等。电子设备需要根据这些点生成一条从客厅到卧室再到卫生间的三维路径。
步骤202,基于第一采样点集合,生成表示待生成的三维路径的曲线。
在一些实施例中,电子设备可以基于第一采样点集合,生成表示待生成的三维路径的曲线。在示例中,电子设备可以根据第一采样点集合包括的第一采样点,拟合出一条曲线作为表示待生成的三维路径的曲线。作为示例,电子设备可以利用现有的三维场景创建引擎THREE.js中提供的生成圆滑曲线的方法CatmullRomCurve3,拟合出一条表示待生成的三维路径的曲线。
步骤203,基于曲线,生成由路径区域集合构成的三维路径。
在一些实施例中,电子设备可以基于曲线,生成由路径区域集合构成的三维路径。
作为示例,电子设备可以将曲线沿水平面向两侧或一侧扩展设定的宽度,从而得到三维路径,并按照设定的规则将三维路径划分为多个网格或多个路段,每个网格或路段即为路径区域。
在示例中,电子设备可以基于预设二维图片的宽高比,在所述曲线上,生成由路径区域集合构成的三维路径。其中,所述路径区域集合中的路径区域为四边形区域。
在示例中,可以将预设的四边形宽度(即路径宽度。例如1米)与预设二维图片的宽高比相乘,得到每个四边形区域的长度(对应二维图片的高度)。进而将上述曲线划分为多条长度相同的线段,然后将每条线段的端点沿法线方向一侧移动与上述路径宽度相同的距离,或沿法线方向和法线反方向两侧分别移动上述路径宽度一半的距离,最后连接移动后的端点,从而得到由多个四边形区域组成的三维路径。
通过生成由多个四边形区域组成的三维路径,且每个四边形区域的宽高比与预设二维图片的宽高比相同,可以使得在后续向四边形区域插入图像时,快速确定四边形区域与预设二维图片的映射关系,提高向四边形区域插入图片的效率,同时向四边形区域插入图片时保持图片的原比例,使三维路径的显示效果更接近真实场景。
步骤204,确定路径区域集合中的路径区域各自的顶点与预设二维图片中的像素点的映射关系。
在一些实施例中,电子设备可以确定路径区域集合中的路径区域各自的顶点与预设二维图片中的像素点的映射关系。
再例如,多个路径区域(例如两个)可以分别对应预设二维图片中的一个区域(例如将预设二维图片一分为二,每个路径区域对应预设二维图片的一个部分),根据多个路径区域的位置关系,可以在预设二维图片中确定每个路径区域对应的部分,进而确定每个路径区域的顶点与预设二维图片中的像素点的映射关系。
在示例中,当路径区域集合中的路径区域为四边形时,电子设备可以根据所述曲线的走向,确定所述路径区域集合中的路径区域各自的四个顶点与所述预设二维图片的四个顶点的对应像素点的映射关系。
其中,曲线的走向可以根据第一采样点集合中的起始点和终止点确定。作为示例,路径区域集合中的路径区域可以为处于一个平面上的矩形区域,该矩形区域的宽高比与预设二维图片的宽高比相同。根据曲线的走向(即三维路径的走向),可以确定矩形区域的四个顶点与预设二维图片的四个顶点的对应像素点的对应关系。例如,根据曲线的延伸方向确定矩形区域中的在前边和在后边,在前边对应预设二维图片的上边,在后边对应预设二维图片的下边,进而确定矩形区域的顶点与预设二维图片的顶点的对应像素点的对应关系。
后续在向各个四边形区域插入像素时,可以根据四边形的顶点与预设二维图片的顶点的映射关系,确定四边形区域中的每个点与预设二维图片中的像素点的对应关系,从而完成向四边形区域中插入二维图片。
通过确定四边形区域的四个顶点与所述预设二维图片的四个顶点的对应像素点的映射关系,可以在向四边形区域插入预设二维图片时,快速确定四边形区域中的每个点的像素,提高展示三维路径的效率。
步骤205,根据映射关系,在路径区域集合中的路径区域内插入预设二维图片中的对应区域包括的像素,并展示插入像素后的三维路径。
在一些实施例中,电子设备可以根据映射关系,在路径区域集合中的路径区域内插入预设二维图片中的对应区域包括的像素,并展示插入像素后的三维路径。
在示例中,在确定了路径区域的顶点对应的像素点后,可以在预设二维图片中确定路径区域对应的图片区域,图片区域可以是预设二维图片的全部区域,也可以是部分区域,进而可以将图片区域进行缩放后将 缩放的图片区域包括的像素插入路径区域内。关于确定路径区域与图片区域的对应关系的方法,可以参考本公开的可选实施例。
本公开上述实施例提供的三维路径展示方法,通过从目标三维空间中确定第一采样点集合,并基于第一采样点集合,生成表示待生成的三维路径的曲线,然后基于曲线,生成由路径区域集合构成的三维路径,接着确定各个路径区域分别包括的顶点与预设二维图片中的像素点的映射关系,最后根据映射关系,在路径区域集合中的路径区域内插入对应的像素,并展示插入像素后的三维路径,从而实现了在三维场景中动态生成并展示三维路径,相比于现有技术需要手动绘制三维路径,本公开实施例可以大大提高生成三维路径的效率,可以向用户实时展示三维路径,提高路径展示的效率和精确性。
在一些示例实现方式中,如图3所示,步骤203可以包括如下子步骤:
步骤2031,从曲线中确定第二采样点集合。
通常,可以按照预设的采样间距(例如1米)从曲线中确定第二采样点集合。
步骤2032,对于第二采样点集合中的第二采样点,确定该第二采样点的法线方向;基于法线方向,确定该第二采样点对应的路径边界点的位置。
其中,确定法线方向的方法是目前的现有技术,这里不再赘述。第二采样点对应的路径边界点的数量可以为一个或两个。通常,可以根据设置的路径宽度,确定路径边界点的位置。例如,当第二采样点对应一个路径边界点时,可以在第二采样点的法线方向上确定与该第二采样点距离为上述路径宽度的点为路径边界点。
当第二采样点对应两个路径边界点时,可以在第二采样点的法线方向上和法线反方向上各确定一个边界点,两个边界点之间的距离为上述路径宽度。通常,可以将两个边界点分别与该第二采样点的距离设置为相等。如图4所示,第二采样点包括P0、P1、P2、……。路径边界点包括,I0、I1、I2、I3、……。l表示生成的曲线。第二采样点P0对应于路径 边界点I0和I1,I0和I1分别位于P0的法线方向和法线反方向,其他第二采样点与路径边界点的关系如图所示。
步骤2033,基于得到的各个路径边界点,生成由路径区域集合构成的三维路径。
作为示例,可以按照图4所示的方式连接各个路径边界点,生成的路径区域为三角形,从而得到由三角形网格构成的三维路径。再例如,可以将如图4所示的位于第二采样点两侧的路径边界点连接,得到由矩形网格构成的三维路径。
本实现方式通过基于每个第二采样点的法线方向确定每个第二采样点对应的路径边界点,根据路径边界点生成三维路径,从而使生成的三维路径更加接近真实的路径,同时根据路径边界点可以使得到的路径区域与预设二维图片的对应关系更加明确,有助于提高向路径区域贴图的效率和精确性。
在一些示例实现方式中,上述步骤2033可以如下执行:
基于得到的各个路径边界点,生成三角形网格作为路径区域,得到由三角形网格集合构成的三维路径。
其中,三维路径中相邻的第二采样点之间的区域由两个具有公共顶点的三角形网格构成。如图4所示,P0、P1为相邻的第二采样点,P0、P1之间的矩形区域由三角形A(顶点为I0、I1、I3)和三角形B(顶点为I2、I3、I0)构成,点I0和I3为公共顶点。设i为第二采样点的索引,例如P0的索引为0,P1的索引为1。则相邻的第二采样点之间的两个三角形可以表示为i*2+0,i*2+1,i*2+3,以及i*2+2,i*2+3,i*2+0。对于N个三角形,由于存在公共顶点,因此,只需2N个点即可描述。
现有的基于三角形网格进行贴图的方法,通常需要3N个点描述N个三角形,因此,本实现方式可以使用较少的点描述三角形,节约了描述三角形所需存储的点占据的存储空间。此外,由于三角形网格包括的三个顶点一定处于同一平面内,因此,通过三角形网格表示三维路径,可以在向三角形网格贴图时,更准确地确定三角形网格的顶点与预设二维图片中的像素的对应关系,提高展示三维路径的效率。
在一些示例实现方式中,在上述步骤2032中,对于第二采样点集合中的第二采样点,电子设备可以按照如下步骤确定该第二采样点对应的路径边界点的位置:
首先,基于预设二维图片的宽高比以及第二采样点集合中的相邻的第二采样点之间的距离,确定该第二采样点对应的路径宽度。
其中,上述预设二维图片与步骤204中的预设二维图片为同一个图片。作为示例,预设二维图片的宽高比为r,设相邻的第二采样点之间的距离为D,则路径宽度为r*D。
然后,基于路径宽度和法线方向,确定该第二采样点对应的路径边界点的位置。
作为示例,可以在法线方向上确定一个路径边界点,且该路径边界点与该第二采样点的距离为上述路径宽度。
本实现方式通过基于预设二维图片的宽高比确定路径宽度,可以使相邻的两个第二采样点之间的矩形区域与预设二维图片等比例,从而在向路径区域中贴图时,使插入的预设二维图片保持原比例,从而使三维路径的展示效果与真实的三维场景更匹配。需要说明的是,矩形区域是在三维空间中的,矩形区域与预设二维图片等比例也是在三维空间中的效果,在展示三维路径时,由于显示窗口是二维的,因此,三维路径映射到显示窗口时显示的贴图的外观与预设二维图片并非等比例。如图5A所示,其示出了形状为正方形的预设二维图片,在如图5B所示三维路径展示画面中,三维路径中插入的预设二维图片是三维展示效果的。
在一些示例实现方式中,对于第二采样点集合中的采样点,电子设备可以基于路径宽度和法线方向,按照如下步骤确定该第二采样点对应的路径边界点的位置:
基于路径宽度,在该第二采样点的法线方向和法线的反方向分别确定与该第二采样点的距离相等的两个路径边界点。如图4所示,W表示路径宽度,路径边界点I0位于P0的法线方向,路径边界点I1位于P0的法线的反方向。对于路径边界点I0和I1,与第二采样点P0的距离均为W/2。
本实现方式通过在第二采样点的法线方向和法线的反方向分别设置与第二采样点距离相等的路径边界点。可以使三维路径更好地与生成的曲线相匹配,提高生成三维路径的准确性。
在一些示例实现方式中,如图6所示,步骤205可以包括如下子步骤:
步骤2051,对于路径区域集合中的路径区域,将该路径区域的顶点分别映射到预设二维图片的顶点。
作为示例,如图4所示,对于三角形路径区域A,在确定其与预设二维图片的映射关系时,需要借助二维图片的uv属性进行描述。uv属性是指预设二维图片的横向用u坐标表示,纵向用v坐标表示,如图5A所示,uv坐标为(0,0)时,映射到预设二维图片的左下角,同理,uv为(1,1)就会映射到预设二维图片的右上角。对于由多个三角形组成三维路径的情况下,可以将每个第二采样点与三维路径的起点的距离与相邻两个第二采样点的距离D进行求模运算,进而确定对应的顶点的u坐标。
例如,对于图4中的第二采样点P0,该点与起点的距离为0,则与D取模得到0/D=0,则顶点I0、I1、I3对应的uv坐标分别为(0,1)、(0,0)、(1,0),顶点I2、I3、I0对应的uv坐标分别为(1,1)、(1,0)、(0,1)。
对于第二采样点P1,该点与起点的距离为D,则与D取模得到D/D=1,则顶点I2、I3、I5对应的uv坐标分别为(0,1)、(0,0)、(1,0),顶点I4、I5、I2对应的uv坐标分别为(1,1)、(1,0)、(0,1)。依次类推,可以确定其他三角形路径区域的顶点与预设二维图片的顶点的对应关系。
步骤2052,基于该路径区域的顶点与预设二维图片的顶点的对应关系,确定该路径区域中的点插入的像素的颜色值。
在示例中,在确定路径区域的顶点与预设二维图片的顶点之间的对应关系后,可以确定路径区域与预设二维图片中对应的区域,从而可以向路径区域中插入像素。
步骤2053,基于所确定的颜色值,在该路径区域内插入对应的像素。
本实现方式通过确定路径区域的顶点与预设二维图片的顶点的对应关系,并根据对应关系插入预设二维图片中的相应像素,实现了将二维图片精确地填充到三维路径中,提高展示三维路径的准确性。
示例性装置
图7是本公开一示例性实施例提供的三维路径展示装置的结构示意图。本实施例可应用在电子设备上,如图7所示,三维路径展示装置包括:第一确定模块701,用于从目标三维空间中确定表示待生成的三维路径经过的点的第一采样点集合;第一生成模块702,用于基于第一采样点集合,生成表示待生成的三维路径的曲线;第二生成模块703,用于基于曲线,生成由路径区域集合构成的三维路径;第二确定模块704,用于确定路径区域集合中的路径区域各自的顶点与预设二维图片中的像素点的映射关系;展示模块705,用于根据映射关系,在路径区域集合中的路径区域内插入预设二维图片中的对应区域包括的像素,并展示插入像素后的三维路径。
在一些实施例中,第一确定模块701可以从目标三维空间中确定表示待生成的三维路径经过的点的第一采样点集合。其中,目标三维空间可以是在上述装置中模拟的三维空间,该三维空间可以对应于真实的三维空间,例如房间内的空间、某个路段对应的空间、车、船、飞机等交通工具的内部空间等;目标三维空间也可以不对应于真实的三维空间,即虚拟空间。目标三维空间通常由对应的三维坐标系表示,从该三维坐标系内可以确定第一采样点集合中的每个点的坐标。
第一采样点集合中的点可以是由用户指定的点,也可以是第一确定模块701根据指定的起点和终点自动确定的点。作为示例,在VR(虚拟现实,Virtual Reality)看房的场景中,目标三维空间内可以包括预先设置的或用户指定的表示客厅的点、表示卧室的点、表示卫生间的点等。第一确定模块701需要根据这些点生成一条从客厅到卧室再到卫生间的三维路径。
在一些实施例中,第一生成模块702可以基于第一采样点集合,生成表示待生成的三维路径的曲线。在示例中,第一生成模块702可以根据 第一采样点集合包括的第一采样点,拟合出一条曲线作为表示待生成的三维路径的曲线。作为示例,第一生成模块702可以利用现有的三维场景创建引擎THREE.js中提供的生成圆滑曲线的方法CatmullRomCurve3,拟合出一条表示待生成的三维路径的曲线。
在一些实施例中,第二生成模块703可以基于曲线,生成由路径区域集合构成的三维路径。作为示例,第二生成模块703可以将曲线沿水平面向两侧或一侧扩展设定的宽度,从而得到三维路径,并按照设定的规则将三维路径划分为多个网格或多个路段,每个网格或路段即为路径区域。
在一些实施例中,第二确定模块704可以确定路径区域集合中的路径区域各自的顶点与预设二维图片中的像素点的映射关系。
作为示例,路径区域集合中的路径区域可以为处于一个平面上的矩形区域,该矩形区域的宽高比与预设二维图片的宽高比相同。根据三维路径的走向,可以确定矩形区域的四个顶点与预设二维图片的四个顶点的对应像素点的对应关系。例如根据三维路径的走向确定矩形区域中的在前边和在后边,在前边对应预设二维图片的上边,在后边对应预设二维图片的下边,进而确定矩形区域的顶点与预设三维图片的顶点的对应像素点的对应关系。
再例如,多个路径区域(例如两个)可以分别对应预设二维图片中的一个区域(例如将预设二维图片一分为二,每个路径区域对应预设二维图片的一个部分),根据多个路径区域的位置关系,可以在预设二维图片中确定每个路径区域对应的部分,进而确定每个路径区域的顶点与预设二维图片中的像素点的映射关系。
在一些实施例中,展示模块705可以根据映射关系,在路径区域集合中的路径区域内插入预设二维图片中的对应区域包括的像素,并展示插入像素后的三维路径。
在示例中,在确定了路径区域的顶点对应的像素点后,可以在预设二维图片中确定路径区域对应的图片区域,图片区域可以是预设二维图片的全部区域,也可以是部分区域,进而可以将图片区域进行缩放后将 缩放的图片区域包括的像素插入路径区域内。关于确定路径区域与图片区域的对应关系的方法,可以参考本公开的可选实施例。
参照图8,图8是本公开另一示例性实施例提供的三维路径展示装置的结构示意图。
在一些示例实现方式中,第二生成模块703包括:第一确定单元7031,用于从曲线中确定第二采样点集合;第二确定单元7032,用于对于第二采样点集合中的第二采样点,确定该第二采样点的法线方向;基于法线方向,确定该第二采样点对应的路径边界点的位置;生成单元7033,用于基于得到的各个路径边界点,生成由路径区域集合构成的三维路径。
在一些示例实现方式中,生成单元7033进一步用于:基于得到的各个路径边界点,生成三角形网格作为路径区域,得到由三角形网格集合构成的三维路径,其中,三维路径中相邻的第二采样点之间的区域由两个具有公共顶点的三角形网格构成。
在一些示例实现方式中,第二确定单元7032包括:第一确定子单元70321,用于基于预设二维图片的宽高比以及第二采样点集合中的相邻的第二采样点之间的距离,确定该第二采样点对应的路径宽度;第二确定子单元70322,用于基于路径宽度和法线方向,确定该第二采样点对应的路径边界点的位置。
在一些示例实现方式中,第二确定子单元70322进一步用于:基于路径宽度,在该第二采样点的法线方向和法线的反方向分别确定与该第二采样点的距离相等的两个路径边界点。
在一些示例实现方式中,第二生成模块703可以进一步用于:基于预设二维图片的宽高比,在所述曲线上,生成由路径区域集合构成的三维路径,其中,所述路径区域集合中的路径区域为四边形区域。
在一些示例实现方式中,第二确定模块704可以进一步用于:根据所述曲线的走向,确定所述路径区域集合中的形状为四边形的路径区域各自的四个顶点与所述预设二维图片的四个顶点的对应像素点的映射关系。
在一些示例实现方式中,展示模块705包括:映射单元7051,用于对于路径区域集合中的路径区域,将该路径区域的顶点分别映射到预设二维图片的顶点;第三确定单元7052,用于基于该路径区域的顶点与预设二维 图片的顶点的对应关系,确定该路径区域中的点插入的像素的颜色值;插入单元7053,用于基于所确定的颜色值,在该路径区域内插入对应的像素。
本公开上述实施例提供的三维路径展示装置,通过从目标三维空间中确定第一采样点集合,并基于第一采样点集合,生成表示待生成的三维路径的曲线,然后基于曲线,生成由路径区域集合构成的三维路径,接着确定各个路径区域分别包括的顶点与预设二维图片中的像素点的映射关系,最后根据映射关系,在路径区域集合中的路径区域内插入对应的像素,并展示插入像素后的三维路径,从而实现了在三维场景中动态生成并展示三维路径,相比于现有技术需要手动绘制三维路径,本公开实施例可以大大提高生成三维路径的效率,可以向用户实时展示三维路径,提高路径展示的效率和精确性。
示例性电子设备
下面,参考图9来描述根据本公开实施例的电子设备。该电子设备可以是如图1所示的终端设备101和服务器103中的任一个或两者、或与它们独立的单机设备,该单机设备可以与终端设备101和服务器103进行通信,以从它们接收所采集到的输入信号。
图9图示了根据本公开实施例的电子设备的框图。
如图9所示,电子设备900包括一个或多个处理器901和存储器902。
处理器901可以是中央处理单元(CPU)或者具有数据处理能力和/或指令执行能力的其他形式的处理单元,并且可以控制电子设备900中的其他组件以执行期望的功能。
存储器902可以包括一个或多个计算机程序产品,计算机程序产品可以包括各种形式的计算机可读存储介质,例如易失性存储器和/或非易失性存储器。易失性存储器例如可以包括随机存取存储器(RAM)和/或高速缓冲存储器(cache)等。非易失性存储器例如可以包括只读存储器(ROM)、硬盘、闪存等。在计算机可读存储介质上可以存储一个或多个计算机程序指令,处理器901可以运行程序指令,以实现上文的本公开的各 个实施例的三维路径展示方法以及/或者其他期望的功能。在计算机可读存储介质中还可以存储诸如第一采样点集合、第二采样点集合等各种内容。
在一个示例中,电子设备900还可以包括:输入装置903和输出装置904,这些组件通过总线系统和/或其他形式的连接机构(未示出)互连。
例如,在该电子设备是终端设备101或服务器103时,该输入装置903可以是摄像头、鼠标、键盘等设备,用于输入三维空间数据、采样点集合等。在该电子设备是单机设备时,该输入装置903可以是通信网络连接器,用于从终端设备101和服务器103接收所输入的三维空间数据、采样点集合等。
该输出装置904可以向外部输出各种信息,包括三维路径。该输出设备904可以包括例如显示器、扬声器、打印机、以及通信网络及其所连接的远程输出设备等等。
当然,为了简化,图9中仅示出了该电子设备900中与本公开有关的组件中的一些,省略了诸如总线、输入/输出接口等等的组件。除此之外,根据具体应用情况,电子设备900还可以包括任何其他适当的组件。
示例性计算机程序产品和计算机可读存储介质
除了上述方法和设备以外,本公开的实施例还可以是计算机程序产品,其包括计算机程序指令,所述计算机程序指令在被处理器运行时使得所述处理器执行本说明书上述“示例性方法”部分中描述的根据本公开各种实施例的三维路径展示方法中的步骤。
所述计算机程序产品可以以一种或多种程序设计语言的任意组合来编写用于执行本公开实施例操作的程序代码,所述程序设计语言包括面向对象的程序设计语言,诸如Java、C++等,还包括常规的过程式程序设计语言,诸如“C”语言或类似的程序设计语言。程序代码可以完全地在用户计算设备上执行、部分地在用户设备上执行、作为一个独立的软件包执行、部分在用户计算设备上部分在远程计算设备上执行、或者完全在远程计算设备或服务器上执行。
此外,本公开的实施例还可以是计算机可读存储介质,其上存储有计算机程序指令,所述计算机程序指令在被处理器运行时使得所述处理器执 行本说明书上述“示例性方法”部分中描述的根据本公开各种实施例的三维路径展示方法中的步骤。
所述计算机可读存储介质可以采用一个或多个可读介质的任意组合。可读介质可以是可读信号介质或者可读存储介质。可读存储介质例如可以包括但不限于电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。可读存储介质的更具体的例子(非穷举的列表)包括:具有一个或多个导线的电连接、便携式盘、硬盘、随机存取存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、光纤、便携式紧凑盘只读存储器(CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。
示例性计算机程序
本公开实施例还提供了一种计算机程序产品,包括计算机程序/指令,所述计算机程序/指令被处理器执行时,可以实现上述任一可能的实现方式中的三维路径展示方法。
该计算机程序产品可以具体通过硬件、软件或其结合的方式实现。在一个可选例子中,该计算机程序产品具体体现为计算机存储介质,在另一个可选例子中,该计算机程序产品具体体现为软件产品,例如软件开发包(Software Development Kit,SDK)等等。
以上结合具体实施例描述了本公开的基本原理,但是,需要指出的是,在本公开中提及的优点、优势、效果等仅是示例而非限制,不能认为这些优点、优势、效果等是本公开的各个实施例必须具备的。另外,上述公开的具体细节仅是为了示例的作用和便于理解的作用,而非限制,上述细节并不限制本公开为必须采用上述具体的细节来实现。
本说明书中各个实施例均采用递进的方式描述,每个实施例重点说明的都是与其它实施例的不同之处,各个实施例之间相同或相似的部分相互参见即可。对于系统实施例而言,由于其与方法实施例基本对应,所以描述的比较简单,相关之处参见方法实施例的部分说明即可。
本公开中涉及的器件、装置、设备、系统的方框图仅作为例示性的例子并且不意图要求或暗示必须按照方框图示出的方式进行连接、布置、配置。如本领域技术人员将认识到的,可以按任意方式连接、布置、配置这些器件、装置、设备、系统。诸如“包括”、“包含”、“具有”等等的词语是开放性词汇,指“包括但不限于”,且可与其互换使用。这里所使用的词汇“或”和“和”指词汇“和/或”,且可与其互换使用,除非上下文明确指示不是如此。这里所使用的词汇“诸如”指词组“诸如但不限于”,且可与其互换使用。
可能以许多方式来实现本公开的方法和装置。例如,可通过软件、硬件、固件或者软件、硬件、固件的任何组合来实现本公开的方法和装置。用于所述方法的步骤的上述顺序仅是为了进行说明,本公开的方法的步骤不限于以上具体描述的顺序,除非以其它方式特别说明。此外,在一些实施例中,还可将本公开实施为记录在记录介质中的程序,这些程序包括用于实现根据本公开的方法的机器可读指令。因而,本公开还覆盖存储用于执行根据本公开的方法的程序的记录介质。
还需要指出的是,在本公开的装置、设备和方法中,各部件或各步骤是可以分解和/或重新组合的。这些分解和/或重新组合应视为本公开的等效方案。
为了例示和描述的目的已经给出了以上描述。此外,此描述不意图将本公开的实施例限制到在此公开的形式。尽管以上已经讨论了多个示例方面和实施例,但是本领域技术人员将认识到其某些变型、修改、改变、添加和子组合。
Claims (19)
- 一种三维路径展示方法,包括:从目标三维空间中确定表示待生成的三维路径经过的点的第一采样点集合;基于所述第一采样点集合,生成表示所述待生成的三维路径的曲线;基于所述曲线,生成由路径区域集合构成的三维路径;确定所述路径区域集合中的路径区域各自的顶点与预设二维图片中的像素点的映射关系;根据所述映射关系,在所述路径区域集合中的路径区域内插入所述预设二维图片中的对应区域包括的像素,并发起展示插入像素后的三维路径。
- 根据权利要求1所述的方法,其中,所述基于所述曲线,生成由路径区域集合构成的三维路径,包括:从所述曲线中确定第二采样点集合;对于所述第二采样点集合中的第二采样点,确定该第二采样点的法线方向;基于所述法线方向,确定该第二采样点对应的路径边界点的位置;基于得到的各个路径边界点,生成由所述路径区域集合构成的三维路径。
- 根据权利要求2所述的方法,其中,所述基于得到的各个路径边界点,生成由路径区域集合构成的三维路径,包括:基于得到的各个路径边界点,生成三角形网格作为路径区域,得到由三角形网格集合构成的三维路径,其中,所述三维路径中相邻的第二采样点之间的区域由两个具有公共顶点的三角形网格构成。
- 根据权利要求2所述的方法,其中,所述基于所述法线方向,确定该第二采样点对应的路径边界点的位置,包括:基于所述预设二维图片的宽高比以及所述第二采样点集合中的相邻的第二采样点之间的距离,确定该第二采样点对应的路径宽度;基于所述路径宽度和所述法线方向,确定该第二采样点对应的路径边界点的位置。
- 根据权利要求4所述的方法,其中,所述基于所述路径宽度和所述法线方向,确定该第二采样点对应的路径边界点的位置,包括:基于所述路径宽度,在该第二采样点的所述法线方向和所述法线方向的反方向分别确定与该第二采样点的距离相等的两个路径边界点。
- 根据权利要求1所述的方法,其中,所述基于所述曲线,生成由路径区域集合构成的三维路径,包括:基于所述预设二维图片的宽高比,在所述曲线上,生成由所述路径区域集合构成的三维路径,其中,所述路径区域集合中的路径区域为四边形区域。
- 根据权利要求6所述的方法,其中,所述确定所述路径区域集合中的路径区域各自的顶点与预设二维图片中的像素点的映射关系,包括:根据所述曲线的走向,确定所述路径区域集合中的形状为四边形的路径区域各自的四个顶点与所述预设二维图片的四个顶点的对应像素点的映射关系。
- 根据权利要求1-7之一所述的方法,其中,所述根据所述映射关系,在所述路径区域集合中的路径区域内插入对应的像素,包括:对于所述路径区域集合中的路径区域,将该路径区域的顶点分别映射到所述预设二维图片的顶点;基于该路径区域的顶点与所述预设二维图片的顶点的对应关系,确定该路径区域中的点插入的像素的颜色值;基于所确定的颜色值,在该路径区域内插入对应的像素。
- 一种三维路径展示装置,包括:第一确定模块,用于从目标三维空间中确定表示待生成的三维路径经过的点的第一采样点集合;第一生成模块,用于基于所述第一采样点集合,生成表示所述待生成的三维路径的曲线;第二生成模块,用于基于所述曲线,生成由路径区域集合构成的三维路径;第二确定模块,用于确定所述路径区域集合中的路径区域各自的顶点与预设二维图片中的像素点的映射关系;展示模块,用于根据所述映射关系,在所述路径区域集合中的路径区域内插入所述预设二维图片中的对应区域包括的像素,并发起展示插入像素后的三维路径。
- 根据权利要求9所述的装置,其中,所述第二生成模块包括:第一确定单元,用于从所述曲线中确定第二采样点集合;第二确定单元,用于对于所述第二采样点集合中的第二采样点,确定该第二采样点的法线方向;基于所述法线方向,确定该第二采样点对应的路径边界点的位置;生成单元,用于基于得到的各个路径边界点,生成由所述路径区域集合构成的三维路径。
- 根据权利要求10所述的装置,其中,所述生成单元进一步用于:基于得到的各个路径边界点,生成三角形网格作为路径区域,得到由三角形网格集合构成的三维路径,其中,所述三维路径中相邻的第二采样点之间的区域由两个具有公共顶点的三角形网格构成。
- 根据权利要求10所述的装置,其中,所述第二确定单元包括:第一确定子单元,用于基于所述预设二维图片的宽高比以及所述第二采样点集合中的相邻的第二采样点之间的距离,确定该第二采样点对应的路径宽度;第二确定子单元,用于基于所述路径宽度和所述法线方向,确定该第二采样点对应的路径边界点的位置。
- 根据权利要求12所述的装置,其中,所述第二确定子单元进一步用于:基于所述路径宽度,在该第二采样点的所述法线方向和所述法线方向的反方向分别确定与该第二采样点的距离相等的两个路径边界点。
- 根据权利要求9所述的装置,其中,所述第二生成模块进一步用于:基于所述预设二维图片的宽高比,在所述曲线上,生成由所述路径区域集合构成的三维路径,其中,所述路径区域集合中的路径区域为四边形区域。
- 根据权利要求14所述的装置,其中,所述第二确定模块进一步用于:根据所述曲线的走向,确定所述路径区域集合中的形状为四边形的路径区域各自的四个顶点与所述预设二维图片的四个顶点的对应像素点的映射关系。
- 根据权利要求9-15之一所述的装置,其中,所述展示模块包括:映射单元,用于对于所述路径区域集合中的路径区域,将该路径区域的顶点分别映射到所述预设二维图片的顶点;第三确定单元,用于基于该路径区域的顶点与所述预设二维图片的顶点的对应关系,确定该路径区域中的点插入的像素的颜色值;插入单元,用于基于所确定的颜色值,在该路径区域内插入对应的像素。
- 一种计算机可读存储介质,所述存储介质存储有计算机程序,所述计算机程序用于执行上述权利要求1-8任一所述的方法。
- 一种电子设备,包括:处理器;和存储器,所述存储器存储有指令,所述指令当被所述处理器执行时,使所述处理器执行上述权利要求1-8任一所述的方法。
- 一种计算机程序,包括指令,所述指令当被处理器执行时,使所述处理器执行上述权利要求1-8任一所述的方法。
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111486747.9A CN114170381A (zh) | 2021-12-07 | 2021-12-07 | 三维路径展示方法、装置、可读存储介质及电子设备 |
CN202111486747.9 | 2021-12-07 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2023103980A1 true WO2023103980A1 (zh) | 2023-06-15 |
Family
ID=80483985
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2022/136643 WO2023103980A1 (zh) | 2021-12-07 | 2022-12-05 | 三维路径展示方法、装置、可读存储介质及电子设备 |
Country Status (3)
Country | Link |
---|---|
US (1) | US20230175858A1 (zh) |
CN (1) | CN114170381A (zh) |
WO (1) | WO2023103980A1 (zh) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114170381A (zh) * | 2021-12-07 | 2022-03-11 | 贝壳技术有限公司 | 三维路径展示方法、装置、可读存储介质及电子设备 |
CN118521722B (zh) * | 2024-07-25 | 2024-11-05 | 山东捷瑞数字科技股份有限公司 | 一种三维虚拟管线的绘制方法、装置及电子设备 |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110595429A (zh) * | 2019-10-23 | 2019-12-20 | 成都乐动信息技术有限公司 | 一种三维运动轨迹的生成方法及装置 |
CN111474899A (zh) * | 2020-04-29 | 2020-07-31 | 大连理工大学 | 一种基于三角化的复杂型腔高速数控铣削螺旋路径生成方法 |
US20210295714A1 (en) * | 2018-09-30 | 2021-09-23 | Moutong Science And Technology Co., Ltd | Methods and apparatuses of generating a unmanned aerial vehicle migration trajectory, electronic devices and storage mediums |
CN114170381A (zh) * | 2021-12-07 | 2022-03-11 | 贝壳技术有限公司 | 三维路径展示方法、装置、可读存储介质及电子设备 |
Family Cites Families (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP4483798B2 (ja) * | 2005-04-06 | 2010-06-16 | 株式会社デンソー | 経路案内装置およびプログラム |
US8532924B2 (en) * | 2009-09-02 | 2013-09-10 | Alpine Electronics, Inc. | Method and apparatus for displaying three-dimensional terrain and route guidance |
US9677898B2 (en) * | 2014-06-17 | 2017-06-13 | Think Ware Corporation | Electronic apparatus and control method thereof |
JP2017076943A (ja) * | 2015-10-16 | 2017-04-20 | 富士通株式会社 | コンテンツ投影装置、コンテンツ投影方法及びコンテンツ投影プログラム |
WO2020034165A1 (en) * | 2018-08-16 | 2020-02-20 | Beijing Didi Infinity Technology And Development Co., Ltd. | Indoor navigation system based on augmented reality |
US10871377B1 (en) * | 2019-08-08 | 2020-12-22 | Phiar Technologies, Inc. | Computer-vision based positioning for augmented reality navigation |
CN111623782A (zh) * | 2020-06-10 | 2020-09-04 | 浙江商汤科技开发有限公司 | 导航路线的展示方法、三维场景模型的生成方法及装置 |
US11828615B2 (en) * | 2020-08-06 | 2023-11-28 | Thinkware Corporation | AR processing device, augmented reality-based route guidance method and electronic device |
CN113237490A (zh) * | 2021-02-08 | 2021-08-10 | 上海博泰悦臻网络技术服务有限公司 | Ar导航方法、系统、电子设备和存储介质 |
TWI766647B (zh) * | 2021-04-19 | 2022-06-01 | 逢甲大學 | 虛擬導航路徑生成方法 |
-
2021
- 2021-12-07 CN CN202111486747.9A patent/CN114170381A/zh active Pending
-
2022
- 2022-11-22 US US17/992,298 patent/US20230175858A1/en active Pending
- 2022-12-05 WO PCT/CN2022/136643 patent/WO2023103980A1/zh unknown
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20210295714A1 (en) * | 2018-09-30 | 2021-09-23 | Moutong Science And Technology Co., Ltd | Methods and apparatuses of generating a unmanned aerial vehicle migration trajectory, electronic devices and storage mediums |
CN110595429A (zh) * | 2019-10-23 | 2019-12-20 | 成都乐动信息技术有限公司 | 一种三维运动轨迹的生成方法及装置 |
CN111474899A (zh) * | 2020-04-29 | 2020-07-31 | 大连理工大学 | 一种基于三角化的复杂型腔高速数控铣削螺旋路径生成方法 |
CN114170381A (zh) * | 2021-12-07 | 2022-03-11 | 贝壳技术有限公司 | 三维路径展示方法、装置、可读存储介质及电子设备 |
Also Published As
Publication number | Publication date |
---|---|
CN114170381A (zh) | 2022-03-11 |
US20230175858A1 (en) | 2023-06-08 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2023103980A1 (zh) | 三维路径展示方法、装置、可读存储介质及电子设备 | |
US9280449B2 (en) | HIT testing of visual objects | |
WO2022227489A1 (zh) | 针对物体的碰撞检测方法、装置、设备和存储介质 | |
CN108961165B (zh) | 用于加载图像的方法和装置 | |
WO2023241065A1 (zh) | 用于图像逆渲染的方法、装置、设备和介质 | |
CN111383329B (zh) | 基于浏览器的三维图像显示方法、装置及电子设备 | |
JP2022028854A (ja) | サンプル画像生成方法、装置及び電子機器 | |
WO2023246189A1 (zh) | 图像信息显示方法和装置 | |
JP2023026531A (ja) | バーチャルキャラクター生成方法、装置、電子機器、記憶媒体及びコンピュータプログラム | |
WO2023202349A1 (zh) | 三维标签的交互呈现方法、装置、设备、介质和程序产品 | |
CN110930492B (zh) | 模型渲染的方法、装置、计算机可读介质及电子设备 | |
CN115375812A (zh) | Cad数据渲染方法、装置、电子设备及存储介质 | |
CN111862342B (zh) | 增强现实的纹理处理方法、装置、电子设备及存储介质 | |
CN115063564B (zh) | 用于二维显示图像中的物品标签展示方法、装置及介质 | |
JP2023178274A (ja) | メッシュ頂点位置についての求根および反復を用いて表面を近似するポリゴンメッシュを生成する方法およびシステム | |
CN112465692A (zh) | 图像处理方法、装置、设备及存储介质 | |
US20240153128A1 (en) | Method of detecting collision of objects, device, and storage medium | |
CN112528707A (zh) | 图像处理方法、装置、设备及存储介质 | |
US11670045B2 (en) | Method and apparatus for constructing a 3D geometry | |
WO2022089061A1 (zh) | 物体标注信息呈现方法、装置、电子设备及存储介质 | |
CN114419299A (zh) | 虚拟物体的生成方法、装置、设备及存储介质 | |
CN114020390A (zh) | Bim模型显示方法、装置、计算机设备和存储介质 | |
WO2023005104A1 (zh) | 一种多视图展示方法、装置、设备和介质 | |
KR20220147183A (ko) | 정원 및 관련 산림 문화 자원 지도 서비스 방법 | |
CN114022601A (zh) | 一种体积元素渲染方法、装置及设备 |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 22903402 Country of ref document: EP Kind code of ref document: A1 |
|
NENP | Non-entry into the national phase |
Ref country code: DE |