CN114898076A - Model label adding method and device, electronic equipment and storage medium - Google Patents
Model label adding method and device, electronic equipment and storage medium Download PDFInfo
- Publication number
- CN114898076A CN114898076A CN202210320577.5A CN202210320577A CN114898076A CN 114898076 A CN114898076 A CN 114898076A CN 202210320577 A CN202210320577 A CN 202210320577A CN 114898076 A CN114898076 A CN 114898076A
- Authority
- CN
- China
- Prior art keywords
- model
- point
- model object
- roaming
- label
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Images
Classifications
-
- 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/20—Editing of 3D images, e.g. changing shapes or colours, aligning objects or positioning parts
-
- 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/003—Navigation within 3D models or images
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/70—Determining position or orientation of objects or cameras
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2219/00—Indexing scheme for manipulating 3D models or images for computer graphics
- G06T2219/004—Annotating, labelling
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02W—CLIMATE CHANGE MITIGATION TECHNOLOGIES RELATED TO WASTEWATER TREATMENT OR WASTE MANAGEMENT
- Y02W90/00—Enabling technologies or technologies with a potential or indirect contribution to greenhouse gas [GHG] emissions mitigation
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Physics & Mathematics (AREA)
- Computer Hardware Design (AREA)
- General Engineering & Computer Science (AREA)
- Computer Graphics (AREA)
- Architecture (AREA)
- Radar, Positioning & Navigation (AREA)
- Remote Sensing (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Processing Or Creating Images (AREA)
Abstract
The embodiment of the invention provides a model label adding method, a model label adding device, electronic equipment and a storage medium, wherein the method comprises the following steps: obtaining a model object located in a three-dimensional virtual space and a roaming position point corresponding to the three-dimensional virtual space, and constructing a bounding box corresponding to the model object; determining a model vertex and a model central point corresponding to the model object from the bounding box; determining the label position of the model object according to the position relationship between the roaming position point and the model center point and/or the position relationship between the roaming position point and each model vertex; and adding a model label corresponding to the model object at the label position.
Description
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method and an apparatus for adding a model tag, an electronic device, and a computer-readable storage medium.
Background
With the continuous development of technology, in many applications, the entity space can be digitally presented, so that a user can browse corresponding content in the three-dimensional space virtually constructed, for example, the user can browse a house three-dimensional virtual space through a corresponding application program, and the like. In the process of displaying the three-dimensional virtual space, the three-dimensional model is often displayed in the three-dimensional virtual space, the three-dimensional model is marked, and a corresponding model label is added to the three-dimensional model for introducing and explaining specific information of the three-dimensional model. In the process of adding model labels to the three-dimensional models, manual marking is adopted in the related technology, and for the manual marking, when the number of the three-dimensional models to be marked is large, the three-dimensional models cannot be marked in batches, so that not only is resource waste caused, but also the efficiency of model marking is greatly reduced.
Disclosure of Invention
The embodiment of the invention provides a method and a device for adding a model label, electronic equipment and a computer readable storage medium, which are used for solving or partially solving the problems of resource waste and low model marking efficiency when the model label is added to a three-dimensional model in a three-dimensional virtual space in the related technology.
The embodiment of the invention discloses a method for adding a model label, which comprises the following steps:
obtaining a model object located in a three-dimensional virtual space and a roaming position point corresponding to the three-dimensional virtual space, and constructing a bounding box corresponding to the model object;
determining a model vertex and a model central point corresponding to the model object from the bounding box;
determining the label position of the model object according to the position relationship between the roaming position point and the model center point and/or the position relationship between the roaming position point and each model vertex;
and adding a model label corresponding to the model object at the label position.
Optionally, after the constructing the bounding box corresponding to the model object, the method further includes:
obtaining a scaling coefficient corresponding to the model object;
zooming the initial bounding box by adopting the zooming coefficient to obtain a target bounding box;
wherein, the determining the model vertex and the model center point corresponding to the model object from the bounding box comprises:
and extracting model vertexes and model center points corresponding to the model objects from the target bounding box.
Optionally, the obtaining of the scaling factor corresponding to the model object includes:
and obtaining the object type of the model object and the scaling coefficient corresponding to the object type.
Optionally, the model object comprises one of a vehicle model, a vehicle component model, a furniture model object.
Optionally, the determining the label position of the model object according to the position relationship between the roaming position point and the model center point and/or the position relationship between the roaming position point and each model vertex includes:
and performing ray detection on the model central point by taking the roaming observation point as a starting point, and if the model central point is positioned on the surface or inside of the model object and other model objects which shield the model central point do not exist, taking the model central point as the label position of the model object.
Optionally, the determining the label position of the model object according to the position relationship between the roaming position point and the model center point and/or the position relationship between the roaming position point and each model vertex includes:
if the model center point is not positioned on the surface or inside of the model object or other model objects shielding the model center point exist, performing ray detection on each model vertex by taking the roaming observation point as a starting point;
and if at least one intersection point exists between the connecting line between the model vertex and the roaming observation point and the model object, acquiring the point distance between each intersection point and the model central point, and taking the intersection point with the minimum point distance as the label position of the model object.
Optionally, the determining the label position of the model object according to the position relationship between the roaming position point and the model center point and/or the position relationship between the roaming position point and each model vertex includes:
and if no intersection point exists between the connecting line between the model vertex and the roaming observation point and the model object, taking the model central point as the label position of the model object.
The embodiment of the invention also discloses a model label adding device, which comprises:
the data acquisition module is used for acquiring a model object positioned in a three-dimensional virtual space and a roaming position point corresponding to the three-dimensional virtual space and constructing a bounding box corresponding to the model object;
the point determining module is used for determining a model vertex and a model central point corresponding to the model object from the bounding box;
a tag position determining module, configured to determine a tag position of the model object according to a position relationship between the roaming position point and the model center point and/or a position relationship between the roaming position point and each model vertex;
and the model label adding module is used for adding a model label corresponding to the model object at the label position.
Optionally, the apparatus further comprises:
a scaling coefficient obtaining module, configured to obtain a scaling coefficient corresponding to the model object;
the bounding box zooming module is used for zooming the initial bounding box by adopting the zooming coefficient to obtain a target bounding box;
wherein the point determination module is specifically configured to:
and extracting model vertexes and model center points corresponding to the model objects from the target bounding box.
Optionally, the scaling factor obtaining module is specifically configured to:
and obtaining the object type of the model object and the scaling coefficient corresponding to the object type.
Optionally, the model object comprises one of a vehicle model, a vehicle component model, a furniture model object.
Optionally, the tag location determining module is specifically configured to:
and performing ray detection on the model central point by taking the roaming observation point as a starting point, and if the model central point is positioned on the surface or in the model object and other model objects shielding the model central point do not exist, taking the model central point as the label position of the model object.
Optionally, the tag location determining module is further specifically configured to:
if the model center point is not positioned on the surface or inside of the model object or other model objects shielding the model center point exist, performing ray detection on each model vertex by taking the roaming observation point as a starting point;
and if at least one intersection point exists between the connecting line between the model vertex and the roaming observation point and the model object, acquiring the point distance between each intersection point and the model central point, and taking the intersection point with the minimum point distance as the label position of the model object.
Optionally, the tag location determining module is further specifically configured to:
and if no intersection point exists between the connecting line between the model vertex and the roaming observation point and the model object, taking the model central point as the label position of the model object.
The embodiment of the invention also discloses electronic equipment which comprises a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory finish mutual communication through the communication bus;
the memory is used for storing a computer program;
the processor is configured to implement the method according to the embodiment of the present invention when executing the program stored in the memory.
Also disclosed is a computer-readable storage medium having instructions stored thereon, which, when executed by one or more processors, cause the processors to perform a method according to an embodiment of the invention.
The embodiment of the invention has the following advantages:
in the embodiment of the invention, by acquiring the model object located in the three-dimensional virtual space and the roaming position point corresponding to the three-dimensional virtual space, and constructing the bounding box corresponding to the model object, then determining the model vertex and the model center point corresponding to the model object from the bounding box, then determining the label position of the model object according to the position relationship between the roaming position point and the model center point and/or the position relationship between the roaming position point and each model vertex, and adding the model label corresponding to the model object at the label position, in the process of labeling the model object in the three-dimensional virtual space, by acquiring the roaming position point when a user browses, extracting the center point and the model vertex on the constructed bounding box of the model object, and then according to the position relationship between the position point and the center point/vertex, the method and the device can rapidly determine the label position of the model object, and meanwhile based on the roaming position point, the matching between the label position and the browsing visual angle of the user can be guaranteed, so that the browsing experience of the user on the three-dimensional virtual space is guaranteed.
Drawings
FIG. 1 is a flow chart illustrating steps of a method for adding a model tag according to an embodiment of the present invention;
fig. 2 is a block diagram of a model tag adding apparatus provided in an embodiment of the present invention;
FIG. 3 is a block diagram of an electronic device provided in an embodiment of the invention;
fig. 4 is a schematic diagram of a computer-readable medium provided in an embodiment of the present invention.
Detailed Description
In order to make the aforementioned objects, features and advantages of the present invention comprehensible, embodiments accompanied with figures are described in further detail below.
As an example, with the continuous development of technology, in many applications, a physical space can be digitally presented, so that a user can browse corresponding content in a three-dimensional space that is virtually constructed, for example, the user can browse a three-dimensional virtual space of a house through a corresponding application program, and the like. The three-dimensional virtual space can include a plurality of model objects, so that a user can display model tags corresponding to the model objects in a browsing process, so that the user can know relevant information of the model objects through the model tags, and the user can be assisted in knowing the model objects and the three-dimensional virtual space. In the process of adding the model labels to the three-dimensional models, manual marking is adopted in the related technology, and for the manual marking, when the number of the three-dimensional models to be marked is large, the three-dimensional models cannot be marked in batches, so that not only is resource waste caused, but also the efficiency of model marking is greatly reduced. In addition, the position of the center point of the bounding box of the model can be used as the label position in the related art, however, in some model objects, the shape of the model object is relatively irregular, for example, an L-shaped model, and the position of the center point of the bounding box of the model object is not on the model object, and the accuracy of the label marking position of the model object is greatly reduced by marking the model object in this way.
In this regard, one of the core invention points of the embodiment of the present invention is that, by obtaining a model object located in a three-dimensional virtual space and a roaming location point corresponding to the three-dimensional virtual space, and constructing a bounding box corresponding to the model object, then determining a model vertex and a model center point corresponding to the model object from the bounding box, then determining a label position of the model object according to a location relationship between the roaming location point and the model center point, and/or a location relationship between the roaming location point and each model vertex, and adding a model label corresponding to the model object at the label position, during labeling the model object in the three-dimensional virtual space, by obtaining the roaming location point when a user browses, and extracting the center point and the model vertex on the constructed bounding box of the model object, then according to a location relationship between the location point and the center point/vertex, the method and the device can rapidly determine the label position of the model object, and meanwhile based on the roaming position point, the matching between the label position and the browsing visual angle of the user can be guaranteed, so that the browsing experience of the user on the three-dimensional virtual space is guaranteed.
Referring to fig. 1, a flowchart illustrating steps of a method for adding a model tag provided in an embodiment of the present invention is shown, which may specifically include the following steps:
in the embodiment of the invention, the three-dimensional virtual space can comprise virtual spaces such as a three-dimensional house space, a three-dimensional exhibition space, a vehicle internal space and the like, so that a user can browse through contents presented in the three-dimensional virtual space, more real and three-dimensional contents are presented for the user in a three-dimensional mode, and the spatial perception of the user to the three-dimensional virtual space is improved. When the three-dimensional virtual space is a three-dimensional house space, the model object may be a furniture model object, such as a sofa model, a tea table model, a television cabinet model, a carpet model, a refrigerator model, and the like; when the three-dimensional virtual space is a three-dimensional vehicle exhibition space, the model object can be a vehicle model; when the three-dimensional virtual space is an interior space of a vehicle, then the model object may be a vehicle accessory or the like in the vehicle interior space, such as a steering wheel, an in-vehicle center control screen, a gear controller, or the like.
In a specific implementation, in order to improve the browsing experience of the user on the three-dimensional virtual space, the model object in the three-dimensional virtual space may be marked, and a corresponding model tag may be displayed at the marked position, where the model tag may include model information matched with the model object, for example, in the three-dimensional house space, the sofa model may be marked, and the tag may be displayed at the marked position, where the tag may include information of the material, price, size, and the like of the sofa model, so that the user may know the relevant information of the model object through the model tag in the browsing process, and the browsing experience of the user may be improved.
In the process of labeling the model object in the three-dimensional space, the model object in the three-dimensional space and the roaming position point located in the three-dimensional space may be obtained first, and then a bounding box corresponding to the model object may be constructed. The roaming position points can be visual angle point positions when a user browses a three-dimensional space, one three-dimensional space can comprise a plurality of different roaming position points, each roaming position point supports the user to carry out 360-degree visual angle switching, and the terminal can present different contents along with the visual angle switching of the user at the same roaming position point; the bounding box may be a cube or a two-dimensional cuboid capable of containing the model object, which may be used for collision detection of the model and, in an embodiment of the present invention, may be used for determining model vertices and model center points corresponding to the model object. It should be noted that, for the bounding box for building the model, which belongs to the prior art, too much description is not made here.
Optionally, for the three-dimensional virtual space, it may be a virtual space generated after the acquisition device acquires a panoramic image of the physical space, in the acquisition process, a position of the acquisition device in the physical space may be used as a positioning point, and then a position corresponding to the positioning point in the constructed three-dimensional virtual space may be used as a roaming position point, for example, assuming that the physical space is a house space, and the acquisition device performs panoramic acquisition at a midpoint position of a living room in the house space, a central point position of a living room object in the constructed three-dimensional house space may be used as a roaming position point, and the like, which is not limited in the present invention.
102, determining a model vertex and a model center point corresponding to the model object from the bounding box;
each model object may correspond to a bounding box, the bounding box may be a cube, and then, a model vertex and a model center point corresponding to the model object may be extracted from the cube, for example, if the bounding box corresponding to the model object is a cube, 8 vertices of the cube may be model vertices corresponding to the model object, a center point of the cube may be a model center point corresponding to the model object, and the like, it may be understood that the model vertex and the model center point are not a vertex and a center point on the model object.
In an optional embodiment, after the bounding box corresponding to the model object is constructed, a scaling coefficient corresponding to the model object may be obtained, then the bounding box is scaled by using the scaling coefficient to obtain the scaled bounding box, then the model vertex and the model central point corresponding to the model object are provided from the scaled bounding box, and the bounding box corresponding to the model object is scaled, so that the reasonability of the label marking position of the model can be effectively ensured. And if the different model objects can correspond to different scaling coefficients, the bounding box can be scaled according to the scaling coefficients by acquiring the object types of the model objects and the scaling coefficients corresponding to the object types. Optionally, the object type may be used to characterize the class of the model object, and different classes may correspond to different scaling coefficients; the model object includes one of a vehicle model, a vehicle component model, and a furniture model object.
In a specific implementation, a world coordinate system corresponding to a three-dimensional space can be constructed, a bounding box corresponding to a model object is constructed under the world coordinate system, then a scaling matrix corresponding to the model object can be constructed, and then 8 model vertexes of the bounding box are respectively multiplied by the scaling matrix to realize scaling of the bounding box, so that the reasonability of the marking position of a model label can be ensured by scaling the bounding box in a corresponding proportion.
103, determining the label position of the model object according to the position relationship between the roaming position point and the model center point and/or the position relationship between the roaming position point and each model vertex;
in the embodiment of the present invention, in order to ensure the accuracy and the generation efficiency of the model label marking position, the label position of the model object may be determined according to the position relationship between the roaming position point and the model center point and/or the position relationship between the roaming position point and each model vertex, so as to add the model label corresponding to the model object to the corresponding label position.
In a specific implementation, the roaming observation point may be used as a starting point, ray detection may be performed on the model center point, and if the model center point is located on the surface or inside of the model object and there is no other model object covering the model center point, the model center point may be used as a label position of the model object. If the model center point is not positioned on the surface or inside of the model object or other model objects shielding the model center point exist, performing ray detection on each model vertex by taking the roaming observation point as a starting point; and if at least one intersection point exists between the connecting line between the model vertex and the roaming observation point and the model object, acquiring the point distance between each intersection point and the model central point, and taking the intersection point with the minimum point distance as the label position of the model object. If there is no intersection between the connection line between the model vertex and the roaming observation point and the model object, the model center point is set as the label position of the model object.
In an example, a world coordinate corresponding to the three-dimensional virtual space may be constructed first, then, in a world coordinate system, a bounding box of each model object in the three-dimensional virtual space is calculated, and the size of the bounding box is scaled appropriately (facilitating subsequent ray detection from the roaming position point to each vertex of the bounding box to obtain as many points intersecting the model object as possible), and then, a model center point and eight vertex positions of the bounding box are calculated. If the model central point E is on the surface or inside of the model object and is not shielded by other models, the representation model central point E not only meets the observation visual angle of a user, but also is positioned on the model object, and the model central point E can be used as the label position of the model object under the roaming position point.
If the model center point E is not on the surface or inside of the model object or the model center point E is blocked by other model objects, ray detection needs to be performed from the starting point S to 8 model vertices of the bounding box, respectively, if there is an intersection point between a connecting line between at least one model fixed point and the starting point S and the model object, an intersection point closest to the model center point E can be selected from the intersection points as a target intersection point, and the position of the target intersection point is taken as a label position. Specifically, ray detection can be performed from the starting point S to 8 model vertices of the bounding box, and intersection tests can be performed in a loop, for example, an empty set array a can be constructed first, and vertex indexes can be performed, whether the vertex indexes are less than or equal to 8 can be determined first, if yes, ray detection is performed from the 1 st model vertex, if an intersection point exists between a connecting line between the model fixing point and the starting point S and the model object, the intersection point is added to the array a, and the vertex index is added by 1; and if the intersection points do not exist, adding 1 to the vertex index, and continuing ray detection until all model vertices are subjected to ray detection, if only one intersection point exists in the array A, taking the intersection point as the label position of the model object, if a plurality of intersection points exist, respectively obtaining the point distance between each intersection point and the model central point of the bounding box, and taking the intersection point with the minimum point distance as the label position of the model object. Alternatively, if there are two or more intersection points with the same point distance from the model center point of the model object, the point coordinates of each intersection point may be obtained, and the intersection point with the largest ordinate value in the point coordinates may be used as the label position of the model object.
Furthermore, if ray detection is performed from the starting point S to 8 model vertices of the bounding box, there is no point of intersection with the model object, and the model center point E is still used as the label position of the model object.
In the process of labeling a model object in a three-dimensional virtual space, a roaming position point when a user browses is obtained, a central point and a model vertex are extracted from a constructed bounding box of the model object, then the label position of the model object can be rapidly determined according to the position relation between the position point and the central point/vertex, and meanwhile, based on the roaming position point, the matching between the label position and the browsing visual angle of the user can be ensured, so that the browsing experience of the user on the three-dimensional virtual space is ensured
And 104, adding a model label corresponding to the model object at the label position.
In a specific implementation, different model objects may correspond to different model tags, and the same model object may correspond to different model tags, for example, if the model object is a sofa model, the model tag may include information such as size, price, and material of the sofa model, and may also include information such as material, durability, and harmful substance information of the sofa model, which is not limited in this invention.
It should be noted that the embodiment of the present invention includes but is not limited to the above examples, and it is understood that, under the guidance of the idea of the embodiment of the present invention, a person skilled in the art may also set the method according to actual requirements, and the present invention is not limited to this.
In the embodiment of the invention, by acquiring the model object located in the three-dimensional virtual space and the roaming position point corresponding to the three-dimensional virtual space, and constructing the bounding box corresponding to the model object, then determining the model vertex and the model center point of the model object from the bounding box, then determining the label position of the model object according to the position relationship between the roaming position point and the model center point or the position relationship between the roaming position point and the model vertex, and adding the model label corresponding to the model object at the label position, in the process of labeling the model object in the three-dimensional virtual space, by acquiring the roaming position point when a user browses and extracting the center point and the model vertex on the constructed bounding box of the model object, then according to the position relationship between the position point and the center point/vertex, not only can the label position of the model object be rapidly determined, meanwhile, based on the roaming position point, the matching between the label position and the browsing visual angle of the user can be ensured, and the browsing experience of the user on the three-dimensional virtual space is further ensured.
It should be noted that, for simplicity of description, the method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the present invention is not limited by the illustrated order of acts, as some steps may occur in other orders or concurrently in accordance with the embodiments of the present invention. Further, those skilled in the art will appreciate that the embodiments described in the specification are presently preferred and that no particular act is required to implement the invention.
Referring to fig. 2, a block diagram of a structure of a model tag adding apparatus provided in the embodiment of the present invention is shown, and specifically, the structure may include the following modules:
a data obtaining module 201, configured to obtain a model object located in a three-dimensional virtual space and a roaming position point corresponding to the three-dimensional virtual space, and construct a bounding box corresponding to the model object;
a point determining module 202, configured to determine a model vertex and a model center point corresponding to the model object from the bounding box;
a tag position determining module 203, configured to determine a tag position of the model object according to a position relationship between the roaming position point and the model center point and/or a position relationship between the roaming position point and each model vertex;
a model label adding module 204, configured to add a model label corresponding to the model object at the label position.
In an alternative embodiment, the apparatus further comprises:
a scaling coefficient obtaining module, configured to obtain a scaling coefficient corresponding to the model object;
the bounding box scaling module is used for scaling the initial bounding box by adopting the scaling coefficient to obtain a target bounding box;
wherein the point determining module 202 is specifically configured to:
and extracting model vertexes and model center points corresponding to the model objects from the target bounding box.
In an optional embodiment, the scaling factor obtaining module is specifically configured to:
and obtaining the object type of the model object and the scaling coefficient corresponding to the object type.
In an alternative embodiment, the model object comprises one of a vehicle model, a vehicle component model, a furniture model object.
In an optional embodiment, the tag location determining module 203 is specifically configured to:
and performing ray detection on the model central point by taking the roaming observation point as a starting point, and if the model central point is positioned on the surface or in the model object and other model objects shielding the model central point do not exist, taking the model central point as the label position of the model object.
In an optional embodiment, the tag location determining module 203 is further specifically configured to:
if the model center point is not positioned on the surface or inside of the model object or other model objects shielding the model center point exist, performing ray detection on each model vertex by taking the roaming observation point as a starting point;
and if at least one intersection point exists between the connecting line between the model vertex and the roaming observation point and the model object, acquiring the point distance between each intersection point and the model central point, and taking the intersection point with the minimum point distance as the label position of the model object.
In an optional embodiment, the tag location determining module 203 is further specifically configured to:
and if no intersection point exists between the connecting line between the model vertex and the roaming observation point and the model object, taking the model central point as the label position of the model object.
For the device embodiment, since it is basically similar to the method embodiment, the description is simple, and for the relevant points, refer to the partial description of the method embodiment.
In addition, an embodiment of the present invention further provides an electronic device, as shown in fig. 3, which includes a processor 301, a communication interface 302, a memory 303 and a communication bus 304, where the processor 301, the communication interface 302 and the memory 303 complete mutual communication through the communication bus 304,
a memory 303 for storing a computer program;
the processor 301 is configured to implement the following steps when executing the program stored in the memory 303:
obtaining a model object located in a three-dimensional virtual space and a roaming position point corresponding to the three-dimensional virtual space, and constructing a bounding box corresponding to the model object;
determining a model vertex and a model central point corresponding to the model object from the bounding box;
determining the label position of the model object according to the position relationship between the roaming position point and the model center point and/or the position relationship between the roaming position point and each model vertex;
and adding a model label corresponding to the model object at the label position.
In an optional embodiment, after the constructing the bounding box corresponding to the model object, the method further comprises:
obtaining a scaling coefficient corresponding to the model object;
zooming the initial bounding box by adopting the zooming coefficient to obtain a target bounding box;
wherein, the determining the model vertex and the model center point corresponding to the model object from the bounding box comprises:
and extracting model vertexes and model center points corresponding to the model objects from the target bounding box.
In an optional embodiment, the obtaining a scaling factor corresponding to the model object includes:
and obtaining the object type of the model object and the scaling coefficient corresponding to the object type.
In an alternative embodiment, the model object comprises one of a vehicle model, a vehicle component model, a furniture model object.
In an optional embodiment, the determining the label position of the model object according to the position relationship between the roaming position point and the model center point and/or the position relationship between the roaming position point and each model vertex includes:
and performing ray detection on the model central point by taking the roaming observation point as a starting point, and if the model central point is positioned on the surface or in the model object and other model objects shielding the model central point do not exist, taking the model central point as the label position of the model object.
In an optional embodiment, the determining the label position of the model object according to the position relationship between the roaming position point and the model center point and/or the position relationship between the roaming position point and each model vertex includes:
if the model center point is not positioned on the surface or inside of the model object or other model objects shielding the model center point exist, performing ray detection on each model vertex by taking the roaming observation point as a starting point;
and if at least one intersection point exists between the connecting line between the model vertex and the roaming observation point and the model object, acquiring the point distance between each intersection point and the model central point, and taking the intersection point with the minimum point distance as the label position of the model object.
In an optional embodiment, the determining the label position of the model object according to the position relationship between the roaming position point and the model center point and/or the position relationship between the roaming position point and each model vertex includes:
and if no intersection point exists between the connecting line between the model vertex and the roaming observation point and the model object, taking the model central point as the label position of the model object.
The communication bus mentioned in the above terminal may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown, but this does not mean that there is only one bus or one type of bus.
The communication interface is used for communication between the terminal and other devices.
The Memory may include a Random Access Memory (RAM) or a non-volatile Memory (non-volatile Memory), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the processor.
The Processor may be a general-purpose Processor, and includes a Central Processing Unit (CPU), a Network Processor (NP), and the like; the Integrated Circuit may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, a discrete Gate or transistor logic device, or a discrete hardware component.
In yet another embodiment provided by the present invention, as shown in fig. 4, there is further provided a computer-readable storage medium 401, which stores instructions that, when executed on a computer, cause the computer to execute the method for adding a model tag described in the above embodiment.
In yet another embodiment provided by the present invention, there is also provided a computer program product containing instructions which, when run on a computer, cause the computer to perform the method of adding model tags described in the above embodiments.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, cause the processes or functions described in accordance with the embodiments of the invention to occur, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, from one website site, computer, server, or data center to another website site, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that incorporates one or more of the available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., Solid State Disk (SSD)), among others.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
All the embodiments in the present specification are described in a related manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, as for the system embodiment, since it is substantially similar to the method embodiment, the description is relatively simple, and reference may be made to the partial description of the method embodiment for relevant points.
The above description is only for the preferred embodiment of the present invention, and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention shall fall within the protection scope of the present invention.
Claims (10)
1. A model tag adding method is characterized by comprising the following steps:
obtaining a model object located in a three-dimensional virtual space and a roaming position point corresponding to the three-dimensional virtual space, and constructing a bounding box corresponding to the model object;
determining a model vertex and a model central point corresponding to the model object from the bounding box;
determining the label position of the model object according to the position relationship between the roaming position point and the model center point and/or the position relationship between the roaming position point and each model vertex;
and adding a model label corresponding to the model object at the label position.
2. The method of claim 1, wherein after the building the bounding box corresponding to the model object, the method further comprises:
obtaining a scaling coefficient corresponding to the model object;
zooming the initial bounding box by adopting the zooming coefficient to obtain a target bounding box;
wherein, the determining the model vertex and the model center point corresponding to the model object from the bounding box comprises:
and extracting model vertexes and model center points corresponding to the model objects from the target bounding box.
3. The method of claim 2, wherein the obtaining the scaling factor corresponding to the model object comprises:
and obtaining the object type of the model object and the scaling coefficient corresponding to the object type.
4. The method of claim 2, wherein the model object comprises one of a vehicle model, a vehicle component model, a furniture model object.
5. The method according to claim 1, wherein determining the label position of the model object according to the position relationship between the roaming position point and the model center point and/or the position relationship between the roaming position point and each model vertex comprises:
and performing ray detection on the model central point by taking the roaming observation point as a starting point, and if the model central point is positioned on the surface or in the model object and other model objects shielding the model central point do not exist, taking the model central point as the label position of the model object.
6. The method according to claim 5, wherein determining the label position of the model object according to the position relationship between the roaming position point and the model center point and/or the position relationship between the roaming position point and each model vertex comprises:
if the model center point is not positioned on the surface or inside of the model object or other model objects shielding the model center point exist, performing ray detection on each model vertex by taking the roaming observation point as a starting point;
and if at least one intersection point exists between the connecting line between the model vertex and the roaming observation point and the model object, acquiring the point distance between each intersection point and the model central point, and taking the intersection point with the minimum point distance as the label position of the model object.
7. The method according to claim 6, wherein determining the label position of the model object according to the position relationship between the roaming position point and the model center point and/or the position relationship between the roaming position point and each model vertex comprises:
and if no intersection point exists between the connecting line between the model vertex and the roaming observation point and the model object, taking the model central point as the label position of the model object.
8. An apparatus for adding a model label, comprising:
the data acquisition module is used for acquiring a model object positioned in a three-dimensional virtual space and a roaming position point corresponding to the three-dimensional virtual space and constructing a bounding box corresponding to the model object;
the point determining module is used for determining a model vertex and a model central point corresponding to the model object from the bounding box;
a tag position determining module, configured to determine a tag position of the model object according to a position relationship between the roaming position point and the model center point and/or a position relationship between the roaming position point and each model vertex;
and the model label adding module is used for adding a model label corresponding to the model object at the label position.
9. An electronic device, comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus;
the memory is used for storing a computer program;
the processor, when executing a program stored on the memory, implementing the method of any of claims 1-7.
10. A computer-readable storage medium having stored thereon instructions, which when executed by one or more processors, cause the processors to perform the method of any one of claims 1-7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210320577.5A CN114898076B (en) | 2022-03-29 | 2022-03-29 | Model label adding method and device, electronic equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210320577.5A CN114898076B (en) | 2022-03-29 | 2022-03-29 | Model label adding method and device, electronic equipment and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN114898076A true CN114898076A (en) | 2022-08-12 |
CN114898076B CN114898076B (en) | 2023-04-21 |
Family
ID=82714720
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210320577.5A Active CN114898076B (en) | 2022-03-29 | 2022-03-29 | Model label adding method and device, electronic equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114898076B (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116049505A (en) * | 2023-04-03 | 2023-05-02 | 杭州美创科技股份有限公司 | Screen space tag collision detection method and device, computer equipment and storage medium |
CN116385273A (en) * | 2023-06-05 | 2023-07-04 | 南京维赛客网络科技有限公司 | Method, system and storage medium for moving points in stepping panoramic roaming |
Citations (25)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20090179895A1 (en) * | 2008-01-15 | 2009-07-16 | Google Inc. | Three-Dimensional Annotations for Street View Data |
CN102163340A (en) * | 2011-04-18 | 2011-08-24 | 宁波万里电子科技有限公司 | Method for labeling three-dimensional (3D) dynamic geometric figure data information in computer system |
CN102521852A (en) * | 2011-11-24 | 2012-06-27 | 中国船舶重工集团公司第七0九研究所 | Showing method for target label independent of three-dimensional scene space |
CN103279992A (en) * | 2013-05-20 | 2013-09-04 | 北京农业信息技术研究中心 | Three-dimensional interactive fruit tree virtual trimming method and system |
CN103617317A (en) * | 2013-11-26 | 2014-03-05 | Tcl集团股份有限公司 | Automatic layout method and system of intelligent 3D (three dimensional) model |
US20160180581A1 (en) * | 2014-12-23 | 2016-06-23 | Google Inc. | Labeling for Three-Dimensional Occluded Shapes |
CN105825551A (en) * | 2016-03-11 | 2016-08-03 | 广州视睿电子科技有限公司 | Three-dimensional label implementation method and device |
CN107748643A (en) * | 2017-11-10 | 2018-03-02 | 济南迅捷万通科技发展有限公司 | A kind of interactive object pick-up method based on subsurface three-dimensional space |
CN108765270A (en) * | 2018-05-30 | 2018-11-06 | 链家网(北京)科技有限公司 | A kind of virtual three-dimensional space label binding method and device |
CN110136273A (en) * | 2019-03-29 | 2019-08-16 | 初速度(苏州)科技有限公司 | A kind of sample data mask method and device in machine learning |
CN110704915A (en) * | 2019-09-20 | 2020-01-17 | 同济大学建筑设计研究院(集团)有限公司 | Sight line analysis method and device, computer equipment and storage medium |
CN110751681A (en) * | 2019-10-18 | 2020-02-04 | 西南科技大学 | Augmented reality registration method, device, device and storage medium |
CN111080799A (en) * | 2019-12-04 | 2020-04-28 | 广东康云科技有限公司 | Scene roaming method, system, device and storage medium based on three-dimensional modeling |
CN111340598A (en) * | 2020-03-20 | 2020-06-26 | 北京爱笔科技有限公司 | Method and device for adding interactive label |
CN111783525A (en) * | 2020-05-20 | 2020-10-16 | 中国人民解放军93114部队 | A method for generating target samples of aerial photography images based on style transfer |
CN111784844A (en) * | 2020-06-09 | 2020-10-16 | 当家移动绿色互联网技术集团有限公司 | Method and device for observing virtual object, storage medium and electronic equipment |
CN112150575A (en) * | 2020-10-30 | 2020-12-29 | 深圳市优必选科技股份有限公司 | Scene data acquisition method, model training method, device and computer equipment |
CN112907760A (en) * | 2021-02-09 | 2021-06-04 | 浙江商汤科技开发有限公司 | Three-dimensional object labeling method and device, tool, electronic equipment and storage medium |
US20210201578A1 (en) * | 2019-12-27 | 2021-07-01 | Lyft, Inc. | Systems and methods for presenting a reconstructed representation of a moving object detected in a scene |
CN113077548A (en) * | 2021-04-26 | 2021-07-06 | 北京百度网讯科技有限公司 | Collision detection method, device, equipment and storage medium for object |
CN113223130A (en) * | 2021-03-17 | 2021-08-06 | 浙江大华技术股份有限公司 | Path roaming method, terminal equipment and computer storage medium |
CN113345092A (en) * | 2021-05-06 | 2021-09-03 | 武汉大学 | Automatic separation method for ground model and non-ground model of real-scene three-dimensional model |
US20210279957A1 (en) * | 2020-03-06 | 2021-09-09 | Yembo, Inc. | Systems and methods for building a virtual representation of a location |
CN113744417A (en) * | 2021-11-08 | 2021-12-03 | 山东捷瑞数字科技股份有限公司 | Dimension marking method of complex node model |
CN113763569A (en) * | 2021-08-30 | 2021-12-07 | 之江实验室 | Image annotation method and device used in three-dimensional simulation and electronic equipment |
-
2022
- 2022-03-29 CN CN202210320577.5A patent/CN114898076B/en active Active
Patent Citations (25)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20090179895A1 (en) * | 2008-01-15 | 2009-07-16 | Google Inc. | Three-Dimensional Annotations for Street View Data |
CN102163340A (en) * | 2011-04-18 | 2011-08-24 | 宁波万里电子科技有限公司 | Method for labeling three-dimensional (3D) dynamic geometric figure data information in computer system |
CN102521852A (en) * | 2011-11-24 | 2012-06-27 | 中国船舶重工集团公司第七0九研究所 | Showing method for target label independent of three-dimensional scene space |
CN103279992A (en) * | 2013-05-20 | 2013-09-04 | 北京农业信息技术研究中心 | Three-dimensional interactive fruit tree virtual trimming method and system |
CN103617317A (en) * | 2013-11-26 | 2014-03-05 | Tcl集团股份有限公司 | Automatic layout method and system of intelligent 3D (three dimensional) model |
US20160180581A1 (en) * | 2014-12-23 | 2016-06-23 | Google Inc. | Labeling for Three-Dimensional Occluded Shapes |
CN105825551A (en) * | 2016-03-11 | 2016-08-03 | 广州视睿电子科技有限公司 | Three-dimensional label implementation method and device |
CN107748643A (en) * | 2017-11-10 | 2018-03-02 | 济南迅捷万通科技发展有限公司 | A kind of interactive object pick-up method based on subsurface three-dimensional space |
CN108765270A (en) * | 2018-05-30 | 2018-11-06 | 链家网(北京)科技有限公司 | A kind of virtual three-dimensional space label binding method and device |
CN110136273A (en) * | 2019-03-29 | 2019-08-16 | 初速度(苏州)科技有限公司 | A kind of sample data mask method and device in machine learning |
CN110704915A (en) * | 2019-09-20 | 2020-01-17 | 同济大学建筑设计研究院(集团)有限公司 | Sight line analysis method and device, computer equipment and storage medium |
CN110751681A (en) * | 2019-10-18 | 2020-02-04 | 西南科技大学 | Augmented reality registration method, device, device and storage medium |
CN111080799A (en) * | 2019-12-04 | 2020-04-28 | 广东康云科技有限公司 | Scene roaming method, system, device and storage medium based on three-dimensional modeling |
US20210201578A1 (en) * | 2019-12-27 | 2021-07-01 | Lyft, Inc. | Systems and methods for presenting a reconstructed representation of a moving object detected in a scene |
US20210279957A1 (en) * | 2020-03-06 | 2021-09-09 | Yembo, Inc. | Systems and methods for building a virtual representation of a location |
CN111340598A (en) * | 2020-03-20 | 2020-06-26 | 北京爱笔科技有限公司 | Method and device for adding interactive label |
CN111783525A (en) * | 2020-05-20 | 2020-10-16 | 中国人民解放军93114部队 | A method for generating target samples of aerial photography images based on style transfer |
CN111784844A (en) * | 2020-06-09 | 2020-10-16 | 当家移动绿色互联网技术集团有限公司 | Method and device for observing virtual object, storage medium and electronic equipment |
CN112150575A (en) * | 2020-10-30 | 2020-12-29 | 深圳市优必选科技股份有限公司 | Scene data acquisition method, model training method, device and computer equipment |
CN112907760A (en) * | 2021-02-09 | 2021-06-04 | 浙江商汤科技开发有限公司 | Three-dimensional object labeling method and device, tool, electronic equipment and storage medium |
CN113223130A (en) * | 2021-03-17 | 2021-08-06 | 浙江大华技术股份有限公司 | Path roaming method, terminal equipment and computer storage medium |
CN113077548A (en) * | 2021-04-26 | 2021-07-06 | 北京百度网讯科技有限公司 | Collision detection method, device, equipment and storage medium for object |
CN113345092A (en) * | 2021-05-06 | 2021-09-03 | 武汉大学 | Automatic separation method for ground model and non-ground model of real-scene three-dimensional model |
CN113763569A (en) * | 2021-08-30 | 2021-12-07 | 之江实验室 | Image annotation method and device used in three-dimensional simulation and electronic equipment |
CN113744417A (en) * | 2021-11-08 | 2021-12-03 | 山东捷瑞数字科技股份有限公司 | Dimension marking method of complex node model |
Non-Patent Citations (5)
Title |
---|
JERRT-J: "UNITY实战进阶-三维AABB包围盒详解-6", 《HTTPS://BLOG.CSDN.NET/FLJ135792468/ARTICLE/DETAILS/120654391》 * |
ZHUANSPACE: "如何在三维空间中添加面板标签?", 《HTTPS://BLOG.CSDN.NET/WEIXIN_45544796/ARTICLE/DETAILS/100741439》 * |
ZHUANSPACE: "如何给建筑模型空间添加标签?", 《HTTPS://BLOG.CSDN.NET/WEIXIN_45544796/ARTICLE/DETAILS/100742519》 * |
潘炜元: "水利水电工程虚拟现实关键技术研究应用", 《中国优秀硕士学位论文全文数据库(信息科技辑)》 * |
蓝汝铭: "《西安电子科技大学出版社》", 31 August 2006 * |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116049505A (en) * | 2023-04-03 | 2023-05-02 | 杭州美创科技股份有限公司 | Screen space tag collision detection method and device, computer equipment and storage medium |
CN116385273A (en) * | 2023-06-05 | 2023-07-04 | 南京维赛客网络科技有限公司 | Method, system and storage medium for moving points in stepping panoramic roaming |
CN116385273B (en) * | 2023-06-05 | 2023-08-15 | 南京维赛客网络科技有限公司 | Method, system and storage medium for moving points in stepping panoramic roaming |
Also Published As
Publication number | Publication date |
---|---|
CN114898076B (en) | 2023-04-21 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US9904664B2 (en) | Apparatus and method providing augmented reality contents based on web information structure | |
CN106846497B (en) | Method and device for presenting three-dimensional map applied to terminal | |
CN113077548B (en) | Collision detection method, device, equipment and storage medium for object | |
CN114898076B (en) | Model label adding method and device, electronic equipment and storage medium | |
CN107329671B (en) | Model display method and device | |
CN112241565A (en) | Modeling method and related device | |
CN114758075B (en) | Method, apparatus and storage medium for generating three-dimensional label | |
CN112950759A (en) | Three-dimensional house model construction method and device based on house panoramic image | |
CN111459269A (en) | Augmented reality display method, system and computer readable storage medium | |
CN112733641A (en) | Object size measuring method, device, equipment and storage medium | |
CN114625983A (en) | House resource information display method and device, electronic equipment and readable storage medium | |
CN108536467A (en) | Location processing method, device, terminal device and the storage medium of code | |
CN108597034B (en) | Method and apparatus for generating information | |
CN114842175B (en) | Interactive presentation method, device, equipment and medium for three-dimensional label | |
CN114693893B (en) | Data processing method and device, electronic equipment and storage medium | |
KR20200094637A (en) | Method, apparatus, device, and storage medium for providing visual representation of set of objects | |
CN110825989A (en) | Picture display method and device, electronic equipment and readable medium | |
CN115115786A (en) | Method, apparatus, device and storage medium for three-dimensional model generation | |
CN109887078B (en) | Sky drawing method, device, equipment and medium | |
CN114153539A (en) | Front-end application interface generation method and device, electronic equipment and storage medium | |
CN114241046A (en) | Data annotation method and device, computer equipment and storage medium | |
CN112652056A (en) | 3D information display method and device | |
CN112907294B (en) | Parking space pricing method and related product | |
CN114218638B (en) | Panoramic image generation method and device, storage medium and electronic device | |
US10895953B2 (en) | Interaction with a three-dimensional internet content displayed on a user interface |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |