CN116843678A - Hard carbon electrode production quality detection method - Google Patents

Hard carbon electrode production quality detection method Download PDF

Info

Publication number
CN116843678A
CN116843678A CN202311082875.6A CN202311082875A CN116843678A CN 116843678 A CN116843678 A CN 116843678A CN 202311082875 A CN202311082875 A CN 202311082875A CN 116843678 A CN116843678 A CN 116843678A
Authority
CN
China
Prior art keywords
gray
area
value
carbon electrode
hard carbon
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202311082875.6A
Other languages
Chinese (zh)
Other versions
CN116843678B (en
Inventor
杨黎军
田其帅
杨坤
杨泽锟
司洪宇
孙康
高洪超
于淼淼
罗文静
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Qingdao Guanbaolin Activated Carbon Co ltd
Original Assignee
Qingdao Guanbaolin Activated Carbon Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Qingdao Guanbaolin Activated Carbon Co ltd filed Critical Qingdao Guanbaolin Activated Carbon Co ltd
Priority to CN202311082875.6A priority Critical patent/CN116843678B/en
Publication of CN116843678A publication Critical patent/CN116843678A/en
Application granted granted Critical
Publication of CN116843678B publication Critical patent/CN116843678B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • G06T7/0004Industrial image inspection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/11Region-based segmentation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/13Edge detection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/136Segmentation; Edge detection involving thresholding
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/187Segmentation; Edge detection involving region growing; involving region merging; involving connected component labelling
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/60Analysis of geometric attributes
    • G06T7/62Analysis of geometric attributes of area, perimeter, diameter or volume

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Quality & Reliability (AREA)
  • Geometry (AREA)
  • Image Analysis (AREA)

Abstract

The invention relates to the technical field of image processing, in particular to a hard carbon electrode production quality detection method. Analyzing a gray image of a hard carbon electrode to be detected to obtain a connected domain of the image of the gray image under different threshold segmentation, and screening the connected domain based on gray value characteristics of crack defects to obtain a suspected defect region; then further analyzing the suspected defect area to obtain a final defect area; and (3) carrying out evaluation on the optimal degree of the completion threshold by combining the shape characteristic parameters of the final defect region with the area of the final defect region and the area of the suspected defect region, further obtaining an optimal threshold, completing image segmentation based on the optimal threshold, obtaining an accurate segmentation result, and completing quality detection. According to the invention, the gray level image of the hard carbon electrode to be detected is analyzed to obtain the optimal threshold value and obtain the accurate segmentation result, and then the quality detection of the hard carbon electrode is completed according to the segmentation result, so that the reliability and accuracy of the quality detection of the hard carbon electrode are improved.

Description

Hard carbon electrode production quality detection method
Technical Field
The invention relates to the technical field of image processing, in particular to a hard carbon electrode production quality detection method.
Background
The hard carbon electrode is a conductor prepared from petroleum coke and needle coke as main raw materials, and various defects are easy to generate in the forming process of the hard carbon electrode, wherein the defects of the hard carbon electrode mainly comprise cracks, unfilled edges, corner drops and the like, and the existence of the defects can seriously influence the usability of the electrode, so that the defects of the hard carbon electrode need to be detected.
Since there are many disturbances on the hard carbon electrode plate, and the crack defect of the hard carbon electrode belongs to a defect which is not easily detected. In the prior art, a traditional threshold segmentation method is generally adopted, so that an accurate optimal threshold cannot be obtained, the crack defect of the hard carbon electrode cannot be accurately detected, and further the quality detection reliability and accuracy of the hard carbon electrode are low.
Disclosure of Invention
In order to solve the technical problems that the traditional threshold segmentation method cannot acquire an accurate optimal threshold value, so that the crack defect of a hard carbon electrode cannot be accurately detected, and further the quality detection reliability and accuracy of the hard carbon electrode are low, the invention aims to provide a hard carbon electrode production quality detection method, which adopts the following specific technical scheme:
acquiring a gray image of a hard carbon electrode to be detected;
acquiring a connected domain of the image of the gray image under different threshold segmentation; taking any threshold value as a target threshold value, and obtaining a suspected defect area according to the gray value of a pixel point in a corresponding area in the gray image of a connected area of the image under the target threshold value; obtaining a final defect region according to the difference of gray values of the edge pixel points of each suspected defect region and the neighborhood pixel points in the preset neighborhood;
obtaining shape characteristic parameters of the final defect areas according to the distribution of pixel points in each final defect area and the corresponding suspected defect area; obtaining an optimal degree parameter of the target threshold according to the area of the final defect area, the area of the suspected defect area and the shape characteristic parameter of the final defect area;
obtaining an optimal threshold according to the optimal degree parameters of all the thresholds; obtaining a segmentation result of the gray level image of the hard carbon electrode to be detected according to the optimal threshold; and obtaining the quality of the hard carbon electrode to be detected according to the segmentation result.
Further, the method for acquiring the suspected defect area comprises the following steps:
acquiring a gray gradient value of each pixel point in the gray image;
taking the average value of the gray gradient values of all pixel points in the corresponding region of each connected region in the gray image as a first average gray gradient value, the variance of the gray values as a first gray variance, and the average value of the gray values as a first gray average;
taking the average value of the gray gradient values of all pixel points in the gray image as a second average gray gradient value, taking the variance of the gray values as a second gray variance and taking the average value of the gray values as a second gray average value;
and taking a corresponding region of a connected region with the first average gray gradient value larger than the second average gray gradient value, the first gray variance smaller than the second gray variance and the first gray mean smaller than the second gray mean in the gray image as a suspected defect region.
Further, the method for acquiring the final defect area includes:
taking any suspected defect area as a defect area to be detected;
taking the difference between the second gray average value and the first gray average value of the defect area to be detected as a gray difference value;
taking any edge pixel point in the defect area to be detected as an edge pixel point to be detected; and carrying out adjustment analysis on the edge pixel points to be detected according to the gray level difference value to obtain the final defect area.
Further, the adjusting and analyzing the edge pixel point to be detected according to the gray level difference value to obtain the final defect area includes:
taking the difference of gray values of each neighborhood pixel point and the center pixel point as neighborhood gray difference in a preset neighborhood taking the edge pixel point to be detected as the center;
acquiring the minimum value of all the neighborhood gray level differences corresponding to the central pixel point, and if the minimum value is smaller than the gray level difference value, taking the neighborhood pixel point corresponding to the minimum value as an updated edge pixel point to be detected; continuing to perform adjustment analysis on the updated edge pixel points to be detected; if the minimum value is greater than or equal to the gray scale difference value, stopping adjusting analysis;
if all the edge pixel points to be detected are updated, the updated edge pixel points to be detected enclose the final defect area; otherwise, the non-updated edge pixel points to be detected and the updated edge pixel points enclose the final defect area.
Further, the method for acquiring the shape characteristic parameter comprises the following steps:
taking any final defect area as a target area;
taking the centroid of the suspected defect area corresponding to the target area as a starting point to obtain a scribing line in a preset direction;
taking the number of intersection points of the scribing line and the target area as a first number of intersection points;
taking the number of intersection points of the scribing line and the suspected defect area corresponding to the target area as a second number of intersection points;
and taking the ratio of the first intersection number to the second intersection number as the shape characteristic parameter of the target area.
Further, the method for obtaining the optimal degree parameter comprises the following steps:
adding the areas of all the final defect areas to obtain the total area of the final defect areas;
adding the areas of all the suspected defect areas to obtain the total area of the suspected defect areas;
taking the ratio of the total area of the final defect area to the total area of the suspected defect area as an area ratio;
taking the average value of the shape characteristic parameters of all the defect areas as an average value characteristic value;
taking the difference between the area ratio and a preset constant as a difference characteristic value; and carrying out negative correlation mapping and normalization on the difference characteristic value, and multiplying the difference characteristic value by the mean characteristic value to serve as the optimal degree parameter.
Further, the method for obtaining the optimal threshold value comprises the following steps:
and taking the threshold corresponding to the maximum value of all the optimal degree parameters as the optimal threshold.
Further, the preset neighborhood is a four-neighborhood.
Further, the preset direction is an eight-chain code direction.
Further, the method for acquiring the gray level image of the hard carbon electrode to be detected comprises the following steps:
and obtaining an initial image of the hard carbon electrode to be detected, and carrying out average method graying on the initial image to obtain the gray image of the hard carbon electrode to be detected.
The invention has the following beneficial effects:
the invention aims to obtain the optimal threshold value during threshold segmentation, so that the crack defect of the hard carbon electrode can be accurately detected, and the reliability and the accuracy of quality detection are improved; firstly, a gray level image of a hard carbon electrode is acquired, and then the gray level image is analyzed; because the cracks have the characteristic of regional concentration, the connected domain of the gray image can be acquired, and meanwhile, because the aim is to acquire the optimal threshold value, the images of dividing the gray image under different threshold values can be acquired, so that the subsequent evaluation on different threshold values is facilitated; further, since the gray value of the pixel point in the crack region has the characteristics of low variation, the connected region can be screened to obtain a suspected defect region; because the acquisition of the connected domain may be interfered by image noise, the suspected defect region may be further analyzed to obtain an accurate final defect region; further, since the crack has obvious shape characteristics, the shape characteristic parameter of each final defect area can be obtained, and then the shape characteristic parameter is combined with the area of the final defect area and the area of the suspected defect area to evaluate the current threshold value to obtain the optimal degree parameter of the current threshold value; and then the optimal threshold value can be obtained by comparing the optimal degree parameters based on all the threshold values; then, the gray level image can be segmented based on an optimal threshold value to obtain an accurate segmentation result, and finally, the quality detection is performed on the hard carbon electrode based on the accurate segmentation result. According to the invention, the suspected defect region in the gray level image is further analyzed to obtain an accurate final defect region, the threshold value is evaluated by combining the suspected defect region with the shape characteristics of the crack defect, the optimal threshold value is accurately obtained, and the image segmentation is performed, so that the crack defect of the hard carbon electrode can be accurately detected, and the reliability and the accuracy of the quality detection of the hard carbon electrode are further improved.
Drawings
In order to more clearly illustrate the embodiments of the invention or the technical solutions and advantages of the prior art, the following description will briefly explain the drawings used in the embodiments or the description of the prior art, and it is obvious that the drawings in the following description are only some embodiments of the invention, and other drawings can be obtained according to the drawings without inventive effort for a person skilled in the art.
Fig. 1 is a flowchart of a method for detecting the production quality of a hard carbon electrode according to an embodiment of the present invention.
Detailed Description
In order to further describe the technical means and effects adopted by the present invention to achieve the preset purpose, the following detailed description refers to specific embodiments, structures, features and effects of a hard carbon electrode production quality detection method according to the present invention with reference to the accompanying drawings and preferred embodiments. In the following description, different "one embodiment" or "another embodiment" means that the embodiments are not necessarily the same. Furthermore, the particular features, structures, or characteristics of one or more embodiments may be combined in any suitable manner.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs.
The following specifically describes a specific scheme of the method for detecting the production quality of the hard carbon electrode provided by the invention with reference to the accompanying drawings.
Referring to fig. 1, a method flowchart of a hard carbon electrode production quality detection method according to an embodiment of the invention is shown, where the method includes:
step S1: and acquiring a gray image of the hard carbon electrode to be detected.
According to the embodiment of the invention, the gray level image of the hard carbon electrode to be detected is analyzed to obtain the optimal threshold value, so that an accurate segmentation result is obtained to finish the quality detection of the hard carbon electrode, and the gray level image of the hard carbon electrode to be detected is needed to be obtained first.
Preferably, the method for acquiring the gray scale image of the hard carbon electrode to be measured in one embodiment of the present invention includes:
and acquiring images of the hard carbon electrode on the conveyor belt in a fixed light source mode through an industrial camera, and then carrying out average method graying treatment on the acquired images to obtain gray images of the hard carbon electrode to be detected. It should be noted that, the deployment of the specific image capturing device, the view angle range of the camera, and other parameter settings, the implementer can adjust according to the specific implementation scenario, which is not limited and described herein in detail; the average gray scale method is a technical means well known to those skilled in the art, and other gray scale methods may be used in other embodiments of the present invention, and specifically, the average gray scale method may be, for example, a maximum value method, a weighted gray scale method, etc., which are not limited and described herein.
The gray level image of the hard carbon electrode to be detected is obtained, and the subsequent analysis process of the gray level image of the hard carbon electrode to be detected can be completed.
Step S2: acquiring a connected domain of an image of the gray image under different threshold segmentation; taking any threshold value as a target threshold value, and obtaining a suspected defect area according to the gray value of a pixel point in a corresponding area in a gray image of a connected area of the image under the target threshold value; and obtaining a final defect region according to the difference between the gray value of the edge pixel point of each suspected defect region and the gray value of the neighborhood pixel point in the preset neighborhood.
The purpose of the embodiment of the invention is to acquire the optimal threshold value and further finish the quality detection of the hard carbon electrode, so that the threshold value can be traversed firstly, the gray level image of the hard carbon electrode to be detected in the step S1 is binarized, and at the moment, the binary image of the gray level image under different threshold values can be acquired. Since the crack defect has the characteristic of region concentration, the connected domain analysis can be performed on each binary image, and the connected domain in each binary image can be obtained. For ease of analysis and explanation, any threshold is used as the target threshold in embodiments of the present invention. In the embodiment of the present invention, 0 is used to represent the crack defect area in the binary image, that is, black represents the foreground area; the method for obtaining the connected domain is an operation process well known to those skilled in the art, and will not be described herein in detail; the range of the traversal threshold may be, for example, (0, 255), and may be adjusted according to the implementation scenario, but is not limited herein, since too large or too small a threshold may cause image loss details or excessive noise retention.
Because the obtained connected domain is directly regarded as a crack area not accurate enough, a larger error can be caused, the connected domain needs to be further screened to obtain a suspected defect area; the screening condition can be based on the gray value of the pixel point in the corresponding region of the connected domain in the gray image in the binary image; the reason is that the gray value of the pixel point in the crack area is generally low, the gray value in the crack area is changed less, and the gray gradient value of the pixel point at the edge of the crack area is larger.
Preferably, the method for acquiring the suspected defect area in one embodiment of the present invention includes:
firstly, acquiring a gray gradient value of each pixel point in a gray image of a hard carbon electrode to be detected; then accumulating the gray gradient values of all pixel points in the corresponding region of each connected region in the gray image, averaging to obtain a first average gray gradient value, taking the variance of the gray value as a first gray variance, and taking the average value of the gray value as a first gray average value; and then taking the average gray gradient value of all pixel points in the gray image as a second average gray gradient value, taking the variance of the gray value as a second gray variance, and taking the average value of the gray value as a second gray average value. Based on the analysis, the gray value of the pixel point in the crack area is generally low, the gray value change in the crack area is small, and the gray gradient value of the pixel point at the edge of the crack area is large, so that the connected domain with the first gray average value being smaller than the second gray average value is used as a suspected defect area in the gray image, wherein the first average gray gradient value is larger than the second average gray gradient value, the first gray variance is smaller than the second gray variance, and the connected domain with the first gray average value being smaller than the second gray average value is used as the suspected defect area in the gray image.
Because the connected domain obtained after the threshold segmentation is further screened to obtain the suspected defect region, image details may be lost and noise may be interfered in the process of obtaining the connected domain, so that the obtained connected domain is not accurate enough, the suspected defect region is not accurate enough at this time, and further analysis of the suspected defect region is required to obtain an accurate final defect region; because the gray value of the pixel point in the crack defect area presents obvious small characteristics, the analysis process can be completed based on the gray value difference between the edge pixel point of the suspected defect area and the neighborhood pixel point in the preset neighborhood.
Preferably, the method for acquiring the final defect area in one embodiment of the present invention includes:
for convenience of analysis and explanation, any suspected defect area is used as a defect area to be detected; according to the analysis of the gray scale characteristics of the crack region, the gray scale values of the pixel points in the crack defect region have obvious small characteristics, so that a second gray scale average value, namely the average value of the gray scale values of all the pixel points in the gray scale image, is firstly obtained, then the difference between the second gray scale average value and the first gray scale average value of the defect region to be detected is obtained, and the difference is used as a gray scale difference value; taking any edge pixel point in the defect area to be detected as an example, taking the edge pixel point as the edge pixel point to be detected, and then carrying out adjustment analysis on the edge pixel point to be detected based on the gray level difference value to obtain the final defect area.
The purpose of the adjustment analysis is to obtain a more accurate final defect region, and at the same time, the adjustment analysis reduces the suspected defect region. If the suspected defect area is enlarged in the adjustment and analysis process, the segmentation result obtained by segmentation under the corresponding threshold is extremely inaccurate, the corresponding threshold can be directly removed, and the subsequent analysis is not performed.
Preferably, in one embodiment of the present invention, adjustment analysis is performed on an edge pixel point to be detected according to a gray level difference value to obtain a final defect area, including:
in a preset neighborhood taking an edge pixel point to be detected as a center, acquiring the difference of gray values of each neighborhood pixel point and the center pixel point, and taking the difference as a neighborhood gray difference; because the gray gradient of the pixel points in the crack area is small, the minimum value in all neighborhood gray differences corresponding to the central pixel point is obtained, and the minimum neighborhood gray difference is compared with the gray difference value, so that the characteristic that the gray value of the pixel points in the crack area is generally smaller can be combined with the characteristic that the gray gradient of the pixel points in the crack area is small; and if the minimum neighborhood gray level difference is smaller than the gray level difference value, taking the neighborhood pixel point corresponding to the minimum neighborhood gray level difference as an updated edge pixel point to be detected, and then continuing to carry out adjustment analysis on the updated edge pixel point to be detected until the minimum neighborhood gray level difference value is not smaller than the gray level difference value, and stopping the adjustment analysis. After finishing adjustment analysis on all edge pixel points to be detected, if all edge pixel points to be detected are updated, taking all updated edge pixel points to be detected as edge pixel points, and enclosing a final defect area; if the edge pixel points to be detected which do not need to be updated exist, the edge pixel points to be detected which are not updated and the edge pixel points to be detected which are updated are taken as the edge pixel points to be detected, and a final defect area is formed.
Preferably, the preset neighborhood is set to be a four-neighborhood in one embodiment of the present invention.
The suspected crack region is further analyzed based on the gray value characteristics of the crack region, an accurate final crack region is obtained, and then subsequent analysis and processing can be performed.
Step S3: obtaining shape characteristic parameters of the final defect areas according to the distribution of pixel points in each final defect area and the corresponding suspected defect area; and obtaining the optimal degree parameter of the target threshold according to the area of the final defect area, the area of the suspected defect area and the shape characteristic parameter of the final defect area.
By the steps, an accurate crack area can be obtained, so that the target threshold value can be evaluated to obtain the optimal degree parameter of the current threshold value. Because the crack region has thin and long shape characteristics, the shape characteristic parameters can be obtained by analyzing the shape characteristics of the crack region, the possibility that the crack region obtained in the step S2 is an actual crack can be further characterized by the shape characteristic parameters, and the reliability of the subsequent analysis result can be further improved.
Preferably, in one embodiment of the present invention, the method for acquiring the shape characteristic parameter includes:
taking any defect area in the step S2 as a target area as an example, drawing lines in a preset direction by taking the centroid of a suspected defect area corresponding to the target area as a starting point to obtain a plurality of scribing lines, then obtaining the number of intersection points of the scribing lines in each preset direction and the target area, and taking the number of intersection points as a first number of intersection points; then obtaining the number of intersection points of the scribing line in the preset direction and the suspected defect area corresponding to the target area, and taking the number of intersection points as a second number of intersection points; then taking the ratio of the first intersection point number to the second intersection point number as a shape characteristic parameter of the target area; because the target area should be smaller than the corresponding suspected defect area and combine the shape features of thin and long cracks, when the number of intersection points of the scribing line and the target area is larger, namely the molecules are larger, and the number of intersection points of the scribing line and the suspected defect area corresponding to the target area is smaller, namely the denominator is smaller, the overall ratio is larger, the suspected defect area can be reflected to be similar to the corresponding target area, and the situation that the target area meets the shape features of the cracks can be also indicated.
Preferably, the preset direction in one embodiment of the present invention is an eight-chain code direction.
The method for acquiring the shape characteristic parameters can analyze each final defect area to acquire the shape characteristic parameters of each final defect area. And then, the shape characteristic parameters of the final defect area, the area of the suspected defect area and the area of the final defect area can be combined to finish the evaluation of the target threshold value, and the optimal degree parameters of the target threshold value are obtained.
Preferably, the method for obtaining the optimal degree parameter in one embodiment of the present invention includes:
judging the optimal degree parameter of the threshold value, wherein the ratio of the area of the suspected defect area acquired under the current threshold value to the area of the accurate final defect area acquired by further analysis in the step S2 can be used as one of evaluation indexes, so that the area of each final defect area is firstly acquired, and then the areas of all the final defect areas are added to obtain the total area of the final defect area; obtaining the area of each suspected defect area, adding the areas of all the suspected defect areas to obtain the total area of the suspected defect areas, and taking the ratio of the total area of the final defect area to the total area of the suspected defect area as an area ratio; the closer the area ratio is to 1, the higher the accuracy of the suspected defective region acquired at the current threshold to the final defective region is.
Since the crack region also has a thin and long shape feature, the shape feature parameter can also be used as one of the evaluation indexes of the optimum degree of the evaluation threshold; accumulating and summing the shape characteristic parameters of all the final defect areas to obtain an average value, and taking the average value as an average value characteristic value; taking the difference between the area ratio and the preset constant as a difference characteristic value, since the analysis shows that the closer the area ratio is to 1, the higher the accuracy of the suspected defect area obtained under the current threshold value is to be the final defect area, the preset constant is set to be 1 in the embodiment of the invention; and then carrying out negative correlation mapping and normalization on the difference characteristic values, and multiplying the difference characteristic values by the mean characteristic values to obtain the optimal degree parameters. The formula model of the optimal degree parameter may specifically be, for example:
wherein,,representing the optimal degree parameter>Represents the area ratio>Representing the mean characteristic value>Expressed as natural constant->An exponential function of the base.
In the formula model of the optimal degree parameter, when the area ratio is different from the preset constant, namely the difference characteristic valueThe smaller the area ratio is, the closer to 1 is, the better the segmentation result under the current threshold value is reflected, and the difference is 0, soUse->Normalizing the sample; then when mean feature value->The larger each shape feature parameter, the greater the likelihood that the crack region obtained at the current threshold, i.e., the final defect region, is an actual crack. Thus->Smaller (less)>The larger at the same time->The greater the optimum degree parameter +.>The larger the current threshold, i.e. the better the segmentation effect.
So far, the optimal degree parameter of each threshold value can be obtained based on the above operation, and then the subsequent analysis process is completed.
Step S4: obtaining an optimal threshold according to the optimal degree parameters of all the thresholds; obtaining a segmentation result of the gray level image of the hard carbon electrode to be detected according to the optimal threshold value; and obtaining the quality of the hard carbon electrode to be detected according to the segmentation result.
After the optimal degree parameters of all the thresholds are obtained, the optimal thresholds can be obtained by comparing the optimal degree parameters.
Preferably, the method for acquiring the optimal threshold value in one embodiment of the present invention includes:
based on the analysis in step S3, it is known that, when the optimal degree parameter is larger, the segmentation effect of the current threshold is better, so in the embodiment of the present invention, the threshold corresponding to the maximum value of all the optimal degree parameters is used as the optimal threshold. It should be noted that if the optimal degree parameter of the plurality of thresholds occursIf the threshold value is the same, one of the threshold values is selected as the optimal threshold value.
After the optimal threshold value is obtained, the gray level image of the hard carbon electrode to be detected can be subjected to threshold segmentation by utilizing the optimal threshold value, so that a more accurate segmentation result is obtained, the cracks on the surface of the hard carbon electrode can be accurately and clearly displayed and identified, and if the cracks are detected on the surface of the hard carbon electrode, the hard carbon electrode is a defective product; if no crack exists, the hard carbon electrode is a qualified product, and the embodiment of the invention improves the reliability and accuracy of the quality detection of the hard carbon electrode by acquiring the optimal threshold value, and is convenient for analyzing the cause of crack generation according to the characteristics of the crack and then improving the production line.
In summary, according to the embodiment of the invention, through analyzing the gray level image of the hard carbon electrode to be detected, the connected domain of the image of the gray level image segmented under different thresholds is obtained, and then the connected domain is screened based on the gray level value characteristics of the defect region, so as to obtain the suspected defect region; because the connected domain may be interfered by noise during the process of obtaining the connected domain, further analysis of the connected domain is required to obtain an accurate final defect region. And then, as the actual crack area not only has obvious gray value characteristics, but also has thin and long shape characteristics, the shape characteristic parameters of the final defect area are obtained, and the shape characteristic parameters, the area of the final defect area and the area of the suspected defect area are combined to finish the evaluation of the optimal degree of the threshold value, namely, the optimal degree parameters of the threshold value are obtained. And then the optimal degree parameters of all the thresholds can be compared to obtain an optimal threshold, and then the segmentation of the gray level image is completed based on the optimal threshold, so that a precise segmentation result is obtained. And finally, the quality detection of the hard carbon electrode can be finished according to the accurate segmentation result, the reliability and the accuracy of the quality detection of the hard carbon electrode are improved, and meanwhile, the method is beneficial to analyzing the cause of crack generation according to the characteristics of the crack so as to improve the production line.
It should be noted that: the sequence of the embodiments of the present invention is only for description, and does not represent the advantages and disadvantages of the embodiments. The processes depicted in the accompanying drawings do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
In this specification, each embodiment is described in a progressive manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment mainly describes differences from other embodiments.

Claims (10)

1. A method for detecting the production quality of a hard carbon electrode, which is characterized by comprising the following steps:
acquiring a gray image of a hard carbon electrode to be detected;
acquiring a connected domain of the image of the gray image under different threshold segmentation; taking any threshold value as a target threshold value, and obtaining a suspected defect area according to the gray value of a pixel point in a corresponding area in the gray image of a connected area of the image under the target threshold value; obtaining a final defect region according to the difference of gray values of the edge pixel points of each suspected defect region and the neighborhood pixel points in the preset neighborhood;
obtaining shape characteristic parameters of the final defect areas according to the distribution of pixel points in each final defect area and the corresponding suspected defect area; obtaining an optimal degree parameter of the target threshold according to the area of the final defect area, the area of the suspected defect area and the shape characteristic parameter of the final defect area;
obtaining an optimal threshold according to the optimal degree parameters of all the thresholds; obtaining a segmentation result of the gray level image of the hard carbon electrode to be detected according to the optimal threshold; and obtaining the quality of the hard carbon electrode to be detected according to the segmentation result.
2. The method for detecting the production quality of a hard carbon electrode according to claim 1, wherein the method for acquiring the suspected defect region comprises:
acquiring a gray gradient value of each pixel point in the gray image;
taking the average value of the gray gradient values of all pixel points in the corresponding region of each connected region in the gray image as a first average gray gradient value, the variance of the gray values as a first gray variance, and the average value of the gray values as a first gray average;
taking the average value of the gray gradient values of all pixel points in the gray image as a second average gray gradient value, taking the variance of the gray values as a second gray variance and taking the average value of the gray values as a second gray average value;
and taking a corresponding region of a connected region with the first average gray gradient value larger than the second average gray gradient value, the first gray variance smaller than the second gray variance and the first gray mean smaller than the second gray mean in the gray image as a suspected defect region.
3. The method for detecting the production quality of the hard carbon electrode according to claim 2, wherein the method for acquiring the final defect region comprises the following steps:
taking any suspected defect area as a defect area to be detected;
taking the difference between the second gray average value and the first gray average value of the defect area to be detected as a gray difference value;
taking any edge pixel point in the defect area to be detected as an edge pixel point to be detected; and carrying out adjustment analysis on the edge pixel points to be detected according to the gray level difference value to obtain the final defect area.
4. The method for detecting the production quality of a hard carbon electrode according to claim 3, wherein the performing adjustment analysis on the edge pixel to be detected according to the gray level difference value to obtain the final defect area includes:
taking the difference of gray values of each neighborhood pixel point and the center pixel point as neighborhood gray difference in a preset neighborhood taking the edge pixel point to be detected as the center;
acquiring the minimum value of all the neighborhood gray level differences corresponding to the central pixel point, and if the minimum value is smaller than the gray level difference value, taking the neighborhood pixel point corresponding to the minimum value as an updated edge pixel point to be detected; continuing to perform adjustment analysis on the updated edge pixel points to be detected; if the minimum value is greater than or equal to the gray scale difference value, stopping adjusting analysis;
if all the edge pixel points to be detected are updated, the updated edge pixel points to be detected enclose the final defect area; otherwise, the non-updated edge pixel points to be detected and the updated edge pixel points enclose the final defect area.
5. The method for detecting the production quality of the hard carbon electrode according to claim 1, wherein the method for acquiring the shape characteristic parameter comprises the following steps:
taking any final defect area as a target area;
taking the centroid of the suspected defect area corresponding to the target area as a starting point to obtain a scribing line in a preset direction;
taking the number of intersection points of the scribing line and the target area as a first number of intersection points;
taking the number of intersection points of the scribing line and the suspected defect area corresponding to the target area as a second number of intersection points;
and taking the ratio of the first intersection number to the second intersection number as the shape characteristic parameter of the target area.
6. The method for detecting the production quality of the hard carbon electrode according to claim 1, wherein the method for acquiring the optimal degree parameter comprises the following steps:
adding the areas of all the final defect areas to obtain the total area of the final defect areas;
adding the areas of all the suspected defect areas to obtain the total area of the suspected defect areas;
taking the ratio of the total area of the final defect area to the total area of the suspected defect area as an area ratio;
taking the average value of the shape characteristic parameters of all the final defect areas as an average value characteristic value;
taking the difference between the area ratio and a preset constant as a difference characteristic value; and carrying out negative correlation mapping and normalization on the difference characteristic value, and multiplying the difference characteristic value by the mean characteristic value to serve as the optimal degree parameter.
7. The method for detecting the production quality of the hard carbon electrode according to claim 1, wherein the method for obtaining the optimal threshold value comprises the following steps:
and taking the threshold corresponding to the maximum value of all the optimal degree parameters as the optimal threshold.
8. The method for detecting the production quality of the hard carbon electrode according to claim 1, wherein the preset neighborhood is a four-neighborhood.
9. The method for detecting the production quality of a hard carbon electrode according to claim 5, wherein the preset direction is an eight-chain code direction.
10. The method for detecting the production quality of the hard carbon electrode according to claim 1, wherein the method for acquiring the gray scale image of the hard carbon electrode to be detected comprises the following steps:
and obtaining an initial image of the hard carbon electrode to be detected, and carrying out average method graying on the initial image to obtain the gray image of the hard carbon electrode to be detected.
CN202311082875.6A 2023-08-28 2023-08-28 Hard carbon electrode production quality detection method Active CN116843678B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311082875.6A CN116843678B (en) 2023-08-28 2023-08-28 Hard carbon electrode production quality detection method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311082875.6A CN116843678B (en) 2023-08-28 2023-08-28 Hard carbon electrode production quality detection method

Publications (2)

Publication Number Publication Date
CN116843678A true CN116843678A (en) 2023-10-03
CN116843678B CN116843678B (en) 2023-11-21

Family

ID=88167468

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311082875.6A Active CN116843678B (en) 2023-08-28 2023-08-28 Hard carbon electrode production quality detection method

Country Status (1)

Country Link
CN (1) CN116843678B (en)

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117274291A (en) * 2023-11-21 2023-12-22 深圳市京鼎工业技术股份有限公司 Method for detecting mold demolding residues based on computer vision
CN117291937A (en) * 2023-11-27 2023-12-26 山东嘉达装配式建筑科技有限责任公司 Automatic plastering effect visual detection system based on image feature analysis
CN117557573A (en) * 2024-01-12 2024-02-13 群亿光电(深圳)有限公司 OCA film bubble detection method based on computer vision
CN117635595A (en) * 2023-12-21 2024-03-01 松佳精密科技(东莞)有限公司 Visual detection method for surface quality of precision injection mold embryo
CN117745715A (en) * 2024-02-06 2024-03-22 中科院南京耐尔思光电仪器有限公司 Large-caliber telescope lens defect detection method based on artificial intelligence
CN117764992A (en) * 2024-02-22 2024-03-26 山东乔泰管业科技有限公司 Plastic pipe quality detection method based on image processing
CN117764990A (en) * 2024-02-22 2024-03-26 苏州悦昇精密机械制造有限公司 method for detecting stamping quality of chassis
CN117808801A (en) * 2024-02-29 2024-04-02 泰安大陆医疗器械有限公司 Visual detection method and system for steel needle row implantation
CN117824889A (en) * 2024-03-04 2024-04-05 杭州中为光电技术有限公司 Silicon rod internal force detection system, detection method and cutting method
CN117853487A (en) * 2024-03-07 2024-04-09 浙江合丰科技有限公司 FPC connector crack detection method and system based on image processing technology
CN118037718A (en) * 2024-04-11 2024-05-14 海门裕隆光电科技有限公司 Electrical terminal production defect detection method

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114235758A (en) * 2021-12-10 2022-03-25 苏州凌云视界智能设备有限责任公司 Defect detection method, device, equipment and storage medium
WO2022062812A1 (en) * 2020-09-28 2022-03-31 歌尔股份有限公司 Screen defect detection method, apparatus, and electronic device
CN114723701A (en) * 2022-03-31 2022-07-08 南通博莹机械铸造有限公司 Gear defect detection method and system based on computer vision
CN115100171A (en) * 2022-07-11 2022-09-23 常宝云 Steel die welding defect detection method and system based on machine vision
CN115345885A (en) * 2022-10-19 2022-11-15 南通鹏宝运动用品有限公司 Method for detecting appearance quality of metal fitness equipment
WO2023077404A1 (en) * 2021-11-05 2023-05-11 宁德时代新能源科技股份有限公司 Defect detection method, apparatus and system

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2022062812A1 (en) * 2020-09-28 2022-03-31 歌尔股份有限公司 Screen defect detection method, apparatus, and electronic device
WO2023077404A1 (en) * 2021-11-05 2023-05-11 宁德时代新能源科技股份有限公司 Defect detection method, apparatus and system
CN114235758A (en) * 2021-12-10 2022-03-25 苏州凌云视界智能设备有限责任公司 Defect detection method, device, equipment and storage medium
CN114723701A (en) * 2022-03-31 2022-07-08 南通博莹机械铸造有限公司 Gear defect detection method and system based on computer vision
CN115100171A (en) * 2022-07-11 2022-09-23 常宝云 Steel die welding defect detection method and system based on machine vision
CN115345885A (en) * 2022-10-19 2022-11-15 南通鹏宝运动用品有限公司 Method for detecting appearance quality of metal fitness equipment

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
王东;黎万义;孙佳;郝高明;王鹏;: "基于机器视觉的微小零件表面缺陷检测研究", 应用科技, no. 04 *

Cited By (21)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117274291B (en) * 2023-11-21 2024-02-13 深圳市京鼎工业技术股份有限公司 Method for detecting mold demolding residues based on computer vision
CN117274291A (en) * 2023-11-21 2023-12-22 深圳市京鼎工业技术股份有限公司 Method for detecting mold demolding residues based on computer vision
CN117291937A (en) * 2023-11-27 2023-12-26 山东嘉达装配式建筑科技有限责任公司 Automatic plastering effect visual detection system based on image feature analysis
CN117291937B (en) * 2023-11-27 2024-03-05 山东嘉达装配式建筑科技有限责任公司 Automatic plastering effect visual detection system based on image feature analysis
CN117635595B (en) * 2023-12-21 2024-04-09 松佳精密科技(东莞)有限公司 Visual detection method for surface quality of precision injection mold embryo
CN117635595A (en) * 2023-12-21 2024-03-01 松佳精密科技(东莞)有限公司 Visual detection method for surface quality of precision injection mold embryo
CN117557573A (en) * 2024-01-12 2024-02-13 群亿光电(深圳)有限公司 OCA film bubble detection method based on computer vision
CN117557573B (en) * 2024-01-12 2024-04-26 群亿光电(深圳)有限公司 OCA film bubble detection method based on computer vision
CN117745715A (en) * 2024-02-06 2024-03-22 中科院南京耐尔思光电仪器有限公司 Large-caliber telescope lens defect detection method based on artificial intelligence
CN117745715B (en) * 2024-02-06 2024-04-23 中科院南京耐尔思光电仪器有限公司 Large-caliber telescope lens defect detection method based on artificial intelligence
CN117764992B (en) * 2024-02-22 2024-04-30 山东乔泰管业科技有限公司 Plastic pipe quality detection method based on image processing
CN117764990A (en) * 2024-02-22 2024-03-26 苏州悦昇精密机械制造有限公司 method for detecting stamping quality of chassis
CN117764992A (en) * 2024-02-22 2024-03-26 山东乔泰管业科技有限公司 Plastic pipe quality detection method based on image processing
CN117764990B (en) * 2024-02-22 2024-05-17 苏州悦昇精密机械制造有限公司 Method for detecting stamping quality of chassis
CN117808801A (en) * 2024-02-29 2024-04-02 泰安大陆医疗器械有限公司 Visual detection method and system for steel needle row implantation
CN117808801B (en) * 2024-02-29 2024-05-17 泰安大陆医疗器械有限公司 Visual detection method and system for steel needle row implantation
CN117824889A (en) * 2024-03-04 2024-04-05 杭州中为光电技术有限公司 Silicon rod internal force detection system, detection method and cutting method
CN117853487A (en) * 2024-03-07 2024-04-09 浙江合丰科技有限公司 FPC connector crack detection method and system based on image processing technology
CN117853487B (en) * 2024-03-07 2024-05-14 浙江合丰科技有限公司 FPC connector crack detection method and system based on image processing technology
CN118037718A (en) * 2024-04-11 2024-05-14 海门裕隆光电科技有限公司 Electrical terminal production defect detection method
CN118037718B (en) * 2024-04-11 2024-07-02 海门裕隆光电科技有限公司 Electrical terminal production defect detection method

Also Published As

Publication number Publication date
CN116843678B (en) 2023-11-21

Similar Documents

Publication Publication Date Title
CN116843678B (en) Hard carbon electrode production quality detection method
Liu et al. Steel surface defect detection using a new Haar–Weibull-variance model in unsupervised manner
CN106595522B (en) A kind of error calibration method of optical grating projection three-dimension measuring system
CN116596936B (en) Solar wing sailboard quality detection method based on image data
CN117197141B (en) Method for detecting surface defects of automobile parts
CN115018844B (en) Plastic film quality evaluation method based on artificial intelligence
CN114494210A (en) Plastic film production defect detection method and system based on image processing
CN111415349B (en) Polyester filament yarn detection method based on image processing technology
CN115100206B (en) Printing defect identification method for textile with periodic pattern
CN115601368B (en) Sheet metal part defect detection method for building material equipment
CN117408995B (en) Power adapter appearance quality detection method based on multi-feature fusion
CN116152242B (en) Visual detection system of natural leather defect for basketball
CN116152262B (en) Method for detecting appearance defects of ionic intermediate film
CN116993726B (en) Mineral casting detection method and system
CN116523913B (en) Intelligent detection method for quality of screw rod
CN115018835B (en) Automobile starter gear detection method
CN114170165A (en) Chip surface defect detection method and device
CN115908362A (en) Method for detecting wear resistance of skateboard wheel
CN115546155A (en) Rivet size detection method based on machine vision
CN116402742A (en) Visual detection method and system for surface defects of automobile sheet metal part
CN117808799B (en) Chamfering equipment processing quality detection method based on artificial intelligence
CN116777911A (en) Double-substrate radiator surface defect detection system based on image recognition
CN117237747B (en) Hardware defect classification and identification method based on artificial intelligence
CN117437226A (en) Automatic on-line vision detection system for semiconductor processing quality
CN115115616B (en) Defect detection method for automobile stamping part based on variable light source

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CB03 Change of inventor or designer information

Inventor after: Yang Lijun

Inventor after: Tian Qishuai

Inventor after: Yang Kun

Inventor after: Yang Zegun

Inventor after: Si Hongyu

Inventor after: Sun Kang

Inventor after: Gao Hongchao

Inventor after: Yu Miaomiao

Inventor after: Luo Jingwen

Inventor before: Yang Lijun

Inventor before: Tian Qishuai

Inventor before: Yang Kun

Inventor before: Yang Zegun

Inventor before: Si Hongyu

Inventor before: Sun Kang

Inventor before: Gao Hongchao

Inventor before: Yu Miaomiao

Inventor before: Luo Wenjing

CB03 Change of inventor or designer information