Sighting device, method, electronic device and storage medium based on a two-dimensional code image
By using a targeting device and method based on QR code images, the problems of long acquisition and targeting time and electromagnetic interference in wireless optical communication are solved, realizing a fast and sensitive targeting process and improving the establishment speed and quality of communication links.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- PURPLE MOUNTAIN LAB
- Filing Date
- 2022-12-12
- Publication Date
- 2026-05-12
AI Technical Summary
In existing wireless optical communication technologies, acquisition and aiming are time-consuming and susceptible to electromagnetic interference, resulting in slow communication link establishment speed and unstable quality.
A targeting device and method based on QR code images are adopted. The receiver generates a QR code image and identifies the coordinates at the transmitter. The aiming is then controlled by controlling the deflection angle of the galvanometer, avoiding traditional communication modules and electromagnetic interference, thus achieving rapid aiming.
It enables a fast and sensitive aiming process, avoids electromagnetic interference, and improves the speed and quality of communication link establishment.
Smart Images

Figure CN116233629B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of wireless optical communication technology, and in particular to a targeting device, method, electronic device, and storage medium based on QR code images. Background Technology
[0002] Wireless optical communication is a communication technology that uses light to wirelessly transmit data in free space. Besides offering a rich spectrum and providing ultra-high capacity services, wireless optical communication technology also possesses unique advantages such as resistance to electromagnetic interference and mutual interference, and secure communication, making it widely applicable in various fields. Fast and accurate acquisition and aiming technology is crucial for the successful implementation of wireless optical communication, determining the speed of communication link establishment and communication quality.
[0003] Currently, target acquisition and aiming are typically achieved using a receiver CCD array or mechanical spiral / matrix scanning combined with traditional communication feedback. However, this method suffers from limitations in large field-of-view areas due to its large scanning range, slow speed, and lengthy acquisition and aiming time. Furthermore, feedback requires additional communication equipment and is susceptible to atmospheric electromagnetic interference, which can affect the timeliness and accuracy of the feedback information. Summary of the Invention
[0004] This invention provides a targeting device, method, electronic device, and storage medium based on QR code images to solve the problem of long capture and aiming time in the prior art and achieve rapid aiming.
[0005] The present invention provides an aiming device based on a QR code image, comprising: a receiving end and a transmitting end;
[0006] The receiving end is used to generate a QR code image based on the incident light beam; the incident light beam is received through an optical communication receiving component.
[0007] The sending end is used for:
[0008] Based on the QR code image, a first coordinate is determined; the first coordinate is the world coordinate of the target point to be aimed at relative to the center of the galvanometer.
[0009] Based on the first coordinate, the deflection angle of the galvanometer is controlled for aiming.
[0010] In some embodiments, the receiving end includes: a detection module, a first main control module, and an LCD screen;
[0011] The detection module is used to detect the spot image determined based on the incident beam;
[0012] The first main control module is used to generate a QR code image based on the light spot image;
[0013] The LCD screen is used to display the QR code image.
[0014] In some embodiments, the QR code image contains the following information:
[0015] The sequence number, the second coordinate, and the ID of the receiving end; the second coordinate is the image pixel coordinate of the center of the light spot.
[0016] In some embodiments, the detection module includes: a beam-splitting prism cube, a light screen, and a monocular camera;
[0017] The beam-splitting prism cube is used to determine the reflected and refracted beams formed by the incident beam;
[0018] The light screen is used to display the light spot image formed by the reflected light beam;
[0019] The monocular camera is used to acquire the light spot image.
[0020] In some embodiments, the transmitting end includes: a binocular camera, a second main control module, and a galvanometer control module;
[0021] The binocular camera is used to identify the QR code image based on the collected image data;
[0022] The second main control module is used to determine the first coordinates based on the QR code image;
[0023] The galvanometer control module is used to control the deflection angle of the galvanometer for aiming based on the first coordinate.
[0024] In some embodiments, the second main control module is specifically used for:
[0025] Based on the QR code image, the second coordinate and the third coordinate are determined; the third coordinate is the image pixel coordinate of the center of the QR code;
[0026] Based on the third coordinate and the calibration parameters of the binocular camera, a fourth coordinate is determined; the fourth coordinate is the camera coordinate system coordinate of the center of the QR code.
[0027] A world coordinate system is constructed with the center of the galvanometer as the origin, and the first coordinate is determined based on the fourth coordinate and the second coordinate.
[0028] In some embodiments, the formula for calculating the first coordinate is as follows:
[0029]
[0030] Among them, (x o ,y o ,z o (x) is the first coordinate, (x)q ,y q ,z q (x) is the fourth coordinate; c ,y c ,z c (x) represents the world coordinates of the left eye camera relative to the galvanometer; p ,y p ,z p (x) represents the spatial coordinates of the target point relative to the center of the QR code; s ,y s (x′, y′) represents the second coordinate; (x′, y′) represents the image pixel coordinates at the center of the screen; d p This refers to the pixel pitch.
[0031] In some embodiments, the receiving end updates the QR code image at a preset frequency;
[0032] The sending end updates the first coordinates based on the updated QR code image;
[0033] And based on the updated first coordinates, the deflection angle of the galvanometer is controlled for aiming.
[0034] The present invention also provides an aiming method based on a QR code image, comprising:
[0035] A QR code image is generated based on the incident light beam; the incident light beam is received by an optical communication receiving component.
[0036] Based on the QR code image, a first coordinate is determined; the first coordinate is the world coordinate of the target point to be aimed at relative to the center of the galvanometer.
[0037] Based on the first coordinate, the deflection angle of the galvanometer is controlled for aiming.
[0038] In some embodiments, after aiming by controlling the deflection angle of the galvanometer based on the first coordinates, the method further includes:
[0039] The QR code image is updated at a preset frequency;
[0040] Update the first coordinates based on the updated QR code image;
[0041] Based on the updated first coordinates, the deflection angle of the galvanometer is controlled for aiming.
[0042] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the aiming method based on the QR code image as described above.
[0043] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the aiming method based on a QR code image as described above.
[0044] The present invention also provides a computer program product, including a computer program that, when executed by a processor, implements the aiming method based on a QR code image as described above.
[0045] The aiming device, method, electronic device, and storage medium based on QR code images provided by this invention achieve laser aiming by communicating information between the sending and receiving ends in the form of QR code images without relying on traditional communication modules. This avoids the problem of electromagnetic interference and has a fast response speed and high sensitivity. Attached Figure Description
[0046] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0047] Figure 1 This is a schematic diagram of the aiming device based on a QR code image provided in an embodiment of the present invention;
[0048] Figure 2 This is a schematic diagram of the receiving end provided in an embodiment of the present invention;
[0049] Figure 3 This is a schematic diagram of the detection module provided in an embodiment of the present invention;
[0050] Figure 4 This is a schematic diagram of the data format contained in the QR code image provided in the embodiments of the present invention;
[0051] Figure 5 This is a flowchart illustrating the aiming method based on QR code images provided in an embodiment of the present invention;
[0052] Figure 6 This is a schematic diagram of the structure of the electronic device provided in an embodiment of the present invention.
[0053] Figure label:
[0054] 1: Transmitter; 11: Binocular camera; 12: Second main control module; 13: Galvanometer control module;
[0055] 2: Receiver; 21: Detection module; 211: Beam splitter cube; 212: Light screen; 213: Monocular camera; 22: First main control module; 23: LCD screen;
[0056] 31: Target aiming point OP; 32: Beam splitting surface of the beam splitter cube; 33: Incident beam; 34: Refracted beam; 35: Reflected beam; 36: Rear face of the beam splitter cube; 41: QR code displayed on the LCD screen and its center point; 42: Optical support. Detailed Implementation
[0057] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.
[0058] Figure 1 This is one of the structural schematic diagrams of the aiming device based on a QR code image provided in the embodiments of the present invention, see reference. Figure 1 This invention provides an aiming device based on a QR code image, which may include: a receiver 2 and a transmitter 1;
[0059] The receiver 2 is used to generate a QR code image based on the incident light beam; the incident light beam is received through an optical communication receiving component.
[0060] The transmitting end 1 is used for:
[0061] Based on the QR code image, a first coordinate is determined; the first coordinate is the world coordinate of the target point to be aimed at relative to the center of the galvanometer.
[0062] Based on the first coordinate, the deflection angle of the galvanometer is controlled for aiming.
[0063] Transmitter 1 and receiver 2 are installed at the two ends that need to perform wireless optical communication. Transmitter 1 is connected to an external laser, while receiver 2 is connected to an external optical communication receiving component for signal light access.
[0064] Based on the incident beam corresponding to the incoming signal light, the incident beam, after passing through the beam splitter cube, can be reflected to form a reflected beam, or refracted to form a refracted beam. The refracted beam is used to transmit information, while the reflected beam is used to detect beam deviation.
[0065] After the reflected beam exits, it forms a light spot on the screen. Based on the characteristics of the beam splitter, the position of the light spot on the screen is symmetrical to the actual exit position of the refracted beam with respect to the beam splitter's beam-splitting surface.
[0066] If the target point OP is set as the midpoint of the rear face of the beam-splitting prism cube, then the spatial relationship between the light spot and the center point of the screen is consistent with the spatial relationship between the exit position of the refracted beam and the target point OP. Therefore, the offset of the beam relative to the target point OP can be further determined.
[0067] Receiver 2 determines the image pixel coordinates of the center of the light spot based on the light spot formed on the screen by the reflected beam, and dynamically generates a QR code image.
[0068] After receiving the QR code image, sender 1 parses it to obtain the pixel coordinates of the center of the light spot. Then, through spatial position estimation and coordinate transformation, the position coordinates of the target point OP can be obtained.
[0069] The transmitter 1 determines the X-axis and Y-axis deflection angles of the galvanometer based on the position coordinates of the target point OP, and converts them into control commands to drive the galvanometer to deflect and aim at the target point OP to emit a laser.
[0070] The aiming device based on QR code images provided in this invention achieves laser aiming by communicating information between the sending and receiving ends in the form of QR code images without relying on traditional communication modules. This avoids electromagnetic interference and features fast response and high sensitivity.
[0071] In some embodiments, the receiving end 2 includes: a detection module 21, a first main control module 22, and an LCD screen 23;
[0072] The detection module 21 is used to detect the spot image determined based on the incident beam;
[0073] The first main control module 22 is used to generate a QR code image based on the light spot image;
[0074] The LCD screen 23 is used to display the QR code image.
[0075] Optionally, the receiver 2 consists of a detection module 21, a first main control module 22, and an LCD screen 23.
[0076] The detection module 21 is used to detect the spot image determined by the incident beam.
[0077] The first main control module 22 is used to generate a QR code image based on the light spot image.
[0078] LCD screen 23 is used to display the QR code image.
[0079] Furthermore, the detection module 21 includes: a beam-splitting prism cube 211, a light screen 212, and a monocular camera 213;
[0080] The beam-splitting prism cube 211 is used to determine the reflected beam and the refracted beam formed by the incident beam;
[0081] The light screen 212 is used to display the light spot image formed by the reflected light beam;
[0082] The monocular camera 213 is used to acquire the light spot image.
[0083] Optionally, Figure 2 This is a schematic diagram of the receiving end provided in an embodiment of the present invention. Figure 3 This is a schematic diagram of the detection module provided in an embodiment of the present invention.
[0084] like Figure 2 and Figure 3 As shown, the detection module 21 includes a beam-splitting prism cube 211, a light screen 212, and a monocular camera 213.
[0085] The beam splitter cube 211 is used to split the incident beam 33 into two: one beam is transmitted through transmission to transmit information, and the other beam is reflected onto the screen 212 for beam offset detection.
[0086] The monocular camera 213 is used to acquire images of light spots formed on a screen.
[0087] Based on the characteristics of the beam splitter, the position of the light spot on the screen 212 acquired by the monocular camera 213 is symmetrical with respect to the beam splitter surface 32 to the actual exit position of the refracted beam 34 on the rear surface 36 of the beam splitter. That is, the spatial relationship between the light spot and the center point of the screen is consistent with the spatial relationship between the exit position of the refracted beam 35 and the target point OP. Based on this, the offset of the beam relative to the target point OP can be further determined.
[0088] The target point OP to be aimed is set as the midpoint of the rear face 36 of the beam splitter cube, and the optical communication receiving component can be externally connected here to realize signal light access.
[0089] The first main control module 22 is used to detect light spots in the image acquired by the monocular camera 213 and determine their center position coordinates, and dynamically generate a QR code image.
[0090] Furthermore, the QR code image contains the following information:
[0091] The sequence number, the second coordinate, and the ID of the receiving end; the second coordinate is the image pixel coordinate of the center of the light spot.
[0092] Figure 4 This is a schematic diagram of the data format contained in the QR code image provided in this embodiment of the invention. The generated QR code image contains decimal numerical information, and the information format is as follows: Figure 4 As shown.
[0093] C2 is a 4-bit serial number, C1 is the pixel coordinates of the light spot in the image on the light screen 212, where the first four bits are the X-axis coordinates and the last four bits are the Y-axis coordinates, and C0 is a 15-bit receiver ID, which can meet the MAC address representation requirements.
[0094] In the initial state and when no light spot is detected, the light spot coordinates C1 are set to (0, 0). The device ID is a 15-bit decimal number, derived from the hexadecimal MAC address converted to decimal. If the conversion result is less than 15 bits, the high-order bits are padded with 0s. Therefore, in the initial state, the QR code generated by the receiving device with MAC address AB:12:34:56:78:90 contains the information 000000000000188094675843216.
[0095] The aiming device based on QR code images provided in this embodiment of the invention not only uses the QR code image generated by the receiving end as a positioning marker, but also has the function of information communication. It can provide real-time feedback of the aiming offset information of the signal beam for the sending end to make fine adjustments, assisting the sending end to aim at the target point of the receiving end quickly and accurately, with fast response speed and high sensitivity.
[0096] In some embodiments, the transmitting end 1 includes: a binocular camera 11, a second main control module 12, and a galvanometer control module 13;
[0097] The binocular camera 11 is used to identify the QR code image based on the collected image data;
[0098] The second main control module 12 is used to determine the first coordinates based on the QR code image;
[0099] The galvanometer control module 13 is used to control the deflection angle of the galvanometer for aiming based on the first coordinate.
[0100] The transmitter 1 consists of a binocular camera 11, a second main control module 12, and a galvanometer control module 13.
[0101] The binocular camera 11 is responsible for acquiring image data for detecting and recognizing QR codes. Based on the application's coverage area requirements, a suitable camera is selected, and the left and right cameras are positioned on the same plane as much as possible. The binocular camera is calibrated and adjusted beforehand using Zhang's calibration method to obtain calibration parameters including the left eye intrinsic parameter matrix, left eye distortion coefficient vector, right eye intrinsic parameter matrix, right eye distortion coefficient vector, rotation matrix, and translation vector.
[0102] The second main control module 12 is used to detect and locate the QR code in the acquired image data using a preset intelligent model, and to identify and decode the data information contained therein. Simultaneously, it obtains the coordinates of the target point to be aimed at by the receiver through methods such as spatial position estimation and coordinate transformation.
[0103] The preset intelligent model is the QR code detection intelligent model with the highest prediction accuracy obtained by training a convolutional neural network and a QR code dataset, and through 300 iterations and parameter adjustments.
[0104] The galvanometer control module 13 is responsible for determining the X-axis and Y-axis deflection angles of the galvanometer based on the first coordinates, and converting them into control commands to drive the galvanometer to deflect and aim at the target point to emit laser.
[0105] The aiming device based on QR code images provided in this embodiment of the invention enables the transmitting end to quickly detect QR code images in the field of view through a binocular camera, and determine the first coordinates based on the QR code images, thereby achieving rapid aiming.
[0106] In some embodiments, the second main control module 12 is specifically used for:
[0107] Based on the QR code image, the second coordinate and the third coordinate are determined; the third coordinate is the image pixel coordinate of the center of the QR code;
[0108] Based on the third coordinate and the calibration parameters of the binocular camera, a fourth coordinate is determined; the fourth coordinate is the camera coordinate system coordinate of the center of the QR code.
[0109] A world coordinate system is constructed with the center of the galvanometer as the origin, and the first coordinate is determined based on the fourth coordinate and the second coordinate.
[0110] Optionally, the second main control module 12 decodes the QR code image to obtain the second coordinates contained in the QR code image, namely the image pixel coordinates of the center of the light spot, and the image pixel coordinates P1 and P2 of the center of the QR code, namely the third coordinates.
[0111] Based on the third coordinate, and using the calibration parameters of the binocular camera, the fourth coordinate, namely the camera coordinate P of the QR code center, is obtained. q (x q ,y q ,z q This refers to the spatial position of the center of the QR code relative to the left-eye camera.
[0112] The calibration parameters can be obtained through Zhang's calibration method, including parameters such as the left eye intrinsic parameter matrix, the left eye distortion coefficient vector, the right eye intrinsic parameter matrix, the right eye distortion coefficient vector, the rotation matrix, and the translation vector.
[0113] A world coordinate system is further constructed with the center point of the galvanometer as the origin, and the first coordinate is determined based on the spatial positional relationship between the binocular camera 11 and the galvanometer, the spatial positional relationship between the target point OP and the center of the QR code, and the second coordinate.
[0114] The formula for calculating the first coordinate is as follows:
[0115]
[0116] Among them, (x o ,y o ,z o (x) is the first coordinate, (x) q ,y q ,z q (x) is the fourth coordinate; c ,y c ,z c (x) represents the world coordinates of the left eye camera relative to the galvanometer; p ,y p ,z p (x) represents the spatial coordinates of the target point relative to the center of the QR code; s ,y s (x′, y′) represents the second coordinate; (x′, y′) represents the image pixel coordinates at the center of the screen; d p This refers to the pixel pitch.
[0117] The aiming device based on QR code images provided in this invention achieves rapid acquisition and coarse aiming at the receiving end by detecting images using a binocular camera and an intelligent model, greatly improving the positioning rate of the receiving end. Simultaneously, the dynamically generated and changing QR code not only serves as a positioning marker but also functions as an information communication tool, assisting the sending end in quickly and accurately aiming at the target point, avoiding electromagnetic interference, and exhibiting fast response and high sensitivity.
[0118] In some embodiments, the receiving end updates the QR code image at a preset frequency;
[0119] The sending end updates the first coordinates based on the updated QR code image;
[0120] And based on the updated first coordinates, the deflection angle of the galvanometer is controlled for aiming.
[0121] After the transmitting end 1 aims at the light screen 212 by controlling the deflection angle of the galvanometer according to the first coordinate, the receiving end 2 continues to acquire image data of the light screen 212 within the field of view through the monocular camera 213 and detects the illuminated spot. The pixel coordinates of the center of the spot in the image are extracted to generate a QR code image containing the spot coordinates and the receiving end ID, and the LED screen 23 is driven to dynamically update and display the QR code image.
[0122] Transmitter 1 also detects the QR code image again and decodes it to obtain the offset of the light spot center at receiver 2. Based on this, it adjusts the deflection angle of the galvanometer. In this way, the transmitter repeatedly detects, identifies, and aims, and the multiple rapid adjustments make the light spot continuously approach the center of the screen, and the corresponding refracted beam also continuously approaches the target point OP.
[0123] The aiming process is considered complete when the distance from the light spot to the center of the screen is less than a preset distance (such as a few pixels), and subsequent optical communication can then begin.
[0124] The preset distance value can be adjusted according to the aiming accuracy requirements. A smaller preset distance results in a smaller offset from the center and higher aiming accuracy.
[0125] The aiming device based on QR code images provided in this invention, without relying on traditional communication modules, dynamically generates changing QR code images that not only serve as positioning markers but also function as information communication tools. It can provide real-time feedback of the aiming offset information of the signal beam for the transmitting end to make fine adjustments, assisting the transmitting end in quickly and accurately aiming at the target point. It realizes the aiming-feedback-adjustment process of the transmitting end in a purely image-based manner, avoiding electromagnetic interference and exhibiting fast response speed and high sensitivity.
[0126] Figure 5 This is a flowchart illustrating the aiming method based on QR code images provided in an embodiment of the present invention. (Refer to...) Figure 5 The aiming method based on QR code images provided in this embodiment of the invention may include:
[0127] Step 501: Generate a QR code image based on the incident light beam; the incident light beam is received through an optical communication receiving component;
[0128] Step 502: Based on the QR code image, determine the first coordinates; the first coordinates are the world coordinates of the target point to be aimed at relative to the center of the galvanometer.
[0129] Step 503: Based on the first coordinate, control the deflection angle of the galvanometer for aiming.
[0130] In step 501, a QR code image is generated based on the incident light beam.
[0131] The signal light is received by the optical communication receiving component, and the incident beam corresponding to the signal light is determined.
[0132] After the incident light beam passes through the beam-splitting prism cube, it can be reflected to form a reflected beam, or refracted to form a refracted beam. The refracted beam is used to transmit information, while the reflected beam is used to detect beam deviation.
[0133] After the reflected beam exits, it forms a light spot on the screen. Based on the characteristics of the beam splitter, the position of the light spot on the screen is symmetrical to the actual exit position of the refracted beam with respect to the beam-splitting surface of the beam splitter.
[0134] If the target point OP is set as the midpoint of the rear face of the beam-splitting prism cube, then the spatial relationship between the light spot and the center point of the screen is consistent with the spatial relationship between the exit position of the refracted beam and the target point OP. Therefore, the offset of the beam relative to the target point OP can be further determined.
[0135] Based on the light spot formed by the reflected beam on the screen, the image pixel coordinates of the center of the light spot are determined, and a QR code image is dynamically generated. The QR code image may contain the following information: serial number, second coordinates, and the ID of the receiving end, where the second coordinates are the image pixel coordinates of the center of the light spot.
[0136] In step 502, the first coordinates are determined based on the QR code image.
[0137] By parsing the QR code image, the pixel coordinates of the center of the light spot can be obtained. Then, through spatial position estimation and coordinate transformation, the position coordinates of the target point OP, i.e., the first coordinates, can be obtained.
[0138] For example, a QR code image contains decimal numerical information, and the information format is as follows: Figure 4 As shown. Initially, the light spot coordinates are set to (0, 0). The device ID is a 15-digit decimal number, derived from the hexadecimal MAC address converted to decimal. If the converted result is less than 15 digits, the higher bits are padded with 0s. Therefore, initially, the QR code generated by the receiving device with MAC address AB:12:34:56:78:90 contains the information 0000000000000188094675843216.
[0139] The image data within the field of view is obtained by monitoring the area using a binocular camera. A smart model is then used to detect QR codes in the image, and the image pixel coordinates P1(x1, y1) and P2(x2, y2) of the center of the detected QR code are extracted, which are the third coordinates.
[0140] Further identification and decoding of the detected QR code image, extracting information such as the sequence number, second coordinate, and receiver ID, reveals that a receiver with ID 188094675843216 has been captured. However, no beam spot has been detected yet, requiring further aiming to achieve optical communication.
[0141] Based on the center image coordinates P1 and P2 of the QR code, and using the calibration parameters of the binocular camera, the fourth coordinate, namely the camera coordinate P of the QR code center, is obtained. q (xq ,y q ,z q This refers to the spatial position of the center of the QR code relative to the left-eye camera.
[0142] A world coordinate system is further constructed with the center point of the galvanometer as the origin, and the first coordinate is obtained based on the spatial relationship between the camera and the galvanometer, the spatial relationship between the target point OP and the center of the QR code, and the second coordinate.
[0143] The formula for calculating the first coordinate is as follows:
[0144]
[0145] Among them, (x o ,y o ,z o (x) is the first coordinate, (x) q ,y q ,z q (x) is the fourth coordinate; c ,y c ,z c (x) represents the world coordinates of the left eye camera relative to the galvanometer; p ,y p ,z p (x) represents the spatial coordinates of the target point relative to the center of the QR code; s ,y s (x′, y′) represents the second coordinate; (x′, y′) represents the image pixel coordinates at the center of the screen; d p This refers to the pixel pitch.
[0146] Where (x′, y′) is usually the image center; for a 640*480 resolution image, its center is (320, 240). p d represents the pixel pitch, indicating the correspondence between pixel distance and physical distance. If a 640*480 image can cover a 4.8cm wide screen, then d... p =48 / 480 = 0.1mm.
[0147] If the decoded spot coordinates are (0, 0), it indicates that no beam is currently illuminating the beam splitter cube, and no spot has been detected. Ignoring the spot coordinates, the formula for calculating the first coordinate is as follows:
[0148]
[0149] Among them, (x o ,y o ,z o (x) is the first coordinate, (x) q ,y q ,zq (x) is the fourth coordinate; c ,y c ,z c (x) represents the world coordinates of the left eye camera relative to the galvanometer; p ,y p ,z p ) represents the spatial coordinates of the target point relative to the center of the QR code.
[0150] In step 503, the deflection angle of the galvanometer is controlled for aiming based on the first coordinate.
[0151] Based on the first coordinate, the deflection angle of the galvanometer in the X and Y directions is determined, and the motor is driven to adjust the X-axis and Y-axis reflectors to aim at the target point and emit laser.
[0152] The aiming method based on QR code images provided in this invention achieves laser aiming by communicating information through QR code images without relying on traditional communication modules, thus avoiding electromagnetic interference problems and offering fast response speed and high sensitivity.
[0153] In some embodiments, after aiming by controlling the deflection angle of the galvanometer based on the first coordinates, the method further includes:
[0154] The QR code image is updated at a preset frequency;
[0155] Update the first coordinates based on the updated QR code image;
[0156] Based on the updated first coordinates, the deflection angle of the galvanometer is controlled for aiming.
[0157] After aiming by controlling the deflection angle of the galvanometer based on the first coordinate, the monocular camera can continue to acquire image data of the light screen within the field of view and detect the illuminated spot. The pixel coordinates of the center of the spot in the image are extracted to generate a QR code containing the spot coordinates and the receiver ID, which drives the LED screen to dynamically update its display.
[0158] The system then detects the QR code image again and decodes it to obtain the offset of the light spot center. Based on this, it adjusts the deflection angle of the galvanometer. This cyclical process of detection, recognition, and aiming, with multiple rapid adjustments, causes the light spot to continuously approach the center of the screen, and the corresponding refracted beam also continuously approaches the target point OP.
[0159] The aiming process is considered complete when the distance from the light spot to the center of the screen is less than a preset distance (e.g., a few pixels), and subsequent optical communication can then begin. The preset distance can be adjusted according to the aiming accuracy requirements; a smaller preset distance results in a smaller offset from the center and higher aiming accuracy.
[0160] The aiming method based on QR code images provided in this invention uses QR codes as positioning poles. By dynamically generating and changing QR codes, it not only serves as a positioning marker but also incorporates information communication functions. It can provide real-time feedback of signal beam aiming offset information for refined adjustments, thereby assisting in rapid and accurate aiming at the target point. Without relying on traditional communication modules, it achieves the aiming-feedback-adjustment process at the transmitting end purely through image processing, avoiding electromagnetic interference and exhibiting fast response and high sensitivity. This invention can be used for rapidly establishing stable optical communication paths in space.
[0161] Figure 6 An example is a schematic diagram of the physical structure of an electronic device, such as... Figure 6 As shown, the electronic device may include a processor 610, a communications interface 620, a memory 630, and a communication bus 640, wherein the processor 610, communications interface 620, and memory 630 communicate with each other via the communication bus 640. The processor 610 can call logical instructions in the memory 630 to execute a method based on a QR code image. This method includes: generating a QR code image based on an incident light beam; the incident light beam being received by an optical communication receiving component; determining first coordinates based on the QR code image; the first coordinates being the world coordinates of the target point relative to the center of a galvanometer; and controlling the deflection angle of the galvanometer for aiming based on the first coordinates.
[0162] Furthermore, the logical instructions in the aforementioned memory 630 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, essentially, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0163] On the other hand, the present invention also provides a computer program product, the computer program product including a computer program that can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer is able to execute the method based on a QR code image provided by the above methods. The method includes: generating a QR code image based on an incident light beam; the incident light beam being received by an optical communication receiving component; determining a first coordinate based on the QR code image; the first coordinate being the world coordinate of the target point to be aimed relative to the center of the galvanometer; and controlling the deflection angle of the galvanometer for aiming based on the first coordinate.
[0164] In another aspect, the present invention also provides a non-transitory computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements a method based on a QR code image provided by the methods described above. The method includes: generating a QR code image based on an incident light beam; the incident light beam being received by an optical communication receiving component; determining a first coordinate based on the QR code image; the first coordinate being the world coordinate of the target point to be aimed relative to the center of a galvanometer; and controlling the deflection angle of the galvanometer for aiming based on the first coordinate.
[0165] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.
[0166] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.
[0167] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions 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 invention.
Claims
1. An aiming device based on a QR code image, characterized in that, Includes: receiver and transmitter; The receiving end is used to generate a QR code image based on the incident light beam; the incident light beam is received through an optical communication receiving component. The sending end is used for: Based on the QR code image, a first coordinate is determined; the first coordinate is the world coordinate of the target point to be aimed at relative to the center of the galvanometer. Based on the first coordinate, the deflection angle of the galvanometer is controlled for aiming; The transmitting end includes: a binocular camera, a second main control module, and a galvanometer control module; The second main control module is specifically used for: Based on the QR code image, a second coordinate and a third coordinate are determined; the third coordinate is the image pixel coordinate of the center of the QR code; the second coordinate is the image pixel coordinate of the center of the light spot in the light spot image determined based on the incident light beam. Based on the third coordinate and the calibration parameters of the binocular camera, a fourth coordinate is determined; the fourth coordinate is the camera coordinate system coordinate of the center of the QR code. A world coordinate system is constructed with the center of the galvanometer as the origin, and the first coordinate is determined based on the fourth coordinate and the second coordinate.
2. The aiming device based on a QR code image according to claim 1, characterized in that, The receiving end includes: a detection module, a first main control module, and an LCD screen; The detection module is used to detect the spot image determined based on the incident beam; The first main control module is used to generate a QR code image based on the light spot image; The LCD screen is used to display the QR code image.
3. The aiming device based on a QR code image according to claim 2, characterized in that, The QR code image contains the following information: The sequence number, the second coordinate, and the ID of the receiving end; the second coordinate is the image pixel coordinate of the center of the light spot.
4. The aiming device based on a QR code image according to claim 3, characterized in that, The detection module includes: a beam-splitting prism cube, a light screen, and a monocular camera; The beam-splitting prism cube is used to determine the reflected and refracted beams formed by the incident beam; The light screen is used to display the light spot image formed by the reflected light beam; The monocular camera is used to acquire the light spot image.
5. The aiming device based on a QR code image according to claim 4, characterized in that, The transmitting end includes: a binocular camera, a second main control module, and a galvanometer control module; The binocular camera is used to identify the QR code image based on the collected image data; The second main control module is used to determine the first coordinates based on the QR code image; The galvanometer control module is used to control the deflection angle of the galvanometer for aiming based on the first coordinate.
6. The aiming device based on a QR code image according to claim 5, characterized in that, The formula for calculating the first coordinate is as follows: Among them, (x o ,y o ,z o (x) is the first coordinate, (x) q ,y q ,z q (x) is the fourth coordinate; c ,y c ,z c (x) represents the world coordinates of the left eye camera relative to the galvanometer; p ,y p ,z p (x) represents the spatial coordinates of the target point relative to the center of the QR code; s ,y s (x′, y′) represents the second coordinate; (x′, y′) represents the image pixel coordinates at the center of the screen; d p This refers to the pixel pitch.
7. The aiming device based on a QR code image according to any one of claims 1 to 6, characterized in that, The receiving end updates the QR code image at a preset frequency; The sending end updates the first coordinates based on the updated QR code image; And based on the updated first coordinates, the deflection angle of the galvanometer is controlled for aiming.
8. An aiming method based on a QR code image, characterized in that, include: A QR code image is generated based on the incident light beam; the incident light beam is received by an optical communication receiving component. Based on the QR code image, determine the first coordinates; The first coordinate is the world coordinate of the target point to be aimed at relative to the center of the galvanometer; Based on the first coordinate, the deflection angle of the galvanometer is controlled for aiming; Determining the first coordinates based on the QR code image includes: Based on the QR code image, a second coordinate and a third coordinate are determined; the third coordinate is the image pixel coordinate of the center of the QR code. The second coordinate is the image pixel coordinate of the center of the light spot in the light spot image determined based on the incident beam; Based on the third coordinate and the calibration parameters of the binocular camera that identifies the QR code image, a fourth coordinate is determined; the fourth coordinate is the camera coordinate system coordinate of the center of the QR code. A world coordinate system is constructed with the center of the galvanometer as the origin, and the first coordinate is determined based on the fourth coordinate and the second coordinate.
9. The aiming method based on a QR code image according to claim 8, characterized in that, After aiming by controlling the deflection angle of the galvanometer based on the first coordinate, the method further includes: The QR code image is updated at a preset frequency; Update the first coordinates based on the updated QR code image; Based on the updated first coordinates, the deflection angle of the galvanometer is controlled for aiming.
10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the aiming method based on the QR code image as described in claim 8 or 9.
11. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the aiming method based on the QR code image as described in claim 8 or 9.