Method for identifying the state of plasma electrolytic oxidation reaction based on image processing

Through image processing technology, including grayscale, segmentation, morphological processing and edge feature extraction, the plasma electrolytic oxidation reaction state and spark quantity are accurately identified, which solves the problem that the reaction state cannot be accurately identified in the prior art and improves the control accuracy of the reaction process.

CN114565556BActive Publication Date: 2025-03-14XIAN UNIV OF TECH
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210042095.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-01-14
Publication Date
2025-03-14
Estimated Expiration
2042-01-14

AI Technical Summary

Technical Problem

The prior art cannot accurately identify the state of plasma electrolytic oxidation reaction and the number of sparks, resulting in the inability to accurately control the reaction process.

Method used

Using an image processing method, by obtaining the spark image of the workpiece surface, grayscale, segmentation, morphological processing and edge feature extraction are performed, the number of sparks is calculated using the connecting domain method, and divided by the surface area of ​​the workpiece to obtain the number of sparks per unit area, and the reaction state is identified.

Benefits of technology

Accurate identification of plasma electrolytic oxidation reaction state and accurate detection of spark quantity are achieved, and the control accuracy of the reaction process is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114565556B_ABST
    Figure CN114565556B_ABST
Patent Text Reader

Abstract

The invention discloses a method for identifying the state of plasma electrolytic oxidation reaction based on image processing, comprising: obtaining a spark image to be processed and obtaining the area S of the workpiece surface; graying the spark image to be processed; segmenting the spark and background of the grayed spark image to be processed to obtain a target spark image; morphologically processing the target spark image to obtain mutually separated spark targets; extracting the edge features of each spark target in the target spark image; connecting the edge features using a connected domain method to obtain the total number of sparks, and dividing it by the area S of the workpiece surface to obtain the number of sparks per unit area, and identifying the plasma electrolytic oxidation reaction state at the current moment according to the number of sparks per unit area. The accuracy of identifying the reaction state of plasma electrolytic oxidation is improved, and it is more conducive to accurately adjusting the reaction process.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of image processing and relates to a method for identifying a plasma electrolytic oxidation reaction state based on image processing. Background Art

[0002] Plasma electrolytic oxidation technology is used for surface treatment of aluminum, magnesium, titanium and their alloys. The principle is that under appropriate electrolyte conditions and pulsed electric field, complex chemical, electrochemical and plasma spark discharge reactions occur on the surface of the metal workpiece as the anode. Under the instantaneous high temperature and high pressure generated by the discharge, a ceramic layer composed mainly of matrix metal oxide and supplemented by electrolyte components grows on the surface of the metal workpiece, which has the advantages of strong corrosion resistance, wear resistance, insulation and green electrolyte.

[0003] The state of plasma electrolytic oxidation reaction is closely related to the growth process of the ceramic layer, and has a great influence on the microscopic morphology and protective performance of the finally grown ceramic layer. The plasma electrolytic oxidation discharge reaction process can be mainly divided into three stages. At the beginning, a large number of bubbles are generated on the surface of the workpiece undergoing plasma discharge reaction, the metallic luster gradually disappears, sparks appear from nothing, and flicker slightly locally. This stage is the anodizing stage. After a few minutes, dense small sparks appear on the surface of the material, which is the spark discharge stage. Then the sparks gradually break and evolve into large and sparse sparks, which is the micro-arc discharge stage. If ablation occurs, large arc discharge will also occur. Its specific reaction state is related to the number of sparks, but because the scale of these discharge sparks is too small, the distribution is too dense, and the characteristics themselves are not obvious enough, the number changes of these tiny discharge sparks can only be roughly divided into three stages by naked eye observation, and it is impossible to accurately identify the plasma electrolytic oxidation reaction state and specific evolution process at a certain moment. Summary of the invention

[0004] The purpose of the present invention is to provide a method for identifying the state of plasma electrolytic oxidation reaction based on image processing, which solves the problem in the prior art that the number of discharge sparks cannot be accurately obtained.

[0005] The technical solution adopted by the present invention is a method for identifying the state of plasma electrolytic oxidation reaction based on image processing, comprising the following steps:

[0006] Step 1, obtaining the spark image to be processed and obtaining the area S of the workpiece surface;

[0007] Step 2, graying the spark image to be processed;

[0008] Step 3, segmenting the spark and background of the grayscaled spark image to be processed to obtain a target spark image;

[0009] Step 4, performing morphological processing on the target spark image to obtain spark targets separated from each other;

[0010] Step 5, extracting edge features of each spark target in the target spark image;

[0011] Step 6: Use the connected domain method to connect the edge features to obtain the total number of sparks, and divide it by the area S of the workpiece surface to obtain the number of sparks per unit area. According to the number of sparks per unit area, the current plasma electrolytic oxidation reaction state is identified.

[0012] The present invention is also characterized in that:

[0013] The specific process of step 2 is: converting the color of the pixel points in the spark image to be processed into grayscale by the weighted average method.

[0014] The specific process of step 3 is as follows: first, take the grayscale mean M of the grayscale image to be processed after grayscale conversion, and arbitrarily select a grayscale value t to divide the grayscale histogram of the image into two parts, A and B. The average values ​​of the two parts are MA and MB, and the proportion of the number of pixels in part A to the total number of pixels is recorded as PA, and the proportion of the number of pixels in part B to the total number of pixels is recorded as PB. The maximum inter-class variance is calculated and used as the grayscale threshold T, and then the grayscale threshold T is used to divide the image into a binary image to obtain the target spark image.

[0015] The specific process of step 4 is: firstly perform an erosion operation on the target spark image, and then expand it to obtain spark targets separated from each other.

[0016] Step 5 specifically includes the following steps:

[0017] Step 5.1, convolve the target spark image using a Gaussian filter to obtain a filtered pixel e;

[0018] Step 5.2: Use a pair of convolution arrays S x ,S y , a 3x3 window in the target spark image is convolved with A and the Sobel operator, and the gradient values ​​of the pixel e in the x and y directions are G respectively. X and G y , and then calculate the gradient intensity G and gradient direction θ of pixel point e;

[0019] Step 5.3: According to the gradient direction, perform non-maximum suppression on the gradient amplitude to obtain the edge point;

[0020] Step 5.4: Use high and low thresholds to process edge points to obtain edge features of each spark target.

[0021] The specific process of step 5.3 is as follows: the gradient direction is divided into E, NE, N, NW, W, SW, S, SE, where 0 represents 0°~45°, 1 represents 45°~90°, 2 represents -90°~-45°, 3 represents -45°~0°, the gradient direction of pixel point P is θ, and the gradient linear interpolation G of pixel points P1 and P2 is obtained. P1 and G p2 , the gradient strength G of the current pixel is compared with the pixel G along the positive and negative gradient directions P1 , G p2 For comparison, suppressing less than pixel G P1 , G p2 The pixel point will be larger than the pixel G P1 , G p2 The pixel points are taken as edge points;

[0022] The process of obtaining the total number of sparks in step 6 is as follows: connect the eight connected regions, traverse the image statistics, obtain 1 spark point, and then expand the eight neighborhoods of the spark point to search the area. When the search area is no longer expanding, count +1 and continue to look for the next new point. Repeat the operation until the search of the entire image is completed and the total number of sparks is obtained.

[0023] The beneficial effects of the present invention are as follows: the method for identifying the reaction state of plasma electrolytic oxidation based on image processing of the present invention accurately detects the number of sparks per unit area generated on the surface of a sample at a certain moment by image processing technology to identify the reaction state of plasma electrolytic oxidation at that moment, and further accurately controls the reaction process according to the evolution of the spark state; the accuracy of identifying the reaction state of plasma electrolytic oxidation is improved, and it is more conducive to accurately adjusting the reaction process. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] Figure 1 is a flow chart of a method for identifying a plasma electrolytic oxidation reaction state based on image processing according to the present invention;

[0025] Figure 2 It is a spark image to be processed in the method for identifying the state of plasma electrolytic oxidation reaction based on image processing of the present invention;

[0026] Figure 3 It is the target spark image in the method for identifying the state of plasma electrolytic oxidation reaction based on image processing of the present invention;

[0027] Figure 4 The mutually separated target spark images in the method for identifying the state of plasma electrolytic oxidation reaction based on image processing of the present invention;

[0028] Figure 5 It is the edge feature of the spark in the method for identifying the state of plasma electrolytic oxidation reaction based on image processing of the present invention;

[0029] Figure 6 It is a spark image in the method for identifying the state of plasma electrolytic oxidation reaction based on image processing of the present invention. DETAILED DESCRIPTION

[0030] The present invention is described in detail below with reference to the accompanying drawings and specific embodiments.

[0031] Methods for identifying the state of plasma electrolytic oxidation reaction based on image processing, such as Figure 1 As shown, the following steps are included:

[0032] Step 1: Use high-resolution camera equipment to take photos of the workpiece surface, such as Figure 2 As shown, the spark image to be processed and the area S of the workpiece surface are obtained;

[0033] Step 2, graying the spark image to be processed;

[0034] Specifically, the color of the pixel points in the spark image to be processed is converted into grayscale by the weighted average method. The conversion formula is:

[0035] I(x,y)=0.3*I_R(x,y)+0.59*I_G(x,y)+0.11*I_B(x,y) (1);

[0036] In the above formula, 0.3, 0.59, and 0.11 are weighting coefficients adjusted according to the human brightness perception system. By eliminating the image hue and saturation information while retaining the brightness, the RGB color image is converted to a grayscale image.

[0037] Step 3: Segment the spark and background of the grayscaled spark image to be processed to obtain the target spark image, such as Figure 3 As shown;

[0038] Specifically, first take the grayscale mean M of the grayscale image to be processed after grayscale conversion, and arbitrarily select a grayscale value t to divide the grayscale histogram of the image into two parts, A and B. The average values ​​of the two parts are MA and MB, and the proportion of the number of pixels in part A to the total number of pixels is recorded as PA, and the proportion of the number of pixels in part B to the total number of pixels is recorded as PB. Calculate the maximum inter-class variance and use it as the grayscale threshold T. The maximum inter-class variance is defined as:

[0039] ICV=PA α *(MA-M) 2 +PB α *(MB-M) 2 (2);

[0040] In the above formula, α is taken as 0.8, and the threshold value T=ICV is taken as 200.

[0041] Then use the grayscale threshold T to segment the image into a binary image:

[0042] T=T[x,y,p(x,y),f(x,y)] (3);

[0043] In the above formula, x and y represent the horizontal and vertical coordinates of the pixel, p(x, y) represents the local characteristics of the pixel, and f(x, y) represents the gray value of the pixel. The image after thresholding is a binary image, which is defined as:

[0044]

[0045] The pixels represented by 0 are the target sparks, and then the target spark image is obtained.

[0046] Step 4, performing morphological processing on the target spark images to obtain target spark images separated from each other;

[0047] Specifically, in the process of plasma electrolytic oxidation, sparks in the image may stick together due to arc mapping, which affects the accuracy of counting. The present invention solves the above problem in the following way. The target spark image is first eroded and then expanded to obtain spark targets separated from each other. The above processing method has the effect of smoothing the target contour, disconnecting narrow connecting parts, and removing small protrusions, so that each target spark is separated from each other, effectively reducing counting errors and facilitating subsequent processing, such as Figure 4 shown.

[0048] Step 5, extracting edge features of each spark target in the target spark image;

[0049] Step 5.1: In order to minimize the influence of noise in the spark image on the spark edge detection result, the noise must be filtered out to prevent false detection caused by noise. In order to smooth the image, a Gaussian filter is used to convolve with the image to reduce the obvious noise effect on the edge detector. Specifically, the target spark image is convolved with a Gaussian filter to obtain the filtered pixel e;

[0050] In this embodiment, a Gaussian filter kernel of (2k+1)x(2k+1) is used, and its equation is:

[0051]

[0052] In the above formula, i and j are the rows and columns of the Gaussian convolution kernel matrix, σ is the variance, and k determines the dimension of the kernel matrix. Taking σ = 1.4, the Gaussian convolution kernel of size 3x3 (k = 1) is:

[0053]

[0054] Assume that a 3x3 window in the target spark image is A, and the pixel to be filtered is e. After Gaussian filtering, the brightness value of pixel e is:

[0055]

[0056] Where * is the convolution symbol, sum represents the sum of all elements in the matrix, h is the coefficient of the Gaussian convolution kernel matrix, and ai is the coefficient of window A.

[0057] Step 5.2: Use a pair of convolution arrays S x ,S y , convolve a 3x3 window A in the target spark image with the Sobel operator, and the convolution array S x ,S y for:

[0058]

[0059]

[0060] In the above formula, S x Represents the Sobel operator in the x direction, used to detect edges in the y direction, S y Represents the Sobel operator in the y direction, which is used to detect edges in the x direction;

[0061] After convolution, the gradient values ​​of pixel e in the x and y directions are G X and G y :

[0062]

[0063]

[0064] In the above formula, * is the convolution symbol, and sum represents the sum of all elements in the matrix;

[0065] Then calculate the gradient intensity G and gradient direction θ of pixel point e;

[0066]

[0067]

[0068] Step 5.3: According to the gradient direction, perform non-maximum suppression on the gradient amplitude to obtain the edge point;

[0069] Specifically, the gradient directions are divided into E, NE, N, NW, W, SW, S, and SE, where 0 represents 0° to 45°, 1 represents 45° to 90°, 2 represents -90° to -45°, and 3 represents -45° to 0°. The gradient direction of pixel point P is θ, and the gradient linear interpolation G of pixel points P1 and P2 is obtained. P1 and G p2 ,

[0070] tanθ=G y / G x (14);

[0071] G P1 =(1-tan(θ))*E+tan(θ)*NE (15);

[0072] G P2 =(1-tan(θ))*W+tan(θ)*SW (16);

[0073] Compare the gradient strength G of the current pixel with the pixel G along the positive and negative gradient directions P1 , G p2 For comparison, suppressing less than pixel G P1 , G p2 The pixel point will be larger than the pixel G P1 , G p2 The pixel points are taken as edge points;

[0074] Step 5.4: Use high and low thresholds to process edge points and obtain edge features of each spark target. Specifically, use weak gradient strength to filter edge pixels and retain edge pixels with high gradient strength to resolve stray responses. Here, a high and low threshold ratio of 2:1 is used to obtain edge features of each spark target, such as Figure 5 shown.

[0075] Step 6: Use the connected domain method to connect the edge features to obtain the total number of sparks, and divide it by the area S of the workpiece surface to obtain the number of sparks per unit area. According to the number of sparks per unit area, the current state of the plasma electrolytic oxidation reaction can be identified, thereby accurately knowing the evolution state of the plasma electrolytic oxidation, providing a basis for further precise control of the reaction process.

[0076] Specifically, the values ​​after binarization processing are only 0 and 1, and the spark edge is clearly displayed. The pixel represented by 0 represents the spark edge that needs to be counted, and the adjacent pixels represented by 0 are connected. Connect the eight connected areas of the top, bottom, left, right, upper left, upper right, lower left, and lower right of the pixel represented by 0, traverse the image statistics, get 1 spark point, and then expand the eight neighborhoods of the spark point to search the area. When the search area is no longer expanded, it means that the search of the area has been completed, count +1, and continue to look for the next new point. Repeat the operation until the search of the entire image is completed. Figure 6 As shown, the total number of sparks is obtained.

[0077] In the above manner, the method for identifying the reaction state of plasma electrolytic oxidation based on image processing of the present invention accurately detects the number of sparks per unit area generated on the surface of the sample at a certain moment by image processing technology to identify the reaction state of plasma electrolytic oxidation at that moment, and further accurately controls the reaction process according to the evolution of the spark state; the accuracy of identifying the reaction state of plasma electrolytic oxidation is improved, which is more conducive to accurately adjusting the reaction process.

Claims

1. A method for identifying a plasma electrolytic oxidation reaction state based on image processing, characterized in that: The following steps are involved: Step 1, obtaining the spark image to be processed and obtaining the area S of the workpiece surface; Step 2, graying the spark image to be processed; Step 3, segmenting the spark and background of the grayscaled spark image to be processed to obtain a target spark image; Step 4, performing morphological processing on the target spark image to obtain spark targets separated from each other; Step 5, extracting edge features of each spark target in the target spark image; Step 5 specifically includes the following steps: Step 5.1, convolve the target spark image using a Gaussian filter to obtain a filtered pixel e; Step 5.2: Use a pair of convolution arrays S x ,S y , a 3x3 window in the target spark image is convolved with A and the Sobel operator, and the gradient values ​​of the pixel e in the x and y directions are G respectively. X and G y , and then calculate the gradient intensity G and gradient direction of pixel e ; Step 5.3: According to the gradient direction, perform non-maximum suppression on the gradient amplitude to obtain the edge point; Step 5.4, processing the edge points with high and low thresholds to obtain edge features of each spark target; Step 6: Connect the edge features using the connected domain method to obtain the total number of sparks, and divide it by the area S of the workpiece surface to obtain the number of sparks per unit area, and identify the plasma electrolytic oxidation reaction state at the current moment according to the number of sparks per unit area; The process of obtaining the total number of sparks in step 6 is as follows: connect the eight connected regions, traverse the image statistics, obtain 1 spark point, and then expand the eight neighborhoods of the spark point to search the area. When the search area is no longer expanding, count +1 and continue to look for the next new point. Repeat the operation until the search of the entire image is completed and the total number of sparks is obtained.

2. The method for identifying the state of plasma electrolytic oxidation reaction based on image processing according to claim 1, characterized in that: The specific process of step 2 is: converting the color of the pixel points in the spark image to be processed into grayscale by the weighted average method.

3. The method for identifying the state of plasma electrolytic oxidation reaction based on image processing according to claim 1, characterized in that: The specific process of step 3 is as follows: first, take the grayscale mean M of the grayscale image to be processed after grayscale conversion, and arbitrarily select a grayscale value t to divide the grayscale histogram of the image into two parts, A and B. The average values ​​of the two parts are MA and MB, and the proportion of the number of pixels in part A to the total number of pixels is recorded as PA, and the proportion of the number of pixels in part B to the total number of pixels is recorded as PB. The maximum inter-class variance is calculated and used as the grayscale threshold T, and then the grayscale threshold T is used to divide the image into a binary image to obtain the target spark image.

4. The method for identifying the state of plasma electrolytic oxidation reaction based on image processing according to claim 1, characterized in that: The specific process of step 4 is: firstly perform an erosion operation on the target spark image, and then expand it to obtain spark targets separated from each other.

5. The method for identifying the state of plasma electrolytic oxidation reaction based on image processing according to claim 1, characterized in that: The specific process of step 5.3 is: divide the gradient direction into E, NE, N, NW, W, SW, S, SE, where 0 represents 0°~45°, 1 represents 45°~90°, 2 represents -90°~-45°, and 3 represents -45°~0°. The gradient direction of the pixel point P is , get the gradient linear interpolation G of pixel points P1 and P2 P1 and G p2 , the gradient strength G of the current pixel is compared with the pixel G along the positive and negative gradient directions P1 , G p2 For comparison, suppressing less than pixel G P1 , G p2 The pixel point will be larger than the pixel G P1 , G p2 The pixel points are regarded as edge points.

Citation Information

Patent Citations

  • Mechanical part stress corrosion detection method

    CN114529548A