CN114926404A - Method for detecting surface abnormality of extrusion molding rubber sealing ring based on edge detection - Google Patents

Method for detecting surface abnormality of extrusion molding rubber sealing ring based on edge detection Download PDF

Info

Publication number
CN114926404A
CN114926404A CN202210461360.6A CN202210461360A CN114926404A CN 114926404 A CN114926404 A CN 114926404A CN 202210461360 A CN202210461360 A CN 202210461360A CN 114926404 A CN114926404 A CN 114926404A
Authority
CN
China
Prior art keywords
code
chain
obtaining
chain code
pixel points
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.)
Pending
Application number
CN202210461360.6A
Other languages
Chinese (zh)
Inventor
骆东彬
李锋
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Nantong Sanjie Graphite Products Co ltd
Original Assignee
Nantong Sanjie Graphite Products Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Nantong Sanjie Graphite Products Co ltd filed Critical Nantong Sanjie Graphite Products Co ltd
Priority to CN202210461360.6A priority Critical patent/CN114926404A/en
Publication of CN114926404A publication Critical patent/CN114926404A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • G06T7/0004Industrial image inspection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/11Region-based segmentation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/13Edge detection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/181Segmentation; Edge detection involving edge growing; involving edge linking
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • G06V10/28Quantising the image, e.g. histogram thresholding for discrimination between background and foreground patterns
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/40Extraction of image or video features
    • G06V10/44Local feature extraction by analysis of parts of the pattern, e.g. by detecting edges, contours, loops, corners, strokes or intersections; Connectivity analysis, e.g. of connected components
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/764Arrangements for image or video recognition or understanding using pattern recognition or machine learning using classification, e.g. of video objects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10004Still image; Photographic image
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30108Industrial image inspection
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/30Computing systems specially adapted for manufacturing

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Multimedia (AREA)
  • Computing Systems (AREA)
  • Artificial Intelligence (AREA)
  • Health & Medical Sciences (AREA)
  • Databases & Information Systems (AREA)
  • Evolutionary Computation (AREA)
  • General Health & Medical Sciences (AREA)
  • Medical Informatics (AREA)
  • Software Systems (AREA)
  • Quality & Reliability (AREA)
  • Image Analysis (AREA)

Abstract

The invention relates to the technical field of image recognition by using electronic equipment, in particular to a method for detecting surface abnormality of an extrusion molding rubber sealing ring based on edge detection, which comprises the following steps: acquiring a gray image of the sealing strip image and edge pixel points in the gray image; obtaining an initial chain code according to the edge pixel point, and obtaining a straight line segment and a symmetrical curve of the model profile according to the initial chain code; cutting the third chain code to obtain a segmented chain code, and obtaining a segmented symmetrical curve of the model profile according to the segmented chain code; removing edge pixel points corresponding to the model outline, and obtaining a closed curve and a non-closed curve according to the rest edge pixel points; obtaining the damage degree and the abnormal degree of the sealing strip according to the closed curve and the non-closed curve; obtaining the defect degree of the sealing strip according to the damage degree and the abnormal degree; according to the method, the influence of the model on the detection result can be removed, and the accuracy of the abnormal detection is improved.

Description

Method for detecting surface abnormality of extrusion molding rubber sealing ring based on edge detection
Technical Field
The invention relates to the technical field of image processing, in particular to a method for detecting surface abnormality of an extrusion molding rubber sealing ring based on edge detection.
Background
The rubber sealing ring is an important industrial product, is already a basic part of a plurality of industries, and is formed by extrusion, and is characterized in that when an extruded strip-shaped sealing strip is cut and wound into a used shape, the sealing strip can be cut into corresponding lengths according to the size of the pipe diameter to be wound, sealing effects are improved, sealing rings with different specifications can be manufactured without a plurality of molds, cost is reduced, but the produced extrusion-formed rubber sealing ring has defects, such as uneven cutting, surface scratches, grooves and the like, which directly affect the performance and the service life of the sealing ring and cause safety problems, and therefore, the sealing ring must be subjected to strict damage detection before leaving a factory and before being used.
The traditional damage detection method is a visual detection method, and a suspected damage area is found and then is subjected to rechecking by means of a microscope and the like, so that the detection method is low in efficiency, and the fatigue and the errors are easily caused by manpower; secondly, a detection method based on machine vision, which mostly depends on the characteristics of manual design, is complicated in process and poor in effect, and cannot accurately distinguish the types and defects on the sealing ring, thereby affecting the detection result, so that a method for detecting the surface abnormality of the extrusion molding rubber sealing ring based on edge detection is needed.
Disclosure of Invention
The invention provides a method for detecting surface abnormality of an extrusion molding rubber sealing ring based on edge detection, which aims to solve the existing problems.
The invention discloses an extrusion molding rubber sealing ring surface abnormity detection method based on edge detection, which adopts the following technical scheme: the method comprises the following steps:
acquiring a gray image of a sealing strip to be detected for manufacturing the rubber sealing ring, and performing edge detection on the gray image to obtain an edge image;
performing chain code tracking on edge pixel points in an edge image to obtain a plurality of initial chain codes, and obtaining corresponding new chain codes according to the difference value of adjacent code elements in each initial chain code; acquiring a mode chain code by using the new chain code, and acquiring a straight line segment of the mode contour in the edge image according to a code element mean value in the mode chain code;
removing chain codes corresponding to the straight line segments from the plurality of initial chain codes to obtain a plurality of second chain codes; obtaining a symmetrical curve of the contour of the medium-size number in the edge image by using the code element in each second chain code and a preset standard value;
removing chain codes corresponding to the straight line segments and the symmetrical curves from the initial chain codes to obtain a plurality of third chain codes, cutting the third chain codes according to code elements in each third chain code to obtain a plurality of segmented chain codes, and obtaining segmented symmetrical curves of model outlines in the edge images according to the segmented chain codes;
shielding straight-line segments, symmetrical curves and piecewise symmetrical curves of the medium-size profile in the edge image to obtain closed curves and non-closed curves in the edge image;
obtaining the damage degree of the sealing strip according to the number of all pixel points in the closed curve and the non-closed curve in the edge image; determining an abnormal closed curve according to the gray values of non-edge pixel points inside and outside the closed curve in the gray image, and obtaining the abnormal degree of the sealing strip according to the number of the pixel points in the abnormal closed curve;
and obtaining the defect degree of the sealing strip according to the damage degree and the abnormal degree of the sealing strip, and determining the abnormal sealing strip according to the defect degree and a preset defect threshold value.
Further, the step of obtaining the mode chain code by using the new chain code comprises:
taking each code element and the following 4 code elements in the new chain code as a code element group of the code element, acquiring a mode in each code element group, and replacing the mode with the value of the code element corresponding to the code element group;
the last 4 symbols of each new chain code are all replaced by 0, and the new chain code after replacing the symbols is marked as a mode chain code.
Further, the step of cutting the third chain code according to the code element in each third chain code to obtain a plurality of segmented chain codes comprises:
obtaining a third mode chain code according to the third chain code by using the method of obtaining the mode chain code by using the initial chain code;
and obtaining a plurality of small chain codes according to the code elements in the third mode chain code, obtaining a third chain code corresponding to the small chain codes, and marking as a segmented chain code.
Further, the step of obtaining a plurality of small chain codes according to the code elements in the third mode chain code comprises:
the symbol with the symbol value of 0 is marked as 0 symbol, if two or more 0 symbols appear at a certain position in the third mode chain code, and the 0 symbol at the position is removed, the third mode chain code is divided into a plurality of small chain codes.
Further, the step of obtaining the symmetric curve of the size contour in the edge image by using the code element in each second chain code and a preset standard value comprises:
if the number of code elements of the second chain code is odd, acquiring a central code element of the second chain code and a plurality of first code element pairs which are symmetrical about the central code element, and calculating a first sum value for each first code element pair;
determining a symmetrical curve of the model contour according to the central code element, the first sum and a preset odd standard value;
if the number of the code elements of the second chain code is even, acquiring the central two code elements of the second chain code and a plurality of second code element pairs which are symmetrical about the central two code elements, and acquiring the central sum value of the central two code elements and the second sum value of each second code element pair;
further, the step of obtaining the segment symmetric curve of the model contour in the edge image according to the segment chain code comprises:
determining a symmetrical curve corresponding to the segmented chain code according to a method for obtaining a symmetrical curve of a model profile in the edge image;
and if all the segmented chain codes in a certain third chain code correspond to the symmetric curve, the third chain code corresponds to the segmented symmetric curve of the model profile in the edge image.
Further, the step of obtaining the damage degree of the sealing strip according to the number of all pixel points in the closed curve and the non-closed curve in the edge image comprises the following steps:
acquiring the sum of the number of all pixel points in a closed curve and a non-closed curve in an edge image, and acquiring the contour perimeter of the sealing strip;
and obtaining the damage degree of the sealing strip according to the ratio of the sum of the number of all pixel points in the closed curve and the non-closed curve to the perimeter of the outline.
Further, the step of obtaining the abnormal degree of the sealing strip according to the number of the pixel points in the abnormal closed curve comprises the following steps:
acquiring the sum of the number of pixel points in all abnormal closed curves, and recording the sum as the number of abnormal pixel points;
acquiring the number of all pixel points in the gray level image of the sealing strip;
and obtaining the abnormal degree of the sealing strip according to the ratio of the number of the abnormal pixel points to the number of all the pixel points.
And further, determining the defect grade of the sealing strip according to the defect degree, and classifying the sealing strip according to the defect grade.
The invention has the beneficial effects that: according to the method for detecting the surface abnormality of the extrusion molding rubber sealing ring based on the edge detection, the histogram equalization processing is performed on the gray level image, so that the contrast of the gray level image is increased, and the subsequent acquisition of the damage degree is facilitated; carrying out binarization processing on the image after the edge pixel points are obtained, thereby enabling the number of the edge pixel points to be obtained quickly in the follow-up process; the influence of the straight line segment at the corner in the model profile is eliminated by carrying out mode processing on the difference chain codes, so that a more accurate model profile edge is obtained; removing the edge pixel points corresponding to the model outline, eliminating the influence of the model outline on abnormal detection, and enabling the rest edge pixel points to completely represent defects, so that the detection result is more accurate; the method also obtains the defect degree according to the obtained damage degree and the abnormal degree, and determines the defect degree from two aspects, so that the damage detection result of the surface of the sealing strip is more accurate.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the embodiments or the description of the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
FIG. 1 is a flowchart illustrating the general steps of an embodiment of a method for detecting surface anomalies in an extrusion molded rubber seal ring based on edge detection in accordance with the present invention;
FIG. 2 is an initial gray scale image of a seal strip in an embodiment of the present invention;
FIG. 3 is a gray scale image of a seal bar in an embodiment of the present invention;
FIG. 4 is a binarized image of a seal bar in an embodiment of the present invention;
FIG. 5 is a graph of defect levels in an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the 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, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
As shown in fig. 1, an embodiment of the method for detecting surface abnormality of an extrusion molded rubber seal ring based on edge detection according to the present invention includes:
and S1, acquiring a gray image of the sealing strip to be detected for manufacturing the rubber sealing ring, and performing edge detection on the gray image to obtain an edge image.
The rubber sealing strips are cut according to the required size in the production process, the obtained rubber sealing strips are fused end to form the rubber sealing rings, and the rubber raw materials are likely to be damaged when coming out through the model pipeline, so that the rubber sealing rings are unqualified in the next step, the extruded rubber sealing strips are subjected to damage detection, the unqualified rubber sealing strips are removed, and the next step of processing of the rubber sealing strips is carried out, so that the defect degree of the surface of the rubber sealing strips is detected.
Specifically, S11, arranging the camera right above the conveyor belt, collecting RGB images of the cut sealing strips, and converting the RGB images into initial grayscale images as shown in fig. 2; s12, the contrast of the directly obtained initial gray level image is low, so that edge pixel parts are not easy to extract, and the defect condition of the sealing strip is not easy to judge, therefore, histogram equalization processing is carried out on the initial gray level image, the contrast of the initial gray level image is increased, and the image after histogram equalization is marked as a gray level image as shown in FIG. 3; s13, performing edge detection on the gray image by using a third anny operator to obtain edge pixel points and non-edge pixel points, and performing binarization representation on the obtained edge pixel points and the non-edge pixel points to obtain a binary image, wherein the obtained binary image is shown in FIG. 4, the gray value of the edge pixel points in the binary image is 1, and the gray value of the non-edge pixel points is 0.
S2, performing chain code tracking on edge pixel points in the edge image to obtain a plurality of initial chain codes, and obtaining corresponding new chain codes according to the difference value of adjacent code elements in each initial chain code; and acquiring a mode chain code by using the new chain code, and acquiring a straight line segment of the mode contour in the edge image according to the code element mean value in the mode chain code.
The model is printed on the surface of the sealing strip, and edge pixel points obtained by utilizing the third anny operator in edge detection are used, one part is edge pixel points of the model outline, and the other part is edge pixel points of the defect edge on the surface of the sealing strip; therefore, when the sealing strip is subjected to abnormal detection, the edge of the model outline is found out firstly, the influence of the model outline is removed, and then the abnormal detection is carried out; the model image is generally regular, the model outline consists of a straight line segment and a symmetrical curve, and the model outline is extracted by adopting a chain code.
Specifically, S21, obtaining the gray value of each pixel point in the binary image, traversing from the top left corner to the left, from the right, and from top to bottom, and performing 8-direction chain code edge tracking from the edge pixel point with the first gray value of 1 until the next 8-direction chain code does not exist in a certain edge pixel point; traversing from left to right and from top to bottom to determine an edge pixel point with a gray value of 1, and repeating the operation until the edge pixel points in the binary image complete edge tracking; describing a plurality of straight lines or curves composed of edge pixel points by using 8-direction chain codes to finally obtain n initial chain codes, wherein the initial chain codes are shown as the following formula (1):
Figure BDA0003620542520000051
wherein, M n Representing the nth initial chain code; n represents the number of initial chain codes; a is k Representing the kth symbol in the nth initial chain code; the number of symbols in each initial chain code is not necessarily the same.
Obtaining a difference value of every two adjacent code elements in each initial chain code, subtracting the next code element from the previous code element, wherein the difference value obtained in each initial chain code forms a corresponding new chain code, and the new chain code is shown as the following formula (2):
Figure BDA0003620542520000052
wherein N is n Representing the nth new chain code; n represents the number of new chain codes; (a) k-1 -a k ) The difference value between the (k-1) th code element and the k-th code element in the nth initial chain code is represented, i code elements exist in the initial chain code, and the new chain code corresponding to the initial chain code has (i-1) code elements.
The code elements in the initial chain code represent the direction of edge pixel points, and for the straight-line section part of the model outline, the edge pixel points corresponding to one straight-line section are supposed to be in the same direction when represented by the chain code, so that the code elements in the initial chain code corresponding to the straight-line section are supposed to be equal, and the code element value in the new chain code corresponding to the initial chain code is supposed to be a long string of 0; if a certain part of the model profile is composed of a plurality of straight line segments, the plurality of straight line segments are expressed in an initial chain code correspondingly, code elements in the initial chain code are divided into a plurality of different numerical values, the numerical values of the code elements in each segment are equal, the plurality of straight line segments are expressed in a new chain code correspondingly, the numerical values of the code elements in the new chain code are a plurality of strings of 0, and other numerical values are mixed with other numerical values in the middle of each string of 0, and the other numerical values are expressed as inflection points of the plurality of straight line segments; to obtain the straight line segment of the model contour, the influence of the inflection point on the numerical value is eliminated.
Specifically, S22, taking each symbol and 4 symbols after each symbol in the new chain code as the symbol group of the symbol, obtaining the mode of each symbol group, taking the mode as the value of the symbol corresponding to the symbol group, and marking the new chain code after the mode processing as the mode chain code, where the mode chain code is expressed by formula (3): n is a radical of i =n 1 (a 1 ,a 2 ,a 3 ,a 4 ,a 5 )n 2 (a 2 ,a 3 ,a 4 ,a 5 ,a 6 )…n m-4 (a m-4 ,a m-3 ,a m-2 ,a m-1 ,a m )n m-3 n m-2 n m-1 n m (3);
Wherein, N i Representing the ith mode chain code; n is m-4 The symbol with the largest occurrence number in the code element group of the (m-4) th symbol is represented; a is a m-4 Represents the (m-4) th code element in the new chain code; the last 4 code elements in each new chain code can not form a code element group of 5 code elements, and all the 4 code elements are set to be 0 in the mode chain code, namely n in the mode chain code m-3 n m-2 n m-1 n m All are 0.
Obtaining the sum of all code elements in each mode chain code, and calculating the code element average value of each mode chain code according to the following formula (4):
Figure BDA0003620542520000061
wherein S is i A symbol mean value representing an ith mode chain code; q i Representing the sum of all symbols in the ith mode chain code; (m) i -1) represents the number of symbols in the ith mode chain code. If S i When the number is equal to 0, acquiring an initial chain code corresponding to the mode chain code, wherein the initial chain code corresponds to straight line segments of the model profile, and for all the straight line segments, the initial chain code corresponds toThe initial chain code is marked.
S3, removing chain codes corresponding to the straight line segments from the initial chain codes to obtain a plurality of second chain codes; and obtaining a symmetrical curve of the contour of the medium size in the edge image by using the code element in each second chain code and a preset standard value.
Step S22 screens out the straight line segment part of the model contour in the edge image, and further determines the remaining initial chain codes to determine the symmetric curve of the model contour in the edge image.
Specifically, the initial chain codes corresponding to the straight line segments of the model profile are removed from the plurality of initial chain codes to obtain a plurality of second chain codes, and the number m of code elements in each second chain code is obtained.
When the number m of code elements of the second chain code is odd, the central code element of the second chain code is obtained
Figure BDA0003620542520000071
Obtaining information about a center symbol
Figure BDA0003620542520000072
A plurality of symmetrical first code element pairs, the code element positioned at the left of the central code element in the first code element pairs is a m1 The symbol to the right of the center symbol is a m2 The symbols in each first symbol pair should satisfy the following formula (5):
m 1 +m 2 =m+1 (5)
wherein m is 1 Represents the m-th in the second chain code 1 A serial number of each symbol element; m is 2 Represents the m-th in the second chain code 2 A serial number of each symbol element; m represents the number of symbols of the second chain code where the center symbol is located.
When the number of symbols in the second chain code is odd, the odd standard value preset with respect to the sum value of the first symbol pair corresponding to different center symbols is as shown in the following table (1):
odd number standard value comparison table (1)
Figure BDA0003620542520000073
If a certain code element number is the second chain code of odd number, the central code element
Figure BDA0003620542520000074
The sum of the values of (a) and corresponding first symbol pairs corresponds to table (1), then the second chain code corresponds to a symmetric curve of the model profile in the edge image.
When the number m of code elements of the second chain code is even, acquiring the center code element pair of the second chain code
Figure BDA0003620542520000075
And
Figure BDA0003620542520000076
obtaining a pair of symbols with respect to a center
Figure BDA0003620542520000077
And
Figure BDA0003620542520000078
a plurality of symmetrical second code element pairs, the code element left to the central code element in the second code element pairs is a m1 The symbol to the right of the center symbol is a m2 And acquiring the sum value of each second code element pair and the sum value of the central code element pair in the second chain code.
When the number of symbols in the second chain code is even, even standard values preset with respect to the sum value of the second symbol pair corresponding to the sum values of different center symbol pairs are as shown in the following table (2):
even standard value comparison table (2)
Figure BDA0003620542520000079
If a certain code element number is the second chain code of even number, the center code element pair
Figure BDA00036205425200000710
And
Figure BDA00036205425200000711
the sum of (2) and the sum of each corresponding second symbol pair are in accordance with table (2), and the second chain code corresponds to the symmetric curve of the model profile in the edge image, and the second chain codes corresponding to all the symmetric curves are marked.
S4, removing chain codes corresponding to the straight line segments and the symmetrical curves from the initial chain codes to obtain a plurality of third chain codes, cutting the third chain codes according to the code elements in each third chain code to obtain a plurality of segmented chain codes, and obtaining the segmented symmetrical curves of the model outlines in the edge images according to the segmented chain codes.
The straight line segments and the symmetrical curve portions of the model contour in the edge image are screened out in the steps S2-S3, and part of the piecewise symmetrical curve is included in the irregular curve, so that the irregular curve needs to be cut, and whether the cut curve is the piecewise symmetrical curve of the model contour or not is judged.
Specifically, S41, removing the initial chain codes corresponding to the straight-line segments and the symmetric curves from the multiple initial chain codes to obtain multiple third chain codes, and processing the third chain codes according to the method for obtaining the new chain codes and the mode chain codes in steps S21 and S22 to obtain new third chain codes and third mode chain codes.
S42, traversing from the first code element of each third mode chain code, marking the code element with the code element value of 0 as a 0 code element, marking the 0 code element appearing for the first time, counting the number of the 0 code elements appearing continuously, finishing the counting when a non-0 number appears, and carrying out the same operation on the subsequent code elements along the third mode chain code; if two or more continuous 0 code elements appear at a certain position in the third mode chain code in the statistical result, cutting the third mode chain code, and removing the 0 code elements at the position to obtain small chain codes at two sides of the 0 code element; if the number of the 0 code elements is one, cutting is not carried out; and if the third mode chain code has two or more continuous 0 code elements at multiple positions, cutting the third mode chain code into a plurality of small chain codes, acquiring a third chain code corresponding to the small chain codes, and marking as a segmented chain code.
S43, determining a symmetrical curve corresponding to the segmented chain code according to the method for obtaining the symmetrical curve in the step S3; and if all the segmented chain codes in a certain third chain code correspond to symmetrical curves, marking the third chain codes corresponding to the segmented symmetrical curves of the model profile corresponding to the third chain codes.
S5, blocking the straight line segment, the symmetrical curve and the piecewise symmetrical curve of the medium-sized contour in the edge image to obtain a closed curve and a non-closed curve in the edge image.
All straight line segments, symmetrical curves and piecewise symmetrical curves of the contour of the logo in the edge image are obtained through steps S2-S4, and the chain codes which are not marked at present correspond to the defect edges of the surface of the sealing strip, the defects of the surface of the sealing strip are composed of closed curves and non-closed curves, the closed curves are probably edges formed by grooves, bulges, cracks and scratches of the surface of the sealing strip, the areas enclosed by the closed curves are also probably defect areas, and the non-closed curves are probably edges formed by scratches of the surface of the sealing strip.
Specifically, in the binary image, all edge pixel points corresponding to the marked initial chain code, the marked second chain code and the marked third chain code are set to be 0, namely all edge pixel points are set to be non-edge pixel points; optionally selecting edge pixel points with the gray value of 1, traversing pixel points in 8 neighborhoods of the edge pixel points, acquiring pixel points with the gray value of 1 in the 8 neighborhoods, respectively taking the pixel points with the gray value of 1 in the 8 neighborhoods as central pixels, continuously traversing the pixel points in 8 neighborhoods of the central pixels, acquiring the pixel points with the gray value of 1, traversing the whole binary image according to the step, if the obtained last pixel point can be overlapped with the first pixel point, forming a closed curve by the pixel points, and if the last pixel point is not overlapped with the first pixel point, forming a non-closed curve by the pixel points; and at the moment, other non-traversed edge pixel points with the gray value of 1 are selected to perform repeated operation, and finally the number of the closed curves is determined.
S6, obtaining the damage degree of the sealing strip according to the number of all pixel points in the closed curve and the non-closed curve in the edge image; and determining an abnormal closed curve according to the gray values of the non-edge pixel points inside and outside the closed curve in the gray image, and obtaining the abnormal degree damage degree of the sealing strip according to the number of the pixel points in the abnormal closed curve.
The defect degree of the sealing strip is influenced by the damage degree and the abnormal degree in the closed curve; the damage degree of the sealing strip is determined according to the length of the damage curve and the perimeter of the sealing strip, but the damage curve is an irregular curve, and the length is difficult to obtain through calculation, so that the damage degree of the sealing strip is determined according to the number of pixel points.
Specifically, S61, setting all gray values of edge pixel points corresponding to the edge contour of the sealing strip in the binary image to be 0, and acquiring the number of pixel points with the gray value of 1 in the binary image, and recording the number as the number of damaged pixel points; obtaining the size of the edge profile of the sealing strip as m x n, and calculating the breakage degree of the sealing strip according to the following formula (6):
Figure BDA0003620542520000091
wherein D is 1 Indicating the breakage degree of the sealing strip; 2(m + n) -4 represents the perimeter of the weatherstrip profile; c represents the total length of the closed curve and the non-closed curve, namely the number of damaged pixel points; d 1 The larger the value, the more serious the breakage of the weather strip surface.
S62, obtaining the gray value average value of non-edge pixel points in a closed curve in the gray image; the method comprises the steps of obtaining the mean value of the gray values of non-edge pixel points outside a closed curve in a gray image, comparing the mean value of the gray values of the non-edge pixel points inside the closed curve with the mean value of the gray values of the non-edge pixel points, recording the closed curve as an abnormal closed curve if the difference between the two mean values is larger than a preset abnormal threshold, and automatically setting the abnormal threshold according to actual conditions.
S63, respectively obtaining the number of pixel points in each abnormal closed curve, and calculating the abnormal degree of the sealing strip according to the following formula (7):
Figure BDA0003620542520000092
wherein D is 2 Indicating the degree of abnormality of the weather strip; m x n represents the number of all pixel points on the surface of the sealing strip; s. the i Representing the number of pixel points in the ith abnormal closed curve; n represents the number of abnormally closed curves;
Figure BDA0003620542520000093
and the number of pixel points in all abnormal closed curves is represented.
And S7, obtaining the defect degree of the sealing strip according to the damage degree and the abnormal degree of the sealing strip, and determining the abnormal sealing strip according to the defect degree and a preset defect threshold value.
The defect degree of the sealing strip is influenced by the damage degree and the abnormal degree in the abnormal closed curve, so that the defect degree of the sealing strip is determined by comprehensively considering the two aspects.
Specifically, S71, the defect degree of the weather strip is calculated according to the following formula (8):
D=D 1 +D 2 (8)
wherein D represents the defect degree of the sealing strip; d 1 Indicating the breakage degree of the sealing strip; d 2 Indicating the degree of abnormality of the weather strip.
Setting the defect threshold to D k The defect degree of the sealing strip is larger than a defect threshold value D k And the sealing strip is an abnormal sealing strip, and the defect threshold value can be set according to the condition.
S72, determining the defect grade of the sealing strip according to the defect degree, and classifying the sealing strip according to the defect grade. The rubber sealing strip is divided into 4 grades of qualified, slight damage, moderate damage and serious damage, and the four grades of damage are respectively rated as 0, 1, 2 and 3 according to the serious condition of the damage from light to heavy. Specifically, the defect grade value of the weather strip is calculated according to the following formula (a):
y=ln(10D+1) (a)
wherein y represents a defect grade value of the weather strip; d represents the defect degree of the sealing strip; the defect degree D is used as an abscissa and the defect grade value y is used as an ordinate to fit a defect grade curve, which is shown in fig. 5.
Judging the defect grade of the sealing strip according to the defect degree table (3):
defect degree meter (3)
Magnitude of y value 0 0<y≤1 1<y≤2 y>2
Degree of defect Defect free Mild defect Moderate defect Serious defect
The obtained sealing strips with different defect grades are classified, so that the subsequent treatment is facilitated.
In summary, the invention provides the method for detecting the surface abnormality of the extrusion molding rubber sealing ring based on the edge detection, and the histogram equalization processing is performed on the gray level image, so that the contrast of the gray level image is increased, and the subsequent acquisition of the damage degree is facilitated; carrying out binarization processing on the image after the edge pixel points are obtained, thereby enabling the number of the edge pixel points to be obtained quickly in the follow-up process; the mode processing is carried out on the difference chain codes, so that the influence of the turning point of the straight line section in the model outline is eliminated, and a more accurate model outline edge is obtained; removing the edge pixel points corresponding to the model outline, eliminating the influence of the model outline on abnormal detection, and enabling the rest edge pixel points to completely represent defects, so that the detection structure is more accurate; the method also obtains the defect degree according to the obtained damage degree and the abnormal degree, and determines the defect degree from two aspects, so that the detection result is more accurate.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and should not be taken as limiting the scope of the present invention, which is intended to cover any modifications, equivalents, improvements, etc. within the spirit and scope of the present invention.

Claims (9)

1. The method for detecting the surface abnormality of the extrusion molding rubber sealing ring based on the edge detection is characterized by comprising the following steps:
acquiring a gray image of a sealing strip to be detected for manufacturing the rubber sealing ring, and performing edge detection on the gray image to obtain an edge image;
performing chain code tracking on edge pixel points in an edge image to obtain a plurality of initial chain codes, and obtaining corresponding new chain codes according to the difference value of adjacent code elements in each initial chain code; acquiring a mode chain code by using the new chain code, and acquiring a straight line segment of the mode contour in the edge image according to a code element mean value in the mode chain code;
removing chain codes corresponding to the straight line segments from the plurality of initial chain codes to obtain a plurality of second chain codes; obtaining a symmetrical curve of the contour of the medium-size number in the edge image by using the code element in each second chain code and a preset standard value;
removing chain codes corresponding to the straight line segments and the symmetrical curves from the initial chain codes to obtain a plurality of third chain codes, cutting the third chain codes according to code elements in each third chain code to obtain a plurality of segmented chain codes, and obtaining segmented symmetrical curves of model outlines in the edge images according to the segmented chain codes;
shielding straight-line segments, symmetrical curves and piecewise symmetrical curves of the contour of the medium size in the edge image to obtain closed curves and non-closed curves in the edge image;
obtaining the damage degree of the sealing strip according to the number of all pixel points in the closed curve and the non-closed curve in the edge image; determining an abnormal closed curve according to the gray values of non-edge pixel points inside and outside the closed curve in the gray image, and obtaining the abnormal degree of the sealing strip according to the number of the pixel points in the abnormal closed curve;
and obtaining the defect degree of the sealing strip according to the damage degree and the abnormal degree of the sealing strip, and determining the abnormal sealing strip according to the defect degree and a preset defect threshold value.
2. The method for detecting surface abnormality of an extrusion rubber seal ring based on edge detection according to claim 1, wherein the step of obtaining a mode chain code using a new chain code includes:
taking each code element and the following 4 code elements in the new chain code as the code element group of the code element, acquiring the mode in each code element group, and replacing the mode with the value of the code element corresponding to the code element group;
and (4) fully replacing the last 4 code elements of each new chain code with 0, and marking the new chain code after the code elements are replaced as a mode chain code.
3. The method for detecting surface abnormality of an extrusion rubber seal ring based on edge detection as claimed in claim 2, wherein the step of cutting the third chain codes according to the code elements in each third chain code to obtain a plurality of segment chain codes comprises:
obtaining a third mode chain code according to the third chain code by using the method for obtaining the mode chain code by using the initial chain code;
and obtaining a plurality of small chain codes according to the code elements in the third mode chain code, obtaining a third chain code corresponding to the small chain codes, and recording the third chain code as a segmented chain code.
4. The method for detecting surface abnormality of an extrusion molded rubber seal ring based on edge detection according to claim 3, wherein the step of obtaining a plurality of small chain codes from the code elements in the third mode chain code includes:
the code element with the code element value of 0 is marked as 0 code element, if two or more continuous 0 code elements appear at a certain position in the third mode chain code, and the 0 code element at the position is removed, the third mode chain code is divided into a plurality of small chain codes.
5. The method for detecting surface abnormality of an extrusion rubber seal ring based on edge detection as claimed in claim 1, wherein the step of obtaining the symmetry curve of the contour of the medium gauge in the edge image by using the symbols in each second chain code and the preset standard value comprises:
if the number of code elements of the second chain code is odd, acquiring a central code element of the second chain code and a plurality of first code element pairs which are symmetrical about the central code element, and calculating a first sum value for each first code element pair;
determining a symmetrical curve of the model contour according to the central code element, the first sum and a preset odd standard value;
if the number of the code elements of the second chain code is even, acquiring the central two code elements of the second chain code and a plurality of second code element pairs which are symmetrical about the central two code elements, and acquiring the central sum value of the central two code elements and the second sum value of each second code element pair;
and determining a symmetrical curve of the model profile according to the central sum, the second sum and a preset even standard value.
6. The method for detecting the surface abnormality of the extrusion molded rubber seal ring based on the edge detection as recited in claim 5, wherein the step of obtaining a piecewise symmetry curve of a model contour in the edge image based on the piecewise chain code includes:
determining a symmetrical curve corresponding to the segmented chain code according to a method for obtaining a symmetrical curve of a model profile in the edge image;
and if all the segmented chain codes in a certain third chain code correspond to the symmetric curve, the third chain code corresponds to the segmented symmetric curve of the model profile in the edge image.
7. The method for detecting the surface abnormality of the extrusion molded rubber sealing ring based on the edge detection as recited in claim 1, wherein the step of obtaining the degree of damage of the sealing strip based on the number of all the pixel points in the closed curve and the non-closed curve in the edge image includes:
acquiring the sum of the number of all pixel points in a closed curve and a non-closed curve in an edge image, and acquiring the contour perimeter of the sealing strip;
and obtaining the damage degree of the sealing strip according to the ratio of the sum of the number of all pixel points in the closed curve and the non-closed curve to the perimeter of the outline.
8. The method for detecting the surface abnormality of the extrusion molding rubber sealing ring based on the edge detection as claimed in claim 1, wherein the step of obtaining the degree of abnormality of the sealing strip according to the number of the pixel points in the abnormal closed curve includes: acquiring the sum of the number of pixel points in all abnormal closed curves, and recording the sum as the number of abnormal pixel points;
acquiring the number of all pixel points in the gray level image of the sealing strip;
and obtaining the abnormal degree of the sealing strip according to the ratio of the number of the abnormal pixel points to the number of all the pixel points.
9. The method for detecting the surface abnormality of the extrusion rubber sealing ring based on the edge detection as claimed in claim 1, further comprising determining a defect grade of the sealing strip according to the defect degree, and classifying the sealing strip according to the defect grade.
CN202210461360.6A 2022-04-28 2022-04-28 Method for detecting surface abnormality of extrusion molding rubber sealing ring based on edge detection Pending CN114926404A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210461360.6A CN114926404A (en) 2022-04-28 2022-04-28 Method for detecting surface abnormality of extrusion molding rubber sealing ring based on edge detection

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210461360.6A CN114926404A (en) 2022-04-28 2022-04-28 Method for detecting surface abnormality of extrusion molding rubber sealing ring based on edge detection

Publications (1)

Publication Number Publication Date
CN114926404A true CN114926404A (en) 2022-08-19

Family

ID=82805948

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210461360.6A Pending CN114926404A (en) 2022-04-28 2022-04-28 Method for detecting surface abnormality of extrusion molding rubber sealing ring based on edge detection

Country Status (1)

Country Link
CN (1) CN114926404A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115115641A (en) * 2022-08-30 2022-09-27 江苏布罗信息技术有限公司 Pupil image segmentation method
CN116993715A (en) * 2023-09-18 2023-11-03 山东庆葆堂生物科技有限公司 Glass bottle air tightness detection method

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115115641A (en) * 2022-08-30 2022-09-27 江苏布罗信息技术有限公司 Pupil image segmentation method
CN115115641B (en) * 2022-08-30 2023-12-22 孙清珠 Pupil image segmentation method
CN116993715A (en) * 2023-09-18 2023-11-03 山东庆葆堂生物科技有限公司 Glass bottle air tightness detection method
CN116993715B (en) * 2023-09-18 2023-12-19 山东庆葆堂生物科技有限公司 Glass bottle air tightness detection method

Similar Documents

Publication Publication Date Title
CN114926404A (en) Method for detecting surface abnormality of extrusion molding rubber sealing ring based on edge detection
CN115375688B (en) Automatic detection method for belt conveyor
CN115239735B (en) Communication cabinet surface defect detection method based on computer vision
WO2021168733A1 (en) Defect detection method and apparatus for defect image, and computer-readable storage medium
CN115100221B (en) Glass defect segmentation method
CN115082418B (en) Precise identification method for automobile parts
CN107230207B (en) Tire detection method and system
CN115035122B (en) Artificial intelligence-based integrated circuit wafer surface defect detection method
CN116777907A (en) Sheet metal part quality detection method
CN115131354B (en) Laboratory plastic film defect detection method based on optical means
CN112465809B (en) Mold defect detection method based on image recognition, computer readable storage medium and device
CN116934740B (en) Plastic mold surface defect analysis and detection method based on image processing
CN115311267B (en) Method for detecting abnormity of check fabric
CN103824304A (en) Method for performing fault diagnosis on ores on conveying belt during conveying process
CN115063430B (en) Electric pipeline crack detection method based on image processing
CN110189297B (en) Magnetic material appearance defect detection method based on gray level co-occurrence matrix
CN115861307B (en) Fascia gun power supply driving plate welding fault detection method based on artificial intelligence
CN115690108A (en) Aluminum alloy rod production quality evaluation method based on image processing
CN113159061B (en) Actual tunnel surrounding rock fragment identification method based on example segmentation
CN114972894A (en) CPP film defect classification method based on computer vision
CN114708325A (en) Method for quickly positioning rubber production problem based on rubber blooming defect
CN116883408B (en) Integrating instrument shell defect detection method based on artificial intelligence
CN116433668A (en) Intelligent hydraulic oil pipe oil leakage detection method
CN114882026A (en) Sensor shell defect detection method based on artificial intelligence
CN115018827A (en) Automatic detection method for quality of building material weld joint

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