Leveling rod barcode edge image processing method

Through the improved polynomial interpolation method and camera variable speed mobile detection method, the problem of poor adaptability of barcode edge image processing of level scale barcode is solved, and efficient and high-precision level scale accuracy detection is achieved.

CN119618265APending Publication Date: 2025-03-14LANGFANG BRANCH OF HEBEI PROVINCIAL INST OF METROLOGY SUPERVISION & TESTING
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411764223.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-04
Publication Date
2025-03-14

AI Technical Summary

Technical Problem

The existing barcode edge image processing methods for leveling barcodes have poor adaptability, resulting in low accuracy detection efficiency and low accuracy.

Method used

The improved polynomial interpolation method is used to extract the image of the level barcode edge, and the camera's variable speed mobile detection method is used to automatically adjust the motion parameters through the servo motor and laser interferometer to achieve high-precision barcode edge recognition and verification.

Benefits of technology

It improves the recognition efficiency and accuracy of barcode edges of level barcodes, saves detection time, and enhances the reliability of metrology and verification.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119618265A_ABST
    Figure CN119618265A_ABST
Patent Text Reader

Abstract

The invention discloses a leveling rod barcode edge image processing method. The leveling rod barcode edge image processing method comprises the following steps: S1, a control system controls a camera to move in parallel along one side of a to-be-measured leveling rod relative to the to-be-measured leveling rod through preset barcode widths, shoots a picture of the to-be-measured leveling rod and measures the actual displacement of the camera; meanwhile, the control system collects photos and actual displacement data of the camera; and S2, the control system performs edge image processing on the picture to realize identification and recording of each bar code edge of the leveling rod bar code, and meanwhile, the recorded data is compared with the actual displacement data of the corresponding camera to realize verification. According to the invention, the identification efficiency of the bar code ruler edge of the leveling rod can be improved, and the verification precision of the bar code ruler edge is greatly improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical field of level ruler accuracy detection, and in particular to a level ruler bar code edge image processing method. Background Art

[0002] As a precision measuring scale, the level is widely used in earthquake measurement, bridge construction, large machinery installation and other measurement work. It is also widely used in engineering practice such as settlement observation of house and pile foundation experiments and deflection observation of building component experiments. The accuracy of the level division will affect the accuracy and reliability of the measurement results, and it must be regularly inspected by the metrology verification department.

[0003] At present, the mainstream calibration method for the accuracy of level rulers in my country's metrology and verification departments is still the manual comparison method, which requires manual visual measurement using an optical reading microscope. This detection method is cumbersome, has low detection efficiency, and causes large errors in manual operation. The current main trend is the development from manual to intelligent, but the existing level ruler barcode edges mostly use laser etching technology, and the integrity of the image edge is poor, which leads to the poor adaptability of the existing image edge processing method to the level ruler barcode edge, which is not conducive to improving the metrology and verification accuracy. Summary of the invention

[0004] The technical problem to be solved by the present invention is to provide a level ruler barcode edge image processing method, which can not only improve the recognition efficiency of the level ruler barcode edge, but also greatly improve its calibration accuracy.

[0005] In order to solve the above technical problems, the technical solutions adopted by the present invention are as follows.

[0006] The method for processing the edge image of a level ruler barcode comprises the following steps:

[0007] S1. The control system controls the camera to move parallel to the level ruler to be measured along one side of the level ruler to be measured by preset barcode widths and takes photos of the level ruler to be measured and measures the actual displacement of the camera; at the same time, the control system collects photos and actual camera displacement data;

[0008] S2. The control system performs edge image processing on the photo to realize the recognition and recording of the edges of each barcode of the level scale barcode, and at the same time compares the recorded data with the actual displacement data of the corresponding camera to realize calibration.

[0009] Preferably, the control system includes a servo motor motion control module for realizing camera movement control, an image acquisition module for realizing camera control and storing photos taken by the camera, a laser interferometer data reading module for obtaining actual displacement data of the camera, an image processing module for performing edge image processing on photos, and a comparison display module respectively connected to the laser interferometer data reading module and the image processing module to realize comparison and verification.

[0010] Preferably, the servo motor motion control module is connected to a servo motor, the output end of the servo motor is connected to a ball screw arranged parallel to the level ruler to be measured, a slide is arranged on the ball screw, the slide is slidably connected to a limit rod arranged parallel to the ball screw, and the camera is arranged on the slide and is at the same height as the central axis of the level ruler to be measured; in the step S1, the relationship between the various coordinate systems of the camera is first derived, and a finite camera model is established, and specifically, the Zhang Zhengyou calibration method is used to perform a calibration experiment on the camera to obtain the camera's intrinsic parameters and reprojection errors, and then the control system controls the rotation of the servo motor through the servo motor motion control module to control the camera movement.

[0011] Preferably, the laser interferometer data reading module is connected to a laser interferometer through a serial port for emitting laser to the slide table to measure the actual displacement of the camera, and the laser interferometer is a LaserCell LH3000 laser interferometer.

[0012] Preferably, in step S1, the control of the servo motor in the control system adopts position control, a laser interferometer is used as a feedback signal reference, and a PID control module in LabVIEW is used to perform closed-loop control on the position of the slide.

[0013] Preferably, the image processing module in step S2 performs edge image processing on the photo, specifically comprising the following steps:

[0014] Grayscale the collected photo images;

[0015] Binarize the grayscale photo image;

[0016] Determine the edge pixel points of the binary image: first determine the barcode edge, then use the improved sub-pixel edge detection algorithm based on polynomial interpolation to detect the pixel values ​​of the image barcode stripes and the camera crosshairs;

[0017] Perform line edge positioning calculation: specifically convert the pixel value to obtain the actual distance.

[0018] Preferably, in step S2, the comparison and display module compares the captured barcode edge pixel center position with the camera crosshair center, calculates the pixel difference between the two and displays it, and simultaneously calculates and displays the captured barcode edge straight line inclination angle, and determines whether the camera and level ruler are in the correct installation position by the inclination angle, thereby ensuring the accuracy of the collected data.

[0019] Preferably, in step S2, the comparison display module obtains the actual distance by conversion based on the pixel value and compares it with the actual displacement data to realize calibration.

[0020] Due to the adoption of the above technical scheme, the technical progress achieved by the present invention is as follows.

[0021] The present invention utilizes an improved polynomial interpolation method to extract images of the edge of a level barcode, which not only improves the recognition efficiency of the edge of the barcode ruler, but also greatly improves the accuracy; the camera variable speed mobile detection method is used to perform measurement under the condition that the level barcode ruler is kept stationary, and the motion parameters are automatically adjusted according to the set moving distance and the moving rules of the previous measurements, thereby saving detection time and improving detection efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] Figure 1 It is a schematic diagram of the structure of the barcode level rod calibration device of the present invention;

[0023] Figure 2 It is a principle block diagram of the control system of the present invention;

[0024] Figure 3 It is the structural block diagram of the PID algorithm of the present invention;

[0025] Figure 4 This is an image processing flow chart of the present invention.

[0026] Among them: 1. servo motor, 2. ball screw, 3. slide, 4. camera, 5. laser interferometer, 6. interferometer, 7. reflector, 8. level ruler to be measured. DETAILED DESCRIPTION

[0027] The present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0028] A method for processing the edge image of a level ruler barcode is implemented based on a barcode level ruler calibration device and combined with Figure 1As shown, the barcode type level ruler calibration device includes a level ruler 8 to be measured, a servo motor 1 and a laser interferometer 5, wherein the output end of the servo motor 1 is connected to a ball screw 2, the ball screw 2 is arranged parallel to the level ruler to be measured, a slide 3 is arranged on the ball screw 2, the slide 3 is slidably connected to a limit rod arranged parallel to the ball screw 2, a camera 4 is arranged on the slide 3, and the camera 4 is at the same height as the central axis of the level ruler 8 to be measured. When in use, the servo motor 1 rotates to control the rotation of the ball screw 2, thereby controlling the camera 4 to move parallel to the level ruler 8 to be measured along one side of the level ruler 8 to be measured, and the camera 4 is used to take a photo of the level ruler 8 to be measured.

[0029] The laser interferometer 5 is a laser interferometer LH3000, which is used to emit laser light to the slide 3. An interferometer 6 is arranged between the laser interferometer 5 and the slide 3. The interferometer 6 is arranged close to the laser interferometer 5. The interferometer 6 is used to interfere with the laser light emitted by the laser interferometer 5. A reflector 7 arranged toward the interferometer 6 is arranged on the slide 3. The reflector 7 is used to reflect the laser beam emitted by the laser interferometer 5, and the reflector 7, the interferometer 6 and the laser beam emitted by the laser interferometer 5 are on the same horizontal line, so that the laser interferometer 5 can measure the actual displacement of the camera.

[0030] The method of the present invention specifically comprises the following steps:

[0031] S1. The control system controls the camera 4 to move parallel to the level ruler 8 to be measured along one side of the level ruler 8 to be measured through the preset barcode widths, takes a photo of the level ruler to be measured, and measures the actual displacement of the camera 4; at the same time, the control system collects photos and actual displacement data of the camera 4.

[0032] like Figure 2 As shown, the control system includes a servo motor motion control module, an image acquisition module, a laser interferometer data reading module, an image processing module and a comparison display module, wherein the servo motor motion control module is connected to the servo motor 1, and the servo motor motion control module realizes the movement control of the camera 4 by controlling the servo motor 1; the image acquisition module is connected to the camera 4, and the image acquisition module is used to realize the control of the camera 4 and store the photos taken by the camera; the laser interferometer data reading module is connected to the laser interferometer 5 through the serial port, and the laser interferometer data reading module is used to obtain the actual displacement data of the camera; the image processing module is connected to the image acquisition module, and the image processing module is used to perform edge image processing on the photos; the comparison display module is connected to the laser interferometer data reading module and the image processing module respectively, and the comparison display module is used to realize comparison verification.

[0033] In this step, the relationship between the coordinate systems of the camera 4 must be derived first, and a finite camera model must be established. Specifically, the Zhang Zhengyou calibration method is used to perform a calibration experiment on the camera to obtain the camera's internal parameters and reprojection errors. Then, the control system controls the rotation of the servo motor 1 through the servo motor motion control module to control the movement of the camera 4. The control of the servo motor 1 in the control system uses position control, uses the laser interferometer 5 as the feedback signal reference, and uses the PID control module in LabVIEW to perform closed-loop control on the position of the slide 3.

[0034] like Figure 3 As shown in the figure, it is the structural block diagram of PID. The PID controller can form a control deviation based on the given input value and the actual output value:

[0035] e(t)=y(t)-r(t)

[0036] Then the deviation is calculated by proportional (P), integral (I), and differential (D), and then the control quantity is formed through linear combination and acts on the controlled object. The formula is as follows:

[0037]

[0038] The form of expressing the transfer function is:

[0039]

[0040] Where K p ——Proportional coefficient

[0041] T i ——Integral time constant

[0042] T d ——Differential time constant

[0043] The proportional link is a proportional reflection of the deviation signal of the control system. When a deviation occurs, the controller produces a control action to reduce the deviation; the integral link is used to eliminate static errors, T i Determines the strength of the integral effect, T i The smaller it is, the stronger the integral effect will be; the differential link reflects the changing trend of the deviation signal. Quoting an effective advance correction signal can speed up the system's action speed and shorten the adjustment time.

[0044] The position of the servo motor 1 is transmitted to the control system via the laser interferometer 5 , and the control system adjusts the output signal of the servo motor 1 so that the position parameter of the servo motor 1 is the same as the set position.

[0045] First, set an initial value in a conditional structure, set it to 0, and pass it through a filter in the PID block diagram. After filtering, the output waveform is transmitted to the conditional structure (the waveform can be refreshed, read, and saved). When the set value is reached, the waveform will no longer fluctuate.

[0046] PID gains is the gain adjustment of PID control, which eliminates the steady-state error of the system. When there is a difference, integral adjustment begins until the error is 0, at which time the integral adjustment stops.

[0047] S2. The control system performs edge image processing on the photo to realize the recognition and recording of the edges of each barcode of the level scale barcode, and at the same time compares the recorded data with the actual displacement data of the corresponding camera to realize calibration.

[0048] like Figure 4 As shown, in step S2, the image processing module performs edge image processing on the photo, which specifically includes the following steps:

[0049] (1) Grayscale the collected photo image: Specifically, use Extract Single Color Plane to extract the grayscale value of the specified plane in the color image. After grayscale processing, the color image will be converted to black and white.

[0050] (2) Binarize the grayscale photo image.

[0051] Binarization is to segment the image from the object by the threshold segmentation method, that is, to select a suitable value between 0-255 as the selected threshold value according to the image, which is 0 for values ​​less than the threshold value and 255 for values ​​greater than the threshold value. When processing, it is necessary to select a suitable threshold value. If the threshold value is too high, many target points will appear, and they will be considered as background points; if the threshold value is too low, the background points will be considered as image points.

[0052] (3) Determine the edge pixels of the binary image.

[0053] In this step, the edge image is first determined by the edge tracking method. However, it is not completely certain that this is the accurate edge determination because there will be gross errors. Further processing is required to improve the accuracy and stability of the barcode edge position. Statistics are performed on the edge data of the barcode. For example, if the pixel value 0 has 20 pixels in a column and 255 has 80 pixels in this column, then this column can be identified as 255, which can represent a single pixel, thereby determining the black and white differentiation and the edge of the barcode.

[0054] Then, the pixel values ​​of the image barcode stripes and the camera crosshairs are detected based on the improved sub-pixel edge detection algorithm of polynomial interpolation. The core of the interpolation method is to interpolate the grayscale value or the derivative of the grayscale value of the pixel point to increase information to achieve sub-pixel edge detection. This step can improve the recognition efficiency and verification accuracy of the leveling ruler barcode edge through the improved sub-pixel edge detection algorithm of polynomial interpolation.

[0055] (4) Perform line edge positioning calculation.

[0056] The pixel value is converted to the actual distance.

[0057] In step S2, the comparison and display module compares the captured barcode edge pixel center position with the camera crosshair center, calculates the pixel difference between the two and displays it, and simultaneously calculates and displays the captured barcode edge straight line inclination angle, and determines whether the camera and level ruler are in the correct installation position by the inclination angle, thereby ensuring the accuracy of the collected data.

[0058] In step S2, the comparison display module obtains the actual distance by conversion according to the pixel value and compares it with the actual displacement data to realize calibration.

[0059] When the present invention is used, the improved sub-pixel edge detection algorithm using the polynomial interpolation method greatly improves the recognition accuracy of the level ruler barcode edge; the camera variable speed mobile detection method is used to perform measurement under the condition of ensuring that the level barcode ruler does not move, and the motion parameters are automatically adjusted according to the set moving distance and the movement rules of the previous measurements, thereby saving detection time and improving detection efficiency.

Claims

1. A method for processing edge images of a level ruler barcode, characterized in that: The following steps are involved: S1. The control system controls the camera (4) to move parallel to the level ruler (8) to be measured and takes a photo of the level ruler to be measured and measures the actual displacement of the camera (4) by controlling the preset width of each bar code. At the same time, the control system collects photos and actual displacement data of the camera (4); S2. The control system performs edge image processing on the photo to realize the recognition and recording of the edges of each barcode of the level scale barcode, and at the same time compares the recorded data with the actual displacement data of the corresponding camera to realize calibration.

2. The method for processing edge images of leveling ruler barcodes according to claim 1, characterized in that: The control system includes a servo motor motion control module for realizing camera movement control, an image acquisition module for realizing camera control and storing photos taken by the camera, a laser interferometer data reading module for obtaining actual camera displacement data, an image processing module for performing edge image processing on photos, and a comparison display module respectively connected to the laser interferometer data reading module and the image processing module to realize comparison and verification.

3. The method for processing the edge image of a level ruler barcode according to claim 2, characterized in that: The servo motor motion control module is connected to a servo motor (1), the output end of the servo motor (1) is connected to a ball screw (2) arranged in parallel with the level ruler (8) to be measured, a slide table (3) is arranged on the ball screw (2), the slide table (3) is slidably connected to a limit rod arranged in parallel with the ball screw (2), and the camera (4) is arranged on the slide table (3) and is at the same height as the central axis of the level ruler (8) to be measured; in the step S1, the relationship between the various coordinate systems of the camera (4) is first derived, and a finite camera model is established, and the Zhang Zhengyou calibration method is specifically used to perform a calibration experiment on the camera to obtain the camera internal parameters and reprojection errors, and then the control system controls the rotation of the servo motor (1) through the servo motor motion control module to control the movement of the camera (4).

4. The method for processing edge images of level ruler barcodes according to claim 3 is characterized in that: The laser interferometer data reading module is connected to a laser interferometer (5) through a serial port for emitting laser light to the slide table (3) to measure the actual displacement of the camera. The laser interferometer (5) is a Laser Measurement LH3000 laser interferometer.

5. The method for processing edge images of level ruler barcodes according to claim 4, characterized in that: In the step S1, the control of the servo motor (1) in the control system adopts position control, a laser interferometer (5) is used as a feedback signal reference, and a PID control module in LabVIEW is used to perform closed-loop control on the position of the slide (3).

6. The method for processing edge images of level ruler barcodes according to claim 2, characterized in that: In step S2, the image processing module performs edge image processing on the photo, which specifically includes the following steps: Grayscale the collected photo images; Binarize the grayscale photo image; Determine the edge pixel points of the binary image: first determine the barcode edge, then use the improved sub-pixel edge detection algorithm based on polynomial interpolation to detect the pixel values ​​of the image barcode stripes and the camera crosshairs; Perform line edge positioning calculation: specifically convert the pixel value to obtain the actual distance.

7. The method for processing edge images of leveling ruler barcodes according to claim 6, characterized in that: In step S2, the comparison display module compares the captured barcode edge pixel center position with the camera crosshair center, calculates the pixel difference between the two and displays it, and simultaneously calculates and displays the captured barcode edge straight line inclination angle, and determines whether the camera and level ruler are in the correct installation position by the inclination angle, thereby ensuring the accuracy of the collected data.

8. The method for processing edge images of level ruler barcodes according to claim 6, characterized in that: In step S2, the comparison display module obtains the actual distance by conversion based on the pixel value and compares it with the actual displacement data to realize verification.