A method and system for crankshaft quality inspection based on image data

By establishing a correspondence between structural numbers and spatial coordinates, and binding the image acquisition center with the structural segment, the problem of inaccurate defect location mapping in existing crankshaft quality inspection methods was solved using symmetrical center lines and gray-scale difference matrices, achieving high-precision defect identification and location.

CN120807488BActive Publication Date: 2026-01-06YONGSHENG HEAVY IND CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511201017.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-08-26
Publication Date
2026-01-06
Estimated Expiration
2045-08-26

AI Technical Summary

Technical Problem

Existing crankshaft quality inspection methods based on image data are difficult to accurately map defect locations, and are prone to false boundaries or edge breaks in complex backgrounds, affecting the stability and accuracy of the inspection.

Method used

By establishing the correspondence between structural numbers and spatial coordinates, and combining the binding of image acquisition centers with structural segments, an image number archiving path table is constructed. Then, using the symmetric center line and gray-level difference matrix in the image matrix, crack boundaries are identified and mapped to actual structural locations.

Benefits of technology

It achieves efficient mapping between image content and structural regions, enhances data traceability, improves the accuracy and positioning precision of defect identification, reduces false detections and missed detections, and enhances the stability of detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120807488B_ABST
    Figure CN120807488B_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of defect detection, in particular to a crankshaft quality inspection method and system based on image data, comprising the following steps: extracting crankshaft coordinates to generate a numbered list, binding image centers to generate a list, attributing images to construct a path table, extracting gray scale differences to generate an array, identifying abnormal mapping structure positions, and outputting crack positioning information. In the present application, the corresponding relationship between structure numbers and spatial coordinates is established, and the image acquisition obtains a precise positioning basis. Combined with the extraction of imaging center points and image attribution binding, the mapping of image content and structure area is realized, the traceability of data archiving is enhanced, the gray value point pairs are extracted using the symmetric center line, the gray scale difference matrix is constructed, the symmetric disturbance is identified and the abnormal distribution is extracted, the crack offset positioning result is generated, the overall scheme realizes the image attribution and defect identification under the guidance of the structure, improves the detection accuracy and positioning accuracy, reduces the false detection rate, and enhances the stability and engineering adaptation ability.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of defect detection, in particular to a crankshaft quality inspection method and system based on image data. BACKGROUND

[0002] The technical field of defect detection involves identifying and analyzing abnormalities in the appearance or structure of products through various sensing means and algorithmic means. The core tasks include defect feature extraction, defect type identification, and positioning analysis. The overall technical field uses image acquisition, image preprocessing, feature extraction, and discriminant classification methods to identify and evaluate surface or structural defects of target objects such as industrial parts. Among them, the traditional image data-based crankshaft quality inspection method refers to acquiring crankshaft surface image data by deploying industrial cameras on the production line, using methods such as grayscale analysis, edge extraction, template matching, and target contour fitting to identify and judge defects such as scratches, cracks, and pits in the image. The Canny edge detection method is often used to identify defect boundaries, combined with Hough transform to identify linear features of cracks, or by comparing target contours with a pre-set template library to determine defect regions.

[0003] The existing method mainly relies on industrial cameras to acquire crankshaft surface images, combines image grayscale analysis, edge detection, and template matching to determine defects, and the processing method highly depends on the pixel features of the image itself, while ignoring the direct correlation between the image and the structural space position, resulting in difficulty in accurately mapping the defect recognition results to the actual area of the crankshaft physical structure. For example, if multiple feature points interfere in the same image, it is easy to misjudge the real position of the defect at the image level. Since there is no clear structural index for the image, the structural position where the defect occurs does not have a continuous reference basis, making it difficult to support subsequent structural quality tracing. Traditional Canny edge detection and Hough transform methods are sensitive to complex background interference, and in scenes with complex textures or uneven lighting, false boundaries or edge breaks may occur, affecting the integrity of defect region extraction. At the same time, the existing method does not have the ability to systematically quantify the symmetry disturbance of image grayscale, and continuous small disturbances such as cracks are difficult to form a stable recognition pattern, thereby affecting the extraction accuracy of defect continuous distribution, and may result in cracks being segmented into multiple regions or completely lost, reducing the stability of the overall detection system and the engineering value of actual application. SUMMARY

[0004] To solve the technical problems existing in the prior art, the present application provides a crankshaft quality inspection method based on image data, comprising the following steps:

[0005] To achieve the above purpose, the present application adopts the following technical scheme: a crankshaft quality inspection method based on image data, comprising the following steps:

[0006] S1: Read the spatial coordinate information of the crankshaft machining section, extract the structural boundary feature points based on the difference in the axial spacing of the nodes, number and mark them according to the node sequence, establish the correspondence between the structural number and the spatial position, and generate a list of structural number coordinates.

[0007] S2: Based on the structural spatial information provided in the structural number coordinate list, extract the corresponding starting position and imaging area boundary value during the image acquisition process, calculate the center point coordinates, establish the binding relationship between the image number and the acquisition center, and generate an image acquisition center list;

[0008] S3: Based on the corresponding data of the image acquisition location in the image acquisition center list and the structural segment location in the structural number coordinate list, determine the proximity between the image acquisition point and the structural segment, determine the segment number to which it belongs and embed it in the image storage path, construct the binding archive path between the image file and the structural segment, and generate the image number archive path table.

[0009] S4: Based on the successfully assigned image content in the image number archiving path table, locate the symmetrical center line of the main axis region in the image matrix, set the sampling interval to extract symmetrical gray value point pairs, sort out the gray value differences between point pairs and construct the corresponding position matrix to generate a structurally symmetrical gray value difference array.

[0010] As a further embodiment of the present invention, the structure number coordinate list includes node number, structure position, and spatial coordinates; the image acquisition center list includes image number, acquisition center point, and imaging boundary; the image number archiving path table includes image number, belonging segment number, and image storage path; and the structure symmetric gray-level difference array includes symmetric point gray-level values, gray-level difference matrix, and centerline position.

[0011] As a further aspect of the present invention, the specific steps of S1 are as follows:

[0012] S101: Read the spatial coordinates of the nodes in the crankshaft machining section, extract the Z-axis coordinates as the axial position reference, arrange them in the order of node number, calculate the Z-axis spacing between adjacent nodes, obtain all spacing values ​​in the node sequence, and obtain the axial spacing change value.

[0013] S102: Based on the axial spacing change value, filter the node positions where the difference between adjacent spacings is greater than the structural boundary threshold, determine whether the structural boundary condition is met, take the nodes that meet the requirements as structural feature points, extract the original number and spatial coordinates, and obtain the structural feature node sequence.

[0014] S103: Based on the numbering order and coordinate information in the sequence of structural feature nodes, establish the correspondence between structural numbers and coordinates, and generate a list of structural number coordinates.

[0015] As a further aspect of the present invention, the specific steps of S2 are as follows:

[0016] S201: Based on the number and corresponding coordinate information recorded in the structure number coordinate list, extract the three-dimensional coordinate values ​​associated with each group of structure numbers, obtain the coordinates of the image acquisition starting point and the boundary coordinates of the imaging area corresponding to the number, determine whether the coordinate boundary range is complete, and obtain the complete coordinate set of boundary information.

[0017] S202: Based on the starting point coordinates and boundary point coordinates corresponding to the structure number in the complete coordinate set of the boundary information, calculate the median of the three-dimensional coordinates along the axis, and use the axial median to form a three-dimensional coordinate form as the spatial reference point of the structure number image acquisition position to generate the image acquisition center coordinate sequence.

[0018] S203: Call the correspondence between the structure number and the acquisition center in the image acquisition center coordinate sequence, extract the image acquisition number and acquisition center coordinate value, arrange and combine the corresponding data items according to the structure number order, and establish an image acquisition center list.

[0019] As a further aspect of the present invention, the specific steps of S3 are as follows:

[0020] S301: Based on the location data in the image acquisition center list and the structure number coordinate list, extract the three-dimensional distance between the image acquisition point and the structure segment, filter out the structure segments that exceed the belonging determination range, and obtain the shortest spatial distance value between the image acquisition point and the structure segment.

[0021] S302: Based on the shortest spatial distance between the image acquisition point and the structural segment, determine the structural segment number to which the image acquisition point belongs, combine the image number and the belonging number, and generate a list of structural segment identifiers to which the image number belongs.

[0022] S303: Call the combined data in the image number belonging to the structure segment identifier list, extract the structure segment number as the archive directory name, embed the image file path, and establish the image number archive path table.

[0023] As a further aspect of the present invention, the specific steps of S4 are as follows:

[0024] S401: Based on the successfully assigned image content in the image number archiving path table, extract the grayscale distribution features of the main axis region in the image matrix, detect the difference in the symmetry of pixel columns, and obtain the position value of the image main axis symmetry center line.

[0025] S402: Call the position value of the image's main axis symmetry center line, set the spacing to extract gray value point pairs on both sides, calculate the gray value difference between point pairs, and generate a gray value difference point pair matrix;

[0026] S403: Based on the position of the point pairs and the gray difference value recorded in the gray value difference point pair matrix, construct a gray difference mapping array under the image matrix size and establish a structurally symmetrical gray difference array.

[0027] As a further aspect of the present invention, the method further includes:

[0028] S5: Based on the gray-level difference distribution constructed in the symmetrical gray-level difference array of the structure, identify continuous abnormal regions in the sequence, make a consistency judgment on the direction of gray-level change, extract the boundary coordinates corresponding to the region, and combine the image attribution information to map to the actual position range of the structural segment to generate a crack location offset information set.

[0029] The crack location offset information set includes the boundary of the abnormal region, the direction of grayscale change, and the mapping position of the structural segment.

[0030] As a further aspect of the present invention, the specific steps of S5 are as follows:

[0031] S501: Based on the gray-level difference distribution constructed in the symmetrical gray-level difference array, detect the continuously changing gray-level difference segments, identify the sequence segments that exceed the gray-level stability threshold range, and obtain the coordinate value set of the gray-level abnormal distribution interval.

[0032] S502: Call the set of coordinate values ​​of the gray-level abnormal distribution interval, determine the consistency of adjacent gray-level difference directions within the interval, filter the boundary coordinates of continuous directions, and obtain the boundary coordinates of the stable section of gray-level difference direction.

[0033] S503: Based on the boundary coordinates of the stable section of grayscale difference direction and the image number attribution information, map the boundary coordinates to the structural section position range to generate a crack location offset information set.

[0034] The continuous abnormal region is a segment in the gray-level difference matrix in which the gray-level difference of multiple adjacent sampling points exceeds a set threshold, and the distribution is continuous and has a consistent direction.

[0035] The consistency judgment is to perform a continuous filtering operation on the direction of gray-scale change, and judge the consistency of adjacent gray-scale difference directions. When the gray-scale difference signs of 5 consecutive sampling points are consistent, or no more than 1 point has a sign reversal, and the gray-scale difference direction change of adjacent points is less than ±10%, it is determined that the direction is consistent and is used as the boundary coordinate of the direction continuity.

[0036] The boundary coordinates are the start and end positions of the identified crack trend area in the image, and the offset position in the structural segment can be located through coordinate mapping.

[0037] The actual location range of the structural segment is the spatial distribution limit of the structural segment within the axial range, which can be defined by the start and end coordinates of each segment in the structural number coordinate list.

[0038] As a further aspect of the present invention, the spatial coordinate information refers to the position information of the crankshaft machining section structural nodes in the X, Y, and Z directions in three-dimensional coordinates, with the Z-axis value along the machining axis direction being preferred as the structural section division benchmark.

[0039] The spacing difference is quantified by the difference in the position change of continuous nodes in the Z-axis direction, and the judgment criteria need to be combined with the typical segment spacing range in the crankshaft machining process.

[0040] The structure number is an identification code automatically generated by the system, which is assigned sequentially according to the structure segments and is not repeatable.

[0041] The boundary value of the imaging area is the coordinate value of the end point of the image acquisition range in the Z-axis direction, which is determined by the limit position of the field of view of the imaging sensor, and together with the starting position, it constitutes a measurable imaging coverage area.

[0042] The center point coordinates are the intermediate coordinate values ​​between the starting position and the boundary position of the imaging area, and are used to indicate the acquisition center position of the image in the crankshaft structure.

[0043] The degree of proximity is determined by calculating the absolute distance or Euclidean distance between the center coordinates of the image and the center coordinates of the structural segment, and setting a predetermined distance threshold to determine the attribution relationship.

[0044] The image content that is successfully assigned is when the distance between the coordinates of the image acquisition center and the coordinates of the structure segment center is less than a set threshold condition, the image is assigned to the structure segment number and bound to the database.

[0045] The symmetry center line of the main axis region is the geometric center line in the horizontal direction of the image matrix, which corresponds to the visual symmetry benchmark of the crankshaft in the image;

[0046] The sampling interval is the distance between adjacent grayscale point pairs in the image coordinate system, and can be set to a fixed pixel value;

[0047] The grayscale difference is the absolute difference in grayscale values ​​between symmetrical pixels.

[0048] A crankshaft quality inspection system based on image data includes:

[0049] The structural number identification module obtains the spatial coordinate values ​​of the crankshaft nodes, continuously compares the distance between adjacent nodes in the axial direction with the set jump threshold, marks the position points where the difference is greater than the threshold as structural boundary points, and binds the spatial coordinates in axial order to generate a structural number coordinate list.

[0050] The image center extraction module extracts the starting and boundary coordinates of each structure segment based on the structural spatial information in the structural number coordinate list, calculates the boundary median to determine the image imaging center position, binds the image number to the center position, and generates an image acquisition center list.

[0051] The image archiving construction module calculates the spatial distance based on the image coordinate points in the image acquisition center list and the structural segment position coordinates in the structural number coordinate list to determine the structural segment number to which the image belongs, embeds the number information into the image path field, and generates an image number archiving path table.

[0052] The symmetric difference array construction module extracts the image matrix and identifies the gray-level distribution of the main axis region based on the image files in the image number archive path table. After locating the horizontal symmetric center line, it sets a step size on both sides to sample and obtain gray-level point pairs. It calculates the gray-level difference of each group and organizes them into a point difference relationship matrix to generate a structurally symmetric gray-level difference array.

[0053] The crack offset localization module filters point pairs with gray-level differences greater than a threshold in a continuous region based on the gray-level change sequence in the symmetrical gray-level difference array of the structure. After determining the consistency of the gray-level change direction, it extracts the coordinates of the boundary points and maps them to the structural coordinate interval through the image number archive path table to generate a crack localization offset information set.

[0054] Compared with the prior art, the advantages and positive effects of the present invention are as follows:

[0055] In this invention, by establishing a correspondence between structural numbers and spatial coordinates, a precise positioning foundation is obtained during the image acquisition stage. Combined with the extraction of the imaging center point and the binding of the image's assigned segment number, efficient mapping between image content and structural regions is achieved, enhancing the traceability of data archiving. Gray-scale point pairs are extracted using the symmetrical center line in the image to construct a gray-scale difference matrix, effectively identifying symmetrical disturbances and forming a gray-scale difference array. Crack boundaries are identified through abnormal distribution and directional consistency, and further mapped to the actual structural location range to generate accurate crack offset positioning results. The overall scheme realizes the defect identification logic driven by image assignment under the structure and gray-scale difference sequence, improving detection accuracy and positioning precision, significantly reducing false detections and missed detections, and enhancing stability and engineering adaptability in practical applications. Attached Figure Description

[0056] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0057] Figure 1This is a schematic diagram of the steps of the present invention;

[0058] Figure 2 This is a detailed schematic diagram of S1 of the present invention;

[0059] Figure 3 This is a detailed schematic diagram of S2 of the present invention;

[0060] Figure 4 This is a detailed schematic diagram of S3 of the present invention;

[0061] Figure 5 This is a detailed schematic diagram of S4 of the present invention;

[0062] Figure 6 This is a detailed schematic diagram of S5 of the present invention;

[0063] Figure 7 This is a system module diagram of the present invention. Detailed Implementation

[0064] The technical solution of the present invention will now be described with reference to the accompanying drawings.

[0065] In embodiments of the present invention, words such as "exemplarily," "for example," etc., are used to indicate that something is an example, illustration, or description. Any embodiment or design described as "exemplary" in the present invention should not be construed as being more preferred or advantageous than other embodiments or designs. Specifically, the use of the word "exemplary" is intended to present the concept in a concrete manner. Furthermore, in embodiments of the present invention, the meaning expressed by "and / or" can be both, or either one.

[0066] In the embodiments of this invention, the terms "image" and "picture" may sometimes be used interchangeably. It should be noted that, without emphasizing the distinction between them, they convey the same meaning. Similarly, the terms "of," "corresponding (relevant)," and "corresponding" may sometimes be used interchangeably. It should be noted that, without emphasizing the distinction between them, they convey the same meaning.

[0067] In this embodiment of the invention, sometimes a subscript such as W1 may be written in a non-subscript form such as W1. When the difference is not emphasized, the meaning they express is the same.

[0068] To make the technical problems, technical solutions and advantages of the present invention clearer, a detailed description will be given below in conjunction with the accompanying drawings and specific embodiments.

[0069] Please see Figure 1 This invention provides a crankshaft quality inspection method based on image data, comprising the following steps:

[0070] S1: Read the spatial coordinate information of the crankshaft machining section, extract the location points with structural boundary characteristics based on the difference in the spacing of the nodes in the axial direction, number and mark them according to the node sequence, establish the correspondence between the structural number and the spatial position, and generate a list of structural number coordinates.

[0071] Spatial coordinate information refers to the position information of the structural nodes of the crankshaft machining section in the X, Y, and Z directions in a three-dimensional coordinate system (Cartesian coordinate system). The Z-axis value along the machining axis is preferred as the basis for dividing the structural section.

[0072] The spacing difference is quantified by the difference in the positional change of continuous nodes in the Z-axis direction. The judgment criteria need to be combined with the typical spacing range in the crankshaft machining process.

[0073] The structure number is an identification code automatically generated by the system, which is assigned sequentially according to the structure segments and is not repeatable.

[0074] To ensure consistency of coordinate data collected by different measuring devices (laser scanning, machine tool probes, or 3D coordinate instruments), the unification of multi-source coordinate data is achieved through coordinate normalization and registration with the reference coordinate system. First, the coordinate data is transformed to the same Cartesian coordinate system, and then rigid body transformation (including translation, rotation, and scaling) is used to align the data to the crankshaft machining reference axis. System errors can be reduced by using the least squares fitting method, thereby ensuring that the correspondence between structure number and spatial coordinates remains consistent across different data sources.

[0075] S2: Based on the structural spatial information provided in the structural number coordinate list, extract the corresponding starting position and imaging area boundary value during the image acquisition process, calculate the center point coordinates, establish the binding relationship between the image number and the acquisition center, and generate an image acquisition center list.

[0076] The boundary value of the imaging region is the coordinate value of the end point of the image acquisition range in the Z-axis direction. It is determined by the limit position of the field of view of the imaging sensor and together with the starting position, it constitutes a measurable imaging coverage area.

[0077] The center point coordinates are the intermediate coordinates between the starting position and the boundary position of the imaging area, used to indicate the acquisition center position of the image in the crankshaft structure;

[0078] To accurately map image grayscale information to crankshaft structure positions, a mapping relationship between image pixels and spatial coordinates can be established. First, the starting point coordinates and boundary point coordinates of the imaging region are mapped to the row and column boundaries of the image matrix, respectively, forming a one-to-one correspondence between spatial range and pixel range. Then, linear interpolation is used to map each pixel in the image matrix... Converting a two-dimensional position to a three-dimensional point in a spatial coordinate system Its conversion formula can be expressed as:

[0079] ;

[0080] in, The coordinates of the starting point of the imaging region. The corresponding pixel interval in the spatial direction. Here, represents the axial coordinates of the imaging center. Through this mapping method, each pixel grayscale value in the image matrix can be correlated with the actual spatial position of the crankshaft surface.

[0081] S3: Based on the corresponding data of image acquisition locations in the image acquisition center list and structure segment locations in the structure number coordinate list, determine the proximity between the image acquisition point and the structure segment, determine the assigned segment number and embed it in the image storage path, construct the binding archive path between the image file and the structure segment, and generate the image number archive path table.

[0082] The degree of proximity is determined by calculating the absolute or Euclidean distance between the center coordinates of the image and the center coordinates of the structural segment, and setting a predetermined distance threshold to determine the attribution relationship;

[0083] S4: Based on the successfully assigned image content in the image number archiving path table, locate the symmetrical center line of the main axis region in the image matrix, set the sampling interval to extract symmetrical gray value point pairs, sort out the gray value difference between the point pairs and construct the corresponding position matrix to generate a structurally symmetrical gray value difference array.

[0084] When the distance between the image acquisition center coordinates and the structure segment center coordinates is less than a set threshold, the image is assigned to the structure segment number and bound to the database.

[0085] The center line of symmetry of the main axis region is the geometric center line in the horizontal direction of the image matrix, which corresponds to the visual symmetry benchmark of the crankshaft in the image;

[0086] The sampling interval is the distance between adjacent grayscale point pairs in the image coordinate system, and can be set to a fixed pixel value;

[0087] Gray-level difference is the absolute difference in gray-level values ​​between symmetrical pixels;

[0088] S5: Based on the gray-level difference distribution constructed in the structurally symmetrical gray-level difference array, continuous abnormal regions are identified in the sequence, the consistency of gray-level change direction is judged, the boundary coordinates corresponding to the region are extracted, and combined with the image attribution information, they are mapped to the actual position range of the structural segment to generate a crack location offset information set.

[0089] A continuous abnormal region is a segment in the gray-level difference matrix in which the gray-level difference of multiple adjacent sampling points exceeds a set threshold, and the distribution is continuous and has a consistent direction.

[0090] Consistency judgment involves performing a continuous filtering operation on the direction of grayscale changes, that is, judging whether the positive and negative signs of the grayscale difference changes remain consistent within a certain range;

[0091] The boundary coordinates represent the start and end positions of the identified crack trend area in the image. The offset position in the structural segment can be located through coordinate mapping.

[0092] The actual location range of a structural segment is the spatial distribution limit of the structural segment within the axial range, which can be defined by the start and end coordinates of each segment in the structural number coordinate list.

[0093] The structure number coordinate list includes node number, structure location, and spatial coordinates; the image acquisition center list includes image number, acquisition center point, and imaging boundary; the image number archiving path table includes image number, segment number, and image storage path; the structure symmetric gray-level difference array includes symmetric point gray-level values, gray-level difference matrix, and centerline location; and the crack location offset information set includes abnormal area boundary, gray-level change direction, and structure segment mapping location.

[0094] Please see Figure 2 The specific steps of S1 are as follows:

[0095] S101: Read the spatial coordinates of the nodes in the crankshaft machining section, extract the Z-axis coordinates as the axial position reference, arrange them in the order of node number, calculate the Z-axis spacing between adjacent nodes, obtain all spacing values ​​in the node sequence, and obtain the axial spacing change value.

[0096] When reading the spatial coordinates of nodes in the crankshaft machining section, a coordinate measurement system attached to the machine tool is used to complete the three-dimensional coordinate acquisition. A trigger probe is used to sequentially contact the node surface to obtain the coordinate information of each position. The value in the Z-axis direction is extracted as the axial position reference. The node numbers are arranged sequentially according to the crankshaft design order, starting from the first node, forming a Z-axis coordinate sequence arranged in numerical order. In this sequence, the distance between two adjacent nodes is obtained by subtracting the next coordinate from the previous one. This process is repeated to obtain all distance values. For example, the Z-axis coordinates of the first to fifth nodes are 10. At values ​​of 00, 18.25, 26.35, 35.80, and 45.10, the distance between the first and second nodes is 8.25, between the second and third is 8.10, between the third and fourth is 9.45, and between the fourth and fifth is 9.30. Further comparison of these distance differences yields the change between each pair of adjacent distances. For example, the difference between 8.10 and 8.25 is -0.15, the difference between 9.45 and 8.10 is 1.35, and the difference between 9.30 and 9.45 is -0.15. These changes are recorded as a distance change sequence, which can be used in subsequent analyses to identify the trend and significance of structural changes between nodes.

[0097] S102: Based on the axial spacing variation value, filter the node positions where the difference between adjacent spacings is greater than the structural boundary threshold, determine whether the structural boundary conditions are met, take the nodes that meet the requirements as structural feature points, extract the original number and spatial coordinates, and obtain the structural feature node sequence.

[0098] When analyzing the axial spacing variation sequence, a reference value for structural boundaries needs to be set as the basis for judgment. This reference value can be set according to crankshaft design data and processing standards, for example, set to 1.00, indicating that when the variation of adjacent spacing exceeds this value, it is considered a possible structural boundary point. All variation values ​​are compared one by one. If a certain variation value is 1.35, it exceeds the reference value, indicating that there is a structural change at that point. The node number corresponding to the variation value is extracted, such as the 3rd node. At the same time, its spatial coordinate information is extracted and the number and coordinates are recorded. This filtering process is automatically completed using a data loop method. Starting from the 1st variation value, it is judged whether its absolute value exceeds the reference value. If it meets the condition, the next node is recorded as a feature node. Let the 3rd, 6th, and 9th nodes among all variations meet the condition. Their numbers and three-dimensional coordinate information are read respectively. The node order remains unchanged, and finally a structural feature node sequence is formed, which contains the node number and the corresponding spatial position data, for subsequent modeling or structural classification.

[0099] S103: Based on the numbering order and coordinate information in the structural feature node sequence, establish the correspondence between structural numbers and coordinates, and generate a list of structural number coordinates;

[0100] The identified structural feature nodes are numbered sequentially and associated with their coordinate information to create a list of structural numbers. Each structural number corresponds to an original node number and its three-dimensional coordinates. For example, structural number S1 corresponds to node 3 with coordinates of 35.2, 18.1, and 26.35; S2 corresponds to node 6 with coordinates of 47.0, 20.0, and 38.0; and S3 corresponds to node 9 with coordinates of 59.5, 19.2, and 51.0. All data records are arranged sequentially with the number as the index for easy retrieval and identification later. During the generation process, the program traverses all structural nodes, extracts the corresponding coordinates one by one, and organizes them into a data set. Each number is labeled with its location and data source in the overall structure, thus forming a complete list of structural numbers and their corresponding coordinates.

[0101] Please see Figure 3 The specific steps of S2 are as follows:

[0102] S201: Based on the number and corresponding coordinate information recorded in the structure number coordinate list, extract the three-dimensional coordinate values ​​associated with each group of structure numbers, obtain the coordinates of the image acquisition start point and the boundary coordinates of the imaging area corresponding to the number, determine whether the coordinate boundary range is complete, and obtain the complete coordinate set of boundary information.

[0103] The structure number coordinate list records the number and 3D coordinate information. The list must first be parsed, matching each number with its corresponding x, y, and z 3D coordinate values. For example, the coordinates for number S001 are 120.5, 210.3, and 15.2. All structure numbers are extracted sequentially, and all associated coordinate values ​​are iterated to determine the starting coordinates for image acquisition for each group of numbers. Generally, the first time point or the first point in the number sequence is taken as the starting coordinates. Simultaneously, the minimum and maximum values ​​of the x, y, and z axes for all coordinate points of that number are calculated to obtain the imaging boundary coordinate range. For example, the x-axis coordinate range for number S001 is 120.5 to 122.8, and the y-axis is 210. The x-axis ranges from 3 to 213.6, and the z-axis ranges from 15.2 to 18.9. Therefore, the boundary range is 120.5 to 122.8 for the x-axis, 210.3 to 213.6 for the y-axis, and 15.2 to 18.9 for the z-axis. To determine if the boundary range is complete, it is necessary to check whether each axis has a valid span. If the span is lower than the set threshold, for example, if the boundary length is less than 0.2m, then the data in that direction is considered missing. During processing, it is necessary to check whether the difference between the z-axis values ​​is too small. If it is found that the difference between the minimum and maximum z-axis values ​​is only 0.05m, then the boundary information of the structure number can be considered incomplete and will be removed. Finally, only the set of structure numbers that have valid coordinate differences in the x, y, and z axes will be retained, and the complete boundary information coordinate set will be output.

[0104] S202: Based on the starting point coordinates and boundary point coordinates corresponding to the structure number in the complete coordinate set of boundary information, calculate the median of the three-dimensional coordinates along the axis, and use the axial median to form a three-dimensional coordinate form as the spatial reference point of the image acquisition position of the structure number, and generate the image acquisition center coordinate sequence.

[0105] From the acquired complete boundary information, the coordinates of the starting point and boundary points are extracted for each structure number. The median values ​​of the coordinates along the x, y, and z axes are then calculated. The method of value selection is determined by the odd or even number of coordinates: for an odd number, the median is taken; for an even number, the average of the two median values ​​is taken. For example, for structure number S001, the x-axis coordinates are 120.5, 121.1, 122.8, with a median of 121.1; the y-axis coordinates are 210.3, 211.8, 213.6, 214.0, with a median of 212.7 (the average between 211.8 and 213.6); and the z-axis values... For example, if the values ​​are 15.2, 16.3, 17.0, and 18.9, the median is the average of 16.65 between 16.3 and 17.0. These three medians are used as the image acquisition center point for that structure number, i.e., the spatial reference point for the acquisition location of that structure number. If a coordinate point associated with a certain number has abnormal drift and its distance from other points exceeds 5m, that point will be excluded from the median calculation to avoid affecting the accuracy of the center value. The above process is repeated for all structure numbers, and finally a list of combinations of structure numbers and center coordinates is formed. Each group contains the number and the corresponding three-axis median, forming a sequence of image acquisition center coordinates.

[0106] S203: Call the correspondence between the structure number and the acquisition center in the image acquisition center coordinate sequence, extract the image acquisition number and acquisition center coordinate value, arrange and combine the corresponding data items according to the structure number order, and establish an image acquisition center list;

[0107] The aforementioned image acquisition center coordinate sequence is invoked to establish a correspondence between structure numbers and center coordinates. After reading the sequence data items, image acquisition numbers are matched for each group of structure numbers. The numbering rules can be based on direct mapping of structure numbers or sequential generation, such as A001, A002, etc., to ensure uniqueness. The acquisition numbers and center coordinates are then combined to form a record item. For example, A001 corresponds to center coordinates 121.1, 212.7, 16.65. The structure numbers are sorted in lexicographical order, for example, S001 is sorted before S002. After sorting, all record items are combined to form an acquisition center list. Each item contains an image acquisition number and its corresponding three-dimensional spatial coordinates. The list content can be uniformly represented as a number plus the three-axis coordinate values ​​in parentheses, such as S001(121.1, 212.7, 16.65), S002(...), etc., forming an ordered list of image acquisition center coordinates for subsequent mapping and scheduling.

[0108] Please see Figure 4The specific steps of S3 are as follows:

[0109] S301: Based on the location data in the image acquisition center list and the structure number coordinate list, extract the three-dimensional distance between the image acquisition point and the structure segment, filter out the structure segments that exceed the belonging determination range, and obtain the shortest spatial distance value between the image acquisition point and the structure segment.

[0110] The specific calculation formula for filtering out structural segments that exceed the attribution determination range is as follows:

[0111] ;

[0112] Calculate the three-dimensional difference weight index Extract the three-dimensional distance between the image acquisition point and the structural segment, and obtain the shortest spatial distance value between the image acquisition point and the structural segment;

[0113] in, Represents image acquisition points With structural segment The three-dimensional difference weighting index between them , , Representing image acquisition points Position data on the X, Y, and Z three-dimensional coordinate axes. , , Representing structural segments Position data on the X, Y, and Z three-dimensional coordinate axes. , , Representing structural segments ( arrive Position data on the X, Y, Z three-dimensional coordinate axes. Representative and image acquisition point The total number of all related structural segments, Represents all structural segments The average value of the axis coordinates;

[0114] Let the image acquisition point be set The three-dimensional coordinate data was collected by an industrial camera system carried by a robotic arm, while the three-dimensional coordinates of the structural segments were acquired by a laser point cloud scanning measuring instrument. During the measurement process, each data point underwent millimeter-level RTK positioning and differential calibration, with the spatial coordinate accuracy controlled within ±1cm.

[0115] Image acquisition points The spatial coordinates are:

[0116] ;

[0117] structural segment The spatial coordinates are:

[0118] ;

[0119] Structural segment set It contains 4 structural segments, which have been registered using a 3D modeling platform. The coordinate data is as follows (all units are meters):

[0120] structural segment : ;

[0121] structural segment : ;

[0122] structural segment : ;

[0123] structural segment : ;

[0124] structural segment z-axis coordinate The average z-axis value of the four structural segments is 9.12m. Calculated by taking the average:

[0125] ;

[0126] Calculate 3D Euclidean distance :

[0127] ;

[0128] Calculate the average distance :

[0129] ;

[0130] ;

[0131] ;

[0132] ;

[0133] The average value is:

[0134] ;

[0135] Find the difference and take its absolute value:

[0136] ;

[0137] In addition to the vertical height difference:

[0138] ;

[0139] Substitute into the formula:

[0140] ;

[0141] This result indicates the image acquisition point With structural segment The relative difference between them in three-dimensional space is 1.3958 meters, and the difference value is... The larger the value, the more structural segments it represents. Spatial attribution and collection point The lower the correlation, the more likely it is to be excluded in the subsequent attribution screening. Structural segments exceeding the statistical tolerance. This result serves as the calculation output parameter for step 3, and is a preliminary criterion for calculating the image-structure shortest spatial distance;

[0142] The formula's calculation logic is based on a weighted fusion of spatial geometric relationships and height offset. First, it calculates the actual spatial distance between the image acquisition point and the target structural segment using three-dimensional Euclidean distance to quantify their absolute positional difference in the three-dimensional coordinate system. Second, it introduces the average spatial distance from the image acquisition point to all other structural segments as a baseline spatial adjacency scale. The absolute value of the difference reflects the degree of local offset of the target structural segment relative to the overall structural environment; this difference, as the first sub-term, reflects the abrupt change in the relative position of the target structural segment in terms of spatial proximity. Furthermore, it introduces the structural segment's... The difference between the z-axis height coordinate and the average z-axis height of all structural segments is used to reflect the vertical deviation of the structural segment in the vertical direction. Instead of taking the square root, this item is superimposed on the spatial difference item with the original absolute value of the offset to form a spatial-height fusion weight index. Finally, a unified evaluation framework is constructed by addition, thereby realizing the expression of the comprehensive spatial fit between the image acquisition point and the structural segment. The entire formula integrates two types of feature information, namely spatial distribution dispersion and height change, through addition. The square root operation is derived from the standard geometric model of three-dimensional distance calculation. The absolute value operation ensures that the evaluation quantity is non-negative, and has stability and comparability.

[0143] The three-dimensional difference weight index is used to measure the degree of inconsistency in the spatial positional relationship between image acquisition points and structural segments. It comprehensively reflects the distance offset and height abrupt changes in the three-dimensional coordinate system. This index not only considers the direct three-dimensional spatial distance between the image acquisition point and the target structural segment, but also compares this distance with the overall average distance from the image acquisition point to the other structural segments to identify whether there is an abnormal deviation in the position of the target structural segment. At the same time, it introduces the height difference of the structural segment in the vertical coordinate direction to further capture the height stratification effect that may affect the structural attribution judgment. The larger the index value, the more significant the difference between the target structural segment and the image acquisition point in terms of positional distribution and height construction. Therefore, it can be used to screen out low-correlation structural segments and improve the accuracy and robustness of the image-structure mapping relationship.

[0144] S302: Based on the shortest spatial distance between the image acquisition point and the structural segment, determine the structural segment number to which the image acquisition point belongs, combine the image number and the belonging number, and generate a list of structural segment identifiers to which the image number belongs.

[0145] First, the distance records for each image point are grouped. For each group of image data, the structural segment number corresponding to the smallest distance is selected as the belonging segment number. For example, if the distance between image number IMG_021 and multiple structural segments is 1.5m, 0.7m, and 2.3m, then the belonging structural segment is the segment number corresponding to 0.7m, such as SD_03. Then, the image number and this segment number are combined to form the image belonging identifier. This can be done by adding an underscore to the structural segment number, such as IMG_021_SD_03. All image acquisition points are processed in sequence to obtain a list of belonging identifiers, such as IMG_022_SD_05, IMG_023_SD_02, etc. The belonging identifier list can be generated by combining fields using data processing tools such as pandas' field merging function or string concatenation function. Finally, a complete image number belonging structural segment identifier dataset is formed, which serves as the basic data for archiving management or path generation.

[0146] S303: Call the combined data in the image number belonging to the structural segment identifier list, extract the structural segment number as the archive directory name, embed the image file path, and establish the image number archive path table;

[0147] The process involves calling the image ID's associated structural segment identifier list. First, the structural segment ID in each identifier combination is parsed. For example, SD_06 is extracted from IMG_034_SD_06 as the archive directory name. Then, based on the original image storage path, such as " / project / images / IMG_034.jpg", a new archive path is constructed by inserting the structural segment directory field, resulting in the format " / project / archive / SD_06 / IMG_034.jpg". This path is implemented using path concatenation methods in file management tools, such as Python's os module or path object processing functions. All image IDs are processed in this way to build an image archive path table. The table records the correspondence between image IDs and their corresponding archive paths. For example, the archive path for IMG_035 is " / project / archive / SD_02 / IMG_035.jpg". By combining these elements one by one, a complete dataset of image ID archive paths is obtained, which is used for the directory organization and file archive index management of image data.

[0148] Please see Figure 5 The specific steps of S4 are as follows:

[0149] S401: Based on the successfully assigned image content in the image number archiving path table, extract the grayscale distribution features of the main axis region in the image matrix, detect the difference in pixel column symmetry, and obtain the position value of the image main axis symmetry center line.

[0150] In the image number archiving path table, successfully assigned image entries are filtered. This can be done by establishing an index structure, using the image number as the primary key, traversing its assignment status field, selecting successfully marked image paths, and loading them into the corresponding image matrix for grayscale feature extraction of the main axis region. The image main axis is the center line position where the grayscale distribution exhibits symmetry. The initial processing steps are to divide the image into columns, average the grayscale values ​​of pixels in each column to generate column grayscale vectors, and then symmetrically compare the differences in grayscale values ​​of each column from the center of the matrix outwards. Each comparison is performed and the difference is calculated to find the point with the smallest global difference as the candidate main axis column position. In the case of an actual image size of 640×480, if the grayscale difference of the center column 320 is the smallest after comparison with the symmetrical column, it is initially identified as the main axis. Further, by using a sliding window to take several columns above and below it for local statistics, the stability of the grayscale difference between these columns and its symmetrical column is compared. If a certain column maintains a small difference value in multiple neighboring rows, it can be marked as the final symmetrical center line of the main axis. Assuming the grayscale value ranges from 0 to 255, the criterion is to select values ​​with a symmetry difference of less than 10. When a column meets this condition in most rows, the column is determined as the position of the center line of the main axis of symmetry.

[0151] S402: Call the position value of the image's main axis symmetry center line, set the spacing to extract gray value point pairs on both sides, calculate the gray value difference between point pairs, and generate a matrix of gray value difference point pairs;

[0152] The specific calculation formula for extracting grayscale point pairs on both sides by setting the spacing is as follows:

[0153] ;

[0154] Calculate the matrix of points with grayscale value differences;

[0155] in, Representing the image number Line 1 The column is configured with symmetrically spaced grayscale point pairs and their grayscale difference feature values. Representing the image number Line 1 The grayscale values ​​of the column pixels, Representing the image number The rows are symmetrical with respect to the principal axis of the image. Column pixel grayscale values, Representing the image number The number of all symmetrical grayscale point pairs extracted under the set row spacing. The index number representing the symmetrical grayscale point pair. Representing the image number Average gray value of symmetrical grayscale point pairs at all set spacings. This represents a very small positive real constant set to prevent the denominator from being zero;

[0156] The images are from a Canon EOS 90D camera, captured at a resolution of 6000×4000 pixels. Grayscale preprocessing was performed using the ITU-R BT.601 standard.

[0157] ;

[0158] Image sampling point behavior Line, set the spacing range as The column extracts a total of symmetrical grayscale point pairs. Group. The principal axis symmetry reference line is set at the center column of the image. .

[0159] Selected point pair column number is Then its symmetrical point column number is The original grayscale values ​​captured in the image are as follows (converted after being acquired via a CMOS sensor):

[0160] ;

[0161] ;

[0162] The grayscale values ​​of the remaining symmetrical point pairs are:

[0163] , ;

[0164] , ;

[0165] , (Axis of symmetry);

[0166] , ;

[0167] , ;

[0168] Calculate each parameter:

[0169] Symmetric points relative to the mean ;

[0170] calculate (The average value of the point pairs extracted from row 1200 of the image):

[0171] ;

[0172] Calculate the square root of variance term:

[0173] ;

[0174] Normalized difference term:

[0175] Gray difference Normalized denominator Normalized value:

[0176] ;

[0177] Substitute into the overall formula:

[0178] ;

[0179] This result indicates that: This represents the comprehensive grayscale difference feature value between the pixel in row 1200 and column 3003 of the image and its symmetrical point in column 2997 under the set grayscale calculation structure. This value aggregates three structures: average grayscale offset, variance distribution, and normalized difference ratio, and serves as an input value in the grayscale difference point pair matrix for subsequent structure judgment steps. The higher this feature value, the greater the deviation of the grayscale structure distribution of the image on the symmetrical pair.

[0180] The formula's operational logic is based on the gray-level contrast features in the image's principal axis symmetry structure. It uses a three-term structure to measure the combined gray-level difference: the first term calculates the average gray-level value of the point pair, reflecting its overall brightness level and serving as a basic symmetry reference; the second term squares the mean deviation of all extracted symmetrical point pairs, takes the square root of the mean, and forms the square root of the variance to measure the dispersion of the local symmetrical gray-level structure in the current row, reflecting its deviation from the overall gray-level pattern; the final term is the normalized result of dividing the absolute value of the gray-level difference between the symmetrical points by the sum of their gray levels plus a small constant, describing the local intensity difference of the point pair and dynamically normalizing it to eliminate the influence of brightness dominance. These three parts represent the overall gray-level center, local variance fluctuation, and single-pair difference intensity, respectively, and are combined additively to form the final gray-level difference feature value. The overall absolute value ensures output direction independence, enhancing feature consistency and stability.

[0181] The grayscale difference point pair matrix is ​​a two-dimensional data set based on the principal axis symmetry structure of an image. It is formed by extracting corresponding grayscale point pairs on both sides by setting a spacing and calculating their grayscale difference feature values. Each element of this matrix corresponds to the comprehensive grayscale difference expression of a set of symmetrical pixel point pairs in a certain row of the image, reflecting the brightness balance, grayscale distribution stability and symmetry preservation of the symmetrical structure in the local area. The matrix traverses the image row by row and records the grayscale feature difference value as the position of each point pair changes. The whole matrix builds the basic structure for image symmetry analysis, which is used to further identify image morphology, detect structural distortion or extract symmetrical regions.

[0182] S403: Based on the position of the point pairs and the gray difference value recorded in the gray value difference point pair matrix, construct a gray-level difference mapping array under the image matrix size and establish a structurally symmetrical gray-level difference array.

[0183] Based on the column positions and gray-level difference information recorded in the gray-level difference point pair matrix obtained in the previous step, a gray-level difference mapping structure is constructed within the overall image dimension. By traversing each row of the image, the gray-level difference of the corresponding point pair is mapped to a difference matrix of the same size as the original image, with the difference marked at the left and right positions respectively. In the case of an image size of 480 rows and 640 columns, if the column numbers of the point pair are 310 and 330, and the difference is 5, then this value is marked at the i-th row and 310-th column and 330-th column positions of the matrix respectively. After traversing the entire image, a gray-level difference mapping array is generated, with each column recording the magnitude of the gray-level difference appearing in each row. This can be used to analyze the distribution pattern of structural symmetry differences. To determine structural symmetry, a difference threshold within a set range can be used for judgment. For example, setting the threshold to 10, if the gray-level difference of a pair of symmetrical positions in a row falls within this range, the point pair is considered structurally symmetrical. This type of difference statistics can help identify symmetrical regions with similar gray-level characteristics, supporting subsequent analysis tasks.

[0184] Please seeFigure 6 The specific steps of S5 are as follows:

[0185] S501: Based on the gray-level difference distribution constructed in the structurally symmetric gray-level difference array, detect the continuously changing gray-level difference segments, identify sequence segments that exceed the gray-level stability threshold range, and obtain the coordinate value set of gray-level abnormal distribution intervals;

[0186] When processing structurally symmetrical image regions, the entire image is divided into symmetrical blocks of equal width or height. The pixel grayscale values ​​of each block are extracted sequentially to form a grayscale matrix. Based on this, the difference in grayscale values ​​between adjacent pixels is calculated row-wise or column-wise to obtain a grayscale difference sequence. For example, if five consecutive pixels with grayscale values ​​of 120, 125, 130, 129, and 127 are extracted from a certain structural region, the grayscale differences are 5, 5, 1, and 2 respectively, forming a continuous grayscale difference variation segment. To identify unstable grayscale regions, a fixed window length is used for sliding analysis. If the window length is set to 5, it moves one pixel at a time, and the difference between the maximum and minimum grayscale differences within the window is calculated. When this difference exceeds... A preset stable threshold indicates that the region exhibits drastic gray-level changes and falls within the range of abnormal gray-level distribution. For example, if the threshold is 3, and the gray-level differences within a certain window are 6, 5, 8, 7, and 5, with a maximum of 8 and a minimum of 5, the difference being 3, which is just at the threshold standard, it can be considered an abnormal segment. By sliding and analyzing each region in the entire image and recording the coordinate positions of these continuous intervals that exceed the stable threshold, a set of coordinates for the gray-level abnormal area can be formed. For example, if there are multiple microcracks in a structural image, which manifest as rapid local gray-level transitions, the analysis yields a set of coordinate points for the region, such as (20,100)-(20,105) and (35,210)-(35,215), providing a basis for subsequent processing.

[0187] S502: Call the coordinate value set of gray-level abnormal distribution interval, determine the adjacent consistency of gray-level difference direction within the interval, filter the boundary coordinates of continuous direction, and obtain the boundary coordinates of stable gray-level difference direction segment.

[0188] Based on the obtained set of coordinates of gray-level anomaly areas, the gray-level difference direction sequence within each region is extracted. According to the changing trend of gray-level values ​​of adjacent pixels, it is labeled as positive change, negative change, or no change. The continuity and consistency of the change direction between pixels are analyzed point by point. When the continuous gray-level difference direction remains unchanged, the segment can be considered a directionally stable segment. For example, if the gray-level values ​​of a continuous pixel sequence change to 112, 118, 124, 129, and 133, and the gray-level differences are all positive, then the direction is considered stable and positive. The minimum length for determining continuity and consistency can be set to 3. If the gray-level difference direction changes by +1, +1... If the values ​​are +1, 0, -1, and -1, then the positive and negative parts each form a continuous directional interval. Segments that do not meet the minimum length requirement are eliminated, and only the segments that meet the requirements are retained. Their boundary positions are recorded. For example, in a cracked area on the surface of a concrete slab, the gray-scale change direction of a certain coordinate segment (50,200)-(50,205) is positive for more than 3 consecutive pixels, thus confirming the formation of a stable directional segment. This operation traverses all gray-scale anomaly area coordinates, identifies boundary areas with strong directional consistency one by one, and forms a set of boundary coordinates of stable directional segments, providing a positioning basis for structural feature positioning.

[0189] S503: Based on the boundary coordinates of the stable section in the gray-scale difference direction and the image number attribution information, map the boundary coordinates to the structural section position range to generate a crack location offset information set;

[0190] By mapping the acquired stable gray-scale boundary segments to the structural segment position range corresponding to the image number, the actual location of the crack can be determined. The image number is matched with the structural segment number. For example, if the image number is A001 and the starting coordinate of the corresponding structural segment position is 100 with a pixel spacing of 0.5 units, and the boundary coordinate is in column 200 of the image, then its mapped position is 100 plus 200 multiplied by 0.5, which equals 200, and is used as the actual offset position of the crack. If the boundary point of another segment is in column 250, then the corresponding offset position is 225. In this way, all identified gray-scale anomaly areas can be mapped to specific structural segments. All mapped positions are recorded to form a crack offset position information set. For example, if three crack boundary points correspond to image pixel columns 180, 210, and 300, respectively, they are mapped to structural segments of 190, 205, and 250. After summarizing, a structural crack distribution map can be formed, providing data for structural condition assessment.

[0191] Please see Figure 7 A crankshaft quality inspection system based on image data, comprising:

[0192] The structural number identification module obtains the spatial coordinate values ​​of the crankshaft nodes, continuously compares the distance between adjacent nodes in the axial direction with the set jump threshold, marks the position points where the difference is greater than the threshold as structural boundary points, and binds the spatial coordinates in axial order to generate a structural number coordinate list.

[0193] The image center extraction module extracts the starting and boundary coordinates of each structure segment based on the structural spatial information in the structural number coordinate list, calculates the boundary median to determine the image imaging center position, binds the image number to the center position, and generates an image acquisition center list.

[0194] The image archiving construction module calculates the spatial distance between the image coordinates in the image acquisition center list and the structural segment position coordinates in the structural number coordinate list to determine the structural segment number to which the image belongs, embeds the number information into the image path field, and generates an image number archiving path table.

[0195] The symmetric difference array construction module extracts the image matrix and identifies the gray-level distribution of the main axis region based on the image files in the image number archive path table. After locating the horizontal symmetric center line, it sets the step size on both sides to sample and obtain gray-level point pairs. It calculates the gray-level difference of each group and organizes them into a point difference relationship matrix to generate a structurally symmetric gray-level difference array.

[0196] The crack offset localization module filters point pairs with gray-level differences greater than a threshold in a continuous region based on the gray-level change sequence in the symmetrical gray-level difference array of the structure. After determining the consistency of the gray-level change direction, it extracts the coordinates of the boundary points and maps them to the structural coordinate interval through the image number archive path table to generate a crack localization offset information set.

[0197] Supplementary Draft of Specific Implementation Examples

[0198] I. Optimized Implementation Example of S4 Symmetric Gray-Level Difference Array Construction

[0199] In this embodiment, to improve the robustness of image processing and the processing efficiency of large-size images, an image illumination compensation preprocessing is added before extracting the gray-level distribution features of the main axis region, and an adaptive sampling strategy is introduced during the construction of the gray-level difference array, as follows:

[0200] (1) Illumination compensation preprocessing

[0201] In step S401, before extracting the grayscale distribution features of the main axis region in the image matrix, it is preferable to perform illumination compensation processing on the original image to reduce the grayscale imbalance caused by the high reflectivity area on the crankshaft surface. In this embodiment, the illumination compensation adopts the adaptive histogram equalization method (CLAHE) to achieve local brightness equalization;

[0202] If hardware conditions permit, a polarized illumination structure or a ring-shaped diffuse light source can be used to reduce grayscale saturation in high-reflectivity areas.

[0203] (2) Highlight pixel processing

[0204] In step S402, before calculating the difference between symmetrical grayscale point pairs, for pixels that are still abnormally saturated after illumination compensation, it is preferable to mark and remove these pixels before grayscale calculation to avoid them interfering with the stability of the grayscale difference matrix.

[0205] (3) Adaptive sampling strategy

[0206] In step S403, an adaptive sampling strategy is introduced when constructing the gray-level difference matrix:

[0207] High-density sampling is used near the center line of principal axis symmetry;

[0208] Reduce the sampling density for background areas far from the center.

[0209] This strategy reduces the overall computational load without affecting the crack detection accuracy. It is suitable for high-resolution image processing scenarios, such as 6000×4000 pixel image data, and can significantly reduce the amount of data processing and improve processing efficiency.

[0210] II. Optimized Implementation Example of S5 Crack Location and Offset Calculation

[0211] In this embodiment, to reduce the interference of crankshaft surface machining textures (such as spiral patterns, oil grooves, etc.) on crack detection, texture filtering is introduced before identifying grayscale anomaly areas, as follows:

[0212] (1) Texture filtering preprocessing

[0213] In step S501, before identifying continuous abnormal regions based on the gray-scale difference array, it is preferable to perform texture filtering on the image to suppress periodic processing texture interference on the crankshaft surface. Specifically, this may include the following two methods:

[0214] Gabor multi-directional filtering:

[0215] By constructing Gabor filters with different directions and frequencies, the multi-directional response features of the image are calculated, and the high response region in the crack direction is extracted to suppress non-crack texture features.

[0216] Frequency domain filtering (FFT):

[0217] The image is subjected to a Fast Fourier Transform to identify periodic high-frequency components with significant energy in the spectrum. These interferences are suppressed by band-stop filtering, and then an inverse transform is performed to obtain the texture-suppressed image.

[0218] (2) Consistency judgment optimization

[0219] In step S502, the consistency of grayscale change direction is analyzed using the image data after texture filtering.

[0220] By removing high-frequency texture interference in advance, misjudgment of abnormal areas caused by periodic background structures can be reduced, ensuring that the extracted continuous abnormal segments are more consistent with the gray-scale distribution characteristics of cracks.

[0221] (3) Precise mapping of crack boundaries

[0222] In step S503, based on the continuous abnormal region after texture filtering, the crack boundary coordinates are extracted, and combined with the image number and spatial coordinate attribution information, the crack boundary is mapped to the actual position range of the crankshaft structure segment, thereby obtaining accurate crack offset positioning information.

[0223] III. Supplementary Notes on System Modules

[0224] Corresponding to the system architecture described in the manual, supplement the relevant implementation details in the following two modules:

[0225] 1. Symmetrical Differential Array Construction Module

[0226] Before extracting the image matrix and identifying the grayscale distribution of the main axis region, this embodiment preferably employs illumination compensation processing to reduce grayscale imbalance caused by high reflectivity;

[0227] Meanwhile, an adaptive sampling strategy is introduced during the gray-level difference matrix calculation process to reduce the computational burden on high-resolution images.

[0228] 2. Crack offset positioning module

[0229] Before detecting crack anomaly regions based on grayscale difference array, this embodiment preferably performs texture filtering to suppress periodic texture interference on the crankshaft surface;

[0230] Based on the texture-filtered data, the consistency of grayscale change direction is judged, and the crankshaft structure segment is mapped using the optimized abnormal region boundary to achieve higher-precision crack location.

[0231] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.

Claims

1. A method of crankshaft quality inspection based on image data, characterized by, The method comprises the following steps: S1: reading the spatial coordinate information of the crankshaft machining section, extracting the structural boundary feature position points according to the axial distance difference of the nodes, numbering and marking the nodes in sequence, establishing the correspondence between the structural number and the spatial position, and generating the structural number coordinate list; S2: based on the structural spatial information provided in the structural number coordinate list, extracting the starting position and imaging area boundary value corresponding to the image acquisition process, calculating the center point coordinate, establishing the binding relationship between the image number and the acquisition center, and generating the image acquisition center list; S3: based on the corresponding data of the image acquisition position in the image acquisition center list and the structural section position in the structural number coordinate list, judging the proximity of the image acquisition point to the structural section, determining the belonging section number and embedding it into the image storage path, constructing the binding archiving path between the image file and the structural section, and generating the image number archiving path table; S4: based on the belonging successful image content in the image number archiving path table, positioning the main shaft area symmetry center line in the image matrix, setting the sampling interval to extract the symmetric gray value points, arranging the gray difference value between the points and constructing the corresponding position matrix, and generating the structural symmetric gray difference array; S5: based on the gray difference value distribution constructed in the structural symmetric gray difference array, identifying the continuous abnormal area in the sequence, judging the consistency of the gray change direction, extracting the boundary coordinates of the area, and mapping them to the actual position interval of the structural section combined with the image belonging information, and generating the crack positioning offset information set; The spatial coordinate information refers to the position information of the crankshaft machining section structure node in X, Y, Z three directions in three-dimensional coordinates, and the Z axis value along the machining axis direction is used as the structural section division reference; The distance difference is quantified by the difference of the position change of the continuous nodes in the Z axis direction, and the judgment standard needs to be combined with the typical section distance range in the crankshaft machining process; The structural number is a system-generated identification code, which is assigned in sequence according to the structural section, and has no repeatability; The imaging area boundary value is the end point coordinate value of the image acquisition device in the Z axis direction, which is determined by the field of view limit position of the imaging sensor, and constitutes a measurable imaging coverage area with the starting position; The center point coordinate is the intermediate coordinate value between the starting position and the boundary position of the imaging area, which is used to indicate the collection center position of the image in the crankshaft structure; The proximity is determined by calculating the absolute distance or Euclidean distance between the image center coordinate and the structural section center coordinate, and setting a predetermined distance threshold to determine the belonging relationship; The belonging successful image content is the image belonging to the structural section number and binding into the warehouse when the distance between the image acquisition center coordinate and the structural section center coordinate is lower than the set threshold condition; The symmetry center line of the main shaft area is the geometric center line in the horizontal direction of the image matrix, which corresponds to the visual symmetry reference of the crankshaft in the image; The sampling interval is the interval distance between adjacent gray point pairs in the image coordinate system, which is set to a fixed pixel value; The gray difference value is the absolute difference between the gray level values of the symmetric pixels.

2. The method of claim 1, wherein The structure number coordinate list comprises node numbers, structure positions and spatial coordinates, the image acquisition center list comprises image numbers, acquisition center points and imaging boundaries, the image number archiving path table comprises image numbers, belonging section numbers and image storage paths, and the structure symmetry gray difference array comprises symmetry point gray values, a gray difference matrix and a center line position.

3. The method of claim 1, wherein the image data is obtained by a camera. The specific steps of S1 are as follows: S101: read the spatial coordinates of the nodes in the crankshaft machining section, extract the Z-axis direction coordinates as the axial position reference, arrange the nodes in sequence according to the node numbers, calculate the Z-axis spacing between adjacent nodes, obtain all the spacing values in the node sequence, and acquire the axial spacing change values; S102: according to the axial spacing change values, screen the node positions with a spacing difference greater than a structure boundary threshold, judge whether the structure boundary condition is met, take the nodes meeting the requirement as structure feature points, extract the original numbers and spatial coordinates, and obtain a structure feature node sequence; S103: establish the corresponding relationship between the structure numbers and the coordinates according to the number sequence and coordinate information in the structure feature node sequence, and generate a structure number coordinate list.

4. The method of claim 3, wherein The specific steps of S2 are as follows: S201: based on the number and corresponding coordinate information recorded in the structure number coordinate list, extract the three-dimensional coordinate values associated with each group of structure numbers, acquire the starting point coordinate and imaging area boundary coordinate values corresponding to the numbers, judge whether the coordinate boundary range is complete, and obtain a boundary information complete coordinate set; S202: according to the starting point coordinate and boundary point coordinate corresponding to the structure numbers in the boundary information complete coordinate set, calculate the median value of the three-dimensional coordinates in the axial direction respectively, take the axial median value as the spatial reference point of the structure number image acquisition position in the form of three-dimensional coordinates, and generate an image acquisition center coordinate sequence; S203: call the corresponding relationship between the structure numbers and the acquisition centers in the image acquisition center coordinate sequence, extract the image acquisition number and acquisition center coordinate value, arrange and combine the corresponding relationship data items according to the structure number sequence, and establish an image acquisition center list.

5. The method of claim 4, wherein the image data is obtained by a camera. The specific steps of S3 are as follows: S301: based on the position data in the image acquisition center list and the structure number coordinate list, extract the three-dimensional distance between the image acquisition point and the structure section, exclude the structure sections exceeding the belonging judgment range, and obtain the shortest spatial distance value between the image acquisition point and the structure section; S302: according to the shortest spatial distance value between the image acquisition point and the structure section, determine the structure section number to which the image acquisition point belongs, combine the image number and the belonging number, and generate an image number belonging structure section identification list; S303: call the combined data in the image number belonging structure section identification list, extract the structure section number as an archiving directory name, embed an image file path, and establish an image number archiving path table.

6. The method of claim 5, wherein the image data is obtained by a camera. The specific steps of S4 are as follows: S401: based on the image content successfully belonging in the image number archiving path table, extract the gray distribution features of the main shaft region in the image matrix, detect the symmetry degree difference value of the pixel column, and obtain the image main shaft symmetry center line position value; S402: Call the image main axis symmetry center line position value, set the interval to extract two sides of the gray value point pair, calculate the gray value difference between the point pair, and generate a gray value difference point pair matrix; S403: According to the position and gray value of the point pair recorded in the gray value difference point pair matrix, a gray difference mapping array under the size of the image matrix is constructed, and a structure symmetry gray difference array is established.

7. The method for crankshaft quality inspection based on image data according to claim 1, wherein the crack positioning offset information set comprises an abnormal area boundary, a gray change direction, and a structure segment mapping position. The specific steps of S5 are:

8. The method of claim 1, wherein, S501: Based on the gray difference value distribution constructed in the structure symmetry gray difference array, a gray difference continuous change section is detected, a sequence section exceeding a gray stability threshold range is identified, and a gray abnormal distribution interval coordinate value set is obtained; S502: Call the gray abnormal distribution interval coordinate value set, judge the adjacent consistency of the gray difference value direction, filter the direction continuous boundary coordinates, and obtain the gray difference value direction stable section boundary coordinates; S503: According to the gray difference value direction stable section boundary coordinates and the image number attribution information, the boundary coordinates are mapped to the structure segment position interval, and a crack positioning offset information set is generated; The continuous abnormal area is a section in which the gray difference of multiple adjacent sampling points in the gray difference value matrix exceeds a set threshold, and the distribution is continuous and has a consistent directionality; The consistency judgment is a continuous filtering operation on the gray change direction, which judges the adjacent consistency of the gray difference value direction. When the signs of the gray difference values of the continuous 5 sampling points are consistent, or not more than 1 point in which the sign is reversed, and the adjacent point gray difference value direction changes less than ± 10%, it is determined that the direction is consistent, which is the direction continuous boundary coordinate; The boundary coordinate is the start and end position of the identified crack trend area in the image, which can be positioned in the offset position of the structure segment through coordinate mapping; The actual position interval of the structure segment is the spatial distribution limit of the structure segment in the axial range, which is determined by the start and end coordinates of each segment in the structure number coordinate list. The system is used to realize the method for crankshaft quality inspection based on image data according to any one of claims 1-8, and the system comprises:

9. A crankshaft quality inspection system based on image data, characterized by, The structure number identification module obtains the spatial coordinate value of the crankshaft node, continuously compares the interval of adjacent nodes in the axial direction with the set jump threshold, marks the position point with a difference greater than the threshold as a structure boundary point, binds the spatial coordinates in the axial order, and generates a structure number coordinate list; The image center extraction module extracts the start and boundary coordinates of each structure according to the structure spatial information in the structure number coordinate list, calculates the boundary median to determine the image center position, binds the image number and the center position, and generates an image acquisition center list; The image archiving construction module calculates the spatial distance between the image coordinate points in the image acquisition center list and the structure segment position coordinates in the structure number coordinate list to judge the image attribution structure segment number, embeds the number information into the image path field, and generates an image number archiving path table. ​ The symmetric difference array construction module extracts an image matrix and identifies a main shaft area gray scale distribution based on the image file in the image number archiving path table, sets a step sampling to obtain a gray scale value point pair on both sides after positioning a transverse symmetry center line, calculates each group of gray scale difference values and arranges them into a point position difference value relationship matrix, and generates a structural symmetric gray scale difference array; The crack offset positioning module extracts boundary point coordinates after judging the consistency of the gray scale change direction according to the gray scale change sequence in the structural symmetric gray scale difference array, and maps them to a structural coordinate interval through the image number archiving path table to generate a crack positioning offset information set; The spatial coordinate information refers to the position information of the crankshaft processing section structure node in the X, Y and Z directions in the three-dimensional coordinate, and the Z axis value in the direction of the processing axis is used as the structure section division reference; The interval difference is quantified by the difference value of the position change of the continuous nodes in the Z axis direction, and the judgment standard needs to be combined with the typical section distance range in the crankshaft processing technology; The structure number is a system automatically generated identification code, which is assigned in sequence according to the structure section, and has no repeatability; The imaging area boundary value is the end coordinate value of the image acquisition device in the Z axis direction, which is determined by the field of view limit position of the imaging sensor, and forms a measurable imaging coverage area with the starting position; The center point coordinate is the intermediate coordinate value between the starting position and the boundary position of the imaging area, which is used to indicate the collection center position of the image in the crankshaft structure; The proximity is calculated by the absolute distance or Euclidean distance between the image center coordinate and the structure section center coordinate, and a predetermined distance threshold is set to judge the attribution relationship; The image content of the attribution success is that when the distance between the image collection center coordinate and the structure section center coordinate is lower than the set threshold condition, the image is attributed to the structure section number and bound into the warehouse; The symmetry center line of the main shaft area is the geometric center line in the horizontal direction of the image matrix, which corresponds to the visual symmetry reference of the crankshaft in the image; The sampling interval is the interval distance of adjacent gray scale point pairs in the image coordinate system, which is set to a fixed pixel value; The gray scale difference value is the absolute difference between the gray scale values of the symmetric pixel points.

Citation Information

Patent Citations

  • Gearbox input shaft bearing life prediction method, device and equipment

    CN119169367A

  • Method and device for automated portrayal and accurate measurement of width of structural crack

    WO2019134252A1