CN113870264B - Tubular part port abnormity detection method and system based on image processing - Google Patents
Tubular part port abnormity detection method and system based on image processing Download PDFInfo
- Publication number
- CN113870264B CN113870264B CN202111460216.2A CN202111460216A CN113870264B CN 113870264 B CN113870264 B CN 113870264B CN 202111460216 A CN202111460216 A CN 202111460216A CN 113870264 B CN113870264 B CN 113870264B
- Authority
- CN
- China
- Prior art keywords
- image
- tubular part
- port
- edge
- rubber tubular
- 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
- 238000001514 detection method Methods 0.000 title claims abstract description 22
- 230000002159 abnormal effect Effects 0.000 claims abstract description 92
- 238000000034 method Methods 0.000 claims abstract description 33
- 230000007547 defect Effects 0.000 claims abstract description 27
- 239000013598 vector Substances 0.000 claims description 90
- 230000005856 abnormality Effects 0.000 claims description 26
- 238000005192 partition Methods 0.000 claims description 24
- 239000000203 mixture Substances 0.000 claims description 18
- 238000003708 edge detection Methods 0.000 claims description 7
- 238000004590 computer program Methods 0.000 claims description 3
- 230000000694 effects Effects 0.000 description 30
- 238000010586 diagram Methods 0.000 description 14
- 230000008447 perception Effects 0.000 description 12
- 230000008569 process Effects 0.000 description 11
- 238000010606 normalization Methods 0.000 description 5
- 238000007789 sealing Methods 0.000 description 4
- 238000000605 extraction Methods 0.000 description 3
- 230000011218 segmentation Effects 0.000 description 2
- 230000002950 deficient Effects 0.000 description 1
- 230000006870 function Effects 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 238000002372 labelling Methods 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 239000000463 material Substances 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
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/21—Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
- G06F18/214—Generating training patterns; Bootstrap methods, e.g. bagging or boosting
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/22—Matching criteria, e.g. proximity measures
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/23—Clustering techniques
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T5/00—Image enhancement or restoration
- G06T5/10—Image enhancement or restoration using non-spatial domain filtering
-
- 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/12—Edge-based segmentation
-
- 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/13—Edge detection
-
- 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/20—Special algorithmic details
- G06T2207/20081—Training; Learning
-
- 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/30—Subject of image; Context of image processing
- G06T2207/30108—Industrial image inspection
- G06T2207/30164—Workpiece; Machine component
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Data Mining & Analysis (AREA)
- General Physics & Mathematics (AREA)
- Physics & Mathematics (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Bioinformatics & Cheminformatics (AREA)
- Evolutionary Biology (AREA)
- Evolutionary Computation (AREA)
- Bioinformatics & Computational Biology (AREA)
- General Engineering & Computer Science (AREA)
- Artificial Intelligence (AREA)
- Life Sciences & Earth Sciences (AREA)
- Quality & Reliability (AREA)
- Image Analysis (AREA)
- Image Processing (AREA)
Abstract
The invention relates to a tubular part port abnormity detection method and system based on image processing, and belongs to the technical field of tubular part port abnormity detection. The method comprises the following steps: obtaining a first abnormal degree index corresponding to the port image of the rubber tubular part to be detected according to the difference between the edge image and the corresponding standard edge image; obtaining the structural distribution uniformity degree corresponding to the port image of the rubber tubular part to be detected according to the position information and the pixel value of each pixel point on the port image of the rubber tubular part to be detected; obtaining a second abnormal degree index corresponding to the port image of the rubber tubular part to be detected according to the defect degree and the structural distribution uniformity degree; and obtaining the abnormal degree corresponding to the port of the rubber tubular part according to the first abnormal degree index and the second abnormal degree index. The method can improve the accuracy of the detection result of the abnormity of the port of the rubber tubular part.
Description
Technical Field
The invention relates to the technical field of tubular part port abnormity detection, in particular to a tubular part port abnormity detection method and system based on image processing.
Background
With the improvement of the mechanization level of China and the application of new materials, the rubber tubular part is widely applied to the fields of machinery and manufacturing; the rubber tubular part formed by the rubber tube has the performances of stamping resistance, wear resistance and the like; since rubber tubular parts are generally used for the connection between the parts, when the ports of the rubber tubular parts are seriously deformed or otherwise defective, the sealing performance of the connection between the parts is abnormal, and the abnormal sealing performance can cause unpredictable accidents or consequences.
The existing method for detecting the abnormality of the ports of the rubber tubular parts is generally based on manual detection, the mode of manually detecting the abnormality of the ports of the rubber tubular parts has strong subjectivity, the abnormality can be found only when the ports have obvious deformation or defects, the ports of some rubber tubular parts which have slight deformation or defects and influence the sealing property of connection between the parts are easily judged to be normal rubber tubular parts, and the detection result of the abnormality of the ports of the rubber tubular parts is not accurate enough.
Disclosure of Invention
The invention provides a method and a system for detecting the port abnormality of a tubular part based on image processing, which are used for solving the problem that the port abnormality of the tubular part cannot be accurately detected in the prior art, and adopt the following technical scheme:
in a first aspect, an embodiment of the present invention provides a method and a system for detecting a port abnormality of a tubular part based on image processing, including the following steps:
acquiring a port image of a rubber tubular part to be detected; obtaining an edge image corresponding to the port image of the rubber tubular part to be detected according to the port image of the rubber tubular part to be detected;
obtaining a first abnormal degree index corresponding to the port image of the rubber tubular part to be detected according to the difference between the edge image and the corresponding standard edge image;
obtaining the corresponding defect degree of the port image of the rubber tubular part to be detected according to the difference between the pixel value of each pixel point on the port image of the rubber tubular part to be detected and the pixel value of the corresponding neighborhood pixel point;
obtaining the structural distribution uniformity degree corresponding to the port image of the rubber tubular part to be detected according to the position information and the pixel value of each pixel point on the port image of the rubber tubular part to be detected;
obtaining a second abnormal degree index corresponding to the port image of the rubber tubular part to be detected according to the defect degree and the structural distribution uniformity degree;
and obtaining the abnormal degree corresponding to the port of the rubber tubular part according to the first abnormal degree index and the second abnormal degree index.
The invention also provides an image processing-based tubular part port abnormality detection system which comprises a memory and a processor, wherein the processor executes a computer program stored in the memory to realize the image processing-based tubular part port abnormality detection method.
Has the advantages that: the invention takes the difference between the edge image and the corresponding standard edge image as the basis for obtaining the first abnormal degree index corresponding to the port image of the rubber tubular part to be detected, the difference between the pixel value of each pixel point on the port image of the rubber tubular part to be detected and the pixel value of the corresponding neighborhood pixel point as the basis for obtaining the defect degree corresponding to the port image of the rubber tubular part to be detected, the position information and the pixel value of the pixel point on the port image of the rubber tubular part to be detected as the basis for obtaining the structure distribution uniformity degree corresponding to the port image of the rubber tubular part to be detected, the defect degree and the structure distribution uniformity degree as the basis for obtaining the second abnormal degree index corresponding to the port image of the rubber tubular part to be detected, and the first abnormal degree index and the second abnormal degree index as the basis for obtaining the abnormal degree corresponding to the port of the rubber tubular part, the accuracy of the detection result of the abnormity of the port of the rubber tubular part can be improved.
Preferably, the method for obtaining the first abnormal degree index corresponding to the port image of the rubber tubular part to be detected according to the difference between the edge image and the corresponding standard edge image comprises the following steps:
obtaining the corresponding excircle edge of the edge image according to the edge image; obtaining a standard excircle edge corresponding to the standard edge image according to the standard edge image; obtaining the circle center of the outer circle edge and the circle center of the standard outer circle edge by using Hough transform;
aligning the circle center of the outer circle edge with the circle center of the standard outer circle edge to obtain an image after the circle center of the outer circle edge is aligned with the circle center of the standard outer circle edge, recording the image after the circle center of the outer circle edge is aligned with the circle center of the standard outer circle edge as an aligned image, and recording the position where the circle center of the outer circle edge is aligned with the circle center of the standard outer circle edge as the circle center of the aligned image;
obtaining the overlapping area and the non-overlapping area of the excircle edge and the standard excircle edge on the alignment image according to the alignment image;
recording the area of the overlapping area as a first area corresponding to the port image of the rubber tubular part, and recording the area of the non-overlapping area as a second area corresponding to the port image of the rubber tubular part;
making a straight line through the outer circle edge, the standard outer circle edge and the circle center of the alignment image on the alignment image;
rotating the straight line on the alignment image along the clockwise direction, and calculating the intersection point distance of the straight line and the intersection point of the outer circle edge and the standard outer circle edge on the alignment image to obtain an intersection point distance sequence corresponding to the alignment image;
recording the maximum intersection point distance in the intersection point distance sequence as a first difference distance corresponding to the port image of the rubber tubular part to be detected;
and obtaining a first abnormal degree index corresponding to the port image of the rubber tubular part according to the first difference distance, the first area and the second area.
Preferably, the first abnormal degree index corresponding to the port image of the rubber tubular part is calculated according to the following formula:
wherein,is a first abnormal degree index corresponding to the port image of the rubber tubular part,a second area corresponding to the port image of the rubber tubular part,a first area corresponding to the port image of the rubber tubular part,the first difference distance corresponding to the port image of the rubber tubular part.
Preferably, the method for obtaining the standard edge image comprises the following steps:
acquiring a large number of port sample images of the rubber tubular part;
identifying sample edge images corresponding to the port sample images of the rubber tubular parts by using an edge detection algorithm;
obtaining the outer circle edge of the sample corresponding to the port sample image of each rubber tubular part according to the sample edge image;
obtaining a minimum circumscribed rectangle corresponding to the outer circle edge of each sample according to the outer circle edge of the sample; constructing a sample vector corresponding to each minimum circumscribed rectangle according to the length and the width corresponding to the minimum circumscribed rectangle; clustering the sample vectors, selecting the category corresponding to the maximum sample vector quantity, and marking the category corresponding to the maximum sample vector quantity as a first category;
obtaining the average value of the lengths of the minimum circumscribed rectangles corresponding to the sample vectors in the first category according to the lengths of the minimum circumscribed rectangles corresponding to the sample vectors in the first category;
obtaining the average value of the minimum circumscribed rectangle widths corresponding to the sample vectors in the first category according to the widths of the minimum circumscribed rectangles corresponding to the sample vectors in the first category;
obtaining the standard degree of the sample excircle edge corresponding to the minimum circumscribed rectangle corresponding to each sample vector in the first category according to the length and width of the minimum circumscribed rectangle corresponding to each sample vector in the first category, the average value of the length of the minimum circumscribed rectangle corresponding to the sample vector in the first category and the average value of the width of the minimum circumscribed rectangle corresponding to the sample vector in the first category;
constructing a standard degree sequence corresponding to the sample vectors in the first category according to the standard degree of the sample excircle edge corresponding to the minimum circumscribed rectangle corresponding to each sample vector in the first category; and selecting a sample edge image corresponding to the sample excircle edge corresponding to the maximum standard degree in the standard degree sequence, and recording the sample excircle edge corresponding to the maximum standard degree as a standard edge image corresponding to the edge image.
Preferably, the standard degree of the sample outer circle edge corresponding to the minimum circumscribed rectangle corresponding to each sample vector in the first category is calculated according to the following formula:
wherein,is the second in the first categoryThe standard degree of the sample excircle edge corresponding to the minimum bounding rectangle corresponding to each sample vector,is the average of the minimum bounding rectangle lengths corresponding to the sample vectors in the first class,is the mean of the minimum bounding rectangle widths corresponding to the sample vectors in the first class,is the second in the first categoryThe length of the minimum bounding rectangle for a sample vector,is the second in the first categoryThe width of the minimum bounding rectangle to which the sample vector corresponds.
Preferably, the method for obtaining the corresponding defect degree of the port image of the rubber tubular part to be detected according to the difference between the pixel value of each pixel point on the port image of the rubber tubular part to be detected and the pixel value of the corresponding neighborhood pixel point comprises the following steps:
calculating the difference value between the pixel value of each pixel point on the port image of the rubber tubular part to be detected and the pixel value of each pixel point corresponding to the eight neighborhoods; obtaining abnormal pixel points on the port image of the rubber tubular part to be detected according to the difference value between the pixel value of each pixel point on the port image of the rubber tubular part to be detected and the pixel value of each pixel point corresponding to eight neighborhoods;
and obtaining the defect degree corresponding to the port image of the rubber tubular part to be detected according to the abnormal pixel points.
Preferably, the method for obtaining the structural distribution uniformity degree corresponding to the port image of the rubber tubular part to be detected according to the position information and the pixel value of each pixel point on the port image of the rubber tubular part to be detected comprises the following steps:
dividing the port image of the rubber tubular part to be detected into a plurality of areas uniformly by using a dividing line;
according to the position information and the pixel values of the pixel points on the left side and the right side corresponding to the pixel points on the dividing lines, fitting to obtain a three-dimensional Gaussian mixture model corresponding to the pixel points on the dividing lines;
according to the three-dimensional Gaussian mixture model, obtaining a structural distribution characteristic vector corresponding to each pixel point on each partition line; obtaining a structure distribution characteristic vector sequence corresponding to each partition line according to the structure distribution characteristic vector corresponding to each pixel point on each partition line;
calculating cosine similarity between every two structural distribution feature vectors in the structural distribution feature vector sequence, and obtaining a cosine similarity mean value corresponding to each partition line according to the cosine similarity;
and obtaining the structural distribution uniformity degree corresponding to the port image of the rubber tubular part to be detected according to the cosine similarity mean value corresponding to each partition line.
Preferably, the second abnormal degree index corresponding to the port image of the rubber tubular part to be detected is calculated according to the following formula:
wherein,is a second abnormal degree index corresponding to the port image of the rubber tubular part to be detected,the defect degree corresponding to the port image of the rubber tubular part to be detected,the structural distribution uniformity degree corresponding to the port image of the rubber tubular part to be detected.
Drawings
To more clearly illustrate the embodiments of the present invention or the technical solutions and advantages of the prior art, the following description will be made
While the drawings necessary for the embodiment or prior art description are briefly described, it should be apparent that the drawings in the following description are merely examples of the invention and that other drawings may be derived from those drawings by those of ordinary skill in the art without inventive step.
FIG. 1 is a flow chart of a method for detecting port abnormality of a tubular part based on image processing according to the present invention;
FIG. 2 is a schematic diagram of an edge image according to the present invention;
FIG. 3 is a schematic view of an aligned image of the present invention;
FIG. 4 is a schematic view of the segmentation of the port image region of the rubber tubular component to be detected 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 tubular part port abnormality detection method based on image processing, which is described in detail as follows:
as shown in fig. 1, the method for detecting the port abnormality of the tubular part based on the image processing comprises the following steps:
and S001, acquiring a port image of the rubber tubular part to be detected, and identifying an edge image corresponding to the port of the rubber tubular part to be detected.
In this embodiment, a port through which the rubber tubular part to be detected is connected with other parts is vertically placed upwards on the detection platform, the industrial camera is arranged right above the detection platform, the industrial camera is downward when viewed from above, and an image of the rubber tubular part to be detected acquired by the industrial camera is an RGB image.
In the embodiment, a port image of the rubber tubular part to be detected, which is acquired by an industrial camera, is input into a semantic perception network to extract the port of the rubber tubular part, so that a semantic perception effect graph of only the port image of the rubber tubular part to be detected is obtained, and the obtained semantic perception effect graph of only the port image of the rubber tubular part to be detected is recorded as a port effect graph of the rubber tubular part to be detected; the semantic perception network of the embodiment is of an Encoder-Decoder structure, the semantic perception network performs convolution operation through an Encoder to extract features, the output result of the Encoder is a feature map, and the feature map is operated through a Decoder to obtain a semantic perception effect map; the specific training process of the semantic perception network comprises the following steps: acquiring a training sample set, wherein the training sample set comprises a plurality of RGB (red, green and blue) images of port samples of rubber tubular parts with the same specification; marking the port area of the RGB image of each rubber tubular part port sample as 1, marking other areas as 0, inputting the RGB image and marking data of each rubber tubular part port sample into a semantic perception network without training, performing iterative training by adopting a cross entropy loss function, and continuously updating network parameters; in this embodiment, the specific network structure and training process of the semantic awareness network are the prior art, and therefore this embodiment is not described in detail.
In the embodiment, a Canny edge detection algorithm is used for carrying out edge extraction on the obtained port effect diagram of the rubber tubular part to be detected to obtain an edge image corresponding to the port effect diagram of the rubber tubular part to be detected, wherein the edge image comprises an inner circle edge and an outer circle edge, and as shown in fig. 2, 1 is the inner circle edge, and 2 is the outer circle edge; in this embodiment, the Canny edge detection algorithm is a known technique, and therefore this embodiment is not described in detail; as other embodiments, other algorithms can be used for performing edge extraction on the port effect map of the rubber tubular part to be detected according to different requirements, for example, the algorithm can be a Sobel edge detection algorithm or a Roberts edge detection algorithm.
And S002, obtaining a first abnormal degree index corresponding to the port image of the rubber tubular part to be detected according to the difference between the edge image and the corresponding standard edge image.
In the embodiment, a first abnormal degree index corresponding to the port image of the rubber tubular part to be detected is obtained by analyzing the difference between the edge image corresponding to the port effect diagram of the rubber tubular part to be detected and the corresponding standard edge image, and the first abnormal degree index is used as a basis for subsequently analyzing the abnormal degree of the port of the rubber tubular part; in this embodiment, a first abnormal degree index corresponding to the port image of the rubber tubular part to be detected is obtained according to the first difference distance, the first area and the second area corresponding to the port effect diagram of the rubber tubular part to be detected.
(a) The standard edge image is a basis for obtaining a first difference distance, a first area and a second area corresponding to a port effect diagram of the rubber tubular part to be detected; in this embodiment, the specific process of obtaining the standard edge image is as follows:
acquiring a large number of port sample images of the rubber tubular part; obtaining a semantic perception effect image of only the port sample image of the rubber tubular part by using a semantic perception effect network, and recording the obtained semantic perception effect image of only the port sample image of the rubber tubular part as a port sample effect image of the rubber tubular part; and performing edge extraction on the port sample effect graph of each rubber tubular part by using a Canny edge detection algorithm to obtain a sample edge image corresponding to the port sample effect graph of each rubber tubular part.
In this embodiment, the sample inner circle edge and the sample outer circle edge on the sample edge image corresponding to the rubber tubular part port sample effect map are marked, and the sample inner circle edge on each sample edge image is markedWhereinis the inner circle edge of the sample on the 1 st sample edge image,is as followsThe inner circle edge of the sample on the edge image of the sample,the number of the sample edge images is also the number of the effect graphs of the port samples of the rubber tubular part; labeling sample outer circle edges on each sample edge image asWhereinis the sample outer circle edge on the 1 st sample edge image,is as followsThe sample outer circle edge on the sample edge image.
In this embodiment, the effect map is corresponding to the port sample of each rubber tubular partObtaining the minimum circumscribed rectangle corresponding to the outer circle edge of each sample on the outer circle edge of the sample on the sample edge image; constructing a sample vector corresponding to each minimum circumscribed rectangle according to the length and the width of the minimum circumscribed rectangle corresponding to the excircle edge of each sampleWhereinthe length of the minimum bounding rectangle is corresponding to the sample excircle edge on the 1 st sample edge image,the width of the sample outer circle edge corresponding to the minimum circumscribed rectangle on the 1 st sample edge image,the sample vector of the minimum bounding rectangle corresponding to the sample excircle edge on the 1 st sample edge image,is as followsThe sample outer circle edge on each sample edge image corresponds to the length of the minimum bounding rectangle,is as followsThe sample outer circle edge on each sample edge image corresponds to the width of the minimum circumscribed rectangle,is as followsThe sample outer circle edge on each sample edge image corresponds to the sample vector of the minimum bounding rectangle.
In the embodiment, a DBSCAN clustering algorithm is used for clustering the sample vectors corresponding to the minimum circumscribed rectangles to obtain a plurality of clustering categories; before the DBSCAN clustering algorithm is used, the size of the neighborhood radius and the threshold of the number of neighborhood samples need to be determined, in this embodiment, the neighborhood radius is set to 3, and the threshold of the number of neighborhood samples is set to 5.
As another embodiment, the size of the neighborhood radius and the threshold of the number of neighborhood samples before use of different DBSCAN clustering algorithms may also be set according to different requirements, for example, the neighborhood radius may be set to 4, and the threshold of the number of neighborhood samples may be set to 6.
In this embodiment, the category corresponding to the maximum number of sample vectors in the cluster categories is selected, the category corresponding to the maximum number of sample vectors is recorded as a first category, and the average value of the lengths of the minimum circumscribed rectangles corresponding to the sample vectors in the first category is obtained according to the length of the minimum circumscribed rectangle corresponding to each sample vector in the first category; calculating the average value of the minimum bounding rectangle length corresponding to the sample vector in the first category according to the following formula:
wherein,is the average of the minimum bounding rectangle lengths corresponding to the sample vectors in the first class,is the number of sample vectors in the first class,is the second in the first categoryThe length of the minimum bounding rectangle to which the sample vector corresponds.
In this embodiment, the average value of the minimum circumscribed rectangle widths corresponding to the sample vectors in the first category is obtained according to the width of the minimum circumscribed rectangle corresponding to each sample vector in the first category; calculating the average value of the minimum bounding rectangle width corresponding to the sample vector in the first category according to the following formula:
wherein,is the mean of the minimum bounding rectangle widths corresponding to the sample vectors in the first class,is the number of sample vectors in the first class,is the second in the first categoryThe width of the minimum bounding rectangle to which the sample vector corresponds.
In this embodiment, the standard degree of the outer circle edge of the sample corresponding to the minimum circumscribed rectangle corresponding to each sample vector in the first category is obtained according to the obtained length and width of the minimum circumscribed rectangle corresponding to each sample vector in the first category, the average value of the length of the minimum circumscribed rectangle corresponding to the sample vector in the first category, and the average value of the width of the minimum circumscribed rectangle corresponding to the sample vector in the first category; calculating the standard degree of the sample excircle edge corresponding to the minimum circumscribed rectangle corresponding to each sample vector in the first category according to the following formula:
wherein,is of the first classTo middleThe standard degree of the sample excircle edge corresponding to the minimum bounding rectangle corresponding to each sample vector,is the average of the minimum bounding rectangle lengths corresponding to the sample vectors in the first class,is the mean of the minimum bounding rectangle widths corresponding to the sample vectors in the first class,is the second in the first categoryThe length of the minimum bounding rectangle for a sample vector,is the second in the first categoryThe width of the minimum circumscribed rectangle corresponding to each sample vector;the smaller the value of (A), corresponds toThe greater the value of (a) is,the larger the value of (d), the closer the sample outer circle edge corresponding to the minimum circumscribed rectangle corresponding to each sample vector in the first class is to the standard outer circle edge.
In this embodiment, a standard degree sequence is constructed according to the obtained standard degree; and selecting the maximum standard degree in the standard degree sequence, and recording the sample edge image corresponding to the sample excircle edge corresponding to the maximum standard degree as the standard edge image of the edge image corresponding to the port effect diagram of the rubber tubular part to be detected.
As another embodiment, other methods for obtaining the standard edge image may be set according to different requirements, for example, the standard edge image of the edge image corresponding to the port effect diagram of the rubber tubular part to be detected may also be obtained according to the inner circle edge of the sample on the sample edge image corresponding to the port effect diagram of each rubber tubular part.
(b) The specific process for obtaining the first difference distance, the first area and the second area corresponding to the port effect diagram of the rubber tubular part to be detected is as follows:
in the embodiment, according to the obtained edge image corresponding to the port effect diagram of the rubber tubular part to be detected, the outer circle edge of the edge image corresponding to the port effect diagram of the rubber tubular part to be detected is obtained; obtaining a standard excircle edge of a standard edge image corresponding to the edge image according to the standard edge image corresponding to the port effect image of the rubber tubular part to be detected; obtaining the center of a circle of the outer circle edge and the center of a circle of the standard outer circle edge by using Hough transform, aligning the obtained center of the outer circle edge with the center of the standard outer circle edge to obtain an image after the center of the outer circle edge is aligned with the center of the standard outer circle edge, recording the image after the center of the outer circle edge is aligned with the center of the standard outer circle edge as an aligned image, and recording the position where the center of the outer circle edge is aligned with the center of the standard outer circle edge as the center of the aligned image, as shown in FIG. 3, 3 is the standard outer circle edge on the aligned image, 4 is the outer circle edge on the aligned image, and the shadow part is the area of the overlapped area of the outer circle edge and the standard outer circle edge; according to the alignment image, calculating to obtain the overlapping area and the non-overlapping area of the upper outer circle edge and the standard outer circle edge of the alignment image, recording the overlapping area of the upper outer circle edge and the standard outer circle edge of the alignment image as a first area corresponding to the port image of the rubber tubular part, and recording the non-overlapping area of the upper outer circle edge and the standard outer circle edge of the alignment image as a second area corresponding to the port image of the rubber tubular part.
In this embodiment, a straight line is made through the outer circle edge on the aligned image, the standard outer circle edge and the center of the aligned image; rotating the straight line on the alignment image for multiple times along the clockwise direction and a fixed angle, and calculating the intersection point distance of the straight line and the outer circle edge on the alignment image and the standard outer circle edge; constructing a corresponding intersection point distance sequence, namely an intersection point distance sequence corresponding to the alignment image, according to the intersection point distance of the straight line and the outer circle edge on the alignment image and the standard outer circle edge; selecting the maximum intersection point distance in the intersection point distance sequence, and recording the maximum intersection point distance as a first difference distance corresponding to the port image of the rubber tubular part to be detected; in this embodiment, the fixed angle of rotation of the straight line on the alignment image is set to 1 degree, and the number of corresponding rotations is 360.
As another embodiment, different rotation modes and rotation angles may be set according to different requirements, for example, a straight line may be rotated counterclockwise on the alignment image, and the fixed angle of the rotation may be 2 degrees.
(c) The specific process of obtaining the first abnormal degree index corresponding to the port image of the rubber tubular part to be detected according to the first difference distance, the first area and the second area corresponding to the port effect diagram of the rubber tubular part to be detected is as follows:
in the embodiment, a first abnormal degree index corresponding to the port image of the rubber tubular part is obtained according to a first difference distance, a first area and a second area corresponding to the port image of the rubber tubular part to be detected; a first difference distance corresponding to the port image of the rubber tubular part to be detected and a second area corresponding to the port image of the rubber tubular part to be detected are in positive correlation with a first abnormal degree index corresponding to the port image of the rubber tubular part, and a first area corresponding to the port image of the rubber tubular part to be detected and the first abnormal degree index corresponding to the port image of the rubber tubular part are in negative correlation; calculating a first abnormal degree index corresponding to the port image of the rubber tubular part according to the following formula:
wherein,is a first abnormal degree index corresponding to the port image of the rubber tubular part,a second area corresponding to the port image of the rubber tubular part,a first area corresponding to the port image of the rubber tubular part,a first difference distance corresponding to the port image of the rubber tubular part; first abnormal degree index corresponding to rubber tubular part port imageThe larger the value of (A), the more serious the abnormality degree corresponding to the port of the rubber tubular part.
As another embodiment, the first abnormal degree index corresponding to the port image of the rubber tubular part may also be obtained by analyzing the difference between the inner circle edge of the edge image corresponding to the port effect diagram of the rubber tubular part to be detected and the corresponding standard inner circle edge.
And S003, obtaining the corresponding defect degree of the port image of the rubber tubular part to be detected according to the difference between the pixel value of each pixel point on the port image of the rubber tubular part to be detected and the pixel value of the pixel point in the corresponding neighborhood.
In this embodiment, the defect degree corresponding to the port image of the rubber tubular part to be detected is obtained by analyzing the difference between the pixel value of each pixel point on the port image of the rubber tubular part to be detected and the pixel value of the corresponding neighborhood pixel point, and the obtained defect degree is used as a basis for subsequently analyzing the second abnormal degree index corresponding to the port image of the rubber tubular part to be detected.
In this embodiment, the process of obtaining the abnormal pixel point on the RGB image of the port of the rubber tubular part to be detected is as follows: multiplying the port effect image of the rubber tubular part to be detected obtained through the semantic perception network and the port image of the rubber tubular part to be detected by using the port effect image of the rubber tubular part to be detected as a mask to obtain an RGB image of the port of the rubber tubular part to be detected; obtaining coordinates and pixel values of all pixel points on the RGB image of the port of the rubber tubular part to be detected according to the RGB image of the port of the rubber tubular part to be detected; obtaining eight neighborhood pixels corresponding to each pixel point on the RGB image of the port of the rubber tubular part to be detected according to the coordinates of each pixel point on the RGB image of the port of the rubber tubular part to be detected; constructing a neighborhood pixel point sequence corresponding to each pixel point on the RGB image of the port of the rubber tubular part to be detected according to each pixel point of the eight neighborhoods corresponding to each pixel point on the RGB image of the port of the rubber tubular part to be detected; calculating the difference value between each pixel point pixel value on the RGB image of the port of the rubber tubular part to be detected and each pixel point pixel value in the corresponding neighborhood pixel point sequence, constructing the difference value sequence corresponding to each pixel point on the RGB image of the port of the rubber tubular part to be detected according to the difference value between each pixel point pixel value on the RGB image of the port of the rubber tubular part to be detected and each pixel point pixel value in the corresponding neighborhood pixel point sequence, and obtaining the number of difference values in the difference value sequence corresponding to each pixel point on the RGB image of the port of the rubber tubular part to be detected, wherein the absolute value of each difference value is greater than the preset difference value threshold; judging whether the number of difference values in the difference value sequence corresponding to each pixel point on the RGB image of the port of the rubber tubular part to be detected is larger than a preset difference value threshold value or not, if so, judging that pixel points on the RGB image of the port of the rubber tubular part to be detected corresponding to the difference value sequence are abnormal pixel points, and otherwise, judging that the pixel points on the RGB image of the port of the rubber tubular part to be detected corresponding to the difference value sequence are normal pixel points.
In this embodiment, the preset difference threshold is set to 5, and the preset number threshold is set to 2; as another embodiment, other preset difference thresholds and preset number thresholds may be set according to different requirements, for example, the preset difference threshold may be 6, and the preset number threshold may be 3.
In the embodiment, the number of the abnormal pixel points on the RGB image of the port of the rubber tubular part to be detected can be obtained through the above process, and the number of the abnormal pixel points on the RGB image of the port of the rubber tubular part to be detected is recorded as the defect degree corresponding to the port image of the rubber tubular part to be detected; the larger the number of the abnormal pixel points on the RGB image of the port of the rubber tubular part to be detected is, the more serious the defect degree corresponding to the port image of the rubber tubular part to be detected is.
And step S004, obtaining the structural distribution uniformity degree corresponding to the port image of the rubber tubular part to be detected according to the position information and the pixel value of each pixel point on the port image of the rubber tubular part to be detected.
In this embodiment, the structural distribution uniformity degree corresponding to the port image of the rubber tubular part to be detected is obtained by analyzing the position information and the pixel value of the pixel point on the RGB image of the port of the rubber tubular part to be detected, and the obtained structural distribution uniformity degree is used as a basis for subsequently analyzing the second abnormal degree index.
In the embodiment, the port RGB image of the rubber tubular part to be detected is uniformly divided into a plurality of regions by using the dividing lines intersecting the inner circle edge and the outer circle edge on the edge image corresponding to the port RGB image of the rubber tubular part to be detected, in the embodiment, the port RGB image of the rubber tubular part to be detected is uniformly divided into 8 regions by using eight dividing lines, as shown in fig. 4, 5 is a dividing line; each dividing line is provided with a plurality of pixel points, and the pixel points on each dividing line form a pixel point sequence corresponding to each dividing line, namely each dividing line corresponds to one pixel point sequence; making a vertical line perpendicular to the corresponding dividing line through each pixel point on each dividing line, and obtaining a pixel point distribution sequence corresponding to each pixel point on each dividing line according to the pixel points on the vertical line; the specific process of obtaining the pixel point distribution sequence corresponding to each pixel point on each dividing line is as follows: obtaining the perpendicular line perpendicular to the dividing line at the 1 st pixel point on the 1 st dividing line according to the process, and marking the pixel point as the perpendicular lineDividing the center point of the perpendicular line of the line, and selecting the center point left side on the perpendicular lineMPixel point and right side of central pointMEach pixel point; according to the 1 st pixel point on the 1 st division line and the left side of the corresponding central pointFPixel point and right side of central pointMEach pixel point, constructing a pixel point distribution sequence corresponding to the 1 st pixel point on the 1 st division line, wherein the number of the pixel points in the pixel point distribution sequence is 2M+ 1; in the same way, the pixel point distribution sequence corresponding to each pixel point on each partition line can be obtained.
In this embodiment, the following componentsMThe value of (2) is set to 20, and as other embodiments, the value may be set differently according to the needsMA value, for example, can beMIs set to a value of 10; as another embodiment, the number of dividing lines may be set to be different according to the requirement, for example, the number of dividing lines may be set to be 10.
In the embodiment, the RGB image of the port of the rubber tubular part to be detected is subjected to graying processing to obtain a gray image of the port of the rubber tubular part to be detected corresponding to the RGB image of the port of the rubber tubular part to be detected; obtaining gray values and coordinate information of all pixel points in a pixel point distribution sequence corresponding to all pixel points on all partition lines on a port gray image of the rubber tubular part to be detected; fitting to obtain a three-dimensional Gaussian mixture model corresponding to each pixel point on each partition line according to the gray value and the coordinate information of each pixel point in the pixel point distribution sequence corresponding to each pixel point on each partition line; namely:
wherein,is as followsOn the dividing lineA three-dimensional Gaussian mixture model corresponding to each pixel point,is as aOn the dividing lineThe number of Gaussian sub-models in the three-dimensional Gaussian mixture model corresponding to each pixel point,is as followsOn the dividing lineIn the three-dimensional Gaussian mixture model corresponding to each pixel pointThe weight of each of the gaussian sub-models,is as followsOn the dividing lineIn the three-dimensional Gaussian mixture model corresponding to each pixel pointThe covariance of the individual gaussian sub-models,is as followsOn the dividing lineIn the three-dimensional Gaussian mixture model corresponding to each pixel pointThe feature vectors of the individual gaussian sub-models,is as followsOn the dividing lineIn the three-dimensional Gaussian mixture model corresponding to each pixel pointMean of feature vectors of the individual gaussian sub-models; first, theOn the dividing lineIn the three-dimensional Gaussian mixture model corresponding to each pixel pointFeature vector of individual Gaussian sub-modelWhereinis as followsOn the dividing linePixel distribution sequence corresponding to each pixel pointThe abscissa of each pixel point is given by its abscissa,is as followsOn the dividing linePixel distribution sequence corresponding to each pixel pointThe vertical coordinate of each pixel point is determined,is as followsOn the dividing linePixel distribution sequence corresponding to each pixel pointThe gray value of each pixel point.
In this embodiment, the process of obtaining the three-dimensional gaussian mixture model through fitting is the prior art, and therefore, detailed description is not given; in this embodiment, the weight of the gaussian sub-model in the three-dimensional gaussian mixture model corresponding to each pixel point on each partition line is calculated by an EM algorithm; the EM algorithm is prior art, and thus the present embodiment is not described in detail.
In this embodiment, each gaussian sub-model in the three-dimensional gaussian mixture model corresponding to each pixel point on each obtained dividing line is obtainedCorresponding to the three parameters, namely corresponding to each pixel point on each partition line, the weight of each Gaussian sub-model in the three-dimensional Gaussian mixture model, the covariance of each Gaussian sub-model and the mean value of the feature vector of each Gaussian sub-model; therefore, the three-dimensional Gaussian mixture model corresponding to each pixel point on each segmentation line contains 3 ×Each parameter is 3 x corresponding to the three-dimensional Gaussian mixture model corresponding to each pixel point on each partition lineParameters, 3 x corresponding to each pixel point on each partition line is constructedA vector of dimensions; corresponding each pixel point on each dividing line to 3The vector of the dimension is recorded as a structural distribution characteristic vector corresponding to each pixel point on each dividing line.
In this embodiment, a structure distribution feature vector sequence corresponding to each partition line is constructed according to a structure distribution feature vector corresponding to each pixel point on each partition line, and cosine similarity between every two structure distribution vectors in the structure distribution vector sequence corresponding to each partition line is calculated to obtain a cosine similarity set corresponding to each partition line; summing cosine similarities in the cosine similarity set corresponding to each partition line, and then calculating an average value to obtain a cosine similarity average value corresponding to each partition line; summing cosine similarity mean values corresponding to all dividing lines corresponding to RGB images of the port of the rubber tubular part to be detected, and recording the summed result as the structural distribution uniformity degree corresponding to the port image of the rubber tubular part to be detected; in this embodiment, the process of calculating the cosine similarity is the prior art, and therefore, will not be described in detail.
And S005, obtaining a second abnormal degree index corresponding to the port image of the rubber tubular part to be detected according to the defect degree and the structure distribution uniformity degree.
In this embodiment, a second abnormal degree index corresponding to the port image of the rubber tubular part to be detected is obtained by analyzing the defect degree and the structural distribution uniformity degree corresponding to the port image of the rubber tubular part to be detected, and then the second abnormal degree index is used as a basis for analyzing the abnormal degree corresponding to the port of the rubber tubular part.
In the embodiment, a second abnormal degree index corresponding to the port image of the rubber tubular part to be detected is obtained according to the defect degree and the structural distribution uniformity degree corresponding to the port image of the rubber tubular part to be detected, and the second abnormal degree index corresponding to the port image of the rubber tubular part to be detected is obtained; the defect degree and the structural distribution uniformity degree corresponding to the port image of the rubber tubular part to be detected are in positive correlation with a second abnormal degree index corresponding to the port image of the rubber tubular part to be detected; calculating a second abnormal degree index corresponding to the port image of the rubber tubular part to be detected according to the following formula:
wherein,is a second abnormal degree index corresponding to the port image of the rubber tubular part to be detected,the defect degree corresponding to the port image of the rubber tubular part to be detected,the structural distribution uniformity degree corresponding to the port image of the rubber tubular part to be detected is obtained; structural distribution uniformity corresponding to port images of rubber tubular parts to be detectedWhereinis the cosine similarity mean value corresponding to the 1 st parting line of the RGB image of the port of the rubber tubular part to be detected,the cosine similarity mean value corresponding to the 8 th dividing line of the RGB image of the port of the rubber tubular part to be detected; second abnormal degree index corresponding to port image of rubber tubular part to be detectedThe larger the value of (A), the more serious the abnormality degree corresponding to the port of the rubber tubular part.
And S006, obtaining the abnormal degree corresponding to the port of the rubber tubular part according to the first abnormal degree index and the second abnormal degree index.
In this embodiment, the first abnormal degree index and the second abnormal degree index corresponding to the obtained port image of the rubber tubular part to be detected are normalized, and the normalization processing is the prior art, so the embodiment is not described in detail; obtaining the abnormal degree corresponding to the port of the rubber tubular part according to the first abnormal degree index and the second abnormal degree index corresponding to the port image of the rubber tubular part to be detected after normalization processing; the first abnormal degree index and the second abnormal degree index corresponding to the port image of the rubber tubular part to be detected after normalization processing are in positive correlation with the abnormal degree corresponding to the port of the rubber tubular part; calculating the abnormal degree corresponding to the end opening of the rubber tubular part according to the following formula:
wherein,the abnormal degree corresponding to the end opening of the rubber tubular part,is a first abnormal degree index corresponding to the port image of the rubber tubular part to be detected after normalization processing,is composed ofThe corresponding weight of the weight is set to be,in order to detect the second abnormal degree index corresponding to the port image of the rubber tubular part after normalization processing,is composed ofThe corresponding weight of the weight is set to be,(ii) a Degree of abnormality corresponding to end opening of rubber tubular partThe larger the value of (A) is, the poorer the sealing property of the port of the rubber tubular part when the port is connected with other parts is; in this embodiment, the following componentsIs set to 0.4, willSet to 0.6; as another embodiment, different weight values may be set according to different requirements, for example, the weight values may be set according to different requirementsIs set to 0.3, willSet to 0.7.
In this embodiment, when the end of the rubber tubular component is abnormalWhen the value of the abnormal degree is larger than the preset abnormal degree threshold value, the rubber tubular part is judged to be an abnormal part and cannot be used; when the end of the rubber tubular part corresponds to abnormal degreeWhen the value of (A) is less than a preset abnormal degree threshold value, judging that the rubber tubular part is a normal part and can be put into use; in this embodiment, the preset abnormal degree threshold is an empirical value and needs to be set according to actual conditions.
Has the advantages that: in the embodiment, the difference between the edge image and the corresponding standard edge image is used as a basis for obtaining a first abnormal degree index corresponding to the port image of the rubber tubular part to be detected, the difference between the pixel value of each pixel point on the port image of the rubber tubular part to be detected and the pixel value of the corresponding neighborhood pixel point is used as a basis for obtaining the defect degree corresponding to the port image of the rubber tubular part to be detected, the position information and the pixel value of the pixel point on the port image of the rubber tubular part to be detected are used as a basis for obtaining the structure distribution uniformity degree corresponding to the port image of the rubber tubular part to be detected, the defect degree and the structure distribution uniformity degree are used as a basis for obtaining a second abnormal degree index corresponding to the port image of the rubber tubular part to be detected, and the first abnormal degree index and the second abnormal degree index are used as a basis for obtaining the abnormal degree corresponding to the port of the rubber tubular part, the accuracy of the detection result of the abnormity of the port of the rubber tubular part can be improved.
The tubular part port abnormality detection system based on image processing of the embodiment comprises a memory and a processor, wherein the processor executes a computer program stored in the memory to realize the tubular part port abnormality detection method based on image processing.
It should be noted that the order of the above-mentioned embodiments of the present invention is merely for description and does not represent the merits of the embodiments, and in some cases, actions or steps recited in the claims may be executed in an order different from the order of the embodiments and still achieve desirable results.
Claims (8)
1. A tubular part port abnormality detection method based on image processing is characterized by comprising the following steps:
acquiring a port image of a rubber tubular part to be detected; obtaining an edge image corresponding to the port image of the rubber tubular part to be detected according to the port image of the rubber tubular part to be detected;
obtaining a first abnormal degree index corresponding to the port image of the rubber tubular part to be detected according to the difference between the edge image and the corresponding standard edge image;
obtaining the corresponding defect degree of the port image of the rubber tubular part to be detected according to the difference between the pixel value of each pixel point on the port image of the rubber tubular part to be detected and the pixel value of the corresponding neighborhood pixel point;
obtaining the structural distribution uniformity degree corresponding to the port image of the rubber tubular part to be detected according to the position information and the pixel value of each pixel point on the port image of the rubber tubular part to be detected;
obtaining a second abnormal degree index corresponding to the port image of the rubber tubular part to be detected according to the defect degree and the structural distribution uniformity degree;
obtaining the abnormal degree corresponding to the port of the rubber tubular part according to the first abnormal degree index and the second abnormal degree index;
the method for obtaining the first abnormal degree index corresponding to the port image of the rubber tubular part to be detected according to the difference between the edge image and the corresponding standard edge image comprises the following steps:
obtaining the corresponding excircle edge of the edge image according to the edge image; obtaining a standard excircle edge corresponding to the standard edge image according to the standard edge image; obtaining the circle center of the outer circle edge and the circle center of the standard outer circle edge by using Hough transform;
aligning the circle center of the outer circle edge with the circle center of the standard outer circle edge to obtain an image after the circle center of the outer circle edge is aligned with the circle center of the standard outer circle edge, recording the image after the circle center of the outer circle edge is aligned with the circle center of the standard outer circle edge as an aligned image, and recording the position where the circle center of the outer circle edge is aligned with the circle center of the standard outer circle edge as the circle center of the aligned image;
obtaining the overlapping area and the non-overlapping area of the excircle edge and the standard excircle edge on the alignment image according to the alignment image;
recording the area of the overlapping area as a first area corresponding to the port image of the rubber tubular part, and recording the area of the non-overlapping area as a second area corresponding to the port image of the rubber tubular part;
making a straight line through the outer circle edge, the standard outer circle edge and the circle center of the alignment image on the alignment image;
rotating the straight line on the alignment image along the clockwise direction, and calculating the intersection point distance of the straight line and the intersection point of the outer circle edge and the standard outer circle edge on the alignment image to obtain an intersection point distance sequence corresponding to the alignment image;
recording the maximum intersection point distance in the intersection point distance sequence as a first difference distance corresponding to the port image of the rubber tubular part to be detected;
and obtaining a first abnormal degree index corresponding to the port image of the rubber tubular part according to the first difference distance, the first area and the second area.
2. The method for detecting the port abnormality of the tubular part based on the image processing as claimed in claim 1, wherein the first abnormality degree index corresponding to the port image of the rubber tubular part is calculated according to the following formula:
wherein,is a first abnormal degree index corresponding to the port image of the rubber tubular part,a second area corresponding to the port image of the rubber tubular part,a first area corresponding to the port image of the rubber tubular part,the first difference distance corresponding to the port image of the rubber tubular part.
3. The tubular part port abnormality detection method based on image processing as claimed in claim 1, wherein the method for obtaining the standard edge image comprises:
acquiring a large number of port sample images of the rubber tubular part;
identifying sample edge images corresponding to the port sample images of the rubber tubular parts by using an edge detection algorithm;
obtaining the outer circle edge of the sample corresponding to the port sample image of each rubber tubular part according to the sample edge image;
obtaining a minimum circumscribed rectangle corresponding to the outer circle edge of each sample according to the outer circle edge of the sample; constructing a sample vector corresponding to each minimum circumscribed rectangle according to the length and the width corresponding to the minimum circumscribed rectangle; clustering the sample vectors, selecting the category corresponding to the maximum sample vector quantity, and marking the category corresponding to the maximum sample vector quantity as a first category;
obtaining the average value of the lengths of the minimum circumscribed rectangles corresponding to the sample vectors in the first category according to the lengths of the minimum circumscribed rectangles corresponding to the sample vectors in the first category;
obtaining the average value of the minimum circumscribed rectangle widths corresponding to the sample vectors in the first category according to the widths of the minimum circumscribed rectangles corresponding to the sample vectors in the first category;
obtaining the standard degree of the sample excircle edge corresponding to the minimum circumscribed rectangle corresponding to each sample vector in the first category according to the length and width of the minimum circumscribed rectangle corresponding to each sample vector in the first category, the average value of the length of the minimum circumscribed rectangle corresponding to the sample vector in the first category and the average value of the width of the minimum circumscribed rectangle corresponding to the sample vector in the first category;
constructing a standard degree sequence corresponding to the sample vectors in the first category according to the standard degree of the sample excircle edge corresponding to the minimum circumscribed rectangle corresponding to each sample vector in the first category; and selecting a sample edge image corresponding to the sample excircle edge corresponding to the maximum standard degree in the standard degree sequence, and recording the sample excircle edge corresponding to the maximum standard degree as a standard edge image corresponding to the edge image.
4. The method for detecting the port abnormality of the tubular part based on the image processing as claimed in claim 3, wherein the standard degree of the sample outer circle edge corresponding to the minimum circumscribed rectangle corresponding to each sample vector in the first category is calculated according to the following formula:
wherein,is the second in the first categoryThe standard degree of the sample excircle edge corresponding to the minimum bounding rectangle corresponding to each sample vector,is the average of the minimum bounding rectangle lengths corresponding to the sample vectors in the first class,is the mean of the minimum bounding rectangle widths corresponding to the sample vectors in the first class,is the second in the first categoryThe length of the minimum bounding rectangle for a sample vector,is the second in the first categoryThe width of the minimum bounding rectangle to which the sample vector corresponds.
5. The method for detecting the abnormality of the port of the tubular part based on the image processing as claimed in claim 1, wherein the method for obtaining the corresponding defect degree of the port image of the tubular part to be detected according to the difference between the pixel value of each pixel point on the port image of the tubular part to be detected and the pixel value of the pixel point in the corresponding neighborhood comprises the following steps:
calculating the difference value between the pixel value of each pixel point on the port image of the rubber tubular part to be detected and the pixel value of each pixel point corresponding to the eight neighborhoods; obtaining abnormal pixel points on the port image of the rubber tubular part to be detected according to the difference value between the pixel value of each pixel point on the port image of the rubber tubular part to be detected and the pixel value of each pixel point corresponding to eight neighborhoods;
and obtaining the defect degree corresponding to the port image of the rubber tubular part to be detected according to the abnormal pixel points.
6. The method for detecting the abnormality of the port of the tubular part based on the image processing as claimed in claim 1, wherein the method for obtaining the structural distribution uniformity degree corresponding to the port image of the rubber tubular part to be detected according to the position information and the pixel value of each pixel point on the port image of the rubber tubular part to be detected comprises:
dividing the port image of the rubber tubular part to be detected into a plurality of areas uniformly by using a dividing line;
according to the position information and the pixel values of the pixel points on the left side and the right side corresponding to the pixel points on the dividing lines, fitting to obtain a three-dimensional Gaussian mixture model corresponding to the pixel points on the dividing lines;
according to the three-dimensional Gaussian mixture model, obtaining a structural distribution characteristic vector corresponding to each pixel point on each partition line; obtaining a structure distribution characteristic vector sequence corresponding to each partition line according to the structure distribution characteristic vector corresponding to each pixel point on each partition line;
calculating cosine similarity between every two structural distribution feature vectors in the structural distribution feature vector sequence, and obtaining a cosine similarity mean value corresponding to each partition line according to the cosine similarity;
and obtaining the structural distribution uniformity degree corresponding to the port image of the rubber tubular part to be detected according to the cosine similarity mean value corresponding to each partition line.
7. The method for detecting the port abnormality of the tubular part based on the image processing as claimed in claim 1, wherein the second abnormality degree index corresponding to the port image of the rubber tubular part to be detected is calculated according to the following formula:
wherein,for testing rubber tubesA second abnormal degree index corresponding to the port image of the shape part,the defect degree corresponding to the port image of the rubber tubular part to be detected,the structural distribution uniformity degree corresponding to the port image of the rubber tubular part to be detected.
8. An image processing-based tubular part port anomaly detection system comprising a memory and a processor, wherein the processor executes a computer program stored in the memory to implement an image processing-based tubular part port anomaly detection method according to any one of claims 1-7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111460216.2A CN113870264B (en) | 2021-12-02 | 2021-12-02 | Tubular part port abnormity detection method and system based on image processing |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111460216.2A CN113870264B (en) | 2021-12-02 | 2021-12-02 | Tubular part port abnormity detection method and system based on image processing |
Publications (2)
Publication Number | Publication Date |
---|---|
CN113870264A CN113870264A (en) | 2021-12-31 |
CN113870264B true CN113870264B (en) | 2022-03-22 |
Family
ID=78985699
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202111460216.2A Active CN113870264B (en) | 2021-12-02 | 2021-12-02 | Tubular part port abnormity detection method and system based on image processing |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113870264B (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114898281B (en) * | 2022-07-13 | 2022-09-30 | 南通高桥体育用品有限公司 | Basketball hoop abnormity detection method and system based on computer vision |
CN116415201B (en) * | 2023-06-07 | 2023-08-15 | 哈尔滨工业大学(威海) | Ship main power abnormality detection method based on deep concentric learning |
Family Cites Families (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP3706051B2 (en) * | 2001-08-13 | 2005-10-12 | 大日本スクリーン製造株式会社 | Pattern inspection apparatus and method |
CN105447851B (en) * | 2015-11-12 | 2018-02-02 | 刘新辉 | The sound hole defect inspection method and system of a kind of glass panel |
CN108447070B (en) * | 2018-03-15 | 2021-08-10 | 中国科学院沈阳自动化研究所 | Industrial part defect detection algorithm based on pixel vector invariant relation features |
CN111353974B (en) * | 2020-02-20 | 2023-08-18 | 苏州凌云光工业智能技术有限公司 | Method and device for detecting image boundary defects |
-
2021
- 2021-12-02 CN CN202111460216.2A patent/CN113870264B/en active Active
Also Published As
Publication number | Publication date |
---|---|
CN113870264A (en) | 2021-12-31 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN113870264B (en) | Tubular part port abnormity detection method and system based on image processing | |
CN115082464B (en) | Method and system for identifying weld data in welding process of dust remover | |
CN115147414B (en) | Surface breakdown defect detection method for bipolar power transistor | |
CN106404793B (en) | Bearing sealing element defect detection method based on vision | |
CN114882044B (en) | Metal pipe surface quality detection method | |
CN108346157B (en) | Method for detecting ellipse in object shot image based on Newton's theorem | |
CN105139386A (en) | Image processing method for quickly and automatically detecting soldered dot unsatisfied products of electric connectors | |
CN114549981A (en) | Intelligent inspection pointer type instrument recognition and reading method based on deep learning | |
CN112686264B (en) | Digital meter reading method, device, computer equipment and storage medium | |
CN109255792B (en) | Video image segmentation method and device, terminal equipment and storage medium | |
CN111695373A (en) | Zebra crossing positioning method, system, medium and device | |
CN114693651B (en) | Image processing-based rubber ring flow mark detection method and device | |
CN105678737A (en) | Digital image corner point detection method based on Radon transform | |
CN118247331B (en) | Automatic part size detection method and system based on image recognition | |
CN109615610B (en) | Medical band-aid flaw detection method based on YOLO v2-tiny | |
CN112418226B (en) | Method and device for identifying opening and closing states of fisheyes | |
CN113962967A (en) | Object shot image ellipse detection algorithm based on Markuling theorem constraint | |
CN108269264B (en) | Denoising and fractal method of bean kernel image | |
CN112634259A (en) | Automatic modeling and positioning method for keyboard keycaps | |
CN111695374B (en) | Segmentation method, system, medium and device for zebra stripes in monitoring view angles | |
CN114998346B (en) | Waterproof cloth quality data processing and identifying method | |
CN116189220A (en) | Building element detection and identification method and device, computer equipment and storage medium | |
CN106340038B (en) | A kind of depth order inference method based on object in monocular image | |
CN114943720A (en) | Electric power image processing method and device | |
CN110751631B (en) | Quick and high-precision rectangle detection method |
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 |