Optical coordinate data acquisition method and device, electronic equipment and storage medium
Through the image, the position of the trigger component and the optical coordinates are calculated, the problem of inconvenient optical coordinate data acquisition in the prior art is solved, and optical coordinate calculation without external control equipment is realized, which improves operation convenience.
Patent Information
- Application Number
- CN202411761482.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-03
- Publication Date
- 2025-03-07
AI Technical Summary
The existing optical coordinate data acquisition method requires users to manually trigger the calculation process, which is inconvenient to operate.
By determining whether the triggering component is in the triggering position based on the image, the initial coordinates of the triggering component under the device coordinate system, and the coordinates of each optical marking component, when the triggering component is in the triggering position, the optical coordinates of the target position under the camera coordinate system are calculated based on the coordinates of the image and the coordinates of the tip point under the device coordinate system.
Users can trigger calculations without the help of external control devices, which improves the convenience of optical coordinate data acquisition operations.
Smart Images

Figure CN119573554A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of optical measurement technology, and in particular to an optical coordinate data acquisition method, device, electronic equipment and storage medium. Background Art
[0002] In the field of optical measurement technology, in the application scenarios of image-guided surgery, in order to improve the accuracy of the surgery, doctors often need to use optical coordinate data acquisition equipment (such as optical probes) and cameras to obtain the optical coordinate data of the tip of the surgical instrument in real time.
[0003] The existing optical coordinate data acquisition method is mainly based on the relative position relationship between the tip point of the optical coordinate data acquisition device and the optical marking component, and the transformation matrix between the camera coordinate system and the device coordinate system, to calculate the optical coordinates of the tip point placed at the target position in the camera coordinate system.
[0004] However, in the existing optical coordinate data acquisition methods, users are usually required to place the optical coordinate data acquisition device at the target position in a preset posture, and then manually trigger the electronic device to calculate the optical coordinates of the tip point in the camera coordinate system through an external control device. For example, the user needs to manually trigger the electronic device calculation process by clicking a specific button on the software interface, using a foot switch, or using a remote control. This often makes the optical coordinate data acquisition operation inconvenient. Summary of the invention
[0005] In response to the shortcomings of the prior art, the present application provides an optical coordinate data acquisition method, device, electronic device and storage medium, which judges whether the trigger component is located at the trigger position based on an image, the initial coordinates of the trigger component in the device coordinate system and the coordinates of each optical marking component. When the trigger component is located at the trigger position, the optical coordinates of the target position in the camera coordinate system are calculated based on the image and the coordinates of the tip point in the device coordinate system. The user can trigger the electronic device to calculate the optical coordinates of the target position without the aid of an external control device, thereby improving the convenience of the optical coordinate data acquisition operation.
[0006] To solve the above problems, the present invention provides the following technical solutions:
[0007] In a first aspect, an embodiment of the present application provides an optical coordinate data acquisition method, comprising:
[0008] Acquire the coordinates of the tip point of the optical coordinate data acquisition device, the initial coordinates of the trigger component, and the coordinates of each optical marking component in the device coordinate system;
[0009] Whenever the optical coordinate data acquisition device is placed at a target position in a preset posture, an image obtained by taking a picture of the optical coordinate data acquisition device by a camera is acquired, wherein the tip point is placed at the target position;
[0010] determining whether the trigger component is located at a trigger position based on the image, the initial coordinates of the trigger component in the device coordinate system, and the coordinates of each of the optical marking components;
[0011] When the trigger component is located at the trigger position, the optical coordinates of the target position in the camera coordinate system are calculated based on the image and the coordinates of the tip point in the device coordinate system.
[0012] In some embodiments, judging whether the trigger component is located at the trigger position based on the image, the initial coordinates of the trigger component in the device coordinate system, and the coordinates of each of the optical marking components includes:
[0013] determining calculated position coordinates of the trigger component in a target coordinate system based on the image, the initial coordinates of the trigger component in the device coordinate system, and the coordinates of each of the optical marking components, the target coordinate system being the device coordinate system or the camera coordinate system;
[0014] When the distance between the calculated position coordinates of the trigger component in the target coordinate system and the current coordinates of the trigger component in the target coordinate system is greater than a preset value, it is determined that the trigger component is located at the trigger position; otherwise, it is determined that the trigger component is not located at the trigger position.
[0015] In some embodiments, determining the calculated position coordinates of the trigger component in the target coordinate system based on the image, the initial coordinates of the trigger component in the device coordinate system, and the coordinates of each of the optical marking components includes:
[0016] When it is determined based on the image that the trigger component is blocked, determining the preset coordinates in the target coordinate system as the calculated position coordinates of the trigger component in the target coordinate system;
[0017] When it is determined based on the image that the trigger component is not blocked, the corresponding target calculation method is determined according to the target coordinate system, and the calculated position coordinates of the trigger component in the target coordinate system are determined based on the image, the initial coordinates of the trigger component in the device coordinate system, and the coordinates of each of the optical marking components.
[0018] In some embodiments, when it is determined based on the image that the trigger component is not blocked, determining a corresponding target calculation method according to the target coordinate system, and using the target calculation method to determine the calculated position coordinates of the trigger component in the target coordinate system based on the image, the initial coordinates of the trigger component in the device coordinate system, and the coordinates of each of the optical marking components, including:
[0019] When it is determined based on the image that the trigger component is not blocked and the target coordinate system is the device coordinate system, the initial coordinates of the trigger component in the device coordinate system are determined as the calculated position coordinates of the trigger component in the target coordinate system;
[0020] When it is determined based on the image that the trigger component is not blocked and the target coordinate system is the camera coordinate system, determining the current coordinates of each of the optical marking components in the camera coordinate system based on the image;
[0021] Calculating a transformation matrix from the device coordinate system to the camera coordinate system based on the coordinates of each of the optical mark components in the device coordinate system and the current coordinates of each of the optical mark components in the camera coordinate system;
[0022] The initial coordinates of the trigger component in the device coordinate system are multiplied by the conversion matrix to obtain the calculated position coordinates of the trigger component in the target coordinate system.
[0023] In some embodiments, when the trigger component is located at the trigger position, calculating the optical coordinates of the target position in the camera coordinate system based on the image and the coordinates of the tip point in the device coordinate system includes:
[0024] The coordinates of the tip point in the device coordinate system are multiplied by the transformation matrix to obtain the optical coordinates of the target position in the camera coordinate system.
[0025] In some embodiments, when the distance between the calculated position coordinates of the trigger component in the target coordinate system and the current coordinates of the trigger component in the target coordinate system is greater than a preset value, judging that the trigger component is located at the trigger position, otherwise judging that the trigger component is not located at the trigger position, includes:
[0026] determining a current coordinate of a trigger component in the camera coordinate system based on the image;
[0027] When the target coordinate system is the camera coordinate system, when the distance between the calculated position coordinates of the trigger component in the camera coordinate system and the current coordinates of the trigger component in the camera coordinate system is greater than a preset value, it is judged that the trigger component is located at the trigger position, otherwise it is judged that the trigger component is not located at the trigger position;
[0028] When the target coordinate system is the device coordinate system, the current coordinates of the trigger component in the camera coordinate system are multiplied by the inverse matrix of the conversion matrix from the device coordinate system to the camera coordinate system to obtain the current coordinates of the trigger component in the device coordinate system;
[0029] When the distance between the calculated position coordinates of the trigger component in the device coordinate system and the current coordinates of the trigger component in the device coordinate system is greater than a preset value, it is determined that the trigger component is located at the trigger position; otherwise, it is determined that the trigger component is not located at the trigger position.
[0030] In some embodiments, there are multiple images, and the multiple images are acquired at different times. The determining whether the trigger component is located at the trigger position based on the images, the initial coordinates of the trigger component in the device coordinate system, and the coordinates of each of the optical marking components includes:
[0031] Determining whether the trigger component is located at a trigger position based on the currently acquired image, the initial coordinates of the trigger component in the device coordinate system, and the coordinates of each of the optical marking components;
[0032] When the trigger component is located at the trigger position, the optical coordinates of the target position in the camera coordinate system are calculated based on the image and the coordinates of the tip point in the device coordinate system, including:
[0033] When the trigger component is located at the trigger position and it is determined that the trigger component is not located at the trigger position based on the previous image acquired before the currently acquired image, the optical coordinates of the target position in the camera coordinate system are calculated based on the currently acquired image and the coordinates of the tip point in the device coordinate system.
[0034] In a second aspect, an embodiment of the present application provides an optical coordinate data acquisition device, the optical coordinate data acquisition device comprising:
[0035] an acquisition unit, configured to acquire the coordinates of the tip point of the optical coordinate data acquisition device, the initial coordinates of the trigger component, and the coordinates of each optical marking component in the device coordinate system; and to acquire an image obtained by taking a photo of the optical coordinate data acquisition device by a camera whenever the optical coordinate data acquisition device is placed at a target position in a preset posture, wherein the tip point is placed at the target position;
[0036] A processing unit is used to determine whether the trigger component is located at a trigger position based on the image, the initial coordinates of the trigger component in the device coordinate system, and the coordinates of each of the optical marking components; when the trigger component is located at the trigger position, the optical coordinates of the target position in the camera coordinate system are calculated based on the image and the coordinates of the tip point in the device coordinate system.
[0037] In a third aspect, an embodiment of the present application provides an electronic device, the electronic device comprising:
[0038] at least one processor; and,
[0039] a memory communicatively connected to the at least one processor; wherein,
[0040] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can perform the optical coordinate data acquisition method according to the first aspect.
[0041] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores an executable program, and the executable program is executed by a processor to implement the optical coordinate data acquisition method as described in the first aspect.
[0042] The present application provides an optical coordinate data acquisition method, device, electronic device and storage medium. The present application determines whether a trigger component is located at a trigger position based on an image, the initial coordinates of the trigger component in a device coordinate system and the coordinates of each optical marking component. When the trigger component is located at the trigger position, the optical coordinates of the target position in a camera coordinate system are calculated based on the image and the coordinates of the tip point in the device coordinate system. The user can trigger the electronic device to calculate the optical coordinates of the target position without the aid of an external control device, thereby improving the convenience of the optical coordinate data acquisition operation. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] Figure 1 It is a flowchart of the optical coordinate data acquisition method provided in an embodiment of the present application.
[0044] Figure 2 It is a structural schematic diagram of the first implementation mode of the optical coordinate data acquisition device provided in an embodiment of the present application.
[0045] Figure 3A It is a schematic diagram of a usage scenario of the first implementation mode of the optical coordinate data acquisition device provided in an embodiment of the present application when calculation of the electronic device is not triggered.
[0046] Figure 3BIt is a schematic diagram of a usage scenario when triggering electronic device calculation of the first implementation mode of the optical coordinate data acquisition device provided in an embodiment of the present application.
[0047] Figure 4 It is a structural diagram of the second implementation mode of the optical coordinate data acquisition device provided in an embodiment of the present application when the electronic device calculation is not triggered.
[0048] Figure 5 It is a structural diagram of the triggering electronic device calculation of the second implementation mode of the optical coordinate data acquisition device provided in an embodiment of the present application.
[0049] Figure 6 It is a structural diagram of the third implementation mode of the optical coordinate data acquisition device provided in an embodiment of the present application when the electronic device calculation is not triggered.
[0050] Figure 7 It is a structural diagram of the triggering electronic device calculation of the third implementation mode of the optical coordinate data acquisition device provided in an embodiment of the present application.
[0051] Figure 8 yes Figure 1 Detailed flowchart of step S300.
[0052] Fig. 9 yes Figure 8 Detailed flowchart of step S310 in FIG.
[0053] Fig.10 yes Figure 8 Detailed flowchart of step S320 in FIG.
[0054] Fig.11 It is a schematic diagram of the structure of the optical coordinate data acquisition device provided in an embodiment of the present application.
[0055] Fig.12 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application.
[0056] Fig.13 It is a structural block diagram of a computer-readable storage medium provided in an embodiment of the present application. DETAILED DESCRIPTION
[0057] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0058] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of the present invention, the meaning of "plurality" is two or more, unless otherwise clearly and specifically defined.
[0059] The present application provides an optical coordinate data acquisition method, device, electronic device and storage medium. It determines whether a trigger component is located at a trigger position based on an image, the initial coordinates of the trigger component in a device coordinate system and the coordinates of each optical marking component. When the trigger component is located at the trigger position, the optical coordinates of the target position in a camera coordinate system are calculated based on the image and the coordinates of the tip point in the device coordinate system. The user can trigger the electronic device to calculate the optical coordinates of the target position without the aid of an external control device, thereby improving the convenience of the optical coordinate data acquisition operation.
[0060] The optical coordinate data acquisition device involved in the present application may be an optical probe or other similar optical devices, which are used to obtain the coordinate data of the target position on the measured object.
[0061] Optionally, the object to be measured may include a surgical instrument, for example, the object to be measured may include a scalpel and a mechanical arm of a surgical robot.
[0062] The optical coordinate data acquisition method provided by the present application will be described in detail below with reference to the accompanying drawings.
[0063] See also Figure 1 , Figure 1 FIG. 1 is a flow chart of the optical coordinate data acquisition method provided in the embodiment of the present application. Figure 1 As shown, the optical coordinate data acquisition method includes: step S100 to step S400.
[0064] Step S100: Acquire the coordinates of the tip point of the optical coordinate data acquisition device, the initial coordinates of the trigger component, and the coordinates of each optical marking component in the device coordinate system.
[0065] See also Figure 2 , Figure 2 Schematic diagram of the structure of the first embodiment of the optical coordinate data acquisition device provided in the embodiment of the present application. Figure 2 As shown, in some embodiments, the optical coordinate data acquisition device 1 includes a main body T, a tip point S, at least three optical marking components 10, and a trigger component 20. The tip point S is used to be placed at the target position, all optical marking components 10 are fixedly mounted on the main body T, and the trigger component 20 is used to trigger the electronic device to calculate the optical coordinates of the target position in the camera coordinate system.
[0066] like Figure 2 As shown, in some embodiments, the initial position of the trigger component 20 and the installation positions of all the optical marker components 10 conform to a preset position relationship. Specifically, the installation position of each optical marker component 10 is the preset installation position corresponding to the optical marker component 10, and the initial position of the trigger component 20 is the preset installation position corresponding to the trigger component 20. In this way, in the image, the relative position relationship between the initial position of the trigger component 20 and the installation positions of all the optical marker components 10 is determined, which can facilitate the calculation of the optical coordinates of the target position according to the determined relative position relationship.
[0067] Optionally, in step S100, the coordinates of the tip point of the optical coordinate data acquisition device in the device coordinate system, the initial coordinates of the trigger component and the coordinates of each optical marking component are used to represent the relative position relationship between the tip point, the initial position of the trigger component and the installation positions of all optical marking components.
[0068] Understandably, Figure 2 This is only an example of one embodiment, and the initial position of the trigger component 20 and the installation positions of all optical marking components 10 are not necessarily Figure 2 The initial position of the trigger component 20 and the installation positions of all optical marking components 10 can conform to any relative position relationship. The initial position of the trigger component 20 is not necessarily Figure 2 As shown near the tip point S, the initial position of the trigger component 20 can be anywhere on the body T.
[0069] In some embodiments, the optical marking component 10 is a reflective marker, each of which has a reflective center. The reflective marker is used to reflect light of a specific wavelength (such as laser or infrared), so it will appear as a clear and identifiable feature point in the image, making it easier for the electronic device to calculate the position coordinates of the optical marking component 10 based on the image.
[0070] In some embodiments, the trigger component 20 is also a reflective marker.
[0071] Step S200: Whenever the optical coordinate data acquisition device is placed at a target position in a preset posture, an image obtained by taking a photo of the optical coordinate data acquisition device by a camera is acquired.
[0072] Among them, the tip point is placed at the target position.
[0073] In some embodiments, there are multiple images, and the acquisition time of the multiple images is different. At every preset time interval, an image of the optical coordinate data acquisition device placed at the target position in a preset posture is acquired by the camera.
[0074] Step S300: judging whether the trigger component is located at the trigger position based on the image, the initial coordinates of the trigger component in the device coordinate system and the coordinates of each optical marking component.
[0075] In some embodiments, the optical coordinate data acquisition method is performed in real time. Optionally, whether the trigger component is located at the trigger position is determined based on the currently acquired image, the initial coordinates of the trigger component in the device coordinate system, and the coordinates of each optical marking component. That is, for multiple images acquired at different acquisition times, subsequent calculations are performed based on the currently acquired image each time an image is acquired.
[0076] In some embodiments, when it is determined based on the image that part of the optical marking component is partially blocked or invisible, the subsequent steps are not executed, and a prompt is issued to remind the user to adjust the position of the optical coordinate data acquisition device. In this way, errors in subsequent calculations can be avoided and the accuracy of the optical coordinates of the collected tip point can be improved.
[0077] In some embodiments, the user triggers the electronic device to calculate the optical coordinates of the target position by blocking the trigger component or moving the trigger component to the trigger position. When the trigger calculation method of blocking the trigger component is adopted, the trigger component is determined to be at the trigger position when the trigger component is blocked.
[0078] like Figure 2 As shown, in some embodiments, the trigger component 20 is fixedly mounted on the main body T. At this time, the user triggers the electronic device to calculate the optical coordinates of the target position by covering the trigger component 20 .
[0079] See also Figure 3A and Figure 3B , Figure 3A It is a schematic diagram of a usage scenario of the first implementation mode of the optical coordinate data acquisition device provided in an embodiment of the present application when calculation of the electronic device is not triggered. Figure 3B 1 is a schematic diagram of a usage scenario of the first embodiment of the optical coordinate data acquisition device provided in the embodiment of the present application when triggering electronic device calculation. Figure 3A As shown in FIG. 1 , when the electronic device is not triggered to calculate, the trigger component 20 is not blocked. At this time, there are feature points representing the trigger component 20 in the image. Figure 3BAs shown, when the electronic device is triggered to calculate, the trigger component 20 is blocked. At this time, there will be no feature points representing the trigger component 20 in the image, and the subsequent electronic device can determine that the trigger component 20 is blocked based on the image, and then trigger the calculation process. In this way, the user can trigger the electronic device to calculate the optical coordinates of the target position without the help of an external control device, thereby improving the convenience of use of the optical coordinate data acquisition device 1.
[0080] In some implementations, the user triggers the electronic device to calculate the optical coordinates of the target position by moving a trigger component to a trigger position.
[0081] In some embodiments, the optical coordinate data acquisition device 1 further includes a movable component, which is used to drive the trigger component 20 to move along a preset motion trajectory. When the trigger component 20 is not located at the initial position after movement, the electronic device can determine that the trigger component 20 is located at the trigger position based on the image, and then trigger the calculation process.
[0082] See also Figure 4 , Figure 4 1 is a schematic diagram of the structure of the second embodiment of the optical coordinate data acquisition device provided in the embodiment of the present application when the electronic device calculation is not triggered. Figure 4 As shown, in some embodiments, the movable component is a sliding mechanism 30. The sliding mechanism 30 includes a slide rail 31 provided on the main body T and a slider 32 slidably mounted on the slide rail 31, the slider 32 is fixedly connected to the trigger component 20, and the slider 32 is used to drive the trigger component 20 to move along the slide rail 31. At this time, the trigger component 20 is located at the initial position.
[0083] See also Figure 5 , Figure 5 1 is a schematic diagram of the structure of the triggering electronic device for calculation of the second embodiment of the optical coordinate data acquisition device provided in the embodiment of the present application. Figure 5 As shown, Figure 5 After the middle trigger component 20 moves along the slide rail 31 , it is located at the trigger position.
[0084] For example, Figure 4 and Figure 5 As shown, when the user applies external force to the slider 32 , the slider 32 may move along the direction indicated by the arrow R1 , thereby driving the trigger component 20 to move along the direction indicated by the arrow R1 . The trigger component 20 moves along the slide rail 31 and is located at the trigger position.
[0085] like Figure 4As shown, in some embodiments, the sliding mechanism 30 includes a first reset mechanism 33, a first end of the first reset mechanism 33 is fixedly connected to one end of the slide rail 31, and a second end of the first reset mechanism 33 is connected to one end of the slider 32. The first reset mechanism 33 is used to make the slider 32 be located at the first initial position when no external force is applied. In this way, when the user does not apply external force to the slider 32, the slider 32 can automatically return to the first initial position, and the trigger component 20 will also automatically return to the initial position, so that the user can operate the slider 32 again to trigger the electronic device to calculate, thereby further improving the convenience of use of the optical coordinate data acquisition device 1.
[0086] like Figure 4 As shown, in some embodiments, the first reset mechanism 33 is a first elastic component, a first end of the first elastic component is fixedly connected to one end of the slide rail 31 , and a second end of the first elastic component is connected to one end of the slider 32 .
[0087] Optionally, when the user applies external force to the slider 32 to cause the trigger component 20 to leave the initial position, the first elastic component will be stretched or compressed. When the user does not apply external force to the slider 32, the first elastic component will drive the slider 32 to automatically return to the first initial position during the process of restoring its original shape, and the trigger component 20 will also automatically return to the initial position.
[0088] Optionally, the first elastic component may be a spring or elastic rubber.
[0089] In some embodiments, the first reset mechanism 33 includes a first magnetic component and a second magnetic component. The first magnetic component is fixedly mounted on one end of the slide rail 31 , and the second magnetic component is fixedly mounted on one end of the slider 32 .
[0090] In some embodiments, the adjacent magnetic poles of the first magnetic component and the second magnetic component have different magnetic properties, and the direction of the line from the first magnetic component to the second magnetic component is opposite to the movement direction of the slider 32. When the user applies an external force to the slider 32 to make the trigger component 20 leave the initial position, the first magnetic component and the second magnetic component always attract each other. When the user does not apply an external force to the slider 32, the mutual attraction between the first magnetic component and the second magnetic component will drive the second magnetic component to move, and then the slider 32 is automatically restored to the first initial position through the second magnetic component, and the trigger component 20 will also automatically restore to the initial position.
[0091] In other embodiments, the adjacent magnetic poles of the first magnetic component and the second magnetic component have the same magnetic properties, and the direction of the line from the first magnetic component to the second magnetic component is the same as the direction of movement of the slider 32. When the user applies an external force to the slider 32 to cause the trigger component 20 to leave the initial position, the first magnetic component and the second magnetic component always repel each other, and during the movement of the trigger component 20, the distance between the first magnetic component and the second magnetic component gradually decreases, and the repulsive force gradually increases. When the user does not apply an external force to the slider 32, the mutual repulsive force between the first magnetic component and the second magnetic component will drive the second magnetic component to move, and then the slider 32 is automatically restored to the first initial position through the second magnetic component, and the trigger component 20 will also automatically restore to the initial position.
[0092] See also Figure 6 , Figure 6 1 is a schematic diagram of the structure of the third embodiment of the optical coordinate data acquisition device provided in the embodiment of the present application when the electronic device calculation is not triggered. Figure 6 As shown, in some embodiments, the movable component is a rotating mechanism 40. The rotating mechanism 40 includes a fixed portion 41 disposed on the main body T and a rotating portion 42 rotatably connected to the fixed portion 41. The rotating portion 42 is fixedly connected to the trigger component 20, and the rotating portion 42 is used to drive the trigger component 20 to rotate along a preset rotation trajectory. At this time, the trigger component 20 is located at the initial position.
[0093] See also Figure 7 , Figure 7 1 is a schematic diagram of the structure of the triggering electronic device calculation of the third embodiment of the optical coordinate data acquisition device provided in the embodiment of the present application. Figure 7 As shown, Figure 7 The middle trigger component 20 is located at the trigger position after rotating.
[0094] For example, Figure 6 and Figure 7 As shown, the user can push the rotating part 42 in the direction indicated by the arrow R2, so that the elastic component rotates with the direction indicated by the arrow R3 as the tangent direction and the fixing part 41 as the fulcrum, and the trigger component 20 is located at the trigger position after rotation.
[0095] In some embodiments, the rotating mechanism 40 includes a second reset mechanism 43, the first end of the second reset mechanism 43 is fixedly mounted at a position of the main body T near one end of the rotating part 42, the second end of the second reset mechanism 43 is connected to one end of the rotating part 42, and the second reset mechanism 43 is used to make the rotating part 42 be located at the second initial position when no external force is applied. In this way, when the user does not apply external force to the rotating part 42, the rotating part 42 can automatically return to the second initial position, and the trigger component 20 will also automatically return to the initial position, so that the user can operate the rotating part 42 again to trigger the electronic device to calculate, thereby further improving the convenience of use of the optical coordinate data acquisition device 1.
[0096] like Figure 6 As shown, in some embodiments, the second reset mechanism 43 is a second elastic component, which is fixedly mounted on the main body T near one end of the rotating portion 42 , and the second end of the second elastic component is connected to one end of the rotating portion 42 .
[0097] Optionally, when the user applies external force to the rotating part 42 to cause the trigger component 20 to leave the initial position, the second elastic component will be stretched or compressed. When the user does not apply external force to the rotating part 42, the second elastic component will drive the rotating part 42 to automatically return to the first initial position in the process of restoring its original shape, and the trigger component 20 will also automatically return to the initial position.
[0098] Optionally, the second elastic component may be a spring or elastic rubber.
[0099] In some embodiments, the second reset mechanism 43 includes a third magnetic component and a fourth magnetic component. The third magnetic component is fixedly installed at a position of the main body T close to one end of the rotating portion 42 , and the fourth magnetic component is fixedly installed at one end of the rotating portion 42 .
[0100] In some embodiments, the adjacent magnetic poles of the third magnetic component and the fourth magnetic component have the same magnetic properties, the third magnetic component is fixedly mounted on the main body T at a position close to the first end of the rotating portion 42 fixedly connected to the trigger component 20, and the fourth magnetic component is fixedly mounted on the first end of the rotating portion 42. When the user applies an external force to the rotating portion 42 to cause the trigger component 20 to leave the initial position, the third magnetic component and the fourth magnetic component always attract each other, and when the user does not apply an external force to the rotating portion 42, the mutual attraction between the third magnetic component and the fourth magnetic component will drive the fourth magnetic component to move, and then the rotating portion 42 is automatically restored to the second initial position through the fourth magnetic component, and the trigger component 20 will also automatically restore to the initial position accordingly.
[0101] In some embodiments, the magnetism of adjacent magnetic poles of the third magnetic component and the fourth magnetic component is different, the third magnetic component is fixedly installed at a position of the second end of the main body T close to the rotating part 42 that is not fixedly connected to the trigger component 20, and the fourth magnetic component is fixedly installed at the second end of the rotating part 42. When the user applies an external force to the rotating part 42 to make the trigger component 20 leave the initial position, the third magnetic component and the fourth magnetic component always repel each other, and during the movement of the trigger component 20, the distance between the third magnetic component and the fourth magnetic component gradually decreases, and the repulsive force gradually increases. When the user does not apply an external force to the rotating part 42, the mutual repulsive force between the third magnetic component and the fourth magnetic component will drive the fourth magnetic component to move, and then the rotating part 42 is automatically restored to the second initial position through the fourth magnetic component, and the trigger component 20 will also automatically restore to the initial position.
[0102] See also Figure 8 , Figure 8 yes Figure 1 Detailed flow chart of step S300 in FIG. Figure 8 As shown, in some implementations, step S300 includes steps S310 to S320.
[0103] Step S310: Determine the calculated position coordinates of the trigger component in the target coordinate system based on the image, the initial coordinates of the trigger component in the device coordinate system, and the coordinates of each optical marking component.
[0104] Optionally, the target coordinate system is a device coordinate system or a camera coordinate system.
[0105] See also Fig. 9 , Fig. 9 yes Figure 8 Detailed flow chart of step S310 in FIG. Fig. 9 As shown, in some embodiments, step S310 includes steps S311 to S312.
[0106] Step S311: when it is determined based on the image that the trigger component is blocked, the preset coordinates in the target coordinate system are determined as the calculated position coordinates of the trigger component in the target coordinate system.
[0107] In some embodiments, when a trigger calculation method of blocking the trigger component is used, step S311 is executed when the trigger component is blocked based on the image, and calculation is not triggered when the trigger component is not blocked based on the image. When a trigger calculation method of moving the trigger component to the trigger position is used, subsequent steps are not executed when the trigger component is blocked based on the image, and a prompt is issued to remind the user to adjust the operation.
[0108] In some embodiments, when a trigger calculation method of blocking the trigger component is adopted, and when the trigger component is blocked based on the image, it can be directly determined that the trigger component is at the trigger position, and then step S400 is executed. In step S311, the preset coordinates in the target coordinate system are determined as the calculated position coordinates of the trigger component in the target coordinate system, so as to make the algorithm compatible with the trigger calculation method of moving the trigger component to the trigger position.
[0109] like Figure 3B As shown, when the electronic device is triggered to calculate, the trigger component 20 is blocked. At this time, there is no feature point representing the trigger component 20 in the image, and the electronic device can determine that the trigger component is blocked based on the image, and then trigger the calculation process.
[0110] Optionally, when the target coordinate system is a camera coordinate system, the preset coordinates in the target coordinate system are (0, 0, 0).
[0111] Step S312: When it is determined based on the image that the trigger component is not blocked, the corresponding target calculation method is determined according to the target coordinate system, and the calculated position coordinates of the trigger component in the target coordinate system are determined based on the image, the initial coordinates of the trigger component in the device coordinate system, and the coordinates of each optical marking component using the target calculation method.
[0112] Optionally, the corresponding target calculation method is determined according to the target coordinate system in order to subsequently determine whether the trigger component is moved to the trigger position by the user according to the initial coordinates and current coordinates of the trigger component in the same coordinate system.
[0113] In some embodiments, when the trigger calculation method of moving the trigger component to the trigger position is adopted, step S312 is performed when the trigger component is determined to be not blocked based on the image. When the trigger calculation method of blocking the trigger component is adopted, calculation is not triggered when the trigger component is determined to be not blocked based on the image.
[0114] In some embodiments, when the target coordinate system is the device coordinate system, step S312 includes: when it is determined based on the image that the trigger component is not obscured and the target coordinate system is the device coordinate system, the initial coordinates of the trigger component in the device coordinate system are determined as the calculated position coordinates of the trigger component in the target coordinate system.
[0115] In some embodiments, when the target coordinate system is a camera coordinate system, step S312 includes steps S3121 to S3123.
[0116] Step S3121: when it is determined based on the image that the trigger component is not blocked and the target coordinate system is the camera coordinate system, the current coordinates of each optical marking component in the camera coordinate system are determined based on the image.
[0117] As described above, each optical marker component will appear as a clearly identifiable feature point in the image. In some embodiments, the feature points in the image are identified, and then the pixel coordinates of the feature points detected on the image are converted into coordinates in the camera coordinate system based on the camera intrinsic parameter matrix to obtain the current coordinates of the optical marker component corresponding to the feature point in the camera coordinate system.
[0118] Optionally, the camera is fixed, and the electronic device inputs the image into a preset program to obtain the current coordinates of each optical marking component in the camera coordinate system.
[0119] Optionally, in step S3121, the current coordinates of the trigger component in the camera coordinate system are determined based on the image at the same time.
[0120] Step S3122: Calculate a transformation matrix from the device coordinate system to the camera coordinate system based on the coordinates of each optical mark member in the device coordinate system and the current coordinates of each optical mark member in the camera coordinate system.
[0121] In some embodiments, a calculation function in a computer vision and graphics processing library is used to calculate a transformation matrix from the device coordinate system to the camera coordinate system based on the coordinates of each optical mark component in the device coordinate system and the current coordinates of each optical mark component in the camera coordinate system.
[0122] Optionally, the computer vision and graphics processing libraries include OpenCV (Open Source Computer Vision Library), VTK (The Visualization Toolkit), PCL (Point Cloud Library), and the like.
[0123] In some embodiments, a singular value decomposition method is used to calculate a transformation matrix from the device coordinate system to the camera coordinate system based on the coordinates of each optical marker component in the device coordinate system and the current coordinates of each optical marker component in the camera coordinate system.
[0124] Step S3123: multiply the initial coordinates of the trigger component in the device coordinate system by the conversion matrix to obtain the calculated position coordinates of the trigger component in the target coordinate system.
[0125] At this time, the calculated position coordinates of the trigger component in the target coordinate system, that is, the calculated position coordinates of the trigger component in the camera coordinate system, can be used to represent the initial position of the trigger component in the target coordinate system.
[0126] Step S320: when the distance between the calculated position coordinates of the trigger component in the target coordinate system and the current coordinates of the trigger component in the target coordinate system is greater than a preset value, it is determined that the trigger component is located at the trigger position; otherwise, it is determined that the trigger component is not located at the trigger position.
[0127] When the trigger component is not at the trigger position, the ideal value of the distance between the calculated position coordinates of the trigger component in the target coordinate system and the current coordinates should be 0. However, due to the positioning error of the camera, the distance may not be 0.
[0128] In some implementations, the preset value is set according to a positioning error of the camera.
[0129] Optionally, the preset value is greater than the positioning error of the camera. For example, when the positioning error of the camera is 0.2 mm (millimeter), the preset value can be set to 0.3 mm.
[0130] See also Fig.10 , Fig.10 yes Figure 8 Detailed flow chart of step S320 in FIG. Fig.10 As shown, in some embodiments, step S320 includes steps S321 to S324.
[0131] Step S321: Determine the current coordinates of the trigger component in the camera coordinate system based on the image.
[0132] When the target coordinate system is the target coordinate system, step S322 is performed after step S321.
[0133] When the target coordinate system is the device coordinate system, steps S323 to S324 are executed after step S321.
[0134] As described above, in step S3121, the current coordinates of the trigger component in the camera coordinate system can be determined based on the image at the same time. In this case, the current coordinates of the trigger component in the camera coordinate system are directly obtained in step S321, and no repeated calculation is required.
[0135] Step S322: When the target coordinate system is the camera coordinate system, when the distance between the calculated position coordinates of the trigger component in the camera coordinate system and the current coordinates of the trigger component in the camera coordinate system is greater than a preset value, it is determined that the trigger component is at the trigger position; otherwise, it is determined that the trigger component is not at the trigger position.
[0136] Step S323: When the target coordinate system is the device coordinate system, the current coordinates of the trigger component in the camera coordinate system are multiplied by the inverse matrix of the conversion matrix from the device coordinate system to the camera coordinate system to obtain the current coordinates of the trigger component in the device coordinate system.
[0137] The inverse matrix of the transformation matrix from the device coordinate system to the camera coordinate system is the transformation matrix from the camera coordinate system to the device coordinate system.
[0138] Optionally, the transformation matrix from the device coordinate system to the camera coordinate system in step S323 has been calculated in step S3122 and does not need to be calculated again here.
[0139] Step S324: when the distance between the calculated position coordinates of the trigger component in the device coordinate system and the current coordinates of the trigger component in the device coordinate system is greater than a preset value, it is determined that the trigger component is located at the trigger position; otherwise, it is determined that the trigger component is not located at the trigger position.
[0140] Step S400: When the trigger component is located at the trigger position, the optical coordinates of the target position in the camera coordinate system are calculated based on the image and the coordinates of the tip point in the device coordinate system.
[0141] In some embodiments, the current coordinates of each optical marker component in the camera coordinate system are determined based on the image, and then the conversion matrix from the device coordinate system to the camera coordinate system is calculated based on the coordinates of each optical marker component in the device coordinate system and the current coordinates of each optical marker component in the camera coordinate system. The conversion matrix from the device coordinate system to the camera coordinate system has been calculated in step S3122 and does not need to be calculated repeatedly.
[0142] In some embodiments, the coordinates of the tip point in the device coordinate system are pre-multiplied by a transformation matrix to obtain the optical coordinates of the target position in the camera coordinate system.
[0143] Because the tip point is placed at the target position, the coordinates of the tip point in the device coordinate system are left-multiplied by the transformation matrix to obtain the optical coordinates of the tip point in the camera coordinate system, and the optical coordinates of the tip point are used as the optical coordinates of the target position.
[0144] As described above, the optical coordinate data acquisition method is performed in real time. In some embodiments, it is determined whether the trigger component is located at the trigger position based on the currently acquired image, the initial coordinates of the trigger component in the device coordinate system, and the coordinates of each optical marking component. That is, for multiple images acquired at different acquisition times, subsequent calculations are performed based on the currently acquired image each time an image is acquired.
[0145] In some embodiments, when the trigger component is located at the trigger position, and it is determined that the trigger component is not located at the trigger position based on the last image acquired before the currently acquired image, the optical coordinates of the target position in the camera coordinate system are calculated based on the currently acquired image and the coordinates of the tip point in the device coordinate system. Among them, the last image acquired before the currently acquired image refers to an image acquired closest to the currently acquired image among all images acquired before the currently acquired image. In this way, when the trigger component is continuously located at the trigger position, only the optical coordinates of the tip point at the moment of the initial triggering are recorded, and the optical coordinates of the new tip point can be collected again after the user releases the trigger operation, thereby avoiding the collection of redundant data and optimizing the user interaction experience.
[0146] In summary, the optical coordinate data acquisition method provided in the embodiment of the present application has the following advantages:
[0147] 1. By judging whether the trigger component is located at the trigger position based on the image, the initial coordinates of the trigger component in the device coordinate system and the coordinates of each optical marking component, when the trigger component is located at the trigger position, the optical coordinates of the target position in the camera coordinate system are calculated based on the image and the coordinates of the tip point in the device coordinate system. The user can trigger the electronic device to calculate the optical coordinates of the target position without the aid of an external control device, thereby improving the convenience of the optical coordinate data acquisition operation.
[0148] 2. When it is determined based on the image that part of the optical marking component is partially blocked or invisible, subsequent steps are not executed, and a prompt is issued to remind the user to adjust the position of the optical coordinate data acquisition device. This can avoid errors in subsequent calculations and improve the accuracy of the optical coordinates of the collected tip point.
[0149] 3. When the trigger component is at the trigger position and it is determined that the trigger component is not at the trigger position based on the previous image acquired before the currently acquired image, the optical coordinates of the target position in the camera coordinate system are calculated based on the currently acquired image and the coordinates of the tip point in the device coordinate system. When the trigger component continues to be at the trigger position, only the optical coordinates of the tip point at the moment of the initial triggering are recorded, and the new optical coordinates of the tip point can be collected again after the user releases the trigger operation, thereby avoiding the collection of redundant data and optimizing the user interaction experience.
[0150] See also Fig.11 , Fig.11 Schematic diagram of the structure of the optical coordinate data acquisition device provided in the embodiment of the present application. Fig.11 As shown, the optical coordinate data acquisition device 300 includes an acquisition module 310 and a processing module 320 .
[0151] In some embodiments, the acquisition module 310 is used to acquire the coordinates of the tip point of the optical coordinate data acquisition device, the initial coordinates of the trigger component, and the coordinates of each optical marking component in the device coordinate system; whenever the optical coordinate data acquisition device is placed at the target position in a preset posture, an image obtained by taking a photo of the optical coordinate data acquisition device by a camera is acquired, wherein the tip point is placed at the target position.
[0152] In some embodiments, the processing module 320 is used to determine whether the trigger component is located at the trigger position based on the image, the initial coordinates of the trigger component in the device coordinate system, and the coordinates of each optical marking component; when the trigger component is located at the trigger position, the optical coordinates of the target position in the camera coordinate system are calculated based on the image and the coordinates of the tip point in the device coordinate system.
[0153] See also Fig.12 , Fig.12 Schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Fig.12 As shown, the electronic device 400 includes: one or more processors 410 and a memory 420, Fig.12 A processor 410 is taken as an example.
[0154] In some implementations, the processor 410 and the memory 420 may be connected via a bus or other means. Fig.12 The example of connecting through bus is taken in the following.
[0155] In some embodiments, the processor 410 is used to obtain the coordinates of the tip point of the optical coordinate data acquisition device, the initial coordinates of the trigger component, and the coordinates of each optical marking component in the device coordinate system; whenever the optical coordinate data acquisition device is placed at the target position in a preset posture, obtain an image obtained by the camera taking a picture of the optical coordinate data acquisition device, wherein the tip point is placed at the target position; determine whether the trigger component is located at the trigger position based on the image, the initial coordinates of the trigger component in the device coordinate system, and the coordinates of each optical marking component; when the trigger component is located at the trigger position, calculate the optical coordinates of the target position in the camera coordinate system based on the image and the coordinates of the tip point in the device coordinate system.
[0156] In some embodiments, the memory 420 is a non-volatile computer-readable storage medium that can be used to store non-volatile software programs, non-volatile computer executable programs and modules, such as program instructions / modules of the optical coordinate data acquisition method in the embodiment of the present application. The processor 410 executes various functional applications and data processing of the electronic device 400 by running the non-volatile software programs, instructions and modules stored in the memory 420, that is, the optical coordinate data acquisition method of the above method embodiment is implemented.
[0157] In some embodiments, the memory 420 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the electronic device 400, etc. In addition, the memory 420 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some embodiments, the memory 420 may optionally include a memory remotely arranged relative to the processor 410, and these remote memories may be connected to the controller via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0158] In some embodiments, one or more modules are stored in the memory 420, and when executed by one or more processors 410, the optical coordinate data acquisition method in any of the above method embodiments is executed, for example, the above described Figure 1 The method comprises steps S100 to S400.
[0159] In some embodiments, the electronic device may be a chip, such as a data processor (DPU) chip used in a data center, or the electronic device may be a network interface card including a chip and multiple interfaces (such as a PCI / PCIE interface, a UART interface, a USB interface, etc.), or the electronic device may be a traditional server, or a server including a network interface card or a chip, wherein the server includes a host and a data processor, wherein the data processor is used to dispatch messages to the host or the data processor itself for processing, and the host is used to process messages dispatched by the data processor.
[0160] Please refer to Fig.13 , Fig.13 The computer-readable storage medium 500 stores a program code 510, which can be called by a processor to execute the optical coordinate data acquisition method described in the above method embodiment.
[0161] The computer readable storage medium 500 may be an electronic memory such as a flash memory, an EEPROM (electrically erasable programmable read-only memory), an EPROM, a hard disk, or a ROM. Optionally, the computer readable storage medium includes a non-transitory computer readable storage medium. The computer readable storage medium 500 has a storage space for program codes for executing any method steps in the above-mentioned optical coordinate data acquisition method. These program codes may be read from or written to one or more computer program products. The program code may be compressed, for example, in an appropriate form.
[0162] In some implementations, the present application also provides a computer program product, including a computer program, which implements the above-mentioned optical coordinate data acquisition method when executed by a processor.
[0163] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a computer-readable storage medium 500. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory may include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory may include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited thereto. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited thereto.
[0164] In summary, the present application provides an optical coordinate data acquisition method, device, electronic device and storage medium, the optical coordinate data acquisition method comprising: obtaining the coordinates of the tip point of the optical coordinate data acquisition device, the initial coordinates of the trigger component and the coordinates of each optical marker component in the device coordinate system; whenever the optical coordinate data acquisition device is placed at the target position in a preset posture, obtaining an image obtained by a camera taking a photo of the optical coordinate data acquisition device, wherein the tip point is placed at the target position; judging whether the trigger component is located at the trigger position based on the image, the initial coordinates of the trigger component in the device coordinate system and the coordinates of each optical marker component; when the trigger component is located at the trigger position, calculating the optical coordinates of the target position in the camera coordinate system based on the image and the coordinates of the tip point in the device coordinate system. The present application judges whether the trigger component is located at the trigger position based on the image, the initial coordinates of the trigger component in the device coordinate system and the coordinates of each optical marker component, and when the trigger component is located at the trigger position, calculating the optical coordinates of the target position in the camera coordinate system based on the image and the coordinates of the tip point in the device coordinate system, so that the user can trigger the electronic device to calculate the optical coordinates of the target position without the aid of an external control device, thereby improving the convenience of the optical coordinate data acquisition operation.
[0165] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. An optical coordinate data acquisition method, characterized in that: The optical coordinate data acquisition method comprises: Acquire the coordinates of the tip point of the optical coordinate data acquisition device, the initial coordinates of the trigger component, and the coordinates of each optical marking component in the device coordinate system; Whenever the optical coordinate data acquisition device is placed at a target position in a preset posture, an image obtained by taking a picture of the optical coordinate data acquisition device by a camera is acquired, wherein the tip point is placed at the target position; determining whether the trigger component is located at a trigger position based on the image, the initial coordinates of the trigger component in the device coordinate system, and the coordinates of each of the optical marking components; When the trigger component is located at the trigger position, the optical coordinates of the target position in the camera coordinate system are calculated based on the image and the coordinates of the tip point in the device coordinate system.
2. The optical coordinate data acquisition method according to claim 1, characterized in that: The determining whether the trigger component is located at the trigger position based on the image, the initial coordinates of the trigger component in the device coordinate system, and the coordinates of each of the optical marking components comprises: determining calculated position coordinates of the trigger component in a target coordinate system based on the image, the initial coordinates of the trigger component in the device coordinate system, and the coordinates of each of the optical marking components, the target coordinate system being the device coordinate system or the camera coordinate system; When the distance between the calculated position coordinates of the trigger component in the target coordinate system and the current coordinates of the trigger component in the target coordinate system is greater than a preset value, it is determined that the trigger component is located at the trigger position; otherwise, it is determined that the trigger component is not located at the trigger position.
3. The optical coordinate data acquisition method according to claim 2, characterized in that: The determining the calculated position coordinates of the trigger component in the target coordinate system based on the image, the initial coordinates of the trigger component in the device coordinate system, and the coordinates of each of the optical marking components comprises: When it is determined based on the image that the trigger component is blocked, determining the preset coordinates in the target coordinate system as the calculated position coordinates of the trigger component in the target coordinate system; When it is determined based on the image that the trigger component is not blocked, the corresponding target calculation method is determined according to the target coordinate system, and the calculated position coordinates of the trigger component in the target coordinate system are determined based on the image, the initial coordinates of the trigger component in the device coordinate system, and the coordinates of each of the optical marking components.
4. The optical coordinate data acquisition method according to claim 3, characterized in that: When it is determined based on the image that the trigger component is not blocked, a corresponding target calculation method is determined according to the target coordinate system, and the calculated position coordinates of the trigger component in the target coordinate system are determined based on the image, the initial coordinates of the trigger component in the device coordinate system, and the coordinates of each of the optical marking components using the target calculation method, including: When it is determined based on the image that the trigger component is not blocked and the target coordinate system is the device coordinate system, the initial coordinates of the trigger component in the device coordinate system are determined as the calculated position coordinates of the trigger component in the target coordinate system; When it is determined based on the image that the trigger component is not blocked and the target coordinate system is the camera coordinate system, determining the current coordinates of each of the optical marking components in the camera coordinate system based on the image; Calculating a transformation matrix from the device coordinate system to the camera coordinate system based on the coordinates of each of the optical mark components in the device coordinate system and the current coordinates of each of the optical mark components in the camera coordinate system; The initial coordinates of the trigger component in the device coordinate system are multiplied by the conversion matrix to obtain the calculated position coordinates of the trigger component in the target coordinate system.
5. The optical coordinate data acquisition method according to claim 4, characterized in that: When the trigger component is located at the trigger position, the optical coordinates of the target position in the camera coordinate system are calculated based on the image and the coordinates of the tip point in the device coordinate system, including: The coordinates of the tip point in the device coordinate system are multiplied by the transformation matrix to obtain the optical coordinates of the target position in the camera coordinate system.
6. The optical coordinate data acquisition method according to claim 2, characterized in that: When the distance between the calculated position coordinates of the trigger component in the target coordinate system and the current coordinates of the trigger component in the target coordinate system is greater than a preset value, judging that the trigger component is located at the trigger position; otherwise, judging that the trigger component is not located at the trigger position, comprises: determining a current coordinate of a trigger component in the camera coordinate system based on the image; When the target coordinate system is the camera coordinate system, when the distance between the calculated position coordinates of the trigger component in the camera coordinate system and the current coordinates of the trigger component in the camera coordinate system is greater than a preset value, it is judged that the trigger component is located at the trigger position, otherwise it is judged that the trigger component is not located at the trigger position; When the target coordinate system is the device coordinate system, the current coordinates of the trigger component in the camera coordinate system are multiplied by the inverse matrix of the conversion matrix from the device coordinate system to the camera coordinate system to obtain the current coordinates of the trigger component in the device coordinate system; When the distance between the calculated position coordinates of the trigger component in the device coordinate system and the current coordinates of the trigger component in the device coordinate system is greater than a preset value, it is determined that the trigger component is located at the trigger position; otherwise, it is determined that the trigger component is not located at the trigger position.
7. The optical coordinate data acquisition method according to claim 1, characterized in that: The number of the images is multiple, and the acquisition time of the multiple images is different. The determining whether the trigger component is located at the trigger position based on the images, the initial coordinates of the trigger component in the device coordinate system, and the coordinates of each of the optical marking components includes: Determining whether the trigger component is located at a trigger position based on the currently acquired image, the initial coordinates of the trigger component in the device coordinate system, and the coordinates of each of the optical marking components; When the trigger component is located at the trigger position, the optical coordinates of the target position in the camera coordinate system are calculated based on the image and the coordinates of the tip point in the device coordinate system, including: When the trigger component is located at the trigger position and it is determined that the trigger component is not located at the trigger position based on a previous image acquired before the currently acquired image, the optical coordinates of the target position in the camera coordinate system are calculated based on the currently acquired image and the coordinates of the tip point in the device coordinate system.
8. An optical coordinate data acquisition device, characterized in that: The optical coordinate data acquisition device comprises: an acquisition unit, configured to acquire the coordinates of the tip point of the optical coordinate data acquisition device, the initial coordinates of the trigger component, and the coordinates of each optical marking component in the device coordinate system; and to acquire an image obtained by taking a photo of the optical coordinate data acquisition device by a camera whenever the optical coordinate data acquisition device is placed at a target position in a preset posture, wherein the tip point is placed at the target position; A processing unit is used to determine whether the trigger component is located at a trigger position based on the image, the initial coordinates of the trigger component in the device coordinate system, and the coordinates of each of the optical marking components; when the trigger component is located at the trigger position, the optical coordinates of the target position in the camera coordinate system are calculated based on the image and the coordinates of the tip point in the device coordinate system.
9. An electronic device, characterized in that: The electronic device comprises: at least one processor; and, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the optical coordinate data acquisition method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores an executable program, and the executable program is executed by a processor to implement the optical coordinate data acquisition method according to any one of claims 1 to 7.