CN114202541B - Cable defect detection method based on artificial intelligence - Google Patents

Cable defect detection method based on artificial intelligence Download PDF

Info

Publication number
CN114202541B
CN114202541B CN202210147194.2A CN202210147194A CN114202541B CN 114202541 B CN114202541 B CN 114202541B CN 202210147194 A CN202210147194 A CN 202210147194A CN 114202541 B CN114202541 B CN 114202541B
Authority
CN
China
Prior art keywords
value
cable
run
pixel value
probability
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.)
Active
Application number
CN202210147194.2A
Other languages
Chinese (zh)
Other versions
CN114202541A (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.)
Hubei Zhonghai Wire And Cable Co ltd
Original Assignee
Hubei Zhonghai Wire And Cable 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 Hubei Zhonghai Wire And Cable Co ltd filed Critical Hubei Zhonghai Wire And Cable Co ltd
Priority to CN202210147194.2A priority Critical patent/CN114202541B/en
Publication of CN114202541A publication Critical patent/CN114202541A/en
Application granted granted Critical
Publication of CN114202541B publication Critical patent/CN114202541B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

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
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • 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/136Segmentation; Edge detection involving thresholding
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10024Color image
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30108Industrial image inspection

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Data Mining & Analysis (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Evolutionary Biology (AREA)
  • Evolutionary Computation (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • General Engineering & Computer Science (AREA)
  • Artificial Intelligence (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Quality & Reliability (AREA)
  • Image Analysis (AREA)
  • Image Processing (AREA)

Abstract

The invention relates to the technical field of artificial intelligence, in particular to a cable defect detection method based on artificial intelligence. The method comprises the steps of collecting a cable image to obtain a cable area image; dividing the cable area image into a plurality of cable subareas, and acquiring the probability that the pixel value in each cable subarea is a skin-broken pixel value; confirming a target pixel value in each cable sub-area according to the probability, carrying out gray stretching on the target pixel value to obtain a cable area enhanced image, and carrying out threshold segmentation on the cable area enhanced image to obtain a skin-broken area. The target pixel value is confirmed according to the probability, gray stretching is carried out on the target pixel value, and stretching display can be carried out on the skin breaking pixel points in different regions more effectively, so that the pertinence is stronger, and the skin breaking defect detection is more accurate.

Description

Cable defect detection method based on artificial intelligence
Technical Field
The invention relates to the technical field of artificial intelligence, in particular to a cable defect detection method based on artificial intelligence.
Background
The cable is broken skin, and slight damage can make the cable current-carrying capacity reduce because of the corrosion of intaking, and more serious damage causes the electric leakage easily, causes the conflagration. The existing method for detecting the skin breaking is to perform gray level stretching of pixel points in a region by performing region division on a cable image so as to obtain an enhanced image, and perform threshold segmentation on the enhanced image so as to detect the skin breaking region.
The person skilled in the art finds that the prior art suffers from the following drawbacks: in the prior art, gray stretching is performed on pixels in a partition area, but the pixels with the similar gray values are actually distinguished, but the pixels with the similar gray values are not necessarily skin-breaking pixels, the method can lead the true skin-breaking pixels not to perform gray stretching, and only the background pixels to be stretched, so that the stretching effect is not obvious, the image enhancement effect is deviated, and the result of detecting the skin-breaking area is inaccurate.
Disclosure of Invention
In order to solve the above technical problems, the present invention aims to provide a cable defect detection method based on artificial intelligence, and the adopted technical scheme is as follows:
the embodiment of the invention provides a cable defect detection method based on artificial intelligence, which comprises the following specific steps:
acquiring a cable image, and performing semantic segmentation on the cable image to obtain a cable area image;
carrying out reverse graying on the cable region image so as to divide the cable region image into a plurality of cable sub-regions by utilizing multi-threshold segmentation, and calculating a gray level run matrix of each cable sub-region in different calculation directions, wherein the calculation directions comprise 0 degree, 45 degrees, 90 degrees and 135 degrees, and the vertical axis of the gray level run matrix represents a pixel value and the horizontal axis represents a run value; calculating a first probability that pixel values in the corresponding cable subareas are skin-broken pixel values according to the plurality of gray level run matrixes corresponding to each cable subarea; calculating the confidence coefficient of the pixel value in each cable subregion as a crust breaking pixel value by using a sliding window; combining the first probability and the confidence coefficient to obtain a second probability that the pixel value in the corresponding cable subregion is a crust breaking pixel value;
confirming a target pixel value in each cable sub-area according to the second probability, carrying out gray level stretching on the target pixel value to obtain a cable area enhanced image, and carrying out threshold segmentation on the cable area enhanced image to obtain a skin-broken area.
Further, the method for calculating the first probability that the pixel value in the corresponding cable sub-region is the crust breaking pixel value according to the plurality of gray level run matrixes corresponding to each cable sub-region includes:
expressing a plurality of gray level run matrixes of each cable subregion by using a direction run tree, wherein the direction run tree expresses that the gray level run matrixes obtained by corresponding one cable subregion to different calculation directions are expressed on a tree structure;
for each cable subregion, obtaining pixel values larger than a threshold value by an otsu threshold segmentation method, and taking the pixel values as high pixel values; dividing the run value corresponding to each high pixel value into a long run value and a short run value according to the run values of each pixel value in the direction run tree in different calculation directions;
and calculating the first probability of each high pixel value being a crust breaking pixel value according to the divided long run value and short run value.
Further, the method for dividing the run value corresponding to each high pixel value into the long run value and the short run value includes:
and acquiring a plurality of run values corresponding to any one high pixel value to obtain a maximum run value, setting a run value threshold according to the maximum run value, and taking the run value which is greater than or equal to the run value threshold as a long run value and the run value which is less than the run value threshold as a short run value.
Further, the method for calculating the first probability that each high pixel value is a crust breaking pixel value according to the divided long-run value and short-run value includes:
respectively counting run values of any one high pixel value in different calculation directions and the corresponding run value quantity based on a direction run tree, dividing all the run values of the high pixel value into a long run value and a short run value, obtaining the final probability that the high pixel value is a crust breaking pixel value in the two mutually perpendicular calculation directions according to the corresponding long run value and short run value in the two mutually perpendicular calculation directions and the corresponding run value quantity, and further selecting the final probability corresponding to the maximum value as the first probability that the high pixel value is the crust breaking pixel value according to a plurality of final probabilities corresponding to the plurality of mutually perpendicular calculation directions; the mutually perpendicular calculation directions include 0-90 degrees and 45-135 degrees.
Further, the method for obtaining the final probability that the high pixel value is the crust breaking pixel value in the two orthogonal calculation directions according to the long run value and the short run value respectively corresponding to the two orthogonal calculation directions and the corresponding run value number comprises:
calculating a first product of each short run value of any one high pixel value in the calculation direction of 0 degree and the corresponding run value number; calculating a second product of each long run value of the high pixel value in the 90-degree calculation direction and the quantity of the run values corresponding to the long run value, adding the second products corresponding to all the long run values in the 90-degree calculation direction to obtain a second product sum, and calculating the ratio of each first product to the second product sum respectively;
acquiring the second product sum corresponding to all the long run values in the calculation direction of 0 degree and the first product corresponding to each short run value in the calculation direction of 90 degrees, and respectively calculating the ratio of each first product to the second product sum;
and obtaining a plurality of ratios according to the mutually vertical calculation direction of 0-90 degrees, and taking the maximum ratio as the final probability that the high pixel value is the crust breaking pixel value.
Further, the method for calculating the confidence of the pixel value in each cable subregion being the crust breaking pixel value by using the sliding window comprises the following steps:
judging whether the pixel value of the corresponding center of each sliding window is a maximum value or not according to all the pixel values in the sliding windows, marking the pixel value if the pixel value is the maximum value, otherwise, not marking, finally calculating the ratio of the marked number of the pixel values to the total number of the pixel values in the corresponding cable subarea, and taking the ratio as the confidence coefficient that the pixel value belongs to the crust breaking pixel value in the cable subarea.
Further, the method for performing gray scale stretching on the target pixel value to obtain the cable region enhanced image includes:
for all target pixel values in any cable subregion, selecting a first target pixel value and a second target pixel value corresponding to the second probability which is the maximum value and the minimum value to obtain an original gray scale dynamic range of the target pixel values;
calculating the variance among all target pixel values in the original gray scale dynamic range, and acquiring the stretching gray scale dynamic range of the target pixel values in the corresponding cable subarea according to the variance;
and calculating corresponding stretched pixel values according to the original value of each target pixel value based on the stretching gray scale dynamic range to obtain a cable area enhanced image.
The embodiment of the invention at least has the following beneficial effects: the probability that each pixel value in the cable area image is the skin breaking pixel value is calculated, the target pixel value is confirmed according to the probability to conduct gray level stretching with the target pixel value, skin breaking pixel points in different cable area areas can be effectively displayed in a stretching mode, pertinence is high, and skin breaking defect detection is accurate.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions and advantages of the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and other drawings can be obtained by those skilled in the art without creative efforts.
FIG. 1 is a flowchart illustrating the steps of a method for detecting cable defects based on artificial intelligence according to an embodiment of the present invention;
fig. 2 is a schematic diagram illustrating a gray scale effect corresponding to a cable skin-broken area under different illumination according to an embodiment of the present invention;
fig. 3 is a schematic diagram of a skin-broken area in a corresponding cable sub-area at different gray levels provided in an embodiment of the present invention;
fig. 4 is a schematic diagram of a direction run tree according to an embodiment of the present invention.
Detailed Description
To further illustrate the technical means and effects of the present invention adopted to achieve the predetermined objects, the following detailed description of the cable defect detection method based on artificial intelligence according to the present invention, its specific implementation, structure, features and effects will be given with reference to the accompanying drawings and preferred embodiments. In the following description, different "one embodiment" or "another embodiment" refers to not necessarily the same embodiment. Furthermore, the particular features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.
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 describes a specific scheme of the cable defect detection method based on artificial intelligence in detail with reference to the accompanying drawings.
Referring to fig. 1, a flowchart illustrating steps of a cable defect detection method based on artificial intelligence according to an embodiment of the present invention is shown, where the method includes the following steps:
and S001, acquiring a cable image, and performing semantic segmentation on the cable image to obtain a cable area image.
Specifically, the method includes arranging a camera, collecting a cable image in a overlooking mode, and performing semantic segmentation on the cable image by using a DNN network to obtain a cable segmentation effect graph, where the specific training process of the DNN network is as follows:
(1) the data sets are acquired images of different cables.
(2) The process of labeling the training set with the corresponding labels is as follows: the pixel value of the pixel point corresponding to the background is marked as 0, and the pixel value of the pixel point corresponding to the cable is marked as 1.
(3) The loss function is a cross entropy loss function.
And multiplying the cable segmentation effect picture as a mask by the original picture to obtain a cable area image in the cable image.
Step S002, performing reverse graying on the cable region image to divide the cable region image into a plurality of cable sub-regions by utilizing multi-threshold segmentation, calculating gray level run matrices of each cable sub-region in different calculation directions, and calculating a first probability that a pixel value in the corresponding cable sub-region is a crust breaking pixel value according to the plurality of gray level run matrices corresponding to each cable sub-region; calculating the confidence coefficient of the pixel value in each cable subregion as a crust breaking pixel value by using a sliding window; and combining the first probability and the confidence coefficient to obtain a second probability that the pixel value in the corresponding cable subregion is the crust breaking pixel value.
Particularly, under the condition of uniform illumination, a better splitting effect of the skin breaking region can be obtained through threshold splitting; the skin break in the case of uneven illumination, as shown in fig. 2: in fig. 2, the dark regions in the left and right images represent skin-broken regions, which have similar original gray values, but the gray values of the skin-broken region and the background region are both larger due to uneven illumination, i.e., stronger illumination in the left image; in the right image, the illumination is weak, and the gray values of the skin-broken area and the background area are small, so that when the situation is faced, a better effect cannot be obtained by adopting global linear stretching to enhance the image, and therefore, the cable image is enhanced by utilizing area division in the embodiment of the invention, the specific process is as follows:
(1) since the cable area image is dark, and black is a background and white is a target in general, the cable area image is reversely grayed to obtain a cable gray scale image in order to meet normal thinking.
The formula for graying is:
Figure 953823DEST_PATH_IMAGE002
wherein,
Figure DEST_PATH_IMAGE003
the gray value of a pixel point in the cable area image is represented, R represents a red channel pixel value corresponding to the cable area image, G represents a green channel pixel value corresponding to the cable area image, and B represents a blue channel pixel value corresponding to the cable area image.
The calculation formula of the reverse graying is as follows:
Figure DEST_PATH_IMAGE005
wherein,
Figure 667701DEST_PATH_IMAGE006
for cable gray-scale imageThe gray value of the pixel point.
(2) And acquiring a gray level histogram of the cable gray level image, and performing multi-threshold segmentation on the cable gray level image according to the gray level histogram to obtain a plurality of different cable subregions. As shown in fig. 3, the squares and the ellipses respectively represent different illumination environments, and are represented by different gray scales, and the long rectangles represent cable sub-regions, and the pixel values in the cable sub-regions are greatly different due to the illumination.
(3) And calculating a gray level run matrix of each cable subregion in different calculation directions, wherein the vertical axis of the gray level run matrix represents a pixel value, and the horizontal axis of the gray level run matrix represents a run value.
In particular, the gray scale run matrix is recorded as
Figure DEST_PATH_IMAGE007
Wherein
Figure 713018DEST_PATH_IMAGE008
representing pixel values in a cable gray map,
Figure 875271DEST_PATH_IMAGE008
the value of (a) is the number of gray levels of the cable gray map,
Figure DEST_PATH_IMAGE009
indicating the length (run value) over which the pixel value has traveled, i.e. in the cable sub-area
Figure 220802DEST_PATH_IMAGE009
Is continuous
Figure 43264DEST_PATH_IMAGE008
It appears that the user has, at the time of the day,
Figure 575877DEST_PATH_IMAGE010
the calculation direction is indicated, and the calculation directions in the embodiment of the present invention are 0 degree, 45 degree, 90 degree, and 135 degree.
(4) And expressing the plurality of gray level run matrixes of each cable subregion by using a direction run tree, and calculating a first probability that the pixel value in each cable subregion is a bark-broken pixel value based on the direction run tree.
Specifically, the direction run-length tree represents gray run-length matrixes obtained in different directions corresponding to the cable sub-regions on a tree structure, and one cable sub-region corresponds to one direction run-length tree. Referring to fig. 4, the root node a of the direction run tree represents different cable sub-regions, and the root node a is used as the level 1 node of the tree structure; layer 2 nodes represent different pixel values; the level 3 nodes represent left and right subtrees of different pixel values, with the left subtree representing 0 and 90 degree directions and the right subtree representing 45 and 135 degree directions; the level 4 nodes represent different directions; the nodes after the fifth layer represent the number of run values corresponding to the run value.
When the cable has a skin-breaking condition, the pixel value corresponding to the skin-breaking is large, the long run values in the skin-breaking direction are large, the short run values in the vertical direction are large, and the number of the long run values and the short run values is close, then the first probability that the pixel value is the skin-breaking pixel value is calculated according to the long run values corresponding to two mutually perpendicular directions of each pixel value, and the specific process is as follows:
(1) for each cable subregion, pixel values greater than the threshold are obtained by an otsu threshold segmentation method, and the pixel values are taken as high pixel values.
(2) And dividing the run value corresponding to each high pixel value into a long run value and a short run value according to the run values of each pixel value in the direction run tree in different calculation directions.
Specifically, taking a high pixel value as an example, a plurality of run values corresponding to the high pixel value are obtained to obtain a maximum run value S, and a run value threshold is set
Figure DEST_PATH_IMAGE011
Will be greater than or equal to the run value threshold
Figure 305935DEST_PATH_IMAGE012
As long-run values, less than a run-value threshold
Figure 974814DEST_PATH_IMAGE012
As a short run value. And dividing the run value corresponding to each high pixel value into a long run value and a short run value.
(3) And calculating the first probability of each high pixel value being a crust breaking pixel value according to the divided long run value and short run value.
Specifically, taking a high pixel value as an example, respectively counting the run values of the high pixel value in different calculation directions (0 degree, 45 degrees, 90 degrees and 135 degrees) and the corresponding run value numbers based on a direction run tree, dividing all the run values into long run values and short run values by using the step (2), obtaining the final probability that the high pixel value is a crust breaking pixel value in the mutually perpendicular calculation directions according to the long run values and the short run values respectively corresponding to the two mutually perpendicular calculation directions and the corresponding run value numbers, and further selecting the final probability corresponding to the maximum value as the first probability that the high pixel value is a crust breaking pixel value according to a plurality of final probabilities corresponding to a plurality of mutually perpendicular calculation directions
Figure DEST_PATH_IMAGE014A
It should be noted that the embodiment of the present invention has two mutually perpendicular calculation directions, i.e., 0-90 degrees and 45-135 degrees.
The method for obtaining the final probability of the high pixel value in each mutually perpendicular calculation direction comprises the following steps: taking 0-90 degrees as an example, calculating each short run value of any one high pixel value in the calculation direction of 0 degree
Figure DEST_PATH_IMAGE015
And the number of its corresponding run values
Figure 764916DEST_PATH_IMAGE016
The first product of (A) is
Figure DEST_PATH_IMAGE017
Simultaneously calculating each long run value of the high pixel value in the 90 degree calculation direction
Figure 50403DEST_PATH_IMAGE018
Number of run values corresponding thereto
Figure 787415DEST_PATH_IMAGE016
Second product of
Figure DEST_PATH_IMAGE019
Adding the second products corresponding to all the long-run values in the 90-degree calculation direction to obtain the sum of the second products
Figure 841959DEST_PATH_IMAGE020
Calculating the ratio between each first product and the sum of the second products
Figure 537382DEST_PATH_IMAGE022
(ii) a Similarly, the second product sum corresponding to all the long-run values in the calculation direction of 0 degree and the first product corresponding to each short-run value in the calculation direction of 90 degrees are obtained, the ratio between each first product sum and the second product sum is respectively calculated, a plurality of ratios are obtained in the calculation direction of 0-90 degrees which is perpendicular to each other, and the maximum ratio is used as the final probability that the high pixel value is the crust breaking pixel value.
And further traversing each cable subregion by adopting a sliding window with the size of 3 x 3, wherein the moving step length of the sliding window is 1, judging whether the pixel value of the corresponding center of each sliding window is a maximum value according to all pixel values in the sliding window, marking the pixel value if the pixel value is the maximum value, or not marking, finally calculating the ratio between the marked number of the pixel values and the total number of the pixel values in the corresponding cable subregion, and taking the ratio as the confidence coefficient that each pixel value belongs to the crust breaking pixel value in the cable subregion, thereby being capable of taking the confidence coefficient that each pixel value in the cable subregion is the crust breaking pixel value.
Since each high pixel value in each cable subregion in the cable region image corresponds to a first probability and a confidence, the product between the first probability and the confidence is calculated as the second probability of each high pixel value in each cable subregion.
And S003, confirming a target pixel value in each cable sub-area according to the second probability, carrying out gray level stretching on the target pixel value to obtain a cable area enhanced image, and carrying out threshold segmentation on the cable area enhanced image to obtain a skin-broken area.
Specifically, a second probability threshold is set, and a high pixel value corresponding to the second probability greater than the second probability threshold is used as the target pixel value. Wherein the second probability threshold is obtained on a condition that the first probability is greater than the first probability threshold and the confidence is greater than the confidence threshold.
Preferably, in the embodiment of the present invention, the first probability threshold is 0.7, and the confidence threshold is 0.7.
Further, performing gray stretching on the target pixel value in each cable subregion, wherein the specific method comprises the following steps:
(1) according to all target pixel values of any cable subregion, selecting a first target pixel value corresponding to the maximum value and the minimum value of the second probability
Figure DEST_PATH_IMAGE023
And a second target pixel value
Figure 44587DEST_PATH_IMAGE024
I.e. the original gray scale dynamic range of the target pixel value in the cable sub-area is
Figure DEST_PATH_IMAGE025
Calculating the variance between all target pixel values from the first target pixel value to the second target pixel value
Figure 585290DEST_PATH_IMAGE026
And obtaining a stretching gray scale dynamic range after stretching the target pixel value in the corresponding cable sub-region according to the variance
Figure DEST_PATH_IMAGE027
Then, the calculation formula of the dynamic range of the stretching gray scale is as follows:
Figure DEST_PATH_IMAGE029
(2) stretching gray scale dynamic range based on target pixel value correspondence
Figure 535752DEST_PATH_IMAGE027
And calculating a corresponding stretched pixel value according to the original value of the target pixel value, wherein the first stretching formula is as follows:
Figure DEST_PATH_IMAGE031
wherein,
Figure 136498DEST_PATH_IMAGE032
is the stretched pixel value;
Figure 130999DEST_PATH_IMAGE016
the pixel values before stretching.
(3) And (3) performing corresponding gray stretching on the target pixel values in all the cable subareas by using the step (1) and the step (2).
Further, for other pixel values in each cable subregion, embodiments of the present invention base the original gray scale dynamic range of the target pixel value
Figure 475393DEST_PATH_IMAGE025
And stretching the grayscale dynamic range
Figure 973370DEST_PATH_IMAGE027
And (3) performing gray scale stretching or compression on the residual pixel values, wherein the specific process is as follows:
(1) the original pixel value range of all pixel values in any cable subregion is counted as
Figure DEST_PATH_IMAGE033
When the maximum pixel value in the cable subregion is equal to the second target pixel value
Figure 276175DEST_PATH_IMAGE024
When is at time
Figure 492393DEST_PATH_IMAGE034
=
Figure 374898DEST_PATH_IMAGE024
Less than the first target pixel value in the cable subregion
Figure 992962DEST_PATH_IMAGE023
The pixel value of (a) corresponds to a dynamic range of the stretching gray scale of
Figure DEST_PATH_IMAGE035
The corresponding second stretching formula is:
Figure DEST_PATH_IMAGE037
wherein,
Figure 466668DEST_PATH_IMAGE038
is the minimum pixel value within the cable subregion.
(2) Maximum pixel value in cable subregion
Figure 170182DEST_PATH_IMAGE034
Greater than the second target pixel value
Figure 856378DEST_PATH_IMAGE024
And a stretched gray scale dynamic range of the target pixel value
Figure 594527DEST_PATH_IMAGE027
In the range of original pixel values
Figure 707977DEST_PATH_IMAGE033
When the pixel value is within the range, the pixel value is larger than the second target pixel value in the cable subregion
Figure 898787DEST_PATH_IMAGE024
Image ofThe dynamic range of the stretching gray scale corresponding to the pixel value is
Figure DEST_PATH_IMAGE039
The corresponding third stretching formula is:
Figure DEST_PATH_IMAGE041
further, a cable region enhanced image is obtained by stretching a target pixel value in the cable region image, and otsu threshold segmentation is performed on the cable region enhanced image to obtain a skin-broken region.
In summary, the embodiment of the present invention provides a cable defect detection method based on artificial intelligence, which acquires a cable image to obtain a cable area image; dividing the cable area image into a plurality of cable subareas, and acquiring the probability that the pixel value in each cable subarea is a skin-broken pixel value; confirming a target pixel value in each cable sub-area according to the probability, carrying out gray stretching on the target pixel value to obtain a cable area enhanced image, and carrying out threshold segmentation on the cable area enhanced image to obtain a skin-broken area. The target pixel value is confirmed according to the probability, gray stretching is carried out on the target pixel value, and stretching display can be carried out on the skin breaking pixel points in different regions more effectively, so that the pertinence is stronger, and the skin breaking defect detection is more accurate.
It should be noted that: the precedence order of the above embodiments of the present invention is only for description, and does not represent the merits of the embodiments. And specific embodiments thereof have been described above. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims may be performed in a different order than in the embodiments and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing may also be possible or may be advantageous.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like that fall within the spirit and principle of the present invention are intended to be included therein.

Claims (3)

1. A cable defect detection method based on artificial intelligence is characterized by comprising the following steps:
acquiring a cable image, and performing semantic segmentation on the cable image to obtain a cable area image;
carrying out reverse graying on the cable region image so as to divide the cable region image into a plurality of cable sub-regions by utilizing multi-threshold segmentation, and calculating a gray level run matrix of each cable sub-region in different calculation directions, wherein the calculation directions comprise 0 degree, 45 degrees, 90 degrees and 135 degrees, and the vertical axis of the gray level run matrix represents a pixel value and the horizontal axis represents a run value; calculating a first probability that pixel values in the corresponding cable subareas are skin-broken pixel values according to the plurality of gray level run matrixes corresponding to each cable subarea; calculating the confidence coefficient of the pixel value in each cable subregion as a crust breaking pixel value by using a sliding window; combining the first probability and the confidence coefficient to obtain a second probability that the pixel value in the corresponding cable subregion is a crust breaking pixel value;
confirming a target pixel value in each cable sub-area according to the second probability, carrying out gray level stretching on the target pixel value to obtain a cable area enhanced image, and carrying out threshold segmentation on the cable area enhanced image to obtain a skin breaking area;
the method for calculating the first probability that the pixel value in the corresponding cable subregion is the crust breaking pixel value according to the plurality of gray level run matrixes corresponding to each cable subregion comprises the following steps:
expressing a plurality of gray level run matrixes of each cable subregion by using a direction run tree, wherein the direction run tree expresses that the gray level run matrixes obtained by corresponding one cable subregion to different calculation directions are expressed on a tree structure, and a root node of the tree structure expresses the cable subregion and a layer 2 node expresses different pixel values; the level 3 nodes represent left and right subtrees of different pixel values, the left subtree representing the calculation directions of 0 degrees and 90 degrees, and the right subtree representing the calculation directions of 45 degrees and 135 degrees; the nodes of the 4 th layer represent different calculation directions; the nodes after the fifth layer represent the number of run values corresponding to the run values;
for each cable subregion, obtaining pixel values larger than a threshold value by an otsu threshold segmentation method, and taking the pixel values as high pixel values; dividing the run value corresponding to each high pixel value into a long run value and a short run value according to the run values of each pixel value in the direction run tree in different calculation directions;
calculating a first probability that each high pixel value is a crust breaking pixel value according to the divided long run value and short run value, wherein the calculation method comprises the following steps:
respectively counting run values of any one high pixel value in different calculation directions and the corresponding run value quantity based on a direction run tree, dividing all the run values of the high pixel value into a long run value and a short run value, obtaining the final probability that the high pixel value is a crust breaking pixel value in the two mutually perpendicular calculation directions according to the corresponding long run value and short run value in the two mutually perpendicular calculation directions and the corresponding run value quantity, and further selecting the final probability corresponding to the maximum value as the first probability that the high pixel value is the crust breaking pixel value according to a plurality of final probabilities corresponding to the plurality of mutually perpendicular calculation directions; the mutually perpendicular calculation directions include 0-90 degrees and 45-135 degrees;
the method for obtaining the final probability that the high pixel value is the crust breaking pixel value in the two mutually perpendicular calculation directions according to the long run value and the short run value respectively corresponding to the two mutually perpendicular calculation directions and the corresponding run value quantity comprises the following steps:
calculating a first product of each short run value of any one high pixel value in the calculation direction of 0 degree and the corresponding run value number; calculating a second product of each long run value of the high pixel value in the 90-degree calculation direction and the quantity of the run values corresponding to the long run value, adding the second products corresponding to all the long run values in the 90-degree calculation direction to obtain a second product sum, and calculating the ratio of each first product to the second product sum respectively;
acquiring the second product sum corresponding to all the long run values in the calculation direction of 0 degree and the first product corresponding to each short run value in the calculation direction of 90 degrees, and respectively calculating the ratio of each first product to the second product sum;
obtaining a plurality of ratios according to the mutually vertical calculation direction of 0-90 degrees, and taking the maximum ratio as the final probability that the high pixel value is the crust breaking pixel value;
the method for calculating the confidence coefficient that the pixel value in each cable subregion is a crust breaking pixel value by using the sliding window comprises the following steps:
judging whether the pixel value of the center corresponding to each sliding window is a maximum value or not according to all the pixel values in the sliding windows, if so, marking the pixel value, otherwise, not marking, finally calculating the ratio of the marked number of the pixel values to the total number of the pixel values in the corresponding cable subarea, and taking the ratio as the confidence coefficient that the pixel value belongs to the crust breaking pixel value in the cable subarea;
the method for obtaining the second probability that the pixel value in the corresponding cable subregion is the crust breaking pixel value by combining the first probability and the confidence coefficient comprises the following steps:
calculating a product between the first probability and the confidence as a second probability of the crust breaking pixel value;
the method for confirming the target pixel value in each cable subregion by the second probability comprises the following steps:
and setting a second probability threshold value, and taking a high pixel value corresponding to the second probability greater than the second probability threshold value as a target pixel value.
2. The method for cable defect detection based on artificial intelligence as claimed in claim 1, wherein said method for dividing the run value corresponding to each high pixel value into long run value and short run value comprises:
and acquiring a plurality of run values corresponding to any one high pixel value to obtain a maximum run value, setting a run value threshold according to the maximum run value, and taking the run value which is greater than or equal to the run value threshold as a long run value and the run value which is less than the run value threshold as a short run value.
3. The method for artificial intelligence based cable defect detection as claimed in claim 1, wherein said gray scale stretching the target pixel values to obtain the enhanced image of the cable region comprises:
for all target pixel values in any cable subregion, selecting a first target pixel value and a second target pixel value corresponding to the second probability which is the maximum value and the minimum value to obtain an original gray scale dynamic range of the target pixel values;
calculating the variance among all target pixel values in the original gray scale dynamic range, and acquiring the stretching gray scale dynamic range of the target pixel values in the corresponding cable subarea according to the variance;
and calculating corresponding stretched pixel values according to the original value of each target pixel value based on the stretching gray scale dynamic range to obtain a cable area enhanced image.
CN202210147194.2A 2022-02-17 2022-02-17 Cable defect detection method based on artificial intelligence Active CN114202541B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210147194.2A CN114202541B (en) 2022-02-17 2022-02-17 Cable defect detection method based on artificial intelligence

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210147194.2A CN114202541B (en) 2022-02-17 2022-02-17 Cable defect detection method based on artificial intelligence

Publications (2)

Publication Number Publication Date
CN114202541A CN114202541A (en) 2022-03-18
CN114202541B true CN114202541B (en) 2022-04-29

Family

ID=80645625

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210147194.2A Active CN114202541B (en) 2022-02-17 2022-02-17 Cable defect detection method based on artificial intelligence

Country Status (1)

Country Link
CN (1) CN114202541B (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114638833B (en) * 2022-05-20 2022-07-26 海门市博洋铸造有限公司 Non-ferrous metal calendering quality detection method and system based on machine vision
CN114842009B (en) * 2022-07-04 2022-09-16 江苏奥派电气科技有限公司 Cable defect detection optimization method based on gray level run matrix
CN114882387B (en) * 2022-07-12 2022-09-16 江苏宝诺铸造有限公司 Bearing raceway bruise identification and automatic polishing positioning method in grinding process
CN115082418B (en) * 2022-07-14 2022-11-04 山东聊城富锋汽车部件有限公司 Precise identification method for automobile parts
CN114998313B (en) * 2022-07-18 2022-10-21 山东海鑫达石油机械有限公司 Fluid conveying pipe orifice burr identification and positioning method based on visual positioning
CN116912234B (en) * 2023-09-06 2023-11-28 青岛理研电线电缆有限公司 Cable stranded wire quality detection method based on image features
CN118196106B (en) * 2024-05-20 2024-07-23 浙江泰嘉和电器有限公司 Image detection method, device and medium for circuit breaker conductive system

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2005039884A1 (en) * 2003-10-22 2005-05-06 Brother Kogyo Kabushiki Kaisha Image processing device, image processing method, recording medium, and program
CN105096325A (en) * 2015-08-05 2015-11-25 彭晓梅 Underwater equipment detection system based on laser image
CN110119677A (en) * 2019-03-28 2019-08-13 东南大学 Carbon fiber composite core cable damage testing method based on image classification network
CN114049489A (en) * 2022-01-13 2022-02-15 山东鹰联光电科技股份有限公司 Early warning method for breakage of optical fiber cable sheath

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2005039884A1 (en) * 2003-10-22 2005-05-06 Brother Kogyo Kabushiki Kaisha Image processing device, image processing method, recording medium, and program
CN105096325A (en) * 2015-08-05 2015-11-25 彭晓梅 Underwater equipment detection system based on laser image
CN110119677A (en) * 2019-03-28 2019-08-13 东南大学 Carbon fiber composite core cable damage testing method based on image classification network
CN114049489A (en) * 2022-01-13 2022-02-15 山东鹰联光电科技股份有限公司 Early warning method for breakage of optical fiber cable sheath

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
一种基于游程码的并行区域标记算法;陆克中等;《计算机工程与应用》;20080601(第16期);全文 *
基于影像组学的肺结节恶性程度预测;杨春然等;《肿瘤影像学》;20170428(第02期);全文 *

Also Published As

Publication number Publication date
CN114202541A (en) 2022-03-18

Similar Documents

Publication Publication Date Title
CN114202541B (en) Cable defect detection method based on artificial intelligence
CN110544258B (en) Image segmentation method and device, electronic equipment and storage medium
CN113034358B (en) Super-resolution image processing method and related device
CN106846339A (en) Image detection method and device
CN110399842B (en) Video processing method and device, electronic equipment and computer readable storage medium
CN111291826A (en) Multi-source remote sensing image pixel-by-pixel classification method based on correlation fusion network
CN115457004A (en) Intelligent detection method of zinc paste based on computer vision
CN112989995B (en) Text detection method and device and electronic equipment
CN112348809A (en) No-reference screen content image quality evaluation method based on multitask deep learning
CN115937626A (en) Automatic generation method of semi-virtual data set based on instance segmentation
CN115423795A (en) Static frame detection method, electronic device and storage medium
CN113269747B (en) Pathological image liver cancer diffusion detection method and system based on deep learning
CN107292892B (en) Video frame image segmentation method and device
CN113965814A (en) Multi-meeting-place key frame extraction method and system based on video meeting scene
CN109242750B (en) Picture signature method, picture matching method, device, equipment and storage medium
CN112995666B (en) Video horizontal and vertical screen conversion method and device combined with scene switching detection
CN112560929B (en) Oil spilling area determining method and device and storage medium
CN115546141A (en) Small sample Mini LED defect detection method and system based on multi-dimensional measurement
CN110458223B (en) Automatic detection method and detection system for bronchial tumor under endoscope
CN113781429A (en) Defect classification method and device for liquid crystal panel, electronic equipment and storage medium
CN108596893B (en) Image processing method and system
CN111179226A (en) Visual field map identification method and device and computer storage medium
CN108416768A (en) One kind being based on binary foreground picture similarity evaluating method
CN113610839B (en) Infrared target significance detection method, device, electronic equipment and medium
CN112712004B (en) Face detection system, face detection method and device and electronic equipment

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
PE01 Entry into force of the registration of the contract for pledge of patent right
PE01 Entry into force of the registration of the contract for pledge of patent right

Denomination of invention: Artificial intelligence based cable defect detection method

Granted publication date: 20220429

Pledgee: China Postal Savings Bank Co.,Ltd. Wuhan Branch

Pledgor: Hubei Zhonghai wire and cable Co.,Ltd.

Registration number: Y2024980013751