Vision measuring instrument and measurement method for space target position and attitude calculation

Through integrated design and deep learning technology, automatic focus and target recognition of visual measurement equipment are achieved, solving the problem of low automation of existing equipment, improving measurement efficiency and accuracy, and suitable for multi-degree-of-freedom measurement.

CN120252510BActive Publication Date: 2025-09-02CHANGCHUN INST OF OPTICS FINE MECHANICS & PHYSICS CHINESE ACAD OF SCI
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202510689040.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-05-27
Publication Date
2025-09-02
Estimated Expiration
2045-05-27

AI Technical Summary

Technical Problem

Existing visual measurement equipment relies on manual operation and has low degree of automation. It requires special cooperation goals. It cannot process blurred images, has a limited measurement range, and is difficult to achieve 360-degree measurements throughout the week, and is unable to achieve 6-degree measurements. It cannot meet the measurement needs of modern industries with high efficiency, high precision and fully automated measurements.

Method used

The integrated design of the image acquisition unit, attitude sensing unit, motion control unit and information processing unit is adopted, including a focus lens, a camera, a dual-axis attitude sensor, a servo motor and a rotation mechanism, and combines deep learning methods to achieve automatic focus and target recognition, realizing one-click measurement and multi-degree of freedom solution.

Benefits of technology

It improves the automation and efficiency of the measurement system, reduces costs, and realizes high-precision multi-degree-of-freedom measurement, which is highly adaptable and suitable for a variety of measurement scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120252510B_ABST
    Figure CN120252510B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of visual measurement technology, and in particular to a visual measuring instrument and measurement method for solving the position and attitude of a spatial target. The image acquisition unit includes a focusing lens and a camera. The former uses an electric field to control the rapid focusing of a liquid focusing lens, and the latter selects key parameters according to the characteristics of the target to be measured, and stores and transmits them. The attitude perception unit includes a dual-axis attitude sensor and a photoelectric encoder. The former measures the horizontal attitude data of the device in real time and transmits it to the information processing unit, and the latter records the angular changes of the rotating mechanism. The motion control unit includes a servo motor and a rotating mechanism. The servo motor is connected to the rotating shaft of the rotating mechanism and accurately controls the angle or speed of the mechanical movement according to the input signal. The information processing unit is installed at the bottom, connected to each component to control it, receive data for processing, and the power supply unit is connected to supply power to the entire device. The advantages are: high integration, high degree of automation, strong adaptability, and rich measurement objects.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of visual measurement technology, and in particular to a visual measuring instrument and a measuring method for calculating the position and attitude of a space target. Background Art

[0002] Traditional visual measurement equipment primarily includes photoelectric theodolites, total stations, and laser trackers. These devices have played an important role in industrial measurement, but each has its limitations. The photoelectric theodolite is an optical measuring instrument primarily used for angular measurement. It uses a telescope to aim at a target and an encoder to record changes in horizontal and vertical angles to complete the measurement task. However, the photoelectric theodolite has a low degree of automation, requiring an operator to manually adjust the level and align the device with the target before measurement can begin. This manual operation is not only inefficient but also susceptible to human error. Furthermore, the photoelectric theodolite primarily measures angles and cannot directly obtain three-dimensional geometric information about an object. Therefore, it is gradually being replaced by other more advanced measurement technologies in modern industry. The total station is an electro-optical instrument that integrates horizontal and vertical angles and distance measurement and is widely used in construction, surveying, and topographic mapping. Similar to the photoelectric theodolite, the total station also requires manual leveling by the operator and the use of specialized cooperating targets (such as prisms or reflective sheets) to complete the measurement task. Although the total station has more comprehensive functions than the photoelectric theodolite, it still has the following limitations: (1) Dependence on cooperative targets: It cannot automatically measure objects without reflectors; (2) Inability to process blurred images: When the target is not clear, the total station cannot automatically identify and track the target; (3) Low measurement efficiency: Due to the need for manual operation, the measurement speed is slow and it is not suitable for measurement tasks of large-scale or complex scenes. Laser trackers are devices that use laser beams for high-precision measurement and are commonly used for three-dimensional coordinate measurement in aerospace, automobile manufacturing and other fields. It determines the position and posture of the target by emitting lasers and receiving the beam reflected by the target. Laser trackers also have the following problems: (1) Dependence on cooperative targets: Special reflective markers or sensors need to be installed on the object to be measured; (2) Limited measurement range: Due to the physical characteristics of the laser beam, its measurement distance and accuracy are subject to certain restrictions; (3) Susceptibility to environmental interference: Laser trackers are sensitive to environmental conditions (such as temperature, vibration, and air turbulence), which may affect the measurement results.

[0003] In summary, the limitations of existing technologies can be summarized as follows: (1) Reliance on manual visual aiming, with a low degree of automation; (2) The device needs to be placed on a leveling platform or manually leveled; (3) A dedicated cooperative target is required to complete the measurement, and the accessories are expensive and require regular maintenance; (4) The measurement field is small, making it difficult to achieve full 360-degree measurement; (5) The blurred image of the target cannot be automatically focused; (6) The target cannot be automatically identified and calculated; (7) 6-DOF measurement cannot be achieved. The above limitations make it difficult for traditional equipment to meet the modern industry's demand for efficient, high-precision, and fully automated measurement. Therefore, it is particularly important to develop a new visual measurement technology that does not rely on a specific cooperative target, can automatically level, automatically focus, automatically search for targets, autonomously identify targets, and calculate 6-DOF. Summary of the Invention

[0004] In order to solve the above problems, the present invention provides a vision measuring instrument and a measuring method for calculating the position and attitude of a space target.

[0005] The first object of the present invention is to provide a visual measuring instrument for solving the position and posture of a spatial target, comprising an image acquisition unit, a posture perception unit, a motion control unit, an information processing unit and a power supply unit;

[0006] The image acquisition unit includes a focusing lens and a camera; the posture sensing unit includes a dual-axis posture sensor and a photoelectric encoder; the motion control unit includes a servo motor and a rotating mechanism;

[0007] The focusing lens uses an electric field to control the liquid focusing lens to quickly adjust the focal length to ensure clear imaging of the target being measured; the camera selects key parameters based on the characteristics of the target being measured, and stores and transmits them;

[0008] The dual-axis attitude sensor measures the horizontal attitude data of the visual measuring instrument in real time and transmits it to the information processing unit for fusion calculation; the photoelectric encoder records the angular changes of the rotating mechanism and provides feedback for the precise control of the servo motor;

[0009] The servo motor is connected to the rotating shaft of the rotating mechanism, providing rotational power for the rotating mechanism and accurately controlling the angle or speed of mechanical movement according to the input signal;

[0010] The information processing unit is installed in the lower part and is connected to the focusing lens, camera, dual-axis attitude sensor, photoelectric encoder and servo motor respectively. It controls each component and receives uploaded data, and processes and analyzes the collected image data.

[0011] The power supply unit connects the focusing lens, camera, dual-axis attitude sensor, photoelectric encoder, servo motor and information processing unit to provide power for the entire visual measuring instrument.

[0012] Preferably, the focusing lens is an electrically controlled focusing lens, which is connected to the information processing unit via a USB interface and receives focusing control commands;

[0013] The camera is a gigabit network industrial camera, and the image data is uploaded to the information processing unit through a gigabit network interface.

[0014] Preferably, the dual-axis attitude sensor is a sensor with an angle measurement range of 10 degrees and an angle accuracy of 0.05 degrees; the dual-axis attitude sensor adopts the Can bus protocol and uploads the horizontal attitude data to the information processing unit through the Can interface;

[0015] The photoelectric encoder uses an encoder with an accuracy of 20 seconds, is installed on the rotating mechanism and connected to the rotating shaft of the rotating mechanism; the photoelectric encoder uses a serial port protocol to upload the azimuth information to the information processing unit through a 422 interface.

[0016] Preferably, the servo motor is a 35mm brushless servo motor, which adopts the Can bus protocol, receives the rotation control command through the Can interface and feeds back the result to the information processing unit.

[0017] Preferably, the power supply unit is a battery; the battery is installed at the lower part, adjacent to the information processing unit to facilitate wiring and fixation.

[0018] A second object of the present invention is to provide a visual measurement method for calculating the position and attitude of a spatial target, which uses the visual measuring instrument for calculating the position and attitude of a spatial target to perform measurement, and specifically includes the following steps:

[0019] S1. Power-on initialization and device self-test: Connect the battery via the power button; perform a self-test to check the operating status of each component and ensure that all parts are in normal working mode;

[0020] S2. Use the servo motor to control the rotating mechanism to rotate to the zero position of the photoelectric encoder; reset the focus lens to the zero position; and complete the initialization settings of the camera;

[0021] S3. Measure the angle between the visual measuring instrument and the horizontal direction of the earth through the dual-axis attitude sensor, and transmit the results in real time to the information processing unit for fusion calculation to obtain the X-axis angle X0 and the Y-axis angle Y0;

[0022] S4 controls the rotation of the rotating mechanism and performs a scanning search. During the search, the aiming action of the target is completed. After alignment, the photoelectric encoder records and outputs the azimuth angle α;

[0023] S5. The camera collects image data of the target in real time and simultaneously transmits the data to the information processing unit;

[0024] S6. Automatically adjust the focus to a clear state through the focusing lens to ensure the target image has the best focus effect;

[0025] S7. The information processing unit uses image recognition technology to determine the target position coordinates u0 and v0. Combined with the angles X0 and Y0 measured by the dual-axis attitude sensor, the azimuth angle α recorded by the photoelectric encoder, and the lens focal length parameter f, it calculates the six-degree-of-freedom information of the target in the camera coordinate system, thereby achieving accurate solution of the spatial target position and attitude.

[0026] Preferably, the rotation angle of the rotating mechanism in step S4 is 360 degrees;

[0027] The six-degree-of-freedom information in step S7 includes three-dimensional spatial coordinate values ​​X, Y, and Z and three-dimensional attitude angles A, B, and C.

[0028] Preferably, the focusing in step S6 adopts a deep learning method, and different focal plane distance values ​​h are corresponded to target images with different clarity. After training with a large amount of image data, the target image is collected and the focusing distance value is predicted according to the clarity of the image, and the image is focused to the optimal position through the focusing lens.

[0029] Preferably, the target is a concentric circle pattern; the target position coordinates are u0 and v0, and the target position coordinates are obtained by a center of gravity algorithm.

[0030] Compared with the prior art, the present invention can achieve the following beneficial effects:

[0031] (1) High automation and one-click measurement: Integrating artificial intelligence technology increases the intelligence and automation level of industrial measurement systems, realizes one-click measurement, greatly simplifies the measurement process, reduces manual intervention, and improves measurement efficiency.

[0032] (2) Dynamic focus, strong real-time performance: Dynamic focus is achieved using computer vision technology, so that an image can both search for targets and adjust focus, improving the overall real-time performance of the measurement system.

[0033] (3) High degree of integration: The hardware equipment has a high degree of integration, is compact, occupies little space, has low measurement space requirements, and has a wide range of applications.

[0034] (4) Multi-degree-of-freedom measurement: It can realize multi-degree-of-freedom measurement, with a simple measurement principle and high degree of universality. It can be easily expanded to many measurement fields, thus improving the flexibility and adaptability of the measurement system.

[0035] (5) Compared with traditional measuring equipment, it reduces costs while improving measurement efficiency and accuracy, bringing higher economic benefits and competitive advantages.

[0036] In summary, the visual measuring instrument and measuring method of the present invention can realize one-click measurement after placement. Compared with traditional measuring equipment, it has the advantages of high integration, high degree of automation, strong adaptability, rich measurement objects, and low cost. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] Figure 1 The figure is a schematic diagram of the internal structure of a vision measuring instrument for calculating the position and posture of a spatial target provided by an embodiment of the present invention.

[0038] Figure 2 The figure is a schematic diagram of the overall appearance structure of a vision measuring instrument for solving the position and posture of a space target provided by an embodiment of the present invention.

[0039] Figure 3 Schematic diagram of device interface and data flow provided according to an embodiment of the present invention.

[0040] Figure 4 The present invention provides a flow chart of a visual measurement method for calculating the position and posture of a spatial target.

[0041] Figure 5 Schematic diagram of a target provided according to an embodiment of the present invention.

[0042] Figure 6 These are images with different defocus distances and corresponding focus adjustment values ​​provided according to an embodiment of the present invention.

[0043] Reference numerals:

[0044] 1. Focusing lens;

[0045] 2. Camera;

[0046] 3. Dual-axis attitude sensor;

[0047] 4. Photoelectric encoder;

[0048] 5. Servo motor;

[0049] 6.Battery;

[0050] 7. Processing platform;

[0051] 8. Housing;

[0052] 801. Upper shell; 802. Middle shell; 803. Lower shell. DETAILED DESCRIPTION

[0053] Hereinafter, embodiments of the present invention will be described with reference to the accompanying drawings. In the following description, identical modules are denoted by identical reference numerals. In the case of identical reference numerals, their names and functions are also identical. Therefore, their detailed description will not be repeated.

[0054] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention will be further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and do not constitute a limitation of the present invention.

[0055] See also Figure 1 As shown, the present invention provides a visual measuring instrument for calculating the position and attitude of a spatial target. The device has an integrated appearance and is divided into three parts: upper, middle and lower. The upper part can rotate, the lower part is the main measurement component, and the middle part is the connection between the upper and lower parts. The internal components include: an image acquisition unit, a posture perception unit, a motion control unit, an information processing unit, and a power supply unit.

[0056] The image acquisition unit includes a focusing lens 1 and a camera 2. Focusing lens 1 uses an electric field to control a liquid focusing lens, rapidly adjusting the focal length to ensure clear imaging of the target being measured. Camera 2 selects key parameters such as image resolution and frame rate based on the characteristics of the target being measured, and stores and transmits these parameters, providing a visual data foundation for subsequent spatial target position and attitude calculations. Camera 2 is mounted on a rotating mechanism, and its shooting angle changes as the mechanism rotates, enabling it to capture images of the spatial target from different directions.

[0057] Specifically, the focusing lens 1 is an electrically controlled focusing lens, which uses an electric field to control the liquid focusing lens. It can control the lens focus with a millisecond-level response, so that the target under test can be clearly imaged. If the focusing time requirement is not high, the focusing part can also use a traditional motor plus feedback device for focusing. The electronically controlled focusing adopts a serial port protocol. The focusing lens 1 is connected to the processing platform 7 through a USB interface and receives the focus control command, and at the same time uploads the focus response feedback signal to the processing platform 7.

[0058] Camera 2 is the main component of visual measurement, responsible for collecting, storing and transmitting image data of the target to be measured; key parameters such as image resolution and frame rate can be selected according to the size and other characteristics of the target to be measured; the present invention adopts a Gigabit network industrial camera with a resolution of 2000H×2000V and a frequency of 20Hz to achieve high-definition image acquisition and fast transmission; camera 2 adopts the GigE protocol and uploads image data to the processing platform 7 through the Gigabit network interface.

[0059] The posture sensing unit includes a dual-axis posture sensor 3 and a photoelectric encoder 4. The dual-axis posture sensor 3 measures the horizontal posture data of the visual measuring instrument in real time and transmits it to the processing platform 7 for fusion calculation. The photoelectric encoder 4 records the angular changes of the rotating mechanism, achieving accurate measurement of the rotation angle and providing feedback for the precise control of the servo motor 5.

[0060] The dual-axis attitude sensor 3 (also known as a dual-axis gyroscope) is a device used to measure the motion attitude of an object, primarily for obtaining attitude information about two axes orthogonal to the horizontal plane of the earth. In a specific embodiment, the dual-axis attitude sensor 3 uses a sensor with an angular measurement range of 10 degrees and an angular accuracy of 0.05 degrees. It can measure the angle between the device and the horizontal direction of the earth in real time, and transmit the results in real time to the processing platform 7 for fusion calculation, providing the device with horizontal attitude data to assist in posture calculation. The dual-axis attitude sensor 3 uses the CAN bus protocol and uploads the horizontal attitude data to the processing platform 7 via the CAN interface.

[0061] The photoelectric encoder 4 is a sensor device for measuring rotation angles, which converts mechanical motion into electrical signals through optical principles. In a specific embodiment, the photoelectric encoder 4 uses an encoder with an accuracy of 20 seconds, is installed on the rotating mechanism and is connected to the rotating shaft of the rotating mechanism. It can accurately record the angular changes of the rotating mechanism, provide accurate data for motion parameters, achieve accurate measurement of the rotation angle of the device, provide feedback for the precise control of the servo motor 5, and ensure the motion accuracy of the visual measuring instrument. The photoelectric encoder 4 uses a serial port protocol to upload the azimuth angle information to the processing platform 7 through the 422 interface.

[0062] The motion control unit includes a servo motor 5 and a rotating mechanism; the servo motor 5 is connected to the rotating shaft of the rotating mechanism, provides rotational power to the rotating mechanism, and accurately controls the angle or speed of mechanical movement according to the input signal;

[0063] The servo motor 5 is a high-performance electric motor whose core function is to accurately control the angle or speed of mechanical movement according to the input signal. In the specific embodiment, a 35mm brushless servo motor is used, and a corresponding reducer is added to control the number of revolutions. This can achieve precise rotation control of the horizontal shaft, drive the rotating mechanism to perform rotational movement, and enable the visual measuring instrument to measure spatial targets from different angles. The servo motor 5 adopts the Can bus protocol, receives rotation control commands through the Can interface, and feeds back the results to the processing platform 7.

[0064] The information processing unit is a processing platform 7;

[0065] The processing platform 7 is the intelligent core of the visual measuring instrument. It uses an artificial intelligence hardware platform and can provide dedicated hardware support for artificial intelligence algorithms and models. The processing platform 7 processes and analyzes the collected image data and extracts useful information by running visual measurement space point position algorithms such as feature extraction, matching, and three-dimensional reconstruction. At the same time, it integrates the image data collected by the camera 2, the data from the dual-axis attitude sensor 3, and the data from the photoelectric encoder 4 to improve the accuracy of the posture solution, achieve accurate solution of the spatial target position and attitude, and control the servo motor 5 and focusing lens 1 to realize the automation and intelligence of the measurement process. The processing platform 7 is installed in the lower part and is connected to the focusing lens 1, camera 2, dual-axis attitude sensor 3, photoelectric encoder 4, and servo motor 5 respectively to control each component and receive uploaded data.

[0066] The advantages of the processing platform 7 are mainly reflected in the following aspects: (1) providing high-performance computing capabilities and realizing target recognition and reasoning functions; (2) realizing multi-sensor data fusion and providing data basis for measurement and calculation; (3) realizing dynamic focusing function of blurred images; (4) realizing computer measurement algorithms on the equipment and completing data solution and output;

[0067] In a specific embodiment, the processing platform 7 uses processing hardware with a GPU, which can achieve a computing power of 10TOPS, meeting the computing power requirements of the above functions; if there are faster and more accurate requirements, a processing platform with higher computing power can be selected according to the needs.

[0068] The power supply unit is a battery 6;

[0069] The battery 6 is installed at the bottom, close to the processing platform 7 for easy wiring and fixation; the battery 6 powers the entire visual measuring instrument and is connected to each component to provide stable power support without the need for an external power supply device, making the visual measuring instrument portable and ensuring that the entire visual measuring instrument can operate normally, supporting portable and field use scenarios; in a specific embodiment, the battery 6 uses a 24V, 6000mA lithium battery, achieving a continuous working time of approximately 5 hours.

[0070] See also Figure 2 , a schematic diagram of the overall exterior structure of the visual measuring instrument for determining the position and attitude of spatial targets according to the present invention. Housing 8, consisting of an upper housing 801, a middle housing 802, and a lower housing 803, protects the internal components from dust while allowing for adequate clearance to ensure smooth rotation of the rotating mechanism. Lower housing 803 securely protects the information processing unit, motion control unit, and power supply unit, forming a sealed yet unimpeded overall structure. This achieves a balance between dust protection and flexible rotation, ensuring stable operation and accurate measurement in complex environments.

[0071] The interfaces and data flows in the vision measuring instrument used for space target position and attitude calculation are shown in Figure 3 shown.

[0072] The present invention also provides a visual measurement method for calculating the position and attitude of a spatial target, which uses the above-mentioned visual measuring instrument for calculating the position and attitude of a spatial target to perform measurement, and specifically includes the following steps:

[0073] S1. Power-on initialization and device self-test: Connect the battery via the power button to provide power to the device; perform a self-test to check the operating status of each component and ensure that all parts are in normal working mode.

[0074] S2. Device initialization: Use the servo motor to control the rotating mechanism to rotate to the 0 position of the photoelectric encoder; reset the focus lens to the 0 position; and complete the initialization settings of the camera.

[0075] S3. Attitude measurement: The dual-axis attitude sensor measures the horizontal angle between the vision measuring instrument and the ground. The results are transmitted to the processing platform in real time for fusion calculation to obtain the X-axis angle X0 and the Y-axis angle Y0.

[0076] S4. Aiming and scanning: The system controls the rotating mechanism to rotate 360 ​​degrees as required to perform scanning and searching. During the search process, the aiming action to the target is completed. After alignment, the photoelectric encoder records and outputs the azimuth angle α.

[0077] S5. Image acquisition: The camera acquires the target’s image data in real time and simultaneously transmits the data to the processing platform.

[0078] S6. Autofocus: Based on a preset algorithm, the focusing lens automatically adjusts the focus to a clear state, ensuring the target image has the best focus effect;

[0079] Focusing uses a deep learning approach, mapping different focal distance values ​​h to target images of varying clarity. After training with a large amount of image data, the focus distance value can be predicted based on the clarity of the target image after acquisition. The image is then focused to the optimal position using a focusing lens. Specifically, the algorithm disclosed in patent application publication number CN119485017A can be used for focusing. The focusing method includes the following steps:

[0080] S61. Fix the target on the object to be measured, align the lens of the industrial measurement system with the object to be measured, adjust the position and distance of the lens relative to the object to be measured, and obtain an image dataset of the object to be measured.

[0081] S62. Input the target images contained in the target image dataset into the target acquisition network in sequence to obtain the target image dataset, where the target image dataset includes target images with prediction boxes that correspond one-to-one to the target images.

[0082] The target image dataset contains target images with varying degrees of blur, and the true defocus distance of each target image is annotated. Annotation is an image preprocessing process. During the acquisition of the target image dataset, the true defocus distance of the clearest image is annotated as 0. The remaining images can be annotated in descending order based on the camera acquisition step size. Slightly clear images are annotated with 0.2 because the golden hook position differs by 0.2 from the sharpest image. Very blurry images are annotated with 5.3 because the golden hook position differs by 5.3 from the sharpest image. The sharpest image can be obtained by maximizing the image gradient or the image clarity evaluation function.

[0083] The target acquisition network is a Yolov8 network. It should be noted that the targets in industrial measurement systems are diverse, making it difficult for the target acquisition network to identify all of them. However, unlike the measured objects, the target has fixed features and shapes, and the dataset is easy to acquire. Therefore, the target is fixed to the measured object so that the target can be used to determine the defocus condition of the measured object.

[0084] The target has various shapes. The target here is a concentric circle pattern with an outer circle diameter of 5.5 cm.

[0085] Before focusing on the current frame of the target image containing the target being detected, the present invention uses a target acquisition network to perform target recognition. Specifically, before system initialization, a target dataset of approximately 40 target images is collected for training to generate a target acquisition network with fixed weights. This target acquisition network is then incorporated into the smart device's algorithm to complete the task of detecting specific targets.

[0086] S63. Calculate the working distance R of the target relative to the camera based on the prediction frame of each target image i ;

[0087] The format of the prediction box is , and are the two diagonal coordinates of the prediction box of the target image of the i-th frame, and the target image resolution is , the target height here is 5.5cm.

[0088] According to the principle of similarity of imaging, is the world coordinate system, is the camera coordinate system, is the image coordinate system. The length and width of the target in the actual scene show a certain simple proportional relationship with the length and width of the projection in the target image. Calculate the working distance R of the target on the current target image relative to the camera i The formula used is:

[0089] ;

[0090] in, is the actual height of the target in the target image of the i-th frame, is the focal length of the target in the target image of the i-th frame, The pixel value occupied by the width of the prediction box in the target image of the i-th frame.

[0091] Use the above steps to obtain the working distance R of the target relative to the camera i , the real distance of the target recognized in each frame can be simply estimated. In addition, by continuously acquiring two frames of target images The value can be used to determine whether the target is moving and the direction of movement, thereby guiding the autofocus process.

[0092] S64. Perform denoising and illumination normalization processing on all target images to obtain a processed target image dataset.

[0093] The Gaussian denoising method is used to perform denoising operations on all target images in turn; the adaptive Gamma transform is used to perform illumination normalization operations on all target images in turn;

[0094] The formula for adaptive Gamma transform is:

[0095] =log 10 0.5 / log 255 ;

[0096] in, is the adaptive Gamma transform result of the target image of the i-th frame, is the grayscale mean of the target image in the i-th frame.

[0097] In real-world situations, the illumination intensity of the input target images varies. The purpose of the gamma transform is to increase the accuracy of the deep regression network and reduce the impact of illumination intensity. Experiments have shown that this approach reduces the error of the deep regression network by 8%. Images with different degrees of blur are different. The human visual system can classify multiple images with varying degrees of blur (clear images, relatively clear images, and blurred images). Computer vision technology simulates human visual perception and then performs quantitative analysis of the blur level of the image, which is the deep regression task.

[0098] S65. Using the deep regression network to predict the predicted defocus distance D of each target image after processing i The deep regression network consists of a feature extraction network and a regression network, with the output of the feature extraction network serving as the input of the regression network. The feature extraction network is a MoblieNet network or a ShuffleNet network, and the regression network includes an MLP network. The feature extraction network is first used to extract image features, and then the regression network is used to complete the nonlinear fitting of the image features. The final regressor of the deep regression network needs to have a practical physical meaning to simplify the focusing process. Therefore, the regressor is defined as the defocus distance from the current image position to the optimal focus position. The defocus distance of the current initial focus position relative to the actual optimal focus position is the optimal defocus distance.

[0099] The predicted defocus distance of each target image after processing is predicted using a deep regression network The expression is: ;

[0100] in, is the predicted defocus distance of the target image of the i-th frame output by the deep regression network, () is the trained deep regression network, is the target image of the i-th frame, are the network parameters of the deep regression network.

[0101] During the training of the deep regression network, the SmoothL1 loss function is used to evaluate the difference between the predicted defocus distance output by the deep regression network and the corresponding actual defocus distance:

[0102] ;

[0103] in, () is the SmoothL1 loss function, is the actual defocus distance annotated for the target image in the i-th frame, The predicted defocus distance annotated for the target image of the i-th frame;

[0104] The minimum loss parameter of the deep regression network is solved by the following formula and adjust the network parameters of the deep regression network through the gradient descent optimizer :

[0105] ;

[0106] Where C is the total number of target images contained in the target image dataset.

[0107] According to the above training steps, a deep regression network with fixed weights can be obtained.

[0108] Step S65 specifically includes the following steps: Since the distance between the target and the camera will change, the size of the target image obtained by the target acquisition network will also change, which may cause the target image to be unsuitable for input into the deep regression network. Therefore, in order to facilitate the input of the target image into the deep regression network, the present invention adopts a region division method:

[0109] S651: Set the size of the image input to the deep regression network to , The design value can be 224, 400, 640, etc. The larger the value, the slower the prediction efficiency of the deep regression network. Therefore, it can be adjusted according to the actual target size designed in the device work. Set to 224.

[0110] S652: If the prediction box of the current target image satisfies or , the resolution of the current target image is scaled to , the best defocus distance of the current target image obtained , execute step S654, otherwise execute step S653.

[0111] Since the target is designed to be circular, the target acquires the network and The difference will not be particularly large, so it will not cause the scale of the target image to be unbalanced. At this time, the defocus distance of the target image is calculated to be , the model can obtain the defocus distance with only one prediction.

[0112] S653: If the prediction box of the current target image satisfies or , then the current target image is divided into The size is The sub-regions are input into the deep regression network in turn, and the optimal defocus distance of the current target image is calculated by the following formula:

[0113] ;

[0114] ;

[0115] Where K is the number of sub-regions, and i is an integer not exceeding K;

[0116] S654: Replace the current target image with the next target image, and repeat steps S652-S653 until the optimal defocus distances of all target images are obtained.

[0117] S66. Re-acquire the target image, and perform static adjustment on the lens according to the predicted defocus distance D1 of the re-acquired first frame target image to obtain a clear first frame target image;

[0118] When focusing begins, the target to be measured does not move. The lens is adjusted according to the optimal defocus distance D1 of the first frame target image so that the lens position , is the initial position of the lens. At this point, static focus is completed and a clear image of the target can be obtained.

[0119] It should be noted that the error of the deep regression network obtained through appropriate training methods will be stable within 5% of the data set acquisition range, which is smaller than the focusing error of the traditional focusing method and has sufficient accuracy.

[0120] During the focusing process of the second and subsequent target images, the target will move. The difficulty of dynamic focusing lies in the difficulty of obtaining the motion state of the target, making it impossible to determine the focus direction.

[0121] The principle of the traditional focusing method, hill climbing search, is to determine the relationship between the image clarity evaluation values ​​of two consecutive frames of the target. When the measured target moves, the image resolution of the measured target is different, so the traditional focusing method is not applicable in this case.

[0122] The efficiency of static focusing achieved by the present invention using a deep regression network is much higher than that of traditional focusing methods. Single focusing takes only 0.2s-0.5s. Therefore, after obtaining the target working distance using the target recognition network, it is sufficient to complete the tasks of dynamic focusing and focal plane tracking.

[0123] S67. Determine whether the target is moving, and determine whether the target is moving according to the target's motion state and the target's working distance R relative to the camera. i Dynamically adjust the lens; the specific methods of dynamic focus are as follows:

[0124] S671: If the second frame target image meets , it is determined that the target has not moved, and the lens is not adjusted, so that the lens position , go to step S674, otherwise go to step S672;

[0125] S672: If the second frame target image meets and , determine the working distance of the target Increase, adjust the lens in the positive direction , so that the lens position , go to step S674, otherwise go to step S673;

[0126] S673: If the second frame target image meets and , determine the working distance of the target To decrease, adjust the lens in the opposite direction , so that the lens position ;

[0127] S674: Replace the second frame of target image with the next frame of target image, and repeat steps S671-S673 until the dynamic adjustment of the lens is completed based on all target images.

[0128] The distance judgment threshold is set to 0.05-0.1m.

[0129] S7. Data processing and solution: The processing platform uses image recognition technology to determine the target position coordinates u0 and v0. Combined with the angles X0 and Y0 measured by the dual-axis attitude sensor, the azimuth angle α recorded by the photoelectric encoder, and the lens focal length parameter f, it calculates the target's three-dimensional spatial coordinate values ​​X, Y, Z and three-dimensional attitude angles A, B, C in the camera coordinate system, totaling six degrees of freedom, thereby achieving accurate solution to the spatial target position and attitude. See the flow chart. Figure 4 .

[0130] Calculation method: Use the visual measurement space point position algorithm, which is determined by the following formula:

[0131] ;

[0132] in, and It is obtained by extracting pixels from the image captured by the camera; K is an internal parameter of visual measurement, and the focal length f can be obtained through calibration measurement. x 、f y and zero position c x 、c y ;

[0133] ;

[0134] R is the visual measurement external parameter rotation matrix, which is determined by the following formula:

[0135] ;

[0136] Where R0 is the installation deviation angle, which is obtained by calibration measurement after installation; R y (α) is the azimuth angle, which is determined by the photoelectric encoder measurement value α; R y (x0) and R z (y0) are the pitch angle and roll angle, respectively, obtained by the dual-axis attitude sensor, and the measured values ​​are x0 and y0;

[0137] ;

[0138] The spatial point position coordinates X, Y, and Z can be obtained from the above formula.

[0139] The target design is clear, simple and has obvious features, which makes it easy to obtain the target position coordinates (target coordinates on the image plane) u0 and v0 through the center of gravity algorithm. Figure 5 The images of different defocus distances and the corresponding focus adjustment values ​​are shown in Figure 6 shown.

[0140] It should be understood that the various forms of the processes shown above can be used to reorder, add, or delete steps. For example, the steps described in the present disclosure can be performed in parallel, sequentially, or in a different order, as long as the desired results of the technical solutions disclosed in the present disclosure can be achieved. This is not limited herein.

[0141] The above specific embodiments do not limit the scope of protection of the present invention. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions may be made based on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention are intended to be included within the scope of protection of the present invention.

Claims

1. A visual measuring instrument for calculating the position and attitude of a spatial target, characterized by: It includes an image acquisition unit, a posture sensing unit, a motion control unit, an information processing unit and a power supply unit; The image acquisition unit includes a focusing lens and a camera; the posture sensing unit includes a dual-axis posture sensor and a photoelectric encoder; the motion control unit includes a servo motor and a rotating mechanism; The focusing lens uses an electric field to control the liquid focusing lens, quickly adjusting the focal length to ensure a clear image of the target being measured. The camera selects key parameters based on the characteristics of the target being measured, and stores and transmits them. Focusing uses a deep learning method to associate different focal plane distance values ​​h with target images of different clarity. After training with a large amount of image data, the focusing distance value is predicted based on the clarity of the target image after the target image is collected, and the image is focused to the optimal position through the focusing lens. The dual-axis attitude sensor measures the horizontal attitude data of the vision measuring instrument in real time and transmits it to the information processing unit for fusion calculation. The photoelectric encoder is installed on the rotating mechanism and connected to the rotating shaft of the rotating mechanism. The photoelectric encoder records the angular changes of the rotating mechanism and provides feedback for the precise control of the servo motor. The servo motor is connected to the rotating shaft of the rotating mechanism, providing rotational power for the rotating mechanism and accurately controlling the angle or speed of mechanical movement according to the input signal; The information processing unit is installed in the lower part and is connected to the focusing lens, camera, dual-axis attitude sensor, photoelectric encoder and servo motor respectively. It controls each component and receives uploaded data, and processes and analyzes the collected image data. The power supply unit connects the focusing lens, camera, dual-axis attitude sensor, photoelectric encoder, servo motor and information processing unit to provide power for the entire visual measuring instrument.

2. A visual measuring instrument for calculating the position and attitude of a spatial target according to claim 1, characterized in that: The focusing lens is an electrically controlled focusing lens, which is connected to the information processing unit via a USB interface and receives focusing control commands; The camera is a gigabit network industrial camera, and the image data is uploaded to the information processing unit through a gigabit network interface.

3. The visual measuring instrument for calculating the position and attitude of a spatial target according to claim 1, characterized in that: The dual-axis attitude sensor is a sensor with an angle measurement range of 10 degrees and an angle accuracy of 0.05 degrees; the dual-axis attitude sensor adopts the Can bus protocol and uploads the horizontal attitude data to the information processing unit through the Can interface; The photoelectric encoder uses an encoder with an accuracy of 20 seconds; The photoelectric encoder adopts a serial port protocol and uploads the azimuth information to the information processing unit via a 422 interface.

4. The visual measuring instrument for calculating the position and attitude of a spatial target according to claim 1, characterized in that: The servo motor is a 35mm brushless servo motor that adopts the CAN bus protocol, receives rotation control commands through a CAN interface and feeds back the results to the information processing unit.

5. The visual measuring instrument for calculating the position and attitude of a spatial target according to claim 1, characterized in that: The power supply unit is a battery; the battery is installed at the lower part, adjacent to the information processing unit for easy wiring and fixation.

6. A method for visual measurement of a spatial target position and attitude, comprising: The specific steps include: S1. Power-on initialization and device self-test: Connect the battery via the power button; perform a self-test to check the operating status of each component and ensure that all parts are in normal working mode; S2. Use the servo motor to control the rotating mechanism to rotate to the zero position of the photoelectric encoder; reset the focus lens to the zero position; and complete the initialization settings of the camera; S3. Measure the angle between the visual measuring instrument and the horizontal direction of the earth through the dual-axis attitude sensor, and transmit the results in real time to the information processing unit for fusion calculation to obtain the X-axis angle X0 and the Y-axis angle Y0; S4 controls the rotation of the rotating mechanism and performs a scanning search. During the search, the aiming action of the target is completed. After alignment, the photoelectric encoder records and outputs the azimuth angle α; S5. The camera collects image data of the target in real time and simultaneously transmits the data to the information processing unit; S6. Automatically adjust the focus to a clear state using the focusing lens to ensure the target image has the best focus effect. Focusing uses a deep learning method to associate different focal plane distance values ​​h with target images of different clarity. After training with a large amount of image data, the focus distance value is predicted based on the image clarity after collecting the target image, and the image is focused to the optimal position using the focusing lens. S7. The information processing unit uses image recognition technology to determine the target position coordinates u0 and v0. Combined with the angles X0 and Y0 measured by the dual-axis attitude sensor, the azimuth angle α recorded by the photoelectric encoder, and the lens focal length parameter f, it calculates the six-degree-of-freedom information of the target in the camera coordinate system, thereby achieving accurate solution of the spatial target position and attitude.

7. The method for visual measurement of spatial target position and attitude according to claim 6, characterized in that: The rotation angle of the rotating mechanism in step S4 is 360 degrees; The six-degree-of-freedom information in step S7 includes three-dimensional spatial coordinate values ​​X, Y, and Z and three-dimensional attitude angles A, B, and C.

8. The method for visual measurement of spatial target position and attitude according to claim 6, characterized in that: The target is a concentric circle pattern; the target position coordinates are u0 and v0, and the target position coordinates are obtained by a center of gravity algorithm.

Citation Information

Patent Citations

  • Dynamic focusing method based on industrial measurement system

    CN119485017A

  • Six-degree-of-freedom spatial coordinate position and attitude measurement device

    CN112556579A

  • Rotary laser detection device with high-precision alignment correction function and correction method

    CN118189920A