Method for measuring height of deep-hole firework lead
By combining motion control and imaging modules, and using YOLOv1-OBB and a servo motor to drive a ball screw, efficient and accurate measurement of the height of deep-hole firework fuses is achieved. This solves the problems of low efficiency of laser reflection and manual detection in existing technologies, achieving sub-pixel measurement accuracy and efficient detection.
Patent Information
- Application Number
- CN202510820780.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-19
- Publication Date
- 2025-09-26
- Estimated Expiration
- 2045-06-19
AI Technical Summary
When detecting the height of the fuse inside a firework paper tube, the existing technologies of laser triangulation and TOF methods are affected by the reflection of the hole wall, resulting in a low signal-to-noise ratio. Manual detection is inefficient and has large errors. The traditional defocusing method has a large amount of calculation and low real-time performance, and cannot meet the needs of efficient full inspection.
Combining the motion control module and the imaging module, YOLOv1-OBB is used for lead positioning, and the ball screw is driven by a servo motor to achieve precise positioning. SIMD instructions are used to accelerate calculations, and image displacement enhancement and differential calculation are combined to eliminate background interference and achieve sub-pixel precision measurement.
The detection accuracy and speed are improved, the interference of laser reflection in deep holes is eliminated, the single-hole detection time is compressed to 0.7s, the detection accuracy is improved to ±0.05mm, the efficiency is increased to 10 pieces/minute, and the impact of image dislocation caused by mechanical vibration is reduced.
Smart Images

Figure CN120702352A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of visual detection technology, and in particular to a method for measuring the height of a deep-hole firework fuse. Background Art
[0002] The standard height for fuse wires in firework paper tubes is (5±3) mm. The industry currently inspects 1.8 billion pieces annually, but manual spot checks result in a missed detection rate exceeding 7%, and contact inspections result in a product scrap rate exceeding 5%. Existing solutions employ laser triangulation, where a laser projects incident light at a 45° angle, and a CMOS sensor captures the displacement of the reflected light spot. However, the angle is too large, and the deep hole wall blocks the laser beam, preventing the sensor from receiving the return laser light. Time-of-flight ranging employs distance calculations based on the time-of-flight of the laser pulse. However, multiple reflections within the hole cause time signal aliasing, resulting in a measurement failure rate exceeding 60%. In summary, when inspecting fuse wire height in firework paper tubes (hole diameter ≤ 5 mm, depth ≥ 30 mm), existing laser triangulation and time-of-flight methods produce multiple reflections on the hole wall, resulting in a signal-to-noise ratio of less than 40% for the sensor's received light spot, making it impossible to obtain valid height data. Manual inspection involves an operator inserting a calibrated probe into the tube for contact measurement. However, the operator experiences inspection speeds of ≤ 3 seconds per piece, and a >10% rate of wire detachment due to probe friction. The current production line relies on manual visual estimation (error ±3mm) or contact probe measurement (damage rate 8%-12%), which cannot achieve 100% full inspection, and the inspection efficiency is less than 10 pieces / minute. Although existing defocusing method research (such as the Tenengrad gradient method) can avoid interference from hole wall reflections, it requires full-frame image clarity calculation. The 1080p image processing takes ≥1.5s, and the mechanical focusing mechanism moves at a speed of ≤5mm / s, which cannot achieve fast positioning of 1mm / step. In short, the traditional defocusing method requires the acquisition of 5-7 focal plane images (taking ≥2s / piece), which has a large amount of calculation and low real-time performance. The clarity evaluation function fluctuates by more than ±15%, which cannot meet the 0.7s inspection cycle required by the production line.
[0003] In view of this, we propose a deep hole fireworks fuse height measurement method to solve the existing problem. Summary of the Invention
[0004] The object of the present invention is to provide a method for measuring the height of a deep-hole firework fuse to solve the problems raised in the above-mentioned background technology.
[0005] To achieve the above objectives, the present invention provides the following technical solutions: a method for measuring the height of deep-hole firework fuses, comprising: combining a motion control module with an imaging module to perform multi-frame image acquisition to obtain N images, using YOLOv11-OBB to locate the fuse, pre-positioning it to the fuse vertex, and then using the vertex area ROI to calculate the clarity in the N images, and using SIMD instructions to accelerate the calculation.
[0006] Furthermore, the motion control module uses a servo motor to drive the ball screw with a lead of 2mm, and cooperates with the encoder closed-loop feedback to achieve a displacement of 1mm step on the Z axis and a repeatability accuracy of ±0.005mm.
[0007] Furthermore, the imaging module is equipped with a 5-megapixel global shutter CMOS camera with a frame rate of 60fps, a fixed focal length lens, a depth of field of 2mm, and a working distance of 300mm.
[0008] Furthermore, during the multi-frame image acquisition process, the servo system steps at 1 mm / step, and collects N images within the 20 mm range of the Z axis. The total stroke is 20 mm, the exposure time of each frame is 20 ms, and the image resolution is 2448 × 2048 pixels.
[0009] Furthermore, in the ROI extraction process based on YOLO-OBB, a lightweight YOLOv11-OBB model is deployed with an input resolution of 640×640 to intercept the target area according to the detection results and eliminate background interference.
[0010] Furthermore, the implementation process of the ROI extraction algorithm based on YOLO-OBB includes image displacement enhancement and difference calculation, local variance clarity evaluation, height mapping and peak location.
[0011] Furthermore, the image displacement enhancement and difference calculation includes: defining a displacement vector, performing an affine transformation on the n-th frame image, and calculating the absolute difference between the image after displacement and the original image.
[0012] Furthermore, the local variance clarity evaluation includes directly calculating the overall variance of the YOLO-OBB demarcated area.
[0013] Furthermore, the height mapping and peak location include: constructing a clarity curve, fitting the curve through cubic spline interpolation, and locating the height corresponding to the maximum variance value.
[0014] Furthermore, N=20.
[0015] Compared with the prior art, the present invention has the following beneficial effects:
[0016] The present invention combines YOLO-OBB with the defocus method by utilizing a fusion architecture of YOLO-OBB and defocus detection. OBB is used to accurately lock the inclined lead area in the deep hole with an inclination angle θ∈[-45°, 45°], eliminating the variance calculation interference caused by the hole wall background in the traditional rectangular ROI, and increasing the effective area ratio from 60% to 95%. According to the displacement enhancement-differential variance joint evaluation mechanism, within the servo step interval of 1mm, the sub-pixel displacement is calculated by the phase correlation method with an accuracy of 0.05 pixels, and a differential operation is performed on the compensated image. The effect of image misalignment caused by mechanical vibration is reduced by 85%, and the variance curve signal-to-noise ratio is improved to 28dB. The servo system and the detection algorithm are coordinated and optimized. The servo uses encoder position comparison technology to accurately control the flying shot every 1mm to ensure position accuracy, and the single-hole detection time is compressed to 0.7s. This not only eliminates the interference of laser reflection inside the deep hole, but also replaces the inefficient manual detection method and improves the detection speed and stability of the defocus method. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Figure 1 This is a workflow diagram of a method for measuring the height of a deep-hole firework fuse according to the present invention;
[0018] Figure 2 A picture of the imaging module of the present invention;
[0019] Figure 3 This is a schematic diagram of the implementation flow of the ROI extraction algorithm based on YOLO-OBB of the present invention. DETAILED DESCRIPTION
[0020] The technical solution of the present invention is further described below with reference to the accompanying drawings and specific embodiments.
[0021] Example 1
[0022] like Figure 1 As shown, a method for measuring the height of deep-hole firework fuses includes: combining a motion control module with an imaging module to perform multi-frame image acquisition to obtain N images, using YOLOv11-OBB to locate the fuse, pre-positioning it to the fuse vertex, and then using the vertex area ROI to calculate the clarity in the N images, and using SIMD instructions to accelerate the calculation.
[0023] The motion control module uses a servo motor to drive the ball screw with a lead of 2mm. Combined with the encoder closed-loop feedback, it can achieve a displacement of 1mm step on the Z axis and a repeatability accuracy of ±0.005mm.
[0024] like Figure 2 As shown, the imaging module is equipped with a 5-megapixel global shutter CMOS camera with a frame rate of 60fps, a fixed focal length lens, a depth of field of 2mm, and a working distance of 300mm.
[0025] During the multi-frame image acquisition process, the servo system steps at 1 mm / step, and collects 20 images within a 20 mm range of the Z axis. The total travel is 20 mm, the exposure time of each frame is 20 ms, and the image resolution is 2448 × 2048 pixels.
[0026] During the algorithm processing, YOLOv11-OBB is used to locate the lead, pre-positioning the lead vertex, and then the vertex area ROI is used to calculate the clarity in 20 images, and SIMD instructions are used to accelerate the calculation.
[0027] In the ROI extraction process based on YOLO-OBB, a lightweight YOLOv11-OBB model is deployed with an input resolution of 640×640. The target area is intercepted according to the detection results to eliminate background interference.
[0028] like Figure 3 As shown in the figure, the implementation process of the ROI extraction algorithm based on YOLO-OBB includes image displacement enhancement and difference calculation, local variance clarity evaluation, height mapping and peak positioning.
[0029] Image displacement enhancement and difference calculation include: defining the displacement vector Δ=(Δx, Δy), for the nth frame image I n Perform affine transformation: I′ n (x,y)=I n (x+Δx,y+Δy), calculate the absolute difference between the shifted image and the original image: D n (x,y)=|I′ n (x,y)-I n-1 (x,y)|.
[0030] The local variance clarity evaluation includes: directly calculating the overall variance of the YOLO-OBB demarcated area: N is the total number of ROI pixels, and μ is the mean grayscale value of the ROI area.
[0031] Height mapping and peak location including: building clarity curves z is the Z-axis position. The cubic spline interpolation curve is used to fit the height corresponding to the maximum variance value. The calculation formula is: Among them, δ = 0.5 mm is the Gaussian smoothing coefficient.
[0032] The above specific embodiments are only several preferred embodiments of the present invention. Based on the technical solutions of the present invention and the relevant inspirations of the above embodiments, those skilled in the art can make various alternative improvements and combinations to the above specific embodiments.
Claims
1. A method for measuring the height of a deep-hole firework fuse, characterized in that: include: The motion control module is combined with the imaging module to acquire multiple frames of images to obtain N images. YOLOv11-OBB is used to locate the lead and pre-position the lead vertex. The vertex area ROI is then used to calculate the clarity in the N images, and SIMD instructions are used to accelerate the calculation.
2. The method for measuring the height of a deep-hole firework fuse according to claim 1, characterized in that: The motion control module uses a servo motor to drive the ball screw with a lead of 2mm. Combined with the encoder closed-loop feedback, it can achieve a displacement of 1mm step on the Z axis and a repeatability accuracy of ±0.005mm.
3. The method for measuring the height of a deep-hole firework fuse according to claim 1, characterized in that: The imaging module is equipped with a 5-megapixel global shutter CMOS camera with a frame rate of 60fps, a fixed focal length lens, a depth of field of 2mm, and a working distance of 300mm.
4. The method for measuring the height of a deep-hole firework fuse according to claim 1, characterized in that: During the multi-frame image acquisition process, the servo system steps at 1 mm / step and collects N images within a 20 mm range on the Z axis. The total stroke is 20 mm, the exposure time for each frame is 20 ms, and the image resolution is 2448 × 2048 pixels.
5. The method for measuring the height of a deep-hole firework fuse according to claim 1, characterized in that: In the ROI extraction process based on YOLO-OBB, a lightweight YOLOv11-OBB model is deployed with an input resolution of 640×640. The target area is intercepted according to the detection results to eliminate background interference.
6. The method for measuring the height of a deep-hole firework fuse according to claim 5, characterized in that: The implementation process of the ROI extraction algorithm based on YOLO-OBB includes image displacement enhancement and difference calculation, local variance clarity evaluation, height mapping and peak positioning.
7. A method for measuring the height of a deep hole firework fuse according to claim 6, characterized in that: Image displacement enhancement and difference calculation include: defining a displacement vector, performing affine transformation on the n-th frame image, and calculating the absolute difference between the image after displacement and the original image.
8. The method for measuring the height of a deep hole firework fuse according to claim 6, characterized in that: The local variance clarity evaluation includes: directly calculating the overall variance of the YOLO-OBB demarcated area.
9. The method for measuring the height of a deep hole firework fuse according to claim 6, characterized in that: Height mapping and peak location include: constructing a clarity curve, fitting the curve through cubic spline interpolation, and locating the height corresponding to the maximum variance value.
10. The method for measuring the height of a deep-hole firework fuse according to claim 4, characterized in that: N=20。
Citation Information
Patent Citations
Lead-wire detection device for firework combined pot
CN105737684A
Methods And Apparatus For Measuring Height On A Semiconductor Wafer
CN107683400A
Visual system for disassembly of container lock pin
CN114332598A
Projection device and ROI feature region selection method
CN115002433A
Self-adaptive image edge detection method and system in unmanned aerial vehicle (UAV) autonomous landing complex environment
CN116580043A