A method for detecting vehicle body defects based on machine vision
By sorting and comparing the car body surface images and analyzing and determining the shadow area, and comparing it with standard sheet surfaces, the problem of misjudgment caused by unclean body surfaces is solved, and the accuracy and comprehensiveness of body defect detection is improved.
Patent Information
- Application Number
- CN202311179501.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-13
- Publication Date
- 2025-04-08
- Estimated Expiration
- 2043-09-13
AI Technical Summary
The existing machine vision-based vehicle body defect detection method is prone to misjudgment when the vehicle body surface is not clean, affecting the detection effect.
By sorting and comparing the car body surface images, confirming abnormal areas, and analyzing and determining the shadow area, and comparing them with standard sheet surfaces to determine whether there are cracks or depressions.
It improves the accuracy and comprehensiveness of body defect detection, reduces misjudgment, and enhances the detection effect.
Smart Images

Figure CN117218079B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of vehicle body detection, and in particular to a vehicle body defect detection method based on machine vision. Background Art
[0002] Machine vision is a rapidly developing branch of artificial intelligence. Simply put, machine vision is the use of machines to replace human eyes for measurement and judgment. The machine vision system uses machine vision products (i.e. image acquisition devices, which are divided into CMOS and CCD) to convert the captured target into image signals and transmit them to a dedicated image processing system.
[0003] Patent application number CN116205903A discloses a method for detecting vehicle body paint defects based on machine vision, including: dividing the vehicle body into several parts and setting a detection area for each part; performing image acquisition and preprocessing the surface paint image; performing single-frame image defect detection, including extracting light band areas based on multiple thresholds, and detecting defects based on dynamic thresholds and combined with Blob feature analysis; performing fused image defect detection, extracting defect features from the fused image based on the maximum grayscale threshold method, combining multiple basic features of the image to form a comprehensive defect description feature vector and identifying vehicle body defects; performing defect deduplication, deduplicating defect detection results of single-camera images and multi-camera images to remove duplicate defects; performing defect location, combining the three-dimensional data of the vehicle body, determining the specific position of the defect on the hood through feature points, marking on the image using a four-point perspective transformation, and performing defect location.
[0004] When inspecting vehicle body defects, images are usually compared to confirm the corresponding abnormal area from the comparison results. The abnormal area is then displayed for external personnel to review and take timely response measures. However, this method is not comprehensive and can easily lead to misjudgment due to unclean areas on the surface of the vehicle body, thus affecting the overall detection effect of machine vision. Summary of the invention
[0005] In view of the deficiencies in the prior art, the present invention provides a vehicle body defect detection method based on machine vision, which solves the problem that misjudgment may easily occur due to the presence of unclean areas on the vehicle body surface.
[0006] To achieve the above objectives, the present invention is implemented through the following technical solutions: A vehicle body defect detection method based on machine vision, comprising the following steps:
[0007] S1. Acquire the surface image of the vehicle body involved in the detection, and compare the acquired surface image of the vehicle body with the preset image to confirm the abnormal area, specifically in the following manner:
[0008] S11, dividing the acquired vehicle body surface image into a plurality of classified images according to the specific classification of the vehicle body panel surface;
[0009] S12. According to the specific model of the corresponding body sheet, a standard sheet of the corresponding model is selected from the cloud or the database, and the divided classification image is compared with the corresponding standard sheet one by one. During the comparison process, if there is an abnormality, the abnormal area is directly confirmed from the classification image, and the confirmed abnormal area is processed in the next step. If there is no abnormality, no processing is required;
[0010] S2. Analyze and determine the abnormal area by shadow area, the specific method is as follows:
[0011] S21, comparing and analyzing the confirmed abnormal area with the designated matching image to determine whether there is a shadow area with inconsistent color. If so, a shadow area analysis signal is generated and step S3 is executed;
[0012] S22, if there is no shadow area with inconsistent colors, generate a regional trend analysis signal and execute step S4;
[0013] S3. Confirm the shadow area in the abnormal area, confirm the standard area corresponding to the abnormal area, confirm the common area corresponding to the shadow area from the standard area, combine the shadow area and the common area for analysis, and determine whether such shadow area is a crack. The specific method is as follows:
[0014] S31, according to the shadow area analysis signal, the shadow area inside the abnormal area is marked, and then, according to the specific area where the abnormal area is located, a corresponding specific area is selected from the standard sheet surface, and the selected corresponding specific area is marked as the standard area, and then the area identical to the shadow area is selected from the standard area, and marked as the common area;
[0015] S32, determining the edge area of the shadow area, and then determining the center area according to the two groups of edge areas determined, and the two groups of edge areas are moved to the center point of the center area according to the shadow area respectively, and in the process of gradual movement, the corresponding center area is locked, and the locked center area is marked as the shadow center area;
[0016] S33, lock the center point in the shadow center area, and then select a group of points with the closest and farthest horizontal distance to the center point in the shadow center area, and mark them as the closest point or the farthest point respectively. If there is no corresponding closest point or farthest point, randomly select two groups of points as the closest point or the farthest point, mark the line between the closest point and the center point as the near point line, and mark the line between the farthest point and the center point as the far point line, and place the near point line or the far point line in a two-dimensional coordinate system, so as to confirm the linear equation Y=KX+B belonging to the near point line or the far point line, mark the K value of the near point line as Kj, and mark the K value of the far point line as Ky, perform absolute value processing on the two groups of K values, and then perform mean value processing to obtain the verification mean parameter HD belonging to this shadow center area;
[0017] S34, the common area is processed in the same manner as in steps S32-S33, the common central area belonging to the common area is confirmed first, and then the check reference of the common central area is confirmed and marked as HB;
[0018] S35, compare HD and HB:
[0019] When HD≤HB, it means that the abnormal area is lower than the common area, thus generating a crack signal and transmitting it to the external display terminal for external personnel to view and perform maintenance on the designated area in a timely manner;
[0020] When HD>HB, it means that this abnormal area is higher than the common area and no treatment is required;
[0021] S4. According to the regional trend analysis signal, a trend analysis is performed on the abnormal area to determine whether the confirmed abnormal area is in a concave state. The specific method is as follows:
[0022] S41, from within the selected abnormal area, adaptively rotate the determined abnormal area image, confirm a group of rotating circles, determine the centers of the circles, and mark the determined centers of the circles as the center point;
[0023] S42, randomly selecting edge points of the abnormal area, connecting the edge points with the determined center points, and constructing a line type to be analyzed;
[0024] S43. Analyze whether the constructed line type to be analyzed is concave. If it is concave, generate a vehicle sinking signal, and transmit the generated vehicle sinking signal to the external display terminal, so as to timely inspect and maintain such abnormal area. If it is not concave, directly display the determined abnormal area picture.
[0025] Beneficial Effects
[0026] The present invention provides a method for detecting vehicle body defects based on machine vision. Compared with the prior art, it has the following beneficial effects:
[0027] The present invention preferentially selects an abnormal area through a corresponding comparison method, and then selects a central area from the abnormal area, and selects a central point, a far point and a near point from the central area, and then combines the corresponding points to construct a far point line and a near point line, and confirms the corresponding K value. After the K value is confirmed, it is compared with the corresponding standard area to analyze whether the corresponding K value is too large or too small. Combined with the actual situation, an overall analysis is performed to determine whether there is a crack. With this analysis method, the confirmed analysis result is more accurate, and external influencing factors are taken into account, thereby improving the accuracy of vehicle body defect detection;
[0028] Subsequently, the situation where there is no shadow area is analyzed to confirm the sunken area, and then the corresponding line type is constructed to analyze whether there is an inner concave situation, so as to improve the comprehensiveness of the vehicle body inspection and facilitate subsequent operators to take timely response measures. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] Figure 1 It is a schematic diagram of the process of the present invention;
[0030] Figure 2 This is a schematic diagram of crack signal generation according to the present invention. DETAILED DESCRIPTION
[0031] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0032] Embodiment 1
[0033] See also Figure 1 The present application provides a vehicle body defect detection method based on machine vision, comprising the following steps:
[0034] S1. Acquire the surface image of the vehicle body involved in the detection, and compare the acquired surface image of the vehicle body with the preset image to confirm the abnormal area, wherein the specific method of confirmation is:
[0035] S11, dividing the acquired vehicle body surface image into a plurality of classified images according to the specific classification of the vehicle body panel surface;
[0036] S12. According to the specific model of the corresponding body sheet, a standard sheet of the corresponding model is selected from the cloud or the database, and the divided classification image is compared with the corresponding standard sheet one by one. During the comparison process, if there is an abnormality, the abnormal area is directly confirmed from the classification image, and the confirmed abnormal area is processed in the next step. If there is no abnormality, no processing is required;
[0037] Specifically, different models have different body panels. Due to the differences in body panels, different models of body panels need to be used for comparison and analysis. During the analysis process, the corresponding abnormal areas are analyzed and determined.
[0038] S2, analyzing and determining the shadow area inside the abnormal area, if the abnormal area has a corresponding shadow area, executing step S3, if the abnormal area does not have a corresponding shadow area, executing step S4, wherein the specific manner of performing the analysis and determination is:
[0039] S21, comparing and analyzing the confirmed abnormal area with the designated matching image to determine whether there is a shadow area with inconsistent color. If so, a shadow area analysis signal is generated and step S3 is executed;
[0040] S22, if there is no shadow area with inconsistent colors, generate a regional trend analysis signal and execute step S4;
[0041] Specifically, when there are specific defects in the vehicle body, cracks or dents will generally appear. For cracks, it is easy to judge the cracks and dirt or paint scratches on the surface of the vehicle body as the same crack, which is easy to cause misjudgment. If there is no corresponding shadow part in the dent area, the shadow part needs to be analyzed separately, so that the accuracy of vehicle body defect detection can be more accurate, thereby improving the overall detection effect of the entire vehicle body detection;
[0042] See also Figure 2 S3. Confirm the shadow area in the abnormal area, confirm the standard area corresponding to the abnormal area, confirm the common area corresponding to the shadow area from the standard area, combine the shadow area and the common area for analysis, and determine whether such shadow area is a crack, wherein the specific method of determination is:
[0043] S31, according to the shadow area analysis signal, the shadow area inside the abnormal area is marked, and then, according to the specific area where the abnormal area is located, a corresponding specific area is selected from the standard sheet surface, and the selected corresponding specific area is marked as the standard area, and then the area identical to the shadow area is selected from the standard area, and marked as the common area;
[0044] S32, determining the edge area of the shadow area, and then determining the center area according to the two groups of edge areas determined, and the two groups of edge areas are moved to the center point of the center area according to the shadow area respectively, and in the process of gradual movement, the corresponding center area is locked, and the locked center area is marked as the shadow center area in the same way as the two side points lock the center point of the corresponding line segment;
[0045] S33, lock the center point in the shadow center area, and then select a group of points with the closest and farthest horizontal distance to the center point in the shadow center area, and mark them as the closest point or the farthest point respectively. If there is no corresponding closest point or farthest point, randomly select two groups of points as the closest point or the farthest point, mark the line between the closest point and the center point as the near point line, and mark the line between the farthest point and the center point as the far point line, and place the near point line or the far point line in a two-dimensional coordinate system, so as to confirm the linear equation Y=KX+B belonging to the near point line or the far point line, mark the K value of the near point line as Kj, and mark the K value of the far point line as Ky, perform absolute value processing on the two groups of K values, and then perform mean value processing to obtain the verification mean parameter HD belonging to this shadow center area;
[0046] S34, the common area is processed in the same manner as in steps S32-S33, the common central area belonging to the common area is confirmed first, and then the check reference of the common central area is confirmed and marked as HB;
[0047] S35, compare HD and HB:
[0048] When HD>HB, it means that the abnormal area is higher than the common area, that is, there is a convex part, and no treatment is required;
[0049] When HD≤HB, it means that the abnormal area is lower than the common area, that is, there is a crack part, so a crack signal is generated and transmitted to the external display terminal for external personnel to view and perform maintenance on the designated area in time;
[0050] Specifically, when performing shadow area analysis, it is necessary to first consider whether the shadow area is caused by external dirt. When the surface of the vehicle body is not clean, it is easy to mark the corresponding dirty area as a shadow area during comparison analysis. When performing actual analysis and judgment of the shadow area, it is necessary to take such dirty areas into consideration to avoid misjudgment, because dirt will cause the corresponding plane to be convex compared to the original plane. If it is a corresponding scratch, it will be concave compared to the original plane. The two sets of planes have different states and need different forms of analysis and processing;
[0051] In the actual analysis process, the central area is determined first, and then the corresponding central point and other external points are determined in the central area, and then the line analysis is performed to determine the corresponding k value. The k value can be understood as the overall trend of the corresponding line. If the trend is smaller than the original picture k value, it means that there is a concave situation, which may be a crack. If the trend is larger than the original picture k value, it means that there is a convex situation, which may be caused by dirty things.
[0052] Embodiment 2
[0053] In the specific implementation process, compared with the first embodiment, this embodiment further includes the following steps:
[0054] S4. According to the regional trend analysis signal, a trend analysis is performed on the abnormal area to determine whether the confirmed abnormal area is in a concave state. The specific method of performing the analysis is as follows:
[0055] S41, from within the selected abnormal area, adaptively rotate the determined abnormal area image, confirm a group of rotating circles, determine the centers of the circles, and mark the determined centers of the circles as the center point;
[0056] S42, randomly selecting edge points of the abnormal area, connecting the edge points with the determined center points, and constructing a line type to be analyzed;
[0057] S43, analyzing whether the constructed line type to be analyzed is concave; if it is concave, generating a vehicle concave signal, and transmitting the generated vehicle concave signal to an external display terminal, and timely performing maintenance on such abnormal area; if it is not concave, directly displaying the determined abnormal area picture, and allowing the operator to check it in time;
[0058] Specifically, from the selected abnormal area, it is necessary to analyze whether there is a pit or foundation pit on the corresponding body surface, so it is necessary to confirm the corresponding line segment through the determined point position, so as to lock the overall shape according to the corresponding line segment, determine whether it is a concave situation or other situations, and take timely response measures;
[0059] Embodiment 3
[0060] The specific implementation process of this embodiment includes the entire implementation process of the above two groups of embodiments.
[0061] Some of the data in the above formulas are numerically calculated by removing their dimensions. Meanwhile, the contents not described in detail in this specification belong to the prior art known to those skilled in the art.
[0062] The above embodiments are only used to illustrate the technical method of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical method of the present invention may be modified or replaced by equivalents without departing from the spirit and scope of the technical method of the present invention.
Claims
1. A vehicle body defect detection method based on machine vision, characterized in that: The following steps are involved: S1. Acquire the surface image of the vehicle body involved in the detection, and compare the acquired surface image of the vehicle body with the preset image to confirm the abnormal area; S2, analyzing and determining the shadow area of the abnormal area, if the abnormal area has a corresponding shadow area, executing step S3, if the abnormal area does not have a corresponding shadow area, executing step S4; S3. Confirm the shadow area in the abnormal area, confirm the standard area corresponding to the abnormal area, confirm the common area corresponding to the shadow area from the standard area, combine the shadow area and the common area for analysis, and determine whether such shadow area is a crack. The specific method is as follows: S31, according to the shadow area analysis signal, the shadow area inside the abnormal area is marked, and then, according to the specific area where the abnormal area is located, a corresponding specific area is selected from the standard sheet surface, and the selected corresponding specific area is marked as the standard area, and then the area identical to the shadow area is selected from the standard area, and marked as the common area; S32, determining the edge area of the shadow area, and then determining the center area according to the two groups of edge areas determined, and the two groups of edge areas are moved to the center point of the center area according to the shadow area respectively, and in the process of gradual movement, the corresponding center area is locked, and the locked center area is marked as the shadow center area; S33, lock the center point in the shadow center area, and then select a group of points with the closest and farthest horizontal distance to the center point in the shadow center area, and mark them as the closest point or the farthest point respectively. If there is no corresponding closest point or farthest point, randomly select two groups of points as the closest point or the farthest point, mark the line between the closest point and the center point as the near point line, and mark the line between the farthest point and the center point as the far point line, and place the near point line or the far point line in a two-dimensional coordinate system, so as to confirm the linear equation Y=KX+B belonging to the near point line or the far point line, mark the K value of the near point line as Kj, and mark the K value of the far point line as Ky, perform absolute value processing on the two groups of K values, and then perform mean processing to obtain the verification mean parameter HD belonging to this shadow center area; S34, the common area is processed in the same manner as in steps S32-S33, the common central area belonging to the common area is confirmed first, and then the check reference of the common central area is confirmed and marked as HB; S35, compare HD and HB: When HD≤HB, it means that the abnormal area is lower than the common area, thus generating a crack signal and transmitting it to the external display terminal for external personnel to view and perform maintenance on the designated area in a timely manner; When HD>HB, it means that this abnormal area is higher than the common area and no treatment is required; S4. According to the regional trend analysis signal, a trend analysis is performed on the abnormal area to determine whether the confirmed abnormal area is in a concave state.
2. The method for detecting vehicle body defects based on machine vision according to claim 1, characterized in that: In step S1, the specific method of confirming the abnormal area is: S11, dividing the acquired vehicle body surface image into a plurality of classified images according to the specific classification of the vehicle body panel surface; S12. According to the specific model of the corresponding body sheet, select the standard sheet of the corresponding model from the cloud or database, compare the divided classification image with the corresponding standard sheet one by one, and during the comparison process, if there is an abnormality, directly confirm the abnormal area from the classification image, and proceed to the next step of processing the confirmed abnormal area. If there is no abnormality, no processing is required.
3. The method for detecting vehicle body defects based on machine vision according to claim 2, characterized in that: In step S2, the specific method of analyzing and determining the shadow area of the abnormal area is: S21, comparing and analyzing the confirmed abnormal area with the designated matching image to determine whether there is a shadow area with inconsistent color. If so, a shadow area analysis signal is generated and step S3 is executed; S22. If there is no shadow area with inconsistent colors, generate a regional trend analysis signal and execute step S4.
4. The method for detecting vehicle body defects based on machine vision according to claim 1, characterized in that: In step S4, the specific method of performing trend analysis on the abnormal area is: S41, from within the selected abnormal area, adaptively rotate the determined abnormal area image, confirm a group of rotating circles, determine the centers of the circles, and mark the determined centers of the circles as the center point; S42, randomly selecting edge points of the abnormal area, connecting the edge points with the determined center points, and constructing a line type to be analyzed; S43. Analyze whether the constructed line type to be analyzed is concave. If it is concave, generate a vehicle sinking signal, and transmit the generated vehicle sinking signal to the external display terminal, so as to timely inspect and maintain such abnormal area. If it is not concave, directly display the determined abnormal area picture.
Citation Information
Patent Citations
Vehicle body finish paint defect detection method
CN116205903A
Optical detection device and detection method for defects of hybrid integrated circuit assembly
CN108802046A
Smooth object surface defect detection method, device, equipment and medium
CN113344865A
Cited By
Standard knowledge comparison method and device based on multi-source data fusion and storage medium
CN120976582A