Computer touch method and system based on double-camera infrared pen position recognition
Through the combination of dual cameras and binocular ranging algorithms, combined with the Kalman filter algorithm and accelerometer data, the problem of insufficient positioning accuracy and stability of the infrared pen is solved, achieving more precise computer touch and simplifying user operations, improving user experience.
Patent Information
- Application Number
- CN202410893623.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-04
- Publication Date
- 2024-10-29
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
In the existing technology, the position acquisition accuracy and stability of the infrared pen are insufficient, resulting in limited touch accuracy and response speed, and the user needs to perform cumbersome calibration operations.
It uses dual cameras to collect infrared light images emitted by the infrared pen in real time, combines the binocular ranging algorithm to calculate the distance between the infrared pen and the camera, and uses the Kalman filter algorithm and accelerometer data to accurately calculate the position of the infrared pen, simplifying user operations and improving positioning. Accuracy.
It improves the positioning accuracy and stability of the infrared pen, simplifies user operations, achieves more precise computer touch, and enhances user experience.
Smart Images

Figure CN118860189A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of computer input devices, and in particular to a computer touch control method and system based on dual-camera infrared pen position recognition. Background Art
[0002] With the development of science and technology, touch technology has gradually become popular. Among them, the mouse, as a traditional computer input device, has been widely used in various scenarios. However, in certain specific occasions, such as large-screen demonstrations and teaching, the use of traditional mice has limitations. Therefore, there is a demand in the market to use infrared pens instead of mice for computer control.
[0003] At present, using an infrared pen instead of a mouse to achieve more convenient and flexible computer control often requires obtaining accurate infrared pen position information and associating it with computer coordinates. However, in the prior art, the accuracy and stability of capturing the position of the infrared pen need to be improved. At the same time, the prior art usually requires users to perform tedious calibration operations, which affects the accuracy and response speed of touch control. Summary of the invention
[0004] In order to improve the positioning accuracy and stability of the infrared pen and achieve more precise computer touch, the present application provides a computer touch method and system based on dual-camera infrared pen position recognition.
[0005] In a first aspect, the present application provides a computer touch control method based on dual-camera infrared pen position recognition, comprising: Sending a synchronization signal to two camera devices, when the two camera devices receive the synchronization signal, using the two camera devices to respectively collect real-time images of infrared light emitted by the infrared pen, the infrared pen being connected to the computer through an interface; Preprocess the image of the infrared pen emitting infrared light collected in real time to obtain the position of the bright spot representing the infrared pen in the image; According to the three-dimensional coordinate system constructed with the middle position point of the two camera devices as the origin, combined with the position of the bright spot representing the infrared pen in the image obtained in real time, the binocular ranging algorithm is used to calculate the actual distance between the infrared pen and the camera device, and the position information of the infrared pen is obtained in real time; According to the infrared pen position information obtained in real time, the moving trajectory of the infrared pen is identified; whether there is a moving trajectory consistent with the current moving trajectory of the infrared pen is queried from the moving trajectory database, if a consistent moving trajectory is found, the corresponding mouse operation is matched according to the queried moving trajectory, and the computer content is controlled according to the matched mouse operation; wherein, different preset moving trajectories are stored in the moving trajectory database, each preset moving trajectory corresponds to a mouse operation, and the mouse operations include: dragging and scrolling.
[0006] By adopting the above scheme, the dual camera device that receives the synchronization signal is used to synchronously collect the real-time image of the infrared pen, and the binocular ranging algorithm is combined to accurately calculate the distance between the infrared pen and the camera, thereby improving the positioning accuracy and stability of the infrared pen; the position information of the infrared pen is used to correspond to the mouse operation to simulate the mouse operation, and the computer can be controlled by simply operating the infrared pen, thereby simplifying the user operation and improving the user experience.
[0007] Preferably, it also includes: Counting the position of the bright spot representing the infrared pen in the image in real time, obtaining the number of times the position of the bright spot representing the infrared pen in the image is obtained within a certain period of time, and determining whether the counted number of times falls within a preset number range; According to the preset number range of the determined statistical number of times, various mouse click operations are matched accordingly; wherein each preset number range represents that the infrared light emitted by the infrared pen flashes at a preset frequency, and corresponds to a mouse click operation mode, and the infrared light emitted by the infrared pen flashes at a preset frequency and is generated according to the corresponding squeezing trigger of the left and right buttons set by the infrared pen; the mouse click operations include: single click of the left mouse button, right click of the mouse button, double click of the left mouse button, and double click of the right mouse button; Control the computer according to a matching mouse click operation method.
[0008] By adopting the above scheme, the design generates infrared light of a preset frequency according to the corresponding triggers of the left and right buttons of the infrared pen. The corresponding number of occurrences of the bright spot representing the position of the infrared pen in the image within a preset time can be counted to match the mouse click operation, thereby simplifying the user operation and realizing the simulation of mouse operation on the computer according to the position information of the infrared pen.
[0009] Preferably, it also includes: The infrared pen is also equipped with an accelerometer, and the position of the infrared pen is preliminarily estimated according to the acceleration value of the accelerometer and used as a priori estimation; The infrared pen position information obtained by binocular ranging algorithm at the previous moment is used as a posteriori estimate; According to the prior estimation and the a posteriori estimation, the Kalman filter estimation algorithm is used to calculate the position information of the infrared pen at the current moment to update the infrared pen position information obtained in real time.
[0010] By adopting the above solution, considering that there may be errors in the calculation of the position information of a single infrared pen, the Kalman filter algorithm is used to combine the acceleration value of the accelerometer and the position calculated in the previous step to obtain more accurate position information.
[0011] Preferably, it also includes: Real-time collection of ambient light intensity; Determine whether the collected light intensity is higher than the preset light intensity or use the binocular ranging algorithm to calculate whether the actual distance between the infrared pen and the camera device exceeds the preset distance range. If so, generate an adjustment instruction to enhance the infrared light signal intensity and send it to the infrared pen to enhance the infrared light signal intensity of the infrared pen.
[0012] By adopting the above scheme, taking into account that the ambient light intensity and distance will affect the effect of the camera device in capturing the infrared light emitted by the infrared pen, a real-time comparison is performed with the preset ambient light threshold or distance threshold. Once it is found that the current ambient light threshold and the preset distance threshold are exceeded, the signal strength of the infrared light generated by the infrared pen is adjusted accordingly to compensate for the effect of the camera device in capturing the infrared light emitted by the infrared pen.
[0013] Preferably, it also includes: According to the real-time position information of the infrared pen, the coordinates of two dimensions in the three-dimensional coordinates are multiplied by a custom coefficient to obtain the coordinates of the cursor on the computer screen; the custom coefficient is set according to the three-dimensional coordinate value of the infrared pen position and the size of the computer screen display.
[0014] By adopting the above scheme, the position information of the simulated mouse cursor on the computer screen coordinates is obtained according to the custom coefficient and the position information of the infrared pen, and the position coordinate changes of the cursor on the computer screen are checked to verify whether the control of the corresponding simulated mouse operation is correct.
[0015] Preferably, it also includes: A timestamp or a specific synchronization mark is added to the video stream of each camera device. Before preprocessing the image of the infrared light emitted by the infrared pen collected in real time, the timestamps or the specific synchronization mark are compared and it is determined whether the images collected by the two cameras are at the same time point. If they are not at the same time point, subsequent processing operations are stopped, and the internal clocks of the two cameras are calibrated using the network time protocol or other time synchronization protocols.
[0016] By adopting the above scheme, the timestamp and synchronization mark are recorded in each frame of video, which is convenient for comparing and judging whether the two cameras capture the infrared pen images at the same time, so as to adjust the internal clock of the camera to ensure more accurate infrared pen position calculation.
[0017] Preferably, the method further includes: the method of preprocessing the image of the infrared pen emitting infrared light collected in real time to obtain the position of the bright spot representing the infrared pen in the image includes: The collected image of infrared light emitted by the infrared pen is grayed and smoothed; the processed image is threshold segmented to return the ambient light brightness value in the image to zero; the morphological operation of dilation and corrosion is used to remove spots in the image; the bright spot representing the infrared pen in the image is obtained through the contour search function of OpenCV, and the UV value of the central pixel of the contour is taken as the position of the bright spot representing the infrared pen in the image.
[0018] By adopting the above solution and using the contour search function of OpenCV, the bright spots of the infrared pen in the image can be accurately obtained, thereby improving the accuracy of subsequent distance calculation.
[0019] In a second aspect, the present application provides a computer touch control system based on dual-camera infrared pen position recognition, comprising: The image acquisition module includes: two camera devices; used to send a synchronization signal to the two camera devices, and when the two camera devices receive the synchronization signal, use the two camera devices to respectively acquire real-time images of infrared light emitted by the infrared pen, and the infrared pen is connected to the computer through an interface; An image processing module is used to pre-process the image of the infrared pen emitting infrared light collected in real time, and obtain the position of the bright spot representing the infrared pen in the image; The distance calculation module is used to calculate the actual distance between the infrared pen and the camera device using a binocular distance measurement algorithm based on a three-dimensional coordinate system constructed with the middle position point of the two camera devices as the origin, combined with the position of the bright spot representing the infrared pen in the image obtained in real time, and obtain the infrared pen position information in real time; The control module is used to identify the movement trajectory of the infrared pen according to the infrared pen position information obtained in real time; query whether there is a movement trajectory consistent with the current movement trajectory of the infrared pen in the movement trajectory database, if a consistent movement trajectory is found, match the corresponding mouse operation according to the queried movement trajectory, and control the computer content according to the matched mouse operation; wherein, different preset movement trajectories are stored in the movement trajectory database, each preset movement trajectory corresponds to a mouse operation, and the mouse operations include: dragging and scrolling.
[0020] By adopting the above solution, the positioning accuracy and stability of the infrared pen are improved, the position information of the infrared pen is used to simulate the mouse operation to achieve more accurate computer touch control, and the user operation is simplified.
[0021] In a third aspect, the present application provides a computer-readable storage medium, wherein the computer-readable storage medium includes a stored computer program, wherein when the computer program is executed, the device where the computer-readable storage medium is located is controlled to execute the method as described above.
[0022] In a fourth aspect, the present application provides a computer device, comprising a memory, a processor, and a program stored and executable on the memory, wherein the program implements the steps of the above method when executed by the processor.
[0023] In summary, this application has the following beneficial effects: 1. The infrared pen position is captured by dual cameras at the same time, and the distance between the infrared pen and the camera is calculated by combining the binocular ranging algorithm, which improves the positioning accuracy and stability of the infrared pen position information; the infrared pen position information is used to determine the running trajectory and running status of the infrared pen, and the corresponding specific mouse operation is matched to simulate the mouse operation, thereby achieving more accurate computer touch control and simplifying user operation; 2. Considering that there may be errors in the calculation of the position information of a single infrared pen, the Kalman filter algorithm is used to combine the acceleration value of the accelerometer and the position calculated in the previous step to obtain more accurate position information.
[0024] 3. By multiplying the position information of the infrared pen by the custom coefficient, the position information of the simulated mouse cursor on the computer screen coordinates can be obtained. The position coordinate changes of the cursor on the computer screen can be checked to verify whether the control of the corresponding simulated mouse operation is correct. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] Figure 1 It is a flow chart of a computer touch control method based on dual-camera infrared pen position recognition described in a specific embodiment; Figure 2 It is a diagram of the connection of the infrared pen in the computer touch control method based on the position recognition of the infrared pen by dual cameras described in the specific embodiment; Figure 3 It is a diagram of the infrared pen buttons in the computer touch control method based on dual-camera infrared pen position recognition described in a specific embodiment; Figure 4 It is a structural schematic diagram of a computer touch control system based on dual-camera infrared pen position recognition described in a specific embodiment. DETAILED DESCRIPTION
[0026] 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 application and are not used to limit the present application.
[0027] like Figure 1 As shown, the embodiment of the present application discloses a computer touch control method based on dual-camera infrared pen position recognition, and the specific steps are as follows: S1. Use two camera devices to respectively collect real-time images of infrared light emitted by the infrared pen.
[0028] Specifically, two camera devices (cameras) located in the same plane are used to respectively collect real-time images of infrared light emitted by the infrared pen; Figure 2 As shown in the figure, the front end of the infrared pen emits infrared light and is connected to the computer through an interface (such as a USB interface). There are two buttons on the front end of the infrared pen, which generate infrared light signals of different frequencies when squeezed and touched, such as Figure 3 shown.
[0029] In order to achieve accurate positioning of the infrared pen's position information, it is necessary to ensure that the two camera devices complete the synchronous acquisition of the real-time image of the infrared light signal emitted by the front end of the infrared pen. Therefore, wireless communication technology, such as Wi-Fi, Bluetooth or radio frequency signals, can be used to send a synchronization signal to the two camera devices. By controlling the signal sending time, it is ensured that the two camera devices receive the synchronization signal at the same time. When the two camera devices receive the synchronization signal, the two camera devices are used to respectively acquire the real-time image of the infrared light emitted by the infrared pen.
[0030] S2. Preprocess the image of the infrared pen emitting infrared light collected in real time to obtain the position of the bright spot representing the infrared pen in the image.
[0031] Specifically, the opencv library can be used to process the collected image to obtain the position of the bright spot representing the infrared pen in the image, including: grayscale processing of the collected image of the infrared pen emitting infrared light, and the brightness value of each pixel of the image obtained after processing; then smoothing and filtering the image to make the bright spot representing the infrared pen smoother in the image; then threshold segmentation is performed on the processed image to return the ambient light brightness value in the image to zero, thereby highlighting the bright spot representing the infrared pen in the image; morphological operation expansion and corrosion operations are used to remove spots in the image, and finally the bright spot representing the infrared pen is obtained in the image through the contour search function of opencv, and the uv value of the central pixel of the contour is taken as the position of the bright spot representing the infrared pen in the image.
[0032] Or after preprocessing the collected image of the infrared pen emitting infrared light, a trained deep learning neural network model is used to obtain the position of the bright spot representing the infrared pen in the image; including: performing image enhancement on the collected image of the infrared pen emitting infrared light, inputting the image after image enhancement processing into the trained deep learning neural network model, and obtaining the position of the bright spot representing the infrared pen in the image. The trained deep learning neural network is trained and generated by historical images annotated with the bright spots and positions representing the infrared pen.
[0033] S3. Use binocular distance measurement algorithm to calculate the actual distance between the infrared pen and the camera device, and obtain the infrared pen position information in real time.
[0034] Specifically, according to the three-dimensional coordinate system constructed with the middle position point of the two camera devices as the origin, combined with the real-time acquired position P1 of the bright spot representing the infrared pen in the corresponding image collected by one camera device and the position P2 of the bright spot representing the infrared pen in the corresponding image collected by another camera device, a binocular ranging algorithm is used to calculate in real time the actual distance between the infrared pen and the camera devices, that is, the distance between the infrared pen and the planes corresponding to the two camera devices.
[0035] Based on the constructed three-dimensional coordinate system and the actual distance obtained by calculation, the position information of the infrared pen at the current moment, that is, the coordinate information of the infrared pen in the constructed three-dimensional coordinate system, is determined and obtained in real time.
[0036] S4. According to the real-time acquired infrared pen position information, the mouse operation is simulated to realize the control of the computer content.
[0037] Specifically, considering that mouse operations mainly include: clicking, double-clicking, dragging, and scrolling, etc. The simulation of dragging and scrolling in mouse operations includes: According to the infrared pen position information obtained in real time, the moving track of the infrared pen is identified; The movement trajectory database is queried to determine whether there is a movement trajectory that is consistent with the movement trajectory of the current infrared pen. The movement trajectory database stores different preset movement trajectories, such as a linear movement trajectory in a specific direction, a circular curve movement trajectory, and the like.
[0038] If a consistent movement trajectory is found, then the touch operation represented by the found movement trajectory is used to simulate the mouse operations and control the computer content. Each preset movement trajectory matches a mouse operation, such as a linear movement trajectory in a specific direction matches scrolling, and a circular curve movement trajectory matches scrolling.
[0039] Click simulation for dragging and scrolling in mouse operations, including: Counting the position of the bright spot representing the infrared pen in the image in real time, obtaining the number of times the position of the bright spot representing the infrared pen in the image is obtained within a certain period of time, and determining whether the counted number of times falls within a preset number range; According to the preset number range of the determined statistical number of times, various mouse click operations are matched accordingly; wherein each preset number range represents that the infrared light emitted by the infrared pen flashes at a preset frequency, matching a mouse click operation mode, and the infrared light emitted by the infrared pen flashes at a preset frequency and is generated according to the corresponding squeezing trigger of the left and right buttons set by the infrared pen; the mouse click operation includes: single click of the left mouse button, right click of the mouse button, double click of the left mouse button, and double click of the right mouse button, which correspond to the first preset number range, the second preset number range, the third preset number range, and the fourth preset number range, respectively; Control the computer according to a matching mouse click operation method.
[0040] S5. According to the real-time position information of the infrared pen, the coordinate information of the corresponding simulated mouse cursor on the computer screen is obtained to verify whether the simulated mouse operation is correct.
[0041] Specifically, mapping the position information of the infrared pen to the computer screen to obtain the position of the corresponding simulated mouse cursor on the computer screen includes: taking the coordinates of two dimensions in the three-dimensional coordinate information of the infrared pen position and multiplying them by a custom coefficient to obtain the cursor position on the computer screen; that is, the position information of the infrared pen is displayed in real time on the computer screen in the form of a cursor, and the movement of the cursor on the computer screen can be observed to verify whether it meets the movement of the computer controlled by the matching mouse operation. Among them, the custom coefficient is set in proportion to the size of the three-dimensional coordinates of the actual infrared pen position and the size of the computer screen display, so that the three-dimensional coordinates of the actual infrared pen position can be completely mapped to the computer screen display.
[0042] For example, if the corresponding mouse operation based on the position information of the infrared pen is sliding, then the movement of the cursor position obtained by calculation is compared to see whether it satisfies the sliding. If not, the verification of the simulated mouse operation fails. Considering that the position of the bright spot representing the infrared pen in the image is inaccurate, you can choose to switch back to S2 and use optimized training of the deep learning neural network to re-acquire the position of the bright spot representing the infrared pen in the image.
[0043] In a specific embodiment, considering that a single positioning calculation method may have certain errors, in order to ensure accurate positioning of the infrared pen, the method further includes: The infrared pen is also equipped with an accelerometer, and the position of the infrared pen is preliminarily estimated according to the acceleration value of the accelerometer and used as a priori estimation; The infrared pen position information obtained by binocular ranging algorithm at the previous moment is used as a posteriori estimate; According to the prior estimation and the a posteriori estimation, the Kalman filter estimation algorithm is used to calculate the position information of the infrared pen at the current moment to update the infrared pen position information obtained in real time.
[0044] In a specific embodiment, considering that the ambient light intensity is too strong or the distance between the infrared pen and the camera is too great, it will affect the acquisition of the position of the bright spot representing the infrared pen in the image. In order to reduce this influence, the method further includes: A sensor may be installed on the camera device to collect the ambient light intensity in real time; Determine whether the collected light intensity is higher than the preset light intensity or use the binocular ranging algorithm to calculate whether the actual distance between the infrared pen and the camera device exceeds the preset distance range. If so, generate an adjustment instruction to enhance the infrared light signal intensity and send it to the infrared pen to enhance the infrared light signal intensity of the infrared pen.
[0045] Or when the collected light intensity is higher than the preset light intensity, the collected ambient light intensity is subtracted from each pixel in the real-time collected image of the infrared pen emitting infrared light to reduce the influence of the ambient light intensity.
[0046] In a specific embodiment, in order to ensure the accurate positioning of the infrared pen, the accuracy of the real-time image acquisition by the two cameras must be ensured, and the method further includes: Adding a timestamp or specific synchronization marker to the video stream of each camera device; Before preprocessing the image of the infrared pen emitting infrared light collected in real time, compare the time stamp or specific synchronization mark and determine whether the images collected by the two camera devices are at the same time point; If they are not at the same time point, it means that the real-time images collected by the two cameras are not synchronized, and the pre-processing operation will not continue. The Network Time Protocol (NTP) or other time synchronization protocols will be used to calibrate the internal clocks of the two cameras, and the pre-processing operation will continue after receiving the synchronized real-time image; if they are at the same time point, the subsequent image processing operation will continue.
[0047] like Figure 4 As shown, the embodiment of the present application discloses a computer touch control system based on dual-camera infrared pen position recognition, including: The image acquisition module 101 includes: two camera devices; used for sending synchronization signals to the two camera devices, and when the two camera devices receive the synchronization signals, using the two camera devices to respectively acquire real-time images of infrared light emitted by the infrared pen.
[0048] The image processing module is used to pre-process the image of the infrared pen emitting infrared light collected in real time, and obtain the position of the bright spot representing the infrared pen in the image.
[0049] The distance calculation module 103 is used to calculate the actual distance between the infrared pen and the camera device using a binocular distance measurement algorithm based on a three-dimensional coordinate system constructed with the middle position point of the two camera devices as the origin, combined with the position of the bright spot representing the infrared pen in the image obtained in real time, and obtain the infrared pen position information in real time; The infrared pen is also equipped with an accelerometer, and the position of the infrared pen is preliminarily estimated according to the acceleration value of the accelerometer and used as a priori estimation; the infrared pen position information calculated and obtained according to the binocular ranging algorithm at the previous moment is used as a posteriori estimation; based on the prior estimation and the posteriori estimation, the Kalman filter estimation algorithm is used to calculate the position information of the infrared pen at the current moment to update the infrared pen position information obtained in real time.
[0050] The control module 104 is used to identify the moving trajectory of the infrared pen according to the infrared pen position information obtained in real time; query whether there is a moving trajectory consistent with the current moving trajectory of the infrared pen in the moving trajectory database, and if a consistent moving trajectory is found, match the corresponding mouse operation according to the queried moving trajectory, and control the computer content according to the matched mouse operation; wherein, different preset moving trajectories are stored in the moving trajectory database, and each preset moving trajectory corresponds to a mouse operation, and the mouse operations include: dragging and scrolling.
[0051] It is also used to count the positions of the bright spots representing the infrared pen in the image in real time, obtain the number of times the positions of the bright spots representing the infrared pen in the image are obtained within a certain period of time, and determine the preset number range in which the statistical number of times lies; according to the preset number range in which the determined statistical number of times lies, various mouse click operations are matched accordingly; wherein, each preset number range represents that the infrared light emitted by the infrared pen flashes at a preset frequency, and corresponds to a mouse click operation mode, and the infrared light emitted by the infrared pen flashes at a preset frequency and is generated according to the corresponding squeezing trigger of the left and right buttons set by the infrared pen; the mouse click operation includes: single-clicking the left mouse button, right-clicking the right mouse button, double-clicking the left mouse button, and double-clicking the right mouse button; and the computer is controlled according to a matched mouse click operation mode.
[0052] The system also includes: an image acquisition adjustment module 105, which is used to acquire the ambient light intensity in real time; determine whether the acquired light intensity is higher than the preset light intensity or use a binocular ranging algorithm to calculate whether the actual distance between the infrared pen and the camera device exceeds the preset distance range. If so, an adjustment instruction for enhancing the infrared light signal intensity is generated and sent to the infrared pen, so that the infrared light signal intensity of the infrared pen is enhanced and adjusted.
[0053] The embodiment of the present application also discloses a computer-readable storage medium.
[0054] Specifically, the computer-readable storage medium stores a computer program that can be loaded by a processor and executes the computer touch method based on dual-camera infrared pen position recognition as mentioned above. The computer-readable storage medium includes, for example: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and other media that can store program codes.
[0055] The embodiment of the present application also discloses a computer device.
[0056] Specifically, the computer device includes a memory and a processor, and the memory stores a computer program that can be loaded by the processor and execute the above-mentioned computer touch method based on dual-camera infrared pen position recognition.
[0057] The above are all preferred embodiments of the present application, and are not intended to limit the protection scope of the present application. Any feature disclosed in this specification (including the abstract and drawings), unless otherwise stated, can be replaced by other equivalent or alternative features with similar purposes. That is, unless otherwise stated, each feature is only an example of a series of equivalent or similar features.
Claims
1. A computer touch control method based on dual-camera infrared pen position recognition, It is characterized in that include: Sending a synchronization signal to two camera devices, when the two camera devices receive the synchronization signal, using the two camera devices to respectively collect real-time images of infrared light emitted by the infrared pen, the infrared pen being connected to the computer through an interface; Preprocess the image of the infrared pen emitting infrared light collected in real time to obtain the position of the bright spot representing the infrared pen in the image; According to the three-dimensional coordinate system constructed with the middle position point of the two camera devices as the origin, combined with the position of the bright spot representing the infrared pen in the image obtained in real time, the binocular ranging algorithm is used to calculate the actual distance between the infrared pen and the camera device, and the position information of the infrared pen is obtained in real time; According to the infrared pen position information obtained in real time, the moving track of the infrared pen is identified; A query is made from the movement trajectory database to determine whether there is a movement trajectory that is consistent with the movement trajectory of the current infrared pen. If a consistent movement trajectory is found, a corresponding mouse operation is matched according to the queried movement trajectory, and the computer content is controlled according to the matched mouse operation. Different preset movement trajectories are stored in the movement trajectory database, and each preset movement trajectory corresponds to a mouse operation, and the mouse operations include: dragging and scrolling.
2. The computer touch control method based on dual-camera infrared pen position recognition according to claim 1, It is characterized in that Also includes: Counting the position of the bright spot representing the infrared pen in the image in real time, obtaining the number of times the position of the bright spot representing the infrared pen in the image is obtained within a certain period of time, and determining whether the counted number of times falls within a preset number range; According to the preset number range of the determined statistical number of times, various mouse click operations are matched accordingly; wherein each preset number range represents that the infrared light emitted by the infrared pen flashes at a preset frequency, and corresponds to a mouse click operation mode, and the infrared light emitted by the infrared pen flashes at a preset frequency and is generated according to the corresponding squeezing trigger of the left and right buttons set by the infrared pen; the mouse click operations include: single click of the left mouse button, right click of the mouse button, double click of the left mouse button, and double click of the right mouse button; Control the computer according to a matching mouse click operation method.
3. The computer touch control method based on dual-camera infrared pen position recognition according to claim 1, It is characterized in that Also includes: The infrared pen is also equipped with an accelerometer, and the position of the infrared pen is preliminarily estimated according to the acceleration value of the accelerometer and used as a priori estimation; The infrared pen position information obtained by binocular ranging algorithm at the previous moment is used as a posteriori estimate; According to the prior estimation and the a posteriori estimation, the Kalman filter estimation algorithm is used to calculate the position information of the infrared pen at the current moment to update the infrared pen position information obtained in real time.
4. The computer touch control method based on dual-camera infrared pen position recognition according to claim 1, It is characterized in that Also includes: Real-time collection of ambient light intensity; Determine whether the collected light intensity is higher than the preset light intensity or use the binocular ranging algorithm to calculate whether the actual distance between the infrared pen and the camera device exceeds the preset distance range. If so, generate an adjustment instruction to enhance the infrared light signal intensity and send it to the infrared pen to enhance the infrared light signal intensity of the infrared pen.
5. The computer touch control method based on dual-camera infrared pen position recognition according to claim 1, It is characterized in that Also includes: According to the real-time position information of the infrared pen, the coordinates of two dimensions in the three-dimensional coordinates are multiplied by a custom coefficient to obtain the coordinates of the cursor on the computer screen; the custom coefficient is set according to the three-dimensional coordinate value of the infrared pen position and the size of the computer screen display.
6. The computer touch control method based on dual-camera infrared pen position recognition according to claim 1, It is characterized in that Also includes: A timestamp or a specific synchronization mark is added to the video stream of each camera device. Before preprocessing the image of the infrared light emitted by the infrared pen collected in real time, the timestamps or the specific synchronization mark are compared and it is determined whether the images collected by the two cameras are at the same time point. If they are not at the same time point, subsequent processing operations are stopped, and the internal clocks of the two cameras are calibrated using the network time protocol or other time synchronization protocols.
7. The computer touch control method based on dual-camera infrared pen position recognition according to claim 1, It is characterized in that The method of preprocessing the image of infrared light emitted by the infrared pen collected in real time to obtain the position of the bright spot representing the infrared pen in the image includes: The collected image of infrared light emitted by the infrared pen is grayed and smoothed; the processed image is threshold segmented to return the ambient light brightness value in the image to zero; the morphological operation of dilation and corrosion is used to remove spots in the image; the bright spot representing the infrared pen in the image is obtained through the contour search function of OpenCV, and the UV value of the central pixel of the contour is taken as the position of the bright spot representing the infrared pen in the image.
8. A computer touch control system based on dual-camera infrared pen position recognition, It is characterized in that include: The image acquisition module includes: two camera devices; used to send a synchronization signal to the two camera devices, and when the two camera devices receive the synchronization signal, use the two camera devices to respectively acquire real-time images of infrared light emitted by the infrared pen, and the infrared pen is connected to the computer through an interface; An image processing module is used to pre-process the image of the infrared pen emitting infrared light collected in real time, and obtain the position of the bright spot representing the infrared pen in the image; The distance calculation module is used to calculate the actual distance between the infrared pen and the camera device using a binocular distance measurement algorithm based on a three-dimensional coordinate system constructed with the middle position point of the two camera devices as the origin, combined with the position of the bright spot representing the infrared pen in the image obtained in real time, and obtain the infrared pen position information in real time; The control module is used to identify the movement trajectory of the infrared pen according to the infrared pen position information obtained in real time; query whether there is a movement trajectory consistent with the current movement trajectory of the infrared pen in the movement trajectory database, if a consistent movement trajectory is found, match the corresponding mouse operation according to the queried movement trajectory, and control the computer content according to the matched mouse operation; wherein, different preset movement trajectories are stored in the movement trajectory database, each preset movement trajectory corresponds to a mouse operation, and the mouse operations include: dragging and scrolling.
9. A computer-readable storage medium, It is characterized in that The computer-readable storage medium includes a stored computer program, wherein when the computer program is executed, the device where the computer-readable storage medium is located is controlled to execute the method according to any one of claims 1 to 7.
10. A computer device, It is characterized in that The computer device comprises a memory, a processor and a program stored and executable on the memory, and the program implements the steps of the method according to any one of claims 1 to 7 when executed by the processor.
Citation Information
Patent Citations
Remote control interactive pen and receiver thereof
CN101833385A
A device and method for realizing virtual painting
CN102298786A
Three-dimensional ultrasonic positioning-based low-power consumption air mouse pen realization method
CN106933385A
Flexible touch detection method and system for notebook computer
CN117785589A
