An interior part defect detection method, system, computer, and storage medium
By processing image data and extracting features of vehicle interior parts, combined with SURF and RANSAC algorithms, efficient and accurate welding defect detection is achieved, solving the problem of low detection efficiency in the prior art.
Patent Information
- Application Number
- CN202411975278.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-31
- Publication Date
- 2025-06-27
- Estimated Expiration
- 2044-12-31
AI Technical Summary
In the prior art, the welding quality detection efficiency of interior parts is low, and requires manual observation or detection based on global image features, making it difficult to achieve efficient and accurate defect recognition.
By obtaining the image data of the vehicle interior parts, performing perspective transformation and edge feature extraction, obtaining the detection coordinates of the welding area, selecting the target sub-image, calculating the average grayscale value to judge the welding defect, and feature matching is performed through the SURF algorithm and the RANSAC algorithm to identify the defect type.
It improves the efficiency and accuracy of welding defect detection, reduces the calculation amount, reduces the impact of lighting, and enhances the extraction accuracy of weld images and the accuracy of defect type identification.
Smart Images

Figure CN119399553B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of interior part detection, and particularly relates to a method, a system, a computer and a storage medium for detecting interior part defects. Background Art
[0002] In order to enhance the strength and stability of interior parts such as door trim panels and instrument panels, horizontal and vertical metal strips are welded together. Whether the welding is good is related to the installation accuracy and appearance quality of the interior parts.
[0003] In the prior art, the detection of welding quality usually requires manual inspection to observe and detect whether there are defects such as cracks, incomplete penetration, pores, and welding beads on its surface; or through an optical detection system, images are collected to judge whether there are defects based on the global recognition detection of image features, and the detection efficiency is low. Summary of the Invention
[0004] Aiming at the deficiencies of the prior art, the purpose of the present invention is to provide a method, a system, a computer and a storage medium for detecting interior part defects, aiming to solve the technical problem of low detection efficiency in the prior art.
[0005] To achieve the above purpose, in a first aspect, the present invention provides: A method for detecting interior part defects, comprising the following steps:
[0006] Obtain the image data of the vehicle interior part, perform perspective transformation processing on the image data to obtain a front view image;
[0007] Extract the edge features of the front view image, obtain the center coordinates corresponding to the interior part based on the edge features, and obtain the detection coordinates corresponding to the welding area based on the center coordinates and the edge features;
[0008] Select a target sub-image from the front view image based on the detection coordinates, calculate the average gray value corresponding to each pixel in the target sub-image, and determine whether the average gray value exceeds a preset range;
[0009] If the average gray value exceeds the preset range, it is determined that the interior part has a welding defect.
[0010] According to one aspect of the above technical solution, after the step of determining that the vehicle interior part has a welding defect, the method further includes:
[0011] Obtain the gray values of the target sub-images corresponding to each welding area, select the target sub-images corresponding to the gray values that exceed the preset range, and mark them as abnormal images;
[0012] Extract defect feature points from the abnormal images based on the SURF algorithm;
[0013] Match the defective feature points with the matching feature points in the template image, and select the optimal matching points based on the Euclidean distance between the matching feature points and the defective feature points, so as to obtain the defect type corresponding to the abnormal image.
[0014] According to one aspect of the above technical solution, the step of selecting the optimal matching points based on the Euclidean distance between the matching feature points and the defective feature points, so as to obtain the defect type corresponding to the abnormal image specifically includes:
[0015] Calculate the Euclidean distance between each of the matching feature points and the defective feature points, sort based on the magnitudes of the Euclidean distances, and screen out some defective feature points with Euclidean distances greater than a preset threshold to obtain a set of target feature points;
[0016] Adopt the RANSAC algorithm to determine inliers based on the set of target feature points to match the corresponding template image, so as to obtain the defect type corresponding to the abnormal image.
[0017] According to one aspect of the above technical solution, the expression of the Euclidean distance corresponding to the set of target feature points is as follows:
[0018] ;
[0019] In the formula, d is the Euclidean distance corresponding to the set of target points, and are respectively the maximum and minimum values of the Euclidean distances between each of the matching feature points and the defective feature points, and k is a proportionality coefficient.
[0020] According to one aspect of the above technical solution, before the step of calculating the average gray value corresponding to each pixel in the target sub-image, the method further includes:
[0021] Filter the target sub-image using low-pass filtering to obtain the average gray value, and based on the following calculation formula, obtain the gray value of the processed target sub-image:
[0022] ;
[0023] In the formula, is the gray value of the processed target sub-image, is the gray value of the target sub-image before processing, represents the rounding function, v is the median gray value, is the average gray value, and F is the cut-off frequency.
[0024] According to one aspect of the above technical solution, the step of selecting the target sub-image from the front view image based on the detection coordinates specifically includes:
[0025] Select the weld center point corresponding to the weld shape from the front view image based on the detected coordinates;
[0026] Take the pixel points on the weld center point as the initial seed point set, and use the region growing method to segment and form a target sub-image from the front view image based on the gray level difference value between the initial seed point set and the neighborhood pixel points.
[0027] According to one aspect of the above technical solution, the growth condition expression corresponding to the gray level difference value is:
[0028] ;
[0029] ;
[0030] ;
[0031] ;
[0032] ;
[0033] In the formula, is the weighted gray level value of the pixel points in the area to be grown, is the average gray level value of the pixel points in the grown area, is the adaptive threshold of the gray level change, is the preset range, n is the number of pixel points in the grown area, is the variance of the gray level values of the pixel points in the grown area, is the first gray level value of the weld center point, is the coordinate of the weld center point, is the second gray level value of the neighborhood pixel point, is the coordinate of the neighborhood pixel point, j is the number of neighborhood pixel points, is the third gray level value of the surrounding pixel points of the neighborhood pixel point, is the coordinate of the surrounding pixel points of the neighborhood pixel point, k is the number of the surrounding pixel points of the neighborhood pixel point, , , are the weight coefficients of the first gray level value, the second gray level value and the third gray level value respectively.
[0034] In the second aspect, the present invention provides an interior part defect detection system, including:
[0035] An image module, configured to obtain image data of a vehicle interior part, perform perspective transformation processing on the image data, and obtain a front view image;
[0036] An edge feature module, configured to extract the edge features of the front view image, obtain the center coordinates corresponding to the interior part based on the edge features, and obtain the detection coordinates corresponding to the welding area based on the center coordinates and the edge features;
[0037] A grayscale module, configured to select a target sub-image from the front view image based on the detection coordinates, calculate the average grayscale value corresponding to each pixel in the target sub-image, and determine whether the average grayscale value exceeds a preset range;
[0038] A determination module, configured to determine that there is a welding defect in the interior part if the average grayscale value exceeds the preset range.
[0039] According to one aspect of the above technical solution, the system further includes:
[0040] A defect type module, configured to obtain the grayscale values of the target sub-images corresponding to each welding area, select the target sub-images corresponding to the grayscale values that exceed the preset range, and mark them as abnormal images;
[0041] Extract defect feature points from the abnormal images based on the SURF algorithm;
[0042] Match the defect feature points with the matching feature points in the template image, and select the optimal matching points based on the Euclidean distance between the matching feature points and the defect feature points, so as to obtain the defect type corresponding to the abnormal image.
[0043] According to one aspect of the above technical solution, the defect type module is specifically configured to:
[0044] Calculate the Euclidean distance between each matching feature point and the defect feature point, sort based on the magnitudes of the Euclidean distances, and screen out some defect feature points with Euclidean distances greater than a preset threshold to obtain a set of target feature points;
[0045] Adopt the RANSAC algorithm to perform inlier determination based on the set of target feature points to match the corresponding template image, so as to obtain the defect type corresponding to the abnormal image.
[0046] According to one aspect of the above technical solution, the grayscale module is specifically configured to:
[0047] Select the weld center point corresponding to the weld shape from the front view image based on the detection coordinates;
[0048] Use the pixel points on the weld center point as the initial seed point set, and adopt the region growing method to segment and form a target sub-image from the front view image based on the grayscale difference value between the initial seed point set and the neighboring pixel points.
[0049] Compared with the prior art, the beneficial effects of the present invention are as follows: By acquiring the image data of the vehicle interior parts and obtaining the detection coordinates corresponding to the welding areas of the interior parts according to the recognition of the edge features of the interior parts, the target sub-image can be selected from the image data. By calculating the average gray value of the target sub-image, it is judged whether there is an abnormal welding appearance. Further, the SURF algorithm is used to extract the features of the abnormal image, and then the RANSAC algorithm is used to match the features with the template features of different defect types to identify the defect types. Compared with the method of global image feature extraction detection, the detection efficiency can be effectively improved. Since the distances between the correct matching points of the welds are basically the same, the partial defect feature points with the Euclidean distance greater than the preset threshold are screened out, which can reduce the calculation amount and achieve the purpose of accurate matching. By using low-pass filtering to filter the target sub-image, the influence of image illumination can be reduced. By using the region growing method to segment and form the target sub-image, the pixel points on the weld center point are used as the initial seed point set, and the adaptive threshold of the gray change is set according to the set growth conditions, so that the weld image can be effectively extracted and the accuracy of subsequent defect type recognition can be improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] Figure 1 It is a schematic flowchart of the interior part defect detection method in the first embodiment of the present invention;
[0051] Figure 2 It is a structural block diagram of the interior part defect detection system in the second embodiment of the present invention;
[0052] Figure 3 It is a schematic hardware structure diagram of a computer in the third embodiment of the present invention;
[0053] The following specific embodiments will further illustrate the present invention in conjunction with the above-mentioned drawings. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0054] To facilitate the understanding of the present invention, the present invention will be described more comprehensively below with reference to the relevant drawings. Several embodiments of the present invention are given in the drawings. However, the present invention can be implemented in many different forms and is not limited to the embodiments described herein. On the contrary, these embodiments are provided to make the disclosure of the present invention more thorough and comprehensive.
[0055] It should be noted that when an element is referred to as being "fixed to" another element, it can be directly on the other element or there may also be a middle element. When an element is considered to be "connected" to another element, it can be directly connected to the other element or there may be a middle element at the same time. The terms "vertical", "horizontal", "left", "right" and similar expressions used herein are only for the purpose of illustration.
[0056] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the technical field to which this invention belongs. The terms used in the specification of this invention are for the purpose of describing specific embodiments only and are not intended to limit the invention. The term "and / or" used herein includes any and all combinations of one or more of the related listed items.
[0057] Embodiment 1
[0058] Please refer to Figure 1 , which shows a flowchart of the interior part defect detection method in the first embodiment of the present invention. As shown in the figure, the method includes the following steps:
[0059] Step S100, obtain the image data of the vehicle interior part, and perform perspective transformation processing on the image data to obtain a front view image.
[0060] Specifically, in this embodiment, the above-mentioned vehicle interior part is the instrument panel skeleton. The instrument panel skeleton is the main support structure of the instrument panel and is composed of multiple metal parts. Most of the connections between these parts are completed by welding, such as the connection between the cross beam and the longitudinal beam. Stable welding can ensure that the instrument panel skeleton has sufficient strength to bear the weight of components such as the instrument, air outlet, and control panel; the above-mentioned image data is the image data after welding processing, and perspective transformation processing is used to eliminate the angle difference between the acquisition plane and the workpiece plane.
[0061] Step S200, extract the edge features of the front view image, obtain the center coordinates corresponding to the interior part based on the edge features, and obtain the detection coordinates corresponding to the welding area based on the center coordinates and the edge features. The extraction of the above-mentioned edge features can adopt the Canny edge detection algorithm, the gradient operator method, etc.
[0062] Step S300, select a target sub-image from the front view image based on the detection coordinates, calculate the average gray value corresponding to each pixel in the target sub-image, and determine whether the average gray value exceeds a preset range.
[0063] It can be understood that the above-mentioned target sub-image corresponds to the image of the weld seam. Since the distribution pattern of the weld seam is the same, if there is no problem with the welding, the average gray value of each pixel point in the image is within a certain range; if the average gray value is too high or too low, it indicates that there are abnormalities such as missed welding or welding beads in the welding. Using the inspection method of gray value can improve the detection efficiency.
[0064] Preferably, in the above step S300, before the step of calculating the average gray value corresponding to each pixel in the target sub-image, the method further includes:
[0065] The target sub-image is filtered by low-pass filtering to obtain the average value of the gray values, and the gray value of the processed target sub-image is obtained based on the following calculation formula:
[0066] ;
[0067] In the formula, is the gray value of the processed target sub-image, is the gray value of the target sub-image before processing, represents the rounding function, v is the median gray value, is the average gray value, and F is the cut-off frequency. By performing low-pass filtering on the target sub-image, the part with a large gray value in the image becomes smaller, and the part with a small gray value becomes larger, so as to achieve the purpose of balancing the illumination and reducing the influence of light on the image.
[0068] Preferably, in the above step S300, the step of selecting the target sub-image from the front view image based on the detection coordinates specifically includes:
[0069] Step S310, selecting the weld center point corresponding to the weld shape from the front view image based on the detection coordinates.
[0070] Step S320, using the pixel points on the weld center point as the initial seed point set, and adopting the region growing method to segment and form the target sub-image from the front view image based on the gray difference value between the initial seed point set and the neighboring pixel points.
[0071] It can be understood that, compared with the method of obtaining the target sub-image by selecting a rectangular frame through the detection coordinates, the method of using the region growing method can more accurately segment the target sub-image corresponding to the weld image. At the same time, using the weld center point, that is, the pixel points in the middle of the weld image, as the initial seed point can improve the growth efficiency and accuracy.
[0072] Furthermore, in this embodiment, the growth condition expression corresponding to the above gray difference value is:
[0073] ;
[0074] ;
[0075] ;
[0076] ;
[0077] ;
[0078] In the formula, is the weighted gray value of the pixel points in the area to be grown, is the average gray value of the pixel points in the grown area, is the adaptive threshold of the gray change, is the preset range, n is the number of pixel points in the grown area, is the variance of the gray values of the pixel points in the grown area, is the first gray value of the center point of the weld, is the coordinate of the center point of the weld, is the second gray value of the neighboring pixel points, is the coordinate of the neighboring pixel points, j is the number of neighboring pixel points, is the third gray value of the surrounding pixel points of the neighboring pixel points, is the coordinate of the surrounding pixel points of the neighboring pixel points, k is the number of surrounding pixel points of the neighboring pixel points, 、 、 are the weight coefficients of the first gray value, the second gray value and the third gray value respectively.
[0079] Specifically, in this embodiment, the neighboring pixel points are the surrounding 8 pixel points in the nine-grid pixel points of the center point of the weld. The surrounding pixel points of the above neighboring pixel points are the four pixel points on the outside, up, down, left and right of the above 8 pixel points. By taking the average gray value within the twelve-neighborhood around the point to be grown and adaptively changing the threshold at the same time, the adaptive ability of region growing can be enhanced, and the phenomena of over-segmentation, under-segmentation and incomplete growth can be improved, and the robustness can be improved.
[0080] Step S400, if the average gray value exceeds the preset range, it is determined that there is a welding defect in the interior trim part.
[0081] It can be understood that if the above average gray value meets the preset range, it means that the brightness of the target sub-image is similar to that of the standard image, indicating that the welding appearance is normal.
[0082] Preferably, in this embodiment, after the step of determining that there is a welding defect in the vehicle interior trim part, the method further includes:
[0083] Step S500, obtain the gray values of the target sub-images corresponding to each welding area, select the target sub-images corresponding to the gray values that exceed the preset range, and mark them as abnormal images.
[0084] Step S600: Extract features from the abnormal image based on the SURF algorithm to obtain defect feature points. The SURF algorithm, namely the Speeded Up Robust Features algorithm, is a feature detection and description algorithm for image recognition and computer vision. Through steps such as constructing the Hessian matrix, the SURF algorithm can stably detect feature points in the image and describe these feature points for subsequent processing such as image matching and target recognition.
[0085] Step S700: Match the defect feature points with the matching feature points in the template image, and select the optimal matching points based on the Euclidean distance between the matching feature points and the defect feature points, so as to obtain the defect type corresponding to the abnormal image.
[0086] Further, the step of selecting the optimal matching points based on the Euclidean distance between the matching feature points and the defect feature points to obtain the defect type corresponding to the abnormal image specifically includes:
[0087] Step S710: Calculate the Euclidean distance between each matching feature point and the defect feature point, sort based on the magnitudes of the Euclidean distances, and screen out some defect feature points with Euclidean distances greater than the preset threshold to obtain the target feature point set;
[0088] Step S720: Use the RANSAC algorithm to perform inlier determination based on the target feature point set to match the corresponding template image, so as to obtain the defect type corresponding to the abnormal image.
[0089] The expression of the Euclidean distance corresponding to the target feature point set is as follows:
[0090] ;
[0091] In the formula, d is the Euclidean distance corresponding to the target point set, and are respectively the maximum and minimum values of the Euclidean distances between each matching feature point and the defect feature point, and k is a proportionality coefficient.
[0092] Specifically, k is a proportionality coefficient. In this embodiment, it takes 0.6 - 0.7 to remove more incorrect matching point pairs with large Euclidean distance deviations.
[0093] Taking advantage of the characteristic that the distances of correct matching points do not vary much, a preliminary screening is carried out. After the preliminary screening, most non - associated points are removed, and the intersections formed by the straight lines between the remaining associated points are also greatly reduced. This not only improves the accuracy, but also shortens the detection time due to the reduction of matching points, thereby improving the detection efficiency.
[0094] In summary, in the above-mentioned embodiment of the present invention, the interior part defect detection method obtains the image data of the vehicle interior part, and obtains the detection coordinates corresponding to the welding area of the interior part according to the recognition of the edge features of the interior part, so as to select the target sub-image from the image data. By calculating the average gray value of the target sub-image, it is judged whether there is an abnormal welding appearance. Further, the SURF algorithm is used to extract the features of the abnormal image, and then the RANSAC algorithm is used to match the features with the template features of different defect types to identify the defect types. Compared with the global image feature extraction detection method, the detection efficiency can be effectively improved. Since the distances between the correctly matched points of the welds are basically the same, the part of the defect feature points with the Euclidean distance greater than the preset threshold is screened out, which can reduce the calculation amount and achieve the purpose of accurate matching. By using low-pass filtering to filter the target sub-image, the influence of image illumination can be reduced. By using the region growing method to segment and form the target sub-image, the pixel points on the weld center point are used as the initial seed point set, and the adaptive threshold of gray change is set according to the set growth conditions, so that the weld image can be effectively extracted and the accuracy of subsequent defect type recognition can be improved.
[0095] Embodiment 2
[0096] The second embodiment of the present application also provides an interior part defect detection system, which is used to implement the above-mentioned embodiment and the preferred implementation manner, and those that have been described will not be repeated. As used hereinafter, terms such as "module", "unit", "sub-unit", etc. can be a combination of software and / or hardware that can achieve a predetermined function. Although the system described in the following embodiments is preferably implemented in software, implementation in hardware, or a combination of software and hardware is also possible and contemplated.
[0097] As Figure 2 shown, the system includes: an image module 100, an edge feature module 200, a gray module 300, and a determination module 400.
[0098] The image module 100 is used to obtain the image data of the vehicle interior part, perform perspective transformation processing on the image data, and obtain a front view image;
[0099] The edge feature module 200 is used to extract the edge features of the front view image, obtain the center coordinates corresponding to the interior part based on the edge features, and obtain the detection coordinates corresponding to the welding area based on the center coordinates and the edge features;
[0100] The gray module 300 is used to select a target sub-image from the front view image based on the detection coordinates, calculate the average gray value corresponding to each pixel in the target sub-image, and judge whether the average gray value exceeds a preset range;
[0101] The determination module 400 is configured to determine that there is a welding defect in the interior trim part if the average gray value exceeds a preset range.
[0102] Preferably, in this embodiment, the system further includes:
[0103] A defect type module, configured to obtain the gray values of the target sub-images corresponding to the respective welding areas, select the target sub-images corresponding to the gray values that exceed the preset range, and mark them as abnormal images;
[0104] Extract features from the abnormal images based on the SURF algorithm to obtain defect feature points;
[0105] Match the defect feature points with the matching feature points in the template image, and based on the Euclidean distance between the matching feature points and the defect feature points, select the optimal matching points, so as to obtain the defect type corresponding to the abnormal image.
[0106] Preferably, in this embodiment, the defect type module is specifically configured to:
[0107] Calculate the Euclidean distances between each of the matching feature points and the defect feature points, sort them based on the magnitudes of the Euclidean distances, and screen out some defect feature points with Euclidean distances greater than a preset threshold to obtain a set of target feature points;
[0108] Adopt the RANSAC algorithm to perform inlier determination based on the set of target feature points to match the corresponding template image, so as to obtain the defect type corresponding to the abnormal image.
[0109] Preferably, in this embodiment, the gray module 300 is specifically configured to:
[0110] Select a weld center point corresponding to the weld shape from the front view image based on the detection coordinates;
[0111] Use the pixel points on the weld center point as an initial seed point set, and adopt the region growing method to segment and form a target sub-image from the front view image based on the gray difference value between the initial seed point set and the neighborhood pixel points.
[0112] In summary, the interior part defect detection system in the above embodiments of the present invention obtains the image data of the vehicle interior parts, and obtains the detection coordinates corresponding to the welding area of the interior parts by identifying the edge features of the interior parts, so as to select the target sub-image from the image data. By calculating the average gray value of the target sub-image, it is judged whether there is an abnormal welding appearance. Further, the SURF algorithm is used to extract the features of the abnormal image, and then the RANSAC algorithm is used to match the features with the template features of different defect types to identify the defect types. Compared with the global image feature extraction detection method, the detection efficiency can be effectively improved. Since the distances between the correctly matched points of the welds are basically the same, some defect feature points with Euclidean distances greater than the preset threshold are screened out, which can reduce the calculation amount and achieve the purpose of accurate matching. By using low-pass filtering to filter the target sub-image, the influence of image illumination can be reduced. By using the region growing method to segment and form the target sub-image, the pixel points on the weld center point are used as the initial seed point set, and the adaptive threshold of gray value change is set according to the set growth conditions, so that the weld image can be effectively extracted and the accuracy of subsequent defect type identification can be improved.
[0113] It should be noted that each of the above modules can be a functional module or a program module, and can be implemented either by software or by hardware. For the modules implemented by hardware, each of the above modules can be located in the same processor; or each of the above modules can also be located in different processors in any combination form.
[0114] Embodiment III
[0115] The third embodiment of the present application provides a computer, which may include a processor 81 and a memory 82 storing computer program instructions.
[0116] Specifically, the above-mentioned processor 81 may include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present application.
[0117] Among them, the memory 82 may include a mass storage for data or commands. By way of example and not limitation, the memory 82 may include a hard disk drive (HDD), a floppy disk drive, a solid state drive (SSD), a flash memory, an optical disk, a magneto-optical disk, a magnetic tape, or a universal serial bus (USB) drive, or a combination of two or more of these. Where appropriate, the memory 82 may include removable or non-removable (or fixed) media. Where appropriate, the memory 82 may be internal or external to the data processing device. In a particular embodiment, the memory 82 is a non-volatile memory. In a particular embodiment, the memory 82 includes a read-only memory (ROM) and a random access memory (RAM). Where appropriate, the ROM may be a mask-programmed ROM, a programmable ROM (PROM), an erasable PROM (EPROM), an electrically erasable PROM (EEPROM), an electrically alterable ROM (EAROM), or a flash memory (FLASH), or a combination of two or more of these. Where appropriate, the RAM may be a static random access memory (SRAM) or a dynamic random access memory (DRAM), where the DRAM may be a fast page mode dynamic random access memory (FPMDRAM), an extended date out dynamic random access memory (EDODRAM), a synchronous dynamic random access memory (SDRAM), etc.
[0118] The memory 82 can be used to store or cache various data files required for processing and / or communication, as well as possible computer program commands executed by the processor 81.
[0119] The processor 81 reads and executes the computer program commands stored in the memory 82 to implement any one of the interior part defect detection methods in the above embodiments.
[0120] In some of the embodiments, the computer may further include a communication interface 83 and a bus 80. Among them, as Figure 3 shown, the processor 81, the memory 82, and the communication interface 83 are connected through the bus 80 and complete communication with each other.
[0121] The communication interface 83 is used to implement communication between the modules, devices, units, and / or devices in the embodiments of the present application. The communication interface 83 can also implement data communication with other components such as external devices, image / data acquisition devices, databases, external storage, and image / data processing workstations.
[0122] Bus 80 includes hardware, software, or both, and couples components of a computer to each other. Bus 80 includes, but is not limited to, at least one of the following: Data Bus, Address Bus, Control Bus, Expansion Bus, Local Bus. By way of example and not limitation, Bus 80 may include an Accelerated Graphics Port (AGP) or other graphics bus, an Extended Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), a Hyper Transport (HT) interconnect, an Industry Standard Architecture (ISA) bus, an InfiniBand interconnect, a Low Pin Count (LPC) bus, a memory bus, a Micro Channel Architecture (MCA) bus, a Peripheral Component Interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a Serial Advanced Technology Attachment (SATA) bus, a Video Electronics Standards Association Local Bus (VLB) bus, or other suitable bus or a combination of two or more of these. In a suitable case, Bus 80 may include one or more buses. Although embodiments of the present application describe and illustrate specific buses, the present application contemplates any suitable bus or interconnect.
[0123] Embodiment Four
[0124] The fourth embodiment of the present application provides a readable storage medium. A computer program command is stored on the readable storage medium; when the computer program command is executed by a processor, any one of the interior part defect detection methods in the above embodiments is implemented.
[0125] The technical features of the above-described embodiments may be combined arbitrarily. For the sake of brevity of description, not all possible combinations of the technical features in the embodiments are described. However, as long as there is no contradiction in the combination of these technical features, it should be considered to be within the scope described in this specification.
[0126] The embodiments described above merely represent several implementation manners of the present application. The description is relatively specific and detailed, but it should not be construed as a limitation on the scope of the invention patent. It should be noted that for those of ordinary skill in the art, without departing from the concept of the present application, several modifications and improvements can still be made, and these all fall within the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the appended claims.
Claims
1. A method for detecting defects in interior decoration parts, characterized in that: The following steps are involved: Acquire image data of a vehicle interior trim, and perform perspective transformation processing on the image data to obtain a front view image; Extracting edge features of the front view image, acquiring center coordinates corresponding to the interior decoration part based on the edge features, and obtaining detection coordinates corresponding to the welding area based on the center coordinates and the edge features; Selecting a target sub-image from the front view image based on the detection coordinates, calculating an average grayscale value corresponding to each pixel in the target sub-image, and determining whether the average grayscale value exceeds a preset range; If the average gray value exceeds a preset range, it is determined that the interior trim has a welding defect; After the step of determining that the vehicle interior trim part has a welding defect, the method further includes: Obtain the grayscale value of the target sub-image corresponding to each welding area, select the corresponding target sub-image whose grayscale value exceeds the preset range, and mark it as an abnormal image; Extract features of the abnormal image based on the SURF algorithm to obtain defect feature points; Matching the defect feature point with the matching feature point in the template image, and selecting the optimal matching point based on the Euclidean distance between the matching feature point and the defect feature point, so as to obtain the defect type corresponding to the abnormal image; The step of selecting a target sub-image from the front view image based on the detection coordinates specifically includes: Selecting a weld center point corresponding to the weld shape from the front view image based on the detection coordinates; Using the pixel points at the center point of the weld as an initial seed point set, and using a region growing method to segment the front view image to form a target sub-image based on the grayscale difference between the initial seed point set and the neighboring pixel points; Among them, the growth condition expression corresponding to the grayscale difference value is: ; ; ; ; ; In the formula, is the weighted gray value of the pixel point in the area to be grown, is the mean gray value of the pixels in the grown area, is the adaptive threshold of grayscale change, is the preset range, n is the number of pixels in the grown area, is the gray value variance of the pixels in the grown area, is the first gray value of the weld center point, are the coordinates of the weld center point, is the second grayscale value of the neighborhood pixel, is the coordinate of the neighborhood pixel, j is the number of pixels in the field, is the third grayscale value of the surrounding pixels of the neighborhood pixel, is the coordinates of the pixels around the neighborhood pixel, k is the number of pixels around the neighborhood pixel, , , are the weight coefficients of the first grayscale value, the second grayscale value and the third grayscale value respectively.
2. The interior decoration defect detection method according to claim 1, characterized in that: The step of selecting the optimal matching point based on the Euclidean distance between the matching feature point and the defect feature point to obtain the defect type corresponding to the abnormal image specifically includes: The Euclidean distance between each matching feature point and the defect feature point is calculated, sorted based on the size of each Euclidean distance, and some defect feature points whose Euclidean distance is greater than a preset threshold are screened out to obtain a target feature point set; The RANSAC algorithm is used to perform internal point determination based on the target feature point set to match the corresponding template image, thereby obtaining the defect type corresponding to the abnormal image.
3. The interior decoration defect detection method according to claim 2, characterized in that: The expression of the Euclidean distance corresponding to the target feature point set is as follows: ; Where d is the Euclidean distance corresponding to the target point set, and are respectively the maximum and minimum values of the Euclidean distances between each of the matching feature points and the defect feature points, and k is a proportional coefficient.
4. The interior decoration defect detection method according to claim 1, characterized in that: Before the step of calculating the average grayscale value corresponding to each pixel in the target sub-image, the method further includes: The target sub-image is filtered by low-pass filtering to obtain the average value of the grayscale value, so as to obtain the grayscale value of the target sub-image after processing based on the following calculation formula: ; In the formula, is the gray value of the target sub-image after processing, is the gray value of the target sub-image before processing, represents the rounding function, v is the grayscale median, is the grayscale mean, and F is the crossover frequency.
5. An interior decoration defect detection system, characterized in that: include: An image module, used to obtain image data of vehicle interior parts, and perform perspective transformation processing on the image data to obtain a front view image; An edge feature module, used to extract edge features of the front view image, obtain the center coordinates corresponding to the interior decoration part based on the edge features, and obtain the detection coordinates corresponding to the welding area based on the center coordinates and the edge features; A grayscale module, used to select a target sub-image from the front view image based on the detection coordinates, calculate an average grayscale value corresponding to each pixel in the target sub-image, and determine whether the average grayscale value exceeds a preset range; A determination module, configured to determine that a welding defect exists in the interior decoration component if the average gray value exceeds a preset range; The system further comprises: The defect type module is used to obtain the grayscale value of the target sub-image corresponding to each welding area, select the corresponding target sub-image whose grayscale value exceeds the preset range, and mark it as an abnormal image; Extract features of the abnormal image based on the SURF algorithm to obtain defect feature points; Matching the defect feature point with the matching feature point in the template image, and selecting the optimal matching point based on the Euclidean distance between the matching feature point and the defect feature point, so as to obtain the defect type corresponding to the abnormal image; The grayscale module is specifically used for: Selecting a weld center point corresponding to the weld shape from the front view image based on the detection coordinates; Using the pixel points at the center point of the weld as an initial seed point set, and using a region growing method to segment the front view image to form a target sub-image based on the grayscale difference between the initial seed point set and the neighboring pixel points; Among them, the growth condition expression corresponding to the grayscale difference value is: ; ; ; ; ; In the formula, is the weighted gray value of the pixel point in the area to be grown, is the mean gray value of the pixels in the grown area, is the adaptive threshold of grayscale change, is the preset range, n is the number of pixels in the grown area, is the gray value variance of the pixels in the grown area, is the first gray value of the weld center point, are the coordinates of the weld center point, is the second grayscale value of the neighborhood pixel, is the coordinate of the neighborhood pixel, j is the number of pixels in the field, is the third grayscale value of the surrounding pixels of the neighborhood pixel, is the coordinates of the pixels around the neighborhood pixel, k is the number of pixels around the neighborhood pixel, , , are the weight coefficients of the first grayscale value, the second grayscale value and the third grayscale value respectively.
6. A computer comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the interior decoration part defect detection method as described in any one of claims 1 to 4 is implemented.
7. A storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method for detecting defects in interior decoration parts as described in any one of claims 1 to 4 is implemented.
Citation Information
Patent Citations
Welding quality detection method
CN115719332A