Method and system for displaying commodity in virtual space through virtual glasses
Technical Field
The invention relates to the technical field of virtual reality, in particular to a method and a system for displaying commodities in a virtual space through virtual glasses.
Background
The brain or sense organs of a person can generate different illusions due to different signals input to the glasses, for example, the person feels the weather dark when wearing sunglasses, and the three-dimensional imaging technology enables the person to feel concave and convex pictures on the same plane. In the current imaging technology, three-dimensional simulation imaging has been implemented, which means that a stereoscopic picture is built on a computer.
Meanwhile, in the existing commodity display or shopping experience, a user can only select a physical store or online shopping, and the physical store shopping needs a long time and wastes physical strength; the shape and material of the product can not be fully known when shopping online, which has great influence on the selection of consumers.
Disclosure of Invention
The technical problem to be solved by the invention is to provide a method and a system for displaying commodities in a virtual space through virtual glasses aiming at the defects in the prior art. The shopping system is used for solving the problems that physical shop shopping in the prior art needs a long time and wastes physical strength; the online shopping can not fully know the shape and the material of the product.
The technical means adopted for solving the technical problem of the invention is to provide a method for displaying commodities in a virtual space through virtual glasses, which comprises the following steps: s1, acquiring a virtual space, establishing a three-dimensional coordinate in a playing interval of the virtual glasses, and corresponding the virtual space to the three-dimensional coordinate; s2, acquiring relevant data of at least one commodity and the relative position of the commodity in the virtual space, and enabling the relative position of the commodity to correspond to the three-dimensional coordinate; and S3, corresponding the position of the commodity in the virtual space according to the position of the commodity in the three-dimensional coordinate, and displaying the commodity in the virtual space through the virtual glasses.
In an embodiment of the present invention, the step S1 includes the steps of: receiving the virtual space construction request; acquiring at least one environmental data; constructing the virtual background according to at least one of the environmental data; receiving a video picture, and replacing the picture in the video picture with the virtual background to obtain the picture of the virtual space; and displaying the picture of the virtual space by using the virtual glasses to form the virtual space.
In an embodiment of the present invention, the receiving the virtual space construction request includes: establishing a corresponding relation between the user identification of the virtual glasses and the virtual space; when the virtual space construction request is received, judging whether the established corresponding relation comprises a virtual space corresponding to the user identification; if yes, further acquiring a virtual background corresponding to the user identifier by using the established corresponding relation; if not, then the step is entered to obtain at least one environmental data.
In an embodiment of the invention, the step S1 further includes the steps of: generating a corresponding space picture for each frame of the picture of the virtual space; and gridding the space picture, and using a preset algorithm to correspond points on the gridded grid to the three-dimensional coordinates.
In an embodiment of the present invention, the step S2 includes the steps of: s21, acquiring related data of at least one commodity and the relative position of the commodity in the virtual space; s22, setting a base point for each of the commodities, and calculating coordinates of a relative position in the virtual space corresponding to the base point; s23, generating a corresponding commodity picture for each frame of the picture of each commodity; and S24, gridding the commodity picture, and corresponding the gridded commodity picture to the three-dimensional coordinate according to the coordinate of the base point.
The invention also provides a system for displaying the commodity in the virtual space through the virtual glasses, which comprises the following components: the system comprises an acquisition module, a display module and a display module, wherein the acquisition module is used for acquiring data related to a virtual space and at least one commodity and the relative position of the commodity in the virtual space; the processing module is used for establishing a three-dimensional coordinate in a playing interval of the virtual glasses, corresponding the virtual space to the three-dimensional coordinate and corresponding the relative position of the commodity to the three-dimensional coordinate; and the display module is used for displaying the commodity in the virtual space through virtual glasses according to the position of the commodity in the three-dimensional coordinate, which corresponds to the position of the commodity in the virtual space.
In an embodiment of the invention, the display module is further configured to display a picture of the virtual space by using the virtual glasses to form the virtual space; the acquisition module includes: a receiving unit, configured to receive the virtual space construction request and receive a video frame; an acquisition unit for acquiring at least one environmental data; a construction unit for constructing the virtual background according to at least one of the environmental data; and the replacing unit is used for replacing the picture in the video picture with the virtual background to obtain the picture of the virtual space.
In an embodiment of the present invention, the constructing unit is further configured to establish a corresponding relationship between the user identifier of the virtual glasses and the virtual space; when the virtual space construction request is received, judging whether the established corresponding relation comprises a virtual space corresponding to the user identification; when the virtual space corresponding to the user identification is included, the established corresponding relation is used, and the obtaining unit is informed of obtaining the virtual background corresponding to the user identification; and when the virtual space corresponding to the user identification is not included, the acquisition unit is informed to acquire at least one piece of environment data.
In an embodiment of the present invention, the processing module further includes: the conversion unit is used for generating a corresponding space picture for each frame of the picture of the virtual space; and the processing unit is used for gridding the space picture and using a preset algorithm to correspond the points on the gridded grid to the three-dimensional coordinates.
In an embodiment of the invention, the obtaining unit is further configured to obtain related data of at least one commodity and a relative position of the commodity in the virtual space; the conversion unit is also used for generating a corresponding commodity picture for each frame of the picture of each commodity; the processing unit is further used for setting a base point of each commodity and calculating coordinates of a relative position in the virtual space corresponding to the base point; and gridding the commodity picture, and corresponding the gridded commodity picture to the three-dimensional coordinate according to the coordinate of the base point.
The method and the system for displaying the commodity in the virtual space through the virtual glasses have the following beneficial effects:
the display is accurate, the commodity can be better displayed, and the user can conveniently know the shape and the state of the product.
Drawings
Fig. 1 is a schematic flow chart illustrating a method for displaying a commodity in a virtual space through virtual glasses according to the present invention.
Fig. 2 is a block diagram of a system for displaying merchandise in a virtual space through virtual glasses according to the present invention.
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
It will be understood that when an element is referred to as being "secured to" another element, it can be directly on the other element or intervening elements may also be present. When an element is referred to as being "connected" to another element, it can be directly connected to the other element or intervening elements may also be present. The terms "vertical," "horizontal," "left," "right," and the like as used herein are for illustrative purposes only.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs. The terminology used in the description of the invention herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used herein, the term "and/or" includes any and all combinations of one or more of the associated listed items.
As shown in fig. 1, fig. 1 is a schematic flow chart illustrating a method for displaying a commodity in a virtual space through virtual glasses according to the present invention. The invention provides a method for displaying commodities in a virtual space through virtual glasses, which comprises the following steps: s1, acquiring a virtual space, establishing a three-dimensional coordinate in a playing interval of the virtual glasses, and enabling the virtual space and the three-dimensional coordinate to correspond; s2, acquiring the relative data of at least one commodity and the relative position of the commodity in the virtual space, and corresponding the relative position of the commodity to the three-dimensional coordinate; and S3, according to the position of the commodity in the three-dimensional coordinate, corresponding the position of the commodity in the virtual space, and displaying the commodity in the virtual space through virtual glasses. Typically, virtual glasses include spherical concave mirrors and a display device disposed at a location outside the focal point of the spherical concave mirrors and within the center of the sphere. During playing, the display equipment plays the three-dimensional image, the three-dimensional image passes through the beam splitter and then forms the three-dimensional image after passing through the spherical concave mirror, and the three-dimensional image can be observed through the virtual glasses.
In an embodiment of the present invention, step S1 includes the steps of: receiving a virtual space construction request; acquiring at least one environmental data; constructing a virtual background from the at least one environmental data; receiving a video picture, and replacing the picture in the video picture with a virtual background to obtain a picture in a virtual space; and displaying the picture of the virtual space by using the virtual glasses to form the virtual space.
Further, receiving a virtual space construction request includes the steps of: establishing a corresponding relation between the user identification of the virtual glasses and the virtual space; when a virtual space construction request is received, judging whether the established corresponding relation comprises a virtual space corresponding to the user identification; if yes, the established corresponding relation is used for further acquiring a virtual background corresponding to the user identification; if not, then the step is entered to obtain at least one environmental data.
Further, step S1 further includes the steps of: generating a corresponding space picture for each frame of the picture of the virtual space; and gridding the spatial picture, and using a preset algorithm to correspond points on the gridded grid to three-dimensional coordinates. In this embodiment, the preset algorithm is a bilinear interpolation algorithm.
Preferably, the step S2 includes the steps of: s21, acquiring related data of at least one commodity and the relative position of the commodity in the virtual space; s22, setting a base point of each commodity, and calculating the coordinates of the relative position in the virtual space corresponding to the base point; s23, generating a corresponding commodity picture for each frame of the picture of each commodity; and S24, gridding the commodity picture, and corresponding the gridded commodity picture to the three-dimensional coordinate according to the coordinate of the base point.
As shown in fig. 2, fig. 2 is a block diagram of a system for displaying a commodity in a virtual space through virtual glasses according to the present invention. The invention also provides a system for displaying the commodity in the virtual space through the virtual glasses, which comprises the following components: the acquisition module is used for acquiring data related to the virtual space and at least one commodity and the relative position of the commodity in the virtual space; the processing module is used for establishing a three-dimensional coordinate in the playing interval of the virtual glasses, corresponding the virtual space to the three-dimensional coordinate and corresponding the relative position of the commodity to the three-dimensional coordinate; and the display module is used for displaying the commodity in the virtual space through the virtual glasses according to the position of the commodity in the three-dimensional coordinate, which corresponds to the position of the commodity in the virtual space. Typically, virtual glasses include spherical concave mirrors and a display device disposed at a location outside the focal point of the spherical concave mirrors and within the center of the sphere. During playing, the display equipment plays the three-dimensional image, the three-dimensional image passes through the beam splitter and then forms the three-dimensional image after passing through the spherical concave mirror, and the three-dimensional image can be observed through the virtual glasses.
In an embodiment of the invention, the display module is further configured to display a picture of the virtual space by using the virtual glasses to form the virtual space. The acquisition module comprises: a receiving unit, configured to receive a virtual space construction request and receive a video frame; an acquisition unit for acquiring at least one environmental data; a construction unit for constructing a virtual background from at least one environmental data; and the replacing unit is used for replacing the picture in the video picture with the virtual background to obtain the picture of the virtual space.
Further, the building unit is further configured to build a corresponding relationship between the user identifier of the virtual glasses and the virtual space; when a virtual space construction request is received, judging whether the established corresponding relation comprises a virtual space corresponding to the user identification; when the virtual space corresponding to the user identification is included, the established corresponding relation is used, and the acquisition unit is informed of acquiring the virtual background corresponding to the user identification; and when the virtual space corresponding to the user identification is not included, the acquisition unit is informed to acquire at least one piece of environment data.
Further, the processing module further comprises: the conversion unit is used for generating a corresponding space picture for each frame of the picture of the virtual space; and the processing unit is used for gridding the space picture and using a preset algorithm to correspond the points on the gridded grid to the three-dimensional coordinates. In this embodiment, the preset algorithm is a bilinear interpolation algorithm.
Preferably, the obtaining unit is further configured to obtain data related to at least one commodity and a relative position of the commodity in the virtual space; the conversion unit is also used for generating a corresponding commodity picture for each frame of the picture of each commodity; the processing unit is also used for setting a base point of each commodity and calculating the coordinates of the relative position in the virtual space corresponding to the base point; and gridding the commodity picture, and corresponding the gridded commodity picture to the three-dimensional coordinate according to the coordinate of the base point.
In summary, the method and the system for displaying the commodity in the virtual space through the virtual glasses provided by the invention have the advantages that the display is accurate, the commodity can be better displayed, and the user can conveniently know the shape and the state of the product. Has high commercial utilization and popularization value.
While the present invention has been described with reference to the embodiments shown in the drawings, the present invention is not limited to the embodiments, which are illustrative and not restrictive, and it will be apparent to those skilled in the art that various changes and modifications can be made therein without departing from the spirit and scope of the invention as defined in the appended claims.