A method and system for online visual inspection of the entire appearance of automotive hexagonal head bolts
By employing a visual inspection method that combines segmented positioning, dynamic lighting, and correction, the problems of low efficiency and insufficient accuracy in bolt inspection in existing technologies have been solved, achieving efficient and accurate full-appearance inspection of bolts.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- 杭州映图智能科技有限公司
- Filing Date
- 2026-04-20
- Publication Date
- 2026-05-26
AI Technical Summary
Existing automotive hexagonal head bolt inspection technologies suffer from high labor intensity, low inspection efficiency, and insufficient accuracy. Furthermore, traditional machine vision inspection cannot adapt to the segmented reflective patterns of bolts, leading to misjudgments of reflective patterns and blind spots in inspection.
A visual inspection method is adopted, which involves segmented positioning of bolts, layered dynamic lighting, and dynamic correction. The method collects attitude parameters through a camera, constructs a reflective mapping model, dynamically adjusts the lighting control parameters, and combines multi-camera layout and thread trajectory splicing technology to accurately identify bolt defects.
It solves the problem of image instability caused by bolt posture fluctuations, accurately identifies various bolt defects, especially difficult-to-identify defects such as thread segment trajectory breaks and local depressions, and achieves high-quality image acquisition and detection.
Smart Images

Figure CN122089710A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of automotive fastener inspection, specifically to an online visual inspection method and system for the full appearance of automotive hexagonal head bolts. Background Technology
[0002] As critical fasteners connecting core components such as the engine block, chassis suspension, and transmission system, the appearance quality of automotive hexagonal head bolts directly determines assembly reliability and driving safety. Defects on the bolt surface, such as head cracks, groove burrs, shank scratches, dents, thread profile damage, and misalignment of the head and shank, can lead to loosening of the assembly, stress concentration, or even fracture failure. Therefore, full appearance quality inspection is a core quality control step in the automotive parts manufacturing process.
[0003] Currently, the visual inspection of automotive hexagonal head bolts mainly relies on two technical solutions: one is manual visual inspection, which suffers from high labor intensity, low inspection efficiency, and strong subjectivity. Furthermore, its accuracy in identifying defects such as localized thread dents and minor scratches is insufficient, making it difficult to meet the high-speed, high-consistency inspection requirements of modern production lines. The other is traditional machine vision inspection methods, which, while achieving partial automation, still face significant technical bottlenecks for bolt inspection. Ordinary glass turntables have poor adaptability, easily leading to bolt circumferential slippage and tilting, resulting in blurred images. Additionally, the bolt surface exhibits segmented, differentiated reflective characteristics, including a strong reflective area at the head, a weak reflective area at the head, a uniform reflective area on the shank, and a helical reflective area on the thread section. Moreover, the reflective trajectory is prone to deviation with bolt posture fluctuations. Existing technologies often employ fixed lighting parameters or overall reflective area division schemes, which cannot adapt to the segmented reflective patterns of bolts. This can easily lead to misjudging thread section reflections as thread damage or masking minor defects due to reflection. Furthermore, existing solutions primarily focus on head and shank defect detection, resulting in blind spots.
[0004] Therefore, in order to solve the problems existing in the prior art, the present invention proposes an online visual inspection method and system for the full appearance of automotive hexagonal head bolts. Summary of the Invention
[0005] To address the shortcomings of existing technologies, the present invention aims to provide an online visual inspection method and system for the full appearance of automotive hexagonal head bolts.
[0006] To achieve the above objectives, the present invention provides the following technical solution:
[0007] A method for online visual inspection of the entire appearance of automotive hexagonal head bolts, comprising: The bolt segmentation and positioning step involves acquiring bolt images using a camera, and obtaining the bolt head center coordinates, head tilt angle, and bolt shank offset angle as attitude fluctuation parameters based on the bolt images. The layered dynamic lighting step divides the bolt into several reflective sub-regions based on the segmented reflective characteristics of the bolt and constructs a reflective mapping model. The lighting control parameters are calculated by combining the target optical state of each sub-region with the attitude fluctuation parameters. The lighting control parameters are used to control the dynamic adjustment of the LED array. The effect of each sub-region is evaluated, and the deviation rate between the actual optical state and the target optical state is calculated. When the deviation rate is greater than the threshold, the lighting control parameters are adjusted. The dynamic correction acquisition step involves acquiring bolt images when the camera detects that the current bolt posture is within a preset threshold, and then performing image correction based on the deviation between the bolt posture in the image to be tested and the standard bolt posture to obtain the image set to be tested. The defect detection steps involve detecting defects in the bolt head and bolt shank of the image under test and verifying them based on the clarity evaluation value of the corresponding sub-region. Multiple frames of the image under test are stitched together to form a continuous thread trajectory. Based on the reflection breakpoints and reflection deviation points of the trajectory, thread segment defects are detected and the detection results are output.
[0008] Furthermore, the bolt segment positioning step includes the following: the camera includes one head monitoring camera positioned directly above the glass turntable, and four rod monitoring cameras symmetrically positioned on the sides of the turntable. The head monitoring camera acquires an image of the bolt head and fits the hexagonal contour of the head to obtain the center coordinates and head tilt angle. The rod monitoring cameras extract the edge contours of the unthreaded area in the upper section and the threaded area in the lower section of the rod, respectively, obtain the rod axis through straight line fitting, and calculate the offset angle between the rod axis and the radius direction of the turntable.
[0009] Furthermore, the layered dynamic lighting step includes dividing the bolt into several reflective sub-regions based on its segmented reflective characteristics, including a strong reflective sub-region at the head, a weak reflective sub-region at the head, a shank sub-region, and a threaded segment sub-region. By collecting data from each reflective sub-region and determining the target optical state of each sub-region based on its reflective characteristics, the strong reflective sub-region at the head is significantly affected by tilt and has a high reflective intensity in its target optical state; the reflective intensity decreases with increasing head tilt angle. The weak reflective sub-region at the head has less impact on clarity due to tilt, and its target optical state is characterized by a groove edge clarity greater than a preset threshold. The shank sub-region exhibits uniform reflectivity, and its target optical state has reduced reflective intensity; when the shank offset angle exceeds a preset threshold, the corresponding camera exposure is increased. The reflective trajectory of the threaded segment sub-region varies according to the head tilt angle and the shank tilt angle; when in the target optical state, the spiral reflective bandwidth is less than a preset threshold, and the trajectory is continuous without breaks.
[0010] Furthermore, the layered dynamic lighting step also includes constructing a reflection mapping model. By collecting optical data of each sub-region under different posture parameters and different turntable rotation angles, the optical data includes reflection intensity, bandwidth, and sharpness. A basic database associated with lighting control parameters is established, including the lamp combination method, brightness value, and illumination angle. Based on the lighting control parameters, posture parameters, and turntable rotation angle, the actual optical state of the sub-region is output according to the reflection mapping model.
[0011] Furthermore, the layered dynamic lighting step also includes, during effect evaluation, calculating the deviation rate between the actual optical state and the target state of each sub-region, and calculating the total deviation rate using weight parameters. When the total deviation rate is greater than a preset threshold, a lighting evaluation value is calculated. If the lighting evaluation value is greater than the preset threshold, a sub-region deviation rate verification is performed. If the lighting evaluation value is less than the preset threshold, the reflection mapping model is adjusted and the lighting control parameters and actual optical state of each sub-region are recalculated. The sub-region deviation rate verification includes, when the sub-region deviation rate is greater than the corresponding preset threshold, backtracking the correspondence between the lighting control parameters and the target optical state of the sub-region under the current posture and angle, updating the basic database, and recalculating the lighting control parameters.
[0012] Furthermore, the dynamic correction acquisition step includes: when the attitude monitoring camera compares the current attitude matrix with the allowable threshold in real time, it sends a trigger signal to each camera to synchronously acquire the corresponding field of view image; otherwise, it acquires the image and marks it as the image to be corrected, and performs differentiated correction on the images to be corrected for different parts. When correcting the head image, if the head tilt angle exceeds the preset threshold, the head image is corrected by reverse rotation. When correcting the pole image, if the pole offset angle is greater than the preset threshold, the pixel translation amount is calculated based on the offset angle difference, and the upper and lower images of the pole are compensated for translation so that the pole axis is aligned with the image center. When correcting the threaded section image, the image to be corrected is straightened by trajectory straightening, and the straightened tilted thread reflection trajectory is corrected to a horizontal straight line.
[0013] Furthermore, in the defect detection steps, bolt head detection includes: when detecting the top surface image of the head, identifying gray-level abrupt change areas using a gray-level gradient algorithm; when the gray-level abrupt change value is greater than a preset threshold and the continuous pixel points are greater than a preset value, it is determined to be a head crack; when detecting the side image of the head, extracting the groove or flange surface edge using an edge detection algorithm, calculating the edge protrusion height; when the protrusion height is greater than a preset value and the continuous length is greater than a preset value, it is determined to be a groove burr; bolt shank defect detection includes: when detecting the upper section image of the shank, extracting linear gray-level abnormal areas using a length and width recognition algorithm; when the length is greater than a preset value and the width is greater than a preset value, it is determined to be a shank scratch; when detecting the lower section image of the shank, calculating the depth of the recessed area based on the gray-level value difference using a depth estimation algorithm; when the depth of the recessed area is greater than a preset value, it is determined to be a shank recess.
[0014] Furthermore, in the defect detection step, the clarity verification is based on the evaluation value of the weak reflective sub-region of the head in the layered dynamic lighting step. The measured clarity value of the weak reflective sub-region of the head in the image corresponding to the head defect detection is extracted. If the clarity is greater than the preset value, the defect detection result is directly confirmed to be valid. If the clarity is less than the preset value, adjacent head detection images are called to cross-verify the same suspected defect area and output the defect result.
[0015] Furthermore, the defect detection step also includes, during the continuous thread trajectory splicing, firstly, extracting reflective white points from each frame of the corrected thread segment detection image. The reflective white points are pixels with grayscale values greater than a preset value. Record the axial coordinates and circumferential angle of each reflective white point. The axial coordinates are calculated based on the calibration relationship between image pixels and actual dimensions. Then, align the coordinates of the reflective white points of each frame along the center line of the thread helix according to the rotation angle of the turntable. Fill the gaps between reflective white points in adjacent frames through linear interpolation to form a complete thread helix trajectory diagram. If the spliced trajectory is continuous without breaks, and the deviation of the white points from the preset standard thread trajectory is less than a preset threshold, it is determined to be without thread defects. If the trajectory has 3 or more consecutive white points with deviations from the standard trajectory greater than the preset threshold, it is determined to be continuous damage to the thread profile. If a single white point has a deviation from the standard trajectory greater than the preset threshold and there are no other high grayscale points within a 5-pixel range around it, it is determined to be a local depression in the thread profile.
[0016] A full-appearance online visual inspection system for automotive hexagonal head bolts includes: The bolt segmentation positioning module acquires bolt images through a camera and obtains the bolt head center coordinates, head tilt angle, and bolt shank offset angle as attitude fluctuation parameters based on the bolt images. The layered dynamic lighting module divides the bolt into several reflective sub-regions based on the segmented reflective characteristics of the bolt and constructs a reflective mapping model. It calculates the lighting control parameters by combining the target optical state of each sub-region with the attitude fluctuation parameters, and controls the dynamic adjustment of the LED array according to the lighting control parameters. It also evaluates the effect of each sub-region, calculates the deviation rate between the actual optical state and the target optical state, and adjusts the lighting control parameters when the deviation rate is greater than the threshold. The dynamic correction acquisition module acquires bolt images when the camera detects that the current bolt posture is within a preset threshold, and performs image correction based on the deviation between the bolt posture in the image to be tested and the standard bolt posture to obtain the image set to be tested. The defect detection module performs bolt head defect detection and bolt shank defect detection on the image under test and verifies it according to the clarity evaluation value of the corresponding sub-region. It stitches multiple frames of the image under test into a continuous thread trajectory, and performs thread segment defect detection based on the trajectory reflection breakpoints and reflection deviation points, and outputs the detection results.
[0017] The beneficial effects of this invention are as follows: By using visual dynamic layered positioning and differential correction, it accurately captures and compensates for bolt posture fluctuations, completely solving the slippage and tilting problems caused by the large length-to-diameter ratio of bolts, and ensuring the stability and integrity of image acquisition; by setting the target optical state according to the segmented reflective characteristics of bolts, and constructing an associated mapping model by combining posture parameters and rotation angles, it dynamically adjusts the lighting control parameters, effectively suppressing segmented reflective interference, avoiding misjudging thread reflective as defects, and providing a high-quality image foundation for defect detection; it covers the head, upper and lower sections of the shank, and threaded sections, and through multi-camera layout and thread trajectory stitching technology, it accurately identifies various defects such as cracks, burrs, scratches, and tooth damage, especially solving the problem of judging difficult-to-identify defects such as threaded section trajectory breakpoints and local depressions. Attached Figure Description
[0018] Figure 1 This is a flowchart of an online visual inspection method for the full appearance of automotive hexagonal head bolts according to the present invention.
[0019] Figure 2 This is a test schematic diagram of an online visual inspection system for the full appearance of automotive hexagonal head bolts according to the present invention. Detailed Implementation
[0020] The present invention will be further described in detail below with reference to the accompanying drawings and embodiments. Identical components are denoted by the same reference numerals. It should be noted that the terms "front," "rear," "left," "right," "upper," and "lower" used in the following description refer to directions in the accompanying drawings, and the terms "bottom surface," "top surface," "inner," and "outer" refer to directions toward or away from the geometric center of a specific component, respectively.
[0021] This invention proposes an online visual inspection method for the entire appearance of automotive hexagonal head bolts, including: The bolt segmentation and positioning step involves acquiring bolt images using a camera, and obtaining the bolt head center coordinates, head tilt angle, and bolt shank offset angle as attitude fluctuation parameters based on the bolt images. Specifically, such as Figures 1 to 2 As shown, the bolt segment positioning step includes the following: the camera includes one head monitoring camera positioned directly above the glass turntable, and four rod monitoring cameras symmetrically positioned on the sides of the turntable. The head monitoring camera acquires the bolt head image and fits the hexagonal contour of the head to obtain the center coordinates and head tilt angle. The rod monitoring cameras extract the edge contours of the unthreaded area in the upper section and the threaded area in the lower section of the rod, respectively, obtain the rod axis through straight line fitting, and calculate the offset angle between the rod axis and the radius direction of the turntable.
[0022] When the head monitoring camera is working, it first preprocesses the acquired bolt head image to remove environmental noise and glare interference from the glass turntable surface, highlighting the hexagonal contour features of the head. Then, image processing algorithms identify the six edges and six vertices of the hexagon. Based on these feature points, contour fitting is performed, and the geometric center of the hexagon is determined through geometric calculations; this center is the center coordinate of the bolt head. The head tilt angle is obtained using the horizontal plane of the glass turntable as a reference. It is achieved by comparing the spatial angle between the plane containing the top contour of the head and the reference plane. Specifically, the tilt degree of the head is calculated by analyzing the difference in vertical distance from each vertex of the hexagon to the reference plane. This parameter directly reflects whether the bolt head is tilted and the magnitude of the tilt angle.
[0023] The working logic of the pole monitoring camera is differentiated based on the structural characteristics of different areas of the pole. For the unthreaded area of the upper section of the pole, the camera focuses on extracting its smooth outer edge contour. The edge features of this area are continuous and regular, making it easy to capture accurately. For the threaded area of the lower section of the pole, the camera filters out the local contour fluctuations caused by the thread protrusions and extracts the overall outer edge trend of the pole. After obtaining the edge features of the two sections, a straight line fitting algorithm is used to fit these feature points, eliminating the influence of local interference factors such as threads and minor surface scratches, to obtain a straight line that represents the overall center direction of the pole. This straight line is the pole axis. The calculation of the pole offset angle is based on the radius direction of the turntable, which is the radial extension direction from the center of the turntable to the location of the bolt. By analyzing the spatial angle between the direction of the pole axis and this radial direction, the pole offset angle can be obtained. This parameter can accurately reflect whether the pole deviates from the preset ideal position, providing a basis for subsequent adjustments to the lighting angle and acquisition angle.
[0024] By collecting multi-dimensional attitude parameters of the head and shank, a dynamic attitude model of the bolt can be fully constructed, ensuring that parameter adjustments in subsequent stages can accurately adapt to the actual state of the bolt, providing a fundamental guarantee for high precision in full-appearance inspection.
[0025] The layered dynamic lighting step divides the bolt into several reflective sub-regions based on the segmented reflective characteristics of the bolt and constructs a reflective mapping model. The lighting control parameters are calculated by combining the target optical state of each sub-region with the attitude fluctuation parameters. The lighting control parameters are used to control the dynamic adjustment of the LED array. The effect of each sub-region is evaluated, and the deviation rate between the actual optical state and the target optical state is calculated. When the deviation rate is greater than the threshold, the lighting control parameters are adjusted. Specifically, such as Figures 1 to 2As shown, the layered dynamic lighting step includes dividing the bolt into several reflective sub-regions based on its segmented reflective characteristics, including a strong reflective sub-region at the head, a weak reflective sub-region at the head, a shank sub-region, and a threaded segment sub-region. By collecting data from each reflective sub-region and determining the target optical state of each sub-region based on its reflective characteristics, the strong reflective sub-region at the head is significantly affected by tilt and has a high reflective intensity in its target optical state; the reflective intensity decreases with increasing head tilt angle. The weak reflective sub-region at the head has less impact on clarity due to tilt, and its target optical state is characterized by a groove edge clarity greater than a preset threshold. The shank sub-region exhibits uniform reflectivity, and its target optical state has reduced reflective intensity; when the shank offset angle exceeds a preset threshold, the corresponding camera exposure is increased. The reflective trajectory of the threaded segment sub-region varies according to the head tilt angle and the shank tilt angle; when in the target optical state, the spiral reflective bandwidth is less than a preset threshold, and the trajectory is continuous without breaks.
[0026] After clearly defining the reflective sub-regions, a target optical state needs to be set for each sub-region. The design of these states is based on the core logic of adapting to defect detection requirements. For the highly reflective sub-region of the head, the target reflective intensity needs to be controlled within a specific range. This avoids excessive intensity leading to image overexposure, which would mask defects such as head cracks and edge bumps, while also avoiding excessive intensity leading to blurred head contours. At the same time, when the head tilt angle increases, the incident angle of light on the tilted side will be closer to the specular reflection angle, and the intensity of light reflected to the camera will increase significantly. Therefore, the reflective intensity on that side needs to be reduced simultaneously to ensure uniform overall head reflection. The target optical state of the weakly reflective sub-region of the head focuses on the clarity of defect features, especially defects such as burrs inside the groove and fine cracks on the flange surface. It is necessary to ensure that the grayscale contrast of the groove edge is sufficiently clear, and this clarity is less affected by the head tilt. The constraint effect of the groove structure on light can reduce the differences in light scattering caused by posture changes. The goal of the rod sub-region is to maintain uniform reflection, because defects such as scratches and dents on the rod need to be identified through local differences in grayscale values. If the reflection is uneven, fluctuations in reflection can easily be misjudged as defects. When the rod offset angle exceeds the set range, the relative angle between the camera and the rod will change, and the amount of reflected light received by the camera will decrease. At this time, the exposure of the corresponding camera needs to be increased to compensate for the light loss and ensure stable brightness of the rod image. The target optical state of the thread segment sub-region is designed around the bandwidth and continuity of the reflective band: the tooth crest width of a normal thread is uniform, and the corresponding reflective band width should also be consistent. If there is damage to the tooth profile, such as tooth crest wear, the reflective band will widen. The reflective band of a normal thread is continuously distributed along the helical trajectory. If there is a dent at the tooth root or missing tooth profile, the reflective band will have a break. Therefore, controlling the helical reflective bandwidth within a narrow range and maintaining continuity is the basis for subsequent judgment of thread defects through trajectory.
[0027] Specifically, such as Figures 1 to 2As shown, the layered dynamic lighting step also includes constructing a reflection mapping model. By collecting optical data of each sub-region under different posture parameters and different turntable rotation angles, the optical data includes reflection intensity, bandwidth, and sharpness. A basic database associated with lighting control parameters is established, which includes the combination of LED beads, brightness value, and illumination angle. Based on the reflection mapping model, the actual optical state of the sub-region is output according to the lighting control parameters, posture parameters, and turntable rotation angle.
[0028] The second step in model building is pattern extraction, which involves mining the correlation logic between input parameters and output results from the basic database. Input parameters include the current bolt's attitude parameters and the turntable rotation angle, while the output results are the actual optical states of each sub-region. For example, when the turntable rotates to a certain angle and the bolt head tilts to the left, to maintain the reflectivity of the highly reflective sub-region at the head within the target range, the left-side LEDs need to be turned off and the brightness of the right-side LEDs reduced. When the rod's offset angle increases, to ensure uniform reflection in the rod's sub-regions, the illumination angle of the side LEDs needs to be adjusted to cover the area after the rod's offset. These patterns are not calculated using formulas but are derived through trend analysis of a large amount of data, ultimately forming a set of dynamically invoked correlation logic. When a certain attitude parameter and turntable angle are input, the model can quickly match the corresponding lighting control parameters and predict the actual optical states of each sub-region under those lighting control parameters.
[0029] Specifically, such as Figures 1 to 2 As shown, the layered dynamic lighting step further includes, during effect evaluation, calculating the deviation rate between the actual optical state and the target state of each sub-region, and calculating the total deviation rate using weight parameters. When the total deviation rate is greater than a preset threshold, a lighting evaluation value is calculated. If the lighting evaluation value is greater than the preset threshold, a sub-region deviation rate verification is performed. If the lighting evaluation value is less than the preset threshold, the reflection mapping model is adjusted and the lighting control parameters and actual optical state of each sub-region are recalculated. The sub-region deviation rate verification includes, when the sub-region deviation rate is greater than the corresponding preset threshold, backtracking the correspondence between the lighting control parameters and the target optical state of the sub-region under the current posture and angle, updating the basic database, and recalculating the lighting control parameters.
[0030] When the total deviation rate exceeds the preset threshold, the lighting evaluation value needs to be further calculated. The lighting evaluation value comprehensively considers the distribution of deviations in each sub-region. If only a few low-weight sub-regions have large deviations, the overall evaluation value may still be high; if high-weight sub-regions, such as the threaded section sub-region, have large deviations, the evaluation value will be significantly reduced. If the lighting evaluation value is greater than the preset threshold, it indicates that the overall lighting effect is qualified, and only sub-region deviation rate verification is required: check the deviation rate of each sub-region one by one. For sub-regions with deviation rates exceeding the standard, backtrack the lighting control parameter records of that sub-region in the basic database under the current posture and turntable angle, analyze the cause of the deviation, such as the previously recorded lighting control parameters not covering the extreme cases of the current posture, update the corresponding lighting control parameters and optical state correspondence in the database, and recalculate the lighting control parameters of that sub-region to ensure that the deviation rate is reduced to within the threshold.
[0031] If the lighting evaluation value is less than the preset threshold, it indicates that the correlation logic of the current reflection mapping model is insufficient. For example, the model does not fully consider the light reflection law under a certain posture. It is necessary to adjust the parameter correlation logic of the model itself, such as correcting the correspondence between the head tilt angle and the brightness adjustment range of the LED beads, or supplementing the lighting control law under the new posture parameter combination. After the adjustment is completed, the lighting control parameters of all sub-areas are recalculated, and the actual optical state of each sub-area is collected again. The deviation rate calculation and evaluation process is repeated until the total deviation rate and the lighting evaluation value meet the requirements and a stable lighting control scheme is formed.
[0032] The dynamic correction acquisition step involves acquiring bolt images when the camera detects that the current bolt posture is within a preset threshold, and then performing image correction based on the deviation between the bolt posture in the image to be tested and the standard bolt posture to obtain the image set to be tested. Specifically, such as Figures 1 to 2 As shown, the dynamic correction acquisition step includes: when the attitude monitoring camera compares the current attitude matrix with the allowable threshold in real time, it sends a trigger signal to each camera to synchronously acquire the corresponding field of view image; otherwise, the image is acquired and marked as the image to be corrected, and differential correction is performed on the images to be corrected for different parts. When the head image is corrected, if the head tilt angle exceeds the preset threshold, the head image is rotated in the opposite direction for correction. When the pole image is corrected, if the pole offset angle is greater than the preset threshold, the pixel translation amount is calculated based on the offset angle difference, and the upper and lower images of the pole are compensated for translation so that the pole axis is aligned with the image center. When the thread section image is corrected, the trajectory straightening process is performed on the image to be corrected, and the tilted thread reflection trajectory after straightening is corrected to a horizontal straight line.
[0033] When the attitude monitoring camera determines that all parameters in the current attitude matrix are within the allowable threshold range, it immediately sends a trigger signal to all detection cameras. These detection cameras, including the top head camera, the side head camera, the upper and lower shank cameras, and the threaded section camera, will simultaneously start image acquisition to ensure that the images of each part of the bolt at the same time completely correspond to its current attitude, avoiding attitude misalignment caused by acquisition time differences. This synchronous acquisition logic can maximize the preservation of the spatial position correlation of each part of the bolt, providing a basis for subsequent defect localization, such as the correlation analysis between head cracking and shank offset. If the attitude monitoring camera determines that the current attitude exceeds the allowable threshold, it will still control the camera to acquire images, but will mark these images as images to be corrected. At this time, the purpose of acquiring images is not for direct detection, but to recover effective features through subsequent correction, avoiding detection blind spots caused by discarding images. For example, only a few attitudes are qualified within one revolution of the bolt, and discarding images exceeding the threshold will miss defects at key angles.
[0034] After image acquisition is completed, differential correction needs to be performed on the image to be corrected. The core basis of this differential design is that the image features relied upon for defect detection in different parts of the bolt are essentially different. Head defects, such as cracks and burrs, rely on clear geometric contours and grayscale contrast. Shank defects, such as scratches and dents, rely on uniform grayscale distribution and local grayscale abrupt changes. Thread segment defects, such as tooth damage and trajectory breakpoints, rely on continuous and regular reflective trajectories. Therefore, it is necessary to design exclusive correction logic for the characteristic requirements of each part.
[0035] For reverse rotation correction of head images, when the head tilt angle exceeds a preset threshold, the head's projection in the image will exhibit a hexagonal contour deformation. For example, when the head tilts to the left, the left side of the head in the image will shorten, and the right side will lengthen. This deformation can cause originally straight crack defects to appear curved, or cause deviations in the height measurement of grooved burrs. Reverse rotation correction requires using the head's center coordinates as the rotation reference to ensure that the head remains at the image center after rotation and does not exceed the field of view. The rotation direction and angle are determined based on the specific value of the head tilt angle. The head is rotated by the same angle in the opposite direction of the tilt, restoring the top surface of the head to a state parallel to the horizontal plane of the image. For example, if the head tilts to the right by a certain angle, it is rotated to the left by the same angle during correction, allowing the hexagonal contour to return to a regular hexagonal shape. At this point, the gray-scale abrupt change line of the crack will regain its straight-line characteristics, and the height and length measurements of the grooved edges can accurately reflect the actual dimensions, providing an accurate contour basis for subsequent head defect detection.
[0036] For translation compensation of the image to be corrected for the pole, when the pole offset angle is greater than the preset threshold, the pole axis will deviate from the image center. If the offset direction is towards the edge of the field of view, it may cause some areas of the upper and lower sections of the pole to exceed the camera's field of view, making it impossible to collect defects in that area. Even if it does not exceed the field of view, the distance between different positions of the pole and the camera will also be different, resulting in higher gray levels on the side closer to the camera and lower gray levels on the side farther away. This uneven gray level is easily misjudged as a dent or scratch on the pole. The implementation of translation compensation involves two steps: The first step is to calculate the pixel translation amount. First, the spatial distance between the pole's axis and the image center is calculated based on the pole's offset angle. Then, combined with the camera's pixel calibration relationship (i.e., the actual physical size corresponding to each pixel), the spatial distance is converted into the number of pixels in the image. This number is the pixel translation amount to be applied. The second step is to perform the translation operation. Pixel translations of the same direction and magnitude are applied to the upper and lower segments of the pole image. For example, if the pole's axis is offset 10 pixels to the left of the image, both the upper and lower segments are simultaneously translated 10 pixels to the right, ensuring that the pole's axis completely coincides with the image center after translation. This synchronous translation ensures that the entire pole is centered in the image's field of view, and that all positions are at the same distance from the camera, resulting in uniform grayscale distribution. This creates conditions for identifying grayscale differences in defects such as scratches and dents.
[0037] For the trajectory straightening processing of the thread segment image to be corrected, the tilt of the reflected trajectory caused by posture and angle is eliminated, laying the foundation for multi-frame trajectory stitching. The reflected trajectory of the thread segment is a spiral bright band formed along the thread crest. When the bolt is tilted or the rotation angle is not in the ideal position, this spiral bright band will appear tilted in the image. If the tilt angle of the reflected trajectory of multiple frames is different, trajectory misalignment will occur during subsequent stitching, making it impossible to form a continuous spiral trajectory, and thus impossible to determine the trajectory breakpoint or deviation point. The trajectory straightening processing is not a simple image rotation, but a targeted adjustment based on the helical parameters of the thread, such as pitch and tooth profile angle. According to the reflected trajectory of the current thread segment, the helical direction and tilt angle of the trajectory are identified. Combined with the helical pitch of the standard thread, that is, the axial distance between two adjacent tooth crests, the tilted helical trajectory is decomposed into continuous horizontal line segments. For example, the original helical trajectory tilted at 45 degrees will be adjusted into a continuous bright band distributed in the horizontal direction, and the spacing of each bright band is consistent with the standard pitch. This straightening process ensures that the reflective bands of each frame of the threaded segment image are at the same horizontal height. When stitching multiple frames together, they can be arranged in order of rotation angle to form a complete and continuous horizontal reflective track, providing a clear track basis for judging whether there are any breaks or width deviations in the track.
[0038] Through the above process, the final set of images to be tested not only covers the entire appearance of the bolt head, upper and lower sections of the shank, and threaded section, but also ensures that the image features of each part can be adapted to the corresponding defect detection requirements. The head contour is regular, the gray scale of the shank is uniform, and the thread trajectory is clear, providing a core guarantee for the high-precision implementation of subsequent defect detection steps.
[0039] The defect detection steps involve detecting defects in the bolt head and bolt shank of the image under test and verifying them based on the clarity evaluation value of the corresponding sub-region. Multiple frames of the image under test are stitched together to form a continuous thread trajectory. Based on the reflection breakpoints and reflection deviation points of the trajectory, thread segment defects are detected and the detection results are output.
[0040] Specifically, such as Figures 1 to 2 As shown, in the defect detection steps, bolt head detection includes: when detecting the top surface image of the head, identifying gray-level abrupt change areas using a gray-level gradient algorithm; when the gray-level abrupt change value is greater than a preset threshold and the continuous pixel points are greater than a preset value, it is determined to be a head crack; when detecting the side image of the head, extracting the edge of the groove or flange surface using an edge detection algorithm, calculating the edge protrusion height; when the protrusion height is greater than a preset value and the continuous length is greater than a preset value, it is determined to be a groove burr; bolt shank defect detection includes: when detecting the upper section image of the shank, extracting linear gray-level abnormal areas using a length and width recognition algorithm; when the length is greater than a preset value and the width is greater than a preset value, it is determined to be a shank scratch; when detecting the lower section image of the shank, calculating the depth of the recessed area based on the gray-level value difference using a depth estimation algorithm; when the depth of the recessed area is greater than a preset value, it is determined to be a shank recess.
[0041] The bolt head defect detection focuses on two high-risk defects: cracks and grooved burrs. These two types of defects directly affect the load-bearing performance of the bolt head. For crack defects on the top surface of the bolt head, a gray-scale gradient algorithm is used for identification. This is based on the physical property that material fracture at the crack changes the light reflection path. When the bolt head is a continuous metal surface, light reflection is uniform, and the image gray-scale distribution is smooth. When a crack exists, a tiny gap or step is formed at the crack. Light is scattered or blocked at the gap, causing a significant jump in gray-scale values on both sides of the crack. This jump is called a gray-scale abrupt change. The core operation of the gray-scale gradient algorithm is to calculate the gray-scale difference between adjacent pixels pixel by pixel, including horizontal, vertical, and diagonal directions. If the gray-scale difference between adjacent pixels is small, it indicates that the gray-scale of the area is smooth and there are no obvious defects. If the gray-scale difference exceeds a preset threshold, it indicates that there is a gray-scale abrupt change at that location, which may be the edge of a crack.
[0042] However, relying solely on a single pixel's grayscale abrupt change is insufficient to determine cracking, as image noise can also cause grayscale jumps in individual pixels. Therefore, a condition for determining consecutive pixels needs to be added. Cracking is only identified when pixels with consecutive grayscale abrupt changes are continuously distributed and their number exceeds a preset value. This condition is based on the premise that cracking is a linearly extending defect, and its grayscale abrupt change region must exhibit a continuous linear distribution. In contrast, grayscale abrupt changes caused by noise are mostly isolated pixels or short-distance contiguous areas, failing to meet the requirement of consecutive pixels. For example, if multiple consecutive pixels in a certain area exhibit grayscale abrupt changes exceeding a threshold, and these pixels extend along a certain direction, it can be preliminarily determined as cracking, but further confirmation using sharpness verification is required.
[0043] The core reason for employing an edge detection algorithm to address the groove-shaped burr defects on the sides of the head is that these burrs are essentially abnormal protrusions at the edges of the groove, requiring identification through contour comparison. Normal edges of head grooves, such as cross-shaped grooves and hexagonal grooves, should be regular geometric lines. Burrs, however, form additional protruding structures outside these normal edges, altering the groove's contour. The edge detection algorithm is implemented in two steps: First, it extracts the groove edges by calculating the rate of change in pixel grayscale; locations with high grayscale change rates are identified as edges. This process extracts the boundaries between the groove area and other areas of the head, as well as the internal contour lines of the groove, forming a complete groove contour map. Second, it filters valid edges, excluding the boundaries between the sides of the head and other areas, retaining only the internal contour lines of the groove, i.e., the boundary lines between the groove walls and the bottom.
[0044] After obtaining the valid edges, the logic for calculating the edge protrusion height is based on the normal groove edge as a reference, comparing the distance between the protrusion and the reference line. A reference contour of the normal groove edge is established using standard bolt images. This reference contour is an average contour formed by fitting edge data from a large number of qualified samples. Then, the groove edge in the image to be detected is compared point by point with the reference contour. If the distance of the edge to be detected at a certain position beyond the reference contour exceeds a preset value, this distance is the protrusion height. Similarly, to eliminate false judgments caused by minor impurities, a continuous length judgment condition needs to be added. Only when the area where the protrusion height exceeds the threshold extends continuously and the continuous length exceeds the preset value is it judged as a groove burr, because protrusions caused by impurities are mostly point-like or short-distance protrusions and cannot form continuous long-distance protrusions.
[0045] Bar defect detection targets two common defects: scratches and dents. These defects weaken the tensile strength and fatigue resistance of the bar. The detection algorithm design needs to solve two key problems: distinguishing between linear scratches and noise, and correlating dent depth with grayscale.
[0046] Regarding the scratch defects on the upper section of the rod, the upper section of the rod is a smooth cylindrical surface. Under normal circumstances, the grayscale distribution of the image is uniform and there is no obvious grayscale abnormality. When scratches are present, the metal surface at the scratches is scratched, forming an uneven texture. The light reflection will show local abnormalities, which will be manifested as linear grayscale abnormal areas in the image. The grayscale of the scratches may be reduced due to light scattering, or the grayscale may be increased due to the metal edge.
[0047] The implementation logic of the length and width recognition algorithm is as follows: First, all gray-level abnormal regions are extracted using image segmentation technology. Then, morphological analysis is performed on each abnormal region: the longest extension direction and the maximum width perpendicular to the length direction of the abnormal region are calculated. If the length of the abnormal region exceeds a preset value and the width is less than a preset value, it indicates that the region is elongated, which matches the morphological characteristics of a scratch, and it is judged as a rod scratch. If both the length and width of the abnormal region are small, it indicates that the region is a point-like impurity or noise, and the defect judgment is excluded. The essence of this design is to distinguish between linear defects and point-like interference through morphological features, ensuring the targeted nature of scratch detection.
[0048] The technical basis for using a depth estimation algorithm to address the dented defects in the lower section of the shank is that the shadowing effect at the dented area causes a difference in grayscale value between the dented area and the normal area, and the magnitude of this grayscale difference is positively correlated with the dent depth. Although the lower section of the shank may have threads, dented defects are mostly located in the smooth transition area between threads or on the shank end face. The dented area forms a local shadow, causing the grayscale value of the dented area to be significantly lower than the surrounding normal area. The core of the depth estimation algorithm is not to directly measure the physical depth, but rather to estimate it indirectly through a grayscale difference and depth correlation model. By collecting a large number of dent samples of known depths, such as artificially made standard dented bolts, grayscale difference data at different dent depths is obtained. The grayscale difference between the dented area and the normal area is used to establish a correlation: the greater the grayscale difference, the greater the dent depth. For example, a dent of a certain depth corresponds to a specific grayscale difference, and a deeper dent will result in a larger grayscale difference. In actual inspection, the grayscale difference between the suspected dented area and the surrounding normal area in the image to be inspected is first calculated. Then, based on the preset correlation rule, the dent depth of that area is estimated. If the estimated depth exceeds the preset value, it indicates that the dent has affected the rod's performance and is judged as a rod dent; if the depth does not exceed the standard, it is judged as qualified. This indirect estimation logic avoids the problem of complex hardware required for direct depth measurement, and qualitative and quantitative judgment of dent depth can be achieved solely through image grayscale.
[0049] In the defect detection step, the clarity verification is based on the evaluation value of the weak reflective sub-region of the head in the layered dynamic lighting step. The measured clarity value of the weak reflective sub-region of the head in the image corresponding to the head defect detection is extracted. If the clarity is greater than the preset value, the defect detection result is directly confirmed to be valid. If the clarity is less than the preset value, adjacent head detection images are called to cross-verify the same suspected defect area and output the defect result.
[0050] Specifically, such as Figures 1 to 2 As shown, the defect detection step further includes, when stitching the continuous thread trajectory, firstly, extracting reflective white points from each frame of the corrected thread segment detection image. The reflective white points are pixels with gray values greater than a preset value. Record the axial coordinates and circumferential angle of each reflective white point. The axial coordinates are calculated based on the calibration relationship between image pixels and actual dimensions. Then, align the coordinates of the reflective white points of each frame along the center line of the thread helix according to the rotation angle of the turntable. Fill the gaps between reflective white points in adjacent frames through linear interpolation to form a complete thread helix trajectory diagram. If the stitched trajectory is continuous without breaks and the deviation of the white points from the preset standard thread trajectory is less than a preset threshold, it is determined to be without thread defects. If the trajectory has 3 or more consecutive white points with deviations from the standard trajectory greater than the preset threshold, it is determined to be continuous damage to the thread profile. If a single white point has a deviation from the standard trajectory greater than the preset threshold and there are no other high gray values within a 5-pixel range around it, it is determined to be a local depression in the thread profile.
[0051] The core of thread defect judgment is comparing the actual trajectory with the standard trajectory. The standard trajectory is an ideal helical trajectory generated based on the design parameters of the bolt to be inspected, such as pitch and thread angle. Standard threads have uniform tooth crest spacing and consistent tooth crest width; therefore, the white dots on the standard trajectory are evenly distributed, and the axial and circumferential spacing between adjacent white dots is fixed. The judgment logic is divided into three categories: To determine if there are no thread defects, if the actual trajectory after splicing is continuous without any breaks, and the deviation of all white dots from the standard trajectory is less than a preset threshold, it indicates that the thread crest shape is regular and there is no obvious damage. The basis for judging the deviation is the difference between the actual coordinates of the white dots and the coordinates of the corresponding positions on the standard trajectory. If the difference is small, it indicates that the position of the thread crest meets the design requirements and there is no wear or offset.
[0052] The determination of continuous thread profile damage is based on the presence of three or more consecutive white spots in the actual trajectory, with deviations from the standard trajectory all exceeding a preset threshold. This indicates continuous deformation of the thread crest in that area, and is thus classified as continuous thread profile damage. This type of damage is often caused by crest wear leading to an increase in crest width, white spots shifting towards the root of the thread, or overall thread deformation causing a section of the trajectory to deviate from the standard position. The deviation of multiple consecutive white spots proves that the damage extends along the thread helix direction, rather than being an isolated localized problem.
[0053] The determination of local concavity in thread profile is as follows: if a single white dot exists in the actual trajectory, and its deviation from the standard trajectory exceeds a preset threshold, and there are no other high-grayscale points within a five-pixel radius of this white dot (i.e., no other reflective white dots), it indicates a local missing or concave area at the tooth crest, and is thus classified as a local concavity in the thread profile. The formation mechanism of this type of defect is that local impact or processing error causes a single tooth crest to become concave. The tooth crest at the concave location cannot form normal reflection, causing the white dot to deviate from the standard trajectory. Since there are no other white dots around it, the combination of a single deviation and the absence of surrounding white dots can accurately distinguish between local concavity and normal reflective fluctuations.
[0054] This invention also proposes an online visual inspection system for the entire appearance of automotive hexagonal head bolts, comprising: The bolt segmentation positioning module acquires bolt images through a camera and obtains the bolt head center coordinates, head tilt angle, and bolt shank offset angle as attitude fluctuation parameters based on the bolt images. The layered dynamic lighting module divides the bolt into several reflective sub-regions based on the segmented reflective characteristics of the bolt and constructs a reflective mapping model. It calculates the lighting control parameters by combining the target optical state of each sub-region with the attitude fluctuation parameters, and controls the dynamic adjustment of the LED array according to the lighting control parameters. It also evaluates the effect of each sub-region, calculates the deviation rate between the actual optical state and the target optical state, and adjusts the lighting control parameters when the deviation rate is greater than the threshold. The dynamic correction acquisition module acquires bolt images when the camera detects that the current bolt posture is within a preset threshold, and performs image correction based on the deviation between the bolt posture in the image to be tested and the standard bolt posture to obtain the image set to be tested. The defect detection module performs bolt head defect detection and bolt shank defect detection on the image under test and verifies it according to the clarity evaluation value of the corresponding sub-region. It stitches multiple frames of the image under test into a continuous thread trajectory, and performs thread segment defect detection based on the trajectory reflection breakpoints and reflection deviation points, and outputs the detection results.
[0055] The foregoing has illustrated and described the basic features, principles, and advantages of the present invention. It should be noted that the present invention is not limited to the above embodiments, but only to some embodiments. Any improvements and additions made without departing from the spirit and scope of the present invention are considered to be within the scope of protection of the present invention.
Claims
1. A method for online visual inspection of the entire appearance of automotive hexagonal head bolts, characterized in that, include: The bolt segmentation and positioning step involves acquiring bolt images using a camera, and obtaining the bolt head center coordinates, head tilt angle, and bolt shank offset angle as attitude fluctuation parameters based on the bolt images. The layered dynamic lighting step divides the bolt into several reflective sub-regions based on the segmented reflective characteristics of the bolt and constructs a reflective mapping model. The lighting control parameters are calculated by combining the target optical state of each sub-region with the attitude fluctuation parameters. The lighting control parameters are used to control the dynamic adjustment of the LED array. The effect of each sub-region is evaluated, and the deviation rate between the actual optical state and the target optical state is calculated. When the deviation rate is greater than the threshold, the lighting control parameters are adjusted. The dynamic correction acquisition step involves acquiring bolt images when the camera detects that the current bolt posture is within a preset threshold, and then performing image correction based on the deviation between the bolt posture in the image to be tested and the standard bolt posture to obtain the image set to be tested. The defect detection steps involve detecting defects in the bolt head and bolt shank of the image under test and verifying them based on the clarity evaluation value of the corresponding sub-region. Multiple frames of the image under test are stitched together to form a continuous thread trajectory. Based on the reflection breakpoints and reflection deviation points of the trajectory, thread segment defects are detected and the detection results are output.
2. The online visual inspection method for the entire appearance of automotive hexagonal head bolts according to claim 1, characterized in that, The bolt segment positioning step includes the following: the camera includes one head monitoring camera positioned directly above the glass turntable, and four rod monitoring cameras symmetrically positioned on the sides of the turntable. The head monitoring camera acquires an image of the bolt head and fits the hexagonal contour of the head to obtain the center coordinates and head tilt angle. The rod monitoring cameras extract the edge contours of the unthreaded area in the upper section and the threaded area in the lower section of the rod, respectively, obtain the rod axis through straight line fitting, and calculate the offset angle between the rod axis and the radius direction of the turntable.
3. The online visual inspection method for the entire appearance of automotive hexagonal head bolts according to claim 1, characterized in that, The layered dynamic lighting step includes dividing the bolt into several reflective sub-regions based on its segmented reflective characteristics, including a strong reflective sub-region at the head, a weak reflective sub-region at the head, a shank sub-region, and a threaded segment sub-region. By collecting data from each reflective sub-region and determining the target optical state of each sub-region based on its reflective characteristics, the strong reflective sub-region at the head is significantly affected by tilt and has a high reflective intensity in its target optical state; the reflective intensity decreases with increasing head tilt angle. The weak reflective sub-region at the head has less impact on clarity due to tilt, and its target optical state is characterized by a groove edge clarity greater than a preset threshold. The shank sub-region exhibits uniform reflectivity, and its target optical state has reduced reflective intensity; when the shank offset angle exceeds a preset threshold, the corresponding camera exposure is increased. The reflective trajectory of the threaded segment sub-region varies according to the head tilt angle and the shank tilt angle; when in the target optical state, the spiral reflective bandwidth is less than a preset threshold, and the trajectory is continuous without breaks.
4. The online visual inspection method for the entire appearance of automotive hexagonal head bolts according to claim 1, characterized in that, The layered dynamic lighting step also includes constructing a reflection mapping model. By collecting optical data of each sub-region under different posture parameters and different turntable rotation angles, the optical data includes reflection intensity, bandwidth, and sharpness. A basic database associated with lighting control parameters is established, which includes the combination of LED beads, brightness value, and illumination angle. Based on the reflection mapping model, the actual optical state of the sub-region is output according to the lighting control parameters, posture parameters, and turntable rotation angle.
5. The online visual inspection method for the entire appearance of automotive hexagonal head bolts according to claim 4, characterized in that, The layered dynamic lighting step further includes, during effect evaluation, calculating the deviation rate between the actual optical state and the target state of each sub-region, and calculating the total deviation rate through weight parameters. When the total deviation rate is greater than a preset threshold, a lighting evaluation value is calculated. If the lighting evaluation value is greater than the preset threshold, the sub-region deviation rate is verified. If the lighting evaluation value is less than the preset threshold, the reflection mapping model is adjusted and the lighting control parameters and actual optical state of each sub-region are recalculated. The sub-region deviation rate verification includes, when the sub-region deviation rate is greater than the corresponding preset threshold, backtracking the correspondence between the lighting control parameters and the target optical state of the sub-region under the current attitude and angle, updating the basic database and recalculating the lighting control parameters.
6. The online visual inspection method for the entire appearance of automotive hexagonal head bolts according to claim 1, characterized in that, The dynamic correction acquisition step includes: when the attitude monitoring camera compares the current attitude matrix with the allowable threshold in real time, it sends a trigger signal to each camera to synchronously acquire the corresponding field of view image. Conversely, images are acquired and marked as images to be corrected. Differential corrections are performed on images to be corrected for different parts. When correcting the head image, if the head tilt angle exceeds a preset threshold, the head image is rotated in the opposite direction. When correcting the pole image, if the pole offset angle is greater than a preset threshold, the pixel translation is calculated based on the offset angle difference, and the upper and lower pole images are compensated for translation to align the pole axis with the image center. When correcting the threaded section image, the image to be corrected is straightened to correct the tilted thread reflection trajectory into a horizontal straight line.
7. The online visual inspection method for the entire appearance of automotive hexagonal head bolts according to claim 1, characterized in that, In the defect detection step, bolt head detection includes, when detecting the top surface image of the head, identifying gray-level abrupt change areas through a gray-level gradient algorithm, and determining the head crack when the gray-level abrupt change value is greater than a preset threshold and the continuous pixels are greater than the preset value. When inspecting the side image of the head, the edge of the groove or flange surface is extracted using an edge detection algorithm, and the height of the edge protrusion is calculated. When the protrusion height is greater than a preset value and the continuous length is greater than a preset value, it is determined to be a groove burr. The bolt shank defect detection includes: when inspecting the upper section image of the shank, linear gray-level abnormal areas are extracted using a length and width recognition algorithm. When the length and width are greater than preset values, they are determined to be shank scratches. When inspecting the lower section image of the shank, the depth of the recessed area is calculated based on the gray-level value difference using a depth estimation algorithm. When the depth of the recessed area is greater than a preset value, it is determined to be shank recess.
8. The online visual inspection method for the entire appearance of automotive hexagonal head bolts according to claim 1, characterized in that, In the defect detection step, the clarity verification is based on the evaluation value of the weak reflective sub-region of the head in the layered dynamic lighting step. The measured clarity value of the weak reflective sub-region of the head in the image corresponding to the head defect detection is extracted. If the clarity is greater than the preset value, the defect detection result is directly confirmed to be valid. If the clarity is less than the preset value, adjacent head detection images are called to cross-verify the same suspected defect area and output the defect result.
9. The online visual inspection method for the entire appearance of automotive hexagonal head bolts according to claim 1, characterized in that, The defect detection step further includes, during the continuous thread trajectory splicing, firstly, extracting reflective white points from each frame of the corrected thread segment detection image. The reflective white points are pixels with grayscale values greater than a preset value. Record the axial coordinates and circumferential angle of each reflective white point. The axial coordinates are calculated based on the calibration relationship between image pixels and actual dimensions. Then, align the coordinates of the reflective white points of each frame along the center line of the thread helix according to the rotation angle of the turntable. Fill the gaps between reflective white points in adjacent frames through linear interpolation to form a complete thread helix trajectory diagram. If the spliced trajectory is continuous without breaks and the deviation of the white points from the preset standard thread trajectory is less than a preset threshold, it is determined to be without thread defects. If the trajectory has 3 or more consecutive white points with deviations from the standard trajectory greater than the preset threshold, it is determined to be continuous damage to the thread profile. If a single white point has a deviation from the standard trajectory greater than the preset threshold and there are no other high grayscale points within a 5-pixel range around it, it is determined to be a local depression in the thread profile.
10. An online visual inspection system for the entire appearance of automotive hexagonal head bolts, applicable to the online visual inspection method for the entire appearance of automotive hexagonal head bolts as described in any one of claims 1 to 9, characterized in that, include: The bolt segmentation positioning module acquires bolt images through a camera and obtains the bolt head center coordinates, head tilt angle, and bolt shank offset angle as attitude fluctuation parameters based on the bolt images. The layered dynamic lighting module divides the bolt into several reflective sub-regions based on the segmented reflective characteristics of the bolt and constructs a reflective mapping model. It calculates the lighting control parameters by combining the target optical state of each sub-region with the attitude fluctuation parameters, and controls the dynamic adjustment of the LED array according to the lighting control parameters. It also evaluates the effect of each sub-region, calculates the deviation rate between the actual optical state and the target optical state, and adjusts the lighting control parameters when the deviation rate is greater than the threshold. The dynamic correction acquisition module acquires bolt images when the camera detects that the current bolt posture is within a preset threshold, and performs image correction based on the deviation between the bolt posture in the image to be tested and the standard bolt posture to obtain the image set to be tested. The defect detection module performs bolt head defect detection and bolt shank defect detection on the image under test and verifies it according to the clarity evaluation value of the corresponding sub-region. It stitches multiple frames of the image under test into a continuous thread trajectory, and performs thread segment defect detection based on the trajectory reflection breakpoints and reflection deviation points, and outputs the detection results.