Automobile flange plate positioning hole detection system based on vision measurement

Through the automotive flange disc positioning hole detection system based on visual measurement, the problems of low detection accuracy, slow efficiency and high cost in the prior art are solved, and high-precision and high-efficiency batch detection are achieved.

CN119665808APending Publication Date: 2025-03-21高兆旋
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411518438.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-29
Publication Date
2025-03-21

AI Technical Summary

Technical Problem

The prior art has problems of low accuracy, slow efficiency and high cost in the detection of automotive flange disc positioning holes, and high precision and high efficiency batch detection cannot be achieved.

Method used

The automotive flange disc positioning hole detection system based on visual measurement is adopted, and the center coordinates and radius are calculated by combining image pre-processing, distortion correction, edge recognition and feature focus transformation to achieve high-precision detection of the flange disc positioning hole.

Benefits of technology

It realizes high-precision detection of small-sized workpieces and micron-scale objects, improves detection efficiency and accuracy, reduces detection costs, and is suitable for batch inspection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119665808A_ABST
    Figure CN119665808A_ABST
Patent Text Reader

Abstract

The invention discloses a high-precision and high-efficiency automobile part detection system which comprises an automobile part image acquisition platform, a distortion image vision measurement correction system, a vision image flange plate positioning hole detection system and flange plate positioning hole detection system software. Even micron-sized objects can be detected, detection analysis is completed, and the purpose of precise measurement is achieved; the circumferential position of the positioning hole is determined by detecting the coordinates of the center position of the positioning hole in the flange plate image, direct contact with the surface of a part is avoided, compared with traditional detection, the efficiency is greatly improved, a software system can detect the position information of the positioning hole of the flange plate through an accurate measurement method, the quality of the flange plate is distinguished, and the detection accuracy is improved. The balance of the automobile transmission shaft is improved, key influences caused by friction and abrasion during shaft movement are reduced, and the automobile part detection scheme is high in precision, high in efficiency and low in consumption.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to an image automobile flange locating hole detection system, and in particular to an automobile flange locating hole detection system based on visual measurement, belonging to the technical field of machine vision automobile parts detection. Background Art

[0002] The automobile transmission shaft is an important part of the automobile. It is a high-speed, low-support rotating body. Therefore, it is crucial to maintain the dynamic balance of the transmission shaft during design, production and processing. The flange plate plays a very important role in the automobile transmission shaft. The role of the flange plate is to form a seamless connection with various spline sleeves. The processing quality of the automobile transmission shaft depends to a large extent on the processing technology of the flange plate. Therefore, batch testing is required during the processing of the flange plate. Selecting a high-precision, high-efficiency, and low-cost testing solution is important for improving the detection efficiency and accuracy of the flange plate.

[0003] The position accuracy of mechanical parts is one of the quality indicators of parts processing, especially the position accuracy of the flange locating hole can ensure the stability of the radial runout of the parts. However, due to human operation errors, machine tool failures, or unreasonable processing technology, there are large errors in the size or position of the parts. Timely and accurate detection of part errors is of great significance in actual production.

[0004] Visual measurement technology is a high-performance measurement technology that has emerged in recent years. It is based on the principle of CCD optical imaging and integrates a variety of modern technologies such as optoelectronics technology, computer processing technology, laser technology, and image processing technology. Visual measurement is a non-contact measurement method that uses images as a means of detecting and transmitting information. It completes detection by analyzing and obtaining information from them, and calculates the texture information of the target object to obtain various parameter information of the target object. Compared with traditional measurement technology, visual measurement technology has many advantages such as high precision, wide range, and strong controllability. In recent years, the development of charge-coupled devices and the birth of higher-performance computers have further promoted the formation and development of visual measurement technology. It has successfully solved many problems such as large amount of computational information and large algorithm limitations, greatly improving the efficiency and accuracy of visual measurement.

[0005] However, in today's automotive industry, the measurement methods are still mainly traditional gauge detection or coordinate measuring machine detection. These methods have a lot of shortcomings. For example, the integrated gauge detection principle is to actually simulate the process of parts matching each other. The parts are first fixed on the template, and then the measuring pins made of standard size are passed through the positioning holes of the parts. Whether the positioning pins can freely pass through the positioning holes of the parts is used to determine whether the position of the holes is qualified. This measurement method cannot obtain specific data on the position of the parts, so it cannot scientifically explain whether the detection is qualified and whether the accuracy can be achieved. It can only be used for batch detection of a batch of parts. When using a three-coordinate measuring machine for detection, the detection process is too complicated and inefficient, and only a batch of finished parts can be sampled for detection.

[0006] Therefore, there is an urgent need for a high-precision and efficient automotive parts inspection technology to measure small-sized workpieces, and even to inspect micron-level objects, complete inspection and analysis, and achieve the purpose of precision measurement.

[0007] In summary, there are still several problems and defects in the existing automotive flange positioning hole detection technology. The difficulties and problems to be solved in this application are concentrated in the following aspects:

[0008] (1) The position accuracy of automobile mechanical parts is one of the quality indicators of parts processing, especially the position accuracy of the flange locating hole can ensure the stability of the radial runout of the parts. The processing quality of automobile transmission shaft depends to a large extent on the processing technology of the flange part. However, due to human operation errors, or failures of the machine tool itself, or unreasonable processing technology, there are large errors in the external dimensions or position of the parts. The existing technology cannot detect the part errors in a timely and accurate manner, resulting in the inability to seamlessly connect with various spline sleeves. The processing quality of automobile transmission shaft is greatly affected. Since batch inspection is required in the processing of the flange, the existing technology urgently needs a high-precision, high-efficiency, and low-cost inspection solution to improve the inspection efficiency and inspection accuracy of the flange.

[0009] (2) There are two types of existing automotive transmission shaft flange measurement methods. One is comprehensive gauge detection, the detection principle of which is to simulate the process of parts matching each other. The parts are first fixed on the template, and then the measuring pins made of standard size are passed through the positioning holes of the parts. Whether the positioning holes can be freely passed through is used to determine whether the position of the holes is qualified. This measurement method cannot obtain specific data on the position of the parts, so it cannot scientifically explain whether the detection is qualified and whether the accuracy can be achieved. In addition, the production cost of high-precision measuring pins is also very expensive, and only a batch of parts can be tested in batches. Another method is to use a three-coordinate measuring machine to detect the position of the parts. In this way, various parameters of the flange positioning holes can be obtained with high detection accuracy. However, the detection steps of this method are complicated and require a lot of time and effort to detect. It will be unacceptable for batch detection and loses the value of large-scale promotion and application.

[0010] (3) The prior art lacks a reliable automobile flange hardware detection platform, lacks an illumination focusing system, a digital image acquisition system, and a visual measurement detection display system. It is unable to complete the setting of the illumination focusing system, the posture adjustment of the CDD camera, and the calculation of the measurement distance. It is unable to perform regional illumination of the end face of the part with a forward light source in the illumination focusing system. There is a lack of a method for acquiring end face images using digital imaging equipment, resulting in low quality of the acquired images. There is a lack of a flange image distortion model, and it is unable to perform a significance test on the matrix domain. The insignificant matrix domain cannot be deleted. There is a lack of a camera calibration method, and the corrected matrix domain matrix cannot be directly called into the subsequent image processing program. The system complexity is large, the image processing efficiency is low, and the automobile parts detection accuracy cannot meet the requirements.

[0011] (4) The existing technology lacks an efficient visual image flange positioning hole detection method, lacks core steps such as image pre-processing, flange positioning hole edge recognition, feature focus transformation to calculate the center coordinates and radius, and pixel equivalent precise calibration. It lacks the recognition and extraction of flange positioning holes, the calculation of the center coordinates, circumference radius, and the angle between the four small positioning holes about the center of the large circle, and lacks pixel equivalent precise calibration, making it impossible to convert the measured image data into real size. It lacks a flange positioning visualization operation platform, and the system's image processing algorithm cannot be mixed and implemented. It lacks callback functions for various controls and the driver and image decoding and display program for the CCD camera, resulting in high cost and low accuracy in automobile parts inspection. It is also impossible to complete batch inspection and visualize the inspection results. Summary of the invention

[0012] The present application has developed a high-precision and high-efficiency automobile parts inspection system, which can measure small-sized workpieces and even micron-level objects, complete inspection and analysis, and achieve the purpose of precise measurement; the circumferential position of the locating hole is determined by detecting the coordinates of the center position of the locating hole in the flange disk image. This detection method avoids direct contact with the surface of the part and has greatly improved efficiency compared with traditional detection. The system is a comprehensive integration of multiple disciplines such as detection control methods combining visual measurement technology, embedded control and computer software control automation. The automobile flange disk locating hole measurement software system based on visual measurement technology can detect the position information of the flange disk locating hole through precise measurement methods, and distinguish the quality of the flange disk, improve the balance of the automobile drive shaft, and reduce the friction and wear during shaft movement. It has a key impact, and at the same time, it has a great promoting effect on the promotion of CCD machine vision technology in practical applications. It is a high-precision, high-efficiency and low-cost automobile parts inspection solution.

[0013] In order to achieve the above technical effects, the technical solutions adopted in this application are as follows:

[0014] The automobile flange locating hole detection system based on visual measurement builds the automobile flange locating hole detection system architecture, including the automobile parts image acquisition platform, the distorted image visual measurement correction system, the visual image flange locating hole detection system, and the flange locating hole detection system software, a total of four parts;

[0015] The first part belongs to the hardware detection platform of the system, which is composed of the light focusing system, digital image acquisition system, and visual measurement detection display system. It includes the setting of the light focusing system, the posture adjustment of the CDD camera, and the calculation of the measurement distance. In the light focusing system, the forward light source is used to regionally illuminate the end face of the part, and then the end face image is collected by the digital imaging device, and the digital image signal is directly transmitted to the computer, and finally the result is output;

[0016] The second part includes the flange disk image distortion model and the correction of the image distortion model. The flange disk image distortion model is proposed, and then the significance test of the matrix domain is carried out. The insignificant matrix domain is deleted, and the camera calibration is carried out based on the MATLAB camera toolbox. In this process, the hybrid programming method of MATLAB and VC++ is innovatively used, so that the matrix domain matrix obtained by correction can be directly called into the subsequent image processing program, reducing the complexity of the system.

[0017] The third part includes image pre-processing, edge recognition of flange disk positioning holes, calculation of center coordinates and radius of feature focus transformation, and accurate calibration of pixel equivalent. The calculation target includes recognition and extraction of flange disk positioning holes, calculation of center coordinates, circumference radius and angle between four small positioning holes about the center of the large circle of flange disk positioning holes, image noise filtering, image edge recognition, target edge matrix domain curve fitting, result matrix domain calculation, accurate calibration of pixel equivalent, and conversion of measured image data into real size.

[0018] The fourth part serves as a visual operation platform for the flange disk positioning hole detection algorithm, which realizes the image processing algorithms and corresponding image processing processes of the first three parts. The detection system visualization interface is implemented using MFC coding, and the system's image processing algorithm is implemented using a mixed coding of C++ and OpenCV. The MFC dialog box is used to develop the software interface layout, and all controls are displayed through a dialog box layout. The callback functions of each control and the CCD camera driver and image decoding and display program are written. Finally, OpenCV is used to implement image processing and calculate the matrix domain information of the flange disk positioning hole.

[0019] Preferably, the automobile flange positioning hole detection system architecture is as follows: the CCD camera is fixed on the connecting rod by the camera firmware, the LED light source with a frosted glass lampshade is firstly put on the housing of the CCD camera to ensure that the LED light source surface is parallel to the CCD lens, and then the CCD camera is fixed on the connecting rod, the connecting rod is fixed to the upper top of the support arm by a knob through a fixing part, and then the object to be tested is placed on the support seat of the test platform, the support seat is fixed on the fixing seat, and the support arm and the fixing seat are directly connected to the base;

[0020] First, adjust the support arm so that it is perpendicular to the work platform, and then adjust the knob to make the connecting rod parallel to the base. Install the CCD camera in the corresponding position so that the center of the CCD camera lens is in a straight line with the center of the object to be measured. Then put the ring-shaped LED light source on the periphery of the camera and fix it. Then adjust it again so that the lens plane is parallel to the end face of the part to be measured. The light source uses forward lighting to obtain the surface edge information of the target part.

[0021] Preferably, the software framework of the flange disk positioning hole detection system consists of two parts: pixel equivalent precise calibration and visual measurement. The pixel equivalent precise calibration module determines the size correspondence between the target size to be detected and the pixel size in the image, and calculates the actual size of the target object according to the image detection result. The pixel equivalent precise calibration part is run once every time the CCD detection system is adjusted, and the pixel equivalent calibration result is stored to provide a reference basis for subsequent visual measurement; the visual measurement module includes an image pre-processing module, an image distortion correction module, an edge detection module, a positioning hole target detection module and a measurement data processing and storage module, wherein the image pre-processing module performs filtering and denoising on the initial image collected by the CCD camera to reduce the noise in the image and enhance the useful detail information in the image, and the image distortion is corrected. The correction module uses the CCD system distortion error obtained by camera calibration, and performs distortion correction processing on the image to better display the initial image information. The edge detection module obtains the edge contour information of the positioning hole target. The positioning hole target detection module obtains the curve equation corresponding to the target contour according to the edge contour information of the image target through the image matrix domain space fitting method, and thus determines the position and size of the target hole. The system software provides a radius size range setting for the positioning hole to be detected. The user sets the detection range according to the size of the positioning hole to be detected to speed up the detection process. Finally, the data processing and storage module uses the calculated target hole position and size according to the proportional coefficient of pixel calibration to obtain the actual size of the target hole, and displays the result on the software interface. The qualified detection system is determined based on the displayed result.

[0022] Preferably, flange disk image distortion model: a flange disk image distortion model is proposed, based on the fact that the measured surface of the system is perpendicular to the axis of the CCD camera lens, assuming that the imaging surface of the end face of the automobile part is P, the P surface is perpendicular to the optical axis of the camera, the curved surface S is a semicircular surface with the center of the lens as the circle center and the focal length f as the radius, and the curved surface S is tangent to the ideal imaging surface P and the point O on the optical axis;

[0023] When there is a point P1 in the incident light beam, in the absence of distortion, the image of P1 should fall on point P2 on the P plane. The distortion makes the vertical plane P1 approximate the curved surface S. At this time, P2 is equivalent to P3. The imaging surface of CCD is parallel to the P plane, so P3 is projected parallel to the imaging surface to become point P4. The imaging surface is curved, and the curved surface is a distortion equivalent curved surface.

[0024] Different visual measurement systems have different types of distortion, which causes deviations in the image coordinates (μ, ν) in the imaging plane, namely:

[0025] μ′=μ+δ μ (μ, ν) Formula 1

[0026] ν′=ν+δ v(μ, ν) Formula 2

[0027] Where μ, ν are the image coordinates when no distortion occurs, μ′, ν′ are the image coordinates when distortion occurs in the measurement system, and δ μ (μ, ν), δ ν (μ, ν) is the coordinate difference under the influence of distortion;

[0028] The imaging linear equation model is combined with Equation 1 and Equation 2 to obtain the nonlinear imaging model of the optical imaging system. Several matrix domain values ​​are obtained through the camera calibration process, and then the matrix domain is brought in to complete the distortion correction of the system.

[0029] Preferably, the correction of the image distortion model: first consider that there are multiple distortions in the lens group, then perform a significance test on the matrix domain, and delete the insignificant matrix domain. The test method is as follows:

[0030] H v :The original hypothesis E(a t )=0;

[0031] The statistics are:

[0032] In the above formula: a t is the estimate of the t-th matrix domain. When υ = 0, S0 represents the weighted mean square error of the average value of the distortion matrix domain, Q n is the corresponding corner element of the cofactor matrix of the distortion matrix domain, υ is the statistical degree of freedom, n is the total number of observations, and μ is the number of distortion matrix domains;

[0033] When a given t After that, based on υ and a t , and the critical value t of the t distribution is obtained a , when t<t a When , the matrix domain is not significant and is deleted in the next iteration;

[0034] The correlation between different matrix domains is tested, and the correlation coefficient between any two matrix domains is:

[0035]

[0036] Where: Q i,j are the corresponding i,j elements in the cofactor matrix Q.

[0037] Preferably, image pre-processing: only for filtering out image noise, use an m*n filter mask, where m and n are odd numbers, and smoothly move the filter mask from the top of the image to calculate the sizes of all pixels in the m*n neighborhood of each pixel in the image, sort the sizes of all pixels, and take the middle value after sorting as the grayscale value of the pixel after filtering, eliminate scattered points and salt and pepper noise in the image, and preserve the edge of the image so that it is not affected by filtering and does not cause blur or unclear edge contours.

[0038] Preferably, the edge identification of the flange plate positioning hole:

[0039] Step 1: Directly perform edge extraction on the image. After edge extraction, the binary image is obtained. The position of the large circle is cropped out separately. According to the known radius of the large circle, a reasonable cropping size is set to obtain the cropped large circle image.

[0040] Step 2: Further process the edges of the cropped large circles to eliminate the influence of other edges. First, perform the closing operation in morphology to fill the interference edges between the large circles, use the median filter to filter out some discontinuous areas around the image, and perform edge extraction again on the processed binary image without any interference edges, so as to obtain the outline information of the clear large circle.

[0041] Step 3: Identify the edges of the four small positioning holes. The positions of the four positioning holes are directly calculated in the original image when shooting. The morphological method is used to fill the interference stripes around the small circle. The initial edge image is closed to remove the interference of the stripes on the flange disk surface. The median filter is used to filter out the arc stripe interference.

[0042] Preferably, the feature focus transformation calculates the coordinates of the center of the circle and the radius: the detection of the circle adopts direct fitting of the feature focus transformation. For any pixel point (x, y) in the image, it is converted to the matrix domain space represented by the three matrix domains r, a, and b, x=a+r*cos(θ), y=b+r*sin(θ). For any group (x, y) on the edge of the image, the corresponding a and b in the matrix domain space are obtained, wherein a point (a, b) in the matrix domain space is on a circle with (x, y) as the center and r as the radius in the matrix domain space. For all points on the edge of the image, the corresponding circle in the matrix domain space is obtained. If the obtained matrix domain (a, b) is within a reasonable range, the position of the corresponding matrix domain space is added by 1, otherwise no processing is performed. Finally, the matrix domains in the matrix domain space are sorted according to the size of their statistical values, and the several fitted circles that meet the conditions are obtained according to the size of the sorting, so as to obtain the coordinates of the center of the circle and the radius of the corresponding circle.

[0043] The calculation steps of the characteristic focus transformation for detecting the location of the positioning hole in the flange disk image using the characteristic focus transformation are as follows:

[0044] Step 1: Detect the edges in the image through the edge detection algorithm and save the location information of all edge points;

[0045] Step 2: Set the range and step size of the angle θ and radius r, and iterate according to the step size;

[0046] Step 3: Calculate the values ​​of a and b of all points on the edge of the image in their corresponding matrix domain space according to the formula x=a+r*cos(θ), y=b+r*sin(θ), accumulate the matrix domain values ​​that meet the specified range, and finally sort them according to the accumulated results to obtain the fitted circle;

[0047] By presetting the range of r, iterative calculation is performed only within the specified range, which reduces the number of iterations of feature focus transformation and saves calculation time.

[0048] The angle between the four small circles about the center of the large circle is obtained by the cosine theorem. The specific calculation formula is shown in Formula 4, where a and b are the distances from the two positioning holes to the center of the large circle, and c is the distance between the two positioning holes:

[0049]

[0050] Where a and b are the distances from the two positioning holes to the center of the large circle, and c is the distance between the two positioning holes.

[0051] Preferably, pixel equivalent accurate calibration: the coordinates of the center of the circular hole and the radius of the circular hole are calculated according to the pixel size. The corresponding relationship between the pixel size in the image and the actual object size is calculated using the pixel equivalent accurate calibration method. L represents the height of a standard object used for calibration, and l represents the pixel size occupied by the standard object in the image. The proportional relationship between the actual object size and the image pixel size is calculated as shown in Formula 5:

[0052] p=l / L Formula 5

[0053] When performing accurate calibration of pixel equivalent, calibration is performed separately in different areas of the object imaging area, and then when calculating the object size, the area division is multiplied by the corresponding proportional coefficient to improve the accuracy of the system calculation.

[0054] Preferably, the flange disk positioning hole detection system software: the system software provides an input box for setting the circle radius size for the user to input, and by setting the variation range of the small circle and large circle radii, the intermediate results that are not within the range are excluded during the feature focus transformation process, thereby speeding up the calculation process of the image detection algorithm. The specific large and small circle radii can be set by the user according to the standard size of the flange disk to be detected, and the monitoring results are redrawn on the initial image through a visual method. The user determines whether the detection result is accurate and reliable based on the position information of the detected circle. If the user determines that the detection result is reliable, the detection result is stored in a table through the Save Result button on the software interface, which is convenient for subsequent viewing and inspection.

[0055] Compared with the prior art, the innovations and advantages of this application are:

[0056] (1) The present application has developed a high-precision and high-efficiency automobile parts inspection system, which can measure small-sized workpieces and even micron-level objects, complete inspection and analysis, and achieve the purpose of precise measurement; by detecting the coordinates of the center position of the locating hole in the flange disk image, the circumferential position of the locating hole is determined. This inspection method avoids direct contact with the surface of the part and has greatly improved efficiency compared with traditional inspection. The system is a comprehensive integration of inspection control methods combining visual measurement technology, embedded control and computer software control automation and other disciplines. The automobile flange disk locating hole measurement software system based on visual measurement technology can detect the position information of the flange disk locating hole through precise measurement methods, and distinguish the quality of the flange disk, improve the balance of the automobile drive shaft, and reduce the friction and wear during the movement of the shaft. It has a key impact, and at the same time, it has a great role in promoting the promotion of CCD machine vision technology in practical applications. It is a high-precision, high-efficiency and low-cost automobile parts inspection solution.

[0057] (2) The present application proposes a hardware detection platform for an efficient automobile parts detection system, which is composed of an illumination focusing system, a digital image acquisition system, and a visual measurement detection display system. The camera calibration model is used to calculate the distortion coefficient of the CCD system, and the camera pixel equivalent is accurately calibrated. The proportional relationship between the target object and the pixels in the image is obtained through the pixel equivalent accurate calibration. The actual size of the target object is obtained according to the measurement result in the image. The platform includes the setting of the illumination focusing system, the posture adjustment of the CCD camera, and the calculation of the measurement distance. In the illumination focusing system, the forward light source is used to regionally illuminate the end face of the part, and then the digital imaging device is used to collect the end face image, and the digital image signal is directly transmitted to the computer, and finally the result is output. The hardware platform design is practical and ingenious, and the collected image quality is very high, which is conducive to subsequent detection.

[0058] (3) This application designs a visual measurement and correction system for distorted images, proposes a flange disk image distortion model, performs a significance test on the matrix domain, deletes insignificant matrix domains, and performs camera calibration based on the MATLAB camera toolbox. In this process, an innovative hybrid programming method of MATLAB and VC++ is used, so that the corrected matrix domain matrix can be directly called into the subsequent image processing program, reducing the complexity of the system. This is very suitable for batch high-speed inspection of automotive parts.

[0059] (4) The present application proposes a visual image flange positioning hole detection system, which removes camera jitter, system thermal noise and unclear imaging noise caused by uneven illumination through a series of processes including image pre-processing, flange positioning hole edge recognition, feature focus transformation, calculation of circle center coordinates and radius, and pixel equivalent precise calibration. The camera calibration model is used to calculate the distortion matrix domain of the CCD system, and the image is distorted during the image pre-processing of the measurement system software. The calculation target includes the recognition and extraction of flange positioning holes, and the circle center coordinates, circumference radius and the angle between the four small positioning holes and the center of the large circle of the flange positioning holes are calculated. The contour of the target circle is made clear through morphological processing, and the edge of the target circle is fitted in the image matrix domain space using feature focus transformation. Then, the correct result is determined based on the matrix domain range. The true radius of the circle is obtained through the ratio obtained in the pixel equivalent precise calibration, thereby greatly improving the detection accuracy of automotive parts.

[0060] (5) This application designs a visual measurement and correction visualization operation platform for distorted images, realizes the image processing algorithm and corresponding image processing process of this application, wherein the visualization interface of the detection system is implemented using MFC coding, the system's image processing algorithm is implemented using a mixed coding of C++ and OpenCV, and the software interface layout is developed using the MFC dialog box. All controls are displayed through a dialog box layout, and the callback functions of each control as well as the driver and image decoding display program of the CCD camera are written. Finally, OpenCV is used to implement image processing and calculate the matrix domain information of the flange disk positioning hole. The software has the characteristics of simple interface, simple operation, and complete functions, which is convenient for accelerating special The feature focus transformation detects the accuracy and speed of the positioning hole, and provides an input box for setting the circle radius size for users to input. By setting the change range of the small circle and the large circle radius, the intermediate results that are not within the range are excluded during the feature focus transformation process, thereby speeding up the calculation process of the image detection algorithm. The software redraws the monitoring results through a visual method. The user determines whether the detection result is accurate and reliable based on the position information of the detected circle. If the user determines that the detection result is reliable, the detection result can be stored in a table through the Save Result button on the software interface, which is convenient for subsequent viewing and inspection. It not only has high detection accuracy and efficiency, but is also practical and convenient. It has great practical significance and broad application prospects. BRIEF DESCRIPTION OF THE DRAWINGS

[0061] Figure 1 It is the architecture block diagram of the automobile flange positioning hole detection system.

[0062] Figure 2 It is a structural diagram of the automobile parts image acquisition platform.

[0063] Figure 3 It is the overall design drawing of the flange positioning hole detection system software.

[0064] Figure 4 It is a schematic diagram of the flange disk image distortion model.

[0065] Figure 5 This is a comparison chart of the flange plate positioning hole before and after smoothing filtering processing.

[0066] Figure 6 It is the edge map of the original image of the flange plate positioning hole.

[0067] Figure 7 It is the edge diagram of the large circle image of the flange disk positioning hole.

[0068] Figure 8 This is a comparison of the great circle morphological processing and its filtered image before and after.

[0069] Fig. 9 This is a schematic diagram of the edge recognition and extraction process of four small positioning holes.

[0070] Fig.10 These are the images of the small positioning hole and the central large positioning hole obtained by using the characteristic focus transformation.

[0071] Fig.11 This is a schematic diagram of the pixel equivalent calibration of automobile parts.

[0072] Fig.12 It is a schematic diagram of the software interface of the flange positioning hole detection system.

[0073] Fig.13 It is a schematic diagram comparing the visual measurement results of the experimental flange disk. DETAILED DESCRIPTION

[0074] The following is a further description of the technical solution of the automobile flange positioning hole detection system based on visual measurement provided by the present application in conjunction with the accompanying drawings, so that those skilled in the art can better interpret the present application and implement it.

[0075] The efficiency and accuracy of parts inspection technology directly affect the product quality in actual production. Especially for the automotive parts processing industry, a parts inspection system with high precision and low time consumption is extremely important. Compared with traditional inspection methods, the visual measurement system constructed in this application has greatly improved the efficiency and accuracy of inspection.

[0076] This application first constructs the architecture of the automobile flange positioning hole detection system, including three major parts: an automobile part image acquisition platform, a distorted image visual measurement correction system, and a visual image flange positioning hole detection system. The first part belongs to the hardware detection platform of the system, which is composed of a light focusing system, a digital image acquisition system, and a visual measurement detection display system, including the setting of the light focusing system, the posture adjustment of the CDD camera, and the calculation of the measurement distance. In the light focusing system, a forward light source is used to regionally illuminate the end face of the part, and then a digital imaging device is used to collect the end face image, and the digital image signal is directly transmitted to the computer, and finally the result is output; the second part includes a flange image distortion model and correction of the image distortion model, and a flange image distortion model is proposed, and then a significance test of the matrix domain is performed to identify the undistorted image. Significant matrix domain deletion is performed, and camera calibration is performed based on the MATLAB camera toolbox. In this process, the innovative hybrid programming method of MATLAB and VC++ is used, so that the matrix domain matrix obtained by correction can be directly called into the subsequent image processing program, greatly reducing the complexity of the system; the third part includes image pre-processing, edge recognition of flange disk positioning holes, characteristic focus transformation to calculate the center coordinates and radius, and pixel equivalent precise calibration. The calculation target includes the recognition and extraction of flange disk positioning holes, calculation of the center coordinates of the flange disk positioning holes, the radius of the circle, and the angle between the four small positioning holes and the center of the large circle. After image noise filtering, image edge recognition, target edge matrix domain curve fitting, and result matrix domain calculation, pixel equivalent precise calibration is performed to convert the measured image data into real size.

[0077] Finally, actual experiments were carried out on the detection system designed in this application in the actual factory environment, and the test results met the requirements put forward by GAC. Compared with the three-coordinate measuring machine detection method used before, the detection efficiency and accuracy were greatly improved, and batch detection was realized.

[0078] 1. Architecture of automobile flange positioning hole detection system

[0079] It consists of a light focusing system, a digital image acquisition system, and a visual measurement, detection, and display system. The system structure diagram is as follows: Figure 1 In the light focusing system, the forward light source is used to irradiate the end face of the part in a regional manner, and then the end face image is collected by a digital imaging device, and the digital image signal is directly transmitted to the computer, and finally the result is output.

[0080] like Figure 2, the CCD camera 2 is fixed on the connecting rod 3 by the camera firmware, firstly, the LED light source 1 with a frosted glass lampshade is put on the housing of the CCD camera to ensure that the LED light source surface is parallel to the CCD lens, and then the CCD camera is fixed on the connecting rod 3, and the connecting rod 3 is fixed to the upper top of the support arm 6 by the knob 5 through the fixing member 4, and then the object to be tested 10 is placed on the test platform support seat 9, the support seat 9 is fixed on the fixing seat 8, and the support arm 6 and the fixing seat 8 are directly connected to the base 7;

[0081] First, adjust the support arm 6 so that the support arm is perpendicular to the work platform, then adjust the knob 5 to make the connecting rod 3 parallel to the base, install the CCD camera in the corresponding position, make the center of the CCD camera lens and the center of the object to be measured in a straight line, then put the ring-shaped LED light source on the periphery of the camera and fix it, and then adjust it again so that the lens plane is parallel to the end face of the part to be measured. The light source uses forward lighting to obtain the surface edge information of the target part.

[0082] The choice of light source is the key to ensure the quality of the image. High-brightness LED lamps not only have good lighting effects, long working hours, and stable light emission, but also use cold light emission, which generates much less heat than ordinary lighting fixtures, consumes less power, and has a long service life. LED lamps with frosted glass lampshades can ensure the uniformity of the light source and obtain better quality images.

[0083] Based on the schematic diagram of the image acquisition and measurement optical path, the horizontal viewing angle of the lens is 46°, L is the distance between the part and the lens, L is 95mm, each pixel in the image represents a real size less than 50um, the resolution of the camera is 2592*1944 pixels, the end face of the part is 115mm, the field of view height is 92mm, and the vertical height of the part in the field of view just fills the vertical height of the camera.

[0084] 2. Software framework of flange positioning hole detection system

[0085] Figure 3The figure shows the overall design architecture of the flange disk positioning hole detection system software. The system software consists of two parts: pixel equivalent precise calibration and visual measurement. The pixel equivalent precise calibration module determines the size correspondence between the target size to be detected and the pixel size in the image, and calculates the actual size of the target object based on the image detection result. The pixel equivalent precise calibration part runs once every time the CCD detection system is adjusted, and the pixel equivalent calibration results are stored to provide a reference for subsequent visual measurement. The visual measurement module includes an image pre-processing module, an image distortion correction module, an edge detection module, a positioning hole target detection module, and a measurement data processing and storage module. The image pre-processing module performs filtering and denoising on the initial image collected by the CCD camera to reduce the noise in the image and enhance the useful detail information in the image. The image distortion correction module uses the phase The CCD system distortion error obtained by machine calibration is processed, and the image is subjected to distortion correction to better display the initial image information. The edge detection module obtains the edge contour information of the positioning hole target. The positioning hole target detection module obtains the curve equation corresponding to the target contour according to the edge contour information of the image target through the image matrix domain space fitting method, and thereby determines the position and size of the target hole. The system software provides the radius size range setting of the positioning hole to be detected. The user sets the detection range according to the size of the positioning hole to be detected to speed up the detection process. Finally, the data processing and storage module uses the calculated target hole position and size to obtain the actual size of the target hole according to the proportional coefficient of pixel calibration, and displays the result on the software interface. The qualified detection system is determined based on the displayed result.

[0086] 1. Camera calibration: The camera calibration model is used to calculate the distortion coefficient of the CCD system, and the camera pixel equivalent is accurately calibrated. The proportional relationship between the target object and the pixels in the image is obtained through accurate pixel equivalent calibration, and the actual size of the target object is obtained based on the measurement results in the image;

[0087] 2. Image pre-processing: including image filtering and denoising, image distortion correction, where image filtering and denoising removes camera jitter, system thermal noise, and unclear imaging noise caused by uneven illumination; the camera calibration model is used to calculate the distortion matrix domain of the CCD system, and the image is distorted and corrected during the image pre-processing process of the measurement system software;

[0088] 3. Image edge detection: Find the edge information of the target object to be measured from the binary or grayscale image, extract the contours of the four small holes and the center graduation circle of the flange disk, obtain the position information of the edge of the target to be measured, and calculate the center position of the positioning hole by fitting method;

[0089] 4. After obtaining the contour of the target circle, the position and size of the detection circle are cleared by morphological processing, and then the edge of the target circle is fitted in the image matrix domain space by feature focus transformation, and then the correct result is determined according to the matrix domain range;

[0090] 5. Result data processing and analysis: Given the position and radius of the circle in the image, the angles between the four small circles and the central dividing circle can be directly calculated using trigonometric cosines, and the true radius of the circle can be calculated using the ratio obtained through precise calibration of pixel equivalents.

[0091] 6. Visualization of test results: The image to be tested is displayed on the software by combining MFC and OpenCV, and the position of the detected circle is marked on the initial image by marking the image after feature focus transformation detection, so that users can observe whether the test results are reliable. At the same time, the test result information is displayed on the right side of the software.

[0092] 3. Visual measurement correction of distorted images

[0093] In the computer vision system for automobile flange locating hole detection, LED lighting and CCD cameras are used to collect external three-dimensional information. In order to obtain part information in a large field of view, a wide-angle lens with a short focal length is used. Because the shorter the focal length of the camera, the wider the field of view, the wider the image obtained. At the same time, the shorter the focal length of the lens and the wider the field of view, the more serious the image distortion is, which cannot meet the normal visual effect and the measurement accuracy will be greatly reduced. Therefore, it is necessary to perform visual measurement correction on the distorted image.

[0094] Image distortion is caused by the introduction of wide-angle lenses. Distortion exists in various forms. Different distortion models have different characteristics. Relevant experiments have shown that when performing distortion correction, the more models are selected, the higher the correction accuracy will be. On the contrary, if too many models are selected, the correction accuracy will be reduced. Therefore, different distortions must be analyzed one by one.

[0095] 1. Flange disk image distortion model

[0096] Since the optical imaging principle of the camera will cause off-axis point imaging, whether it is a wide beam or a thin beam, due to the existence of spherical aberration, the intersection of the actual light on the image side and the optical axis will have a certain distance difference relative to the intersection of the paraxial light and the optical axis, which will make the image lose its approximation in geometric shape relative to the original object. This is the distortion of the system. Since there is a certain distance difference between the intersection of the actual light on the image side and the optical axis and the intersection when there is no distortion, the image is deformed, and this distortion is nonlinear, and there are also photoelectric conversion errors, environmental noise, and CCD manufacturing process errors. These reasons will affect the size of image distortion, among which the error of the lens group has the greatest impact on the distortion. Based on this, this application proposes a flange disk image distortion model.

[0097] Based on the relationship that the measured surface and the axis of the CCD camera lens are perpendicular to each other in this system, it is assumed that the imaging surface of the end face of the automobile part is P, and the P surface is perpendicular to the optical axis of the camera. The curved surface S is a semicircular surface with the center of the lens as the circle center and the focal length f as the radius. The curved surface S is tangent to the ideal imaging surface P and point O on the optical axis, such as Figure 4 shown.

[0098] When there is a point P1 in the incident light beam, in the absence of distortion, the image of P1 should fall on point P2 on the P plane. The distortion makes the plane P1, which should be a vertical plane, approximate the curved surface S. At this time, P2 is equivalent to P3. The imaging surface of the CCD is parallel to the P plane, so P3 is projected parallel to the imaging surface and becomes point P4. The imaging surface is bent, and the curved surface is a distortion equivalent curved surface.

[0099] Different visual measurement systems have different types of distortion, which causes deviations in the image coordinates (μ, ν) in the imaging plane, namely:

[0100] μ′=μ+δ μ (μ, ν) Formula 1

[0101] ν′=ν+δ ν (μ, ν) Formula 2

[0102] Where μ, ν are the image coordinates when no distortion occurs, μ′, ν′ are the image coordinates when distortion occurs in the measurement system, and δ μ (μ, ν), δ ν (μ, ν) is the coordinate difference under the influence of distortion;

[0103] The imaging linear equation model is combined with Equation 1 and Equation 2 to obtain the nonlinear imaging model of the optical imaging system. Several matrix domain values ​​are obtained through the camera calibration process, and then the matrix domain is brought in to complete the distortion correction of the system.

[0104] 2. Correction of image distortion model

[0105] First, consider that there are multiple distortions in the lens group, and then perform a significance test on the matrix domain, and delete the insignificant matrix domains. The test method is as follows:

[0106] H v :The original hypothesis E(a t )=0;

[0107] The statistics are:

[0108] In the above formula: a t is the estimate of the t-th matrix domain. When υ = 0, S0 represents the weighted mean square error of the average value of the distortion matrix domain, Q n is the corresponding corner element of the cofactor matrix of the distortion matrix domain, υ is the statistical degree of freedom, n is the total number of observations, and μ is the number of distortion matrix domains.

[0109] When a given t After that, based on υ and a t , and the critical value t of the t distribution is obtained a , when t<t a , the matrix domain is not significant and is deleted in the next iteration.

[0110] The correlation between different matrix domains is tested, and the correlation coefficient between any two matrix domains is:

[0111]

[0112] Where: Q i,j are the corresponding i,j elements in the cofactor matrix Q.

[0113] 4. Visual image flange positioning hole detection method

[0114] The calculation objectives include the recognition and extraction of the flange disk positioning holes, the calculation of the center coordinates of the flange disk positioning holes, the circumference radius and the angle between the four small positioning holes and the center of the large circle. The specific image processing steps include image preprocessing, image edge recognition, target edge matrix domain curve fitting, and result matrix domain calculation.

[0115] 1. Image pre-processing

[0116] The CCD visual measurement environment of this application is relatively fixed and the background is single, so the image pre-processing process is only aimed at filtering out image noise. Use an m*n filter mask, where m and n are odd numbers, and smoothly move the filter mask from the top of the image to calculate the size of all pixels in the m*n neighborhood of each pixel in the image, sort the size of all pixels, and take the middle value after sorting as the gray value of the pixel after filtering, eliminating the scattered points and salt and pepper noise in the image, and better preserve the edge of the image so that it is not affected by filtering and blurring or unclear edge contours occur.

[0117] (II) Edge identification of flange positioning hole

[0118] Figure 5 The left side shows a plan view of the flange disk taken with a camera. From the figure, it can be seen that the surface of the flange disk reflects light strongly, resulting in many obvious black shadows in the image. Therefore, the image needs to be filtered first. The image after filtering is as follows: Figure 5 As shown on the right, it can be seen from the figure that the shadow part of the image is significantly weakened after filtering, and the black part in the middle of the straight texture next to the four small positioning holes on the image surface is also significantly weakened, indicating that the filtering has a good effect on the processing of image shadows and can enhance the image contrast.

[0119] Step 1: Directly extract the edge of the image. The binary image obtained after edge extraction is as follows Figure 6 As shown. Figure 6 It can be seen that due to the presence of many various stripes on the surface of the flange disk and the reflection of the flange disk surface, there are a large number of complex interference edges in the direct edge detection results, which is very unfavorable for the recognition of the edge of the target positioning hole. For the recognition of the large circle at the center of the image, considering that the position of the large circle must be located at the center of the image each time the image is taken, even if the orientation of the flange disk is different during shooting, the large circle will still be at the exact center of the image. Therefore, the position of the large circle is cropped out separately, and according to the known radius of the large circle, a reasonable cropping size is set to obtain the cropped large circle image. Figure 7 Shown is the edge information of the cropped large circle.

[0120] Step 2: Further process the edges of the cut-out large circle to eliminate the influence of other edges. Figure 7 The edge image shown in the figure has difficulty in identifying the target edge due to the interference of other edges. From the edge image, it can be seen that the edges of the two large circles are closed, and the size of the closed area is obviously smaller than the radius of the large circle. Therefore, the closing operation in morphology is first performed to fill the interference edges between the large circles. After filling, the following is obtained Figure 8The image on the left shows that the image not only completely preserves the edge information of the large circle, but also eliminates other interfering edges. However, there are still some discontinuous areas around the image. The area of ​​these areas is relatively small, so median filtering is used to filter them out. Figure 8 The image on the left is obtained after median filtering. Figure 8 As shown on the right, it can be seen from the figure that the interference items have been completely filtered out. If edge extraction is performed again on the processed binary image, there will be no interference edges, and clear large circle contour information can be obtained.

[0121] Step 3: Identify the edges of the four small positioning holes. The four positioning holes are not fixed when photographing, so they cannot be cut out and calculated separately. They need to be calculated directly in the original image, and it is very difficult to extract the edges in the original image. Considering that there are a lot of interference stripes around the small circle, these stripes are closed and the closed area is small, so a morphological method is used to fill the interference stripes around the small circle. First, the initial edge image is closed to remove the interference of the stripes on the flange surface. The image obtained is as follows: Fig. 9 As shown on the left, it can be seen from the figure that after the closing operation, the straight stripes in the original image are expanded and disappear, and the remaining arc stripes are obviously thinner than the target. Therefore, the median filter is used to filter out the arc stripe interference. The image after filtering is as follows Fig. 9 As shown on the right, the outlines of the four positioning holes are clear and there are no interfering edges around them. Although there are still some small blocks in the image, these blocks have little effect on the edge extraction of the positioning holes. These interference items can be eliminated in the subsequent edge curve fitting process.

[0122] (III) Characteristic focus transformation to calculate the center coordinates and radius

[0123] The detection of circles adopts direct fitting of feature focus transformation. For any pixel point (x, y) in the image, it is converted to the matrix domain space represented by three matrix domains r, a, and b, where x = a + r*cos(θ) and y = b + r*sin(θ). For any group (x, y) on the edge of the image, the corresponding a and b in the matrix domain space are obtained, where a point (a, b) in the matrix domain space is on a circle with (x, y) as the center and r as the radius in the matrix domain space. For all points on the edge of the image, the corresponding circle in the matrix domain space is obtained. If the obtained matrix domain (a, b) is within a reasonable range, the position of the corresponding matrix domain space is added by 1, otherwise no processing is performed. Finally, the matrix domains in the matrix domain space are sorted according to the size of their statistical values. According to the size of the sorting, the several fitted circles that meet the conditions are obtained, and the center coordinates and radius of the corresponding circle can be obtained.

[0124] The calculation steps of the characteristic focus transformation for detecting the location of the positioning hole in the flange disk image using the characteristic focus transformation are as follows:

[0125] Step 1: Detect the edges in the image through the edge detection algorithm and save the location information of all edge points;

[0126] Step 2: Set the range and step size of the angle θ and radius r, and iterate according to the step size;

[0127] Step 3: Calculate the values ​​of a and b of all points on the edge of the image in their corresponding matrix domain space according to the formula x=a+r*cos(θ), y=b+r*sin(θ), accumulate the matrix domain values ​​that meet the specified range, and finally sort them according to the accumulated results to obtain the fitted circle;

[0128] The size of the flange disk image obtained by the initial shooting is large, and there are many pixels on the edge of the image. The operation speed of directly processing the original image will be very slow. In order to speed up the calculation speed of the characteristic focus transformation, by presetting the range of r, only r is iterated within the specified range, reducing the number of iterations of the characteristic focus transformation and saving a lot of calculation time.

[0129] Fig.10 The images of the four small positioning holes and the central large positioning hole obtained by the characteristic focus transformation are shown in the figure, and the detection results are marked with circles. It can be seen from the figure that the positions and sizes of the four small positioning holes and the central large hole are basically consistent with the positions and sizes of the holes in the original image, and the interference of the shadow part in the small positioning hole does not affect the detection result of the characteristic focus transformation, indicating that the filtering and morphological processing methods in the edge detection process are very effective, which shows that the method of the present application can correctly calculate the size and position of the positioning hole.

[0130] for Fig.10 The calculated sizes of the four positioning holes and the corresponding center coordinates are as follows (the brackets represent x, y, and r, i.e. the x coordinate, y coordinate and radius r of the circle): (529, 123, 83), (1293, 139, 82), (1295, 1775, 80), (2057, 675, 82), and the calculated size of the large circle and the corresponding center coordinates are as follows: (1291, 961, 251).

[0131] The angle between the four small circles about the center of the large circle is obtained by the cosine theorem. The specific calculation formula is shown in Formula 4, where a and b are the distances from the two positioning holes to the center of the large circle, and c is the distance between the two positioning holes:

[0132]

[0133] Where a and b are the distances from the two positioning holes to the center of the large circle, and c is the distance between the two positioning holes.

[0134] (IV) Pixel Equivalent Precision Calibration

[0135] The coordinates of the center of the circular hole and the radius of the circular hole are calculated according to the pixel size, and the pixel equivalent accurate calibration method is used to calculate the corresponding relationship between the pixel size in the image and the actual object size. Fig.11 The method shown in the figure calibrates the pixel equivalent. In the figure, L represents the height of a standard object used for calibration, and l represents the pixel size occupied by the standard object in the image. The proportional relationship between the actual object size and the image pixel size is calculated as shown in Formula 5:

[0136] p=l / L Formula 5

[0137] Taking into account the influence of the camera imaging process and the non-perpendicularity of the object surface, there are deviations in the pixel calibration coefficients of different areas in the image. Therefore, when performing accurate pixel equivalent calibration, calibration is performed separately in different areas of the object imaging area, and then when calculating the object size, the area division is multiplied by the corresponding proportional coefficient to improve the accuracy of the system calculation.

[0138] 5. Flange positioning hole detection system software

[0139] The flange disk positioning hole detection system software is a visual operation platform for the flange disk positioning hole detection algorithm, which implements the image processing algorithm of this application and the corresponding image processing process. The detection system visualization interface is implemented using MFC coding, and the system's image processing algorithm is implemented using a mixed coding of C++ and OpenCV. This application uses the MFC dialog box to develop the software interface layout, presents all controls through a dialog box layout, and writes the callback functions of each control as well as the driver and image decoding display program of the CCD camera. Finally, OpenCV is used to implement image processing and calculate the matrix domain information of the flange disk positioning hole. The flange disk positioning hole detection system software interface designed by this application is as follows: Fig.12 shown.

[0140] The flange disk positioning hole detection system software has the characteristics of simple interface, simple operation and complete functions. In order to speed up the accuracy and detection speed of the positioning hole detection by feature focus transformation, the system software provides an input box for setting the circle radius size for users to input. By setting the range of changes in the radius of the small circle and the large circle, the intermediate results that are not within the range are excluded during the feature focus transformation process, and the calculation process of the image detection algorithm is accelerated. The specific radius of the large and small circles can be set by the user according to the standard size of the flange disk to be detected. Finally, the software redraws the monitoring results on the initial image through a visual method. The user judges whether the detection result is accurate and reliable based on the position information of the detected circle. If the user judges that the detection result is reliable, the detection result can be stored in the table through the Save Result button on the software interface, which is convenient for subsequent viewing and inspection.

[0141] VI. Experimental Results and Analysis

[0142] For the flange disk image detection system designed in this application, in order to verify the detection accuracy and error analysis of the system, 10 DC3311-B spline sleeves of the same batch produced by GAC Passenger Vehicle Co., Ltd. were randomly selected. The production standard of the diameter of the pitch circle in the spline sleeve flange disk is 77.6mm, the production standard of the measuring rod diameter is 4.5mm, and the standard of the angle between two adjacent holes relative to the center hole is 70°. The specific experimental method is to use the spline sleeve flange disk detection system of this application and the three-coordinate measuring instrument to test these 10 spline sleeve flange disks respectively, and compare the detection results of the two methods through a table. The test results are shown in the table. Fig.13 shown.

[0143] analyze Fig.13 The results show that the diameter error of the flange visual measurement system software and the three-coordinate measuring machine is less than 0.03 mm, and the error of the angle between the center of the measuring rod and the center of the pitch circle is less than 0.08°, both of which meet the measurement error standards required by this system. The average measurement time of the flange visual measurement system software is within 1 minute, while the measurement time of the three-coordinate measuring machine is generally more than 10 minutes, and the detection results of the three-coordinate measuring machine need to be manually filled in and recorded.

[0144] Based on the experimental data results and analysis, the following conclusions can be drawn: the results obtained by the flange disk image detection system are consistent with the detection results of the traditional three-dimensional coordinate measuring instrument. The error of the circle radius is less than 0.03 mm, and the detection error of the measuring rod angle is less than 0.08°. The flange disk image detection system has the advantages of small repeatability detection error, fast detection speed, and convenient data storage. Therefore, the flange disk image detection system not only improves the accuracy of flange disk detection, but also improves the efficiency of flange disk detection.

Claims

1. The automobile flange positioning hole detection system based on visual measurement is characterized by: Construct the automobile flange locating hole detection system architecture, including automobile parts image acquisition platform, distorted image visual measurement correction system, visual image flange locating hole detection system, and flange locating hole detection system software; The first part belongs to the hardware detection platform of the system, which is composed of the light focusing system, digital image acquisition system, and visual measurement detection display system. It includes the setting of the light focusing system, the posture adjustment of the CDD camera, and the calculation of the measurement distance. In the light focusing system, the forward light source is used to regionally illuminate the end face of the part, and then the end face image is collected by the digital imaging device, and the digital image signal is directly transmitted to the computer, and finally the result is output; The second part includes the flange disk image distortion model and the correction of the image distortion model. The flange disk image distortion model is proposed, and then the significance test of the matrix domain is carried out. The insignificant matrix domain is deleted, and the camera calibration is carried out based on the MATLAB camera toolbox. In this process, the hybrid programming method of MATLAB and VC++ is innovatively used, so that the matrix domain matrix obtained by correction can be directly called into the subsequent image processing program, reducing the complexity of the system. The third part includes image pre-processing, edge recognition of flange disk positioning holes, calculation of center coordinates and radius of feature focus transformation, and accurate calibration of pixel equivalent. The calculation target includes recognition and extraction of flange disk positioning holes, calculation of center coordinates, circumference radius and angle between four small positioning holes about the center of the large circle of flange disk positioning holes, image noise filtering, image edge recognition, target edge matrix domain curve fitting, result matrix domain calculation, accurate calibration of pixel equivalent, and conversion of measured image data into real size. The fourth part serves as a visual operation platform for the flange disk positioning hole detection algorithm, which realizes the image processing algorithms and corresponding image processing processes of the first three parts. The detection system visualization interface is implemented using MFC coding, and the system's image processing algorithm is implemented using a mixed coding of C++ and OpenCV. The MFC dialog box is used to develop the software interface layout, and all controls are displayed through a dialog box layout. The callback functions of each control and the CCD camera driver and image decoding and display program are written. Finally, OpenCV is used to implement image processing and calculate the matrix domain information of the flange disk positioning hole.

2. The automobile flange positioning hole detection system based on visual measurement according to claim 1 is characterized in that: The structure of the automobile flange positioning hole detection system is as follows: a CCD camera (2) is fixed on a connecting rod (3) by a camera firmware, and an LED light source (1) with a frosted glass lampshade is first put on the housing of the CCD camera to ensure that the LED light source surface is parallel to the CCD lens, and then the CCD camera is fixed on the connecting rod (3), and the connecting rod (3) is fixed to the upper top of the support arm (6) by a knob (5) through a fixing member (4), and then the object to be tested (10) is placed on a test platform support seat (9), and the support seat (9) is fixed on a fixing seat (8), and the support arm (6) and the fixing seat (8) are directly connected to the base (7); First, the support arm (6) is adjusted so that the support arm is perpendicular to the working platform, and then the connecting rod (3) is parallel to the base by adjusting the knob (5). The CCD camera is installed at the corresponding position so that the center of the CCD camera lens and the center of the object to be measured are in a straight line. Then, the ring-shaped LED light source is fixedly installed on the periphery of the camera, and then adjusted again so that the lens plane is parallel to the end face of the part to be measured. The light source illumination adopts the forward illumination mode to obtain the surface edge information of the target part.

3. The automobile flange positioning hole detection system based on visual measurement according to claim 1 is characterized in that: The software framework of the flange disk positioning hole detection system: It consists of two parts: pixel equivalent precise calibration and visual measurement. The pixel equivalent precise calibration module determines the size correspondence between the target size to be detected and the pixel size in the image, and calculates the actual size of the target object based on the image detection result. The pixel equivalent precise calibration part runs once every time the CCD detection system is adjusted, and the pixel equivalent calibration results are stored to provide a reference for subsequent visual measurement; the visual measurement module includes an image pre-processing module, an image distortion correction module, an edge detection module, a positioning hole target detection module, and a measurement data processing and storage module. The image pre-processing module performs filtering and denoising on the initial image collected by the CCD camera to reduce the noise in the image and enhance the useful detail information in the image. The image distortion correction The module uses the CCD system distortion error obtained by camera calibration, and performs distortion correction processing on the image to better display the initial image information. The edge detection module obtains the edge contour information of the positioning hole target. The positioning hole target detection module obtains the curve equation corresponding to the target contour according to the edge contour information of the image target through the image matrix domain space fitting method, and thus determines the position and size of the target hole. The system software provides the radius size range setting of the positioning hole to be detected. The user sets the detection range according to the size of the positioning hole to be detected to speed up the detection process. Finally, the data processing and storage module uses the calculated target hole position and size according to the proportional coefficient of pixel calibration to obtain the actual size of the target hole, and displays the result on the software interface. According to the displayed result, it is determined whether the detection system is qualified.

4. The automobile flange positioning hole detection system based on visual measurement according to claim 1 is characterized in that: Flange disk image distortion model: The flange disk image distortion model is proposed, based on the fact that the measured surface of this system is perpendicular to the axis of the CCD camera lens. It is assumed that the imaging surface of the end face of the automobile part is P, and the P surface is perpendicular to the optical axis of the camera. The curved surface S is a semicircular surface with the center of the lens as the circle center and the focal length f as the radius. The curved surface S is tangent to the ideal imaging surface P and the 0 point on the optical axis. When there is a point P1 in the incident light beam, in the absence of distortion, the image of P1 should fall on point P2 on the P plane. The distortion makes the vertical plane P1 approximate the curved surface S. At this time, P2 is equivalent to P3. The imaging surface of CCD is parallel to the P plane, so P3 is projected parallel to the imaging surface to become point P4. The imaging surface is curved, and the curved surface is a distortion equivalent curved surface. Different visual measurement systems have different types of distortion, which causes deviations in the image coordinates (μ, v) in the imaging plane, namely: μ′ = μ + δ μ (μ, v) Equation 1 v′=v+δ v (m,n) formula 2 Where μ, ν are the image coordinates when no distortion occurs, μ′, v′ are the image coordinates when distortion occurs in the measurement system, and δ μ (μ, ν), δ v (μ, v) is the coordinate difference under the influence of distortion; The imaging linear equation model is combined with Equation 1 and Equation 2 to obtain the nonlinear imaging model of the optical imaging system. Several matrix domain values ​​are obtained through the camera calibration process, and then the matrix domain is brought in to complete the distortion correction of the system.

5. The automobile flange positioning hole detection system based on visual measurement according to claim 1 is characterized in that: Correction of the image distortion model: First consider the existence of multiple distortions in the lens group, then perform a significance test on the matrix domain and delete the insignificant matrix domains. The test method is as follows: H v :The original hypothesis E(a t )=0; The statistics are: In the above formula: a t is the estimate of the t-th matrix domain. When υ = 0, S0 represents the weighted mean square error of the average value of the distortion matrix domain, Q n is the corresponding corner element of the cofactor matrix of the distortion matrix domain, υ is the statistical degree of freedom, n is the total number of observations, and μ is the number of distortion matrix domains; When a given t After that, based on υ and a t , and the critical value t of the t distribution is obtained a , when t <t a When , the matrix domain is not significant and is deleted in the next iteration; The correlation between different matrix domains is tested, and the correlation coefficient between any two matrix domains is: Where: Q i,j are the corresponding i, j elements in the cofactor matrix Q.

6. The automobile flange positioning hole detection system based on visual measurement according to claim 1 is characterized in that: Image pre-processing: Only for filtering out image noise, use an m*n filter mask, where m and n are odd numbers. Move the filter mask smoothly from the top of the image, calculate the sizes of all pixels in the m*n neighborhood of each pixel in the image, sort the sizes of all pixels, and take the middle value of the sorting as the grayscale value of the pixel after filtering. This eliminates scattered points and salt and pepper noise in the image, and preserves the edges of the image so that they are not affected by filtering and become blurred or have unclear edge contours.

7. The automobile flange positioning hole detection system based on visual measurement according to claim 1 is characterized in that: Edge recognition of flange plate positioning hole: Step 1: Directly perform edge extraction on the image. After edge extraction, the binary image is obtained. The position of the large circle is cropped out separately. According to the known radius of the large circle, a reasonable cropping size is set to obtain the cropped large circle image. Step 2: Further process the edges of the cropped large circles to eliminate the influence of other edges. First, perform the closing operation in morphology to fill the interference edges between the large circles, use the median filter to filter out some discontinuous areas around the image, and perform edge extraction again on the processed binary image without any interference edges, so as to obtain the outline information of the clear large circle. Step 3: Identify the edges of the four small positioning holes. The positions of the four positioning holes are directly calculated in the original image when shooting. The morphological method is used to fill the interference stripes around the small circle. The initial edge image is closed to remove the interference of the stripes on the flange disk surface. The median filter is used to filter out the arc stripe interference.

8. The automobile flange positioning hole detection system based on visual measurement according to claim 1 is characterized in that: Calculate the center coordinates and radius of the circle by feature focus transformation: The detection of the circle adopts direct fitting by feature focus transformation. For any pixel point (x, y) in the image, it is converted to the matrix domain space represented by the three matrix domains r, a, and b, where x = a + r*cos(θ) and y = b + r*sin(θ). For any group (x, y) on the edge of the image, the corresponding a and b in the matrix domain space are obtained, where a point (a, b) in the matrix domain space is on a circle with (x, y) as the center and r as the radius in the matrix domain space. For all points on the edge of the image, the corresponding circle in the matrix domain space is obtained. If the obtained matrix domain (a, b) is within a reasonable range, the position of the corresponding matrix domain space is added by 1, otherwise no processing is performed. Finally, the matrix domains in the matrix domain space are sorted according to the size of their statistical values. According to the size of the sorting, the several fitted circles that meet the conditions are obtained, and the center coordinates and radius of the corresponding circle can be obtained. The calculation steps of the characteristic focus transformation for detecting the location of the positioning hole in the flange disk image using the characteristic focus transformation are as follows: Step 1: Detect the edges in the image through the edge detection algorithm and save the location information of all edge points; Step 2: Set the range and step size of the angle θ and radius r, and iterate according to the step size; Step 3: Calculate the values ​​of a and b of all points on the edge of the image in their corresponding matrix domain space according to the formula x=a+r*cos(θ), y=b+r*sin(θ), accumulate the matrix domain values ​​that meet the specified range, and finally sort them according to the accumulated results to obtain the fitted circle; By presetting the range of r, iterative calculation is performed only within the specified range, which reduces the number of iterations of feature focus transformation and saves calculation time. The angle between the four small circles about the center of the large circle is obtained by the cosine theorem. The specific calculation formula is shown in Formula 4, where a and b are the distances from the two positioning holes to the center of the large circle, and c is the distance between the two positioning holes: Where a and b are the distances from the two positioning holes to the center of the large circle, and c is the distance between the two positioning holes.

9. The automobile flange positioning hole detection system based on visual measurement according to claim 1, characterized in that: Pixel equivalent accurate calibration: The coordinates of the center of the circular hole and the radius of the circular hole are calculated according to the pixel size. The pixel equivalent accurate calibration method is used to calculate the corresponding relationship between the pixel size in the image and the actual object size. L represents the height of a standard object used for calibration, and l represents the pixel size occupied by the standard object in the image. The proportional relationship between the actual object size and the image pixel size is calculated as shown in Formula 5: p=l / L Formula 5 When performing accurate calibration of pixel equivalent, calibration is performed separately in different areas of the object imaging area, and then when calculating the object size, the area division is multiplied by the corresponding proportional coefficient to improve the accuracy of the system calculation.

10. The automobile flange positioning hole detection system based on visual measurement according to claim 1, characterized in that: Flange disk positioning hole detection system software: The system software provides an input box for setting the circle radius size for users to input. By setting the change range of the small circle and large circle radius, the intermediate results that are not in the range are excluded during the feature focus transformation process, thereby speeding up the calculation process of the image detection algorithm. The specific large and small circle radii can be set by the user according to the standard size of the flange disk to be detected. The monitoring results are redrawn on the initial image through a visual method. The user determines whether the detection result is accurate and reliable based on the position information of the detected circle. If the user determines that the detection result is reliable, the detection result is stored in a table through the Save Result button on the software interface for subsequent viewing and inspection.