A method and device for detecting the flatness of engineering plastics
Through multi-angle image acquisition and image processing technology, combined with parallel stripe projection analysis, the problems of unstable plane detection accuracy of engineering plastics and sensitive to the reflection characteristics of different materials in the prior art are solved, and high efficiency and accuracy of large-scale detection are achieved.
Patent Information
- Application Number
- CN202411268465.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-11
- Publication Date
- 2025-04-11
- Estimated Expiration
- 2044-09-11
AI Technical Summary
The existing engineering plastic planarity detection methods have problems such as unstable detection accuracy and sensitivity to the differences in surface reflection characteristics of different materials, and are difficult to be suitable for large-scale inspection.
High-resolution industrial cameras are used to capture engineering plastic surface images from multiple angles, and through grayscale processing, noise removal and image enhancement, edge detection algorithms and morphological operations are used to identify problem areas that deviate from flatness. Then, a fine parallel stripe pattern is projected to the surface, the distortion, offset or interruption of the stripes is analyzed, and the distance variation between the stripes is calculated to quantify the planetary deviation.
It realizes rapid and accurate detection of the flatness of engineering plastics, is suitable for large-scale inspection, and can flexibly deal with the differences in reflective characteristics of different surfaces of different materials, meeting the high efficiency needs in actual production.
Smart Images

Figure CN119022837B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of plane detection, and more specifically, to a method and device for detecting the flatness of engineering plastics. Background Art
[0002] Flatness testing of engineering plastics usually refers to measuring the degree of deviation of a planar workpiece surface from an ideal plane. This type of testing is crucial to ensuring the accuracy and functionality of mechanical parts.
[0003] The flatness detection methods of engineering plastics are divided into contact type and non-contact type. The contact type is to obtain flatness information by continuously and accurately measuring the size of the object in the three directions of X, Y, and Z through the stylus at the detection end. The detection accuracy will be affected by the measurement accuracy of the stylus. The higher the measurement accuracy of the stylus, the more measurement points are required, and the amount of engineering work required for comprehensive mobile measurement is greater. The stylus is easy to wear after long-term use, and it will cause damage to the surface of the engineering plastic, and the measured flatness accuracy is unstable.
[0004] The non-contact method uses laser to perform non-contact scanning on the surface of a flat workpiece, collects a large amount of point cloud data, and then uses software to analyze this data to determine the flatness. However, due to the different reflection characteristics of different material surfaces, the point cloud data will show uneven reflection of the laser by some engineering materials. The laser will be concentratedly reflected in one direction instead of being scattered. If the sensor is not on this reflection path, it may not receive enough reflected signals, resulting in the missing of this part in the point cloud data, resulting in missing or abnormal points in the point cloud data.
[0005] The above engineering plastic flatness detection scheme is not suitable for large-scale engineering plastic flatness detection, and cannot meet the actual measurement needs of engineering plastic flatness. Summary of the invention
[0006] The invention provides a method and device for detecting the flatness of engineering plastics, and solves the technical problems in related technologies.
[0007] The present invention provides a method for detecting the flatness of engineering plastics, comprising the following steps:
[0008] S100: Use a high-resolution industrial camera to capture the surface images of the engineering plastics to be inspected from multiple angles, convert the collected surface images into grayscale and remove noise from the images, and then output the pre-processed images through image enhancement;
[0009] S200: applying an edge detection algorithm to extract edge information from the preprocessed image, using morphological operations to remove small noise points in the image, analyzing edge features to identify problem areas that deviate from normal flatness, marking the problem areas and excluding the problem areas from the image, and inputting the image after excluding the problem areas into S300;
[0010] S300: Projecting a set of fine parallel stripe patterns onto the surface of the engineering plastic to be inspected, using an industrial camera again to capture the surface image of the engineering plastic to be inspected on the projected parallel stripe patterns, excluding the problem area on the surface image of the engineering plastic to be inspected, processing the surface image of the engineering plastic to be inspected, analyzing and identifying the areas where the moiré fringes in the image are distorted, offset or interrupted, and quantifying the maximum deviation value of the area where the distortion, offset or interruption occurs by calculating the distance change between the moiré fringes;
[0011] S400: quantifying the deformation variable of each initially screened region according to the results of moiré fringe analysis and recognition, comparing the quantified deformation variable with a preset threshold, and outputting a final classification result according to the comparison result;
[0012] The classification results include pass / fail identification, maximum deviation value from flatness and location of problem areas.
[0013] Furthermore, the edge detection algorithm uses Canny edge detection, including the following:
[0014] First, the image is Gaussian filtered to remove noise;
[0015] Calculate the gradient strength and direction of the image, the expression is as follows:
[0016]
[0017] Among them, I x and I y is the first-order derivative along the x and y directions, G(x,y) is the gradient strength of the pixel (x,y) in the image, and θ(x,y) is the gradient direction of the pixel (x,y) in the image;
[0018] The gradient intensity is non-maximum suppressed and the local maximum is retained. The expression is as follows:
[0019] if A>B>C>D>E
[0020] A=G(x,y)
[0021] B=G(x+1,y)andG(x,y)
[0022] C=G(x-1,y)andG(x,y)
[0023] D=G(x,y+1)andG(x,y)
[0024] E=G(x,y-1)
[0025] then E(x,y)=A
[0026] else E(x,y)=0
[0027] Among them, E(x,y) is the edge strength after non-maximum suppression;
[0028] Apply high and low thresholds to detect strong and weak edges, and connect the edges through connected components, which are expressed as follows:
[0029] if E(x,y)>T h
[0030] then E(x,y)=255
[0031]
[0032] then E(x,y)=255
[0033] else E(x,y)=0
[0034] Among them, T h is the high threshold, T l is the low threshold.
[0035] Furthermore, the morphological operation in step S200 includes the following:
[0036] Dilation operation: expand the edge area of the image and remove small noise points;
[0037] Erosion operation: shrink the edge area of the image and remove isolated small noise points;
[0038] Opening operation: the image is corroded first and then expanded to remove small noise points;
[0039] Closing operation: The image is first expanded and then eroded to fill the holes on the edges.
[0040] Furthermore, the expression of the dilation operation in morphological operations is as follows:
[0041]
[0042] Among them, S is the set of structural elements, s x and y is the offset of the structural element, E dilated (x, y) represents the image information after the dilation operation;
[0043] The expression of the corrosion operation is as follows:
[0044]
[0045] Among them, E eroded (x, y) represents the image information after the corrosion operation;
[0046] The expression of the opening operation is as follows:
[0047] E opened (x,y)=dilate(erode(E(x,y)))
[0048] Among them, E opened (x, y) represents the image information after the opening operation, dilate represents the dilation operation, and erode represents the erosion operation;
[0049] The expression of the closing operation is as follows:
[0050] E closed (x,y)=erode(dilate(E(x,y)))
[0051] Among them, E closed (x, y) represents the image information after the closing operation.
[0052] Further, the steps to identify problematic areas that deviate from normal flatness are as follows:
[0053] Use contour detection algorithms to extract edge contours and analyze the area and perimeter features of the contours;
[0054] The expression of the contour detection algorithm is as follows:
[0055] Contours = find Contours(E closed )
[0056] Among them, Contours represents a contour set, and find Contours extracts contours;
[0057] The expressions for analyzing the area and perimeter characteristics of the contour are as follows:
[0058] Area=area(Contour i )
[0059] Perimeter=perimeter(Contour i )
[0060] Among them, Contour iis the i-th contour, area represents contour area analysis, perimeter represents contour perimeter analysis, Area represents contour area, and Perimeter represents contour perimeter;
[0061] Areas that significantly deviate from normal flatness are marked based on contour features, and the marked problem areas are excluded, leaving only the initially screened flat areas.
[0062] Furthermore, marking the problem area is to mark the area that significantly deviates from the normal flatness according to the contour features, and its expression is as follows:
[0063] Problem Regions = {Contour i ∣Area(Contour i )>A threshold}
[0064] Among them, Problem Regions represents the problem area, A threshold It is used to filter out the contours with a larger area;
[0065] Excluding the marked problem areas means only keeping the areas that are considered relatively flat after preliminary screening. The expression is as follows:
[0066] Filtered Regions=Image\ProblemRegions
[0067] Among them, Filtered Regions represents the filtered area, and Image represents the filtering operation.
[0068] Furthermore, the specific steps in step S300 are as follows:
[0069] The stripes of the projected parallel stripe pattern are monochrome, and the periodicity of the stripes is achieved by alternating black and white lines;
[0070] Use a projection device to project a parallel stripe pattern onto the surface of the engineering plastic to be tested, and use a high-resolution industrial camera to capture the surface image of the engineering plastic on which the parallel stripe pattern is projected from the same angle;
[0071] To extract the stripe information from the surface image, the threshold segmentation method is used, and its expression is as follows:
[0072]
[0073] Projected Pattern(x,y)=Stripe Pattern(x,y)·Intensity
[0074] I stripes(x,y)=Capture Projected Pattern(x,y)
[0075]
[0076] Where, Stripe Pattern (x, y) is the stripe pattern information, w is the width of the stripe in pixels, Intensity is the intensity of the projected stripe, Projected Pattern (x, y) is the projected image information, T' is the threshold, I binary To extract the stripe information from the surface image, I stripes An image showing an engineering plastic surface with a stripe pattern projected on it;
[0077] Analyze the distortion, offset or interruption of stripes and calculate the distance change between stripes;
[0078] Δd(x,y)=|d(x,y)-d0|
[0079] Where Δd(x,y) is the change in fringe distance, d(x,y) is the fringe spacing at point (x,y), and d0 is the ideal fringe spacing;
[0080] Quantify the flatness of engineering plastics based on statistical methods;
[0081]
[0082] Where RMS is the root mean square error, Δd(x i ,y i ) is at each pixel (x i ,y i ) at the fringe spacing deviation.
[0083] Further, in step S400, according to the maximum deviation value analyzed in step S300, the deformation amount of each preliminary screening pass area is quantified, and the flatness is quantified using a statistical method;
[0084] Its expression is as follows:
[0085]
[0086] Where N is the number of sampling points, Δd i is the fringe spacing deviation at the i-th sampling point.
[0087] A flatness detection device for engineering plastics, comprising:
[0088] Image acquisition and preprocessing module: Use a high-resolution industrial camera to capture images of the engineering plastic surface from different angles, and grayscale, remove noise, and enhance the images.
[0089] Edge detection and feature analysis module: Apply edge detection algorithms to extract edge information in images, use morphological operations to remove small noise points, identify any problem areas that deviate from normal flatness, mark problem areas in the image and exclude them;
[0090] Moiré fringe projection and analysis module: projects a set of fine parallel fringe patterns onto the surface of engineering plastics, uses an industrial camera to capture the image of the fringe pattern mapped onto the plastic surface, excludes previously marked problem areas, processes the image to identify distortions, offsets or interruptions in the moiré fringes, and calculates the distance changes between the moiré fringes to quantify the maximum deviation value of the abnormal area;
[0091] Deformation quantification and classification module: quantify the deformation of each area that passes the preliminary screening based on the results of the moiré fringe analysis, compare the quantified value with the preset threshold, and output the final classification result based on the comparison result.
[0092] A storage medium stores non-transitory computer-readable instructions for executing one or more steps in the aforementioned method for detecting the flatness of engineering plastics.
[0093] The beneficial effects of the present invention are:
[0094] The present invention acquires comprehensive information by collecting images from multiple angles, and improves the image quality by using grayscale processing, noise removal and image enhancement. From image acquisition to the final classification result output, the obvious problem areas are quickly eliminated through preliminary screening, and the distance change between the moiré fringes is calculated to quantify the deformation. The image processing technology is used to flexibly deal with the differences in reflective characteristics of surfaces of different materials. The present invention is suitable for large-scale flatness detection of engineering plastics and can meet the high efficiency requirements in actual production. BRIEF DESCRIPTION OF THE DRAWINGS
[0095] Figure 1 It is a flow chart of a method for detecting the flatness of engineering plastics proposed by the present invention;
[0096] Figure 2 It is a module block diagram of a flatness detection device for engineering plastics proposed by the present invention.
[0097] In the figure: 101, image acquisition and preprocessing module; 102, edge detection and feature analysis module; 103, moiré fringe projection and analysis module; 104, deformation quantification and classification module. DETAILED DESCRIPTION
[0098] The subject matter described herein will now be discussed with reference to example implementations. It should be understood that the discussion of these implementations is only to enable those skilled in the art to better understand and implement the subject matter described herein, and the functions and arrangements of the elements discussed may be changed without departing from the scope of protection of the present specification. Various examples may omit, replace, or add various processes or components as needed. In addition, the features described in some examples may also be combined in other examples.
[0099] At least one embodiment of the present invention discloses a method for detecting the flatness of engineering plastics, such as Figure 1-Figure 2 As shown, the following steps are included:
[0100] S100: Image acquisition and preprocessing
[0101] Use high-resolution industrial cameras to capture surface images of the engineering plastics to be inspected from multiple angles to ensure stable lighting conditions to reduce the impact of light changes;
[0102] In one embodiment of the present invention, the preparation environment required for image acquisition is as follows:
[0103] 1. Light control: Ensure that the ambient light conditions are stable. You can use blackout curtains or operate in a closed testing room.
[0104] 2. Light source setting: Use uniform backlight or professional light sources such as ring light to ensure consistent light intensity throughout the inspection area.
[0105] 3. Camera settings: Use a high-resolution industrial camera and set the camera parameters (such as exposure time, gain, etc.) to obtain high-quality images.
[0106] The exposure time is t exp , the unit is usually milliseconds (ms); gain is gain, which is usually a unitless proportional coefficient.
[0107] 4. Multi-angle shooting
[0108] Angle selection: Choose multiple angles to cover all important areas of engineering plastics. For example, multiple angles include but are not limited to shooting from directly above, shooting from the left, shooting from the right, and shooting at an angle of 45° between the four sides and the horizontal plane;
[0109] Synchronous triggering: Use an external trigger signal to synchronize the operation of the light source and camera, ensuring that the status of the light source and camera are consistent every time you shoot.
[0110] Image preprocessing: grayscale the collected image, use appropriate filters (such as Gaussian filtering or median filtering) to remove noise in the image, and perform image enhancement, such as contrast enhancement or histogram equalization, to improve the image quality;
[0111] Grayscale processing: Convert a color image to a grayscale image. The formula is:
[0112] I gray (x,y)=0.299·R(x,y)+0.587·G(x,y)+0.114·B(x,y)
[0113] Among them, I gray is a grayscale image, R(x,y), G(x,y), B(x,y) are the pixel values of the red, green and blue channels in the original image respectively.
[0114] Denoising:
[0115] 1. Gaussian filtering: Use a Gaussian kernel to perform convolution on the image to remove noise.
[0116]
[0117] Among them, g(i,j) is the Gaussian kernel function, w and h are the width and height of the Gaussian kernel, which are usually odd numbers, such as 3×3 or 5×5, and the standard deviation of the Gaussian kernel is σ, which determines the degree of diffusion of the kernel function.
[0118] 2. Median filtering: Take the median of the pixel values in the window as the new pixel value at that position.
[0119] I median (x,y)=median(I(x+i,y+j)∣i,j∈[-r,r])
[0120] The radius of the median filter window is r, for example, r=1 corresponds to a 3×3 window.
[0121] 3. Image Enhancement:
[0122] Contrast Enhancement: Use histogram equalization to increase image contrast.
[0123] I enhanced (x,y)=HistEq(I(x,y))
[0124] Among them, HistEq represents the histogram equalization operation.
[0125] 4. Histogram equalization: Calculate the cumulative distribution function (CDF) and map it back to grayscale.
[0126]
[0127] Among them, hist(i) is the number of pixels at the i-th gray level, and N is the total number of pixels.
[0128]
[0129] Among them, the gray level after histogram equalization is I eq (x,y), the pixel value after mapping.
[0130] S200: Preliminary screening (based on visual algorithm)
[0131] Edge detection: Apply edge detection algorithms (such as Canny edge detection) to extract edge information in the image. Edge detection can help identify the boundaries and internal structural features of engineering plastic parts;
[0132] Canny edge detection:
[0133] Gaussian filtering: First, the image is Gaussian filtered to remove noise.
[0134]
[0135] Among them, g(i,j) is the Gaussian kernel function, w and h are the width and height of the kernel, I smooth (x,y) represents the image information after Gaussian filtering.
[0136] Gradient calculation: Calculate the gradient strength and direction of the image.
[0137]
[0138] Among them, I x and I y is the first-order derivative along the x and y directions, G(x,y) is the gradient strength of the pixel (x,y) in the image, and θ(x,y) is the gradient direction of the pixel (x,y) in the image.
[0139] Non-maximum suppression: Perform non-maximum suppression on the gradient intensity and retain the local maximum.
[0140] if A>B>C>D>E
[0141] A=G(x,y)
[0142] B=G(x+1,y)andG(x,y)
[0143] C=G(x-1,y)andG(x,y)
[0144] D=G(x,y+1)andG(x,y)
[0145] E=G(x,y-1)
[0146] then E(x,y)=A
[0147] else E(x,y)=0
[0148] Among them, E(x,y) is the edge strength after non-maximum suppression.
[0149] Dual Threshold Detection and Connection: Apply high and low thresholds to detect strong and weak edges, and connect the edges via connected components.
[0150] if E(x,y)>T h
[0151] then E(x,y)=255
[0152]
[0153] then E(x,y)=255
[0154] else E(x,y)=0
[0155] Among them, T h is the high threshold, T l is the low threshold.
[0156] Morphological operations: Use morphological operations such as dilation and erosion to remove small noise points in the image and highlight the main edge features. You can use opening and closing operations to further smooth the edges and fill holes.
[0157] Dilation operation: expand the edge area and remove small noise points.
[0158]
[0159] Among them, S is the set of structural elements, s x and y is the offset of the structural element, E dilated (x,y) represents the image information after the dilation operation.
[0160] Erosion operation: shrink the edge area and remove isolated small noise points.
[0161]
[0162] Among them, S is the set of structural elements, s x and y is the offset of the structural element, E eroded (x,y) represents the image information after the corrosion operation.
[0163] Opening operation: first erosion and then expansion, used to remove small noise points.
[0164] E opened (x,y)=dilate(erode(E(x,y)))
[0165] Among them, E opened (x, y) represents the image information after the opening operation, dilate represents the dilation operation, and erode represents the erosion operation;
[0166] Closing operation: dilation followed by erosion to fill holes on the edges.
[0167] E closed (x,y)=erode(dilate(E(x,y)))
[0168] Among them, E closed (x, y) represents the image information after the closing operation, and n represents the number of times the dilation or erosion operation is performed.
[0169] Feature extraction: Analyze edge features to identify areas that deviate significantly from normal flatness.
[0170] These areas may be caused by large deformations of the surface. Contour detection algorithms can be used to extract irregular contours and further analyze the shape and size of these contours.
[0171] Contour Detection:
[0172] Use a contour detection algorithm (such as the find Contours method in OpenCV) to extract edge contours:
[0173] Contours = find Contours(E closed )
[0174] Among them, Contours represents a contour set, and find Contours extracts contours;
[0175] Feature analysis: Analyze the area, perimeter and other features of the contour.
[0176] Area=area(Contour i )
[0177] Perimeter=perimeter(Contour i )
[0178] Among them, Contour iis the i-th contour, area represents contour area analysis, perimeter represents contour perimeter analysis, Area represents contour area, and Perimeter represents contour perimeter;
[0179] It should be noted that the contour area threshold: A threshold , used to filter out contours with larger areas; contour perimeter threshold: P threshold , which is used to filter out contours with longer perimeters.
[0180] Region segmentation: Mark the initially detected problem areas and exclude them, leaving only the initially screened relatively flat areas for the next detailed inspection.
[0181] Mark Problem Areas: Areas that significantly deviate from normal flatness are marked based on contour features.
[0182] Problem Regions = {Contour i ∣Area(Contour i )>A threshold}
[0183] Among them, Problem Regions represents the problem area;
[0184] Exclude problem areas: Exclude marked problem areas and only keep areas that are considered relatively flat based on preliminary screening.
[0185] Filtered Regions=Image\ProblemRegions
[0186] Among them, Filtered Regions represents the filtered area, and Image represents the filtering operation;
[0187] It should be noted that the Gaussian kernel size: w and h, for example, 3×3 or 5×5, the Gaussian kernel standard deviation: σ, for example, 1.4; the high threshold: T h , for example 100; low threshold: T l , such as 50; structure element size: w and h, such as 3×3 or 5×5; number of iterations: n, such as 1 or 2; contour area threshold: A threshold , for example 100 pixels; contour perimeter threshold: P threshold , for example 30 pixels.
[0188] S300: Detailed detection (based on the moiré effect)
[0189] Fringe projection: Projects a set of fine parallel fringe patterns onto a relatively flat area that has been initially screened.
[0190] It should be noted that the image initially screened is an image excluding the marked problem area, which can be achieved by first projecting a parallel stripe image on the surface of the engineering plastic excluding the marked problem area;
[0191] Or projecting parallel stripe images on the surface of engineering plastics and marking the problem areas to exclude the image of the problem areas;
[0192] The stripes should have sufficient contrast to be clearly visible and can be solid or colored for better viewing.
[0193] Stripe Generation: Generates a fine pattern of parallel stripes. The stripes can be solid or colored for increased visibility.
[0194] The periodicity of the stripes can be achieved by generating a series of alternating black and white lines.
[0195]
[0196] Wherein, Stripe Pattern (x, y) is the stripe pattern information, w is the width (period) of the stripe, and the unit is usually pixel.
[0197] Stripe projection: Use a projection device (such as a digital light processor DLP) to project a stripe pattern onto a relatively flat area that has been initially screened.
[0198] Make sure the stripe pattern has enough contrast to be clearly visible.
[0199] Projected Pattern(x,y)=Stripe Pattern(x,y)·Intensity
[0200] Among them, Intensity is the intensity of the projected stripes, and Projected Pattern (x, y) is the projected image information.
[0201] Image acquisition: Use the camera again to capture the image of the engineering plastic surface with the stripe pattern projected on it, making sure that the stripe pattern is clearly visible without severe distortion or blur.
[0202] Image Capture: Use a high-resolution industrial camera to capture images of the engineering plastic surface with the stripe pattern projected on it from the same angle.
[0203] Ensure that lighting conditions are stable to avoid the effects of light changes.
[0204] I stripes (x,y)=Capture Projected Pattern(x,y)
[0205] Among them, I stripes (x, y) represents the image of the engineering plastic surface projected with the stripe pattern, and the exposure time of the industrial camera is t exp , the unit is usually milliseconds (ms), gain is gain, the unit is usually a dimensionless proportional coefficient, and Capture Projected Pattern (x, y) is the captured projection image information.
[0206] Moire analysis: Process newly acquired images to analyze the moiré fringes, identifying distortions, offsets, or interruptions in the fringes that indicate subtle surface irregularities, and quantifying the severity of these irregularities by calculating changes in the distance between fringes.
[0207] Stripe extraction: To extract stripe information from an image, a simple threshold segmentation method can be used.
[0208]
[0209] Where T' is the threshold, I binary To extract the stripe information from the surface image.
[0210] Moire fringe detection: Analyzes fringe distortions, shifts, or interruptions that indicate subtle surface irregularities.
[0211] The variation in distance between fringes is calculated to quantify the severity of these irregularities.
[0212] Δd(x,y)=|d(x,y)-d0|
[0213] Where Δd(x,y) is the change in fringe distance, d(x,y) is the fringe spacing at point (x,y), and d0 is the ideal fringe spacing.
[0214] Parameters represent:
[0215] Threshold: T', the unit is usually grayscale value (0-255).
[0216] Ideal fringe spacing: d0, usually in pixels.
[0217] Deformation Quantification
[0218] Deformation calculation: quantify the overall flatness based on statistical methods (such as root mean square error RMS).
[0219]
[0220] Where N is the number of pixels, Δd(x i ,y i ) is at each pixel (xi ,y i ) at the fringe spacing deviation.
[0221] Parameters represent:
[0222] Root mean square error: RMS, the unit is usually pixels.
[0223] The above specific steps can be summarized as follows:
[0224] Fringe Generation: Generates a set of periodic fringe patterns.
[0225] Fringe Projection: Projecting a fringe pattern onto an engineering plastic surface.
[0226] Image capture: An image of the projected fringe pattern is captured with an exposure time t exp 'and gain gain'.
[0227] Stripe extraction: Extract stripe information from the image, with a threshold value of T'.
[0228] Moire fringe detection: Analyze the distortion, deviation or interruption of fringes.
[0229] Deformation quantification: The root mean square error (RMS) is used to quantify the deformation.
[0230] S400: Output classification results
[0231] Quantify deformation: Based on the results of the moiré fringe analysis, quantify the deformation of each preliminary screening pass area, and use statistical methods (such as root mean square error RMS) to quantify the overall flatness.
[0232] Deformation Quantification:
[0233] Based on the results of the moiré fringe analysis, the amount of deformation in each preliminary screening pass area was quantified.
[0234] Statistical methods such as root mean square error (RMS) are used to quantify the overall flatness.
[0235] Mathematical expression:
[0236]
[0237] Where N is the number of sampling points, Δd i is the fringe spacing deviation at the i-th sampling point.
[0238] Parameters represent:
[0239] Root mean square error (RMS): A statistical measure of deformation.
[0240] Number of sampling points N: The number of points used for analysis.
[0241] Fringe spacing deviation Δd i : The deviation of the fringe spacing at the ith sampling point from the standard spacing.
[0242] Classification results: The quantified deformation amount is compared with the preset standard or threshold to determine whether the flatness of the engineering plastic meets the requirements. Based on the comparison results, the engineering plastic parts are classified as qualified or unqualified.
[0243] Comparison and classification:
[0244] The quantified shape amount is compared with a preset standard or threshold.
[0245] If the RMS value is less than or equal to the set threshold, it is considered that the flatness of the area meets the requirements; otherwise, it does not meet the requirements.
[0246] Its expression is as follows:
[0247]
[0248] Parameters represent:
[0249] Threshold: The standard value used to distinguish qualified from unqualified.
[0250] Classification result: qualified / unqualified.
[0251] Result output: Output the final classification results, including but not limited to: pass / fail identification, maximum deviation value of flatness, location of problem areas and suggestions for possible further inspection or correction.
[0252] Output the final classification results, including but not limited to: pass / fail identification, maximum deviation value of flatness, location of problem areas, and suggestions for possible further inspection or correction.
[0253] Parameters represent:
[0254] Maximum Deviation: The maximum deformation value among all detection areas.
[0255] Position information: the coordinates or relative position of the problem area in the image.
[0256] Recommendation: Suggestions for improvement or treatment measures based on the test results.
[0257] Summary of specific steps
[0258] Deformation quantification: The root mean square error (RMS) is used to quantify the deformation.
[0259] Parameters: number of sampling points N, fringe spacing deviation Δd i .
[0260] Compare and Classify: Compare the RMS value to a threshold value.
[0261] Parameters: Threshold, classification result (qualified / unqualified).
[0262] Result output: Output classification results, maximum deviation value, location of problem areas, and improvement suggestions.
[0263] Parameters: maximum deviation value, location information, suggestions.
[0264] like Figure 2 As shown, the present invention also provides a flatness detection device for engineering plastics, comprising:
[0265] Image acquisition and preprocessing module: Use high-resolution industrial cameras to capture images of engineering plastic surfaces from different angles; grayscale the acquired images; apply noise reduction techniques (such as median filtering and Gaussian filtering) to remove noise from the images; perform image enhancement (such as histogram equalization or contrast adjustment) to improve image quality.
[0266] Edge Detection and Feature Analysis Module: Apply edge detection algorithms (such as Canny edge detection or Sobel operator) to extract edge information in the image; use morphological operations (such as erosion and dilation) to remove small noise points; analyze edge features to identify any problem areas that deviate from normal flatness; mark problem areas in the image and exclude them in preparation for subsequent processing;
[0267] Moiré fringe projection and analysis module: Projects a set of fine parallel fringe patterns onto the surface of engineering plastics; uses an industrial camera again to capture an image of the fringe pattern mapped onto the plastic surface; excludes previously marked problem areas; processes the image to identify distortions, offsets or interruptions in the moiré fringes; calculates the distance changes between the moiré fringes and quantifies the maximum deviation value of these abnormal areas.
[0268] Deformation quantification and classification module: quantify the deformation of each area that passes the preliminary screening based on the results of the moiré fringe analysis; compare these quantified values with the preset thresholds; output the final classification results (for example, whether it exceeds the allowable flatness tolerance) based on the comparison results.
[0269] At least one embodiment of the present disclosure provides a storage medium storing non-transitory computer-readable instructions for executing one or more steps in the aforementioned method for detecting the flatness of engineering plastics.
[0270] The computer program may be stored / distributed on a suitable medium, such as an optical storage medium or a solid-state medium supplied together with or as part of other hardware, but may also be distributed in other forms, such as via the Internet or other wired or wireless telecommunication systems. Any reference signs in the claims should not be construed as limiting the scope.
[0271] The above describes an embodiment of the present invention, but this embodiment is not limited to the above-mentioned specific implementation mode. The above-mentioned specific implementation mode is merely illustrative and not restrictive. Under the guidance of this embodiment, ordinary technicians in this field can also make more forms of equivalent embodiments, all of which are protected by this embodiment.
Claims
1. A method for detecting the flatness of engineering plastics, characterized in that: The following steps are involved: S100: Use a high-resolution industrial camera to capture the surface images of the engineering plastics to be inspected from multiple angles, convert the collected surface images into grayscale and remove noise from the images, and then output the pre-processed images through image enhancement; S200: applying an edge detection algorithm to extract edge information from the preprocessed image, using morphological operations to remove small noise points in the image, analyzing edge features to identify problem areas that deviate from normal flatness, marking the problem areas and excluding the problem areas from the image, and inputting the image after excluding the problem areas into S300; S300: Projecting a set of fine parallel stripe patterns onto the surface of the engineering plastic to be inspected, using an industrial camera again to capture the surface image of the engineering plastic to be inspected on the projected parallel stripe patterns, excluding the problem area on the surface image of the engineering plastic to be inspected, processing the surface image of the engineering plastic to be inspected, analyzing and identifying the areas where the moiré fringes in the image are distorted, offset or interrupted, and quantifying the maximum deviation value of the area where the distortion, offset or interruption occurs by calculating the distance change between the moiré fringes; Use a projection device to project a parallel stripe pattern onto the surface of the engineering plastic to be tested, and use a high-resolution industrial camera to capture the surface image of the engineering plastic on which the parallel stripe pattern is projected from the same angle; The stripes of the projected parallel stripe pattern are monochrome, and the periodicity of the stripes is achieved by alternating black and white lines; To extract the stripe information from the surface image, the threshold segmentation method is used, and its expression is as follows: ; ; ; ; in, is the stripe pattern information, is the width of the stripe in pixels, is the intensity of the projected fringes, To project image information, is the threshold value, To extract the fringe information from the surface image, An image showing an engineering plastic surface with a stripe pattern projected on it; Analyze the distortion, offset or interruption of the stripes and calculate the distance change between the stripes. The expression is as follows: ; in, is the variation of fringe distance, It's on point The fringe spacing at is the ideal fringe spacing; According to the statistical method, the flatness of engineering plastics is quantified as follows: ; in, is the root mean square error, At each pixel The fringe spacing deviation at is the number of sampling points; S400: quantifying the deformation variable of each initially screened region according to the results of moiré fringe analysis and recognition, comparing the quantified deformation variable with a preset threshold, and outputting a final classification result according to the comparison result; The classification results include pass / fail identification, maximum deviation value from flatness and location of problem areas.
2. The method for detecting the flatness of engineering plastics according to claim 1, characterized in that: The edge detection algorithm uses Canny edge detection, which includes the following: First, the image is Gaussian filtered to remove noise; Calculate the gradient strength and direction of the image, the expression is as follows: ; ; in, and is along and The first derivative of the direction, Pixels in the image The gradient strength, Pixels in the image The gradient direction of The gradient intensity is non-maximum suppressed and the local maximum is retained. The expression is as follows: ; ; ; ; ; ; ; ; in, is the edge strength after non-maximum suppression; Apply high and low thresholds to detect strong and weak edges, and connect the edges through connected components, which are expressed as follows: ; ; ; ; ; in, is the high threshold, is the low threshold.
3. The method for detecting the flatness of engineering plastics according to claim 2, characterized in that: The morphological operations at step S200 include the following: Dilation operation: expand the edge area of the image and remove small noise points; Erosion operation: shrink the edge area of the image and remove isolated small noise points; Opening operation: the image is corroded first and then expanded to remove small noise points; Closing operation: The image is first expanded and then eroded to fill the holes on the edges.
4. The method for detecting the flatness of engineering plastics according to claim 3, characterized in that: The expression of the dilation operation in morphological operations is as follows: ; in, is a set of structural elements, Represents a structural element, and is the offset of the structural element, Represents the image information after the dilation operation; The expression of the corrosion operation is as follows: ; in, Represents the image information after the corrosion operation; The expression of the opening operation is as follows: ; in, Represents the image information after opening operation, represents the expansion operation, Indicates corrosion operation; The expression of the closing operation is as follows: ; in, Represents the image information after the closing operation.
5. The method for detecting the flatness of engineering plastics according to claim 4, characterized in that: The steps to identify problem areas that deviate from normal flatness are as follows: Use contour detection algorithms to extract edge contours and analyze the area and perimeter features of the contours; The expression of the contour detection algorithm is as follows: ; in, represents a set of contours, Extract contours; The expressions for analyzing the area and perimeter characteristics of the contour are as follows: ; ; in, It is A silhouette, represents the contour area analysis, Represents contour perimeter analysis, represents the contour area, Indicates the contour perimeter; Areas that significantly deviate from normal flatness are marked based on contour features, and the marked problem areas are excluded, leaving only the initially screened flat areas.
6. A method for detecting the flatness of engineering plastics according to claim 5, characterized in that: Marking problem areas is to mark areas that significantly deviate from normal flatness based on contour features. The expression is as follows: ; in, Indicates the problem area, It is used to filter out the contours with a larger area; Excluding the marked problem areas means only keeping the areas that are considered relatively flat after preliminary screening. The expression is as follows: ; in, represents the filtered area, Represents a filter operation.
7. A method for detecting the flatness of engineering plastics according to claim 6, characterized in that: In step S400, according to the maximum deviation value analyzed in step S300, the deformation amount of each preliminary screening area is quantified, and the flatness is quantified using a statistical method; Its expression is as follows: ; in, It is in The fringe spacing deviation at each sampling point.
8. A flatness detection device for engineering plastics, characterized in that: The method for performing one or more steps of the flatness detection method for engineering plastics as claimed in any one of claims 1 to 7 comprises: Image acquisition and preprocessing module: Use a high-resolution industrial camera to capture images of the engineering plastic surface from different angles, and grayscale, remove noise, and enhance the images. Edge detection and feature analysis module: Apply edge detection algorithms to extract edge information in images, use morphological operations to remove small noise points, identify any problem areas that deviate from normal flatness, mark problem areas in the image and exclude them; Moiré fringe projection and analysis module: projects a set of fine parallel fringe patterns onto the surface of engineering plastics, uses an industrial camera to capture the image of the fringe pattern mapped onto the plastic surface, excludes previously marked problem areas, processes the image to identify distortions, offsets or interruptions in the moiré fringes, and calculates the distance changes between the moiré fringes to quantify the maximum deviation value of the abnormal area; Deformation quantification and classification module: quantify the deformation of each area that passes the preliminary screening based on the results of the moiré fringe analysis, compare the quantified value with the preset threshold, and output the final classification result based on the comparison result.
9. A storage medium, characterized in that: Non-transitory computer-readable instructions are stored, and are used to execute one or more steps in the flatness detection method for engineering plastics as described in any one of claims 1-7.
Citation Information
Patent Citations
Device and method for detecting and measuring surface defects of products
CN115201202A
Crack length detection system based on computer image processing
CN118037730A
Remote sensing image shadow automatic detection algorithm based on orthogonal decomposition
CN118379636A