Vehicle body paint surface defect detection method and device, computer equipment and medium
The body image is enhanced by the optical flow method and mapped to the three-dimensional coordinate system, which solves the problems of low traditional manual detection efficiency and high leakage detection rate, and achieves efficient and accurate detection of body paint defects.
Patent Information
- Application Number
- CN202411183564.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-27
- Publication Date
- 2024-12-06
- Estimated Expiration
- 2044-08-27
AI Technical Summary
Traditional artificial visual inspection methods are inefficient and have high leakage detection rate in automotive paint defect detection, making it impossible to achieve efficient and accurate detection of car body paint defects.
The optical flow method is used to enhance the defects of the vehicle body image, and combined with the initial image collected by the striped camera, the defect position of the body paint surface is detected and mapped to the three-dimensional coordinate system to achieve efficient and accurate defect detection.
The image is enhanced by the optical flow method, accurately identify the paint defects of the vehicle body, and map them to the three-dimensional coordinate system under the camera coordinate system, which improves detection efficiency and accuracy and reduces the leakage detection rate.
Smart Images

Figure CN119086563A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a method, device, computer equipment, storage medium and computer program product for detecting vehicle body paint defects. Background Art
[0002] The paint surface of a car not only directly determines the beauty and quality of the whole vehicle, but also provides effective protection for the body and prolongs the service life of the vehicle. However, during the painting process, various defects will inevitably appear on the car paint surface, such as local dents, paint blistering, and small scratches. These problems not only affect the appearance of the vehicle, but may also cause corrosion to the body, threatening the safety of the whole vehicle. Therefore, timely detection and repair of these paint defects is crucial to ensure the quality and performance of the whole vehicle. However, the strong high-reflective characteristics of the paint surface bring huge challenges to surface imaging and defect detection. Therefore, traditional technologies still mainly use manual visual methods to detect defects.
[0003] The traditional method of defect detection using manual visual inspection is not only inefficient, but also has a high defect missed detection rate. It is unable to achieve efficient and accurate 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] Obtaining an initial vehicle body image captured by a streak camera under the illumination of sinusoidal streak light;
[0007] Using an optical flow method to perform defect enhancement on the initial vehicle body image to obtain a defect enhanced vehicle body image;
[0008] Performing defect detection on the defect-enhanced vehicle body image to obtain the position of the vehicle body paint defect in the 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 using an optical flow method to perform defect enhancement on the initial vehicle body image to obtain a defect enhanced vehicle body image comprises:
[0011] 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;
[0012] The first directional optical flow and the second directional optical flow are combined to obtain optical flow intensities of two different adjacent frames;
[0013] Based on the optical flow intensities of the two different adjacent frames, a total fused optical flow is obtained;
[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, the step of removing duplicate defect positions in the three-dimensional coordinate system of the vehicle body based on a preset error tolerance value to obtain a target vehicle body paint defect position comprises:
[0024] Obtaining the Euclidean distance between defect positions in the three-dimensional coordinate system of the vehicle body;
[0025] Determine the defect position whose Euclidean distance is less than the preset error tolerance value 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, used for performing defect enhancement on the initial vehicle body image by using an optical flow method to obtain a defect enhanced vehicle body image;
[0030] A defect detection module, 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;
[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, the memory stores a computer program, and the processor implements the following steps when executing the computer program:
[0033] Obtaining an initial vehicle body image captured by a streak camera under the illumination of sinusoidal streak light;
[0034] Using an optical flow method to perform defect enhancement on the initial vehicle body image to obtain a defect enhanced vehicle body image;
[0035] Performing defect detection on the defect-enhanced vehicle body image to obtain the position of the vehicle body paint defect in the 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. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the following steps are implemented:
[0038] Obtaining an initial vehicle body image captured by a streak camera under the illumination of sinusoidal streak light;
[0039] Using an optical flow method to perform defect enhancement on the initial vehicle body image to obtain a defect enhanced vehicle body image;
[0040] Performing defect detection on the defect-enhanced vehicle body image to obtain the position of the vehicle body paint defect in the 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, and when the computer program is executed by a processor, the following steps are implemented:
[0043] Obtaining an initial vehicle body image captured by a streak camera under the illumination of sinusoidal streak light;
[0044] Using an optical flow method to perform defect enhancement on the initial vehicle body image to obtain a defect enhanced vehicle body image;
[0045] Performing defect detection on the defect-enhanced vehicle body image to obtain the position of the vehicle body paint defect in the 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 above-mentioned vehicle body paint defect detection method, device, computer equipment, storage medium and computer program product obtain the initial vehicle body image of the vehicle body under the irradiation of sinusoidal stripe light captured by the streak camera; use the optical flow method to enhance the defects of the initial vehicle body image to obtain the defect enhanced vehicle body image; perform defect detection on the defect enhanced vehicle body image to obtain the vehicle body paint defect position in the camera coordinate system; map 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. In the whole process, the initial vehicle body image of the vehicle body under the irradiation of sinusoidal stripe light captured by the streak camera is used for vehicle body paint defect detection based on the initial vehicle body image, and the initial vehicle body image is enhanced by the optical flow method, so that efficient and accurate vehicle body paint defect detection can be achieved. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] Figure 1 A diagram showing an application environment of a vehicle body paint defect detection method in an embodiment;
[0049] Figure 2 A schematic diagram of a process of detecting vehicle body paint defects in one embodiment;
[0050] Figure 3 A schematic diagram of a process of 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. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0053] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present 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, the vehicle body is illuminated by sinusoidal stripe light, and the streak camera 102 collects the initial vehicle body image at this time, and sends the initial vehicle body image to the detection terminal 104, and the detection terminal 104 obtains the initial vehicle body image of the vehicle body under the sine stripe light illumination collected by the streak camera; the initial vehicle body image is defect-enhanced by the optical flow method to obtain a defect-enhanced vehicle body image; the defect-enhanced vehicle body image is defect-detected to obtain the vehicle body paint defect position in the camera coordinate system; the vehicle body paint defect position in the camera coordinate system is mapped to the vehicle body 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 the example 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] The tunnel-type LED light source plus the diffusion plate displays sinusoidal stripe light. During the inspection process, the vehicle body passes through the tunnel, and the light source shines on the surface of the vehicle body to produce sinusoidal stripe light bands. At this time, the streak camera collects the initial vehicle body image under the irradiation of the sinusoidal stripe light, and then sends the collected initial vehicle body image to the inspection terminal. Specifically, the streak camera needs to be based on a certain beat during the shooting process. Specifically, the forward distance of the vehicle body and the shooting beat of the streak camera can be controlled to accurately collect the initial vehicle body image for subsequent vehicle body paint defect detection. During shooting, the displacement change of the vehicle body for each photo should not exceed 1 / 4 of the short side width 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 principle of defect measurement by optical flow method: the brightness of non-defective areas remains approximately unchanged in adjacent frames, which is the background. The light intensity of defects will change in adjacent image frames, which is regarded as the defect moving on the background. Here, the optical flow method is used to enhance the defects of the initial body image, so that the defects of the body paint surface can be easily identified. Specifically, since there is a relative displacement between the defect and the stripe, the dense optical flow algorithm Farneback can be used for defect enhancement.
[0060] S600: 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.
[0061] Defect detection is performed on the defect-enhanced vehicle body image obtained in S400, which can be performed using a conventional vehicle body paint surface detection method to identify and locate the position of the vehicle body paint surface defect, determine the defect type, and calculate the defect size. Since the current vehicle body paint surface defect detection result is obtained based on the image collected by the streak camera, the paint surface defect position obtained at this time is the vehicle body paint surface defect position in the camera coordinate system.
[0062] S800: 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 target paint defect position of the vehicle body.
[0063] In order to finally obtain the body paint defect position 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 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, and the target body paint defect position can 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 the initial vehicle body image captured by the streak camera under the irradiation of sinusoidal stripe light; uses the optical flow method to enhance the defects of the initial vehicle body image to obtain the 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; maps 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. In the whole process, the initial vehicle body image captured by the streak camera under the irradiation of sinusoidal stripe light is used for vehicle body paint defect detection based on the initial vehicle body image, and the initial vehicle body image is enhanced by the optical flow method, so that efficient and accurate vehicle body paint defect detection can be achieved.
[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 features. The optical flow intensity (or optical flow amplitude) is usually defined as the modulus of the vector sum of the optical flow components in 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, that is, the "size" or "intensity" of the optical flow in two-dimensional space, which reflects the speed of the movement of pixels or feature points in the image. The first direction optical flow and the second direction optical flow obtained from different adjacent frames are fused separately to obtain the optical flow intensity of different two adjacent frames.
[0073] S460: Obtaining a total fused optical flow based on the optical flow intensities of two different adjacent frames.
[0074] The optical flow intensities of two adjacent frames are accumulated to obtain the total fused optical flow. 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 according to 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 value of optical flow intensity can be set to distinguish between normal areas and potential defect areas, where 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. The defect areas can be highlighted by adjusting the contrast or brightness of the defect areas or applying other image enhancement techniques. In order to display the defects more clearly, the defect areas can be marked with specific colors or color coding, for example, using highlight colors such as red or yellow to mark the defects. The edges of the enhanced defect 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 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 includes:
[0081] The vehicle body CAD three-dimensional model, the vehicle body reference position and the streak camera calibration parameters are obtained; 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.
[0082] Mapping the position of the paint defect in the camera coordinate system to the 3D coordinate system of the vehicle body, especially the 3D model of the vehicle body CAD (computer-aided design), is a complex process involving multiple steps. This usually includes steps such as camera calibration, coordinate conversion and 3D space positioning. Specifically, the whole 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, often used for design, manufacturing, and quality control. Car body reference position: A known or easily identifiable position of 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 position and orientation of the camera relative to the car body) geometric characteristics. The calibration process usually involves taking pictures of 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, while ensuring that the captured image contains enough feature points for accurate calibration. Apply a camera calibration algorithm (such as Zhang Zhengyou calibration method) to calculate the camera's internal and external parameters. These parameters will be used for subsequent coordinate transformation.
[0087] 3. Coordinate transformation
[0088] From image coordinates to camera coordinates: First, convert the position of the paint defect on the vehicle body captured by the camera (in pixels) into three-dimensional coordinates in the camera coordinate system. This usually involves steps such as image dedistortion and mapping of image coordinates to camera coordinates. From camera coordinates to vehicle body three-dimensional coordinates: Then, using the internal and external parameters obtained by camera calibration and the information of the vehicle body reference position, the defect position in the camera coordinate system is mapped to the coordinate system of the vehicle body CAD three-dimensional model. This usually involves mathematical operations such as rigid body transformation (rotation and translation).
[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 3D space of the vehicle body. The defect location is marked in 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. Adjust camera calibration parameters, coordinate transformation algorithms, or mapping processes based on the verification results to improve mapping accuracy and reliability.
[0093] In one embodiment, 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 target paint defect position of the vehicle body 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 this embodiment, in addition to position mapping, the defect positions are also deduplicated to improve the accuracy of the target vehicle body paint defect position obtained in the end. In practical applications, there may be multiple cameras or the same camera capturing the same defect data at different times, which can be better removed after mapping to the vehicle body three-dimensional coordinate system. Considering the existence of errors in the coordinate mapping process, the error tolerance Δd is set. If the Euclidean distance between defects is less than the error tolerance, it is judged as a duplicate point.
[0096] Furthermore, based on a preset error tolerance value, the defect positions in the three-dimensional coordinate system of the vehicle body are deduplicated to obtain the target vehicle body paint defect positions, 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; deduplicating the duplicate points of the defect positions in the three-dimensional coordinate system of the vehicle body to obtain the target vehicle body paint defect positions.
[0097] Specifically, when processing paint defect position data in the three-dimensional coordinate system of the vehicle body, in order to ensure data accuracy and reduce redundancy, the defect positions are usually deduplicated based on the preset error tolerance. This process mainly includes the following steps:
[0098] 1. Obtain the defect position in the three-dimensional coordinate system of the vehicle body.
[0099] First, it is necessary to obtain the specific positions of all detected body paint defects in the three-dimensional coordinate system. These positions are usually expressed in the form of (x, y, z) coordinates, where x, y, and z represent the horizontal, vertical, and height coordinates in the 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, the preset error tolerance (usually a small positive number, such as 0.1mm or set according to specific needs) is used to determine which defect locations are "repeated". If the Euclidean distance between two defect locations is less than this preset error tolerance, the two locations are considered to be repeated, or they represent a small offset of the same defect in different inspections.
[0104] 4. Deduplication processing.
[0105] For the points that are determined to be duplicates, duplicate removal is required. This usually means selecting one of the points as a representative and deleting or ignoring the other duplicate points. The method of deduplication can be selected according to specific needs, such as averaging the coordinate values, retaining the first detected point or the last detected point, etc. Get the target body paint defect position:
[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 involved in the above embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above embodiments may include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0108] Based on the same inventive concept, the embodiment of the present application also provides a vehicle body paint defect detection device for implementing the vehicle body paint defect detection method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more vehicle body paint defect detection device embodiments provided below can refer to the limitations of the vehicle body paint defect detection method above, and will not be repeated 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 vehicle body image captured by a streak camera under the illumination of sinusoidal streak light;
[0111] An enhancement module 400 is used to enhance defects of the initial vehicle body image by 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 of the embodiments, the enhancement module 400 is also 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 directional optical flow and the second directional optical flow of two adjacent frames in the initial vehicle body image by using the Farneback function.
[0116] In one of the embodiments, 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 of the embodiments, 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; 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 of the embodiments, the mapping module 800 is also used to obtain the Euclidean distance between the defect positions in the three-dimensional coordinate system of the vehicle body; determine that the defect position whose Euclidean distance is less than a preset error tolerance value is a duplicate point; and remove the duplicate points of the defect position in the three-dimensional coordinate system of the vehicle body to obtain the target vehicle body paint defect position.
[0119] Each module in the above-mentioned vehicle body paint defect detection device can be implemented in whole or in part by software, hardware, or a combination thereof. Each of the above-mentioned modules can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute the operations corresponding to each of the above modules.
[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 through a system bus. Among them, 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 on a vehicle body paint surface 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 covered on the display screen, or a button, a trackball or a touchpad set on the computer device housing, or an external keyboard, touchpad or mouse, etc.
[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 those shown in the figure, or combine certain components, or have a different arrangement of components.
[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, including 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 can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and 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 the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can 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 can include random access memory (RAM) or external cache memory, etc. As an 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 each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.
[0126] The technical features of the above embodiments may 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 only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A method for detecting defects on a vehicle body paint surface, characterized in that: The method comprises: Obtaining an initial vehicle body image captured by a streak camera under the illumination of sinusoidal streak light; Using an optical flow method to perform defect enhancement on the initial vehicle body image to obtain a defect enhanced vehicle body image; Performing defect detection on the defect-enhanced vehicle body image to obtain the position of the vehicle body paint defect in the 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 The defect enhancement of the initial vehicle body image by using the optical flow method to obtain the defect enhanced vehicle body image comprises: 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; The first directional optical flow and the second directional optical flow are combined to obtain optical flow intensities of two different adjacent frames; Based on the optical flow intensities of the two different adjacent frames, a total fused optical flow is obtained; A defect-enhanced vehicle body image is generated according to the fused optical flow and the initial vehicle body image.
3. The method according to claim 2, characterized in that The calculating of the first direction optical flow and the second direction optical flow of two adjacent frames in the initial vehicle body image comprises: 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.
4. 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.
5. 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: 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.
6. The method according to claim 5, characterized in that Deduplication of defect positions in the three-dimensional coordinate system of the vehicle body 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 position whose Euclidean distance is less than the preset error tolerance value 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.
7. A vehicle body paint defect detection device, characterized in that: 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, used for performing defect enhancement on the initial vehicle body image by using an optical flow method to obtain a defect enhanced vehicle body image; A defect detection module, 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; 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.
8. 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 6 are implemented.
9. 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 6 are implemented.
10. 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 6 are implemented.
Citation Information
Patent Citations
Magneto-optic image enhancement method based on optical flow algorithm
CN107180428A
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
Vehicle body paint surface defect detection device
CN214251551U
Tunnel defect detecting method and system using unmanned aerial vehicle
US20220383484A1
Cited By
Paint surface visual inspection and grinding and polishing method, device, equipment, medium and program product
CN120516502A
