CN115904201A - Virtual reality equipment, its control method, device, and computer storage medium - Google Patents
Virtual reality equipment, its control method, device, and computer storage medium Download PDFInfo
- Publication number
- CN115904201A CN115904201A CN202211436400.8A CN202211436400A CN115904201A CN 115904201 A CN115904201 A CN 115904201A CN 202211436400 A CN202211436400 A CN 202211436400A CN 115904201 A CN115904201 A CN 115904201A
- Authority
- CN
- China
- Prior art keywords
- virtual
- keyboard
- environment
- mouse
- virtual reality
- 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.)
- Pending
Links
Images
Landscapes
- User Interface Of Digital Computer (AREA)
Abstract
本申请公开了一种虚拟现实设备及其控制方法、装置以及计算机存储介质,属于虚拟现实技术领域。该方法包括:通过图像采集组件获取设备主体外部环境的环境图像;在环境图像中进行平面检测;在虚拟现实设备的虚拟环境中展示检测到的至少一个平面;响应于在环境图像中识别到键盘,在虚拟现实设备的虚拟环境中键盘的对应位置生成虚拟键盘;响应于虚拟键盘被放置在至少一个平面中的目标平面上,在虚拟环境中目标平面的对应位置建立虚拟桌面;获取鼠标的输入信号;基于鼠标的输入信号,在虚拟环境中生成鼠标对应的选择射线。如此便能够通过外部的鼠标以及键盘来对虚拟环境进行控制,降低了误触的可能性。
The application discloses a virtual reality device, its control method, device and computer storage medium, belonging to the technical field of virtual reality. The method includes: acquiring an environment image of the external environment of the device body through an image acquisition component; performing plane detection in the environment image; displaying at least one detected plane in the virtual environment of the virtual reality device; responding to recognizing the keyboard in the environment image , generating a virtual keyboard at the corresponding position of the keyboard in the virtual environment of the virtual reality device; in response to the virtual keyboard being placed on the target plane in at least one plane, establishing a virtual desktop at the corresponding position of the target plane in the virtual environment; obtaining the input of the mouse Signal; based on the input signal of the mouse, a selection ray corresponding to the mouse is generated in the virtual environment. In this way, the virtual environment can be controlled through an external mouse and keyboard, reducing the possibility of false touches.
Description
技术领域technical field
本申请涉及虚拟现实技术领域,特别涉及一种虚拟现实设备及其控制方法、装置以及计算机存储介质。The present application relates to the technical field of virtual reality, and in particular to a virtual reality device, its control method, device and computer storage medium.
背景技术Background technique
虚拟现实设备是一种能够向用户提供虚拟现实体验的设备。基于不同的应用场景,虚拟现实设备能够提供不同的功能,如游戏、影视以及办公等。A virtual reality device is a device that can provide a user with a virtual reality experience. Based on different application scenarios, virtual reality devices can provide different functions, such as games, film and television, and office work.
一种虚拟现实设备的控制方法,用于向用户提供办公场景,在该方法中,首先在虚拟环境中生成虚拟桌面,并在虚拟桌面上生成虚拟键盘,并通过摄像头拍摄用户的手部图像,以在虚拟环境中生成手部的模型。当用户的手部模型触碰到虚拟键盘的对应按键时,可以获取按键对应的信息。A control method of a virtual reality device, which is used to provide an office scene to a user. In the method, a virtual desktop is first generated in a virtual environment, a virtual keyboard is generated on the virtual desktop, and an image of the user's hand is captured by a camera. to generate a model of the hand in a virtual environment. When the user's hand model touches a corresponding key of the virtual keyboard, information corresponding to the key can be obtained.
但是,上述方法中用户误触的可能性较大,导致上述方法的准确性较低。However, in the above method, the possibility of the user touching by mistake is relatively high, resulting in low accuracy of the above method.
发明内容Contents of the invention
本申请实施例提供了一种虚拟现实设备及其控制方法、装置以及计算机存储介质。所述技术方案如下:Embodiments of the present application provide a virtual reality device and its control method, device, and computer storage medium. Described technical scheme is as follows:
根据本申请实施例的一方面,提供一种虚拟现实设备的控制方法,用于虚拟现实设备,所述虚拟现实设备包括设备主体、键盘以及鼠标,所述设备主体上具有图像采集组件,所述方法包括:According to an aspect of the embodiment of the present application, a method for controlling a virtual reality device is provided, which is used for a virtual reality device. The virtual reality device includes a device body, a keyboard, and a mouse, and the device body has an image acquisition component. The Methods include:
通过所述图像采集组件获取所述设备主体外部环境的环境图像;Acquiring an environmental image of the external environment of the device body through the image acquisition component;
在所述环境图像中进行平面检测;performing plane detection in the environment image;
在所述虚拟现实设备的虚拟环境中展示检测到的至少一个平面;displaying the detected at least one plane in a virtual environment of the virtual reality device;
响应于在所述环境图像中识别到所述键盘,在所述虚拟现实设备的虚拟环境中所述键盘的对应位置生成虚拟键盘;in response to identifying the keyboard in the environment image, generating a virtual keyboard at a corresponding location of the keyboard in the virtual environment of the virtual reality device;
响应于所述虚拟键盘被放置在所述至少一个平面中的目标平面上,在所述虚拟环境中所述目标平面的对应位置建立虚拟桌面;Responsive to the virtual keyboard being placed on a target plane in the at least one plane, establishing a virtual desktop at a corresponding location of the target plane in the virtual environment;
获取所述鼠标的输入信号;obtaining an input signal of the mouse;
基于所述鼠标的输入信号,在所述虚拟环境中生成所述鼠标对应的选择射线。Based on the input signal of the mouse, a selection ray corresponding to the mouse is generated in the virtual environment.
可选地,所述基于所述鼠标的输入信号,在所述虚拟环境中生成所述鼠标对应的选择射线,包括:Optionally, the generating a selection ray corresponding to the mouse in the virtual environment based on the input signal of the mouse includes:
基于所述鼠标的输入信号获取所述鼠标的平面坐标;acquiring the plane coordinates of the mouse based on the input signal of the mouse;
将所述平面坐标转换为所述虚拟环境中的世界坐标;transforming the plane coordinates into world coordinates in the virtual environment;
基于所述世界坐标以及所述虚拟环境中虚拟相机的朝向生成所述选择射线,所述选择射线穿过所述世界坐标,且方向与所述虚拟相机的朝向平行。The selection ray is generated based on the world coordinates and the orientation of the virtual camera in the virtual environment, the selection ray passes through the world coordinates, and the direction is parallel to the orientation of the virtual camera.
可选地,所述基于所述世界坐标以及所述虚拟环境中虚拟相机的朝向生成所述选择射线之后,所述方法还包括:Optionally, after generating the selection ray based on the world coordinates and the orientation of the virtual camera in the virtual environment, the method further includes:
对所述选择射线与所述虚拟环境中的物体进行碰撞检测;performing collision detection on the selected ray and objects in the virtual environment;
将所述选择射线碰撞到的第一个物体确定为所述鼠标当前选中的物体。The first object collided by the selection ray is determined as the object currently selected by the mouse.
可选地,所述获取所述鼠标的输入信号之前,所述方法还包括:Optionally, before acquiring the input signal of the mouse, the method further includes:
响应于在所述环境图像中识别到所述鼠标,在所述虚拟现实设备的虚拟环境中所述鼠标的对应位置生成虚拟鼠标。In response to identifying the mouse in the environment image, a virtual mouse is generated at a corresponding location of the mouse in the virtual environment of the virtual reality device.
可选地,所述在所述环境图像中进行平面检测,包括:Optionally, the performing plane detection in the environment image includes:
通过随机抽样一致算法、霍夫变换算法或区域增长聚类算法在所述环境图像中进行平面检测。The plane detection is performed in the environment image by a random sampling consensus algorithm, a Hough transform algorithm or a region growing clustering algorithm.
可选地,所述在所述虚拟现实设备的虚拟环境中所述键盘的对应位置生成虚拟键盘,包括:Optionally, the generating a virtual keyboard at a corresponding position of the keyboard in the virtual environment of the virtual reality device includes:
检测所述键盘是否具有预设的多个特征中的任一特征;Detecting whether the keyboard has any one of a plurality of preset characteristics;
在所述键盘具有所述任一特征时,获取所述任一特征对应的键盘模型;When the keyboard has any of the features, obtain a keyboard model corresponding to any of the features;
在所述虚拟现实设备的虚拟环境中所述键盘的对应位置加载所述键盘模型。The keyboard model is loaded at the corresponding position of the keyboard in the virtual environment of the virtual reality device.
可选地,所述特征包括预设的按键排布方式、预设的光学标记以及预设的外形中的至少一种。Optionally, the feature includes at least one of a preset key arrangement, a preset optical mark, and a preset shape.
可选地,所述在所述虚拟现实设备的虚拟环境中所述键盘的对应位置加载所述键盘模型,包括:Optionally, loading the keyboard model at the corresponding position of the keyboard in the virtual environment of the virtual reality device includes:
通过所述环境图像确定所述键盘在所述虚拟环境中的位置以及姿态;determining the position and posture of the keyboard in the virtual environment through the environment image;
基于所述位置以及姿态在所述虚拟环境中加载所述键盘模型。and loading the keyboard model in the virtual environment based on the position and posture.
可选地,所述方法还包括:Optionally, the method also includes:
在所述键盘不具有所述预设特征时,基于所述键盘的图像生成所述键盘的第一模型;When the keyboard does not have the preset feature, generating a first model of the keyboard based on the image of the keyboard;
在所述虚拟现实设备的虚拟环境中所述键盘的对应位置加载所述第一模型。The first model is loaded at a corresponding position of the keyboard in the virtual environment of the virtual reality device.
根据本申请实施例的另一方面,提供一种虚拟现实设备的控制装置,所述虚拟现实设备包括设备主体、键盘以及鼠标,所述设备主体上具有图像采集组件,所述虚拟现实设备的控制装置包括:According to another aspect of the embodiment of the present application, a control device for a virtual reality device is provided. The virtual reality device includes a device body, a keyboard, and a mouse. The device body has an image acquisition component. The control device for the virtual reality device Devices include:
图像获取模块,用于通过所述图像采集组件获取所述设备主体外部环境的环境图像;An image acquisition module, configured to acquire an environmental image of the external environment of the device main body through the image acquisition component;
平面检测模块,用于在所述环境图像中进行平面检测;a plane detection module, configured to perform plane detection in the environment image;
平面展示模块,用于在所述虚拟现实设备的虚拟环境中展示检测到的至少一个平面;A plane display module, configured to display at least one detected plane in the virtual environment of the virtual reality device;
键盘生成模块,用于响应于在所述环境图像中识别到所述键盘,在所述虚拟现实设备的虚拟环境中所述键盘的对应位置生成虚拟键盘;a keyboard generation module, configured to generate a virtual keyboard at a corresponding position of the keyboard in the virtual environment of the virtual reality device in response to the recognition of the keyboard in the environment image;
桌面建立模块,用于响应于所述虚拟键盘被放置在所述至少一个平面中的目标平面上,在所述虚拟环境中所述目标平面的对应位置建立虚拟桌面;a desktop creation module, configured to create a virtual desktop at a corresponding position of the target plane in the virtual environment in response to the virtual keyboard being placed on the target plane in the at least one plane;
输入获取模块,用于获取所述鼠标的输入信号;an input acquisition module, configured to acquire an input signal of the mouse;
射线建立模块,用于基于所述鼠标的输入信号,在所述虚拟环境中生成所述鼠标对应的选择射线。The ray creation module is configured to generate a selection ray corresponding to the mouse in the virtual environment based on the input signal of the mouse.
可选地,所述射线建立模块,用于:Optionally, the ray building module is used for:
基于所述鼠标的输入信号获取所述鼠标的平面坐标;acquiring the plane coordinates of the mouse based on the input signal of the mouse;
将所述平面坐标转换为所述虚拟环境中的世界坐标;transforming the plane coordinates into world coordinates in the virtual environment;
基于所述世界坐标以及所述虚拟环境中虚拟相机的朝向生成所述选择射线,所述选择射线穿过所述世界坐标,且方向与所述虚拟相机的朝向平行。The selection ray is generated based on the world coordinates and the orientation of the virtual camera in the virtual environment, the selection ray passes through the world coordinates, and the direction is parallel to the orientation of the virtual camera.
根据本申请实施例的另一方面,提供一种虚拟现实设备,所述虚拟现实设备包括处理器和存储器,所述存储器中存储有至少一条指令、至少一段程序、代码集或指令集,所述至少一条指令、所述至少一段程序、所述代码集或指令集由所述处理器加载并执行以实现如上述的虚拟现实设备的控制方法。According to another aspect of the embodiments of the present application, a virtual reality device is provided, the virtual reality device includes a processor and a memory, and at least one instruction, at least one program, a code set or an instruction set are stored in the memory, the At least one instruction, the at least one program, the code set or the instruction set are loaded and executed by the processor to implement the above-mentioned virtual reality device control method.
根据本申请实施例的另一方面,提供一种计算机存储介质,所述计算机存储介质中存储有至少一条指令、至少一段程序、代码集或指令集,所述至少一条指令、所述至少一段程序、所述代码集或指令集由处理器加载并执行以实现如上述的虚拟现实设备的控制方法。According to another aspect of the embodiments of the present application, a computer storage medium is provided, wherein at least one instruction, at least one section of program, code set or instruction set is stored in the computer storage medium, and the at least one instruction, the at least one section of program . The code set or instruction set is loaded and executed by the processor to implement the control method of the virtual reality device as described above.
根据本申请实施例的另一方面,提供了一种计算机程序产品或计算机程序,该计算机程序产品或计算机程序包括计算机指令,该计算机指令存储在计算机可读存储介质中。计算机设备的处理器从计算机可读存储介质读取该计算机指令,处理器执行该计算机指令,使得该计算机设备执行上述的各种可选实现方式中提供的方法。According to another aspect of the embodiments of the present application, a computer program product or computer program is provided, the computer program product or computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. The processor of the computer device reads the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the computer device executes the methods provided in the various optional implementation manners above.
本申请实施例提供的技术方案带来的有益效果至少包括:The beneficial effects brought by the technical solutions provided by the embodiments of the present application at least include:
通过在虚拟现实设备的虚拟环境中展示检测到的外部环境中的至少一个平面,并在虚拟环境中生成键盘所对应的虚拟键盘,之后在虚拟键盘放置的平面所在位置建立虚拟桌面,再将鼠标的输入信号转换为虚拟环境中的选择射线,如此便能够通过外部的鼠标以及键盘来对虚拟环境进行控制,降低了误触的可能性,实现了提升虚拟现实设备的控制方法的准确性的效果。By displaying at least one plane in the detected external environment in the virtual environment of the virtual reality device, and generating a virtual keyboard corresponding to the keyboard in the virtual environment, and then establishing a virtual desktop at the position of the plane where the virtual keyboard is placed, and then placing the mouse The input signal of the input signal is converted into a selection ray in the virtual environment, so that the virtual environment can be controlled through an external mouse and keyboard, reducing the possibility of false touch, and achieving the effect of improving the accuracy of the control method of the virtual reality device .
另外,本申请实施例提供的方法中,将鼠标的输入信号转换至虚拟环境中对应的选择射线,以便于用户直接通过办公时常用的鼠标在虚拟环境进行对应的控制,而无需使用虚拟现实设备专用的手柄,节省了成本,且降低了用户的学习成本,提高了用户体验。In addition, in the method provided by the embodiment of the present application, the input signal of the mouse is converted to the corresponding selection ray in the virtual environment, so that the user can directly use the mouse commonly used in office to perform corresponding control in the virtual environment without using a virtual reality device The dedicated handle saves costs, reduces user learning costs, and improves user experience.
附图说明Description of drawings
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings that need to be used in the description of the embodiments will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present application. For those skilled in the art, other drawings can also be obtained based on these drawings without creative effort.
图1是本申请实施例中一种实施环境的示意图;FIG. 1 is a schematic diagram of an implementation environment in an embodiment of the present application;
图2是本申请实施例提供的一种虚拟现实设备的控制方法的方法流程图;Fig. 2 is a method flowchart of a method for controlling a virtual reality device provided by an embodiment of the present application;
图3是本申请实施例提供的另一种虚拟现实设备的控制方法的方法流程图;Fig. 3 is a method flow chart of another control method of a virtual reality device provided by an embodiment of the present application;
图4是本申请实施例提供方法中一种虚拟环境的示意图;Fig. 4 is a schematic diagram of a virtual environment in the method provided by the embodiment of the present application;
图5是本申请实施例提供的一种虚拟现实设备的控制装置的框图。Fig. 5 is a block diagram of a control device for a virtual reality device provided by an embodiment of the present application.
通过上述附图,已示出本申请明确的实施例,后文中将有更详细的描述。这些附图和文字描述并不是为了通过任何方式限制本申请构思的范围,而是通过参考特定实施例为本领域技术人员说明本申请的概念。By means of the above drawings, specific embodiments of the present application have been shown, which will be described in more detail hereinafter. These drawings and text descriptions are not intended to limit the scope of the concept of the application in any way, but to illustrate the concept of the application for those skilled in the art by referring to specific embodiments.
具体实施方式Detailed ways
为使本申请的目的、技术方案和优点更加清楚,下面将结合附图对本申请实施方式作进一步地详细描述。In order to make the purpose, technical solution and advantages of the present application clearer, the implementation manners of the present application will be further described in detail below in conjunction with the accompanying drawings.
本申请实施例提供的虚拟现实设备的控制方法,可以应用于虚拟现实设备中,如图1所示,图1是本申请实施例中一种实施环境的示意图,该实施环境中可以包括虚拟现实设,该虚拟现实设备可以包括设备主体11、键盘12以及鼠标13,设备主体11上具有图像采集组件111。The control method of the virtual reality device provided by the embodiment of the present application can be applied to the virtual reality device, as shown in Figure 1, which is a schematic diagram of an implementation environment in the embodiment of the application, and the implementation environment can include a virtual reality It is assumed that the virtual reality device may include a device main body 11 , a
其中,设备主体11可以为虚拟现实(Virtual Reality,VR)眼镜、虚拟现实头盔等各种头戴式虚拟现实装置。设备主体11可以为六自由度(6DOF)的虚拟现实装置,以便于用户能够拥有更好的体验。该设备主体11上具有图像采集组件111,该图像采集组件111可以朝向佩戴有设备主体11的用户的正前方,以便于获取用户正前方的环境的图像。图像采集组件111可以包括可见光摄像头、深度摄像头等。设备主体11可以具有显示屏,用户通过观看该显示屏可以获得虚拟现实的体验。Wherein, the device main body 11 may be various head-mounted virtual reality devices such as virtual reality (Virtual Reality, VR) glasses, virtual reality helmets, and the like. The device main body 11 can be a six degrees of freedom (6DOF) virtual reality device, so that users can have a better experience. The device main body 11 has an
键盘12可以为与设备主体11建立有无线连接或有线连接,示例性的,键盘12可以与设备主体11建立有蓝牙连接。该键盘12可以为预设型号的键盘,设备主体11中可以存储有预先建立的该预设型号的键盘的模型。The
鼠标13可以为与设备主体11建立有无线连接或有线连接,示例性的,鼠标13可以与设备主体11建立有蓝牙连接。该鼠标13也可以为预设型号的鼠标,设备主体11中可以存储有预先建立的该预设型号的鼠标的模型。The mouse 13 can establish a wireless connection or a wired connection with the device main body 11 , for example, the mouse 13 can establish a Bluetooth connection with the device main body 11 . The mouse 13 may also be a mouse of a preset model, and a pre-established model of the mouse of the preset model may be stored in the device main body 11 .
键盘12和鼠标13可以位于桌面D上。键盘12以及鼠标13与设备主体11无线连接时,延迟可以在20毫秒以内,以保证用户体验。A
此外,该虚拟现实设备10还可以包括虚拟现实主机,该虚拟现实主机可以作为设备主体11的信号源,为设备主体11提供控制信息,以及经过处理的图像数据。该虚拟现实主机可以部分或者全部结合设置于设备主体11中,或者,可以位于设备主体11外。该虚拟现实主机中可以具有控制组件,用于控制设备主体11。In addition, the virtual reality device 10 can also include a virtual reality host, which can serve as a signal source for the device main body 11 and provide control information and processed image data for the device main body 11 . The virtual reality host can be partly or fully set in the device main body 11 , or can be located outside the device main body 11 . The virtual reality host may have a control component for controlling the device main body 11 .
本申请实施例提供的虚拟现实设备的控制方法,可以向用户提供一种虚实结合的应用场景,用户可以利用该场景进行办公、娱乐等各种活动。The method for controlling a virtual reality device provided in the embodiment of the present application can provide a user with an application scene combining virtual reality, and the user can use the scene for various activities such as office work and entertainment.
图2是本申请实施例提供的一种虚拟现实设备的控制方法的方法流程图,该方法可以用于图1所示的虚拟现实设备,该方法可以包括下面几个步骤:Fig. 2 is a method flowchart of a method for controlling a virtual reality device provided by an embodiment of the present application, the method can be used for the virtual reality device shown in Fig. 1, and the method may include the following steps:
步骤201、通过图像采集组件获取设备主体外部环境的环境图像。
步骤202、在环境图像中进行平面检测。
步骤203、在虚拟现实设备的虚拟环境中展示检测到的至少一个平面。
步骤204、响应于在环境图像中识别到键盘,在虚拟现实设备的虚拟环境中键盘的对应位置生成虚拟键盘。Step 204: In response to recognizing the keyboard in the environment image, generate a virtual keyboard at a corresponding position of the keyboard in the virtual environment of the virtual reality device.
步骤205、响应于虚拟键盘被放置在至少一个平面中的目标平面上,在虚拟环境中目标平面的对应位置建立虚拟桌面。Step 205: In response to the virtual keyboard being placed on the target plane in at least one plane, create a virtual desktop at a corresponding position of the target plane in the virtual environment.
步骤206、获取鼠标的输入信号。
步骤207、基于鼠标的输入信号,在虚拟环境中生成鼠标对应的选择射线。
综上所述,本申请实施例提供的虚拟现实设备的控制方法,通过在虚拟现实设备的虚拟环境中展示检测到的外部环境中的至少一个平面,并在虚拟环境中生成键盘所对应的虚拟键盘,之后在虚拟键盘放置的平面所在位置建立虚拟桌面,再将鼠标的输入信号转换为虚拟环境中的选择射线,如此便能够通过外部的鼠标以及键盘来对虚拟环境进行控制,降低了误触的可能性,实现了提升虚拟现实设备的控制方法的准确性的效果。To sum up, the control method of the virtual reality device provided by the embodiment of the present application displays at least one plane in the detected external environment in the virtual environment of the virtual reality device, and generates a virtual plane corresponding to the keyboard in the virtual environment. Keyboard, and then establish a virtual desktop at the position of the plane where the virtual keyboard is placed, and then convert the input signal of the mouse into a selection ray in the virtual environment, so that the virtual environment can be controlled through the external mouse and keyboard, reducing false touches possibility, the effect of improving the accuracy of the control method of the virtual reality device is achieved.
另外,本申请实施例提供的方法中,将鼠标的输入信号转换至虚拟环境中对应的选择射线,以便于用户直接通过办公时常用的鼠标在虚拟环境进行对应的控制,而无需使用虚拟现实设备专用的手柄,节省了成本,且降低了用户的学习成本,提高了用户体验。In addition, in the method provided by the embodiment of the present application, the input signal of the mouse is converted to the corresponding selection ray in the virtual environment, so that the user can directly use the mouse commonly used in office to perform corresponding control in the virtual environment without using a virtual reality device The dedicated handle saves costs, reduces user learning costs, and improves user experience.
图3是本申请实施例提供的另一种虚拟现实设备的控制方法的方法流程图,该方法可以用于图1所示的虚拟现实设备,该方法可以包括下面几个步骤:Fig. 3 is a method flow chart of another method for controlling a virtual reality device provided by an embodiment of the present application. This method can be used for the virtual reality device shown in Fig. 1, and the method may include the following steps:
步骤301、通过图像采集组件获取设备主体外部环境的环境图像。
该图像采集组件可以持续获取备主体外部环境的环境图像,该环境图像是佩戴有设备主体的用户周围的环境的图像,可以便于设备主体基于该图像对虚拟现实设备的虚拟环境进行对应的显示。示例性的,当图像采集组件朝向设备主体的正前方(设备主体的正前方可以与佩戴设备主体的用户的正前方为同一方向)时,该环境图像可以反应佩戴有设备主体的用户正前方的环境,并基于该环境图像在虚拟环境中用户的正前方进行相应的内容展示。The image acquisition component can continuously acquire the environment image of the external environment of the device body. The environment image is an image of the environment around the user wearing the device body, which can facilitate the device body to display the virtual environment of the virtual reality device based on the image. Exemplarily, when the image acquisition component faces the front of the device body (the front of the device body may be in the same direction as the front of the user wearing the device body), the environment image may reflect the front of the user wearing the device body. environment, and display corresponding content in front of the user in the virtual environment based on the environment image.
本申请实施例提供的方法可以应用于虚拟现实设备的控制组件中,该控制组件可以位于设备主体中,或者,也可以位于设备主体外。当控制组件位于设备主体外时,控制组件与设备主体建立有无线连接或有线连接。The method provided by the embodiment of the present application can be applied to a control component of a virtual reality device, and the control component can be located in the device main body, or can also be located outside the device main body. When the control component is located outside the device main body, the control component establishes a wireless connection or a wired connection with the device main body.
步骤302、在环境图像中进行平面检测。
控制组件可以在图像采集组件获取的环境图像中进行平面检测,以检测主体外部环境中存在的平面。由于检测主体外部环境为真实环境,通常较为复杂,会存在较多的平面,如桌面、地面,墙面以及天花板等,进而进行平面检测后,可以检测出多个平面。The control component can perform plane detection in the environment image acquired by the image acquisition component, so as to detect the plane existing in the external environment of the subject. Since the external environment of the detection subject is a real environment, it is usually relatively complex, and there will be many planes, such as desktops, floors, walls, and ceilings, etc. After performing plane detection, multiple planes can be detected.
在一种示例性的实施例中,控制组件可以通过随机抽样一致算法(RANdom SAmpleConsensus,RANSAC)、霍夫变换算法或区域增长聚类算法在环境图像中进行平面检测。In an exemplary embodiment, the control component may perform plane detection in the environment image through a random sampling consensus algorithm (RANdom SAmple Consensus, RANSAC), a Hough transform algorithm, or a region growing clustering algorithm.
随机抽样一致算法是一种根据一组包含异常数据的样本数据集,计算出数据的数学模型参数,从而得到有效样本数据的算法。随机抽样一致算法广泛应用于计算机视觉中。在应用随机抽样一致算法进行平面检测时,可以循环使用随机抽样一致算法来针对环境图案进行平面检测,当达到循环终止条件(如循环到平面面积为设定的最小阈值)时,终止循环随机抽样一致算法。The random sampling consensus algorithm is an algorithm that calculates the mathematical model parameters of the data based on a set of sample data sets containing abnormal data, thereby obtaining effective sample data. Random sampling consensus algorithms are widely used in computer vision. When applying the random sampling consensus algorithm for plane detection, the random sampling consensus algorithm can be used cyclically to perform plane detection for environmental patterns. When the loop termination condition is reached (such as the loop to the plane area is the set minimum threshold), the loop random sampling is terminated. consensus algorithm.
霍夫变换算法是一种特征提取(feature extraction)算法,霍夫变换算法被广泛应用在图像分析(image analysis)、计算机视觉(computer vision)以及数位影像处理(digital image processing)。霍夫变换算法可以用来辨别找出图像中的各种特征。本申请实施例中,可以应用霍夫变换算法来检测环境图像中的平面。The Hough transform algorithm is a feature extraction algorithm. The Hough transform algorithm is widely used in image analysis, computer vision and digital image processing. The Hough transform algorithm can be used to identify various features in an image. In the embodiment of the present application, a Hough transform algorithm may be applied to detect planes in the environment image.
区域增长聚类算法是一种基于区域生长的网络分割算法,属于局部贪婪算法的一种。本申请实施例中,可以应用区域增长聚类算法来检测环境图像中的平面。The region growing clustering algorithm is a network segmentation algorithm based on region growing, which belongs to a kind of local greedy algorithm. In the embodiment of the present application, a region growing clustering algorithm may be applied to detect planes in the environment image.
通过随机抽样一致算法、霍夫变换算法或区域增长聚类算法进行平面检测的具体过程可以参考相关技术,本申请实施例在此不再赘述。For the specific process of plane detection through the random sampling consensus algorithm, the Hough transform algorithm, or the region growing clustering algorithm, reference may be made to related technologies, and the embodiments of the present application will not repeat them here.
步骤303、在虚拟现实设备的虚拟环境中展示检测到的至少一个平面。Step 303: Display the detected at least one plane in the virtual environment of the virtual reality device.
控制组件可以在虚拟现实设备的虚拟环境中展示检测到的至少一个平面,以便于用户在虚拟环境中可以看到检测到的至少一个平面。该控制组件可以在虚拟环境中的对应位置展示检测到的至少一个平面,进而该至少一个平面便能够反映出现实环境中各种平面以及物体的位置,如此可以便于用户基于虚拟环境中所展示的至少一个平面,来获知现实环境中各种平面的位置,这一方面可以便于用户基于展示出的平面来确定办公时作为桌面的平面,另一方面可以避免用户与这些平面发生碰撞。The control component can display the detected at least one plane in the virtual environment of the virtual reality device, so that the user can see the detected at least one plane in the virtual environment. The control component can display the detected at least one plane at a corresponding position in the virtual environment, and then the at least one plane can reflect the positions of various planes and objects in the real environment, so that it is convenient for the user to At least one plane is used to know the positions of various planes in the real environment. On the one hand, it can facilitate the user to determine the plane used as the desktop during office work based on the displayed plane, and on the other hand, it can prevent the user from colliding with these planes.
在虚拟环境中,可以通过多种方式来展示平面,例如可以通过网格图形来标示出平面,或者,可以由模型来标识出平面,或者,可以通过点阵来标示出平面,或者,可以通过阵列排布的多个十字形图案来标示出平面等,本申请实施例对此不进行限制。In the virtual environment, planes can be displayed in various ways, for example, planes can be marked by grid graphics, or planes can be marked by models, planes can be marked by dot matrix, or planes can be marked by A plurality of cross-shaped patterns arranged in an array are used to mark planes and the like, which is not limited in this embodiment of the present application.
步骤304、响应于在环境图像中识别到键盘,检测键盘是否具有预设的多个特征中的任一特征。Step 304: In response to recognizing the keyboard in the environment image, detect whether the keyboard has any one of a plurality of preset characteristics.
控制组件可以在环境图像中进行键盘检测,由于键盘具有阵列排布的多个按键,且按键上均具有字母或符号,整体的特征较为明显,当键盘出现在图像采集组件的视野范围内时,控制组件可以基于图像采集组件所采集得到的环境图像识别到键盘,并对键盘进行实时跟踪。The control component can perform keyboard detection in the environment image. Since the keyboard has multiple keys arranged in an array, and the keys have letters or symbols, the overall characteristics are more obvious. When the keyboard appears within the field of view of the image acquisition component, The control component can recognize the keyboard based on the environment image collected by the image acquisition component, and track the keyboard in real time.
控制组件可以在环境图像检测到键盘时,检测该键盘是否具有预设的多个特征中的任一特征。其中,该特征包括预设的按键排布方式、预设的光学标记以及预设的外形中的至少一种。该预设特征可以是预先确定的一种或多种键盘所具有的特征。The control component can detect whether the keyboard has any one of the preset characteristics when the keyboard is detected in the environment image. Wherein, the feature includes at least one of a preset key arrangement, a preset optical mark, and a preset shape. The preset feature may be one or more predetermined features of the keyboard.
步骤305、在键盘具有任一特征时,获取任一特征对应的键盘模型。
设备主体中可以预先存储上述预设的每个特征对应的键盘模型,控制组件在识别到的键盘具有任一特征时,可以从设备主体本地的存储中获取该任一特征对应的键盘模型。The keyboard model corresponding to each preset feature can be pre-stored in the device body, and when the control component recognizes that the keyboard has any feature, it can obtain the keyboard model corresponding to any feature from the local storage of the device body.
示例性的,上述特征为预设的光学标记,该光学标记具体可以为键盘型号的标记,当控制组件检测到的键盘具有其中的一个键盘型号的标记时,可以从本地存储中获取该键盘型号的标记所对应的键盘模型。Exemplarily, the above feature is a preset optical mark, and the optical mark can specifically be a mark of a keyboard model. When the control component detects that the keyboard has a mark of one of the keyboard models, the keyboard model can be obtained from the local storage The keyboard model corresponding to the tag of .
在一种示例性的实施例中,设备主体中可以预先存储有这一种或多种键盘的精细模型,该精细模型的精细程度较高,且可以具有对应的一些特效,如灯效以及动画效果等,如此有利于提高用户体验。In an exemplary embodiment, the fine model of the one or more keyboards may be pre-stored in the main body of the device. The fine model has a high degree of fineness and may have corresponding special effects, such as lighting effects and animations. effects, etc., which is conducive to improving user experience.
另外,控制组件可以在键盘不具有预设特征时,基于识别到的键盘的图像生成键盘的第一模型,并在虚拟现实设备的虚拟环境中键盘的对应位置加载该第一模型。该第一模型的精细程度,可以低于上述设备主体中预先存储的键盘模型,以降低处理组件的运算压力。In addition, the control component may generate a first model of the keyboard based on the recognized image of the keyboard when the keyboard does not have preset features, and load the first model at the corresponding position of the keyboard in the virtual environment of the virtual reality device. The fineness of the first model may be lower than that of the keyboard model pre-stored in the main body of the device, so as to reduce the computing pressure of the processing component.
步骤306、在虚拟现实设备的虚拟环境中键盘的对应位置加载键盘模型。
控制组件在获取了键盘模型后,可以在虚拟现实设备的虚拟环境中键盘的对应位置加载键盘模型。当图像采集组件持续获取环境图像时,控制组件便可以实时的在虚拟现实设备的虚拟环境中对应位置(该对应位置可以是指现实环境中的键盘在虚拟环境中对应的位置)加载键盘模型,此种情况下,实现了将现实环境中的键盘投影到了虚拟环境中的效果。用户在现实环境中拿起键盘,并移动键盘的过程中,虚拟环境中的键盘也会随之移动。After the control component acquires the keyboard model, it can load the keyboard model at the corresponding position of the keyboard in the virtual environment of the virtual reality device. When the image acquisition component continues to acquire the environment image, the control component can load the keyboard model in real time at the corresponding position in the virtual environment of the virtual reality device (the corresponding position can refer to the corresponding position of the keyboard in the real environment in the virtual environment), In this case, the effect of projecting the keyboard in the real environment into the virtual environment is realized. When the user picks up the keyboard in the real environment and moves the keyboard, the keyboard in the virtual environment will also move accordingly.
在一种示例性的实施例中,控制组件可以通过环境图像确定键盘在虚拟环境中的位置以及姿态,并基于位置以及姿态在虚拟环境中加载键盘模型,以实现键盘模型更为准确的移动,提高用户体验。In an exemplary embodiment, the control component can determine the position and posture of the keyboard in the virtual environment through the environment image, and load the keyboard model in the virtual environment based on the position and posture, so as to realize more accurate movement of the keyboard model, Improve user experience.
步骤307、响应于虚拟键盘被放置在至少一个平面中的目标平面上,在虚拟环境中目标平面的对应位置建立虚拟桌面。Step 307: In response to the virtual keyboard being placed on the target plane in at least one plane, create a virtual desktop at a corresponding position of the target plane in the virtual environment.
当控制组件检测到虚拟键盘被放置在至少一个平面中的目标平面上,表明该目标平面为用户选定的用于作为办公桌面的平面,则控制组件可以在虚拟环境中目标平面的对应位置建立虚拟桌面。该虚拟桌面可以具有办公桌类似的外形,或者,控制组件可以预先存储有多种虚拟桌面的模型(不同虚拟桌面的模型的外形以及材质不同),可以由用户选择其中的一种。When the control component detects that the virtual keyboard is placed on the target plane in at least one plane, indicating that the target plane is the plane selected by the user as the office desktop, the control component can establish the corresponding position of the target plane in the virtual environment virtual desktop. The virtual desktop may have a desk-like appearance, or the control component may pre-store multiple virtual desktop models (different virtual desktop models have different shapes and materials), and the user may select one of them.
至步骤307结束,本申请实施例提供的方法向用户提供的虚拟桌面以及位于虚拟桌面上的虚拟键盘,该虚拟键盘可以为显示环境中实体的键盘的投影,用户操作显示环境中的实体的键盘时,虚拟键盘可以做出对应的反馈,且控制组件可以获取用户输入的信息,并基于该信息进行对应的控制。且用户操作实体的键盘时,误触的可能性较低,如此便能够提高该方法的准确性。At the end of
步骤308、响应于在环境图像中识别到鼠标,在虚拟现实设备的虚拟环境中鼠标的对应位置生成虚拟鼠标。Step 308: In response to recognizing the mouse in the environment image, generate a virtual mouse at a corresponding position of the mouse in the virtual environment of the virtual reality device.
控制组件可以在环境图像中进行鼠标识别,并在识别到鼠标时,在虚拟现实设备的虚拟环境中鼠标的对应位置生成虚拟鼠标。当图像采集组件持续获取环境图像时,控制组件便可以实时的在虚拟现实设备的虚拟环境中对应位置(该对应位置可以是指现实环境中的鼠标在虚拟环境中对应的位置)加载鼠标模型,此种情况下,实现了将现实环境中的鼠标投影到了虚拟环境中的效果。用户在现实环境中手握鼠标,并移动以及操作鼠标的过程中,虚拟环境中的鼠标也会随之移动。如此便实现了用户在现实环境以及虚拟环境中同步操作鼠标的效果,提高了用户体验。The control component can recognize the mouse in the environment image, and when the mouse is recognized, generate a virtual mouse at the corresponding position of the mouse in the virtual environment of the virtual reality device. When the image acquisition component continues to acquire environmental images, the control component can load the mouse model in real time at the corresponding position in the virtual environment of the virtual reality device (the corresponding position can refer to the corresponding position of the mouse in the real environment in the virtual environment), In this case, the effect of projecting the mouse in the real environment into the virtual environment is realized. When the user holds the mouse in the real environment and moves and operates the mouse, the mouse in the virtual environment will also move accordingly. In this way, the effect that the user operates the mouse synchronously in the real environment and the virtual environment is realized, and the user experience is improved.
步骤309、获取鼠标的输入信号。
控制组件可以通过与鼠标之间的连接,来获取鼠标的输入信号。鼠标的输入信号可以包括鼠标的位置信号,此外,该输入信号还可以包括按键信号。The control component can obtain the input signal of the mouse through the connection with the mouse. The input signal of the mouse may include a position signal of the mouse. In addition, the input signal may also include a key signal.
步骤310、基于鼠标的输入信号获取鼠标的平面坐标。
控制组件可以基于鼠标的输入信号获取鼠标的平面坐标。该平面坐标可以记录有鼠标在桌面平面坐标系中的坐标,该平面坐标系可以为设备主体的显示屏上的像素坐标系,该坐标系的范围可以为(0,0)到(Sw,Sh),Sw为显示屏的像素宽度,Sh为显示屏的像素高度。The control component can obtain the plane coordinates of the mouse based on the input signal of the mouse. The plane coordinates can record the coordinates of the mouse in the desktop plane coordinate system, and the plane coordinate system can be the pixel coordinate system on the display screen of the device main body, and the range of the coordinate system can be (0,0) to (Sw, Sh ), Sw is the pixel width of the display screen, and Sh is the pixel height of the display screen.
步骤311、将平面坐标转换为虚拟环境中的世界坐标。
控制组件可以将平面坐标转换为虚拟环境中的世界坐标。示例性的,控制组件可以通过渲染引擎来实现该转换过程。Control components can convert plane coordinates to world coordinates in the virtual environment. Exemplarily, the control component can implement the conversion process through a rendering engine.
步骤312、基于世界坐标以及虚拟环境中虚拟相机的朝向生成选择射线。
控制组件在获取了鼠标的位置所对应的世界坐标后,可以基于该世界坐标以及虚拟环境中虚拟相机的朝向,生成选择射线。其中,虚拟相机的朝向可以由设备主体的朝向来决定,选择射线穿过世界坐标,且方向与虚拟相机的朝向平行,也即是该选择射线可以由鼠标的位置,以及虚拟相机的朝向共同决定。After the control component acquires the world coordinates corresponding to the mouse position, it can generate a selection ray based on the world coordinates and the orientation of the virtual camera in the virtual environment. Among them, the orientation of the virtual camera can be determined by the orientation of the device body, the selection ray passes through the world coordinates, and the direction is parallel to the orientation of the virtual camera, that is, the selection ray can be determined by the position of the mouse and the orientation of the virtual camera .
步骤313、对选择射线与虚拟环境中的物体进行碰撞检测。
控制组件在生成选择射线后,可以对选择射线与虚拟环境中的物体进行碰撞检测。其中,虚拟环境中的物体可以为办公时所显示的各种物体,如一个或多个屏幕以及三维模型等。After the control component generates the selection ray, it can perform collision detection on the selection ray and objects in the virtual environment. Wherein, the objects in the virtual environment may be various objects displayed during office work, such as one or more screens and three-dimensional models.
步骤314、将选择射线碰撞到的第一个物体确定为鼠标当前选中的物体。
控制组件可以将选择射线碰撞到的第一个物体确定为鼠标当前选中的物体。在一种示例性的实施例中,可以先虚拟环境中突出显示鼠标当前选中的物体,当接收到鼠标或者键盘的确定指令(该指令可以在鼠标的按键被点击,或者是键盘上的指定按键被点击时发出)时,可以对选中的物体做进一步的操作,如打开操作等。The control component can determine the first object collided by the selection ray as the object currently selected by the mouse. In an exemplary embodiment, the object currently selected by the mouse can be highlighted in the virtual environment first, and when a certain instruction from the mouse or keyboard is received (the instruction can be clicked on a button of the mouse, or a specified button on the keyboard When it is clicked), further operations can be performed on the selected object, such as opening operations, etc.
请参考图4,图4是本申请实施例提供方法中一种虚拟环境的示意图,其中,该虚拟环境中包括虚拟桌面d,位于虚拟桌面d上的虚拟键盘k以及虚拟鼠标m,该虚拟桌面d、虚拟键盘k以及虚拟鼠标m均为现实环境中的桌面、键盘以及鼠标的投影,该虚拟环境中还包括虚拟显示屏s1、s2以及s3,这三块虚拟显示屏可以用于显示办公相关的内容,另外,该虚拟环境中还显示有鼠标对应的选择射线L,该选择射线L可以用于对显示屏s1、s2以及s3所显示的内容,或者虚拟环境中的其他物体进行选择。Please refer to FIG. 4. FIG. 4 is a schematic diagram of a virtual environment in the method provided by the embodiment of the present application, wherein the virtual environment includes a virtual desktop d, a virtual keyboard k and a virtual mouse m located on the virtual desktop d, the virtual desktop d. Virtual keyboard k and virtual mouse m are the projections of the desktop, keyboard and mouse in the real environment. The virtual environment also includes virtual display screens s1, s2 and s3. These three virtual display screens can be used to display office-related In addition, the virtual environment also displays a selection ray L corresponding to the mouse, and the selection ray L can be used to select the content displayed on the display screens s1, s2, and s3, or other objects in the virtual environment.
如此便实现了通过鼠标在平面上的操作,来实现对三维的虚拟环境进行控制效果,用户无需使用专用的虚拟现实手柄,节省了设备成本以及用户的学习成本。In this way, the operation of the mouse on the plane is realized to realize the effect of controlling the three-dimensional virtual environment, and the user does not need to use a dedicated virtual reality handle, which saves equipment costs and user learning costs.
综上所述,本申请实施例提供的虚拟现实设备的控制方法,通过在虚拟现实设备的虚拟环境中展示检测到的外部环境中的至少一个平面,并在虚拟环境中生成键盘所对应的虚拟键盘,之后在虚拟键盘放置的平面所在位置建立虚拟桌面,再将鼠标的输入信号转换为虚拟环境中的选择射线,如此便能够通过外部的鼠标以及键盘来对虚拟环境进行控制,降低了误触的可能性,实现了提升虚拟现实设备的控制方法的准确性的效果。To sum up, the control method of the virtual reality device provided by the embodiment of the present application displays at least one plane in the detected external environment in the virtual environment of the virtual reality device, and generates a virtual plane corresponding to the keyboard in the virtual environment. Keyboard, and then establish a virtual desktop at the position of the plane where the virtual keyboard is placed, and then convert the input signal of the mouse into a selection ray in the virtual environment, so that the virtual environment can be controlled through the external mouse and keyboard, reducing false touches possibility, the effect of improving the accuracy of the control method of the virtual reality device is achieved.
另外,本申请实施例提供的方法中,将鼠标的输入信号转换至虚拟环境中对应的选择射线,以便于用户直接通过办公时常用的鼠标在虚拟环境进行对应的控制,而无需使用虚拟现实设备专用的手柄,节省了成本,且降低了用户的学习成本,提高了用户体验。In addition, in the method provided by the embodiment of the present application, the input signal of the mouse is converted to the corresponding selection ray in the virtual environment, so that the user can directly use the mouse commonly used in office to perform corresponding control in the virtual environment without using a virtual reality device The dedicated handle saves costs, reduces user learning costs, and improves user experience.
下述为本公开装置实施例,可以用于执行本公开方法实施例。对于本公开装置实施例中未披露的细节,请参照本公开方法实施例。The following are device embodiments of the present disclosure, which can be used to implement the method embodiments of the present disclosure. For details not disclosed in the disclosed device embodiments, please refer to the disclosed method embodiments.
图5是本申请实施例提供的一种虚拟现实设备的控制装置的框图,该装置可以通过软件、硬件或者两者的结合实现成为虚拟现实设备的控制组件的部分或者全部。该虚拟现实设备的控制装置500包括:Fig. 5 is a block diagram of a control device for a virtual reality device provided by an embodiment of the present application. The device can be implemented as part or all of the control component of the virtual reality device through software, hardware or a combination of the two. The control device 500 of the virtual reality device includes:
图像获取模块510,用于通过图像采集组件获取设备主体外部环境的环境图像;An image acquisition module 510, configured to acquire an environmental image of the external environment of the device main body through an image acquisition component;
平面检测模块520,用于在环境图像中进行平面检测;A plane detection module 520, configured to perform plane detection in the environment image;
平面展示模块530,用于在虚拟现实设备的虚拟环境中展示检测到的至少一个平面;A plane display module 530, configured to display at least one detected plane in the virtual environment of the virtual reality device;
键盘生成模块540,用于响应于在环境图像中识别到键盘,在虚拟现实设备的虚拟环境中键盘的对应位置生成虚拟键盘;A keyboard generation module 540, configured to generate a virtual keyboard at a corresponding position of the keyboard in the virtual environment of the virtual reality device in response to recognizing the keyboard in the environment image;
桌面建立模块550,用于响应于虚拟键盘被放置在至少一个平面中的目标平面上,在虚拟环境中目标平面的对应位置建立虚拟桌面;A desktop creation module 550, configured to create a virtual desktop at a corresponding position of the target plane in the virtual environment in response to the virtual keyboard being placed on the target plane in at least one plane;
输入获取模块560,用于获取鼠标的输入信号;Input obtaining module 560, is used for obtaining the input signal of mouse;
射线建立模块570,用于基于鼠标的输入信号,在虚拟环境中生成鼠标对应的选择射线。The ray creation module 570 is configured to generate a selection ray corresponding to the mouse in the virtual environment based on the input signal of the mouse.
综上所述,本申请实施例提供的虚拟现实设备的控制装置,通过在虚拟现实设备的虚拟环境中展示检测到的外部环境中的至少一个平面,并在虚拟环境中生成键盘所对应的虚拟键盘,之后在虚拟键盘放置的平面所在位置建立虚拟桌面,再将鼠标的输入信号转换为虚拟环境中的选择射线,如此便能够通过外部的鼠标以及键盘来对虚拟环境进行控制,降低了误触的可能性,实现了提升虚拟现实设备的控制方法的准确性的效果。To sum up, the control device of the virtual reality device provided by the embodiment of the present application displays at least one plane in the detected external environment in the virtual environment of the virtual reality device, and generates a virtual plane corresponding to the keyboard in the virtual environment. Keyboard, and then establish a virtual desktop at the position of the plane where the virtual keyboard is placed, and then convert the input signal of the mouse into a selection ray in the virtual environment, so that the virtual environment can be controlled through the external mouse and keyboard, reducing false touches possibility, the effect of improving the accuracy of the control method of the virtual reality device is achieved.
另外,本申请实施例提供的虚拟现实设备的控制装置,将鼠标的输入信号转换至虚拟环境中对应的选择射线,以便于用户直接通过办公时常用的鼠标在虚拟环境进行对应的控制,而无需使用虚拟现实设备专用的手柄,节省了成本,且降低了用户的学习成本,提高了用户体验。In addition, the control device for virtual reality equipment provided by the embodiment of the present application converts the input signal of the mouse to the corresponding selection ray in the virtual environment, so that the user can directly use the mouse commonly used in office to perform corresponding control in the virtual environment without the need for Using a special handle for virtual reality equipment saves costs, reduces user learning costs, and improves user experience.
可选地,射线建立模块,用于:Optionally, ray builds modules for:
基于鼠标的输入信号获取鼠标的平面坐标;Obtain the plane coordinates of the mouse based on the input signal of the mouse;
将平面坐标转换为虚拟环境中的世界坐标;Convert plane coordinates to world coordinates in the virtual environment;
基于世界坐标以及虚拟环境中虚拟相机的朝向确定选择射线,选择射线穿过世界坐标,且方向与虚拟相机的朝向平行。The selected ray is determined based on the world coordinates and the orientation of the virtual camera in the virtual environment, the selected ray passes through the world coordinates, and the direction is parallel to the orientation of the virtual camera.
可选地,虚拟现实设备的控制装置还包括:Optionally, the control device of the virtual reality device also includes:
碰撞检测模块,用于对选择射线与虚拟环境中的物体进行碰撞检测;A collision detection module, used for collision detection between the selected ray and objects in the virtual environment;
选择模块,用于将选择射线碰撞到的第一个物体确定为鼠标当前选中的物体。The selection module is used to determine the first object collided by the selection ray as the object currently selected by the mouse.
可选地,虚拟现实设备的控制装置还包括:Optionally, the control device of the virtual reality device also includes:
虚拟鼠标生成模块,用于响应于在环境图像中识别到鼠标,在虚拟现实设备的虚拟环境中鼠标的对应位置生成虚拟鼠标。The virtual mouse generating module is configured to generate a virtual mouse at a corresponding position of the mouse in the virtual environment of the virtual reality device in response to recognizing the mouse in the environment image.
可选地,平面检测模块,用于:Optionally, a plane detection module for:
通过随机抽样一致算法、霍夫变换算法或区域增长聚类算法在环境图像中进行平面检测。Plane detection in environment images by random sampling consensus algorithm, Hough transform algorithm or region growing clustering algorithm.
可选地,键盘生成模块,用于:Optionally, a keyboard generation module for:
检测键盘是否具有预设的多个特征中的任一特征;Detecting whether the keyboard has any one of a plurality of preset characteristics;
在键盘具有任一特征时,获取任一特征对应的键盘模型;When the keyboard has any feature, obtain the keyboard model corresponding to any feature;
在虚拟现实设备的虚拟环境中键盘的对应位置加载键盘模型。The keyboard model is loaded at the corresponding position of the keyboard in the virtual environment of the virtual reality device.
可选地,特征包括预设的按键排布方式、预设的特征为以及预设的外形中的至少一种。Optionally, the feature includes at least one of a preset key arrangement, a preset feature, and a preset shape.
可选地,键盘生成模块,用于:Optionally, a keyboard generation module for:
通过环境图像确定键盘在虚拟环境中的位置以及姿态;Determine the position and posture of the keyboard in the virtual environment through the environment image;
基于位置以及姿态在虚拟环境中加载键盘模型。Load the keyboard model in the virtual environment based on position and pose.
可选地,虚拟现实设备的控制装置还包括:Optionally, the control device of the virtual reality device also includes:
模型生成模块,用于在键盘不具有预设特征时,基于键盘的图像生成键盘的第一模型;A model generation module, configured to generate a first model of the keyboard based on the image of the keyboard when the keyboard does not have preset features;
模型加载模块,用于在虚拟现实设备的虚拟环境中键盘的对应位置加载第一模型。The model loading module is configured to load the first model at the corresponding position of the keyboard in the virtual environment of the virtual reality device.
综上所述,本申请实施例提供的虚拟现实设备的控制装置,通过在虚拟现实设备的虚拟环境中展示检测到的外部环境中的至少一个平面,并在虚拟环境中生成键盘所对应的虚拟键盘,之后在虚拟键盘放置的平面所在位置建立虚拟桌面,再将鼠标的输入信号转换为虚拟环境中的选择射线,如此便能够通过外部的鼠标以及键盘来对虚拟环境进行控制,降低了误触的可能性,实现了提升虚拟现实设备的控制方法的准确性的效果。To sum up, the control device of the virtual reality device provided by the embodiment of the present application displays at least one plane in the detected external environment in the virtual environment of the virtual reality device, and generates a virtual plane corresponding to the keyboard in the virtual environment. Keyboard, and then establish a virtual desktop at the position of the plane where the virtual keyboard is placed, and then convert the input signal of the mouse into a selection ray in the virtual environment, so that the virtual environment can be controlled through the external mouse and keyboard, reducing false touches possibility, the effect of improving the accuracy of the control method of the virtual reality device is achieved.
另外,本申请实施例提供的虚拟现实设备的控制装置,将鼠标的输入信号转换至虚拟环境中对应的选择射线,以便于用户直接通过办公时常用的鼠标在虚拟环境进行对应的控制,而无需使用虚拟现实设备专用的手柄,节省了成本,且降低了用户的学习成本,提高了用户体验。In addition, the control device for virtual reality equipment provided by the embodiment of the present application converts the input signal of the mouse to the corresponding selection ray in the virtual environment, so that the user can directly use the mouse commonly used in office to perform corresponding control in the virtual environment without the need for Using a special handle for virtual reality equipment saves costs, reduces user learning costs, and improves user experience.
此外,本申请实施例还提供一种虚拟现实设备,虚拟现实设备包括处理器和存储器,存储器中存储有至少一条指令、至少一段程序、代码集或指令集,至少一条指令、至少一段程序、代码集或指令集由处理器加载并执行以实现如上述的虚拟现实设备的控制方法。In addition, the embodiment of the present application also provides a virtual reality device, the virtual reality device includes a processor and a memory, at least one instruction, at least one program, code set or instruction set are stored in the memory, at least one instruction, at least one program, code The set or instruction set is loaded and executed by the processor to implement the control method of the above-mentioned virtual reality device.
本申请实施例还提供一种计算机存储介质,计算机存储介质中存储有至少一条指令、至少一段程序、代码集或指令集,至少一条指令、至少一段程序、代码集或指令集由处理器加载并执行以实现如上述的虚拟现实设备的控制方法。The embodiment of the present application also provides a computer storage medium, at least one instruction, at least one program, code set or instruction set is stored in the computer storage medium, at least one instruction, at least one program, code set or instruction set is loaded by the processor and Execute to realize the above-mentioned virtual reality device control method.
本申请实施例还提供了一种计算机程序产品或计算机程序,该计算机程序产品或计算机程序包括计算机指令,该计算机指令存储在计算机可读存储介质中。计算机设备的处理器从计算机可读存储介质读取该计算机指令,处理器执行该计算机指令,使得该计算机设备执行上述的各种可选实现方式中提供的方法。The embodiment of the present application also provides a computer program product or computer program, where the computer program product or computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. The processor of the computer device reads the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the computer device executes the methods provided in the various optional implementation manners above.
本申请中术语“A和B的至少一种”,仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和B的至少一种,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。同理,“A、B和C的至少一种”表示可以存在七种关系,可以表示:单独存在A,单独存在B,单独存在C,同时存在A和B,同时存在A和C,同时存在C和B,同时存在A、B和C这七种情况。同理,“A、B、C和D的至少一种”表示可以存在十五种关系,可以表示:单独存在A,单独存在B,单独存在C,单独存在D,同时存在A和B,同时存在A和C,同时存在A和D,同时存在C和B,同时存在D和B,同时存在C和D,同时存在A、B和C,同时存在A、B和D,同时存在A、C和D,同时存在B、C和D,同时存在A、B、C和D,这十五种情况。The term "at least one of A and B" in this application is just an association relationship describing associated objects, which means that there may be three relationships. For example, at least one of A and B can mean: A exists alone, and at the same time There are three cases of A and B, and B alone. Similarly, "at least one of A, B, and C" means that seven relationships can exist, which can mean: A exists alone, B exists alone, C exists alone, A and B exist simultaneously, A and C exist simultaneously, and C and B, there are seven situations of A, B and C at the same time. Similarly, "at least one of A, B, C, and D" means that there can be fifteen relationships, which can mean: A exists alone, B exists alone, C exists alone, D exists alone, A and B exist simultaneously, and A and C, A and D, C and B, D and B, C and D, A, B, and C, A, B, and D, A, C and D, B, C, and D exist at the same time, and A, B, C, and D exist at the same time, these fifteen situations.
在本申请中,术语“第一”仅用于描述目的,而不能理解为指示或暗示相对重要性。术语“多个”指两个或两个以上,除非另有明确的限定。In the present application, the term "first" is used for descriptive purpose only, and cannot be understood as indicating or implying relative importance. The term "plurality" means two or more, unless otherwise clearly defined.
在本申请所提供的几个实施例中,应该理解到,所揭露的装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided in this application, it should be understood that the disclosed devices and methods may be implemented in other ways. For example, the device embodiments described above are only illustrative. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or May be integrated into another system, or some features may be ignored, or not implemented. In another point, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces, and the indirect coupling or communication connection of devices or units may be in electrical, mechanical or other forms.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place, or may be distributed to multiple network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
本领域普通技术人员可以理解实现上述实施例的全部或部分步骤可以通过硬件来完成,也可以通过程序来指令相关的硬件完成,所述的程序可以存储于一种计算机可读存储介质中,上述提到的存储介质可以是只读存储器,磁盘或光盘等。Those of ordinary skill in the art can understand that all or part of the steps for implementing the above embodiments can be completed by hardware, and can also be completed by instructing related hardware through a program. The program can be stored in a computer-readable storage medium. The above-mentioned The storage medium mentioned may be a read-only memory, a magnetic disk or an optical disk, and the like.
以上所述仅为本申请的可选实施例,并不用以限制本申请,凡在本申请的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本申请的保护范围之内。The above are only optional embodiments of the application, and are not intended to limit the application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the application shall be included in the protection of the application. within range.
Claims (13)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202211436400.8A CN115904201A (en) | 2022-11-16 | 2022-11-16 | Virtual reality equipment, its control method, device, and computer storage medium |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202211436400.8A CN115904201A (en) | 2022-11-16 | 2022-11-16 | Virtual reality equipment, its control method, device, and computer storage medium |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| CN115904201A true CN115904201A (en) | 2023-04-04 |
Family
ID=86474083
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202211436400.8A Pending CN115904201A (en) | 2022-11-16 | 2022-11-16 | Virtual reality equipment, its control method, device, and computer storage medium |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN115904201A (en) |
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN116541923A (en) * | 2023-04-07 | 2023-08-04 | 中国民用航空飞行学院 | VR-based indoor installation foundation positioning method for equipment with support |
| CN117784959A (en) * | 2024-01-10 | 2024-03-29 | 深圳市华宇鸿信电子科技有限公司 | An interactive system and method for AI smart mouse |
-
2022
- 2022-11-16 CN CN202211436400.8A patent/CN115904201A/en active Pending
Cited By (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN116541923A (en) * | 2023-04-07 | 2023-08-04 | 中国民用航空飞行学院 | VR-based indoor installation foundation positioning method for equipment with support |
| CN116541923B (en) * | 2023-04-07 | 2023-12-19 | 中国民用航空飞行学院 | VR-based indoor installation foundation positioning method for equipment with support |
| CN117784959A (en) * | 2024-01-10 | 2024-03-29 | 深圳市华宇鸿信电子科技有限公司 | An interactive system and method for AI smart mouse |
| CN117784959B (en) * | 2024-01-10 | 2024-08-20 | 深圳市华宇鸿信电子科技有限公司 | Interactive system and method for AI intelligent mouse |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US10761612B2 (en) | Gesture recognition techniques | |
| US10732725B2 (en) | Method and apparatus of interactive display based on gesture recognition | |
| US10394334B2 (en) | Gesture-based control system | |
| US9600078B2 (en) | Method and system enabling natural user interface gestures with an electronic system | |
| US20220148279A1 (en) | Virtual object processing method and apparatus, and storage medium and electronic device | |
| US9940720B2 (en) | Camera and sensor augmented reality techniques | |
| CN107665042B (en) | Enhanced virtual touchpad and touchscreen | |
| JP4323180B2 (en) | Interface method, apparatus, and program using self-image display | |
| EP2790089A1 (en) | Portable device and method for providing non-contact interface | |
| CN110456907A (en) | Virtual screen control method, device, terminal equipment and storage medium | |
| TWI471815B (en) | Gesture recognition device and method | |
| US9501810B2 (en) | Creating a virtual environment for touchless interaction | |
| US20180253149A1 (en) | Information processing system, information processing apparatus, control method, and program | |
| US20230061557A1 (en) | Electronic device and program | |
| CN112068698A (en) | An interaction method, device, electronic device, and computer storage medium | |
| JPWO2017057106A1 (en) | Input device, input method, and program | |
| CN115904201A (en) | Virtual reality equipment, its control method, device, and computer storage medium | |
| CN118466805A (en) | Non-contact 3D model human-computer interaction method based on machine vision and gesture recognition | |
| CN104851134A (en) | Augmented Reality System and Method Combining Virtual Trigger and Real Object Trigger | |
| CN111913560A (en) | Virtual content display method, device, system, terminal equipment and storage medium | |
| CN114167997B (en) | Model display method, device, equipment and storage medium | |
| US11726654B2 (en) | Display apparatus capable of displaying icon corresponding to shape of hand-drafted input, display method, and non-transitory computer-executable medium storing program thereon | |
| CN116159308B (en) | Game interaction methods, devices, computer equipment, and computer-readable storage media | |
| US20190339864A1 (en) | Information processing system, information processing method, and program | |
| KR20250007373A (en) | Apparatus and Method for Recognizing Motion |
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 |