CN114937039B - Intelligent detection method for steel pipe defects - Google Patents

Intelligent detection method for steel pipe defects Download PDF

Info

Publication number
CN114937039B
CN114937039B CN202210858986.0A CN202210858986A CN114937039B CN 114937039 B CN114937039 B CN 114937039B CN 202210858986 A CN202210858986 A CN 202210858986A CN 114937039 B CN114937039 B CN 114937039B
Authority
CN
China
Prior art keywords
edge
target
steel pipe
pixel points
area
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
CN202210858986.0A
Other languages
Chinese (zh)
Other versions
CN114937039A (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.)
Afaron Shandong Technology Co ltd
Original Assignee
Afaron Shandong Technology 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 Afaron Shandong Technology Co ltd filed Critical Afaron Shandong Technology Co ltd
Priority to CN202210858986.0A priority Critical patent/CN114937039B/en
Publication of CN114937039A publication Critical patent/CN114937039A/en
Application granted granted Critical
Publication of CN114937039B publication Critical patent/CN114937039B/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
    • 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
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/764Arrangements for image or video recognition or understanding using pattern recognition or machine learning using classification, e.g. of video objects
    • 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/10004Still image; Photographic image
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/30Computing systems specially adapted for manufacturing

Abstract

The invention relates to the technical field of image processing, in particular to an intelligent detection method for steel pipe defects. The method comprises the following steps: obtaining a salient region to be selected in the surface image of the steel pipe to be detected according to the obtained salient image corresponding to the surface image of the steel pipe to be detected; classifying all to-be-selected significant pixel points in the to-be-selected significant region to obtain all growth sets; selecting growth sets with the number of to-be-selected significant pixel points in each growth set larger than or equal to a second threshold value, and recording as target growth sets; obtaining a scab area and a contour edge of the scab area in the surface image of the steel pipe to be detected according to the number of the to-be-selected significant pixel points in each target growth set; acquiring a target edge image corresponding to a surface image of a steel pipe to be detected; and obtaining a crease defect area and a scratch defect area according to each edge line in the target edge image. The invention realizes more accurate detection of various defects on the surface of the steel pipe with lower cost.

Description

Intelligent detection method for steel pipe defects
Technical Field
The invention relates to the technical field of image processing, in particular to an intelligent detection method for steel pipe defects.
Background
The steel pipe is a metal part which plays roles of connection, control, diversion, sealing, support and the like in a pipeline system, and the defects on the surface of the steel pipe not only affect the aesthetic property of the steel pipe, but also affect the morphological structure of the steel pipe. Because different and similar defects appear on the surface of the steel pipe, the detection difficulty of the surface of the steel pipe is increased, a large number of training sets and test sets are required for the detection of the surface of the steel pipe by adopting a neural network in the prior art, and the requirement on hardware of a detection system is high; the neural network can only detect the most obvious defects in the image but cannot detect the defects of various mashups existing in the image; therefore, how to rapidly and accurately detect various defects on the surface of the steel pipe at low cost is a problem to be solved.
Disclosure of Invention
In order to solve the above problems, the invention aims to provide an intelligent detection method for steel pipe defects, which adopts the following technical scheme:
the invention provides an intelligent detection method for steel pipe defects, which comprises the following steps:
acquiring a surface image of a steel pipe to be detected;
acquiring a saliency map corresponding to the surface image of the steel pipe to be detected; obtaining a to-be-selected significant region in the to-be-detected steel pipe surface image according to the significant value corresponding to each pixel point in the significant image, wherein the to-be-selected significant region comprises each to-be-selected significant pixel point in the to-be-detected steel pipe surface image;
classifying all to-be-selected significant pixel points in the to-be-selected significant region to obtain all growth sets, wherein each growth set comprises all to-be-selected significant pixel points belonging to the growth set; selecting growth sets with the number of the significant pixel points to be selected in each growth set larger than or equal to a second threshold value, and recording as target growth sets; obtaining a scab area and a contour edge of the scab area in the surface image of the steel pipe to be detected according to the number of the to-be-selected significant pixel points in each target growth set;
processing the surface image of the steel pipe to be detected to obtain a corresponding target edge image, wherein the target edge image does not include edge lines corresponding to the contour edge of the scab area; and obtaining a crease defect area and a scratch defect area according to each edge line in the target edge image.
Preferably, acquiring a saliency map corresponding to the surface image of the steel pipe to be detected; obtaining a salient region to be selected in the surface image of the steel pipe to be detected according to the salient value corresponding to each pixel point in the salient map, wherein the salient region to be selected comprises:
processing the surface image of the steel pipe to be detected by using a visual saliency algorithm to obtain a saliency map corresponding to the surface image of the steel pipe to be detected;
obtaining an optimal segmentation threshold according to the saliency value corresponding to each pixel point in the saliency map and the Otsu method;
marking the pixel points with the significant values larger than the optimal segmentation threshold value in the significant graph as the significant pixel points to be selected, and marking the set formed by the significant pixel points to be selected as the significant pixel point set to be selected;
marking the pixel points with the significant value less than or equal to the optimal segmentation threshold value in the significant graph as non-significant pixel points, and marking a set formed by all the non-significant pixel points as a non-significant pixel point set;
calculating the ratio of the average value of the significant values corresponding to all the pixels in the to-be-selected significant pixel point set to the average value of the significant values corresponding to all the pixels in the non-significant pixel point set;
if the ratio is smaller than or equal to a first threshold value, judging that no scab defect exists in the surface image of the steel pipe to be detected;
if the ratio is larger than the first threshold, marking the pixel points corresponding to the pixel points in the to-be-selected significant pixel point set in the to-be-detected steel pipe surface image as to-be-selected significant pixel points, and marking the region formed by the to-be-selected significant pixel points in the to-be-detected steel pipe surface image as to-be-selected significant region.
Preferably, the classifying each to-be-selected significant pixel point in the to-be-selected significant region to obtain each growth set includes:
extracting straight lines in the salient region to be selected by utilizing Hough straight line detection to obtain all straight lines existing in the salient region to be selected;
processing each straight line existing in the salient region to be selected to obtain a straight line region corresponding to each straight line;
marking the pixel points in the linear area corresponding to each straight line as linear pixel points; removing straight line pixel points existing in the salient region to be selected, and recording the remaining salient region to be selected as a target salient region to be selected;
taking any one to-be-selected significant pixel point in the target to-be-selected significant region as an initial growth point, judging whether to have the to-be-selected significant pixel point belonging to the target to-be-selected significant region in a window with the size of 5 multiplied by 5 and taking the initial growth point as a center, and if so, merging the to-be-selected significant pixel point in the window into a first growth set; respectively taking other to-be-selected significant pixel points except the initial growth point in the window corresponding to the initial growth point as new initial growth points, judging whether to-be-selected significant pixel points belonging to a target to-be-selected significant region exist in the window with the size of 5 multiplied by 5 corresponding to the new initial growth point, if so, merging the to-be-selected significant pixel points in the window into a first growth set, continuing to grow, and if not, stopping growing to obtain a first growth set; and by analogy, selecting any one of the to-be-selected significant pixel points outside the first growth set in the target to-be-selected significant region as a new initial growth point, and growing until all the to-be-selected significant pixel points in the target to-be-selected significant region are traversed completely to obtain all the growth sets.
Preferably, processing each straight line existing in the to-be-selected significant region to obtain a straight line region corresponding to each straight line includes:
for any straight line:
the equation corresponding to the straight line is
Figure 611527DEST_PATH_IMAGE001
Wherein x is the abscissa of the pixel, y is the ordinate of the pixel,
Figure 279138DEST_PATH_IMAGE002
is the minimum value of the abscissa corresponding to each pixel point on the straight line,
Figure 509262DEST_PATH_IMAGE003
is the maximum value of the abscissa corresponding to each pixel point on the straight line, k is the slope corresponding to the straight line, and b is the intercept corresponding to the straight line;
respectively setting two straight lines parallel to the straight line, and marking as a first straight line and a second straight line; the equation of the first line is
Figure 553310DEST_PATH_IMAGE004
The equation of the second line is
Figure 185280DEST_PATH_IMAGE005
Wherein
Figure 23792DEST_PATH_IMAGE006
Connecting the end points of the first straight line and the second straight line, and recording the formed area as a straight line area corresponding to the straight line;
the above-mentioned
Figure 741212DEST_PATH_IMAGE007
The obtaining method comprises the following steps:
will be provided with
Figure 995476DEST_PATH_IMAGE007
Increasing from 0 by 2 each time until the proportion of the pixels which are not to-be-selected significant pixels in the pixels contained in the region which is increased more before the increase is larger than the proportion threshold value, and taking the value which finally meets the condition as the value
Figure 75427DEST_PATH_IMAGE007
The value of (c).
Preferably, obtaining a scar area and a contour edge of the scar area in the surface image of the steel pipe to be detected according to the number of the to-be-selected significant pixel points in each target growth set includes:
for any target growth set:
acquiring a maximum vertical coordinate and a minimum vertical coordinate according to coordinates corresponding to each to-be-selected significant pixel point in the target growth set;
obtaining the area of the corresponding region of the target growth set in the surface image of the steel pipe to be detected according to the coordinates of each to-be-selected significant pixel point in the target growth set, and recording the area as the area of the corresponding region of the target growth set;
for any ordinate in the target growth set between the maximum and minimum ordinates: taking the to-be-selected significant pixel point with the maximum abscissa and the to-be-selected significant pixel point with the minimum abscissa in the to-be-selected significant pixel points corresponding to the ordinate in the target growth set as boundary pixel points of the region corresponding to the target growth set;
connecting boundary pixel points of the region corresponding to the target growth set by adopting an interpolation method to obtain the edge of the region corresponding to the target growth set;
calculating the ratio of the number of the to-be-selected significant pixels corresponding to the target growth set to the area of the region corresponding to the target growth set, and taking the ratio as the density of the region corresponding to the target growth set;
if the density of the area corresponding to the target growth set is less than or equal to a third threshold value, judging that the area corresponding to the target growth set is not a scab area; if the density of the area corresponding to the target growth set is larger than a third threshold value, the area corresponding to the target growth set is judged to be a scab area, and the edge of the area corresponding to the target growth set in the surface image of the steel pipe to be detected is used as the outline edge of the scab area.
Preferably, the area of the region corresponding to the target growth set is calculated by the following formula:
Figure 84841DEST_PATH_IMAGE008
wherein S is the area of the region corresponding to the target growth set,
Figure 210928DEST_PATH_IMAGE009
is the maximum ordinate corresponding to the target growth set,
Figure 347512DEST_PATH_IMAGE010
is the minimum ordinate corresponding to the target growth set,
Figure 937762DEST_PATH_IMAGE011
the maximum value of the abscissa corresponding to each to-be-selected significant pixel point with the ordinate of y in the target growth set,
Figure 134388DEST_PATH_IMAGE012
the minimum value of the abscissa corresponding to each to-be-selected significant pixel point with the ordinate of y in the target growth set is obtained,
Figure 810089DEST_PATH_IMAGE013
is the width of the pixel.
Preferably, the processing of the steel pipe surface image to be detected to obtain a corresponding target edge image includes:
extracting edge lines in the surface image of the steel pipe to be detected by adopting a canny operator to obtain a corresponding edge image;
if the steel pipe surface image to be detected has the scab defect, removing edge lines of the contour edge belonging to the scab area in the edge image, and completing gaps of the edge lines intersected with the edge lines of the contour edge of the scab area in the edge image by adopting an interpolation method to obtain a target edge image; the notch of the edge line is caused by removing the edge line corresponding to the contour edge of the scar area.
Preferably, obtaining a crease defect area and a scratch defect area in the surface image of the steel pipe to be detected according to each edge line in the target edge image, includes:
for any edge line: acquiring a Hessian matrix corresponding to each pixel point on the edge line; calculating the principal component direction of the Hessian matrix corresponding to each pixel point by adopting a PCA algorithm, and taking the principal component direction of the Hessian matrix corresponding to each pixel point as the direction angle corresponding to each pixel point; calculating the average value of the direction angles corresponding to all the pixel points on the edge line, and taking the average value as the direction angle corresponding to the edge line; obtaining a Pearson coefficient corresponding to the edge line according to the coordinates corresponding to each pixel point on the edge line; extracting the edge of the single pixel point of the edge line by utilizing image thinning operation, and taking the number of the pixel points on the edge of the single pixel point corresponding to the edge line as the length corresponding to the edge line;
for any two edge lines in the target edge image: marking the two edge lines as a first edge line and a second edge line respectively; obtaining the width between the two edge lines according to the coordinates of each pixel point on the first edge line and the second edge line;
if the Pearson coefficients corresponding to any two edge lines in the target edge image are all larger than the threshold value of the linear approximation degree
Figure 750363DEST_PATH_IMAGE014
The absolute value of the difference value of the corresponding lengths is smaller than the length difference threshold value, and the absolute value of the difference value of the corresponding direction angles is smaller than the direction angle difference threshold value
Figure 460699DEST_PATH_IMAGE015
If the width between any two edge lines is smaller than the width threshold, dividing the two edge lines into a group to obtain each edge line corresponding to each group; the above-mentioned
Figure 562647DEST_PATH_IMAGE016
Said
Figure 991223DEST_PATH_IMAGE017
Wherein, in the step (A),
Figure 469609DEST_PATH_IMAGE018
for the second adaptation of the parameter(s),
Figure 854627DEST_PATH_IMAGE019
adjusting a parameter for a first adaptation;
for any group: if the group only comprises two edge lines, judging that the two edge lines in the group belong to the two side edges of the scratch defect, and taking the area between the two edge lines as a scratch defect area; if the group comprises more than two edge lines, judging the edge lines as crease lines of the crease defects, and combining the maximum abscissa and the maximum ordinate, the maximum abscissa and the minimum ordinate, the minimum abscissa and the maximum ordinate, and the minimum abscissa and the minimum ordinate, which correspond to all pixel points on all the edge lines in the group, to obtain four coordinates; and connecting the pixel points corresponding to the four coordinates to obtain a crease defect area.
Preferably, the obtaining the width between the first edge line and the second edge line according to the coordinates of each pixel point on the first edge line and the second edge line includes:
for any pixel point on the first edge line: making a straight line passing through the pixel point, wherein the difference between the inclination angle of the straight line and the direction angle corresponding to the first edge line
Figure 393056DEST_PATH_IMAGE020
Calculating the Euclidean distance between the two pixel points according to the coordinate corresponding to the pixel point and the coordinate of the pixel point where the straight line intersects with the second edge line, and recording the Euclidean distance as the width corresponding to the pixel point;
taking the average value of the widths corresponding to all the pixel points on the first edge as the width between the first edge line and the second edge line;
the above-mentioned
Figure 43349DEST_PATH_IMAGE019
And said
Figure 325425DEST_PATH_IMAGE018
The obtaining method comprises the following steps:
obtaining the number of pixel points on all edge lines in the target edge image in the scab area
Figure 744774DEST_PATH_IMAGE021
And the total number of all pixel points on all edge lines
Figure 188525DEST_PATH_IMAGE022
The above-mentioned
Figure 326114DEST_PATH_IMAGE019
The calculation formula of (2) is as follows:
Figure 67674DEST_PATH_IMAGE023
the above-mentioned
Figure 357841DEST_PATH_IMAGE018
The calculation formula of (2) is as follows:
Figure 487340DEST_PATH_IMAGE024
the invention has the following beneficial effects:
firstly, obtaining a salient region to be selected in the surface image of the steel pipe to be detected according to the obtained salient image corresponding to the surface image of the steel pipe to be detected; then classifying all to-be-selected significant pixel points in the to-be-selected significant region to obtain all growth sets; selecting growth sets with the number of to-be-selected significant pixel points in each growth set larger than or equal to a second threshold value, and recording as target growth sets; then obtaining a scab area and a contour edge of the scab area in the surface image of the steel pipe to be detected according to the number of the to-be-selected significant pixel points in each target growth set; and finally, processing the surface image of the steel pipe to be detected to obtain a corresponding target edge image, and further obtaining a crease defect area and a scratch defect area according to each edge line in the target edge image. The invention detects the image of the surface of the steel pipe in an image processing mode, judges whether the surface of the steel pipe has defects or not, and identifies the positions of different defects, thereby realizing more accurate detection of various defects on the surface of the steel pipe with lower cost.
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 embodiments or the description of 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 flow chart of an intelligent method for detecting defects of a steel pipe according to the present invention;
FIG. 2 is a schematic diagram of edge lines in an edge image.
Detailed Description
In order to further explain the technical means and functional effects of the present invention adopted to achieve the predetermined purpose, the following describes an intelligent method for detecting defects of a steel pipe according to the present invention in detail with reference to the accompanying drawings and preferred 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 intelligent detection method for the defects of the steel pipe provided by the invention in detail by combining with the accompanying drawings.
The embodiment of the intelligent detection method for the defects of the steel pipe comprises the following steps:
as shown in fig. 1, the intelligent detection method for steel pipe defects of the present embodiment includes the following steps:
s1, acquiring a surface image of the steel pipe to be detected.
Three common defects among steel pipe defects include scratches, folds, and scabs; wherein the scratch defect is generally positioned on the outer side of the steel pipe and presents a linear groove shape, most scratches can be seen from the groove bottom, and the cause of the scratch defect is mainly mechanical scratch in the processes of roller bed, cooling bed, straightening, transportation and the like; the folding defects are linear locally overlapped folding lines which are regularly and continuously distributed on the surface of the steel material and approximate to cracks, and generally have a certain inclination angle with the surface of the steel material along the rolling direction; the scab defect is generally tongue-shaped, block-shaped or fish scale-shaped raised slice, is irregularly distributed on the surface of steel, has unequal area size and thickness and irregular outline, and can be distributed singly or in a plurality of connected slices. These three defects merge with each other and are difficult to distinguish.
In order to detect the defects on the surface of the steel pipe, the embodiment first obtains an image corresponding to the surface of the steel pipe to be detected; then preprocessing the image, namely filtering noise in the image by adopting a Gaussian filter, and then enhancing the image by adopting histogram equalization to increase the contrast of the image; recording the image corresponding to the surface of the steel pipe to be detected after pretreatment as the image of the surface of the steel pipe to be detected.
S2, acquiring a saliency map corresponding to the surface image of the steel pipe to be detected; and obtaining a to-be-selected salient region in the surface image of the steel pipe to be detected according to the corresponding salient value of each pixel point in the salient map, wherein the to-be-selected salient region comprises each to-be-selected salient pixel point in the surface image of the steel pipe to be detected.
Considering that if various defects exist on the shot steel pipe surface image, even the phenomenon of defect mixing occurs, only the most obvious defects in the image can be detected by adopting the classification neural network, but various defects in the image cannot be detected, and the requirement of the neural network on the hardware of the detection system is higher; the embodiment provides an intelligent detection method for steel pipe defects, which can detect various defects contained in an image of the surface of a steel pipe and quickly and accurately detect various defects on the surface of the steel pipe at a lower cost.
Because the color of scab is different from that of other areas, the embodiment firstly judges whether the surface of the steel pipe to be detected has scab defects, specifically:
in the embodiment, a visual saliency algorithm (FT) is utilized to process the surface image of the steel pipe to be detected to obtain a saliency map corresponding to the surface image of the steel pipe to be detected, wherein the saliency map has the same size as the surface image of the steel pipe to be detected, and the pixel points are in one-to-one correspondence; one pixel point in the saliency map corresponds to one saliency value (namely one pixel point in the image of the surface of the steel pipe to be detected corresponds to one saliency value), and the value ranges of the saliency values are all [0,1]. The embodiment detects the scab defect in the steel pipe surface image based on the saliency map corresponding to the steel pipe surface image to be detected.
The scab defect appears on the saliency map as a collection of pixels with large saliency values and close spatial positions. In this embodiment, the Otsu atsu method is adopted to segment the saliency map based on the saliency value corresponding to each pixel point in the saliency map, so as to obtain an optimal segmentation threshold.
In the embodiment, pixel points with significant values larger than the optimal segmentation threshold in the significant graph are marked as to-be-selected significant pixel points, and a set formed by all to-be-selected significant pixel points is marked as to-be-selected significant pixel point set; and marking the pixels with the significant value less than or equal to the optimal segmentation threshold value in the significant graph as non-significant pixels, and marking a set formed by the non-significant pixels as a non-significant pixel set. Calculating the average value of the significant values corresponding to all the pixel points in the set of the significant pixel points to be selected, and recording the average value as a first average value
Figure 862958DEST_PATH_IMAGE025
(ii) a Calculating the average value of the significant values corresponding to all the pixel points in the non-significant pixel point set, and recording as the second average value
Figure 736105DEST_PATH_IMAGE026
(ii) a If it is
Figure 615199DEST_PATH_IMAGE027
If the value is less than or equal to the first threshold value, the steel pipe surface image to be detected does not have the scab defect; if it is
Figure 915599DEST_PATH_IMAGE027
If the number of the pixels in the to-be-selected significant pixel point set is greater than the first threshold, it is determined that the to-be-selected significant pixel points in the to-be-selected significant pixel point set correspond to the number of the pixels in the to-be-selected significant pixel point set, and the area formed by the to-be-selected significant pixel points in the to-be-selected significant area in the to-be-detected steel pipe surface image is recorded as the to-be-selected significant area. In this embodiment, the first threshold is set to 2, and specifically needs to be set according to actual needs.
S3, classifying all to-be-selected significant pixel points in the to-be-selected significant region to obtain all growth sets, wherein each growth set comprises all to-be-selected significant pixel points belonging to the growth set; selecting growth sets with the number of to-be-selected significant pixel points in each growth set larger than or equal to a second threshold value, and recording as target growth sets; and obtaining a scab area and the contour edge of the scab area in the surface image of the steel pipe to be detected according to the number of the to-be-selected significant pixel points in each target growth set.
And if the steel pipe surface image to be detected does not have the scab defect, directly detecting the scratch defect and the folding defect.
If the steel pipe surface image to be detected is judged to have the scab defect, the steel pipe surface image to be detected is further detected by the embodiment to obtain the area where the scab defect exists in the steel pipe surface image to be detected, specifically:
considering that the linear defects on the surface of the steel pipe can interfere with the detection of the scar defects, the embodiment extracts the straight lines in the to-be-selected salient region by using hough straight line detection to obtain all the straight lines in the to-be-selected salient region. In this embodiment, hough line detection is the prior art, and will not be described herein.
Considering that all the linear defects on the surface of the steel pipe have a certain width, in this embodiment, each straight line existing in the region to be selected is processed to obtain a linear region corresponding to each straight line, specifically, for any straight line:
let the equation corresponding to the straight line obtained by Hough line detection be
Figure 778513DEST_PATH_IMAGE028
Figure 189772DEST_PATH_IMAGE029
Wherein x is the abscissa of the pixel, y is the ordinate of the pixel,
Figure 454531DEST_PATH_IMAGE002
is the minimum value of the abscissa corresponding to each pixel point on the straight line,
Figure 660253DEST_PATH_IMAGE003
the maximum value of the abscissa corresponding to each pixel point on the straight line is defined, k is the slope corresponding to the straight line, b is the intercept corresponding to the straight line, and the origin of the coordinate system is the point corresponding to the lower left corner of the image; in this embodiment, two straight lines parallel to the straight line are respectively set and respectively recorded as a first straight line and a second straight line, and the equation of the first straight line is
Figure 10463DEST_PATH_IMAGE004
The equation of the second line is
Figure 22150DEST_PATH_IMAGE005
Wherein
Figure 141416DEST_PATH_IMAGE006
And the equations of the first straight line and the second straight line have the same domain as the equation of the straight line; in this embodiment, the end points of the first straight line and the second straight line are connected, and the formed region is recorded as a straight line region corresponding to the straight line; the embodiment is realized by determining
Figure 783619DEST_PATH_IMAGE007
To determine the linear region to which the line corresponds, and in particular, will
Figure 355546DEST_PATH_IMAGE007
Starting from 0, each time an increment of 2,until the proportion of the pixel points which are not the significant pixel points to be selected in the increased and more increased areas is larger than the proportion threshold value, taking the value at the moment as the proportion threshold value
Figure 108607DEST_PATH_IMAGE007
The value of (2) is, in this embodiment, set the ratio threshold to 80%, specifically set according to actual needs. For example, when
Figure 347958DEST_PATH_IMAGE007
When the number is 2, judging whether the ratio of the number of the pixels which are not to be selected and are obvious in the increased area is more than 80 percent, if so, stop the cycle and order
Figure 161062DEST_PATH_IMAGE030
(ii) a If not, order
Figure 954706DEST_PATH_IMAGE007
Is 4, and judges
Figure 511458DEST_PATH_IMAGE007
Area ratio corresponding to 4
Figure 605316DEST_PATH_IMAGE007
If the ratio of the number of the pixels which are not to-be-selected significant pixels in the corresponding region which is more than 2 is more than 80 percent, stopping circulation and enabling the number of the pixels to be selected significant pixels to be larger than 80 percent
Figure 589321DEST_PATH_IMAGE031
(ii) a If not, the increment is continued until the set condition is met, and the command is sent
Figure 135840DEST_PATH_IMAGE007
Equal to the value at which the condition is satisfied.
Thus, in the present embodiment, a straight line region corresponding to each straight line is obtained.
In this embodiment, the pixel points in the linear region corresponding to each linear line are recorded as linear pixel points, then the linear pixel points existing in the to-be-selected salient region are removed, and the remaining to-be-selected salient region is recorded as a target to-be-selected salient region.
Next, in this embodiment, each to-be-selected significant pixel point in the target to-be-selected significant region is classified to obtain each growth set, specifically:
taking any one to-be-selected significant pixel point in a target to-be-selected significant region as an initial growth point, searching whether to-be-selected significant pixel points belonging to the target to-be-selected significant region exist in a 5 × 5 window with the initial growth point as a center, if so, merging the to-be-selected significant pixel points in the window into a first growth set, then respectively taking other to-be-selected significant pixel points except the initial growth point in the window corresponding to the initial growth point as new initial growth points, judging whether to-be-selected significant pixel points belonging to the target to-be-selected significant region exist in the 5 × 5 window corresponding to the new initial growth point, if so, merging the to-be-selected significant pixel points in the window into the same growth set (namely, the first growth set) as the initial growth point, and continuing to grow; if not, stopping growth, thus obtaining a growth set; after the growth set is obtained, any one of the to-be-selected significant pixel points outside the first growth set in the target to-be-selected significant region is continuously selected as a new initial growth point by adopting the above operation, and the growth is performed until the traversal of the to-be-selected significant pixel points in the target to-be-selected significant region is completed, so that each growth set is obtained in the embodiment. The above process in this embodiment is similar to the conventional region growing algorithm, and this embodiment only changes the judgment condition and the window size, so detailed descriptions are omitted.
Then, if the number of the to-be-selected significant pixels included in the growth set is smaller than a second threshold, the growth set is considered to be too small and does not form a scar defect region, so that the growth set in which the number of the to-be-selected significant pixels in each growth set is greater than or equal to the second threshold is selected and recorded as a target growth set; the size of the second threshold is set according to actual needs, and the second threshold is set to 20 in this embodiment. And then analyzing the target growth set to obtain a scab area and the edge of the scab area in the surface image of the steel pipe to be detected, wherein for any target growth set:
acquiring a maximum vertical coordinate and a minimum vertical coordinate (namely a maximum row and a minimum row in an image) according to coordinates corresponding to each to-be-selected significant pixel point in the target growth set, wherein each to-be-selected significant pixel point in the target growth set is in an area between the maximum vertical coordinate and the minimum vertical coordinate in the to-be-detected steel pipe surface image; then, in this embodiment, according to the coordinates of each to-be-selected significant pixel point in the target growth set, the area of the region corresponding to the target growth set in the surface image of the steel pipe to be detected (that is, the area of the region where each to-be-selected significant pixel point in the target growth set is located in the surface image of the steel pipe to be detected is recorded as the area of the region corresponding to the target growth set), that is:
Figure 230704DEST_PATH_IMAGE032
wherein S is the area of the region corresponding to the target growth set,
Figure 100440DEST_PATH_IMAGE009
is the maximum ordinate corresponding to the target growth set,
Figure 740500DEST_PATH_IMAGE010
is the minimum ordinate corresponding to the target growth set,
Figure 23583DEST_PATH_IMAGE011
the maximum value of the abscissa corresponding to each to-be-selected significant pixel point with the ordinate of y in the target growth set,
Figure 469608DEST_PATH_IMAGE012
the minimum value of the abscissa corresponding to each to-be-selected significant pixel point with the ordinate of y in the target growth set is obtained,
Figure 521746DEST_PATH_IMAGE013
the width of the pixel point is defaulted to 1 in this embodiment, and specifically, the width of the pixel point is determined according to actual needsAnd (4) setting.
This embodiment will be described
Figure 598287DEST_PATH_IMAGE033
And
Figure 368665DEST_PATH_IMAGE034
the corresponding pixel points are used as boundary pixel points of the area corresponding to the target growth set in the y-th row (namely, the vertical coordinate is the row corresponding to y), namely, the pixel point to be selected with the maximum horizontal coordinate and the pixel point to be selected with the minimum horizontal coordinate in the pixel points to be selected corresponding to each vertical coordinate between the maximum vertical coordinate and the minimum vertical coordinate in the target growth set are used as the boundary pixel points of the area corresponding to the target growth set; in this embodiment, an interpolation method is used to connect the boundary pixel points of the region corresponding to the target growth set, so as to obtain the edge of the region corresponding to the target growth set (i.e., the boundary of the corresponding region). The interpolation method in this embodiment is the prior art, and will not be described herein.
In this embodiment, the ratio of the number of to-be-selected significant pixels corresponding to the target growth set to the area of the region corresponding to the target growth set is calculated, and the ratio is used as the density of the region corresponding to the target growth set, that is:
Figure 556064DEST_PATH_IMAGE035
wherein the content of the first and second substances,
Figure 462709DEST_PATH_IMAGE036
for the density of the region corresponding to the target growth set,
Figure 631522DEST_PATH_IMAGE037
and the number of the to-be-selected significant pixels corresponding to the target growth set is counted. If the density of the area corresponding to the target growth set is larger than a third threshold value, judging that the area corresponding to the target growth set is a scab area, namely the scab defect exists in the surface image of the steel pipe to be detected, and detecting the steel to be detectedThe edge of the area corresponding to the target growth set in the tube surface image is used as the contour edge of the scar area (namely, used as the boundary of the scar area); otherwise, judging that the area corresponding to the target growth set is not a scar area.
According to the method, each target growth set is analyzed according to the process, and then a scab area and a contour edge of the scab area existing in the surface image of the steel pipe to be detected are obtained; and if the area corresponding to each target growth set is not judged to be the scab area, indicating that no scab defect exists in the surface image of the steel pipe to be detected.
S4, processing the surface image of the steel pipe to be detected to obtain a corresponding target edge image, wherein the target edge image does not include edge lines corresponding to the contour edge of the scab area; and obtaining a crease defect area and a scratch defect area according to each edge line in the target edge image.
In this embodiment, the scab defect existing in the image of the surface of the steel pipe to be detected is detected according to step S3.
Then, the folding defects and the scratch defects in the surface image of the steel pipe to be detected are detected according to the characteristics of the folding defects and the scratch defects; considering that the existence of the scab defect can interfere the judgment of the folding defect, and the influence factors are mainly two aspects, in the first aspect, unnecessary edge lines can be introduced into the boundary of the scab defect, and the edge lines can be mistaken for folding lines in the folding defect; on the other hand, the occurrence of the scar defect can cause the folding line appearing on the scar defect to deflect and twist to a certain extent, the deflection means that the folding line has a certain inclination angle with the normal folding line and is not parallel to the normal folding line any more, and the twist means that the folding line is not a pure straight line any more and a deformation phenomenon may occur; therefore, in this embodiment, the scarring defect is first detected, and if the scarring defect exists, the interference of the scarring defect needs to be eliminated first when the folding defect is subsequently detected, specifically:
in the embodiment, firstly, extracting edge lines in a surface image of a steel pipe to be detected by adopting a canny operator to obtain a corresponding edge image; if the steel pipe surface image to be detected does not have the scab defect, recording the edge image as a target edge image; if the scab defect exists in the surface image of the steel pipe to be detected, removing edge lines of the contour edge belonging to the scab area in the edge image (namely removing edge lines of the boundary belonging to the scab area in the edge image), considering that if other edge lines intersect with the edge lines corresponding to the contour edge of the scab area, when the edge lines corresponding to the contour edge of the scab area are removed, partial pixels of the other edge lines are removed, and further other edge lines are notched, so that the embodiment judges that no other edge lines intersect with the edge lines corresponding to the contour edge of the scab area, if two edge lines intersect with the edge lines corresponding to the contour edge of the scab area, acquiring the Euclidean distance of the intersection point of the two edge lines and the edge lines corresponding to the contour edge of the scab defect area, and if the Euclidean distance is smaller than a preset distance threshold, merging the two edge lines, namely, filling up the notches of the two edge lines by using an interpolation method; the preset distance threshold is set according to actual needs. For example, as shown in fig. 2, where 1 is an edge line corresponding to the contour edge of the scar defect area, 2 is a first edge line, 3 is a second edge line, and 4 is a third edge line, where 2 has a point of intersection with the outer edge of 1, 3 has two points of intersection with the inner side of 1, and 4 has a point of intersection with the outer side of 1; after the contour edge of the scar defect area is removed, a gap exists between 2 and 3, the Euclidean distance of the gap (the Euclidean distance of two intersection points between 2 and 3) is smaller than a distance threshold, the 2 and 3 are the same edge line, and the gap is filled by adopting an interpolation method; 3 and 4, the Euclidean distance of the notch (the Euclidean distance of the intersection point between 3 and 4) is larger than the distance threshold, and the fact that 2 and 3 are not the same edge line means that the notch does not need to be filled.
Considering that the corresponding concave part of the scratch has a deep depth, a large width and a large length, the canny operator can detect edge lines on two sides of the scratch (because the shot surface image of the steel pipe to be detected is a partial surface of the steel pipe to be detected); whereas for fold defects the fold line depressions are thinner and shallower, the fold lines are parallel to each other, but in the area of the scarring defects the fold lines may deflect and distort.
For any edge line in the target edge image: acquiring a Hessian matrix corresponding to each pixel point on the edge line, calculating the principal component direction of the Hessian matrix corresponding to each pixel point by adopting a PCA algorithm, taking the principal component direction of the Hessian matrix corresponding to each pixel point as the direction angle corresponding to each pixel point, calculating the average value of the direction angles corresponding to all the pixel points on the edge line, and taking the obtained average value as the direction angle corresponding to the edge line; then, according to the coordinates corresponding to each pixel point on the edge line, acquiring a Pearson coefficient corresponding to the edge line, wherein the value range of the Pearson coefficient is [0,1], the Pearson coefficient represents the linear correlation of the edge line, namely the linear approximation degree, the more the Pearson coefficient is close to 1, the closer the edge line is to the straight line, and the more the Pearson coefficient is close to 0, the more the edge line is deviated from the straight line; and finally, extracting the edge of the single pixel point of the edge line by utilizing image thinning operation, and taking the number of the pixel points on the edge of the single pixel point corresponding to the edge line as the length corresponding to the edge line. Thus, the direction angle, the pearson coefficient and the length corresponding to each edge line in the target edge image can be obtained in the embodiment. In this embodiment, the process of acquiring the Hessian matrix, the PCA algorithm, the image thinning operation, and the pearson coefficient are prior art, and are not described herein again.
Then, the present embodiment calculates the width between any two edge lines in the target edge image, specifically:
for any two edge lines in the target edge image: recording the two edge lines as a first edge line and a second edge line respectively, sequentially traversing each pixel point on the first edge line, and for any pixel point: making a straight line passing through the pixel point, wherein the difference between the inclination angle of the straight line and the direction angle corresponding to the first edge line
Figure 639930DEST_PATH_IMAGE020
Obtaining the coordinate of the pixel point intersected by the straight line and the second edge line, and intersecting the straight line and the second edge line according to the coordinate corresponding to the pixel pointCalculating the Euclidean distance between the two pixel points according to the coordinates of the pixel points, and recording the Euclidean distance as the corresponding width of the pixel point; thus, the corresponding width of each pixel point on the first edge line is obtained, and the average value of the corresponding widths of all the pixel points on the first edge is used as the width between the first edge line and the second edge line. The present embodiment can obtain the width between any two edge lines in the target edge image according to the above process.
If the Pearson coefficients corresponding to any two edge lines in the target edge image are all larger than the threshold value of the linear approximation degree
Figure 880287DEST_PATH_IMAGE014
The absolute value of the difference value of the corresponding lengths is smaller than the length difference threshold value, and the absolute value of the difference value of the corresponding direction angles is smaller than the direction angle difference threshold value
Figure 657750DEST_PATH_IMAGE015
And if the width between any two edge lines is less than the width threshold value, dividing the two edge lines into a group. The length difference threshold and the width threshold are set according to actual needs.
In the present embodiment, the threshold of the degree of linear approximation is
Figure 59781DEST_PATH_IMAGE016
The direction angle difference threshold is
Figure 555485DEST_PATH_IMAGE017
Wherein
Figure 333954DEST_PATH_IMAGE019
For the first adaptation of the parameter(s),
Figure 965923DEST_PATH_IMAGE018
adjusting a parameter for a second adaptation; considering that if the edge line falls into the scar region, the edge line may be deflected and distorted, the deflection may increase the absolute value of the difference between the direction angles corresponding to the two edge lines, and the distortion may decrease the pearson coefficient of the edge line, so thatThe parallel threshold needs to be adjusted up
Figure 70015DEST_PATH_IMAGE015
Reducing threshold of degree of linear approximation
Figure 584173DEST_PATH_IMAGE014
I.e. increasing the first adaptive adjustment parameter
Figure 166332DEST_PATH_IMAGE019
And a second adaptive adjustment parameter
Figure 918388DEST_PATH_IMAGE018
. The embodiment acquires the number of the pixel points on all the edge lines in the target edge image in the scab area
Figure 927801DEST_PATH_IMAGE021
And the total number of all pixel points on all edge lines
Figure 132517DEST_PATH_IMAGE022
Then the embodiment is based on
Figure 518368DEST_PATH_IMAGE021
And
Figure 859351DEST_PATH_IMAGE022
to obtain
Figure 39665DEST_PATH_IMAGE019
And
Figure 731678DEST_PATH_IMAGE018
i.e. by
Figure 327744DEST_PATH_IMAGE023
Figure 61518DEST_PATH_IMAGE024
In this embodiment, based on the above conditions, each edge line in the target edge image is grouped to obtain each edge line corresponding to each group.
For any group: if the group only comprises two edge lines, the two edge lines in the group belong to two side edges of the scratch defect, and the area between the two edge lines is a scratch defect area; if the group contains more than two edge lines, the edge lines are crease lines of the crease defects, the maximum abscissa and the maximum ordinate combination, the maximum abscissa and the minimum ordinate combination, the minimum abscissa and the maximum ordinate combination, the minimum abscissa and the minimum ordinate combination, and the four vertexes of the crease defect area (namely pixel points corresponding to the four coordinates) are obtained by combining the maximum abscissa and the maximum ordinate, the maximum abscissa and the minimum ordinate, which correspond to all pixel points on all the edge lines in the group, so as to obtain four coordinates, and the four vertexes are connected to obtain the crease defect area; if none of the defects are met, the defect is not present.
In the embodiment, each group is analyzed to detect whether a defect exists in the surface image of the steel pipe to be detected, if so, a crease defect area and a scratch defect area in the surface image of the steel pipe to be detected are identified, and the detected defect area is mapped to the surface image of the steel pipe to be detected, so that the crease defect area and the scratch defect area in the surface image of the steel pipe to be detected are obtained.
So far, the embodiment detects the surface image of the steel pipe to be detected to determine whether the three defects described in the embodiment exist in the surface image of the steel pipe to be detected, and if so, identifies the positions corresponding to different defects.
According to the embodiment, firstly, a salient region to be selected in the surface image of the steel pipe to be detected is obtained according to the obtained salient image corresponding to the surface image of the steel pipe to be detected; then classifying all to-be-selected significant pixel points in the to-be-selected significant region to obtain all growth sets; in the embodiment, a growth set with the number of to-be-selected significant pixels in each growth set greater than or equal to a second threshold is selected and recorded as a target growth set; then obtaining a scab area and a contour edge of the scab area in the surface image of the steel pipe to be detected according to the number of the to-be-selected significant pixel points in each target growth set; finally, the steel pipe surface image to be detected is processed by the embodiment to obtain a corresponding target edge image, and then a crease defect area and a scratch defect area are obtained according to each edge line in the target edge image. The embodiment detects the image of the surface of the steel pipe in an image processing mode, judges whether the surface of the steel pipe has defects or not, identifies the positions of different defects, and realizes more accurate detection of various defects on the surface of the steel pipe with lower cost.
It should be noted that: 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 (5)

1. An intelligent detection method for defects of a steel pipe is characterized by comprising the following steps:
acquiring a surface image of a steel pipe to be detected;
acquiring a saliency map corresponding to the surface image of the steel pipe to be detected; obtaining a salient region to be selected in the surface image of the steel pipe to be detected according to the corresponding salient value of each pixel point in the salient map, wherein the salient region to be selected comprises each salient pixel point to be selected in the surface image of the steel pipe to be detected;
classifying all to-be-selected significant pixel points in the to-be-selected significant region to obtain all growth sets, wherein each growth set comprises all to-be-selected significant pixel points belonging to the growth set; selecting growth sets with the number of to-be-selected significant pixel points in each growth set larger than or equal to a second threshold value, and recording as target growth sets; obtaining a scab area and a contour edge of the scab area in the surface image of the steel pipe to be detected according to the number of the to-be-selected significant pixel points in each target growth set;
processing the surface image of the steel pipe to be detected to obtain a corresponding target edge image, wherein the target edge image does not include edge lines corresponding to the contour edge of the scab area; obtaining a crease defect area and a scratch defect area according to each edge line in the target edge image;
acquiring a saliency map corresponding to the surface image of the steel pipe to be detected; obtaining a salient region to be selected in the surface image of the steel pipe to be detected according to the salient value corresponding to each pixel point in the salient map, wherein the salient region to be selected comprises:
processing the surface image of the steel pipe to be detected by using a visual saliency algorithm to obtain a saliency map corresponding to the surface image of the steel pipe to be detected;
obtaining an optimal segmentation threshold according to the saliency value corresponding to each pixel point in the saliency map and the Otsu method;
marking the pixel points with the significant values larger than the optimal segmentation threshold value in the significant graph as the significant pixel points to be selected, and marking the set formed by the significant pixel points to be selected as the significant pixel point set to be selected;
marking the pixel points with the significant value less than or equal to the optimal segmentation threshold value in the significant graph as non-significant pixel points, and marking a set formed by all the non-significant pixel points as a non-significant pixel point set;
calculating the ratio of the average value of the significant values corresponding to all the pixel points in the to-be-selected significant pixel point set to the average value of the significant values corresponding to all the pixel points in the non-significant pixel point set;
if the ratio is smaller than or equal to a first threshold value, judging that no scab defect exists in the surface image of the steel pipe to be detected;
if the ratio is larger than a first threshold value, marking pixel points corresponding to all pixel points in the to-be-selected significant pixel point set in the to-be-detected steel pipe surface image as to-be-selected significant pixel points, and marking a region formed by all to-be-selected significant pixel points in the to-be-detected steel pipe surface image as to-be-selected significant regions;
the step of classifying the to-be-selected significant pixel points in the to-be-selected significant region to obtain each growth set includes:
extracting straight lines in the salient region to be selected by utilizing Hough straight line detection to obtain all straight lines in the salient region to be selected;
processing each straight line existing in the salient region to be selected to obtain a straight line region corresponding to each straight line;
marking the pixel points in the linear area corresponding to each straight line as linear pixel points; removing straight line pixel points existing in the salient region to be selected, and recording the remaining salient region to be selected as a target salient region to be selected;
taking any one to-be-selected significant pixel point in the target to-be-selected significant region as an initial growth point, judging whether to have the to-be-selected significant pixel point belonging to the target to-be-selected significant region in a window with the size of 5 multiplied by 5 and taking the initial growth point as a center, and if so, merging the to-be-selected significant pixel point in the window into a first growth set; respectively taking other to-be-selected significant pixel points except the initial growth point in the window corresponding to the initial growth point as new initial growth points, judging whether to-be-selected significant pixel points belonging to a target to-be-selected significant region exist in the window with the size of 5 multiplied by 5 corresponding to the new initial growth point, if so, merging the to-be-selected significant pixel points in the window into a first growth set, continuing to grow, and if not, stopping growing to obtain a first growth set; by analogy, selecting any one of the to-be-selected significant pixel points outside the first growth set in the target to-be-selected significant region as a new initial growth point, and growing until all the to-be-selected significant pixel points in the target to-be-selected significant region are traversed completely to obtain all the growth sets;
obtaining a scab area and a contour edge of the scab area in the surface image of the steel pipe to be detected according to the number of the to-be-selected significant pixel points in each target growth set, wherein the contour edge comprises the following steps:
for any target growth set:
acquiring a maximum vertical coordinate and a minimum vertical coordinate according to coordinates corresponding to each to-be-selected significant pixel point in the target growth set;
obtaining the area of the corresponding region of the target growth set in the surface image of the steel pipe to be detected according to the coordinates of each to-be-selected significant pixel point in the target growth set, and recording the area as the area of the corresponding region of the target growth set;
for any ordinate in the target growth set between the maximum and minimum ordinates: taking the to-be-selected significant pixel point with the maximum abscissa and the to-be-selected significant pixel point with the minimum abscissa in the to-be-selected significant pixel points corresponding to the ordinate in the target growth set as boundary pixel points of the region corresponding to the target growth set;
connecting boundary pixel points of the region corresponding to the target growth set by adopting an interpolation method to obtain the edge of the region corresponding to the target growth set;
calculating the ratio of the number of the to-be-selected significant pixel points corresponding to the target growth set to the area of the region corresponding to the target growth set, and taking the ratio as the density of the region corresponding to the target growth set;
if the density of the area corresponding to the target growth set is less than or equal to a third threshold value, judging that the area corresponding to the target growth set is not a scab area; if the density of the area corresponding to the target growth set is larger than a third threshold value, judging that the area corresponding to the target growth set is a scab area, and taking the edge of the area corresponding to the target growth set in the surface image of the steel pipe to be detected as the contour edge of the scab area;
obtaining a crease defect area and a scratch defect area in the surface image of the steel pipe to be detected according to each edge line in the target edge image, and the method comprises the following steps:
for any edge line: acquiring a Hessian matrix corresponding to each pixel point on the edge line; calculating the principal component direction of the Hessian matrix corresponding to each pixel point by adopting a PCA algorithm, and taking the principal component direction of the Hessian matrix corresponding to each pixel point as the direction angle corresponding to each pixel point; calculating the average value of the direction angles corresponding to all the pixel points on the edge line, and taking the average value as the direction angle corresponding to the edge line; obtaining a Pearson coefficient corresponding to the edge line according to the coordinates corresponding to each pixel point on the edge line; extracting the edge of the single pixel point of the edge line by utilizing image thinning operation, and taking the number of the pixel points on the edge of the single pixel point corresponding to the edge line as the length corresponding to the edge line;
for any two edge lines in the target edge image: marking the two edge lines as a first edge line and a second edge line respectively; obtaining the width between the two edge lines according to the coordinates of each pixel point on the first edge line and the second edge line;
if the Pearson coefficients corresponding to any two edge lines in the target edge image are both greater than the linear approximation threshold value
Figure 117842DEST_PATH_IMAGE001
The absolute value of the difference value of the corresponding lengths is smaller than the length difference threshold value, and the absolute value of the difference value of the corresponding direction angles is smaller than the direction angle difference threshold value
Figure 404467DEST_PATH_IMAGE002
If the width between any two edge lines is smaller than the width threshold, dividing the two edge lines into a group to obtain each edge line corresponding to each group; the above-mentioned
Figure 528280DEST_PATH_IMAGE003
Said
Figure 874948DEST_PATH_IMAGE004
Wherein, in the step (A),
Figure 848327DEST_PATH_IMAGE005
for the second adaptation of the parameter(s),
Figure 673064DEST_PATH_IMAGE006
adjusting a parameter for a first adaptation;
for any group: if the group only comprises two edge lines, judging that the two edge lines in the group belong to the two side edges of the scratch defect, and taking the area between the two edge lines as a scratch defect area; if the group comprises more than two edge lines, judging the edge lines as crease lines of the crease defects, and combining the maximum abscissa and the maximum ordinate, the maximum abscissa and the minimum ordinate, the minimum abscissa and the maximum ordinate, and the minimum abscissa and the minimum ordinate, which correspond to all pixel points on all the edge lines in the group, to obtain four coordinates; and connecting the pixel points corresponding to the four coordinates to obtain a crease defect area.
2. The intelligent steel pipe defect detection method according to claim 1, wherein the processing of each straight line existing in the to-be-selected salient region to obtain a straight line region corresponding to each straight line comprises:
for any straight line:
the equation corresponding to the straight line is
Figure 916963DEST_PATH_IMAGE007
Wherein x is the abscissa of the pixel, y is the ordinate of the pixel,
Figure 168953DEST_PATH_IMAGE008
is the minimum value of the abscissa corresponding to each pixel point on the straight line,
Figure 632557DEST_PATH_IMAGE009
is the maximum value of the abscissa corresponding to each pixel point on the straight line, k is the slope corresponding to the straight line, and b is the intercept corresponding to the straight line;
respectively setting two straight lines parallel to the straight line, and marking as a first straight line and a second straight line; the equation of the first line is
Figure 995406DEST_PATH_IMAGE010
The equation of the second line is
Figure 359391DEST_PATH_IMAGE011
In which
Figure 782282DEST_PATH_IMAGE012
Connecting the end points of the first straight line and the second straight line, and recording the formed area as a straight line area corresponding to the straight line;
the above-mentioned
Figure 736112DEST_PATH_IMAGE013
The obtaining method comprises the following steps:
will be provided with
Figure 168231DEST_PATH_IMAGE013
Increasing from 0, increasing by 2 each time until the proportion of the pixels which are not to-be-selected significant pixels in the pixels contained in the region which is increased more than before the increase is larger than a proportion threshold value, and taking the value which finally meets the condition as the value
Figure 121143DEST_PATH_IMAGE013
The value of (c).
3. The intelligent detection method for the defects of the steel pipes according to claim 1, characterized in that the area of the region corresponding to the target growth set is calculated by adopting the following formula:
Figure 980515DEST_PATH_IMAGE014
wherein S is the area of the region corresponding to the target growth set,
Figure 887553DEST_PATH_IMAGE015
is the maximum ordinate corresponding to the target growth set,
Figure 982417DEST_PATH_IMAGE016
is the minimum ordinate corresponding to the target growth set,
Figure 55415DEST_PATH_IMAGE017
the maximum value of the abscissa corresponding to each to-be-selected significant pixel point with the ordinate of y in the target growth set,
Figure 318644DEST_PATH_IMAGE018
the minimum value of the abscissa corresponding to each to-be-selected significant pixel point with the ordinate of y in the target growth set is obtained,
Figure 477093DEST_PATH_IMAGE019
is the width of the pixel.
4. The intelligent detection method for the defects of the steel pipe according to claim 1, wherein the step of processing the surface image of the steel pipe to be detected to obtain a corresponding target edge image comprises the following steps:
extracting edge lines in the surface image of the steel pipe to be detected by adopting a canny operator to obtain a corresponding edge image;
if the steel pipe surface image to be detected has the scab defect, removing edge lines of the contour edge belonging to the scab area in the edge image, and completing gaps of the edge lines intersected with the edge lines of the contour edge of the scab area in the edge image by adopting an interpolation method to obtain a target edge image; the notch of the edge line is caused by removing the edge line corresponding to the contour edge of the scar area.
5. The intelligent steel pipe defect detection method according to claim 1, wherein obtaining the width between the first edge line and the second edge line according to the coordinates of each pixel point on the two edge lines comprises:
for any pixel point on the first edge line: making a straight line passing through the pixel point, wherein the difference between the inclination angle of the straight line and the direction angle corresponding to the first edge line
Figure 251014DEST_PATH_IMAGE020
Calculating the Euclidean distance between the two pixel points according to the coordinate corresponding to the pixel point and the coordinate of the pixel point where the straight line intersects with the second edge line, and recording the Euclidean distance as the width corresponding to the pixel point;
taking the average value of the widths corresponding to all the pixel points on the first edge as the width between the first edge line and the second edge line;
the above-mentioned
Figure 912939DEST_PATH_IMAGE006
And said
Figure 881158DEST_PATH_IMAGE005
The obtaining method comprises the following steps:
obtaining the number of pixel points on all edge lines in the target edge image in the scab area
Figure 526903DEST_PATH_IMAGE021
And the total number of all pixel points on all edge lines
Figure 573356DEST_PATH_IMAGE022
The above-mentioned
Figure 620947DEST_PATH_IMAGE006
The calculation formula of (2) is as follows:
Figure 485698DEST_PATH_IMAGE023
the above-mentioned
Figure 618739DEST_PATH_IMAGE005
The calculation formula of (2) is as follows:
Figure 734462DEST_PATH_IMAGE024
CN202210858986.0A 2022-07-21 2022-07-21 Intelligent detection method for steel pipe defects Active CN114937039B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210858986.0A CN114937039B (en) 2022-07-21 2022-07-21 Intelligent detection method for steel pipe defects

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210858986.0A CN114937039B (en) 2022-07-21 2022-07-21 Intelligent detection method for steel pipe defects

Publications (2)

Publication Number Publication Date
CN114937039A CN114937039A (en) 2022-08-23
CN114937039B true CN114937039B (en) 2022-10-25

Family

ID=82868980

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210858986.0A Active CN114937039B (en) 2022-07-21 2022-07-21 Intelligent detection method for steel pipe defects

Country Status (1)

Country Link
CN (1) CN114937039B (en)

Families Citing this family (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115131387B (en) * 2022-08-25 2023-01-24 山东鼎泰新能源有限公司 Gasoline engine spray wall collision parameter automatic extraction method and system based on image processing
CN115147407B (en) * 2022-08-29 2022-11-18 聊城市博源节能科技有限公司 Bearing quality detection method based on computer vision
CN115272335A (en) * 2022-09-29 2022-11-01 江苏万森绿建装配式建筑有限公司 Metallurgical metal surface defect detection method based on significance detection
CN115375685B (en) * 2022-10-25 2023-03-24 临沂天元混凝土工程有限公司 Method for detecting sand and stone particle size abnormity in concrete raw material
CN115375688B (en) * 2022-10-25 2023-04-28 苏州德斯米尔智能科技有限公司 Automatic detection method for belt conveyor
CN115511888B (en) * 2022-11-22 2023-02-17 深圳市岑科实业有限公司 Inductance defect detection method and system based on vision
CN115797353B (en) * 2023-02-08 2023-05-09 山东乾钢金属科技有限公司 Intelligent detection system and method for quality of cold-rolled strip steel
CN115861307B (en) * 2023-02-21 2023-04-28 深圳市百昌科技有限公司 Fascia gun power supply driving plate welding fault detection method based on artificial intelligence
CN116152248B (en) * 2023-04-20 2023-06-30 中科慧远视觉技术(北京)有限公司 Appearance defect detection method and device, storage medium and computer equipment
CN116258713B (en) * 2023-05-11 2023-07-21 青岛穗禾信达金属制品有限公司 Welding processing detection method for metal cabinet
CN117078680B (en) * 2023-10-16 2024-01-23 张家港极客嘉智能科技研发有限公司 Abnormal detection method for pipe gallery support and hanger for inspection robot
CN117474924B (en) * 2023-12-28 2024-03-15 山东鲁抗医药集团赛特有限责任公司 Label defect detection method based on machine vision

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111667462A (en) * 2020-05-12 2020-09-15 常熟理工学院 Automatic detection method and system for small and weak targets in welding defects
CN112150412A (en) * 2020-08-31 2020-12-29 衢州光明电力投资集团有限公司赋腾科技分公司 Insulator self-explosion defect detection method based on projection curve analysis

Family Cites Families (18)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP3088874B1 (en) * 2013-12-27 2023-03-15 JFE Steel Corporation Surface defect detection method and surface defect detection device
CN107610103B (en) * 2017-08-30 2021-01-08 西安石油大学 Steel pipe spiral arc welding seam region extraction method based on X-ray imaging
RU2764644C1 (en) * 2018-11-30 2022-01-19 ДжФЕ СТИЛ КОРПОРЕЙШН Method for detecting surface defects, device for detecting surface defects, method for producing steel materials, method for steel material quality control, steel materials production plant, method for generating models for determining surface defects and a model for determining surface defects
CN109489591B (en) * 2018-12-17 2020-09-25 吉林大学 Plane scratch length non-contact measuring method based on machine vision
CN109872300B (en) * 2018-12-17 2021-02-19 南京工大数控科技有限公司 Visual saliency detection method for appearance defects of friction plate
KR102654713B1 (en) * 2019-07-09 2024-04-03 제이에프이 스틸 가부시키가이샤 Seamless steel pipe with excellent sulfuric acid dew point corrosion resistance and manufacturing method thereof
CN110766660A (en) * 2019-09-25 2020-02-07 上海众壹云计算科技有限公司 Integrated circuit defect image recognition and classification system based on fusion depth learning model
CN112668725A (en) * 2020-05-21 2021-04-16 广东顺德募优网络科技有限公司 Metal hand basin defect target training method based on improved features
CN112712512A (en) * 2021-01-05 2021-04-27 余波 Hot-rolled strip steel scab defect detection method and system based on artificial intelligence
CN113496483B (en) * 2021-06-22 2023-06-16 华南理工大学 Weld seam air hole defect detection method based on image processing
CN113781402B (en) * 2021-08-19 2024-03-26 中国电子产品可靠性与环境试验研究所((工业和信息化部电子第五研究所)(中国赛宝实验室)) Method and device for detecting scratch defects on chip surface and computer equipment
CN113822890B (en) * 2021-11-24 2022-02-25 中科慧远视觉技术(北京)有限公司 Microcrack detection method, device and system and storage medium
CN113920122B (en) * 2021-12-15 2022-03-04 山东鹰联光电科技股份有限公司 Cable defect detection method and system based on artificial intelligence
CN114219805B (en) * 2022-02-22 2022-05-13 武汉旺佳玻璃制品有限公司 Intelligent detection method for glass defects
CN114549497B (en) * 2022-02-28 2022-11-29 扬州市恒邦机械制造有限公司 Method for detecting surface defects of walking board based on image recognition and artificial intelligence system
CN114414660B (en) * 2022-03-18 2024-01-12 盐城工学院 Axle number and crack identification method for railway vehicle wheel set
CN114705686A (en) * 2022-03-21 2022-07-05 佛山科学技术学院 Method and system for detecting surface defects of cylindrical pot, controller and industrial personal computer
CN114693686B (en) * 2022-06-02 2022-09-02 启东市鸿盛纺织有限公司 Method for detecting stains on bed sheet cloth

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111667462A (en) * 2020-05-12 2020-09-15 常熟理工学院 Automatic detection method and system for small and weak targets in welding defects
CN112150412A (en) * 2020-08-31 2020-12-29 衢州光明电力投资集团有限公司赋腾科技分公司 Insulator self-explosion defect detection method based on projection curve analysis

Also Published As

Publication number Publication date
CN114937039A (en) 2022-08-23

Similar Documents

Publication Publication Date Title
CN114937039B (en) Intelligent detection method for steel pipe defects
CN115375676B (en) Stainless steel product quality detection method based on image recognition
CN111310558B (en) Intelligent pavement disease extraction method based on deep learning and image processing method
CN115170576B (en) Aluminum pipe surface defect detection method based on machine vision
CN109410230B (en) Improved Canny image edge detection method capable of resisting noise
CN114998350B (en) Stone defect detection method based on image processing
CN115100221B (en) Glass defect segmentation method
CN115063423B (en) Self-adaptive identification method for cold and hot cracks of mechanical castings based on computer vision
CN115294099B (en) Method and system for detecting hairline defect in steel plate rolling process
CN115330645B (en) Welding image enhancement method
WO2023279966A1 (en) Multi-lane-line detection method and apparatus, and detection device
CN115063430B (en) Electric pipeline crack detection method based on image processing
CN114972343A (en) Method for detecting production abnormity of laser welding product
CN114820773A (en) Silo transport vehicle carriage position detection method based on computer vision
CN115115642A (en) Strip steel scab defect detection method based on image processing
CN115330758B (en) Welding quality detection method based on denoising treatment
CN114841997B (en) Method for detecting surface defects of sealing surface of valve base
CN114926387A (en) Weld defect detection method and device based on background estimation and edge gradient suppression
CN115032202B (en) Method for removing residual impurities of stevioside product
CN111524156A (en) Overlapped citrus segmentation method based on distance transformation and angular point detection
CN115861320A (en) Intelligent detection method for automobile part machining information
CN114972575A (en) Linear fitting algorithm based on contour edge
CN114119603A (en) Image processing-based snack box short shot defect detection method
CN108492306A (en) A kind of X-type Angular Point Extracting Method based on image outline
CN116993742B (en) Nickel alloy rolling defect detection method based on machine vision

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