CN117214183A - Paper defect detection method based on machine vision - Google Patents

Paper defect detection method based on machine vision Download PDF

Info

Publication number
CN117214183A
CN117214183A CN202311465240.4A CN202311465240A CN117214183A CN 117214183 A CN117214183 A CN 117214183A CN 202311465240 A CN202311465240 A CN 202311465240A CN 117214183 A CN117214183 A CN 117214183A
Authority
CN
China
Prior art keywords
connected domain
ellipse
pulp
target area
neighborhood
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.)
Granted
Application number
CN202311465240.4A
Other languages
Chinese (zh)
Other versions
CN117214183B (en
Inventor
冀衍超
王学玲
于海
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shandong Sishui Jinlide Paper Co ltd
Original Assignee
Shandong Sishui Jinlide Paper 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 Shandong Sishui Jinlide Paper Co ltd filed Critical Shandong Sishui Jinlide Paper Co ltd
Priority to CN202311465240.4A priority Critical patent/CN117214183B/en
Publication of CN117214183A publication Critical patent/CN117214183A/en
Application granted granted Critical
Publication of CN117214183B publication Critical patent/CN117214183B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • 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

  • Image Analysis (AREA)

Abstract

The invention relates to the technical field of image processing, in particular to a paper defect detection method based on machine vision, which comprises the following steps: acquiring a paper surface image, acquiring a connected domain of the paper surface image, acquiring a first ellipse and a second ellipse of the connected domain according to the minimum circumscribed rectangle of a convex hull region of the connected domain, further acquiring the fitting degree of the connected domain to the ellipse, further screening a suspected pulp point region, acquiring the adjacent degree of the suspected pulp point region and the neighborhood connected domain according to the first distance and the second distance between the suspected pulp point region and the neighborhood connected domain, acquiring the probability that the suspected pulp point region is a pulp point according to the adjacent degree, further acquiring all connected domains which are not pulp points, and marking the connected domain which is not the pulp point to acquire a marked image; and dividing the marked image to obtain streak defects. The invention eliminates the interference of paper pulp points and more accurately detects paper defects.

Description

Paper defect detection method based on machine vision
Technical Field
The invention relates to the technical field of image processing, in particular to a paper defect detection method based on machine vision.
Background
Paper is one of the carriers of characters and is essential in daily life. In the paper production process, defects such as streaks and the like occur in the paper production process due to problems of an illumination system, machine faults, improper manual operation and the like.
In order to avoid a huge loss of paper production caused by paper defects, paper defects need to be detected. Since streaks on paper may not be apparent, they cannot be detected completely using existing machine vision detection methods such as edge detection methods. The watershed segmentation algorithm has higher segmentation accuracy and good response to weak edges, and can be used for detecting streaks on paper, but in the detection process, the watershed algorithm is excessively segmented due to the tiny gray change of the image surface and the pulp points on the paper, so that the detection of the streaks is interfered.
Disclosure of Invention
The invention provides a paper defect detection method based on machine vision, which aims to solve the existing problems.
The invention discloses a paper defect detection method based on machine vision, which adopts the following technical scheme:
one embodiment of the invention provides a paper defect detection method based on machine vision, which comprises the following steps:
collecting an image of the surface of the paper; acquiring a connected domain of the surface image of the paper; acquiring the minimum circumscribed rectangle of the convex hull region of each connected domain as a first rectangle of each connected domain; acquiring a first ellipse and a second ellipse of each connected domain according to the first rectangle of each connected domain; acquiring the fitting degree of each connected domain to the ellipse according to the first ellipse and the second ellipse of each connected domain; screening suspected pulp point areas according to the fitting degree of each connected domain to the ellipse;
taking any suspected pulp point area as a target area, and acquiring all neighborhood connected areas of the target area; taking the length of a connecting line between the center of the target area and the center of the neighborhood communication domain as a first distance between the target area and the neighborhood pixel point, and acquiring a second distance between the target area and the neighborhood pixel point according to the pixel point of the target area on the connecting line and the pixel point of the neighborhood communication domain;
obtaining the proximity degree of the target area and each neighborhood connected domain according to the first distance and the second distance between the target area and each neighborhood connected domain; acquiring the probability of the target area as a pulp point according to the proximity degree of the target area and all the neighborhood connected areas; acquiring the probability that all suspected pulp point areas are pulp points; acquiring all connected domains which are not pulp points according to the probability that each suspected pulp point area is a pulp point and the fitting degree of each connected domain to an ellipse;
marking all connected areas which are not pulp points in the pulp surface image to obtain a marked image; dividing a marked image by using a watershed algorithm based on the mark, wherein the edges obtained by dividing are edges of streak defects, and obtaining the streak defects according to the edges of the streak defects.
Preferably, the method for acquiring the connected domain of the surface image of the paper comprises the following specific steps:
acquiring a paper surface gradient image according to the gradient amplitude of each pixel point in the paper surface image, and performing threshold segmentation on the paper surface gradient image to obtain a paper surface binary image; carrying out connected domain analysis on the paper surface binary image to obtain all connected domains in the paper surface binary image; filling each multi-connected domain in the binary image on the surface of the paper, and converting the multi-connected domain into a single-connected domain;
and forming a connected domain of the paper surface image by all the corresponding pixel points of the pixel points in each single connected domain in the paper surface binary image in the paper surface image.
Preferably, the step of obtaining the first ellipse and the second ellipse of each connected domain according to the first rectangle of each connected domain includes the following specific steps:
taking the central point of the first rectangle of the connected domain as the central point of the ellipse, and marking asThe length of the diagonal line of the first rectangle is taken as the length of the major axis of the ellipse, and is denoted as +.>The method comprises the steps of carrying out a first treatment on the surface of the Any diagonal line of the first rectangle passing through the communicating region is taken as a perpendicular bisector, and the perpendicular bisector is connected with the first rectangleThe length of a line segment formed by two intersection points of the edges of the communicating region is denoted as b as the length of the minor axis of the ellipse;
the central point of the first rectangle of the connected domain isThe length of the long axis is->Two ellipses of length b of the minor axis are denoted as a first ellipse and a second ellipse, respectively.
Preferably, the obtaining the fitting degree of each connected domain to the ellipse according to the first ellipse and the second ellipse of each connected domain includes the following specific steps:
acquiring two focuses of a first ellipse and two focuses of a second ellipse; first of connected domainThe fitting degree of each edge pixel point to the first ellipse is as follows:
wherein,is the->Fitting degree of the edge pixel points to the first ellipse; />Is the->Edge pixel points; />、/>Two foci in the first ellipse; />Is the length of the major axis of the first ellipse; />Is the->Edge pixels->Focus to the first ellipse +.>European distance,/, of->Is the->Edge pixels->Focus to the first ellipse +.>Is a Euclidean distance of (2); />Is a super parameter; />Is an exponential function with a natural constant as a base;
taking the average value of the fitting degree of all edge pixel points of the connected domain to the first ellipse as the fitting degree of the connected domain to the first ellipse;
similarly, the fitting degree of the connected domain to the second ellipse is obtained; and taking the larger value of the fitting degree of the connected domain to the first ellipse and the fitting degree of the connected domain to the second ellipse as the fitting degree of the connected domain to the ellipse.
Preferably, the screening the suspected pulp point area according to the fitting degree of each connected domain to the ellipse comprises the following specific steps:
acquiring the area of each connected domain; and when the area of the communicating region is positioned between the preset precision area and the preset standard area and the fitting degree of the communicating region to the ellipse is larger than a preset first threshold value, taking the communicating region as a suspected pulp point region.
Preferably, the step of obtaining all the neighborhood connected domains of the target area includes the following specific steps:
will be、/>、/>、/>、/>、/>、/>And +.>And respectively taking the two adjacent domains as a neighborhood direction, and acquiring the nearest connected domain in each adjacent domain direction of the center of the target area as the adjacent connected domain of the target area.
Preferably, the step of obtaining the second distance between the target area and the neighborhood pixel according to the pixel of the target area on the connection line and the pixel of the neighborhood connected domain includes the following specific steps:
and acquiring Euclidean distances between all edge pixel points of the target area on the connection line and all edge pixel points of the neighborhood connected domain on the connection line, and taking the minimum Euclidean distance between the edge pixel points of the target area on the connection line and the edge pixel points of the neighborhood connected domain as a second distance between the target area and the neighborhood connected domain.
Preferably, the obtaining the proximity degree of the target area and each neighborhood connected domain according to the first distance and the second distance between the target area and each neighborhood connected domain includes the following specific steps:
wherein,the proximity degree of the target area and the j-th neighborhood connected area is determined; />A first distance between the target area and the jth neighborhood connected domain; />A second distance between the target area and the jth neighborhood connected domain; />The number of the neighborhood connected domains of the target area.
Preferably, the obtaining the probability that the target area is a pulp point according to the proximity degree of the target area and all the neighborhood connected areas includes the following specific steps:
wherein the method comprises the steps ofProbability of being a pulp point for the target area; />The proximity degree of the target area and the j-th neighborhood connected area is determined; />For the target areaThe number of neighborhood connected domains.
Preferably, the obtaining all the connected domains not being pulp points according to the probability that each suspected pulp point area is a pulp point and the fitting degree of each connected domain to the ellipse comprises the following specific steps:
when the probability that the suspected pulp point area is a pulp point is smaller than a preset second threshold value, the communication area corresponding to the suspected pulp point area is not the pulp point; when the area of the communicating region is smaller than or equal to the preset precision area or larger than or equal to the middle of the preset standard area and the fitting degree of the communicating region to the ellipse is smaller than or equal to a preset first threshold value, the communicating region is not a pulp point.
The technical scheme of the invention has the beneficial effects that: according to the embodiment of the invention, the connected domain of the paper surface image is obtained, the first ellipse and the second ellipse of the connected domain are obtained according to the minimum circumscribed rectangle of the convex hull region of the connected domain, the fitting degree of the connected domain to the ellipse is further obtained, the micro region with the shape similar to the ellipse is screened according to the fitting degree, namely the region with the suspected pulp point, the distance between the suspected pulp point region and the central point of the neighborhood connected domain and the minimum distance between the suspected pulp point region and the neighborhood connected domain on the connecting line of the central point are obtained and are respectively used as the first distance and the second distance, the proximity degree of the suspected pulp point region and the neighborhood connected domain is obtained according to the ratio of the second distance to the first distance, the probability that the suspected pulp point region is a pulp point is obtained according to the proximity degree, all the connected domains which are not pulp points are further obtained, the connected domain which is not the pulp point is marked, the marked image is obtained, and the marked image is divided, and the streak defect is obtained. According to the method, the suspected pulp point areas are obtained, and all areas which are not pulp points are screened out according to the probability that the suspected pulp point areas are pulp points, so that the influence of the pulp points on the splitting effect is eliminated when the mark image is split by the watershed, the excessive splitting is avoided, the accurate edges of streak defects are obtained, and the paper defect detection is more accurate.
Drawings
In order to more clearly illustrate the embodiments of the invention or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described, it being obvious that the drawings in the following description are only some embodiments of the invention, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart showing the steps of a machine vision-based paper defect detection method according to the present invention;
FIG. 2 is a paper surface image;
FIG. 3 is a paper surface gradient image;
fig. 4 is a streak edge image.
Detailed Description
In order to further describe the technical means and effects adopted by the present invention to achieve the preset purpose, the following detailed description refers to specific embodiments, structures, features and effects of a machine vision-based paper defect detection method according to the present invention with reference to the accompanying drawings and preferred embodiments. In the following description, different "one embodiment" or "another embodiment" means that the embodiments are not necessarily the same. Furthermore, the particular features, structures, or characteristics of one or more embodiments may be combined in any suitable manner.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs.
The following specifically describes a specific scheme of the paper defect detection method based on machine vision provided by the invention with reference to the accompanying drawings.
Referring to fig. 1, a flowchart of a machine vision-based paper defect detection method according to an embodiment of the invention is shown, the method includes the following steps:
s001, collecting an image of the surface of the paper.
And shooting the surface of the paper by using an industrial camera to obtain an RGB image of the surface of the paper. It should be noted that, the vertical angle shooting of the camera can reduce the influence of the illumination direction to the greatest extent, so the shooting angle of the industrial camera is vertical shooting. The photographed RGB image of the paper surface contains only the paper area and no other background area.
In order to facilitate subsequent analysis and processing, graying operation is carried out on the RGB image of the paper surface to obtain a gray scale image which is recorded as the paper surface image. One paper surface image of an embodiment of the present invention is shown in fig. 2.
Thus, a sheet surface image is acquired.
S002, acquiring a connected domain of the paper surface image.
It should be noted that during the production process of paper, streak defects may be generated by human errors or other reasons, so that the streak defects need to be detected when leaving the factory, but the pulp points in the quality fault tolerance range affect the detection result because of the over-segmentation problem, so that the connected domains in the paper surface image need to be extracted, so that the connected domains which may be the pulp points are screened out according to the shape and the distribution characteristics of the connected domains, and when the paper surface image is segmented later, the pulp points are avoided, the over-segmentation is avoided, and the accurate streak defects are obtained.
In the embodiment of the invention, firstly, the gradient amplitude of each pixel point in the paper surface image is obtained, the gradient amplitude of all the pixel points in the paper surface image forms the paper surface gradient image, and referring to fig. 3, the paper surface gradient image is subjected to threshold segmentation to obtain a paper surface binary image, wherein white pixel points in the paper surface binary image are pulp point edges or streak defect edges or noise points on paper. In the embodiment of the invention, the method for threshold segmentation of the gradient image on the surface of the paper is an Ojin threshold segmentation method, and in other embodiments, an operator can select the threshold segmentation method according to actual implementation conditions.
And carrying out connected domain analysis on the paper surface binary image to obtain all connected domains in the paper surface binary image. In the embodiment of the invention, the adopted connected domain analysis method is as followsAlgorithm, in other embodiments, the practitioner may select the connected domain analysis method according to the actual implementation.
The connected domain in the obtained paper surface binary image may be a connected domain formed by an edge of a pulp point, may be a connected domain formed by an edge of a streak defect, or may be a noise point. In order to obtain a complete pulp point or streak defect, the connected domain needs to be filled.
In the embodiment of the invention, for each multi-connected domain in the paper surface binary image, a hollow area in the middle of the multi-connected domain is filled, and the multi-connected domain is converted into a single connected domain. It should be noted that the multiple communicating domains and the single communicating domain are known techniques, and detailed descriptions thereof are omitted in the embodiments of the present invention.
Thus, connected domains in the paper surface binary image are obtained.
And forming one connected domain of the paper surface image by all the corresponding pixel points of the pixel points in each connected domain in the paper surface binary image, so that a plurality of connected domains of the paper surface image can be obtained.
Thus, the connected domain in the sheet surface image is acquired.
S003, screening a suspected pulp point area.
After the connected domain of the paper surface image is obtained, it is necessary to extract the connected domain in order to prevent the micro-areas such as pulp points from affecting the detection result during the detection. Because the shape of the pulp points is approximate to ellipse and circle, the embodiment of the invention firstly screens the connected domain which is likely to be the pulp points through ellipse fitting and area judgment, then further screens the connected domain of the pulp points according to the distribution position of the connected domain which is likely to be the pulp points, and acquires the accurate connected domain of the pulp points, so that the influence of the pulp points is eliminated in the subsequent process of segmenting the paper surface image, and the accurate streak defect is acquired.
In the embodiment of the invention, convex hull detection is firstly carried out on each connected domain in the paper surface image respectively to obtain a convex hull region of each connected domain, and the minimum circumscribed rectangle of the convex hull region of each connected domain is obtained and recorded as a first rectangle of each connected domain.
It should be noted that, since the first rectangle is the smallest circumscribed rectangle of the convex hull region of the connected domain, if the connected domain is in the shape of an ellipse, the center point of the ellipse is located at the center of the first rectangle, and the length of the major axis of the ellipse is close to the length of the diagonal line of the first rectangle.
In the embodiment of the invention, any connected domain in the paper surface image is taken as a target connected domain, the central point of a first rectangle of the target connected domain is obtained and taken as the central point of an ellipse to be fitted by the target connected domain, and the sitting mark is as. Obtaining the diagonal length of the first rectangle of the target connected domain as the length of the major axis of the ellipse to be fitted by the target connected domain by +.>And (3) representing. And taking any diagonal line of a first rectangle passing through the target communicating region as a perpendicular bisector, and taking the length of a line segment formed by two intersection points of the perpendicular bisector and the edge of the target communicating region as the length of the short axis of the ellipse to be fitted by the target communicating region, wherein b is represented.
In the first rectangle for obtaining the target connected domain, the central point isThe length of the long axis is +.>If the minor axis is an ellipse with length b, there may be two different ellipses, and the major axes of the two ellipses are two diagonals of the first rectangle of the target connected domain. These two ellipses are denoted as first ellipse and second ellipse, respectively.
The two foci on the ellipse are located on the major axis of the ellipse, the distance between the two foci is the focal length, if the focal length is recorded asAccording to the elliptic theorem +.>Thereby two foci of the ellipse can be obtained. The two foci in the first ellipse are respectively marked +.>、/>The two foci in the second ellipse are respectively marked as +.>、/>
It is noted that, according to the elliptic theorem, the sum of distances from any one point on the ellipse to two focuses of the ellipse is equal to the length of the major axis of the ellipse, so that the fitting degree of each pixel point on the edge of the target connected domain to the first ellipse and the second ellipse can be calculated according to the theorem.
In the embodiment of the invention, the pixel points on the edge of the target connected domain are marked as edge pixel points, and the fitting degree of each edge pixel point to the first ellipse, such as the first ellipse of the target connected domain, is obtainedThe fitting degree of each edge pixel point to the first ellipse is as follows:
wherein,is the +.>Fitting degree of the edge pixel points to the first ellipse; />Is the +.>Edge pixel points; />、/>Two foci in the first ellipse; />Is the length of the major axis of the first ellipse;is an exponential function with a natural constant as a base; />Is the +.>Edge pixels->Focus to the first ellipse +.>European distance,/, of->Is the +.>Edge pixels->Focus to the first ellipse +.>Is a Euclidean distance of (2); />Is super parameter for preventing ++>Approaching 0, in the present example,/-in the present example>In other embodiments, the practitioner can set +.>Is a value of (2); when->The more approaching 0, the +.>The greater the fit of the edge pixel points to the first ellipse.
And taking the average value of the fitting degree of all edge pixel points of the target connected domain to the first ellipse as the fitting degree of the target connected domain to the first ellipse.
And similarly, acquiring the fitting degree of the target connected domain to the second ellipse, and taking the larger value of the fitting degree of the target connected domain to the first ellipse and the fitting degree of the target connected domain to the second ellipse as the fitting degree of the target connected domain to the ellipse.
The higher the fitting degree of the target communicating region to the ellipse is, the more the shape of the target communicating region is similar to the ellipse, and the more likely the target communicating region is a pulp point in paper. Since the area of the pulp point is small, the connected domain which is likely to be the pulp point can be screened out by limiting the fitting degree and the area. Based on human experience, the accuracy of the inspection machine is generallyTherefore will->As the preset precision area, the embodiment of the invention only focuses on areas larger than +.>In the paper detection standard, for the occurrence of oneThe small regions are inclusive, so that it is prescribed according to the general detection standard that when the area of the target communicating region is smaller than +.>It may be the pulp point at that time, so will +.>As a preset standard area.
In the embodiment of the invention, the area of the target connected domain is acquired and is denoted by S. Presetting a threshold valueThe first threshold is preset and is used for screening the target connected domain with large fitting degree, and the fitting degree range is 0,1]In order to make defect detection more comprehensive, the embodiment of the invention selects a fitting degree range [0,1 ]]The middle 0.5 is the preset first threshold +.>In other embodiments, the practitioner can set a preset first threshold value according to the actual implementation>Is a value of (2).
The target connected domain is taken as a suspected pulp point region when the target connected domain satisfies the following conditions:
wherein S is the area of the target connected domain,fitting degree of the target connected domain to ellipse; />A first threshold is preset.
And similarly, acquiring the fitting degree of each connected domain to the ellipse and the area of each connected domain, and acquiring all suspected pulp point areas according to the fitting degree of each connected domain to the ellipse and the area of each connected domain. The connected domain that does not satisfy the above conditions is not a pulp point.
Thus, a suspected pulp point area is obtained.
S004, acquiring a mark image.
It should be noted that, since the overall trend of the streak is linear, but there may be a local variation, and since the partial area of the streak defect is not obvious, when the connected domain is obtained in step S002, the streak defect may be divided into a plurality of connected domains, each connected domain of the streak defect is distributed in an elongated shape, which is relatively similar to the oval shape, and therefore the obtained suspected pulp point area may also include the connected domain of the partial streak defect, and it is necessary to reject the same. All the connected domains of the streak defect are distributed on a straight line approximately, and the distance between the adjacent connected domains of the streak defect is smaller, so that the streak defect in the suspected pulp point area can be screened out by combining the characteristics.
In the embodiment of the invention, the center of an ellipse fitted to each connected domain is taken as the center of each connected domain. Any one suspected pulp area is taken as a target area. Will be、/>、/>、/>、/>、/>、/>And respectively taking the adjacent directions as one adjacent direction, and acquiring the nearest connected domain in each adjacent direction of the center of the target area as the adjacent connected domain of the target area, wherein the target area has 8 adjacent connected domains at most because of the total of 8 adjacent directions.
And taking any one neighborhood connected domain of the target area as a target neighborhood connected domain, connecting the center of the target area with the center of the target neighborhood connected domain, taking the length of the connecting line (namely, the Euclidean distance between the center of the target area and the center of the target neighborhood connected domain) as the first distance between the target area and the target neighborhood connected domain, acquiring Euclidean distances between all edge pixel points of the target area on the connecting line and all edge pixel points of the target neighborhood connected domain on the connecting line, and taking the smallest Euclidean distance as the second distance between the target area and the target neighborhood connected domain.
And similarly, acquiring a first distance and a second distance between the target area and each neighborhood connected domain.
Obtaining the proximity degree of the target region and each neighborhood connected domain according to the first distance and the second distance between the target region and each neighborhood connected domain, wherein the proximity degree of the target region and the j-th neighborhood connected domain is as follows:
wherein,the proximity degree of the target area and the j-th neighborhood connected area is determined; />A first distance between the target area and the jth neighborhood connected domain; />A second distance between the target area and the jth neighborhood connected domain; />The number of neighborhood connected domains of the target area; when the ratio of the second distance to the first distance +.>The smaller the target area and the jth neighborhood connected domain are, the more slender the target area and the jth neighborhood connected domain are, the closer the distance between the target area and the jth neighborhood connected domain is, the more likely the target area and the jth neighborhood connected domain are part of the streak defect, and the larger the proximity degree between the target area and the jth neighborhood connected domain is; when the ratio of the second distance to the first distanceThe larger the distance between the target area and the jth neighborhood connected domain, the more discontinuous the target area and the jth neighborhood connected domain, the less likely the target area and the jth neighborhood connected domain are part of the streak defect, and the smaller the proximity degree between the target area and the jth neighborhood connected domain is.
It should be noted that, when the proximity of the target area to one neighborhood connected domain is larger, the smaller the proximity of the target area to the other neighborhood connected domains, the more likely the target area is a portion of the streak defect, the less likely the target area is a pulp point, and when the proximity of the target area to all neighborhood connected domains is not large, the less likely the target area is a portion of the streak defect, the more likely the target area is a pulp point.
In the embodiment of the invention, the probability that the target area is a pulp point is obtained according to the proximity degree of the target area and all the neighborhood connected areas:
wherein the method comprises the steps ofProbability of being a pulp point for the target area; />The proximity degree of the target area and the j-th neighborhood connected area is determined; />The number of neighborhood connected domains of the target area; />For the entropy of the proximity of the target region to all the neighborhood connected regions, when the proximity of the target region to all the neighborhood connected regions is equal (i.e., is +.>) When the entropy of the proximity degree of the target area and all the neighborhood connected areas is maximum, is +.>Thus utilizeDivided by->Normalizing; when the entropy of the proximity degree of the target area and all the neighborhood connected domains is larger, the proximity degree of the target area and all the neighborhood connected domains is not large, the target area is less likely to be part of streak defects, the target area is more likely to be a pulp point, and the probability that the target area is the pulp point is higher; on the contrary, when the entropy of the proximity degree of the target area and all the neighborhood connected domains is smaller, the difference between the proximity degrees of the target area and all the neighborhood connected domains is larger, the target area is unlikely to be a part of streak defects, the target area is unlikely to be a pulp point, and the probability that the target area is the pulp point is smaller.
Similarly, the probability that each suspected pulp point region is a pulp point is obtained.
Presetting a threshold valueA preset second threshold value is recorded and used for screening connected domains serving as pulp points, and the second threshold value is preset in the embodiment of the invention>In other embodiments, the practitioner may set a preset second threshold +.>Is a value of (2). When the probability of the suspected pulp point area being a pulp point is greater than or equal to a preset second threshold +.>And when the paper pulp is detected, taking the suspected paper pulp point area as a paper pulp point, otherwise, taking the suspected paper pulp point area as a paper pulp point.
To this end, a pulp point is obtained.
The connected domain outside the pulp point is the connected domain which is not the pulp point. And marking all connected areas which are not pulp points in the pulp surface image to obtain a marked image.
Thus, a marker image is acquired.
S005, acquiring a paper defect area according to the marked image.
It should be noted that, all the connected domains that are not pulp points are connected domains of streak defects, and since the connected domains are obtained according to the gradient of the pixel points in the paper surface image, the edges less obvious to the streak defects may not be included in the connected domains. The watershed has good response to weak edges, so that the accurate edges of streak defects can be obtained by combining a watershed segmentation algorithm. The watershed segmentation is carried out based on an image gradient map, a water collecting basin is formed by being submerged upwards from the minimum value in the image gradient map, and a dam is built at the boundary of the water collecting basin, so that the segmentation effect is realized. If the watershed segmentation is directly performed on the paper surface gradient image, the watershed segmentation is influenced by noise points or pulp points in the paper surface gradient image, so that over segmentation is caused. The region to be segmented is marked based on marked watershed segmentation, and the region is only submerged upwards from the minimum value of the marked region, so that over segmentation can be avoided. The marked area in the marked image obtained by the embodiment of the invention is a connected area which is not a pulp point, namely an area which needs to be segmented.
In the embodiment of the invention, the mark image is segmented by using a watershed algorithm based on marks, edges of all areas obtained by segmentation are edges of streak defects, the streak edge image is shown in fig. 4, and an area surrounded by the edges of the streak defects is the streak defect.
Thus, a complete streak defect on the surface of the paper was obtained.
Through the steps, the detection of paper defects is completed.
According to the embodiment of the invention, the connected domain of the paper surface image is obtained, the first ellipse and the second ellipse of the connected domain are obtained according to the minimum circumscribed rectangle of the convex hull region of the connected domain, the fitting degree of the connected domain to the ellipse is further obtained, the micro region with the shape similar to the ellipse is screened according to the fitting degree, namely the region with the suspected pulp point, the distance between the suspected pulp point region and the central point of the neighborhood connected domain and the minimum distance between the suspected pulp point region and the neighborhood connected domain on the connecting line of the central point are obtained and are respectively used as the first distance and the second distance, the proximity degree of the suspected pulp point region and the neighborhood connected domain is obtained according to the ratio of the second distance to the first distance, the probability that the suspected pulp point region is a pulp point is obtained according to the proximity degree, all the connected domains which are not pulp points are further obtained, the connected domain which is not the pulp point is marked, the marked image is obtained, and the marked image is divided, and the streak defect is obtained. According to the method, the suspected pulp point areas are obtained, and all areas which are not pulp points are screened out according to the probability that the suspected pulp point areas are pulp points, so that the influence of the pulp points on the splitting effect is eliminated when the mark image is split by the watershed, the excessive splitting is avoided, the accurate edges of streak defects are obtained, and the paper defect detection is more accurate.
The foregoing description of the preferred embodiments of the invention is not intended to be limiting, but rather is intended to cover all modifications, equivalents, alternatives, and improvements that fall within the spirit and scope of the invention.

Claims (10)

1. A machine vision-based paper defect detection method, comprising the steps of:
collecting an image of the surface of the paper; acquiring a connected domain of the surface image of the paper; acquiring the minimum circumscribed rectangle of the convex hull region of each connected domain as a first rectangle of each connected domain; acquiring a first ellipse and a second ellipse of each connected domain according to the first rectangle of each connected domain; acquiring the fitting degree of each connected domain to the ellipse according to the first ellipse and the second ellipse of each connected domain; screening suspected pulp point areas according to the fitting degree of each connected domain to the ellipse;
taking any suspected pulp point area as a target area, and acquiring all neighborhood connected areas of the target area; taking the length of a connecting line between the center of the target area and the center of the neighborhood communication domain as a first distance between the target area and the neighborhood pixel point, and acquiring a second distance between the target area and the neighborhood pixel point according to the pixel point of the target area on the connecting line and the pixel point of the neighborhood communication domain;
obtaining the proximity degree of the target area and each neighborhood connected domain according to the first distance and the second distance between the target area and each neighborhood connected domain; acquiring the probability of the target area as a pulp point according to the proximity degree of the target area and all the neighborhood connected areas; acquiring the probability that all suspected pulp point areas are pulp points; acquiring all connected domains which are not pulp points according to the probability that each suspected pulp point area is a pulp point and the fitting degree of each connected domain to an ellipse;
marking all connected areas which are not pulp points in the pulp surface image to obtain a marked image; dividing a marked image by using a watershed algorithm based on the mark, wherein the edges obtained by dividing are edges of streak defects, and obtaining the streak defects according to the edges of the streak defects.
2. The machine vision-based paper defect detection method according to claim 1, wherein the acquiring the connected domain of the paper surface image comprises the following specific steps:
acquiring a paper surface gradient image according to the gradient amplitude of each pixel point in the paper surface image, and performing threshold segmentation on the paper surface gradient image to obtain a paper surface binary image; carrying out connected domain analysis on the paper surface binary image to obtain all connected domains in the paper surface binary image; filling each multi-connected domain in the binary image on the surface of the paper, and converting the multi-connected domain into a single-connected domain;
and forming a connected domain of the paper surface image by all the corresponding pixel points of the pixel points in each single connected domain in the paper surface binary image in the paper surface image.
3. The machine vision-based paper defect detection method according to claim 1, wherein the step of obtaining the first ellipse and the second ellipse of each connected domain from the first rectangle of each connected domain comprises the following specific steps:
taking the central point of the first rectangle of the connected domain as the central point of the ellipse, and marking asThe length of the diagonal line of the first rectangle is taken as the length of the major axis of the ellipse, and is denoted as +.>The method comprises the steps of carrying out a first treatment on the surface of the Taking any diagonal line of a first rectangle passing through the communicating region as a perpendicular bisector, taking the length of a line segment formed by two intersection points of the perpendicular bisector and the edge of the communicating region as the length of the short axis of the ellipse, and marking the length as b;
the central point of the first rectangle of the connected domain isThe length of the long axis is->Two ellipses of length b of the minor axis are denoted as a first ellipse and a second ellipse, respectively.
4. The machine vision-based paper defect detection method according to claim 1, wherein the step of obtaining the fitting degree of each connected domain to the ellipse according to the first ellipse and the second ellipse of each connected domain comprises the following specific steps:
acquiring two focuses of a first ellipse and two focuses of a second ellipse; first of connected domainThe fitting degree of each edge pixel point to the first ellipse is as follows:
wherein,is the->Fitting degree of the edge pixel points to the first ellipse; />Is the->Edge pixel points; />、/>Two foci in the first ellipse; />Is the length of the major axis of the first ellipse; />Is the->Edge pixels->Focus to the first ellipse +.>European distance,/, of->Is the->Edge pixels->Focus to the first ellipse +.>Is a Euclidean distance of (2); />Is a super parameter; />Is an exponential function with a natural constant as a base;
taking the average value of the fitting degree of all edge pixel points of the connected domain to the first ellipse as the fitting degree of the connected domain to the first ellipse;
similarly, the fitting degree of the connected domain to the second ellipse is obtained; and taking the larger value of the fitting degree of the connected domain to the first ellipse and the fitting degree of the connected domain to the second ellipse as the fitting degree of the connected domain to the ellipse.
5. The machine vision-based paper defect detection method according to claim 1, wherein the screening of the suspected pulp point area according to the fitness of each connected domain to an ellipse comprises the following specific steps:
acquiring the area of each connected domain; and when the area of the communicating region is positioned between the preset precision area and the preset standard area and the fitting degree of the communicating region to the ellipse is larger than a preset first threshold value, taking the communicating region as a suspected pulp point region.
6. The machine vision-based paper defect detection method according to claim 1, wherein the step of obtaining all neighborhood connected domains of the target area comprises the following specific steps:
will be、/>、/>、/>、/>、/>、/>And +.>And respectively taking the two adjacent domains as a neighborhood direction, and acquiring the nearest connected domain in each adjacent domain direction of the center of the target area as the adjacent connected domain of the target area.
7. The machine vision-based paper defect detection method according to claim 1, wherein the step of obtaining the second distance between the target region and the neighboring pixel according to the pixel of the target region and the pixel of the neighboring connected region on the line comprises the following specific steps:
and acquiring Euclidean distances between all edge pixel points of the target area on the connection line and all edge pixel points of the neighborhood connected domain on the connection line, and taking the minimum Euclidean distance between the edge pixel points of the target area on the connection line and the edge pixel points of the neighborhood connected domain as a second distance between the target area and the neighborhood connected domain.
8. The machine vision-based paper defect detection method according to claim 1, wherein the step of obtaining the proximity degree of the target area to each neighborhood connected domain according to the first distance and the second distance between the target area and each neighborhood connected domain comprises the following specific steps:
wherein,the proximity degree of the target area and the j-th neighborhood connected area is determined; />A first distance between the target area and the jth neighborhood connected domain; />A second distance between the target area and the jth neighborhood connected domain; />The number of the neighborhood connected domains of the target area.
9. The machine vision-based paper defect detection method according to claim 1, wherein the obtaining the probability that the target area is a pulp point according to the proximity degree of the target area and all the neighborhood connected areas comprises the following specific steps:
wherein the method comprises the steps ofProbability of being a pulp point for the target area; />The proximity degree of the target area and the j-th neighborhood connected area is determined; />The number of the neighborhood connected domains of the target area.
10. The machine vision-based paper defect detection method according to claim 5, wherein the step of obtaining all connected domains not being pulp points according to the probability that each suspected pulp point area is a pulp point and the fitting degree of each connected domain to an ellipse comprises the following specific steps:
when the probability that the suspected pulp point area is a pulp point is smaller than a preset second threshold value, the communication area corresponding to the suspected pulp point area is not the pulp point; when the area of the communicating region is smaller than or equal to the preset precision area or larger than or equal to the middle of the preset standard area and the fitting degree of the communicating region to the ellipse is smaller than or equal to a preset first threshold value, the communicating region is not a pulp point.
CN202311465240.4A 2023-11-07 2023-11-07 Paper defect detection method based on machine vision Active CN117214183B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311465240.4A CN117214183B (en) 2023-11-07 2023-11-07 Paper defect detection method based on machine vision

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311465240.4A CN117214183B (en) 2023-11-07 2023-11-07 Paper defect detection method based on machine vision

Publications (2)

Publication Number Publication Date
CN117214183A true CN117214183A (en) 2023-12-12
CN117214183B CN117214183B (en) 2024-01-30

Family

ID=89049595

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311465240.4A Active CN117214183B (en) 2023-11-07 2023-11-07 Paper defect detection method based on machine vision

Country Status (1)

Country Link
CN (1) CN117214183B (en)

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6748110B1 (en) * 2000-11-09 2004-06-08 Cognex Technology And Investment Object and object feature detector system and method
CN203275314U (en) * 2013-06-04 2013-11-06 北京兆维电子(集团)有限责任公司 Online paper flaw detection system
WO2016047377A1 (en) * 2014-09-22 2016-03-31 富士フイルム株式会社 Image-recording device, and image defect detection device and method
WO2017171651A1 (en) * 2016-03-30 2017-10-05 Agency For Science, Technology And Research System and method for imaging a surface defect on an object
CN107255641A (en) * 2017-06-06 2017-10-17 西安理工大学 A kind of method that Machine Vision Detection is carried out for GRIN Lens surface defect
CN108537153A (en) * 2018-03-27 2018-09-14 华南农业大学 A kind of detection of log board hole defect and localization method based on ellipse fitting
CN111137645A (en) * 2019-12-31 2020-05-12 四川索牌科技股份有限公司 Detection system and detection method for paper cover
CN114627118A (en) * 2022-05-13 2022-06-14 江苏裕荣光电科技有限公司 Method and system for identifying insulation defects of optical fiber cable
CN115239735A (en) * 2022-09-23 2022-10-25 探长信息技术(苏州)有限公司 Communication cabinet surface defect detection method based on computer vision
CN115457035A (en) * 2022-11-10 2022-12-09 山东鲁旺机械设备有限公司 Machine vision-based construction hanging basket welding quality detection method
CN116758061A (en) * 2023-08-11 2023-09-15 山东优奭趸泵业科技有限公司 Casting surface defect detection method based on computer vision

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6748110B1 (en) * 2000-11-09 2004-06-08 Cognex Technology And Investment Object and object feature detector system and method
CN203275314U (en) * 2013-06-04 2013-11-06 北京兆维电子(集团)有限责任公司 Online paper flaw detection system
WO2016047377A1 (en) * 2014-09-22 2016-03-31 富士フイルム株式会社 Image-recording device, and image defect detection device and method
WO2017171651A1 (en) * 2016-03-30 2017-10-05 Agency For Science, Technology And Research System and method for imaging a surface defect on an object
CN107255641A (en) * 2017-06-06 2017-10-17 西安理工大学 A kind of method that Machine Vision Detection is carried out for GRIN Lens surface defect
CN108537153A (en) * 2018-03-27 2018-09-14 华南农业大学 A kind of detection of log board hole defect and localization method based on ellipse fitting
CN111137645A (en) * 2019-12-31 2020-05-12 四川索牌科技股份有限公司 Detection system and detection method for paper cover
CN114627118A (en) * 2022-05-13 2022-06-14 江苏裕荣光电科技有限公司 Method and system for identifying insulation defects of optical fiber cable
CN115239735A (en) * 2022-09-23 2022-10-25 探长信息技术(苏州)有限公司 Communication cabinet surface defect detection method based on computer vision
CN115457035A (en) * 2022-11-10 2022-12-09 山东鲁旺机械设备有限公司 Machine vision-based construction hanging basket welding quality detection method
CN116758061A (en) * 2023-08-11 2023-09-15 山东优奭趸泵业科技有限公司 Casting surface defect detection method based on computer vision

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
PETERSON ADRIANO BELAN等: "Machine vision system for quality inspection of beans", 《THE INTERNATIONAL JOURNAL OF ADVANCED MANUFACTURING TECHNOLOGY》, pages 1 - 15 *
李家宏等: "基于 k-邻域前景像素分析的划痕提取方法", 《计算机应用》, vol. 37, no. 2, pages 175 - 178 *
艾淑芳;闫钧华;李大雷;许俊峰;沈静;: "遥感图像中的机场跑道检测算法", 电光与控制, vol. 24, no. 2, pages 43 - 45 *
郝勇;温钦华;吴文辉;邱小川;: "轴承防尘盖缺陷机器视觉自动检测方法研究", 测控技术, no. 01, pages 85 - 90 *

Also Published As

Publication number Publication date
CN117214183B (en) 2024-01-30

Similar Documents

Publication Publication Date Title
CN108776140B (en) Machine vision-based printed matter flaw detection method and system
CN106228161B (en) A kind of pointer-type dial plate automatic reading method
CN108364280A (en) Structural cracks automation describes and width accurately measures method and apparatus
CN106056118A (en) Recognition and counting method for cells
CN108537099A (en) A kind of licence plate recognition method of complex background
CN111931776A (en) Deep learning-based double-pointer instrument reading method
CN116309600B (en) Environment-friendly textile quality detection method based on image processing
CN111260788A (en) Power distribution cabinet switch state identification method based on binocular vision
CN115439476B (en) Silk-screen defect detection method and device based on image analysis
CN116485785B (en) Surface defect detection method for solar cell
CN109712125A (en) A kind of dip roll coating application process generation bubble machine vision detection method
CN113888536B (en) Printed matter double image detection method and system based on computer vision
CN115830022A (en) Filter screen defect detection method based on machine vision
CN116740054B (en) Tongue image tooth trace detection method based on image processing
CN116310882B (en) Forestry information identification method based on high-resolution remote sensing image
CN109341524A (en) A kind of optical fiber geometric parameter detection method based on machine vision
CN116664567B (en) Solid insulation switch cabinet quality assessment method and system
CN111738256A (en) Composite material CT image segmentation method based on improved watershed algorithm
CN108830899A (en) A kind of center of circle detection method that the quick self-adapted angle point based on geometrical characteristic combines
CN115170518A (en) Cell detection method and system based on deep learning and machine vision
CN114937004A (en) Method for detecting surface pore defects of mechanical parts based on computer vision
CN117214183B (en) Paper defect detection method based on machine vision
CN116681696B (en) Mold quality monitoring method for automatic production equipment
CN112258536B (en) Integrated positioning and segmentation method for calluses and cerebellum earthworm parts
CN116485801B (en) Rubber tube quality online detection method and system based on computer vision

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
PE01 Entry into force of the registration of the contract for pledge of patent right

Denomination of invention: A Machine Vision Based Paper Defect Detection Method

Granted publication date: 20240130

Pledgee: Industrial and Commercial Bank of China Limited Sishui sub branch

Pledgor: SHANDONG SISHUI JINLIDE PAPER Co.,Ltd.

Registration number: Y2024980022529