Vehicle body paint defect detection method, device, computer equipment and medium
By combining streak cameras and optical flow methods with a three-dimensional car body model, the problems of low efficiency and poor accuracy of traditional manual inspection are solved, and efficient and accurate detection and positioning of car body paint defects are achieved.
Patent Information
- Application Number
- CN202411183564.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-27
- Publication Date
- 2025-09-26
- Estimated Expiration
- 2044-08-27
AI Technical Summary
Traditional manual visual inspection of vehicle body paint defects is inefficient and has a high missed detection rate, making it impossible to achieve efficient and accurate vehicle body paint defect detection.
A streak camera is used to obtain the initial image of the car body under sinusoidal streak light. The optical flow method is used to enhance defects. Combined with the car body CAD 3D model and camera calibration parameters, the defect position in the camera coordinate system is mapped to the car body 3D coordinate system for efficient and accurate defect detection.
It achieves efficient and accurate vehicle body paint defect detection, can locate the defect position under the camera and three-dimensional coordinate system, and supports subsequent analysis and repair work.
Smart Images

Figure CN119086563B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a method, apparatus, computer equipment, storage medium, and computer program product for detecting vehicle body paint defects. Background Art
[0002] Automotive paint not only directly determines the overall vehicle's aesthetics and image, but also provides effective protection for the vehicle body and extends its service life. However, during the painting process, various defects inevitably develop on the paint surface, such as localized dents, blistering, and minor scratches. These issues not only affect the vehicle's aesthetic appearance but can also cause corrosion, threatening the vehicle's safety. Therefore, timely detection and repair of these paint defects is crucial to ensuring vehicle quality and performance. However, the highly reflective nature of paint surfaces poses significant challenges to surface imaging and defect detection, leading traditional techniques to rely primarily on manual visual inspection for defect detection.
[0003] The traditional method of manual visual defect detection is not only inefficient, but also has a high defect missed detection rate. It cannot achieve efficient and accurate vehicle body paint defect detection. Summary of the Invention
[0004] Based on this, it is necessary to provide an efficient and accurate vehicle body paint defect detection method, device, computer equipment, storage medium and computer program product to address the above technical problems.
[0005] In a first aspect, the present application provides a method for detecting vehicle body paint defects. The method comprises:
[0006] Obtain the initial image of the vehicle body captured by the streak camera under the illumination of sinusoidal streak light;
[0007] Performing defect enhancement on the initial vehicle body image using an optical flow method to obtain a defect enhanced vehicle body image;
[0008] Performing defect detection on the defect-enhanced vehicle body image to obtain a position of a vehicle body paint defect in a camera coordinate system;
[0009] The paint defect position of the vehicle body in the camera coordinate system is mapped to the three-dimensional coordinate system of the vehicle body to obtain the target paint defect position of the vehicle body.
[0010] In one embodiment, the step of performing defect enhancement on the initial vehicle body image using an optical flow method to obtain the defect enhanced vehicle body image includes:
[0011] Calculating a first direction optical flow and a second direction optical flow of two adjacent frames in the initial vehicle body image, where the first direction and the second direction are two directions perpendicular to each other;
[0012] Fusing the first directional optical flow and the second directional optical flow to obtain optical flow intensities of two different adjacent frames;
[0013] Obtaining a total fused optical flow based on the optical flow intensities of the two different adjacent frames;
[0014] A defect-enhanced vehicle body image is generated according to the fused optical flow and the initial vehicle body image.
[0015] In one embodiment, calculating the first direction optical flow and the second direction optical flow of two adjacent frames in the initial vehicle body image includes:
[0016] The Farneback function is used to calculate the first direction optical flow and the second direction optical flow of two adjacent frames in the initial vehicle body image.
[0017] In one embodiment, mapping the vehicle body paint defect position in the camera coordinate system to the vehicle body three-dimensional coordinate system to obtain the target vehicle body paint defect position includes:
[0018] Obtain the vehicle body CAD 3D model, vehicle body reference position, and streak camera calibration parameters;
[0019] Based on the vehicle body reference position and the streak camera calibration parameters, the vehicle body paint defect position in the camera coordinate system is mapped to the vehicle body CAD three-dimensional model to obtain the target vehicle body paint defect position.
[0020] In one embodiment, mapping the vehicle body paint defect position in the camera coordinate system to the vehicle body three-dimensional coordinate system to obtain the target vehicle body paint defect position includes:
[0021] Mapping the paint defect position of the vehicle body in the camera coordinate system to the three-dimensional coordinate system of the vehicle body to obtain the defect position in the three-dimensional coordinate system of the vehicle body;
[0022] The defect positions in the three-dimensional coordinate system of the vehicle body are deduplicated based on a preset error tolerance value to obtain the target vehicle body paint surface defect positions.
[0023] In one embodiment, removing duplicate defect positions in the vehicle body three-dimensional coordinate system based on a preset error tolerance to obtain target vehicle body paint defect positions includes:
[0024] Obtaining the Euclidean distance between defect positions in the three-dimensional coordinate system of the vehicle body;
[0025] Determine the defect location whose Euclidean distance is less than the preset error tolerance as a duplicate point;
[0026] The duplicate points of the defect position in the three-dimensional coordinate system of the vehicle body are removed to obtain the target vehicle body paint defect position.
[0027] In a second aspect, the present application also provides a vehicle body paint defect detection device. The device comprises:
[0028] An image acquisition module is used to acquire an initial vehicle body image captured by a streak camera under the illumination of sinusoidal streak light;
[0029] an enhancement module, configured to enhance defects of the initial vehicle body image using an optical flow method to obtain a defect-enhanced vehicle body image;
[0030] a defect detection module, configured to perform defect detection on the defect-enhanced vehicle body image to obtain a position of a vehicle body paint defect in a camera coordinate system;
[0031] The mapping module is used to map the paint defect position of the vehicle body in the camera coordinate system to the three-dimensional coordinate system of the vehicle body to obtain the target paint defect position of the vehicle body.
[0032] In a third aspect, the present application further provides a computer device. The computer device includes a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are performed:
[0033] Obtain the initial image of the vehicle body captured by the streak camera under the illumination of sinusoidal streak light;
[0034] Performing defect enhancement on the initial vehicle body image using an optical flow method to obtain a defect enhanced vehicle body image;
[0035] Performing defect detection on the defect-enhanced vehicle body image to obtain a position of a vehicle body paint defect in a camera coordinate system;
[0036] The paint defect position of the vehicle body in the camera coordinate system is mapped to the three-dimensional coordinate system of the vehicle body to obtain the target paint defect position of the vehicle body.
[0037] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the following steps:
[0038] Obtain the initial image of the vehicle body captured by the streak camera under the illumination of sinusoidal streak light;
[0039] Performing defect enhancement on the initial vehicle body image using an optical flow method to obtain a defect enhanced vehicle body image;
[0040] Performing defect detection on the defect-enhanced vehicle body image to obtain a position of a vehicle body paint defect in a camera coordinate system;
[0041] The paint defect position of the vehicle body in the camera coordinate system is mapped to the three-dimensional coordinate system of the vehicle body to obtain the target paint defect position of the vehicle body.
[0042] In a fifth aspect, the present application further provides a computer program product. The computer program product includes a computer program that, when executed by a processor, implements the following steps:
[0043] Obtain the initial image of the vehicle body captured by the streak camera under the illumination of sinusoidal streak light;
[0044] Performing defect enhancement on the initial vehicle body image using an optical flow method to obtain a defect enhanced vehicle body image;
[0045] Performing defect detection on the defect-enhanced vehicle body image to obtain a position of a vehicle body paint defect in a camera coordinate system;
[0046] The paint defect position of the vehicle body in the camera coordinate system is mapped to the three-dimensional coordinate system of the vehicle body to obtain the target paint defect position of the vehicle body.
[0047] The aforementioned vehicle body paint defect detection method, apparatus, computer device, storage medium, and computer program product obtain an initial vehicle body image captured by a streak camera under sinusoidal stripe light illumination; utilize optical flow to enhance defects in the initial vehicle body image to obtain a defect-enhanced vehicle body image; perform defect detection on the defect-enhanced vehicle body image to determine the vehicle body paint defect location in the camera coordinate system; and map the vehicle body paint defect location in the camera coordinate system to the vehicle body's three-dimensional coordinate system to obtain the target vehicle body paint defect location. Throughout this process, vehicle body paint defect detection is performed based on the initial vehicle body image captured by the streak camera under sinusoidal stripe light illumination, and the initial vehicle body image is enhanced using the optical flow method, enabling efficient and accurate vehicle body paint defect detection. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] Figure 1 A diagram showing an application environment of a vehicle body paint defect detection method according to an embodiment;
[0049] Figure 2 1 is a flow chart of a method for detecting vehicle body paint defects in one embodiment;
[0050] Figure 3 is a flow chart of a method for detecting vehicle body paint defects in another embodiment;
[0051] Figure 4 is a structural block diagram of a vehicle body paint defect detection device in one embodiment;
[0052] Figure 5 FIG. 1 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0053] In order to make the purpose, technical solutions and advantages of this application more clear, the following further describes this application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.
[0054] The vehicle body paint defect detection method provided in the embodiment of the present application can be applied to Figure 1 In the application environment shown, a vehicle body is illuminated by sinusoidal stripe light, and a streak camera 102 captures an initial vehicle body image at this time and transmits the initial vehicle body image to a detection terminal 104. The detection terminal 104 obtains the initial vehicle body image captured by the streak camera under the sinusoidal stripe light; uses an optical flow method to perform defect enhancement on the initial vehicle body image to obtain a defect-enhanced vehicle body image; performs defect detection on the defect-enhanced vehicle body image to obtain the vehicle body paint defect position in the camera coordinate system; and maps the vehicle body paint defect position in the camera coordinate system to the vehicle body's three-dimensional coordinate system to obtain the target vehicle body paint defect position.
[0055] In one embodiment, Figure 2 As shown, a method for detecting defects on a vehicle body paint surface is provided. Figure 1 Taking the detection terminal 104 in FIG. 1 as an example, the following steps are included:
[0056] S200: Acquire an initial vehicle body image captured by a streak camera under the illumination of sinusoidal streak light.
[0057] A tunnel-style LED light source coupled with a diffuser displays sinusoidal stripes of light. During the inspection process, as the vehicle body passes through the tunnel, the light source illuminates the surface of the vehicle body, generating sinusoidal stripes of light. The streak camera then captures an initial image of the vehicle body under this sinusoidal stripe light and transmits this captured initial image to the inspection terminal. Specifically, the streak camera's capture process must be based on a specific rhythm. Specifically, the vehicle body's forward distance and the streak camera's capture rhythm can be controlled to accurately capture the initial vehicle body image for subsequent paint defect detection. During each capture, the vehicle body displacement should not exceed 1 / 4 of the width of the short side of the binary stripe light source.
[0058] S400: Using an optical flow method to perform defect enhancement on the initial vehicle body image to obtain a defect enhanced vehicle body image.
[0059] The optical flow method for defect detection works as follows: The brightness of non-defective areas remains approximately constant between consecutive frames, representing the background. Defective areas experience variations in light intensity between consecutive frames, representing the defect moving within the background. Here, the optical flow method is used to enhance the initial vehicle body image, making it easier to identify paint defects. Specifically, due to the relative displacement between the defect and the streak, the dense optical flow algorithm Farneback is suitable for defect enhancement.
[0060] S600: Defect detection is performed on the defect-enhanced vehicle body image to obtain the position of the vehicle body paint defect in the camera coordinate system.
[0061] Defect detection is performed on the defect-enhanced vehicle body image obtained in S400. Conventional vehicle body paint inspection methods can be used to identify and locate paint defects, determine their types, and calculate their sizes. Because the current paint defect detection results are based on images captured by the streak camera, the paint defect locations obtained are in the camera coordinate system.
[0062] S800: Mapping the vehicle body paint defect position in the camera coordinate system to the vehicle body three-dimensional coordinate system to obtain the target vehicle body paint defect position.
[0063] In order to finally obtain the position of the body paint defect in the body coordinate system (body three-dimensional coordinate system), it is necessary to map the body paint defect position in the camera coordinate system to the body three-dimensional coordinate system to obtain the target body paint defect position. Specifically, the mapping process needs to be carried out in combination with the body CAD three-dimensional model, the body reference position when taking pictures, and the camera calibration parameters corresponding to the streak camera. Furthermore, according to the body reference position when taking pictures and the pre-calibrated internal and external parameters of the camera, the paint defect can be mapped from the pixel coordinates in the image to the body three-dimensional coordinate system, that is, the target body paint defect position in the body three-dimensional coordinate system is obtained. The target body paint defect position can also be further displayed on the display interface of the terminal, thereby displaying the defect information on various parts of the body.
[0064] The above-mentioned vehicle body paint defect detection method obtains an initial vehicle body image captured by a streak camera under sinusoidal stripe light illumination; uses optical flow to enhance defects in the initial vehicle body image to obtain a defect-enhanced vehicle body image; performs defect detection on the defect-enhanced vehicle body image to determine the vehicle body paint defect location in the camera coordinate system; and maps the vehicle body paint defect location in the camera coordinate system to the vehicle body's three-dimensional coordinate system to obtain the target vehicle body paint defect location. Throughout this process, vehicle body paint defect detection is performed based on the initial vehicle body image captured by the streak camera under sinusoidal stripe light illumination, and the initial vehicle body image is enhanced using the optical flow method, achieving efficient and accurate vehicle body paint defect detection.
[0065] like Figure 3 As shown, in one embodiment, S400 includes:
[0066] S420: Calculate the optical flow in a first direction and the optical flow in a second direction of two adjacent frames in the initial vehicle body image, where the first direction and the second direction are two directions perpendicular to each other.
[0067] The first direction and the second direction are two directions perpendicular to each other, for example, the first direction is horizontal and the second direction is vertical; or the first direction is vertical and the second direction is horizontal. Two adjacent frames refer to the images captured by the streak camera in the process of capturing the initial image. The first direction optical flow between the two frames is calculated. u,k and the second direction optical flow v,k (u, v are two perpendicular directions, k is a constant, representing the kth optical flow calculation. Specifically, the first direction optical flow can be calculated using the Farneback function u,k and the second direction optical flow v,k .
[0068] Furthermore, in a streak camera or any video sequence, using the Farneback optical flow algorithm to calculate the optical flow between adjacent frames is an effective method. The Farneback algorithm is an optical flow estimation algorithm based on image gradients. It assumes that the image brightness changes smoothly in a local area and that this change can be approximated by a polynomial model. First, two frames of images from a streak camera are acquired, and then the optical flow between the two frames is calculated, where the optical flow is represented as flow u_k (horizontal optical flow) and flow v_k (vertical optical flow), k means this is the kth optical flow calculation.
[0069] S440: Fusing the first directional optical flow and the second directional optical flow to obtain optical flow intensities of two different adjacent frames.
[0070] In streak cameras or any video processing scenario, when Farneback or other optical flow algorithms are used to calculate the optical flow in two directions (usually horizontal and vertical, i.e., u and v directions), these optical flow components can be further processed to obtain the optical flow intensity or other related motion characteristics. The optical flow intensity (or optical flow amplitude) is usually defined as the modulus of the vector sum of the optical flow components in the two directions. For a given optical flow component flowu and flowv, the optical flow intensity flow m It can be calculated by the following formula:
[0071]
[0072] This formula calculates the Euclidean length of the optical flow vector, or the "size" or "intensity" of the optical flow in two-dimensional space. It reflects the speed of motion of pixels or feature points in the image. The first and second direction optical flows obtained for different adjacent frames are fused separately to obtain the optical flow intensities for the two adjacent frames.
[0073] S460: Obtaining a total fused optical flow based on the optical flow intensities of two different adjacent frames.
[0074] The total fused optical flow is obtained by summing the optical flow intensities of two adjacent frames. The specific calculation formula is:
[0075] fusion m (i, j) = {flow m,1 (i, j)∨flow m,2 (i, j)∨...∨flow m,k (i, j)}
[0076] Where V represents the maximum value operation and (i, j) is the image pixel coordinate.
[0077] S480: Generate a defect-enhanced vehicle body image based on the fused optical flow and the initial vehicle body image.
[0078] After obtaining the fused optical flow, the characteristic areas in the optical flow image (fused optical flow) are further analyzed. These characteristic areas usually correspond to paint defects. Therefore, the fused optical flow and the initial vehicle body image can be combined to generate a defect-enhanced vehicle body image, that is, the areas where paint defects may exist are highlighted.
[0079] Furthermore, a threshold for the optical flow intensity can be set to distinguish between normal areas and potential defect areas. Areas with higher optical flow intensity may indicate defects in the paint surface. Areas in the fused optical flow image where the optical flow intensity exceeds the threshold are marked as potential defect areas. The initial vehicle body image is fused with the marked defect areas. These areas can be highlighted by adjusting the contrast and brightness of the defective areas or applying other image enhancement techniques. In order to display the defects more clearly, the defective areas can be marked with specific colors or color codes, for example, using highlight colors such as red or yellow to mark the defects. The edges of the enhanced defective areas are smoothed to reduce artifacts or jagged edges caused by the enhancement process. Further contrast, brightness or color balance adjustments are made to the entire enhanced vehicle body image as needed to ensure the overall quality and readability of the image.
[0080] In one embodiment, mapping the vehicle body paint defect position in the camera coordinate system to the vehicle body three-dimensional coordinate system to obtain the target vehicle body paint defect position includes:
[0081] Obtain the vehicle body CAD 3D model, the vehicle body reference position, and the streak camera calibration parameters. Based on the vehicle body reference position and the streak camera calibration parameters, map the vehicle body paint defect position in the camera coordinate system to the vehicle body CAD 3D model to obtain the target vehicle body paint defect position.
[0082] Mapping the paint defect locations from the camera coordinate system to the vehicle's 3D coordinate system, particularly the 3D CAD (Computer-Aided Design) model, is a complex, multi-step process. This typically involves camera calibration, coordinate transformation, and 3D spatial localization. Specifically, the process includes the following stages:
[0083] 1. Obtain necessary data
[0084] Car body CAD 3D model: This is an accurate 3D representation of the car body, commonly used for design, manufacturing, and quality control. Car body reference position: A known or easily identifiable location on the car body in the real world, used to establish the relationship between the camera coordinate system and the 3D coordinate system of the car body. Streak camera calibration parameters: These parameters describe the camera's internal (such as focal length, optical center position) and external (such as the camera's position and orientation relative to the car body) geometric characteristics. The calibration process typically involves capturing a target of known shape and size (such as a calibration plate) and using these images to calculate the camera's internal and external parameters.
[0085] 2. Camera Calibration
[0086] Use a streak camera to capture the vehicle body and its reference position, ensuring that the captured image contains sufficient feature points for accurate calibration. Apply a camera calibration algorithm (such as the Zhang Zhengyou calibration method) to calculate the camera's intrinsic and extrinsic parameters. These parameters will be used for subsequent coordinate transformations.
[0087] 3. Coordinate transformation
[0088] From image coordinates to camera coordinates: First, the vehicle body paint defect location (in pixels) captured by the camera is converted into 3D coordinates in the camera coordinate system. This typically involves steps such as image dedistortion and mapping from image coordinates to camera coordinates. From camera coordinates to vehicle body 3D coordinates: Then, using the internal and external parameters obtained from camera calibration and information about the vehicle body reference position, the defect location in the camera coordinate system is mapped to the coordinate system of the vehicle body CAD 3D model. This typically involves mathematical operations such as rigid body transformations (rotations and translations).
[0089] 4. Mapping to the vehicle body CAD 3D model
[0090] The converted 3D coordinates are matched with the vehicle body CAD model to determine the specific location of the defect in the vehicle body's 3D space. The defect location is marked on the CAD model for subsequent analysis, measurement, and repair work.
[0091] 5. Verification and adjustment
[0092] Perform necessary verification steps, such as checking the accuracy of defect locations using physical measurement tools or verifying the consistency of mapping results by comparing images from different viewing angles. Based on the verification results, adjust camera calibration parameters, coordinate transformation algorithms, or the mapping process to improve mapping accuracy and reliability.
[0093] In one embodiment, mapping the vehicle body paint defect position in the camera coordinate system to the vehicle body three-dimensional coordinate system to obtain the target vehicle body paint defect position includes:
[0094] The paint defect position of the vehicle body in the camera coordinate system is mapped to the three-dimensional coordinate system of the vehicle body to obtain the defect position in the three-dimensional coordinate system of the vehicle body; the defect position in the three-dimensional coordinate system of the vehicle body is deduplicated based on the preset error tolerance value to obtain the target paint defect position of the vehicle body.
[0095] In addition to position mapping, this embodiment also removes duplicate defect locations to improve the accuracy of the final target vehicle body paint defect locations. In practical applications, multiple cameras, or the same camera at different times, may capture the same defect data. Mapping to the vehicle body's three-dimensional coordinate system can effectively remove these duplicates. To account for errors in the coordinate mapping process, an error tolerance value Δd is set. If the Euclidean distance between defects is less than this tolerance value, the defect is considered a duplicate point.
[0096] Furthermore, deduplication of defect positions in the three-dimensional coordinate system of the vehicle body is performed based on a preset error tolerance value to obtain the target vehicle body paint defect position, including: obtaining the Euclidean distance between the defect positions in the three-dimensional coordinate system of the vehicle body; determining that the defect positions whose Euclidean distance is less than the preset error tolerance value are duplicate points; deduplication of duplicate points of the defect positions in the three-dimensional coordinate system of the vehicle body to obtain the target vehicle body paint defect position.
[0097] Specifically, when processing paint defect location data in the vehicle body's 3D coordinate system, to ensure data accuracy and reduce redundancy, duplicate locations are usually removed based on a preset error tolerance. This process mainly includes the following steps:
[0098] 1. Obtain the defect location in the three-dimensional coordinate system of the vehicle body.
[0099] First, the specific locations of all detected paint defects in the vehicle body must be obtained in a three-dimensional coordinate system. These locations are typically expressed as (x, y, z) coordinates, where x, y, and z represent the horizontal, vertical, and height coordinates in three-dimensional space, respectively.
[0100] 2. Calculate the Euclidean distance between defect locations.
[0101] For each pair of defect locations, the distance between them is calculated using the Euclidean distance formula.
[0102] 3. Determine the repeated points.
[0103] Next, a preset error tolerance (usually a small positive number such as 0.1mm or set according to specific requirements) is used to determine which defect locations are "duplicate." If the Euclidean distance between two defect locations is less than this preset error tolerance, the two locations are considered duplicates, or they represent a slight shift in the same defect between different inspections.
[0104] 4. Deduplication processing.
[0105] For points that are determined to be duplicates, duplicate removal is required. This usually means selecting one point as a representative and deleting or ignoring the other duplicate points. The method of duplicate removal can be selected according to specific needs, such as averaging the coordinate values, retaining the first detected point, or retaining the last detected point. The target body paint defect location is obtained:
[0106] After the above deduplication process, what is finally obtained is a set of locations without duplication, and each point represents an independent paint defect, that is, the target vehicle body paint defect location.
[0107] It should be understood that, although the steps in the flowcharts of the above embodiments are shown in sequence as indicated by the arrows, these steps are not necessarily performed in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and these steps can be performed in other orders. Moreover, at least a portion of the steps in the flowcharts of the above embodiments may include multiple steps or multiple stages, and these steps or stages are not necessarily performed at the same time, but can be performed at different times. The execution order of these steps or stages is not necessarily to be performed in sequence, but can be performed in turn or alternately with other steps or at least a portion of steps or stages in other steps.
[0108] Based on the same inventive concept, embodiments of the present application also provide a vehicle body paint defect detection device for implementing the aforementioned vehicle body paint defect detection method. The solution provided by this device is similar to the solution described in the aforementioned method. Therefore, the specific limitations of one or more vehicle body paint defect detection device embodiments provided below can be found in the aforementioned limitations of the vehicle body paint defect detection method and will not be further elaborated here.
[0109] like Figure 4 As shown, in one embodiment, the present application also provides a vehicle body paint defect detection device. The device includes:
[0110] An image acquisition module 200 is used to acquire an initial image of a vehicle body captured by a streak camera under the illumination of sinusoidal streak light;
[0111] An enhancement module 400 is configured to enhance defects of the initial vehicle body image using an optical flow method to obtain a defect-enhanced vehicle body image;
[0112] The defect detection module 600 is used to perform defect detection on the defect-enhanced vehicle body image to obtain the position of the vehicle body paint defect in the camera coordinate system;
[0113] The mapping module 800 is used to map the paint defect position of the vehicle body in the camera coordinate system to the three-dimensional coordinate system of the vehicle body to obtain the target paint defect position of the vehicle body.
[0114] In one embodiment, the enhancement module 400 is further used to calculate the first direction optical flow and the second direction optical flow of two adjacent frames in the initial vehicle body image, where the first direction and the second direction are two directions perpendicular to each other; fuse the first direction optical flow and the second direction optical flow to obtain the optical flow intensity of two different adjacent frames; obtain the total fused optical flow based on the optical flow intensity of two different adjacent frames; and generate a defect-enhanced vehicle body image based on the fused optical flow and the initial vehicle body image.
[0115] In one embodiment, the enhancement module 400 is further configured to calculate the first direction optical flow and the second direction optical flow of two adjacent frames in the initial vehicle body image using a Farneback function.
[0116] In one embodiment, the mapping module 800 is also used to obtain the vehicle body CAD three-dimensional model, the vehicle body reference position and the streak camera calibration parameters; based on the vehicle body reference position and the streak camera calibration parameters, the vehicle body paint defect position in the camera coordinate system is mapped to the vehicle body CAD three-dimensional model to obtain the target vehicle body paint defect position.
[0117] In one embodiment, the mapping module 800 is also used to map the vehicle body paint defect position in the camera coordinate system to the vehicle body three-dimensional coordinate system to obtain the defect position in the vehicle body three-dimensional coordinate system; and deduplicate the defect position in the vehicle body three-dimensional coordinate system based on a preset error tolerance value to obtain the target vehicle body paint defect position.
[0118] In one embodiment, the mapping module 800 is further used to obtain the Euclidean distance between the defect positions in the three-dimensional coordinate system of the vehicle body; determine that the defect positions whose Euclidean distance is less than a preset error tolerance value are duplicate points; and remove duplicate points of the defect positions in the three-dimensional coordinate system of the vehicle body to obtain the target vehicle body paint defect position.
[0119] Each module in the vehicle body paint defect detection device described above may be implemented in whole or in part through software, hardware, or a combination thereof. Each module may be embedded in or independent of a processor within a computer device in hardware form, or may be stored in a computer device's memory in software form, allowing the processor to call and execute the corresponding operations of each module.
[0120] In one embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as follows: Figure 5 As shown. The computer device includes a processor, a memory, a communication interface, a display screen and an input device connected via a system bus. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be achieved through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a method for detecting defects in vehicle body paint is implemented. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad provided on the computer device housing, or an external keyboard, touchpad or mouse.
[0121] Those skilled in the art will understand that Figure 5 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.
[0122] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the above-mentioned vehicle body paint defect detection method when executing the computer program.
[0123] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the above-mentioned vehicle body paint defect detection method is implemented.
[0124] In one embodiment, a computer program product is provided, comprising a computer program, which implements the above-mentioned vehicle body paint defect detection method when executed by a processor.
[0125] Those skilled in the art will appreciate that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing the relevant hardware through a computer program. The above-mentioned computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, database or other media used in the embodiments provided in this application may include at least one of non-volatile and volatile memory. Non-volatile memory may include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory may include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in the various embodiments provided herein may include at least one of a relational database and a non-relational database. Non-relational databases may include, but are not limited to, distributed databases based on blockchains. The processor involved in the various embodiments provided herein may be, but are not limited to, a general-purpose processor, a central processing unit, a graphics processing unit, a digital signal processor, a programmable logic unit, a data processing logic unit based on quantum computing, and the like.
[0126] The technical features of the above embodiments can be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0127] The above embodiments merely illustrate several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present invention. It should be noted that a person skilled in the art may make various modifications and improvements without departing from the spirit of the present invention, all of which fall within the scope of protection of the present application. Therefore, the scope of protection of the present application shall be determined by the appended claims.
Claims
1. A method for detecting defects in vehicle body paint, characterized in that: The method comprises: Obtain the initial image of the vehicle body captured by the streak camera under the illumination of sinusoidal streak light; Defect enhancement is performed on the initial vehicle body image using an optical flow method to obtain a defect-enhanced vehicle body image. The method includes: calculating a first-direction optical flow and a second-direction optical flow in two adjacent frames of the initial vehicle body image, where the first direction and the second direction are two directions perpendicular to each other; fusing the first-direction optical flow and the second-direction optical flow to obtain optical flow intensities of two different adjacent frames; obtaining a total fused optical flow based on the optical flow intensities of the two different adjacent frames; and generating a defect-enhanced vehicle body image based on the fused optical flow and the initial vehicle body image. Performing defect detection on the defect-enhanced vehicle body image to obtain a position of a vehicle body paint defect in a camera coordinate system; The paint defect position of the vehicle body in the camera coordinate system is mapped to the three-dimensional coordinate system of the vehicle body to obtain the target paint defect position of the vehicle body.
2. The method according to claim 1, characterized in that Calculating the first direction optical flow and the second direction optical flow of two adjacent frames in the initial vehicle body image includes: The Farneback function is used to calculate the first direction optical flow and the second direction optical flow of two adjacent frames in the initial vehicle body image.
3. The method according to claim 1, characterized in that Mapping the vehicle body paint defect position in the camera coordinate system to the vehicle body three-dimensional coordinate system to obtain the target vehicle body paint defect position includes: Obtain the vehicle body CAD 3D model, vehicle body reference position, and streak camera calibration parameters; Based on the vehicle body reference position and the streak camera calibration parameters, the vehicle body paint defect position in the camera coordinate system is mapped to the vehicle body CAD three-dimensional model to obtain the target vehicle body paint defect position.
4. The method according to any one of claims 1 to 3, characterized in that Mapping the vehicle body paint defect position in the camera coordinate system to the vehicle body three-dimensional coordinate system to obtain the target vehicle body paint defect position includes: Mapping the paint defect position of the vehicle body in the camera coordinate system to the three-dimensional coordinate system of the vehicle body to obtain the defect position in the three-dimensional coordinate system of the vehicle body; The defect positions in the three-dimensional coordinate system of the vehicle body are deduplicated based on a preset error tolerance value to obtain the target vehicle body paint surface defect positions.
5. The method according to claim 4, characterized in that Deduplication of defect positions in the vehicle body three-dimensional coordinate system based on a preset error tolerance to obtain target vehicle body paint defect positions includes: Obtaining the Euclidean distance between defect positions in the three-dimensional coordinate system of the vehicle body; Determine the defect location whose Euclidean distance is less than the preset error tolerance as a duplicate point; The duplicate points of the defect position in the three-dimensional coordinate system of the vehicle body are removed to obtain the target vehicle body paint defect position.
6. A vehicle body paint defect detection device, characterized in that: For implementing the method according to any one of claims 1 to 5, the device comprises: An image acquisition module is used to acquire an initial vehicle body image captured by a streak camera under the illumination of sinusoidal streak light; an enhancement module, configured to enhance defects of the initial vehicle body image using an optical flow method to obtain a defect-enhanced vehicle body image; a defect detection module, configured to perform defect detection on the defect-enhanced vehicle body image to obtain a position of a vehicle body paint defect in a camera coordinate system; The mapping module is used to map the paint defect position of the vehicle body in the camera coordinate system to the three-dimensional coordinate system of the vehicle body to obtain the target paint defect position of the vehicle body.
7. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 5 are implemented.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.
9. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.
Citation Information
Patent Citations
Intelligent detecting and polishing system and method for automobile body paint surface defects
CN114720475A
Vehicle body paint surface defect video detection method and video detection system
CN116930187A