Infrared positioning method, infrared positioning device and infrared positioning system
By using the infrared lights distributed by the waist triangle in virtual reality applications for infrared point recognition, identify the movement direction of objects, solve the problem that existing technology cannot accurately obtain the direction of the object movement, and realize a better user immersion and virtual environment. interactive.
Patent Information
- Application Number
- CN202080001234.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-07-13
- Publication Date
- 2025-01-28
- Estimated Expiration
- 2040-07-13
AI Technical Summary
Existing virtual reality positioning methods cannot accurately obtain the moving direction of objects, and it is difficult to meet users' immersion needs and interaction needs.
By carrying the infrared lights distributed on the waist triangle on the object, the positioning objects are treated based on the positioning object of the object image, the coordinate data of the three infrared dots is obtained, the apex and bottom of the bottom triangle such as the waist triangle are identified, and the point of the target is generated. The direction vector represents the movement direction of the object, and calculates the angle between the vector between the direction vector and the preset coordinate system of the virtual environment to determine the movement direction of the object.
Achieve the exact positioning and obtaining movement direction of objects in virtual reality, enhance the user's immersion, and support the interaction of people, people, and things in the virtual environment.
Smart Images

Figure CN112136158B_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of virtual reality and positioning technology, and in particular relates to an infrared positioning method, an infrared positioning device and an infrared positioning system. Background Art
[0002] Virtual Reality (VR) technology is a computer simulation system that can create and experience a virtual world. It uses computers to generate a virtual environment, which provides users with a three-dimensional dynamic vision with multi-source information fusion and interaction, allowing users to immerse themselves in the virtual environment.
[0003] With the continuous advancement and rapid development of communication technology, virtual reality applications have also been widely used. For example, in real-time acquisition of the position of a car in simulated virtual driving, or acquisition of a human body position heat map in an exhibition hall, or acquisition of the relative position of a physical object in an interactive game, in these virtual reality applications, it is necessary to locate the object according to its real position and develop a virtual system to match the real position. Some existing positioning methods applied to virtual reality can only locate and identify objects, but cannot determine the direction of movement of objects, making it difficult to meet the immersion and interaction needs of users in virtual reality applications. Summary of the invention
[0004] Technical issues
[0005] One of the purposes of the embodiments of the present application is to provide an infrared positioning method, an infrared positioning method and an infrared positioning system, which can accurately locate and obtain the movement direction of an object in a virtual reality application, and meet the immersion and interaction needs of users in the virtual reality application.
[0006] Technical Solutions
[0007] In order to solve the above technical problems, the technical solution adopted in the embodiment of the present application is:
[0008] In a first aspect, an infrared positioning method is provided, the infrared positioning method comprising:
[0009] Performing infrared point recognition processing on the object to be located based on the object image, and acquiring infrared point information corresponding to the object to be located, wherein the infrared point information includes coordinate data of three infrared points, and the three infrared points are distributed in an isosceles triangle;
[0010] Identify the vertices and the midpoints of the base of the isosceles triangle according to the coordinate data of the three infrared points, and generate a direction vector pointing to the vertices according to the vertices and the midpoints of the base of the isosceles triangle, wherein the direction vector represents the movement direction of the object to be located;
[0011] The vector angle between the direction vector of the object to be located and the preset coordinate system of the virtual environment is calculated, and the movement direction of the object to be located is determined according to the vector angle.
[0012] In one embodiment, after the step of performing infrared point recognition processing on the object to be located based on the object image to obtain infrared point information corresponding to the object to be located, wherein the infrared point information includes coordinate data of three infrared points, and the three infrared points are distributed in an isosceles triangle, the following steps are included:
[0013] In combination with the coordinate data of the three infrared points, the center of gravity position of the isosceles triangle is calculated according to the triangle geometry principle, and the center of gravity position of the isosceles triangle is determined as the position of the object to be located.
[0014] In one embodiment, the step of performing infrared point recognition processing on the object to be located based on the object image to obtain infrared point information corresponding to the object to be located, wherein the infrared point information includes coordinate data of three infrared points, and the three infrared points are distributed in an isosceles triangle, comprises:
[0015] Open the camera image through the CCV computer vision library, and obtain a first object image containing the object to be located from the image captured by the camera;
[0016] Performing infrared point recognition processing on the first object image to identify all infrared points in the first object image;
[0017] Performing a number counting process on all infrared points in the first object image to obtain the number of infrared points identified from the first object image;
[0018] If the number of infrared points identified from the first object image is three, verifying whether the three infrared points are distributed in an isosceles triangle;
[0019] If the three infrared points are distributed in an isosceles triangle, the coordinate data of the three infrared points are acquired.
[0020] In one embodiment, after the step of performing a number counting process on all infrared points in the first object image to obtain the number of infrared points identified from the first object image, the method further comprises:
[0021] If the number of the infrared points is less than three or the number of the infrared points is equal to three but is not distributed in an isosceles triangle, the angle of the camera picture opened by the CCV computer vision library is adjusted according to a preset adjustment rule, and the second object image is reacquired based on the adjusted camera picture;
[0022] performing infrared point recognition processing on the second object image to identify all infrared points in the second object image;
[0023] Performing a number counting process on all infrared points in the second object image to obtain the number of infrared points identified from the second object image;
[0024] If the number of infrared points identified from the second object image is three, verifying whether the three infrared points are distributed in an isosceles triangle;
[0025] If the three infrared points are distributed in an isosceles triangle, the coordinate data of the three infrared points are acquired.
[0026] In one embodiment, after the step of performing a number counting process on all infrared points in the first object image to obtain the number of infrared points identified from the first object image, the method further comprises:
[0027] If the number of infrared points identified from the first object image is more than three, three infrared points distributed in an isosceles triangle are selected from all the infrared points identified from the first object image, and coordinate data of the three infrared points are acquired.
[0028] In a second aspect, an infrared positioning device is provided, the infrared positioning device comprising:
[0029] An acquisition module, used for performing infrared point recognition processing on the object to be located based on the object image, and acquiring infrared point information corresponding to the object to be located, wherein the infrared point information includes coordinate data of three infrared points, and the three infrared points are distributed in an isosceles triangle;
[0030] A generating module, used for identifying the vertices and the midpoints of the base of the isosceles triangle according to the coordinate data of the three infrared points, and generating a direction vector pointing to the vertex according to the vertices and the midpoints of the base of the isosceles triangle, wherein the direction vector represents the movement direction of the object to be located;
[0031] The calculation module is used to calculate the vector angle between the direction vector of the object to be located and the preset coordinate system of the virtual environment, and determine the movement direction of the object to be located according to the vector angle.
[0032] In a third aspect, an infrared positioning system is provided, the infrared positioning system being used to implement the steps of the infrared positioning method described in any one of the first aspects above, including a camera end, a detection end and a positioning calculation end, wherein:
[0033] The camera end is used to capture an image of the object to be located and obtain infrared point information from the image, wherein the infrared point information contains coordinate data of the infrared point;
[0034] The detection end is used to receive the infrared point information acquired by the camera end, and identify three infrared points corresponding to the object to be located from the acquired infrared point information, wherein the three infrared points are distributed in an isosceles triangle;
[0035] The positioning calculation end is used to combine the coordinate point data of three infrared points distributed in an isosceles triangle, determine the position of the object to be positioned in the virtual reality environment by calculating the center of gravity position of the isosceles triangle, and determine the movement direction of the object to be positioned in the virtual reality environment by calculating the vector angle between the direction vector representing the movement direction of the object to be positioned and the preset coordinate system of the virtual environment, wherein the direction vector representing the movement direction of the object to be positioned is obtained by pointing the midpoint of the base of the isosceles triangle to the vertex of the isosceles triangle.
[0036] In one embodiment, the positioning calculation end can also be used to verify the calculated position and movement direction of the object to be located in virtual reality. If the verification result fails, the verification result is fed back to the detection end and the detection end is triggered to re-identify the three infrared points corresponding to the object to be located from the acquired infrared point information, so that the positioning calculation end recalculates the position and movement direction of the object to be located in virtual reality until the verification result passes.
[0037] In one embodiment, the positioning calculation end adopts a queue working mode to perform positioning calculation, obtains multiple groups of infrared point data in real time and verifies the position and movement direction of the object to be positioned in virtual reality that have been calculated and determined according to the multiple groups of infrared point data, wherein each group of infrared point data contains coordinate data of three infrared points distributed in an isosceles triangle, and the verification process includes expected value calculation processing and variance value calculation processing for the multiple groups of infrared point data.
[0038] In one embodiment, the detection end periodically receives the infrared point information acquired by the camera end through a preset data template, wherein the data type in the preset data module is configured as a list data type.
[0039] In a fourth aspect, an electronic device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the infrared positioning method as described in the first aspect when executing the computer program.
[0040] In a fifth aspect, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the infrared positioning method as described in any one of the first aspects are implemented.
[0041] Beneficial Effects
[0042] Compared with the prior art, the embodiment of the present application has the following beneficial effects: by mounting infrared lamps distributed in an isosceles triangle on the object, infrared point recognition processing is performed on the object to be located based on the object image, the positions of the three infrared lamps corresponding to the three infrared points distributed in an isosceles triangle in the image are identified, and the coordinate data of the three infrared points are obtained according to the positions. Further, the vertex and the midpoint of the base of the isosceles triangle are identified according to the coordinate data of the three infrared points, and the direction vector pointing to the vertex is generated according to the vertex and the midpoint of the base of the isosceles triangle. Finally, by calculating the vector angle between the direction vector of the object to be located and the preset coordinate system of the virtual environment, the current movement direction of the object to be located is determined by the vector angle. Thus, the movement direction of the object to be located is determined in the virtual reality application, so that the user can still distinguish the direction when immersed in the virtual environment, which enhances the user's immersion in the virtual environment, and by distinguishing the direction in the virtual environment, people and people, people and objects can interact in the virtual environment, meeting the user's interaction needs in the virtual environment. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0044] Figure 1 A schematic diagram of a basic method flow of an infrared positioning method provided in an embodiment of the present application;
[0045] Figure 2 A flow chart of a method for obtaining infrared point information corresponding to an object in the infrared positioning method provided in an embodiment of the present application;
[0046] Figure 3 A schematic flow chart of another method for obtaining infrared point information corresponding to an object in the infrared positioning method provided in an embodiment of the present application;
[0047] Figure 4 A schematic diagram of the structure of an infrared positioning device provided in an embodiment of the present application;
[0048] Figure 5 A basic schematic block diagram of an infrared positioning system provided in an embodiment of the present application;
[0049] Figure 6 A schematic diagram of an electronic device for implementing an infrared positioning method provided in an embodiment of the present application. DETAILED DESCRIPTION
[0050] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present application.
[0051] It should be noted that when a component is referred to as being "fixed on" or "disposed on" another component, it may be directly on the other component or indirectly on the other component. When a component is referred to as being "connected to" another component, it may be directly or indirectly connected to the other component. The orientation or positional relationship indicated by the terms "upper", "lower", "left", "right", etc. is based on the orientation or positional relationship shown in the accompanying drawings, and is only for the convenience of description, and does not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation on the present application. For ordinary technicians in this field, the specific meanings of the above terms can be understood according to the specific circumstances. The terms "first" and "second" are only used for the purpose of convenience of description, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of technical features. The meaning of "multiple" is two or more, unless otherwise clearly and specifically defined.
[0052] In order to illustrate the technical solution provided by the present application, a detailed description is given below in conjunction with specific drawings and embodiments.
[0053] In some embodiments of this application, please refer to Figure 1 , Figure 1 A basic method flow chart of an infrared positioning method provided in an embodiment of the present application is as follows:
[0054] In step S101, infrared point recognition processing is performed on the object to be located based on the object image to obtain infrared point information corresponding to the object to be located, wherein the infrared point information includes coordinate data of three infrared points, and the three infrared points are distributed in an isosceles triangle.
[0055] In this embodiment, the object to be located is a VR (Virtual Reality) device used in virtual reality applications, such as VR glasses, VR helmets, and the like. Three infrared lamps are mounted on the object to be located, and the three infrared lamps are distributed in an isosceles triangle when the infrared lamps are mounted. Therefore, when the object to be located is located in a virtual reality application, an image of the object to be located can be captured by a camera, and then infrared point recognition processing is performed on the object to be located based on the image. For example, an infrared filter is configured on the camera end, and the image captured by the camera is filtered to identify the positions of the three infrared lamps mounted on the object to be located corresponding to the three infrared points in the image, and the positions of the three infrared points are combined to form an isosceles triangle. Moreover, the coordinate data of the three infrared points can be obtained based on the positions of the three infrared points combined with the coordinate system pre-set in the virtual environment.
[0056] In step S102, the vertices and the midpoints of the base of the isosceles triangle are identified, and a direction vector pointing to the vertices is generated according to the vertices and the midpoints of the base of the isosceles triangle, wherein the direction vector represents the movement direction of the object to be located;
[0057] In this embodiment, after obtaining the positions of the three infrared points in the image corresponding to the three infrared lights carried by the object to be located, the vertices and the midpoints of the base in the isosceles triangle are identified based on the isosceles triangle presented by the three infrared points. Specifically, in an isosceles triangle, the point where two short sides intersect is the vertex, and the side opposite to the vertex is the base. Thus, the vertex of the isosceles triangle can be obtained by identifying the length of each side of the isosceles triangle. After identifying the long side of the isosceles triangle, the length of the long side is divided into two equal parts, and the point corresponding to the two equal parts is the midpoint of the base of the isosceles triangle. After identifying the vertices and the midpoint of the base of the isosceles triangle, a direction vector pointing to the vertex is generated based on the vertices and the midpoint of the base of the isosceles triangle, and this direction vector is used to characterize the movement direction of the object to be located.
[0058] In step S103, the vector angle between the direction vector of the object to be positioned and the preset coordinate system of the virtual environment is calculated, and the movement direction of the object to be positioned in the virtual environment is determined according to the vector angle.
[0059] In this embodiment, the virtual environment preset coordinate system is a two-dimensional coordinate system set based on the camera end top view in the virtual reality application, and the two-dimensional coordinate system and the direction vector of the object are located on the same plane. In addition, the origin of the two-dimensional coordinate system can be specified in the virtual environment constructed by the virtual reality application according to the calculation requirements, and the principle of specification is to facilitate calculation. In some specific implementations, the X-axis direction and the Y-axis direction of the two-dimensional coordinate system can be determined according to the four directions of southeast, northwest, and northeast. For example, the east direction is the positive direction of the X-axis, and the north direction is the positive direction of the Y-axis. At this time, by calculating the vector angle between the direction vector of the object to be located and the positive direction of the X-axis in the two-dimensional coordinate system and / or calculating the vector angle between the direction vector of the object to be located and the positive direction of the Y-axis in the two-dimensional coordinate system, the movement direction of the object to be located in the virtual environment can be determined according to the calculated vector angle.
[0060] For example, when determining the movement direction of the object to be located in the virtual environment by calculating the vector angle between the direction vector of the object to be located and the positive direction of the X-axis in the two-dimensional coordinate system, the rule for determining the movement direction of the object can be pre-set as follows: for the vector angle between the direction vector of the object and the positive direction of the X-axis in the two-dimensional coordinate system, along the counterclockwise direction, when the angle is in the interval of 0°<vector angle<90°, the object movement direction is determined to be east of north+vector angle; when the angle is in the interval of 90°<vector angle<180°, the object movement direction is determined to be north of west+(vector angle-90°); when the angle is in the interval of 180°<vector angle<270°, the object movement direction is determined to be west of south+(vector angle-180°); when the angle is in the interval of 270°<vector angle<360°, the object movement direction is determined to be south of east+(vector angle-270°). Based on this, if it is calculated that the vector angle between the direction vector of the object to be located and the positive direction of the X-axis in the two-dimensional coordinate system is 30°, then it can be determined that the movement direction of the object to be located is 30° east of north.
[0061] It can be understood that when determining the movement direction of the object to be located in the virtual environment by calculating the vector angle between the direction vector of the object to be located and the positive direction of the Y axis in the two-dimensional coordinate system, or combining the vector angle between the direction vector of the object to be located and the positive direction of the X axis in the two-dimensional coordinate system and the vector angle between the direction vector of the object to be located and the positive direction of the Y axis in the two-dimensional coordinate system to determine the movement direction of the object to be located in the virtual environment, the determination rule of the movement direction of the object to be located can be set in advance, and then the movement direction of the object to be located in the virtual environment can be determined based on the determination rule. The setting of the movement direction determination rule is similar to the above example and will not be repeated here.
[0062] The infrared positioning method provided in the above embodiment carries infrared lamps distributed in an isosceles triangle on the object, performs infrared point recognition processing on the object to be positioned based on the object image, identifies the positions of the three infrared lamps corresponding to the three infrared points distributed in an isosceles triangle in the image, and obtains the coordinate data of the three infrared points according to the positions. Further, the vertex and the midpoint of the base of the isosceles triangle are identified according to the coordinate data of the three infrared points, and the direction vector pointing to the vertex is generated according to the vertex and the midpoint of the base of the isosceles triangle. Finally, by calculating the vector angle between the direction vector of the object to be positioned and the preset coordinate system of the virtual environment, the current movement direction of the object to be positioned is determined by the vector angle. Thus, the movement direction of the object to be positioned is determined in the virtual reality application, so that the user can still distinguish the direction when immersed in the virtual environment, which enhances the user's immersion in the virtual environment, and by distinguishing the direction in the virtual environment, people and people, people and objects can interact in the virtual environment, meeting the user's interaction needs in the virtual environment.
[0063] In some embodiments of the present application, after obtaining the coordinate data of the three infrared points corresponding to the object to be located, the centroid position of the isosceles triangle can be calculated according to the triangle geometry principle in combination with the coordinate data of the three infrared points, so as to determine the centroid position of the isosceles triangle as the position of the object to be located. Specifically, according to the triangle geometry principle, the intersection of the midlines of the sides is the centroid of the isosceles triangle.
[0064] In some embodiments of this application, please refer to Figure 2 , Figure 2 A flow chart of a method for obtaining infrared point information corresponding to an object in the infrared positioning method provided in the embodiment of the present application. The details are as follows:
[0065] In step S201, the camera image is opened through the CCV computer vision library, and a first object image containing the object to be located is obtained from the image captured by the camera;
[0066] In step S202, infrared point recognition processing is performed on the first object image to identify all infrared points in the first object image;
[0067] In step S203, a number counting process is performed on all infrared points in the first object image to obtain the number of infrared points identified from the first object image;
[0068] In step S204, if the number of infrared points identified from the first object image is three, verify whether the three infrared points are distributed in an isosceles triangle;
[0069] In step S205, if the three infrared points are distributed in an isosceles triangle, the coordinate data of the three infrared points are acquired.
[0070] In this embodiment, when the infrared positioning method provided by the present application is used to locate an object in a virtual reality application, firstly, a camera device is connected, and then the camera screen is opened through the CCV computer vision library, and then a first object image containing the object to be located is obtained from the screen taken by the camera, and then the infrared point recognition processing is performed on the first object image to identify all infrared points in the first object image. The CCV computer vision library (cachedcomputer vision library) is a modern computer vision library with cache based on C language, with a built-in cache mechanism, simple functional interface, and can transparently cache and pre-process images. In this embodiment, three infrared lights are mounted on the object to be located, and then the infrared points corresponding to the object to be located in the first object image are obtained by CCV in conjunction with infrared recognition, which fully utilizes the accuracy of the CCV computer vision library in processing image data, and at the same time solves the defects of CCV being susceptible to external interference and having low discrimination of designated objects by cooperating with infrared recognition. In this embodiment, after all infrared points in the first object image are identified, since the first object image may be disturbed by external factors and generate other infrared points other than infrared lamps, the infrared points identified from the first object image can be statistically processed to determine whether there are and only three infrared points identified from the first object image. If the number of infrared points obtained by counting is three, then it is verified whether the three infrared points are distributed in an isosceles triangle. It should be noted that when three infrared lamps are mounted on the object to be located, the three infrared lamps are distributed in an isosceles triangle. Therefore, the infrared points corresponding to the three infrared lamps identified from the first object image should also be distributed in an isosceles triangle. Accordingly, when the number of infrared points in the first object image is statistically obtained to be three, it is further verified whether the three infrared points are the three infrared points corresponding to the three infrared lamps mounted on the object to be located. Specifically, verification can be performed based on the characteristics of an isosceles triangle. For example, the distance between the three infrared points is calculated based on the coordinate data of the three infrared points to obtain the lengths of the three sides of the triangle. It is determined whether two of the three sides are equal in length. If so, it is confirmed that the three infrared points are distributed in an isosceles triangle, that is, it is verified that the three infrared points are three infrared points corresponding to the three infrared lights carried on the object to be located. After verifying that the three infrared points are distributed in an isosceles triangle, the coordinate data of the three infrared points are obtained. It can be understood that the coordinate data obtained here is the coordinate data in the camera coordinate system based on the camera configuration. In some specific implementations, a custom coordinate system that is easy to calculate can also be customized in the virtual environment. Then, the coordinate data obtained in the camera coordinate system is converted into coordinate data in the custom configuration coordinate system of the virtual environment by mapping in the coordinates.
[0071] In some embodiments of this application, please refer to Figure 3 , Figure 3 This is a flow chart of another method for obtaining infrared point information corresponding to an object in the infrared positioning method provided in the embodiment of the present application. The details are as follows:
[0072] In step S301, if the number of the infrared points is less than three or the number of the infrared points is equal to three but is not distributed in an isosceles triangle, the angle of the camera picture opened by the CCV computer vision library is adjusted according to a preset adjustment rule, and the second object image is reacquired based on the adjusted camera picture;
[0073] In step S302, infrared point recognition processing is performed on the second object image to identify all infrared points in the second object image;
[0074] In step S303, a number counting process is performed on all infrared points in the second object image to obtain the number of infrared points identified from the second object image;
[0075] In step S304, if the number of infrared points identified from the second object image is three, verify whether the three infrared points are distributed in an isosceles triangle;
[0076] In step S305, if the three infrared points are distributed in an isosceles triangle, the coordinate data of the three infrared points are acquired.
[0077] In this embodiment, the image captured by the camera may fail to capture the position of the infrared fixed object to be located normally, which may cause the number of infrared points in the first object image captured by the camera to be less than three or the number of infrared points to be equal to three but not distributed in an isosceles triangle. At this time, when it is statistically determined that the number of infrared points in the first object image is less than three or equal to three but not distributed in an isosceles triangle, the angle of the camera image opened by the CCV computer vision library can be adjusted so that the image captured by the camera can capture the position of the infrared fixed object to be located normally, and then after the angle adjustment of the camera image is completed, the second object image is re-acquired based on the adjusted camera image. Then, three infrared points distributed in an isosceles triangle corresponding to the object to be located are acquired according to the second object image. In this embodiment, steps S302-S305 are basically the same as steps S202-S205 in the aforementioned embodiment, and will not be repeated here.
[0078] In some embodiments of the present application, since the first object image may be interfered by external factors and generate other infrared points other than infrared lights, there may be a situation where the number of infrared points identified from the first object image is more than three. For this situation, in this embodiment, all infrared points in the first object image can be identified first, and then screened according to the set screening rules, such as the characteristics of an isosceles triangle (there are only two equal sides), that is, a triangle is drawn for every three infrared points, and based on the coordinate data of the infrared points, it is determined whether there are only two equal sides in the triangle, thereby screening out three infrared points distributed in an isosceles triangle. After determining the three infrared points distributed in an isosceles triangle from all the infrared points in the first object image, the coordinate data of the three infrared points are obtained. It can be understood that if the number of infrared points identified in the second object image in the aforementioned embodiment is more than three, it can also be processed according to the method provided in this embodiment.
[0079] It is understandable that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0080] In some embodiments of this application, please refer to Figure 4 , Figure 4 A schematic diagram of the structure of an infrared positioning device provided in an embodiment of the present application is described in detail as follows:
[0081] In this embodiment, the infrared positioning device includes: an acquisition module 401, a generation module 402, and a calculation module 403. The acquisition module 401 is used to perform infrared point recognition processing on the object to be positioned based on the object image, and obtain infrared point information corresponding to the object to be positioned, wherein the infrared point information includes coordinate data of three infrared points, and the three infrared points are distributed in an isosceles triangle. The generation module 402 is used to identify the vertices and the midpoints of the base of the isosceles triangle according to the coordinate data of the three infrared points, and generate a direction vector pointing to the vertex according to the vertices and the midpoints of the base of the isosceles triangle, and the direction vector represents the movement direction of the object to be positioned. The calculation module 403 is used to calculate the vector angle between the direction vector of the object to be positioned and the preset coordinate system of the virtual environment, and determine the movement direction of the object to be positioned according to the vector angle.
[0082] The infrared positioning device corresponds one to one with the above-mentioned infrared positioning method, and will not be described in detail here.
[0083] In some embodiments of this application, please refer to Figure 5 , Figure 5This is a basic schematic block diagram of an infrared positioning system provided in an embodiment of the present application. Figure 5 As shown, the infrared positioning system 50 includes a camera end 51, a detection end 52 and a positioning calculation end 53. Among them:
[0084] The camera end 51 is used to capture the image of the object to be located and obtain infrared point information from the image, wherein the infrared point information contains the coordinate data of the infrared point. In this embodiment, the camera end 51 uses infrared combined with the open source CCV computer vision library to perform object recognition, making full use of the accuracy of the CCV computer vision library in processing image data, and at the same time, by cooperating with infrared recognition, it solves the defects of CCV being susceptible to external interference and having low recognition of designated objects. In some specific implementations, the camera end is started by connecting, and then the camera end screen is opened using the CCV computer vision library, and then the camera end screen is adjusted by adjusting the CCV computer vision library parameters, and the object image is obtained from the camera end screen and the infrared points in the object image are identified. In some specific implementations, the interference of external factors can also be avoided by setting the recognition area of the object image, and the infrared point information is transmitted to the detection end 52 in real time.
[0085] The detection end 52 is used to receive the infrared point information obtained by the camera end, and identify three infrared points corresponding to the object to be located from the infrared point information obtained, wherein the three infrared points are distributed in an isosceles triangle. In this embodiment, the detection end 52 uses the tuio protocol to receive the infrared point information from the camera end 51. Specifically, after receiving the infrared point information from the camera end 51, the infrared point information is first counted to confirm the number of infrared points obtained from the object image. Then, according to the number of infrared points obtained, it is determined whether it is the number (three) that can form an isosceles triangle. If so, the coordinate data of the three infrared points are transmitted to the positioning calculation end 53 for calculation. Otherwise, if the number of infrared points is more than three, it can be filtered by setting a filtering rule, for example, by drawing a triangle for every three infrared points, judging whether there are and only two sides in the triangle are equal based on the coordinate data of the infrared points, thereby filtering out three infrared points distributed in an isosceles triangle, and then transmitting the coordinate data of the three infrared points to the positioning calculation end 53 for calculation. If the number of infrared points is less than three or equal to three but not distributed in an isosceles triangle, the detection operation is terminated and the tuio information is monitored, waiting to receive the next infrared point information from the camera end 51.
[0086] In some specific implementations, the detection end 52 can receive the infrared point information from the camera end 51 through a preset data template. Specifically, a data template is designed to have the function of converting standard tuio protocol data into a list data type that is easy to parse, and the data template is associated with a timer so that the data template performs regular data acquisition processing according to the time interval set by the timer. In this embodiment, the timer is set to 20ms, that is, 50 sets of infrared point information are acquired per second, which achieves low data latency between the actual environment and the virtual environment, and avoids the problem of asymmetric data between the actual environment and the virtual environment in virtual reality applications.
[0087] The positioning calculation terminal 53 is used to combine the coordinate point data of the three infrared points distributed in an isosceles triangle, determine the position of the object to be located in the virtual reality environment by calculating the center of gravity of the isosceles triangle, and determine the movement direction of the object to be located in the virtual reality environment by calculating the vector angle between the direction vector representing the movement direction of the object to be located and the preset coordinate system of the virtual environment, wherein the direction vector representing the movement direction of the object to be located is obtained by the midpoint of the base of the isosceles triangle pointing to the vertex of the isosceles triangle. In this embodiment, after obtaining the coordinate data of the three infrared points distributed in an isosceles triangle, the coordinates of the three infrared points are recorded and added to the calculation queue as a group of data, so as to adopt the queue first-in-first-out working mode for data calculation. The center of gravity of the isosceles triangle and the vector angle between the direction vector and the preset coordinate system of the virtual environment are calculated for each group of data in the queue according to the queue order, thereby determining the position and movement direction of the object to be located in the virtual reality environment.
[0088] In some specific implementations, the positioning calculation end 53 can also verify the position and movement direction of the object to be located in the virtual reality determined by calculation. If the verification result fails, the verification result is fed back to the detection end 52 and the detection end 52 is triggered to re-identify the three infrared points corresponding to the object to be located from the acquired infrared point information, and then the positioning calculation end 53 recalculates the position and movement direction of the object to be located in the virtual reality until the verification result passes. Specifically, in this embodiment, the positioning calculation end 53 adopts a queue first-in-first-out working mode to calculate data, and then in this calculation process, n groups of infrared point data are stored in real time, wherein each group of infrared point data contains the coordinate data of three infrared points distributed in an isosceles triangle. Then, the expected value and variance value of the n groups (for example, 10 groups) of data are calculated in real time, thereby verifying the position and movement direction of the object to be located in the virtual reality determined by calculation, and eliminating unexpected data with the help of the expected value and variance value, so that the positioning information of the object to be located is more accurate and reliable.
[0089] In some embodiments of this application, please refer to Figure 6 , Figure 6 A schematic diagram of an electronic device for implementing an infrared positioning method provided in an embodiment of the present application. Figure 6 As shown, the electronic device 6 of this embodiment includes: a processor 61, a memory 62, and a computer program 63 stored in the memory 62 and executable on the processor 61, such as an infrared positioning program. When the processor 61 executes the computer program 62, the steps in the above-mentioned infrared positioning method embodiments are implemented. Alternatively, when the processor 61 executes the computer program 63, the functions of the modules / units in the above-mentioned device embodiments are implemented.
[0090] Exemplarily, the computer program 63 may be divided into one or more modules / units, which are stored in the memory 62 and executed by the processor 61 to complete the present application. The one or more modules / units may be a series of computer program instruction segments capable of completing specific functions, which are used to describe the execution process of the computer program 63 in the electronic device 6. For example, the computer program 63 may be divided into:
[0091] An acquisition module, used for performing infrared point recognition processing on the object to be located based on the object image, and acquiring infrared point information corresponding to the object to be located, wherein the infrared point information includes coordinate data of three infrared points, and the three infrared points are distributed in an isosceles triangle;
[0092] A generating module, used for identifying the vertices and the midpoints of the base of the isosceles triangle according to the coordinate data of the three infrared points, and generating a direction vector pointing to the vertex according to the vertices and the midpoints of the base of the isosceles triangle, wherein the direction vector represents the movement direction of the object to be located;
[0093] The calculation module is used to calculate the vector angle between the direction vector of the object to be located and the preset coordinate system of the virtual environment, and determine the movement direction of the object to be located according to the vector angle.
[0094] The electronic device may include, but is not limited to, a processor 61 and a memory 62. Those skilled in the art will appreciate that Figure 6 It is only an example of the electronic device 6 and does not constitute a limitation of the electronic device 6. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, the electronic device may also include input and output devices, network access devices, buses, etc.
[0095] The processor 61 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.
[0096] The memory 62 may be an internal storage unit of the electronic device 6, such as a hard disk or memory of the electronic device 6. The memory 62 may also be an external storage device of the electronic device 6, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the electronic device 6. Further, the memory 62 may also include both an internal storage unit and an external storage device of the electronic device 6. The memory 62 is used to store the computer program and other programs and data required by the electronic device. The memory 62 may also be used to temporarily store data that has been output or is to be output.
[0097] It should be noted that the information interaction, execution process, etc. between the above-mentioned devices / units are based on the same concept as the method embodiment of the present application. Their specific functions and technical effects can be found in the method embodiment part and will not be repeated here.
[0098] An embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in the above-mentioned method embodiments can be implemented.
[0099] An embodiment of the present application provides a computer program product. When the computer program product runs on a mobile terminal, the mobile terminal can implement the steps in the above-mentioned method embodiments when executing the computer program product.
[0100] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.
[0101] If the integrated module / unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium. It should be noted that the content contained in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.
[0102] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0103] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0104] In the embodiments provided in the present application, it should be understood that the disclosed devices / terminal equipment and methods can be implemented in other ways. For example, the device / terminal equipment embodiments described above are only schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0105] 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 distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0106] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.
Claims
1. An infrared positioning method, characterized in that: include: Performing infrared point recognition processing on the object to be located based on the object image, and acquiring infrared point information corresponding to the object to be located, wherein the infrared point information includes coordinate data of three infrared points, and the three infrared points are distributed in an isosceles triangle; Identify the vertices and the midpoints of the base of the isosceles triangle according to the coordinate data of the three infrared points, and generate a direction vector pointing to the vertices according to the vertices and the midpoints of the base of the isosceles triangle, wherein the direction vector represents the movement direction of the object to be located; Calculating the vector angle between the direction vector of the object to be located and the preset coordinate system of the virtual environment, and determining the movement direction of the object to be located according to the vector angle; The step of performing infrared point recognition processing on the object to be located based on the object image to obtain infrared point information corresponding to the object to be located includes: Open the camera image through the CCV computer vision library, and obtain a first object image containing the object to be located from the image captured by the camera; Performing infrared point recognition processing on the first object image to identify all infrared points in the first object image; Performing a number counting process on all infrared points in the first object image to obtain the number of infrared points identified from the first object image; If the number of infrared points identified from the first object image is three, verifying whether the three infrared points are distributed in an isosceles triangle; If the three infrared points are distributed in an isosceles triangle, obtaining coordinate data of the three infrared points; After the step of performing a number counting process on all infrared points in the first object image to obtain the number of infrared points identified from the first object image, the method further comprises: If the number of infrared points identified from the first object image is more than three, draw a triangle by every three infrared points, determine whether there are and only two equal sides in the triangle based on the coordinate data of the infrared points, select three infrared points distributed in an isosceles triangle from all the infrared points identified from the first object image, and obtain the coordinate data of the three infrared points; After obtaining the coordinate data of three infrared points distributed in an isosceles triangle, the coordinates of the three infrared points are recorded and added as a group of data to a calculation queue, so as to adopt a queue first-in-first-out working mode for data calculation. During the calculation process, multiple groups of infrared point data are stored in real time, and expected values and variance values of the multiple groups of infrared point data are calculated, the movement direction of the object to be located in virtual reality determined by calculation is verified, and unexpected data is excluded; wherein each group of infrared point data contains the coordinate data of three infrared points distributed in an isosceles triangle.
2. The infrared positioning method according to claim 1, characterized in that: After the step of performing infrared point recognition processing on the object to be located based on the object image to obtain infrared point information corresponding to the object to be located, wherein the infrared point information includes coordinate data of three infrared points, and the three infrared points are distributed in an isosceles triangle, the method further comprises: The coordinate data of the three infrared points are combined and the center of gravity position of the isosceles triangle is calculated according to the triangle geometry principle, and the center of gravity position of the isosceles triangle is determined as the position of the object to be located.
3. The infrared positioning method according to claim 1, characterized in that: After the step of performing a number counting process on all infrared points in the first object image to obtain the number of infrared points identified from the first object image, the method further comprises: If the number of the infrared points is less than three or the number of the infrared points is equal to three but is not distributed in an isosceles triangle, the angle of the camera picture opened by the CCV computer vision library is adjusted according to a preset adjustment rule, and the second object image is reacquired based on the adjusted camera picture; performing infrared point recognition processing on the second object image to identify all infrared points in the second object image; Performing a number counting process on all infrared points in the second object image to obtain the number of infrared points identified from the second object image; If the number of infrared points identified from the second object image is three, verifying whether the three infrared points are distributed in an isosceles triangle; If the three infrared points are distributed in an isosceles triangle, the coordinate data of the three infrared points are acquired.
4. An infrared positioning device, characterized in that: The infrared positioning device comprises: An acquisition module, used for performing infrared point recognition processing on the object to be located based on the object image, and acquiring infrared point information corresponding to the object to be located, wherein the infrared point information includes coordinate data of three infrared points, and the three infrared points are distributed in an isosceles triangle; A generating module, used for identifying the vertices and the midpoints of the base of the isosceles triangle according to the coordinate data of the three infrared points, and generating a direction vector pointing to the vertex according to the vertices and the midpoints of the base of the isosceles triangle, wherein the direction vector represents the movement direction of the object to be located; A calculation module, used to calculate the vector angle between the direction vector of the object to be located and the preset coordinate system of the virtual environment, and determine the movement direction of the object to be located according to the vector angle; Among them, the infrared point recognition processing of the object to be located based on the object image to obtain the infrared point information corresponding to the object to be located includes: opening the camera screen through the CCV computer vision library, and obtaining the first object image containing the object to be located from the screen taken by the camera; performing infrared point recognition processing on the first object image to identify all infrared points in the first object image; performing number counting processing on all infrared points in the first object image to obtain the number of infrared points identified from the first object image; if the number of infrared points identified from the first object image is three, verifying whether the three infrared points are distributed in an isosceles triangle; if the three infrared points are distributed in an isosceles triangle, obtaining the coordinate data of the three infrared points; The infrared positioning device is further used for: if the number of infrared points identified from the first object image is more than three, drawing a triangle by every three infrared points, judging whether there are and only two equal sides in the triangle based on the coordinate data of the infrared points, selecting three infrared points distributed in an isosceles triangle from all the infrared points identified from the first object image, and obtaining the coordinate data of the three infrared points; The infrared positioning device is also used for: after obtaining the coordinate data of three infrared points distributed in an isosceles triangle, recording the coordinates of the three infrared points and adding the coordinate data of the three infrared points as a group of data to a calculation queue, so as to adopt a queue first-in-first-out working mode to perform data calculation. During the calculation process, multiple groups of infrared point data are stored in real time, and expected values and variance values of the multiple groups of infrared point data are calculated, the movement direction of the object to be positioned in virtual reality determined by calculation is verified, and unexpected data is excluded; wherein each group of infrared point data contains the coordinate data of three infrared points distributed in an isosceles triangle.
5. An infrared positioning system, characterized in that: It includes the camera end, the detection end and the positioning calculation end, among which: The camera end is used to capture an image of the object to be located and obtain infrared point information from the image, wherein the infrared point information contains coordinate data of the infrared point; The detection end is used to receive the infrared point information acquired by the camera end, and identify three infrared points corresponding to the object to be located from the acquired infrared point information, wherein the three infrared points are distributed in an isosceles triangle; The positioning calculation end is used to combine the coordinate point data of three infrared points distributed in an isosceles triangle, determine the position of the object to be positioned in the virtual reality environment by calculating the center of gravity of the isosceles triangle, and determine the movement direction of the object to be positioned in the virtual reality environment by calculating the vector angle between the direction vector representing the movement direction of the object to be positioned and the preset coordinate system of the virtual environment, wherein the direction vector representing the movement direction of the object to be positioned is obtained by pointing the midpoint of the base of the isosceles triangle to the vertex of the isosceles triangle; The infrared positioning system is further used to: open the camera screen through the CCV computer vision library, and obtain a first object image containing the object to be positioned from the screen taken by the camera; perform infrared point recognition processing on the first object image to identify all infrared points in the first object image; perform number counting processing on all infrared points in the first object image to obtain the number of infrared points identified from the first object image; if the number of infrared points identified from the first object image is three, verify whether the three infrared points are distributed in an isosceles triangle; if the three infrared points are distributed in an isosceles triangle, obtain the coordinate data of the three infrared points; The infrared positioning system is further used for: if the number of infrared points identified from the first object image is more than three, drawing a triangle by every three infrared points, judging whether there are and only have two equal sides in the triangle based on the coordinate data of the infrared points, selecting three infrared points distributed in an isosceles triangle from all the infrared points identified from the first object image, and obtaining the coordinate data of the three infrared points; The positioning calculation end adopts a queue working mode to perform positioning calculation. The positioning calculation end is also used for: after obtaining the coordinate data of three infrared points distributed in an isosceles triangle, by recording the coordinates of the three infrared points and adding the coordinate data of the three infrared points as a group of data to the calculation queue, so as to adopt a queue first-in-first-out working mode to perform data calculation. During the calculation process, multiple groups of infrared point data are stored in real time, and the expected values and variance values of the multiple groups of infrared point data are calculated, the movement direction of the object to be positioned in virtual reality determined by calculation is verified, and unexpected data is excluded; wherein each group of infrared point data contains the coordinate data of three infrared points distributed in an isosceles triangle.
6. The infrared positioning system according to claim 5, characterized in that: The positioning calculation end is also used to verify the calculated position and movement direction of the object to be located in the virtual reality. If the verification result fails, the verification result is fed back to the detection end and the detection end is triggered to re-identify the three infrared points corresponding to the object to be located from the acquired infrared point information, so that the positioning calculation end recalculates the position and movement direction of the object to be located in the virtual reality until the verification result passes.
7. The infrared positioning system according to claim 6, characterized in that: The positioning calculation end is also used for: acquiring multiple groups of infrared point data in real time and verifying the position of the object to be positioned in virtual reality determined by calculation according to the multiple groups of infrared point data.
8. The infrared positioning system according to claim 5, characterized in that: The detection end periodically receives the infrared point information acquired by the camera end through a preset data template, wherein the data type configured by the preset data module is a list data type.
Citation Information
Patent Citations
Indoor automatic transport vehicle positioning system with three fixed balls as visual marker
CN104792312A
Cleaner and method of controlling cleaner
CN105094127A
Livestock and poultry inventory method and device, electronic equipment and storage medium
CN111028266A