Corrugated pipe surface defect detection method and device based on Haar features and storage medium
By detection method based on the surface defect detection method based on the HAAR characteristics, the HAAR features are extracted and the distance between the Oushi is calculated, which solves the problem of low accuracy and efficiency caused by the low accuracy caused by artificially caused by the surface defect detection of ripples. Efficient automation testing.
Patent Information
- Application Number
- CN202411402053.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-09
- Publication Date
- 2025-01-24
AI Technical Summary
In the prior art, the detection of surface defects of bellows relies on manual observation, which is difficult, low in accuracy and low efficiency, and is affected by workers' experience and subjective factors.
The corrugated pipe surface defect detection method based on Haar features is used to complete the defect detection by obtaining the corrugated pipe surface image, extracting Haar features, calculating the Euclidean distance, and comparing it with the preset threshold.
It improves the accuracy and efficiency of corrugated pipe surface defect detection, reduces dependence on worker experience and subjective factors, and realizes automated detection.
Smart Images

Figure CN119359662A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image processing technology, and specifically to a method, device and storage medium for detecting surface defects of a corrugated pipe based on Haar features. Background Art
[0002] During the production and processing of bellows, if the mold is damaged or improperly processed, various defects will form on the surface of the bellows, which will have a negative impact on the appearance and performance of the bellows. Therefore, it is very important to detect the surface defects of the bellows and discover and control them in time. Nowadays, defects on the surface of bellows are mainly detected by manual observation. Due to the dense distribution of bellows expansion joints, manual detection is difficult and is affected by workers' experience and subjective factors. The detection accuracy is not high and the efficiency is low. Summary of the invention
[0003] The purpose of this application is to provide a method, device and storage medium for detecting surface defects of a corrugated pipe based on Haar features, so as to solve the technical problems raised in the above-mentioned background technology.
[0004] To achieve the above objectives, this application discloses the following technical solutions:
[0005] In a first aspect, the present application provides a method for detecting surface defects of a corrugated pipe based on Haar features, the method comprising the following steps:
[0006] Obtain the surface image of the corrugated pipe to be tested that has been processed on the production line;
[0007] The acquired surface image of the bellows to be tested is processed to obtain a plurality of images of areas where defects may exist, and each image of an area where defects may exist is defined as an image to be tested; wherein the area where defects may exist is the expansion joint of the bellows to be tested;
[0008] The Haar features of each image to be tested are extracted respectively, and the Euclidean distance to the origin of the vector space is calculated based on the extracted Haar features. The calculated Euclidean distance is compared with a preset Euclidean distance threshold, and the defect detection of the surface of the corrugated pipe to be tested is completed based on the comparison result.
[0009] Preferably, the Euclidean distance threshold is calculated by normalizing the Haar features of the surface of the corrugated pipe without defects, wherein the normalized Haar features are obtained by normalizing the Haar features corresponding to the surface of the corrugated pipe without defects.
[0010] Preferably, the defect detection on the surface of the tested bellows based on the comparison result specifically includes:
[0011] Define the extracted Haar feature to calculate the Euclidean distance to the origin of the vector space as E Distance count , define the Euclidean distance threshold as E·Distance threshold ;
[0012] When the Euclidean distance corresponding to any image to be tested satisfies E·Distance count >E·Distance threshold , it indicates that there are defects on the surface of the tested bellows; otherwise, it indicates that there are no defects on the surface of the tested bellows.
[0013] Preferably, the processing of the image to be detected to obtain a plurality of images of areas where defects may exist specifically includes:
[0014] Filtering the acquired surface image of the bellows to be tested to obtain a filtered surface image;
[0015] Performing threshold segmentation on the filtered surface image to obtain a surface image containing an expansion joint;
[0016] Calculating the centroid of each connected area in the surface image containing the expansion joint, and mapping each centroid to a corresponding position in the filtered surface image;
[0017] In the mapping result, two centroids of the edge are removed, several centroids other than the removed two centroids are moved according to preset compensation parameters, and the filtered surface image is segmented by the several moved centroids to obtain N images to be tested.
[0018] Preferably, filtering the acquired surface image of the tested bellows specifically includes:
[0019] The surface image of the tested bellows is filtered based on a Gabor filter to blur the image with a small response to the Gabor filter.
[0020] Preferably, the threshold segmentation of the filtered surface image to obtain the surface image containing the expansion joint specifically includes:
[0021] The portion of the filtered surface image whose grayscale value is less than a preset grayscale threshold is segmented and removed, and binarized to obtain the expansion joint-containing surface image.
[0022] Preferably, the method of moving a plurality of centroids other than the two removed centroids according to preset compensation parameters, and segmenting the filtered surface image with the moved plurality of centroids to obtain N images to be tested specifically includes:
[0023] A plurality of centroids other than the two removed centroids are moved according to a preset displacement compensation amount to obtain an image to be segmented;
[0024] The filtered surface image is segmented with each centroid in the image to be segmented as the center to obtain a test image.
[0025] Preferably, the displacement compensation amount is determined by lighting conditions and parameters of the bellows to be tested.
[0026] In a second aspect, the present application provides a bellows surface defect detection device based on Haar features, comprising:
[0027] An acquisition module is configured to: acquire a target image including a corrugated pipe to be detected, wherein the surface of the corrugated pipe to be detected has a plurality of objects to be detected;
[0028] The image detection module is configured to: process the surface image containing the bellows to be detected to obtain a plurality of images to be detected, wherein each image to be detected contains a single expansion joint of the bellows to be detected;
[0029] The defect detection module is configured to: calculate the Haar features corresponding to each of the images to be tested, calculate the Euclidean distance to the vector space based on the Haar features of each image to be tested, and compare the calculated Euclidean distance with a preset Euclidean distance threshold, and complete the defect detection on the surface of the corrugated tube to be tested based on the comparison results.
[0030] In a third aspect, the present application provides a computer-readable storage medium having stored thereon a computer program executable by a processor, and when the computer program is executed by the processor, the Haar feature-based method for detecting surface defects of a corrugated pipe as described above is implemented.
[0031] Beneficial effect: The Haar feature-based bellows surface defect detection method, device and storage medium of the present application process the acquired image to extract the surface image of the bellows to be detected from the entire image, thereby preventing the environmental image from affecting the detection result, and then divide the acquired image into several images to be tested according to a single expansion joint, and finally extract the Haar feature of a single image to be tested, calculate its Euclidean distance to the origin of the vector space, and compare it with a preset Euclidean distance threshold, and finally determine whether there are defects on the detected surface of the bellows, with high detection accuracy and detection efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without paying any creative work.
[0033] Figure 1 A schematic diagram of a process flow of a method for detecting surface defects of a corrugated pipe based on Haar features provided in an embodiment of the present application;
[0034] Figure 2 Schematic diagram of each process corresponding to the positioning of a single expansion joint provided in an embodiment of the present application. DETAILED DESCRIPTION
[0035] The technical solutions in the embodiments of the present application are described clearly and completely below. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present application.
[0036] In this article, the term "comprising" is intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of more restrictions, the elements defined by the sentence "comprising..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0037] This embodiment provides an image of a corrugated pipe on a production line to achieve real-time detection of surface defects, solve the problems existing in manual detection, and improve detection accuracy and efficiency.
[0038] Specifically, this embodiment provides a Figure 1 The Haar feature-based method for detecting surface defects of a corrugated pipe shown in the figure comprises the following steps:
[0039] Obtain the surface image of the corrugated pipe to be tested that has been processed on the production line;
[0040] The acquired surface image of the bellows to be tested is processed to obtain a plurality of images of areas where defects may exist, and each image of an area where defects may exist is defined as an image to be tested; wherein the area where defects may exist is the expansion joint of the bellows to be tested;
[0041] The Haar features of each image to be tested are extracted respectively, and the Euclidean distance to the origin of the vector space is calculated based on the extracted Haar features. The calculated Euclidean distance is compared with a preset Euclidean distance threshold, and the defect detection of the surface of the corrugated pipe to be tested is completed based on the comparison result.
[0042] Based on the above, the Haar feature-based bellows surface defect detection method of this embodiment processes the image to be tested. First, the surface image of the bellows to be tested is extracted from the entire image to prevent the environmental image from affecting the detection result. Secondly, the obtained image is divided into multiple images according to a single expansion joint. Finally, the Haar feature of a single image to be tested is extracted, and its Euclidean distance to the origin of the vector space is calculated. It is compared with a preset Euclidean distance threshold to determine whether there are defects on the detected surface of the bellows.
[0043] Secondly, based on the Haar features of the bellows surface image, this method judges whether there are defects on the product surface according to the image. This method does not require knowing the cause of the defects and the type, shape, size and other advance information of the defects. It can directly detect defects on the surface of the bellows. Compared with manual inspection, this method is faster and more efficient.
[0044] In this embodiment, the Euclidean distance threshold is calculated by the standardized Haar feature of the surface of the corrugated pipe without defects, wherein the standardized Haar feature is obtained by standardizing the Haar feature corresponding to the surface of the corrugated pipe without defects. In this regard, the defect detection of the surface of the corrugated pipe to be tested based on the comparison result specifically includes:
[0045] Define the extracted Haar feature to calculate the Euclidean distance to the origin of the vector space as E Distance count , define the Euclidean distance threshold as E·Distance threshold ;
[0046] When the Euclidean distance corresponding to any image to be tested satisfies E·Distance count >E·Distance threshold , it indicates that there are defects on the surface of the tested bellows; otherwise, it indicates that there are no defects on the surface of the tested bellows.
[0047] In this embodiment, the image to be detected is processed to obtain a number of images of areas where defects may exist, specifically including:
[0048] Filtering the acquired surface image of the bellows to be tested to obtain a filtered surface image;
[0049] Performing threshold segmentation on the filtered surface image to obtain a surface image containing an expansion joint;
[0050] Calculating the centroid of each connected area in the surface image containing the expansion joint, and mapping each centroid to a corresponding position in the filtered surface image;
[0051] In the mapping result, two centroids of the edge are removed, several centroids other than the removed two centroids are moved according to preset compensation parameters, and the filtered surface image is segmented by the several moved centroids to obtain N images to be tested.
[0052] By this means, through filtering, images that are greatly different from the surface of the bellows in the image to be detected, such as environmental images, can be filtered out; through threshold segmentation, the image of the smooth part of the bellows surface can be filtered out, and the image of the bellows expansion joint can be extracted; by removing the two centroids at the edge of the image and moving the remaining centroids according to preset compensation parameters, the influence of incomplete segmentation and light source can be eliminated, and finally the detected target image can be obtained.
[0053] In this embodiment, filtering the acquired surface image of the tested bellows specifically includes:
[0054] The surface image of the tested bellows is filtered based on a Gabor filter to blur the image with a small response to the Gabor filter.
[0055] That is, this method designs a single filter based on the Gabor kernel to filter out the background and smooth parts according to the size of a single telescopic section. The parameter setting is based on the following assumption: the camera and the platform on which the bellows are placed are parallel to each other at the same distance. This ensures that the parameters are fixed. The Gabor filter is defined as:
[0056]
[0057] Among them, θ represents the rotation angle of the function, σ represents the Gaussian variance coefficient of x and y, and u0 represents the cosine modulation frequency. The filter has the largest response at u0 in the frequency domain, which is also the basis for parameter setting. The center frequency u0 is related to the frequency domain and spatial domain characteristics of the expansion joint. A single expansion joint of the bellows can be regarded as a texture element to a certain extent, which is distinguished from the non-expansion joint area of the bellows. The height of the texture element is called h and the width is called w. Setting u0 to 1 / w can highlight the texture with a period of w, that is, the target object bellows expansion joint. In addition, the details representing high frequencies in the texture will be removed, thereby reducing interference and improving accuracy. According to the six sigma principle of the filter, the σ value determines the size of the filter in the spatial domain. The size of the Gabor filter is set to 6σ×6σ. b is the bandwidth of the filter, which is a commonly used parameter for bandpass filters. Increasing the bandwidth b will expand the frequency domain response range of the filter and reduce the frequency response of the filter, which relatively highlights the smooth connection part of the bellows. At the same time, the volume of the filter is reduced, thereby reducing the computational cost and speeding up the computational efficiency.
[0058] Furthermore, the threshold segmentation of the filtered surface image to obtain the surface image containing the expansion joint specifically includes:
[0059] The portion of the filtered surface image whose grayscale value is less than a preset grayscale threshold is segmented and removed, and binarized to obtain the expansion joint-containing surface image.
[0060] Based on the design of Gabor filter, in this embodiment, the positioning of a single expansion joint is obtained by the following method:
[0061] S1: Assuming that each expansion joint has a similar response to the designed Gabor filter, the expansion joint can be separated from the smooth part and the background and accurately located by the response image of the Gabor filter.
[0062] S2: First, use Gabor filter to filter Figure 2 The detection image f(x,y) in a is filtered. The response image g(x,y) is obtained, as Figure 2 As shown in b in . Compared with the expansion joint part, the background and smooth part are blurred, and their response intensity is also lower (that is, the background and smooth part are filtered out by the response intensity), and some details of the expansion joint are filtered out, which is conducive to locating the detected target. Then, the threshold segmentation method is used to display the area with strong filter response in the binary image B(x,y). Calculation is as follows Figure 2 The centroid of the connected area in the binary image B(x,y) shown in c is used to determine the location of the expansion joint, as shown in Figure 2 The set of connected regions in B(x,y) is: C i(i=1,2,3,...n, where n is the number of non-zero single connected regions), the corresponding centroid coordinates are:
[0063]
[0064] S3: Figure 2 As shown in (d), since the width of the transition expansion node between the expansion node and the smooth part is half of w, the response to the designed Gabor filter is low and its centroid is filtered out.
[0065] S4: In the smooth part of the background part, some areas containing the set Gabor filter main frequency will become interference areas. In order to eliminate these interference areas, each connected area Ci in the binary image B(x,y) is identified by the following two morphological conditions.
[0066] S5: Area is one of the scalar quantities that describe morphological geometric properties. The area A(C) of a connected region C in a binary image can be defined as:
[0067] AC)=∑ x ∑ y Ix,yΔA
[0068] Where (x, y)∈C, ΔA is the size of a pixel. This feature is a description of the response of the Gabor filter. The maximum value Amax and the minimum value Amin are both selected from defect-free samples. In the actual detection process, the slight deformation of the bellows and some other unknown factors will cause A(C) to exceed the upper limit Amax and the lower limit Amin. Therefore, the compensation coefficients k1 and k2 can be set to eliminate the errors caused by these factors and other unknown factors. Therefore, the normal area range is k1×Amin~k2×Amax.
[0069] S6: The connected region C has the same standard second-order central moment as the ellipse, and the eccentricity E(C) of the ellipse is a robust descriptor of the shape of the region. The relationship between the second-order central moment of the ellipse and its major and minor axes is as follows:
[0070]
[0071] where uxx, uyy, and uxy are the standard second-order central moments connecting the region and the ellipse, and
[0072] MaxL and MinL are the lengths of the major and minor axes of the ellipse, which are equal to λ1 and λ2 respectively.
[0073] Then, according to the ellipse eccentricity calculation formula, the value E(C) of the connection area C can be obtained:
[0074]
[0075] Among them, E(C) is a feature that describes the shape of the connected area. The range of eccentricity E(C) is (0, 1). The closer E(C) is to 1, the flatter the shape is; the closer E(C) is to 0, the rounder the shape is. Since uxx+uyy and (uxx-uyy)2-4uxy2 are two Hu moment invariants, this description is invariant to rotation and scaling. Similar to the area range, the normal range of this value is k3×Emin~k4×Emax.
[0076] In this embodiment, the threshold segmentation of the filtered surface image to obtain the surface image containing the expansion joint specifically includes:
[0077] The portion of the filtered surface image whose grayscale value is less than a preset grayscale threshold is segmented and removed, and binarized to obtain the surface image containing the expansion joint.
[0078] Secondly, the method of moving a plurality of centroids other than the two removed centroids according to preset compensation parameters, and segmenting the filtered surface image with the moved plurality of centroids to obtain N images to be tested specifically includes:
[0079] A plurality of centroids other than the two removed centroids are moved according to a preset displacement compensation amount to obtain an image to be segmented;
[0080] The filtered surface image is segmented with each centroid in the image to be segmented as the center to obtain a test image.
[0081] It is feasible that the displacement compensation amount is determined by the lighting conditions and the parameters of the bellows to be tested. Since the lighting may not be parallel to the surface of the bellows, the center of mass of the reflective area is offset compared to the center of mass of the actual bellows expansion joint. The compensation amount is set to make the two coincide.
[0082] In the above scheme, the surface image of the bellows is segmented with the centroid as the center, and each segmented image contains an expansion joint and two smooth parts, where the expansion joint is located in the center of the image. The centroid compensation and strict segmentation conditions ensure the consistency of the segmented image and improve the robustness of the detection.
[0083] Specifically, the segmentation of a single expansion joint used in this embodiment is achieved by the following method:
[0084] D1: After locating the target, each expansion joint in the detection image is segmented according to the centroid. To obtain an ideal segmented image, the following two conditions must be met. First, the two centroids close to the edge of the detection image are removed, and an additional parameter (Δx, Δy) is set to move the centroid. The edge centroid points are removed to avoid incomplete segmentation. The reason for removing these points is that the light source may not be completely parallel to the bellows, ensuring that these points are located in the middle of its expansion joint. The points after compensation are:
[0085] Sicontroid(xi,yi)=Cicotroid(xi,yi)+(Δx,Δy)
[0086] D2: Another requirement is that the peak of the expansion joint is located in the middle of the segmented image, with two troughs on each side of the peak, which can improve the consistency of the segmented image. The reflective surface of the peak part is wider and longer than the reflective surface of the trough part, and has a stronger adaptability to light changes. In addition, placing the peak on both sides of the segmented image can double the number of detections of the same peak to compensate for the slight deformation of the bellows. The width and length of the segmented image are SegW and SegH respectively. After the segmentation is completed, N images to be tested are obtained.
[0087] Based on the above, it can be seen that the Haar feature describes the grayscale change of the image pixels. If a defect occurs on the surface of the bellows expansion joint, the color of the defect will be darker than the surface of the bellows expansion joint, and its eigenvalue will change accordingly. The advantage of the Haar feature is the calculation speed, which can increase the speed of feature extraction and realize real-time detection. Specifically, the defect detection based on the Haar feature in this embodiment is achieved by the following methods:
[0088] Take the segmented N images to be tested as input;
[0089] T1: First, calculate its response to the Haar wavelet, the filter size of the Haar wavelet is 8×8. Divide the wavelet responses dx and dy into a grid of n×n pixel units, where dx represents the horizontal response and dy represents the vertical response. Calculate the sum of dx and dy in the divided grid, where n = [SegW / 4]. The symbol [] indicates a rounding operation. The n value is set to divide the segmented image into four parts in the horizontal direction.
[0090] T2: In order to incorporate the polarity information of the intensity changes for analysis, the absolute value sum of the responses |dx| and |dy| are extracted. Each sub-region has a four-dimensional sub-vector V that describes its underlying intensity structure. ij =(∑d x ,∑d y ,Σ|d x |,Σ|d y|), i, j represent the grid of the i-th row and j-th column. In addition, each segmented image has a 4×m 4D descriptor, where m = 4h / SegW. Each 4D descriptor represents the corresponding surface condition in the grid. The wavelet response is not affected by the illumination offset.
[0091] T3: Vector V ij The distribution of each element in the vector is often very different, which leads to some elements playing a decisive role in the judgment. Therefore, each element in the vector is standardized so that the distribution of each element follows the same standard normal distribution. The four-dimensional descriptor of all grids is represented by a descriptor vector F = [V 11 ,V 12 ,…,V 4m ]. In order to normalize the vector F, a certain number of defect-free surface samples are required to calculate the normal distribution of the vector F. The vector F is obtained from k groups of positive sample images. k :
[0092]
[0093] Mean vector μ=[μ1,μ2,…μ i ,…μ d ] and the variance vector δ=[δ1,δ2,…δ i ,…δ d ] can be calculated by the following formula:
[0094]
[0095] T4: Obtaining the discriminant vector F k After that, F k Refactored to NV ij is the standardized V ij Vector represents the surface condition of a defect-free sample. We calculate the Euclidean distance between the vector and the origin of the vector space and set the maximum value as the judgment limit. In addition, the judgment threshold is expressed as:
[0096]
[0097] Where Tij is the threshold of the grid at row i and column j, and p is the compensation coefficient used to eliminate the effect of insufficient sample collection. The setting range of this value is 1.15 to 1.25.
[0098] T5: The final defect discriminant is:
[0099]
[0100] Among them, (||NV ij ||2 <T ij) is a logical operation. When the condition is met, its value is equal to 1, and when the condition is not met, its value is equal to 0. If and only if all values are equal to 1, the label is equal to 1, indicating that there is no defect on the surface of the segmented image. In addition, if the label is equal to 0, the location of the defect can be roughly determined according to i and j.
[0101] Based on the same inventive concept, the present embodiment discloses in a second aspect a Haar feature-based bellows surface defect detection device applicable to the aforementioned Haar feature-based bellows surface defect detection method, the device comprising:
[0102] An acquisition module is configured to: acquire a surface image containing a bellows to be inspected, wherein the surface of the bellows to be inspected has a plurality of expansion joints;
[0103] The image detection module is configured to: process the surface image containing the bellows to be detected to obtain a plurality of images to be detected, wherein each image to be detected contains a single expansion joint of the bellows to be detected;
[0104] The defect detection module is configured to: calculate the Haar features corresponding to each of the images to be tested, calculate the Euclidean distance to the vector space based on the Haar features of each image to be tested, and compare the calculated Euclidean distance with a preset Euclidean distance threshold, and complete the defect detection on the surface of the corrugated tube to be tested based on the comparison results.
[0105] It should be noted that the Haar feature-based corrugated pipe surface defect detection device of this embodiment corresponds to the aforementioned Haar feature-based corrugated pipe surface defect detection method. Therefore, the undisclosed parts of the Haar feature-based corrugated pipe surface defect detection device (including but not limited to specific functional content and technical effects) can refer to the relevant records in the aforementioned Haar feature-based corrugated pipe surface defect detection method, and this text will not go into details here.
[0106] In addition, the present embodiment discloses in a third aspect a computer-readable storage medium storing a computer program executable by a processor. When the computer program is executed by the processor, the Haar feature-based method for detecting surface defects of a corrugated pipe as described above is implemented.
[0107] Similarly, the computer-readable storage medium of this embodiment corresponds to the aforementioned Haar feature-based bellows surface defect detection method. Therefore, the parts not disclosed in the computer-readable storage medium (including but not limited to specific functional content and technical effects) can refer to the relevant records in the aforementioned Haar feature-based bellows surface defect detection method, and this text will not go into details here.
[0108] In the embodiments provided in the present application, it should be understood that the embodiments described herein can be implemented in hardware, software, firmware, middleware, code or any appropriate combination thereof. For hardware implementation, the processor can be implemented in one or more of the following units: application specific integrated circuit (ASIC), digital signal processor (DSP), digital signal processing device (DSPD), programmable logic device (PLD), field programmable gate array (FPGA), processor, controller, microcontroller, microprocessor, other electronic units designed to implement the functions described herein or their combination. For software implementation, part or all of the flow of the embodiment can be completed by instructing the relevant hardware through a computer program. When implemented, the above program can be stored in a computer-readable storage medium or transmitted as one or more instructions or codes on a computer-readable storage medium. Computer-readable storage media include computer storage media and communication media, wherein the communication medium includes any medium that is convenient for transmitting a computer program from one place to another. The storage medium can be any available medium that a computer can access. The computer-readable storage medium can include but is not limited to RAM, ROM, EEPROM, CD-ROM or other optical disk storage, disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store the desired program code in the form of an instruction or data structure and can be accessed by a computer.
[0109] Finally, it should be noted that the above is only a preferred embodiment of the present application and is not intended to limit the present application. Although the present application has been described in detail with reference to the aforementioned embodiments, it is still possible for those skilled in the art to modify the technical solutions described in the aforementioned embodiments or to make equivalent substitutions for some of the technical features therein. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application.
Claims
1. A method for detecting surface defects of a corrugated pipe based on Haar features, characterized in that: The method comprises the following steps: Obtain the surface image of the corrugated pipe to be tested that has been processed on the production line; The acquired surface image of the bellows to be tested is processed to obtain a plurality of images of areas where defects may exist, and each image of an area where defects may exist is defined as an image to be tested; wherein the area where defects may exist is the expansion joint of the bellows to be tested; The Haar features of each image to be tested are extracted respectively, and the Euclidean distance to the origin of the vector space is calculated based on the extracted Haar features. The calculated Euclidean distance is compared with a preset Euclidean distance threshold, and the defect detection of the surface of the corrugated pipe to be tested is completed based on the comparison result.
2. The method for detecting surface defects of a corrugated pipe based on Haar features according to claim 1, characterized in that: The Euclidean distance threshold is calculated by normalizing the Haar feature of the surface of the corrugated pipe without defects, wherein the normalized Haar feature is obtained by normalizing the Haar feature corresponding to the surface of the corrugated pipe without defects.
3. The method for detecting surface defects of a corrugated pipe based on Haar features according to claim 2 is characterized in that: The defect detection on the surface of the tested bellows based on the comparison result specifically includes: Define the extracted Haar feature to calculate the Euclidean distance to the origin of the vector space as E Distance count , define the Euclidean distance threshold as E·Distance threshold ; When the Euclidean distance corresponding to any image to be tested satisfies E·Distance count >E·Distance threshold , it indicates that there are defects on the surface of the tested bellows; otherwise, it indicates that there are no defects on the surface of the tested bellows.
4. The method for detecting surface defects of a corrugated pipe based on Haar features according to claim 1, characterized in that: The processing of the image to be inspected to obtain a number of images of areas where defects may exist specifically includes: Filtering the acquired surface image of the bellows to be tested to obtain a filtered surface image; Performing threshold segmentation on the filtered surface image to obtain a surface image containing an expansion joint; Calculating the centroid of each connected area in the surface image containing the expansion joint, and mapping each centroid to a corresponding position in the filtered surface image; In the mapping result, two centroids of the edge are removed, several centroids other than the removed two centroids are moved according to preset compensation parameters, and the filtered surface image is segmented by the several moved centroids to obtain N images to be tested.
5. The method for detecting surface defects of a corrugated pipe based on Haar features according to claim 4 is characterized in that: The filtering of the acquired surface image of the bellows to be tested specifically includes: The surface image of the tested bellows is filtered based on a Gabor filter to blur the image with a small response to the Gabor filter.
6. The method for detecting surface defects of a corrugated pipe based on Haar features according to claim 4, characterized in that: The step of performing threshold segmentation on the filtered surface image to obtain the surface image containing the expansion joint specifically includes: The portion of the filtered surface image whose grayscale value is less than a preset grayscale threshold is segmented and removed, and binarized to obtain the surface image containing the expansion joint.
7. The method for detecting surface defects of a corrugated pipe based on Haar features according to claim 6, characterized in that: The method of moving a plurality of centroids other than the two removed centroids according to preset compensation parameters, and segmenting the filtered surface image with the moved plurality of centroids to obtain N images to be tested specifically includes: A plurality of centroids other than the two removed centroids are moved according to a preset displacement compensation amount to obtain an image to be segmented; The filtered surface image is segmented with each centroid in the image to be segmented as the center to obtain a test image.
8. The method for detecting surface defects of a corrugated pipe based on Haar features according to claim 7, characterized in that: The displacement compensation amount is determined by the lighting conditions and the parameters of the bellows to be tested.
9. A bellows surface defect detection device based on Haar features, characterized in that: include: An acquisition module is configured to: acquire a surface image containing a bellows to be inspected, wherein the surface of the bellows to be inspected has a plurality of expansion joints; The image detection module is configured to: process the surface image containing the bellows to be detected to obtain a plurality of images to be detected, wherein each image to be detected contains a single expansion joint of the bellows to be detected; The defect detection module is configured to: calculate the Haar features corresponding to each of the images to be tested, calculate the Euclidean distance to the vector space based on the Haar features of each image to be tested, and compare the calculated Euclidean distance with a preset Euclidean distance threshold, and complete the defect detection on the surface of the corrugated tube to be tested based on the comparison results.
10. A computer-readable storage medium, characterized in that: A computer program that can be executed by a processor is stored thereon. When the computer program is executed by the processor, the corrugated pipe surface defect detection method based on Haar features as described in any one of claims 1 to 8 is implemented.
Citation Information
Patent Citations
Monocrystalline silicon photovoltaic cell crack defect detection method
CN112991264A
Cited By
Intelligent monitoring method and system for PE pipe production
CN120339272A
Intelligent monitoring method and system for PE pipe production
CN120339272B