CN115311304B - Iron plate corrosion defect detection method - Google Patents
Iron plate corrosion defect detection method Download PDFInfo
- Publication number
- CN115311304B CN115311304B CN202211248930.XA CN202211248930A CN115311304B CN 115311304 B CN115311304 B CN 115311304B CN 202211248930 A CN202211248930 A CN 202211248930A CN 115311304 B CN115311304 B CN 115311304B
- Authority
- CN
- China
- Prior art keywords
- abnormal
- connected domain
- area
- iron plate
- obtaining
- 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
Links
- XEEYBQQBJWHFJM-UHFFFAOYSA-N Iron Chemical compound [Fe] XEEYBQQBJWHFJM-UHFFFAOYSA-N 0.000 title claims abstract description 134
- 229910052742 iron Inorganic materials 0.000 title claims abstract description 67
- 230000007797 corrosion Effects 0.000 title claims abstract description 56
- 238000005260 corrosion Methods 0.000 title claims abstract description 56
- 230000007547 defect Effects 0.000 title claims abstract description 23
- 238000001514 detection method Methods 0.000 title claims abstract description 14
- 230000002159 abnormal effect Effects 0.000 claims abstract description 205
- 238000004891 communication Methods 0.000 claims abstract description 22
- 238000000034 method Methods 0.000 claims abstract description 21
- 230000011218 segmentation Effects 0.000 claims abstract description 20
- JEIPFZHSYJVQDO-UHFFFAOYSA-N iron(III) oxide Inorganic materials O=[Fe]O[Fe]=O JEIPFZHSYJVQDO-UHFFFAOYSA-N 0.000 claims abstract description 16
- 230000002547 anomalous effect Effects 0.000 claims description 4
- 238000009826 distribution Methods 0.000 description 9
- 235000002566 Capsicum Nutrition 0.000 description 5
- 239000006002 Pepper Substances 0.000 description 5
- 241000722363 Piper Species 0.000 description 5
- 235000016761 Piper aduncum Nutrition 0.000 description 5
- 235000017804 Piper guineense Nutrition 0.000 description 5
- 235000008184 Piper nigrum Nutrition 0.000 description 5
- 230000000694 effects Effects 0.000 description 5
- 150000003839 salts Chemical class 0.000 description 5
- 208000012868 Overgrowth Diseases 0.000 description 2
- 238000010586 diagram Methods 0.000 description 2
- 238000011156 evaluation Methods 0.000 description 2
- 230000035772 mutation Effects 0.000 description 2
- 230000008569 process Effects 0.000 description 2
- 238000012545 processing Methods 0.000 description 2
- 239000011800 void material Substances 0.000 description 2
- 238000004458 analytical method Methods 0.000 description 1
- 238000004364 calculation method Methods 0.000 description 1
- 230000008859 change Effects 0.000 description 1
- 230000001427 coherent effect Effects 0.000 description 1
- 238000012937 correction Methods 0.000 description 1
- 239000006185 dispersion Substances 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 238000009776 industrial production Methods 0.000 description 1
- 230000001788 irregular Effects 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 239000003973 paint Substances 0.000 description 1
- 230000008439 repair process Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/0002—Inspection of images, e.g. flaw detection
- G06T7/0004—Industrial image inspection
- G06T7/0006—Industrial image inspection using a design-rule based approach
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/10—Segmentation; Edge detection
- G06T7/187—Segmentation; Edge detection involving region growing; involving region merging; involving connected component labelling
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/60—Analysis of geometric attributes
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/90—Determination of colour characteristics
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/10—Image acquisition modality
- G06T2207/10004—Still image; Photographic image
-
- Y—GENERAL 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
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02P—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
- Y02P90/00—Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
- Y02P90/30—Computing systems specially adapted for manufacturing
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- Computer Vision & Pattern Recognition (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Geometry (AREA)
- Quality & Reliability (AREA)
- Image Processing (AREA)
Abstract
The invention belongs to the technical field of iron plate corrosion defect detection, and particularly relates to an iron plate corrosion defect detection method. The method comprises the following steps: obtaining an iron plate corrosion area growth segmentation image corresponding to the iron plate corrosion gray image and each communication domain on the iron plate corrosion area growth segmentation image based on a region growth algorithm; obtaining different abnormal connected domains according to the area and color characteristic indexes; obtaining the area difference rate of each abnormal connected domain according to the area of each abnormal connected domain; acquiring a neighborhood pixel point set of each abnormal connected domain; obtaining the average distance corresponding to each abnormal connected domain according to the distance from each pixel point in the neighborhood pixel point set corresponding to each abnormal connected domain to the corresponding abnormal connected domain; finally, obtaining an abnormal communication domain of the vacuum hole according to the area difference rate and the average distance; and repairing the abnormal communication region which is the vacuum hole to obtain the iron plate corrosion region. The invention can accurately determine the rust area of the iron plate.
Description
Technical Field
The invention relates to the technical field of iron plate corrosion defect detection, in particular to an iron plate corrosion defect detection method.
Background
In industrial production and manufacturing, the iron plate is rusted to reduce the mechanical properties of the iron plate, such as strength, plasticity, toughness and the like, and also to damage the geometric shape of the iron plate and shorten the service life of the iron plate; at present, the most common mode for rusting of iron doors in the industry is to carry out rust removal and paint repair operation on a rust area, the operation is often an area needing to obtain rusting, and the traditional threshold segmentation cannot play a good role in segmenting the condition that the color of the rust changes along with different rusting degrees due to a single threshold.
Therefore, the defects are generally segmented and extracted by using a region growing algorithm aiming at the identification and detection of the rust defects on the surface of the iron plate, the algorithm is suitable for the scene with uncertain threshold values, and more accurate rust edges can be obtained; however, due to the limitation of the algorithm and the influence of noise, a phenomenon of missing void regions or overgrowth of the edges of the void regions may occur, and this phenomenon may result in low detection or identification accuracy of the iron plate corrosion defect regions.
Disclosure of Invention
The invention provides an iron plate corrosion defect detection method, which is used for solving the problem of lower precision when the existing method is used for detecting an iron plate corrosion defect area, and adopts the following technical scheme:
the embodiment of the invention provides a method for detecting iron plate corrosion defects, which comprises the following steps:
acquiring a gray image of iron plate corrosion; obtaining an iron plate corrosion region growth segmentation image corresponding to the iron plate corrosion gray level image and each connected domain on the iron plate corrosion region growth segmentation image based on a region growth algorithm; the number of the pixel points in the connected domain is more than or equal to 1;
acquiring the area and color characteristic indexes of each connected domain; obtaining various abnormal connected domains according to the area and color characteristic indexes; obtaining the area difference rate of each abnormal connected domain according to the area of each abnormal connected domain; acquiring a neighborhood pixel point set of each abnormal connected domain; obtaining the average distance corresponding to each abnormal connected domain according to the distance from each pixel point in the neighborhood pixel point set corresponding to each abnormal connected domain to the corresponding abnormal connected domain; obtaining an abnormal connected domain which is a vacuum hole according to the area difference rate and the average distance;
and repairing the abnormal communication region which is the vacuum hole to obtain an iron plate corrosion region.
Preferably, the method for obtaining the area and color feature index of each connected domain includes:
acquiring the area of each connected domain; the area of each connected domain is measured by the number of pixel points in the connected domain;
and acquiring the mean value of the gray values of the pixels in each connected domain, and recording the mean value of the gray values of the pixels in each connected domain as the color characteristic index of each connected domain.
Preferably, the method for obtaining the different connected domains comprises:
recording a connected domain with the area smaller than a preset area threshold value and the color characteristic index of the corresponding connected domain between [220,255] as an abnormal connected domain; and marking the pixel points in the abnormal connected domain as abnormal points.
Preferably, the method of area difference ratio to each of the abnormally connected domains comprises:
acquiring the area of a standard noise connected domain; the number of the pixel points in the standard noise connected domain is(ii) a Recording the area of a Standard noise connected Domain as +>;/>
Obtaining the area difference rate of each abnormal connected domain according to the area of the standard noise connected domain and the area of each abnormal connected domain;
for any abnormal connected domain, calculating the area difference rate of the abnormal connected domain according to the following formula:
wherein,is the area difference ratio of the abnormal connected domain>Is the area of the abnormally connected field>Is the area of the standard noise connected field>And n is the number of the abnormal connected domains.
Preferably, the method for obtaining the neighborhood pixel point set of each abnormal connected domain includes:
for any abnormal connected domain:
constructing and obtaining a target circle corresponding to the abnormal communication domain by taking the abnormal communication domain as a circle center;
recording other abnormal points except the abnormal point in the abnormal connected domain in a target circle corresponding to the abnormal connected domain as neighborhood pixel points of the abnormal connected domain;
and constructing and obtaining a neighborhood pixel point set of the abnormal connected domain according to each neighborhood pixel point of the abnormal connected domain.
Preferably, the method for obtaining the average distance corresponding to each abnormal connected domain includes:
for any anomalous connected domain:
calculating the distance from each pixel point in the neighborhood pixel point set corresponding to the abnormal connected domain;
sorting according to the distance from small to large to obtain a corresponding distance sequence;
obtaining the average distance corresponding to the abnormal connected domain according to the distance sequence corresponding to the abnormal connected domain;
calculating the average distance corresponding to the abnormal connected domain according to the following formula:
wherein,is the average distance corresponding to the abnormally connected field, <' >>The number of the pixel points in the neighborhood pixel point set corresponding to the abnormal connected domain is determined, and then>For the first parameter value in the distance sequence corresponding to the abnormally connected field, <>Is the weight of the first parameter value in the distance sequence corresponding to the abnormal connected component field, and->For the sum of the remaining parameter values in the distance sequence corresponding to the abnormal connected field except the first parameter value>Is->The weight of (c).
Preferably, for any abnormal connected domain, the probability index that the abnormal connected domain is a vacuum hole is calculated according to the following formula:
wherein,the abnormally connected area is a likelihood indicator of a vacuum hole, based on>For the average distance corresponding to the abnormal connected field>Is the area difference ratio of the abnormal connected domain>Is->Based on the weight of->Is->The weight of (c).
Firstly, acquiring an iron plate corrosion gray image; obtaining an iron plate corrosion area growth segmentation image corresponding to the iron plate corrosion gray image and each communication area on the iron plate corrosion area growth segmentation image based on an area growth algorithm; the number of the pixel points in the connected domain is more than or equal to 1; then obtaining the area and color characteristic index of each connected domain; obtaining various abnormal connected domains according to the area and color characteristic indexes; obtaining the area difference rate of each abnormal connected domain according to the area of each abnormal connected domain; acquiring a neighborhood pixel point set of each abnormal connected domain; obtaining the average distance corresponding to each abnormal connected domain according to the distance from each pixel point in the neighborhood pixel point set corresponding to each abnormal connected domain to the corresponding abnormal connected domain; finally, obtaining an abnormal communication domain of the vacuum hole according to the area difference rate and the average distance; and repairing the abnormal communication region which is the vacuum hole to obtain the iron plate corrosion region. The invention can accurately determine the rust area of the iron plate.
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 of a method for detecting iron plate rust defects according to the present invention;
FIG. 2 is a schematic diagram of an anomalous connected domain and neighborhood outliers of the anomalous connected domain of the present invention;
FIG. 3 is a schematic diagram of the distribution of edge pixel blocks according to the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be described clearly and completely with reference to the accompanying drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, rather than all embodiments, and all other embodiments obtained by those skilled in the art based on the embodiments of the present invention belong to the protection scope of the embodiments of the present invention.
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 embodiment provides a method for detecting iron plate corrosion defects, which is explained in detail as follows:
as shown in fig. 1, the method for detecting iron plate corrosion defects comprises the following steps:
s001, acquiring a gray image of iron plate corrosion; obtaining an iron plate corrosion area growth segmentation image corresponding to the iron plate corrosion gray image and each communication domain on the iron plate corrosion area growth segmentation image based on a region growth algorithm; and the number of the pixel points in the connected domain is more than or equal to 1.
Since the area growth algorithm for extracting the defect area in the prior art is limited and also influenced by noise, a phenomenon that a missing cavity area or an area edge overgrows may be generated, and the existence of the phenomenon can cause low detection or identification precision of the iron plate corrosion defect area, so that cavities without seed points put in and overgrowth parts need to be found and repaired, but in the searching process, the interference of signals can be generated when an image is collected to generate salt and pepper noise, the noise is also expressed as cavities in the image, the misjudgment of results is often generated, the interference is caused when the cavities (subsequently called as 'vacuum cavities') which are not put in seeds are searched, and the cavity information is lost in a traditional denoising mode.
The method comprises the steps of firstly, acquiring an iron plate image with a corrosion defect on the surface by using an image acquisition system, and recording the image as the iron plate corrosion image; carrying out graying treatment on the iron plate corrosion image to obtain an iron plate corrosion gray image; selecting a region with small gray value (darker color) for the image after the graying treatment, putting the seed points, and definingDifference of gray level at thresholdThe same type of seed points in the range is judged and combined for the pixels in eight neighborhoods of the current seed pixel points; performing a region growing algorithm to obtain an effect image after the region growing and dividing and each region on the effect image after the region growing and dividing, recording the effect image after the region growing and dividing as an iron plate corrosion region growing and dividing image corresponding to the iron plate corrosion gray image, recording each region on the effect image after the region growing and dividing as each communication domain on the iron plate corrosion region growing and dividing image, wherein the number of pixel points in each communication domain is more than or equal to 1; said threshold value->The setting is required according to actual conditions.
S002, obtaining the area and color characteristic index of each connected domain; obtaining different abnormal connected domains according to the area and color characteristic indexes; obtaining the area difference rate of each abnormal connected domain according to the area of each abnormal connected domain; acquiring a neighborhood pixel point set of each abnormal connected domain; obtaining the average distance corresponding to each abnormal connected domain according to the distance from each pixel point in the neighborhood pixel point set corresponding to each abnormal connected domain to the corresponding abnormal connected domain; and obtaining an abnormal connected domain which is the vacuum hole according to the area difference rate and the average distance.
Next, in this embodiment, each obtained connected domain needs to be analyzed to obtain an abnormal point or area on the image, which is usually white, and then further analysis is performed based on the size appearance and distribution of the abnormal area in the image to eliminate the influence of noise, so as to find out a real cavity area for correction, and then abnormal point detection is performed on the edge of the obtained area to obtain a more accurate corrosion area.
For an iron plate corrosion area growth segmentation image obtained by using an area growth algorithm, adjacent pixel points with similar gray values on the image form the same communicated area, but because the area growth algorithm can only grow in continuous areas and uncertainty exists in selection of seed pixel points, the number of input seed pixel points and the number of input seed pixel points, missing holes can possibly occur due to the fact that partial areas do not grow, and the areas are not endowed with correspondingly classified pixel values after segmentation, so that the color presented in the image is white; the areas of the regions which are not grown by the seed points are generally small, the probability of being grown is very high as the areas are larger, and only small regions have small putting probability, so that the phenomenon of omission occurs; therefore, the present embodiment uses the above features as a basis for determining to find abnormal points or regions in the iron plate rust region growth segmentation image and make a unified mark; firstly, the embodiment acquires the area of each connected domain; the calculation mode of the connected domain area is a known technology and therefore is not described in detail; then obtaining the mean value of the gray values of the pixel points in each connected domain, recording the mean value of the gray values of the pixel points in each connected domain as the color characteristic index of each connected domain, wherein the larger the mean value is, the closer the color of the connected domain is to white; in this embodiment, a connected domain having an area smaller than a preset area threshold and corresponding to the connected domain with a color characteristic index of [220,255] is marked as an abnormal connected domain; the preset area threshold needs to be set according to actual conditions, but the value of the preset area threshold needs to be greater than or equal to 1, and pixel points in an abnormal connected domain are marked as abnormal points.
Thus, abnormal connected domains on the growth segmentation image of the iron plate corrosion region are obtained.
Then, analyzing the abnormal connected domain to obtain a real cavity and eliminate noise interference; the areas of the hollow areas are different, so that the shapes of the hollow areas are irregular; in contrast, the appearance of salt and pepper noise is similar and is often represented as isolated pixel points on the image, so that the total area of the pixel points is smaller than that of the vacuum hole; and because the abnormal points in the abnormal area of the rusty part in the segmentation image are always noise (if the abnormal points are missed holes, the abnormal points are included by a normal growth mode and are not in accordance with logic), the abnormal point characteristics in the rusty part can be used as a reference template to be distinguished by comparing the external size characteristics of the abnormal points in other areas.
Firstly, analyzing the area of an abnormal connected domain, wherein the area of the connected domain is measured by the number of pixel points; because the abnormal points are very abrupt, the gray difference of the adjacent pixel points is very large, and the abnormal points are similar to the abrupt state; therefore, abnormal points in the rust can be acquired according to the gradient value; therefore, in this embodiment, the area of the standard noise connected domain is obtained first, and the number of the pixel points in the standard noise connected domain isThen the area of the standard noise connected domain is recorded as->(ii) a When judging abnormal points in other areas, if the area is more than->The area is possibly a vacuum hole area, the difference value can be made between the area of the current abnormal point and the area of the reference template, the larger the obtained value is, the more possible the area is the vacuum hole, and the area difference rate of each abnormal connected domain is obtained according to the area of the standard noise connected domain and the area of each abnormal connected domain; for any abnormal connected domain, calculating the area difference rate of the abnormal connected domain according to the following formula:
wherein,is the area difference ratio of the abnormal connected domain>Is the area of the abnormally connected field>Is the area of the standard noise connected field>The average value of the areas of the abnormal connected domains, wherein n is the number of the abnormal connected domains; when/is>When it is determined that the abnormal connected component is noisy, the probability that the abnormal connected component is noisy is greater when->If the value is more than 1, the probability that the abnormal connected domain is a vacuum hole is higher.
Then, the discrete situation of each abnormal connected domain is obtained by calculating the distance distribution situation of each abnormal connected domain from the nearest abnormal point around the abnormal connected domain in the image, and the specific logic for judging whether the point is a vacuum hole or not according to the discrete distribution situation is as follows: because the distribution of noise is relatively common in the whole image, the whole image is filled with the noise, and the number of noise points is far larger than that of vacuum holes, the nearest point from the current point to the periphery can be calculated in the judgment of the discrete distribution degree of the abnormal connected domainThe mean value of the distances of the abnormal points represents the discrete condition of the abnormal points; then the point at which the discrete value is more abnormal (most recently @)>Small distance mean) can be determined as a point with a high likelihood of a vacuum hole.
The basis for judging whether the abnormal communication area is a vacuum hole is as follows: the salt and pepper noise is distributed relatively evenly in the local space and relatively regular, so that the distance between the noise point and the noise point is relatively even; if the outlier is a vacuum hole, it is closer to the surrounding pixels, i.e., the density is greater than the density of other points in the field.
The discrete degree of each abnormal connected domain in the space is reflected by the judgment of the distance between each abnormal connected domain and the surrounding abnormal points; for any abnormal connected domain: using the abnormal connected domain as the center of a circle and the abnormal points in any direction around the abnormal connected domain as the search target range to find out the point nearest to the current center of the circleThe distance of the singular points, stored in the collection +>Recording as a neighborhood pixel point set of the abnormal connected domain, namely constructing and obtaining a target circle corresponding to the abnormal connected domain by taking the abnormal connected domain as a circle center, wherein the radius of the target circle needs to be determined according to actual conditions, and recording other abnormal points except the abnormal point in the abnormal connected domain in the target circle corresponding to the abnormal connected domain as neighborhood pixel points of the abnormal connected domain; if the current connected domain is a vacuum hole, the distribution of the connected domain in the image can disturb the salt and pepper noise which is originally regularly distributed in the image, and because the noise point and the cavity point in the space can be sequentially used as the central points to be judged according to the mode, the distance from the noise point to the first abnormal point closest to the noise point and the cavity point can be influenced by the vacuum hole; assume that ^ is greater than or equal to, as shown in FIG. 2>Is a hole, the rest->Some smaller dots around the original image are the salt and pepper noise present in the original image, and the passing->Will be subjected to surrounding abnormal points>Due to the presence of a vacuum hole, the nearest distance between the adjacent abnormal point and the vacuum holeFrom, these points are outliers), the outliers around them that are closest to themselves are the holes, i.e., the closest distance is the distance from itself to the hole; and the remaining noise points, with the exception of the affected noise points, which are closest to themselves +>The distance mean value difference of the abnormal points is not large; in order to be unaffected by the distance of the nearest outlier, appropriate weights need to be assigned.
For any abnormal connected domain: calculating the distance from each pixel point in the neighborhood pixel point set corresponding to the abnormal connected domain; sorting according to the distance from small to large to obtain a corresponding distance sequence; obtaining the average distance corresponding to the abnormal connected domain according to the distance sequence corresponding to the abnormal connected domain; calculating the average distance corresponding to the abnormal connected domain according to the following formula:
wherein,is the average distance corresponding to the abnormally connected field, <' >>The number of the pixel points in the neighborhood pixel point set corresponding to the abnormal connected domain is judged>For the first parameter value in the distance sequence corresponding to the abnormally connected field, based on the absolute value of the parameter value in the distance sequence, and>is the weight of the first parameter value in the distance sequence corresponding to the abnormal connected domain, and>for the sum of the other parameter values in the distance sequence corresponding to the abnormal connected field except the first parameter value>Is->The weight of (c). Need to be given to a &'s device to prevent interference with distance data by the first outlier>Assign less weight and thus set +>、。
Calculating the average of each abnormal connected domain in the space according to the formulaA distance; the smaller the value is, the denser the current abnormal connected domain is proved to be, namely the possibility of vacuum holes is higher. Thus when>Greater than 1 and larger values are more likely to be vacuum holes, and smaller average distances are more likely to be vacuum holes.
For any abnormal connected domain, calculating the probability index of the abnormal connected domain as a vacuum hole according to the following formula:
wherein,the abnormal connected domain is trueLikelihood indicator for a cavity>For the average distance corresponding to the abnormal connected field>Is the area difference ratio of the abnormal connected domain>Is->Based on the weight of->Is->The weight of (c);And &>Representing a weight, wherein a proper weight is given to the judged influence magnitude according to the difference rate and the dispersion degree; since the evaluation of the degree of difference between the mean distance and the density is more objective than the evaluation of the former is set->0.4,(ii) a Due to>And a suspected vacuum hole>Is proportional to the value of (c) in the sample,and a suspected vacuum hole>Is inversely proportional to the value of (d); the hyperbolic tangent function and the exponential function in the above equation are chosen to normalize the results.
The closer the value of (1) is, the higher the probability that the abnormal connected domain is a vacuum hole degree is, and the probability threshold is set to be ^ based>(ii) a And when the calculated value of the abnormal connected domain is larger than the possibility threshold value, judging the abnormal connected domain is a vacuum hole, and when the value of the abnormal connected domain is smaller than the possibility threshold value, judging the abnormal connected domain is noise.
And S003, repairing the abnormal communication region which is the vacuum hole to obtain an iron plate corrosion region.
In the embodiment, the abnormal communication region which is the vacuum hole is corrected to be the color of the rusty region, so as to obtain specific rusty region data; the steps are comprehensively analyzed and judged from two aspects to obtain the part belonging to the vacuum hole in the abnormal point region in the image, and the vacuum hole part is repaired to obtain a specific corrosion region; at this time, abnormal point detection needs to be performed on the edge of the segmented image, because in the segmentation process, some errors may exist in the effect of the combination processing of the algorithm and the actual scene, which causes abnormal burrs or small protruding pixel points to exist on the edge, and this step is used to specifically solve this edge defect. The information characteristics of a certain pixel point on the edge are known to be coherent relative to the front and rear edge points under normal conditions, if the point is an abnormal point, the point has some salience for the front and rear edge points, the abnormal change condition of the edge curve can be analyzed through chain code operation, and the abnormal point can be found according to the mutation of numerical values. Selecting 8 connected chain codes, comparing with the actual situation that 4 connected chain codes are more consistent with pixel point distribution, describing that the obtained adjacent pixel point information is more accurate, firstly randomly finding a starting point on the edge, starting traversing the edge point information in the clockwise direction, and expressing the information by using a numerical value in the 8 connected domain chain codes according to the position of the next pixel point relative to the current pixel point; the edge pixel distribution as in fig. 3 can be represented by 8 connected domain chain codes as: 1110070; searching pixel points in the image corresponding to the mutation data by analyzing the obtained coded data information to obtain abnormal points in the edge points, and then repairing the points; and finally, a more accurate rusted area is obtained.
Through the steps, a more accurate rust area can be obtained, the rust degree of the iron plate is judged according to the obtained segmentation image, the influence degree of rust and the rust removal difficulty degree are evaluated, and classification processing is performed in a targeted manner.
In the embodiment, firstly, an iron plate corrosion gray image is obtained; obtaining an iron plate corrosion area growth segmentation image corresponding to the iron plate corrosion gray level image and each connected domain on the iron plate corrosion area growth segmentation image based on a region growth algorithm; the number of the pixel points in the connected domain is more than or equal to 1; then obtaining the area and color characteristic index of each connected domain; obtaining different abnormal connected domains according to the area and color characteristic indexes; obtaining the area difference rate of each abnormal connected domain according to the area of each abnormal connected domain; acquiring a neighborhood pixel point set of each abnormal connected domain; obtaining the average distance corresponding to each abnormal connected domain according to the distance from each pixel point in the neighborhood pixel point set corresponding to each abnormal connected domain to the corresponding abnormal connected domain; finally, obtaining an abnormal communication domain of the vacuum hole according to the area difference rate and the average distance; and repairing the abnormal communication region which is the vacuum hole to obtain an iron plate corrosion region. The embodiment can accurately determine the rust area of the iron plate.
The above-mentioned embodiments are only used to illustrate the technical solutions of the present application, and not to limit the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; the modifications or substitutions do not make the essence of the corresponding technical solutions deviate from the technical solutions of the embodiments of the present application, and are included in the protection scope of the present application.
Claims (4)
1. A method for detecting iron plate corrosion defects is characterized by comprising the following steps:
acquiring a gray image of iron plate corrosion; obtaining an iron plate corrosion area growth segmentation image corresponding to the iron plate corrosion gray image and each communication domain on the iron plate corrosion area growth segmentation image based on a region growth algorithm; the number of the pixel points in the connected domain is more than or equal to 1;
acquiring the area and color characteristic index of each connected domain; obtaining various abnormal connected domains according to the area and color characteristic indexes; obtaining the area difference rate of each abnormal connected domain according to the area of each abnormal connected domain; acquiring a neighborhood pixel point set of each abnormal connected domain; obtaining the average distance corresponding to each abnormal connected domain according to the distance from each pixel point in the neighborhood pixel point set corresponding to each abnormal connected domain to the corresponding abnormal connected domain; obtaining an abnormal communication domain of the vacuum hole according to the area difference rate and the average distance;
repairing the abnormal communication region which is the vacuum hole to obtain an iron plate corrosion region;
a method of obtaining distinct connected domains, comprising:
recording a connected domain with the area smaller than a preset area threshold value and the color characteristic index of the corresponding connected domain between [220,255] as an abnormal connected domain; recording the pixel points in the abnormal connected domain as abnormal points;
the method for acquiring the neighborhood pixel point set of each abnormal connected domain comprises the following steps:
for any anomalous connected domain:
constructing and obtaining a target circle corresponding to the abnormal communication domain by taking the abnormal communication domain as a circle center;
recording other abnormal points except the abnormal point in the abnormal connected domain in a target circle corresponding to the abnormal connected domain as neighborhood pixel points of the abnormal connected domain;
constructing a neighborhood pixel point set of the abnormal connected domain according to each neighborhood pixel point of the abnormal connected domain;
the method for obtaining the average distance corresponding to each abnormal connected domain comprises the following steps:
for any abnormal connected domain:
calculating the distance from each pixel point in the neighborhood pixel point set corresponding to the abnormal connected domain;
sorting according to the distance from small to large to obtain a corresponding distance sequence;
obtaining the average distance corresponding to the abnormal connected domain according to the distance sequence corresponding to the abnormal connected domain;
calculating the average distance corresponding to the abnormal connected domain according to the following formula:
wherein,is the average distance corresponding to the abnormally connected field, <' >>The number of the pixel points in the neighborhood pixel point set corresponding to the abnormal connected domain is judged>For the first parameter value in the distance sequence corresponding to the abnormally connected field, <>Is the weight of the first parameter value in the distance sequence corresponding to the abnormal connected component field, and->Is the exception ofThe sum of the remaining parameter values in the distance sequence corresponding to the pass field, excluding the first parameter value, is->Is->The weight of (c).
2. The iron plate corrosion defect detection method of claim 1, wherein the method for obtaining the area and color characteristic indexes of each connected domain comprises the following steps:
acquiring the area of each connected domain; the area of each connected domain is measured by the number of pixel points in the connected domain;
and acquiring the mean value of the gray values of the pixels in each connected domain, and recording the mean value of the gray values of the pixels in each connected domain as the color characteristic index of each connected domain.
3. The iron plate corrosion defect detection method of claim 1, wherein the method for obtaining the area difference rate of each abnormal connected domain comprises:
acquiring the area of a standard noise connected domain; the number of the pixel points in the standard noise connected domain is(ii) a Recording the area of the Standard noise connected Domain as `>;
Obtaining the area difference rate of each abnormal connected domain according to the area of the standard noise connected domain and the area of each abnormal connected domain;
for any abnormal connected domain, calculating the area difference rate of the abnormal connected domain according to the following formula:
4. The method for detecting the rust defect of the iron plate as claimed in claim 1, wherein for any abnormal connected domain, the probability index that the abnormal connected domain is a vacuum hole is calculated according to the following formula:
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211248930.XA CN115311304B (en) | 2022-10-12 | 2022-10-12 | Iron plate corrosion defect detection method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211248930.XA CN115311304B (en) | 2022-10-12 | 2022-10-12 | Iron plate corrosion defect detection method |
Publications (2)
Publication Number | Publication Date |
---|---|
CN115311304A CN115311304A (en) | 2022-11-08 |
CN115311304B true CN115311304B (en) | 2023-04-14 |
Family
ID=83868325
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202211248930.XA Active CN115311304B (en) | 2022-10-12 | 2022-10-12 | Iron plate corrosion defect detection method |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115311304B (en) |
Families Citing this family (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116363126B (en) * | 2023-05-30 | 2023-08-22 | 东莞市立时电子有限公司 | Welding quality detection method for data line USB plug |
CN116485797B (en) * | 2023-06-25 | 2023-08-29 | 潍坊亚贝涂料有限公司 | Artificial intelligence-based paint color difference rapid detection method |
CN117197127B (en) * | 2023-11-02 | 2024-02-20 | 广东乾威精密连接器有限公司 | Automobile terminal detection method based on machine vision |
CN117649412B (en) * | 2024-01-30 | 2024-04-09 | 山东海天七彩建材有限公司 | Aluminum material surface quality detection method |
CN118196025B (en) * | 2024-03-13 | 2024-11-01 | 深圳个元科技有限公司 | Visual detection method and system for gear appearance defects |
Family Cites Families (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP5926937B2 (en) * | 2011-11-30 | 2016-05-25 | オリンパス株式会社 | Image processing apparatus, image processing method, and image processing program |
CN115049649B (en) * | 2022-08-12 | 2022-11-11 | 山东振鹏建筑钢品科技有限公司 | Reinforcing steel bar polishing and rust removing control method based on corrosion degree |
CN115100203B (en) * | 2022-08-25 | 2022-11-18 | 山东振鹏建筑钢品科技有限公司 | Method for detecting quality of steel bar polishing and rust removal |
-
2022
- 2022-10-12 CN CN202211248930.XA patent/CN115311304B/en active Active
Also Published As
Publication number | Publication date |
---|---|
CN115311304A (en) | 2022-11-08 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN115311304B (en) | Iron plate corrosion defect detection method | |
CN115829883B (en) | Surface image denoising method for special-shaped metal structural member | |
CN117173184B (en) | Road construction quality detection method and system based on artificial intelligence | |
CN115330783A (en) | Steel wire rope defect detection method | |
CN115294120B (en) | Valve surface quality detection method based on image recognition | |
CN114419025A (en) | Fiberboard quality evaluation method based on image processing | |
CN116703251B (en) | Rubber ring production quality detection method based on artificial intelligence | |
CN109685760B (en) | MATLAB-based SLM powder bed powder laying image convex hull depression defect detection method | |
CN115294159B (en) | Method for dividing corroded area of metal fastener | |
CN116309537A (en) | Defect detection method for oil stain on surface of tab die | |
CN115115638B (en) | Oil leakage detection and judgment method for hydraulic system | |
CN113838054A (en) | Mechanical part surface damage detection method based on artificial intelligence | |
CN106780347B (en) | Early loquat bruise identification method based on OCT image processing | |
CN117058147B (en) | Environment-friendly plastic product defect detection method based on computer vision | |
CN115841491B (en) | Quality detection method for porous metal material | |
CN115578389A (en) | Defect detection method of groove MOS device | |
CN115861320A (en) | Intelligent detection method for automobile part machining information | |
CN116304963B (en) | Data processing system suitable for geological disaster early warning | |
CN115222735B (en) | Metal mold quality detection method based on pockmark defects | |
CN115115603A (en) | Automobile accessory flywheel surface detection method based on artificial intelligence | |
CN117152119A (en) | Profile flaw visual detection method based on image processing | |
CN116503394A (en) | Printed product surface roughness detection method based on image | |
CN118037730B (en) | Crack length detection system based on computer image processing | |
CN115880280A (en) | Detection method for quality of steel structure weld joint | |
CN117705815B (en) | Printing 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 |