A computer vision-based method for detecting the size of a crankshaft
By employing multi-view image acquisition and geometric dynamic projection correction algorithms in crankshaft inspection, the problems of image acquisition distortion and noise interference in traditional methods are solved, achieving efficient and accurate crankshaft dimension inspection and improving the robustness and accuracy of the inspection.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CHANGZHOU GUANGXING PRECISION MASCH CO LTD
- Filing Date
- 2025-06-17
- Publication Date
- 2026-05-26
AI Technical Summary
Traditional computer vision-based crankshaft dimension detection methods suffer from problems such as projection distortion from multi-view image acquisition, noise interference in feature point extraction, lack of robustness in detection results, and low accuracy, failing to effectively solve the problems of accuracy and consistency in crankshaft dimension measurement.
Industrial cameras are used to acquire crankshaft images from different perspectives. The images are preprocessed by combining grayscale conversion, noise suppression and edge detection. The initial size is optimized by a geometric dynamic projection correction algorithm. A set of crankshaft contour feature points is constructed and the optimized size is calculated. A six-degree-of-freedom robotic arm and a geometric projection correction algorithm are used to correct the projection distortion between perspectives.
It achieves comprehensive capture of the geometric features of various parts of the crankshaft, improves the integrity and accuracy of the inspection, enhances the clarity of the image data and the reliability of the calculation, and significantly improves the accuracy of the final dimension measurement, especially in avoiding distortion caused by oblique viewing angles.
Smart Images

Figure CN120655623B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer vision, and more particularly to a crankshaft dimension detection method based on computer vision. Background Technology
[0002] The crankshaft is one of the core components of an internal combustion engine. It is usually made of steel or cast iron and is responsible for converting the reciprocating motion of the piston into rotational motion, thereby driving the machine. Therefore, the dimensional accuracy of the crankshaft is directly related to the engine's performance, stability and lifespan, making crankshaft dimensional inspection crucial.
[0003] In the traditional crankshaft dimension inspection process, manual measuring tools (such as calipers, inside and outside micrometers, etc.) are usually used for measurement. Although intuitive, they have many limitations, such as human operation error, low inspection efficiency, and difficulty in adapting to the measurement of crankshafts with complex shapes. Therefore, developing an efficient, accurate, and automated crankshaft dimension inspection technology has become an important issue in the field of mechanical manufacturing.
[0004] With the rapid development of computer vision technology, computer vision-based dimension inspection methods have gradually become an ideal choice. Computer vision can detect various dimensions of crankshafts through image acquisition, processing and analysis. It has the advantages of non-contact, high precision and automation. It can not only improve production efficiency, but also effectively improve product quality and has broad application prospects.
[0005] However, the traditional computer vision-based crankshaft dimension detection methods mentioned above still have the following problems: projection distortion from multi-view image acquisition, noise interference in feature point extraction, lack of robustness in detection results, and low detection accuracy. Summary of the Invention
[0006] This invention provides a computer vision-based crankshaft dimension detection method to address the inaccuracy of crankshaft dimension measurement caused by projection distortion in traditional multi-view image acquisition processes. Furthermore, conventional image processing techniques may fail to effectively extract accurate geometric features due to factors such as uneven illumination and noise interference on the surface of crankshaft and other components. Additionally, the geometric features of the crankshaft may vary at different angles, and traditional methods often ignore the differences between viewpoints, failing to fully consider the projection distortion at each viewpoint and thus failing to achieve reasonable dimension optimization.
[0007] The present invention provides a crankshaft dimension detection method based on computer vision, which specifically includes the following technical solutions:
[0008] A crankshaft dimension detection method based on computer vision includes the following steps:
[0009] S1. Acquire original crankshaft images from different perspectives and perform image preprocessing to extract the crankshaft contour; based on the crankshaft contour, identify crankshaft contour feature points and construct a crankshaft contour feature point set; based on the crankshaft contour feature points, calculate the preliminary dimensions;
[0010] S2. Introduce a geometric dynamic projection correction algorithm to optimize the initial dimensions and obtain optimized crankshaft dimensions.
[0011] Preferably, S1 specifically includes:
[0012] The original crankshaft image is converted into a grayscale image, and noise suppression processing is performed on the grayscale image to obtain a noise-suppressed image; edge detection is performed on the noise-suppressed image to extract the crankshaft contour.
[0013] Preferably, S1 specifically includes:
[0014] Mark the crankshaft contour points and identify the crankshaft contour feature points; convert the pixel coordinates of the crankshaft contour feature points to world coordinates and output the crankshaft contour feature point set.
[0015] Preferably, S1 specifically includes:
[0016] Select feature point pairs representing the dimensions of various parts of the crankshaft from the set of crankshaft profile feature points, and calculate the Euclidean distance of each pair of feature points in three-dimensional space as the preliminary dimensions.
[0017] Preferably, S2 specifically includes:
[0018] In the implementation of the geometric dynamic projection correction algorithm, the crankshaft profile feature point set is fitted to obtain the main shaft centerline; the crankshaft profile feature points are projected onto the vertical plane of the main shaft centerline to obtain the projection points.
[0019] Preferably, S2 specifically includes:
[0020] Calculate the vector from the crankshaft profile feature points to the projection points, and normalize it to obtain the normalized direction vector.
[0021] Preferably, S2 specifically includes:
[0022] Based on the normalized direction vector and combined with the direction vector of the main axis centerline, the cosine value of the angle between the direction of the main axis centerline and the projection direction of the crankshaft profile feature points is calculated.
[0023] Preferably, S2 specifically includes:
[0024] The weighted dimension is obtained by multiplying the cosine of the angle between the main shaft centerline direction and the projection direction of the crankshaft profile feature points by the preliminary dimension of each viewpoint; the weighted dimensions of all viewpoints are summed and divided by the sum of the cosines of the angle between the main shaft centerline direction and the projection direction of the crankshaft profile feature points of all viewpoints to calculate the optimized value of the crankshaft dimension; the optimized values of the dimensions of each part of the crankshaft are integrated to form an optimized dimension set.
[0025] The beneficial effects of the technical solution of the present invention are:
[0026] 1. By using an industrial camera mounted on a six-degree-of-freedom robotic arm, original crankshaft images are acquired from different perspectives (such as top view, side view, and oblique view), ensuring that the geometric features of each part of the crankshaft can be captured comprehensively and accurately; the multi-view acquisition method effectively avoids the loss of image information caused by a single perspective, improving the integrity and accuracy of the inspection.
[0027] 2. By employing techniques such as grayscale conversion, noise suppression, and edge detection, the original crankshaft image is preprocessed to remove noise interference and enhance the clarity of the crankshaft outline. This provides accurate image data for subsequent feature extraction and size calculation, ensuring the reliability of subsequent calculations.
[0028] 3. A geometric dynamic projection correction algorithm is introduced to optimize the initial dimensions. By fitting the spindle centerline and calculating the cosine of the angle between the spindle centerline direction and the projection direction of the crankshaft contour feature points, projection distortion between different viewpoints is effectively corrected. It can combine dimensional data from different viewpoints to generate more accurate optimized dimensions. In particular, it significantly improves the accuracy of the final dimension measurement, especially in avoiding distortion caused by oblique viewing angles. Attached Figure Description
[0029] Figure 1 This is a flowchart of a crankshaft dimension detection method based on computer vision according to the present invention. Detailed Implementation
[0030] To further illustrate the technical means and effects adopted by the present invention to achieve its intended purpose, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0031] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains.
[0032] The following description, in conjunction with the accompanying drawings, details a specific scheme for a crankshaft dimension detection method based on computer vision provided by the present invention.
[0033] See attached document Figure 1 The diagram illustrates a flowchart of a computer vision-based crankshaft dimension detection method according to an embodiment of the present invention. The method includes the following steps:
[0034] S1. Acquire original crankshaft images from different perspectives and perform image preprocessing to extract the crankshaft contour; based on the crankshaft contour, identify crankshaft contour feature points and construct a crankshaft contour feature point set; based on the crankshaft contour feature points, calculate the preliminary dimensions;
[0035] An industrial camera (such as the Basler acA4024-29um, resolution 4024×3036 pixels, pixel size 1.85 micrometers, frame rate at least 30 frames per second) is selected, equipped with a 25mm fixed-focus lens, covering a crankshaft dimension of approximately 500mm×200mm. The industrial camera is mounted on a six-DOF robotic arm (such as the ABB IRB 120, positioning accuracy ±0.01mm) to acquire raw crankshaft images from different perspectives, including top view (camera optical axis perpendicular to the crankshaft main axis, used to capture the circular outline of the journal), side view (camera optical axis parallel to the main axis, used to capture the crank length and eccentricity), and 45-degree oblique view (used to capture transition areas and complex geometric details). The camera position for each perspective is precisely adjusted by the robotic arm to ensure that the field of view covers all key parts of the crankshaft. Multi-view acquisition ensures that the geometric features of the crankshaft (such as journal diameter and crank length) are captured at different angles to improve inspection robustness.
[0036] A ring-shaped LED light source (brightness of at least 5000 lumens, color temperature of 5500K, uniformity greater than 90%) is used in conjunction with a 300 mm diameter diffuser to reduce high-gloss reflections and shadows on the crankshaft's metal surface and enhance the clarity of the crankshaft image outline.
[0037] Since the original crankshaft image is affected by environmental noise (such as dust, light spots), uneven lighting or surface texture interference, it is necessary to perform image preprocessing on the original crankshaft image to extract the crankshaft contour.
[0038] The image preprocessing includes grayscale conversion, noise suppression, and edge detection. Grayscale conversion converts the original crankshaft image into a grayscale image to reduce color interference and highlight the geometric contours of the crankshaft. Noise suppression applies Gaussian filtering to the grayscale image to remove environmental noise (such as dust and light spots), reducing false detections in subsequent edge detection and obtaining a noise-suppressed image. Edge detection uses the Canny edge detection algorithm to extract the crankshaft contour based on the noise-suppressed image, ensuring the contour is complete. The methods used in the image preprocessing are all well-known techniques to those skilled in the art and will not be described in detail here.
[0039] Mark the crankshaft profile points to construct a crankshaft profile point set. ,in These are assigned viewpoint numbers to indicate different camera viewpoints, including top views, side views, etc. Indicates the first The crankshaft profile from the [number]th perspective One point, Indicates the first The crankshaft profile from the [number]th perspective The coordinates of the points Indicates the first The total number of crankshaft profile points from each viewpoint;
[0040] Using the Harris corner detection algorithm, with a corner response threshold of 0.01 and a neighborhood size of 3×3 pixels, crankshaft contour feature points in the crankshaft contour point set are identified, including the arc points of the main journal edge, the connecting rod journal edge, and the crank angle; the Harris corner detection algorithm is a well-known technique in the art and will not be described in detail here.
[0041] By using camera calibration parameters, the pixel coordinates of crankshaft profile feature points are converted into world coordinates. Output crankshaft profile feature point set ,in, Indicates the first The crankshaft profile from the [number]th perspective One feature point, Indicates the first The crankshaft profile from the [number]th perspective The world coordinates of a feature point Indicates the first The number of crankshaft profile feature points from each viewpoint;
[0042] Based on crankshaft profile feature points, preliminary dimensions of various parts of the crankshaft (including main journal diameter, connecting rod journal diameter, crank length, eccentricity, etc.) are calculated. Specifically, based on the crankshaft's geometric characteristics, representative feature point pairs are selected from the crankshaft profile feature point set. The method for selecting these feature point pairs is well-known to those skilled in the art and will not be elaborated here. For each pair of feature points, the Euclidean distance in three-dimensional space is calculated as the preliminary dimension, expressed by the following formula:
[0043] ,
[0044] in, Indicates the crankshaft at the 1st The first perspective Preliminary dimensions of each part; and They represent the first time. Each perspective can represent the characteristic points of the crankshaft dimensions. and World coordinates and The value range is 1 to .
[0045] S2. Introduce a geometric dynamic projection correction algorithm to optimize the initial dimensions and obtain optimized values for the crankshaft dimensions;
[0046] In computer vision, multi-view image acquisition often results in projection distortion due to the relationship between the camera's viewpoint and the object's geometry. To correct projection distortion in multi-view image acquisition and optimize the measurement accuracy of crankshaft dimensions, a geometric dynamic projection correction algorithm is introduced based on computer vision and geometric projection theory. This algorithm optimizes the initial dimensions to obtain optimized crankshaft dimensions. The optimized dimensions of each part are then integrated to form an optimized dimension set, including main journal diameter, connecting rod journal diameter, crank length, and eccentricity.
[0047] The geometric dynamic projection correction algorithm fits the crankshaft profile feature point set using the least squares method to obtain the main shaft centerline, projects the crankshaft profile feature points onto the vertical plane of the main shaft centerline, and weights and fuses the preliminary dimensions based on the cosine of the angle between the main shaft centerline direction and the projection direction of the crankshaft profile feature points to generate optimized crankshaft dimensions.
[0048] For each crankshaft profile feature point, a vector (i.e., a position vector) from the crankshaft profile feature point to the reference point is calculated to represent the position of the crankshaft profile feature point relative to the reference point of the main shaft centerline. The projection component of the position vector on the main shaft direction vector is calculated, i.e., the offset of the crankshaft profile feature point along the main shaft direction is obtained by the dot product of the position vectors. The offset of the crankshaft profile feature point along the main shaft direction is subtracted from the coordinates of the crankshaft profile feature point to obtain the projection point, which is located in the vertical plane of the main shaft centerline. The reference point is used to define the reference position of the main shaft centerline and is obtained by centroid calculation. The calculation method is a well-known technique to those skilled in the art and will not be described in detail here.
[0049] Furthermore, for each crankshaft profile feature point, the vector from the crankshaft profile feature point to the projection point is calculated and normalized to obtain a normalized direction vector; the absolute value of the dot product of the normalized direction vector and the direction vector of the main shaft centerline is calculated and divided by the product of the magnitudes of the two vectors (the normalized direction vector and the direction vector of the main shaft centerline) to obtain the cosine value of the angle between the direction of the main shaft centerline and the projection direction of the crankshaft profile feature point, which is used to reflect the degree of proximity of the viewing angle to the vertical plane of the main shaft centerline;
[0050] Multiply the initial dimension of each viewpoint by the cosine of the angle between the main axis centerline direction and the projection direction of the crankshaft profile feature points to obtain the weighted dimension. Sum all weighted dimensions and divide by the sum of the cosines of the angles between the main axis centerline direction and the projection direction of the crankshaft profile feature points for all viewpoints to calculate the optimized crankshaft dimension, as shown in the following formula:
[0051] ,
[0052] in, Indicates the crankshaft number Optimized values for the dimensions of each part; Indicates all perspectives ( arrive Summation; Indicates the first The cosine of the angle between the centerline of the principal axis of the viewpoint and the projection direction of the crankshaft contour feature points is used to correct viewpoint projection distortion. The calculation formula is as follows: ; Indicates the first The angle between the direction of the principal axis of view and the projection direction of the feature points of the crankshaft profile; Indicates the direction vector of the principal axis centerline; Indicates the first Viewpoint crankshaft profile feature points Relative to the projection point The normalized direction vector is calculated using the following formula: , Indicates the first Vector from key feature points of the crankshaft profile to the projection point; Represents the projection point, i.e., the th Viewpoint crankshaft profile feature points The formula for calculating the projection onto the plane perpendicular to the principal axis centerline is: ; The reference point indicating the center line of the main spindle; A vector representing the reference point from the crankshaft profile feature point to the main shaft centerline; This indicates that the calculation is performed using the vector dot product. exist Projected length in the direction; This represents the square of the magnitude of the vector along the principal axis centerline, used for normalization. Indicates the first The projection distance from the feature points of the crankshaft profile to the center line of the main shaft;
[0053] The optimized values of the dimensions of various parts of the crankshaft are integrated to form an optimized dimension set. This includes the dimensions of all parts, such as the main journal diameter, connecting rod journal diameter, crank length, and eccentricity. This indicates the quantity of dimensions for all parts of the crankshaft.
[0054] In summary, a computer vision-based crankshaft dimension detection method has been developed.
[0055] The order of the embodiments is for illustrative purposes only and does not represent the superiority or inferiority of the embodiments. The processes depicted in the drawings do not necessarily require a specific or sequential order to achieve the desired result. In some embodiments, multitasking and parallel processing are possible or may be advantageous.
[0056] The various embodiments in this specification are described in a progressive manner. The same or similar parts between the various embodiments can be referred to each other. Each embodiment focuses on describing the differences from other embodiments.
[0057] The above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included within the protection scope of the present invention.
Claims
1. A crankshaft dimension detection method based on computer vision, characterized in that, Includes the following steps: S1. Acquire original crankshaft images from different perspectives and perform image preprocessing to extract the crankshaft contour; based on the crankshaft contour, identify crankshaft contour feature points and construct a crankshaft contour feature point set; based on the crankshaft contour feature points, calculate the preliminary dimensions; S2. Introduce a geometric dynamic projection correction algorithm to fit the crankshaft profile feature point set to obtain the main shaft centerline; project the crankshaft profile feature points onto the vertical plane of the main shaft centerline to obtain projection points; calculate the vector from the crankshaft profile feature points to the projection points and normalize it to obtain a normalized direction vector; based on the normalized direction vector and combined with the main shaft centerline direction vector, calculate the cosine of the angle between the main shaft centerline direction and the projection direction of the crankshaft profile feature points; multiply the cosine of the angle between the main shaft centerline direction and the projection direction of the crankshaft profile feature points by the preliminary dimension of each viewpoint to obtain a weighted dimension; sum the weighted dimensions of all viewpoints and divide by the sum of the cosines of the angle between the main shaft centerline direction and the projection direction of the crankshaft profile feature points of all viewpoints to optimize the preliminary dimensions and obtain optimized crankshaft dimensions; integrate the optimized dimensions of each part of the crankshaft to form an optimized dimension set.
2. The crankshaft dimension detection method based on computer vision according to claim 1, characterized in that, S1 specifically includes: The original crankshaft image is converted into a grayscale image, and noise suppression processing is performed on the grayscale image to obtain a noise-suppressed image; edge detection is performed on the noise-suppressed image to extract the crankshaft contour.
3. The crankshaft dimension detection method based on computer vision according to claim 2, characterized in that, S1 specifically includes: Mark the crankshaft contour points and identify the crankshaft contour feature points; convert the pixel coordinates of the crankshaft contour feature points to world coordinates and output the crankshaft contour feature point set.
4. The crankshaft dimension detection method based on computer vision according to claim 3, characterized in that, S1 specifically includes: Select feature point pairs representing the dimensions of various parts of the crankshaft from the set of crankshaft profile feature points, and calculate the Euclidean distance of each pair of feature points in three-dimensional space as the preliminary dimensions.