CN115690105A - Milling cutter scratch detection method based on computer vision - Google Patents

Milling cutter scratch detection method based on computer vision Download PDF

Info

Publication number
CN115690105A
CN115690105A CN202211718931.6A CN202211718931A CN115690105A CN 115690105 A CN115690105 A CN 115690105A CN 202211718931 A CN202211718931 A CN 202211718931A CN 115690105 A CN115690105 A CN 115690105A
Authority
CN
China
Prior art keywords
milling cutter
scratch
image
characteristic
haar
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
CN202211718931.6A
Other languages
Chinese (zh)
Other versions
CN115690105B (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.)
Wuxi Huixing Intelligent Equipment Co ltd
WUXI KANGBEI ELECTRONIC EQUIPMENT CO Ltd
Original Assignee
Wuxi Huixing Intelligent Equipment Co ltd
WUXI KANGBEI ELECTRONIC EQUIPMENT 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 Wuxi Huixing Intelligent Equipment Co ltd, WUXI KANGBEI ELECTRONIC EQUIPMENT CO Ltd filed Critical Wuxi Huixing Intelligent Equipment Co ltd
Priority to CN202211718931.6A priority Critical patent/CN115690105B/en
Publication of CN115690105A publication Critical patent/CN115690105A/en
Application granted granted Critical
Publication of CN115690105B publication Critical patent/CN115690105B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

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

Abstract

The invention relates to the technical field of image data processing, in particular to a milling cutter scratch detection method based on computer vision, which is characterized in that semantic segmentation is respectively carried out on each surface gray level image of the surface of a milling cutter to obtain a milling cutter gray level image, and each milling cutter gray level image is uniformly divided into at least two sub-images; acquiring a characteristic circle-like coefficient of each pixel point according to the gradient of the pixel points in the subimages; constructing a milling cutter surface scratch haar operator according to the characteristic circle-like coefficient of each pixel point, and acquiring a surface roughness complex factor of the subimage by using the milling cutter surface scratch haar operator; obtaining the surface scratch defect probability of the milling cutter gray level image according to the surface roughness complex factor of each subimage; and carrying out milling cutter scratch detection according to the surface scratch defect probability of each milling cutter gray level image. The invention improves the accuracy of the scratch detection result of the milling cutter.

Description

Milling cutter scratch detection method based on computer vision
Technical Field
The invention relates to the technical field of image data processing, in particular to a milling cutter scratch detection method based on computer vision.
Background
The die is cut and rubbed by the milling cutter on the numerical control machine tool, so that machine parts meeting requirements are finally obtained, but the milling cutter in the numerical control machine tool can be worn after the die is machined for a long time, and the surface of the milling cutter is scratched and worn.
The worn milling cutter may lose the raw material of the die when processing the mechanical parts with high precision, so that the difference between the finally processed mechanical parts and the required precision is large, and the machine tool can be vibrated in serious conditions, so that production accidents are caused, and the production and processing costs of enterprises are increased.
At present, for the scratch abrasion detection of a milling cutter, firstly, a surface image of the milling cutter is collected, then, threshold segmentation is carried out on the surface image based on a segmentation threshold set by experience, and the scratch defect detection is realized according to a threshold segmentation result. However, the empirically set segmentation threshold is easily affected by subjectivity, resulting in inaccurate scratch defect detection results.
Disclosure of Invention
In order to solve the problem that the result of the scratch defect detection is inaccurate due to the empirically set segmentation threshold, the invention aims to provide a milling cutter scratch detection method based on computer vision, and the adopted technical scheme is as follows:
one embodiment of the invention provides a milling cutter scratch detection method based on computer vision, which comprises the following steps:
acquiring at least two surface gray level images of the surface of the milling cutter; performing semantic segmentation on each surface gray level image to obtain a milling cutter gray level image, and uniformly dividing each milling cutter gray level image into at least two sub-images;
for any subimage of any one milling cutter gray level image, acquiring a characteristic circle-like coefficient of each pixel point according to the gradient of the pixel points in the subimage; constructing a milling cutter surface scratch haar operator according to the characteristic circle-like coefficient of each pixel point, acquiring a haar characteristic value of each pixel point in the subimage by using the milling cutter surface scratch haar operator, and acquiring a characteristic image according to the haar characteristic value; acquiring a surface roughness complex factor of the subimage according to the characteristic image;
for any one milling cutter gray level image, obtaining the surface scratch defect probability of the milling cutter gray level image according to the surface roughness complex factor and the characteristic image of each sub-image under the milling cutter gray level image; and carrying out milling cutter scratch detection according to the surface scratch defect probability of each milling cutter gray level image.
Further, the method for obtaining the characteristic circle-like coefficient of each pixel point according to the gradient of the pixel points in the sub-image comprises the following steps:
and for any pixel point in the sub-image, constructing a Hessian matrix according to the gradient of the pixel point, taking the maximum characteristic value of the Hessian matrix as the scratch orthogonal direction characteristic value of the pixel point, taking the minimum characteristic value of the Hessian matrix as the scratch extending direction characteristic value of the pixel point, and taking the ratio of the scratch orthogonal direction characteristic value to the scratch extending direction characteristic value as the characteristic circle-like coefficient of the pixel point.
Further, the method for constructing the milling cutter surface scratch haar operator according to the characteristic circle-like coefficient of each pixel point comprises the following steps:
setting a characteristic circle-like coefficient threshold, counting the number of pixels of which the characteristic circle-like coefficient is smaller than the characteristic circle-like coefficient threshold as a first number, and calculating the ratio of the first number to the total number of pixels in the subimage and recording the ratio as a first ratio;
the milling cutter surface scratch haar operator is composed of a black rectangle and a white rectangle, the milling cutter surface scratch haar operator is set to be a diagonal characteristic, and the direction of a characteristic vector corresponding to a characteristic value in the scratch orthogonal direction is the same as the distribution direction of the black rectangle in the milling cutter surface scratch haar operator;
acquiring a difference value between a constant 1 and a first ratio, and taking the product of the side length of the sub-image and the difference value as the side length of a black rectangle in a milling cutter surface scratch haar operator; and acquiring an adjusting proportion coefficient according to the first ratio, and acquiring the size of the milling cutter surface scratch haar operator according to the product of the side length of a black rectangle in the milling cutter surface scratch haar operator and the adjusting proportion coefficient.
Further, the method for obtaining the adjustment scaling factor according to the first ratio includes:
when the difference value between the constant 1 and the first ratio is smaller than a first threshold value, the adjusting proportion coefficient takes a first set value, and when the difference value between the constant 1 and the first ratio is larger than or equal to the first threshold value, the adjusting proportion coefficient takes a second set value.
Further, the method for acquiring the characteristic image includes:
and normalizing the haar characteristic value of each pixel point in the subimage to obtain a corresponding normalized haar characteristic value, wherein an image formed by the normalized haar characteristic values of all the pixel points in the subimage is a characteristic image.
Further, the method for acquiring the surface roughness complexity factor of the sub-image according to the characteristic image comprises the following steps:
and constructing a Weber distribution model of the characteristic image, acquiring shape parameters and proportion parameters of the Weber distribution model by using a maximum likelihood estimation method, acquiring corresponding ratios by using the shape parameters as numerators and the proportion parameters as denominators, and recording results obtained by using the opposite numbers of the ratios as indexes of natural constants as surface roughness complex factors of the subimages.
Further, the method for obtaining the probability of the surface scratch defect of the milling cutter gray-scale image according to the surface roughness complex factor and the characteristic image of each sub-image in the milling cutter gray-scale image comprises the following steps:
constructing a rectangular coordinate system by taking the shape parameters as a longitudinal axis and the proportion parameters as a transverse axis, acquiring parameter points of each sub-image in the rectangular coordinate system, acquiring scratch defect parameter points by using the Otsu method based on the shape parameters and the proportion parameters corresponding to the parameter points, and counting the number of the scratch defect parameter points as a second number;
and calculating the ratio of the second quantity to the quantity of the sub-images, acquiring the addition result of the surface roughness complex factors of all the sub-images, and taking the product of the addition result and the ratio as the surface scratch defect probability of the milling cutter gray level image.
Further, the method for detecting the milling cutter scratches according to the probability of the surface scratch defects of each milling cutter grayscale image comprises the following steps:
respectively carrying out normalization processing on the surface scratch defect probability of each milling cutter gray level image to obtain corresponding normalized surface scratch defect probability; and setting a surface scratch defect probability threshold, and determining that the milling cutter has scratch defects when the normalized surface scratch defect probability of the milling cutter gray level image is greater than the surface scratch defect probability threshold.
Further, the method for obtaining the haar characteristic value of each pixel point in the sub-image by using the haar operator of the scratch on the surface of the milling cutter comprises the following steps:
and for any pixel point in the sub-image, calculating the sum of gray values of all pixel points in a black rectangle in the milling cutter surface scratch haar operator corresponding to the pixel point, calculating the sum of gray values of all pixel points in a white rectangle in the milling cutter surface scratch haar operator corresponding to the pixel point, and taking the difference value between the sum of gray values of all pixel points in the black rectangle and the sum of gray values of all pixel points in the white rectangle as the haar characteristic value of the pixel point.
The invention has the following beneficial effects:
in order to ensure that the complete surface of the milling cutter is acquired, at least two surface gray level images of the surface of the milling cutter are acquired, in order to avoid background interference, semantic segmentation is respectively carried out on each surface gray level image to obtain a milling cutter gray level image, each milling cutter gray level image is uniformly divided into at least two sub-images, the complex process of acquiring the standard milling cutter surface image is reduced, and meanwhile, the accuracy of subsequent scratch defect detection can be improved; based on the direction extension characteristic of scratches on the surface of the milling cutter, the characteristic circle-like coefficients of the pixel points are obtained according to the gradient of each pixel point in the subimage, and the anisotropy of the pixel points in the image can be reflected; in order to improve the accuracy of scratch feature extraction in an image, a milling cutter surface scratch haar operator is constructed according to the characteristic circle-like coefficient of each pixel point, and the haar feature value of each pixel point in a subimage is obtained by using the milling cutter surface scratch haar operator so as to obtain a feature image; the characteristic image represents scratch characteristics in the sub-image, so that the surface roughness complex factor of the sub-image is obtained according to the characteristic image; the surface scratch defect probability is obtained by combining the surface roughness complex factor of each sub-image in the milling cutter gray level image, and under the condition that each region in the milling cutter gray level image is analyzed with the same characteristics, the analysis error of only a single region is reduced, so that the surface scratch defect probability of the milling cutter gray level image is more rigorous, and the result of milling cutter scratch detection according to the surface scratch defect probability of each milling cutter gray level image is more accurate.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions and advantages of the prior art, the drawings used in the embodiments or the description of the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and other drawings can be obtained by those skilled in the art without creative efforts.
Fig. 1 is a flowchart illustrating steps of a method for detecting scratches of a milling cutter based on computer vision according to an embodiment of the present invention;
fig. 2 is a schematic diagram of a haar operator of the surface scratch of the milling cutter in the embodiment of the invention.
Detailed Description
To further illustrate the technical means and effects of the present invention adopted to achieve the predetermined objects, the following detailed description of a method for detecting scratches of a milling cutter based on computer vision, which is provided by the present invention, with reference to the accompanying drawings and preferred embodiments, describes specific embodiments, structures, features and effects thereof. In the following description, different "one embodiment" or "another embodiment" refers to not necessarily the same embodiment. Furthermore, the particular features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs.
The following describes a specific scheme of the milling cutter scratch detection method based on computer vision in detail with reference to the accompanying drawings.
Referring to fig. 1, a flowchart illustrating steps of a method for detecting a scratch on a milling cutter based on computer vision according to an embodiment of the present invention is shown, where the method includes:
s001, acquiring at least two surface gray level images of the surface of the milling cutter; and performing semantic segmentation on each surface gray level image to obtain a milling cutter gray level image, and uniformly dividing each milling cutter gray level image into at least two sub-images.
Specifically, in order to obtain a higher-quality milling cutter surface image and enable the subsequent milling cutter scratch detection process to use scratch detail information of the milling cutter surface, a proper image shooting and collecting device needs to be selected. Compared with the traditional CMOS camera, the CCD camera has better image quality and clearer imaging details when shooting and acquiring, so that the CCD camera is used for shooting and acquiring the surface of the milling cutter to obtain the surface image of the milling cutter in the RGB color space.
Considering that the abstract mathematical model of the milling cutter is a cylindrical three-dimensional structure and different side surfaces may have different defects, in order to acquire the whole surface of the milling cutter, the surface of the milling cutter to be detected is shot by using a CCD camera to obtain at least two milling cutter surface images.
The milling cutter surface image in the RGB color space obtained by shooting and collecting is provided with three different color channels, analysis and calculation may need to be carried out on the three different channels when subsequent calculation, analysis and detection are carried out on the milling cutter surface scratch, and in order to reduce calculation cost and improve the accuracy detection effect of milling cutter surface scratch identification, the milling cutter surface image in the RGB color space is converted into a surface gray level image of the milling cutter surface by using a weighted average method. Meanwhile, in order to avoid the influence of random natural noise on the subsequent detection of the scratch quality of the surface of the milling cutter in a shooting and collecting environment, a Gaussian filtering method is used for preprocessing the surface gray level image.
The weighted average method and the gaussian filtering method are known techniques, and are not described in detail in this embodiment.
In order to avoid the influence of the background pixel points on the subsequent detection of the scratch defects of the milling cutter, semantic segmentation is carried out on each surface gray image by using a GrabCT algorithm, the background part is removed, only the milling cutter part is reserved, and then the milling cutter gray image is obtained. The GrabCT algorithm is a known technology, and is not described in detail in the embodiment of the scheme.
For any milling cutter gray level image, uniformly dividing the milling cutter gray level image into at least two sub-images, and setting the size of the uniformly divided sub-images as
Figure DEST_PATH_IMAGE001
. By dividing the grayscale image of the milling cutter, the detection of scratches on the surface of the milling cutter can be completed by utilizing the difference effect between different areas, so that the complicated process of obtaining the image of the surface of the standard milling cutter is reduced.
S002, for any sub-image of any milling cutter gray level image, obtaining a characteristic circle-like coefficient of each pixel point according to the gradient of the pixel points in the sub-image; constructing a milling cutter surface scratch haar operator according to the characteristic circle-like coefficient of each pixel point, acquiring a haar characteristic value of each pixel point in the subimage by using the milling cutter surface scratch haar operator, and acquiring a characteristic image according to the haar characteristic value; and acquiring the surface roughness complexity factor of the sub-image according to the characteristic image.
Specifically, if a scratch defect occurs in the milling cutter grayscale image, the scratch defect extends in a certain direction, and meanwhile, in the scratch extending direction, fluctuation of the grayscale value is stable, but a large grayscale value change occurs in the orthogonal direction perpendicular to the scratch extending direction, so that the scratch condition in the milling cutter grayscale image is analyzed based on the characteristic.
Taking the jth sub-image of the a-th milling cutter grayscale image as an example, the specific analysis process of the scratch condition in the sub-image is as follows:
(1) Analyzing the anisotropy of each pixel point in the subimage according to the gradient of each pixel point in the subimage, which specifically comprises the following steps: and for any pixel point in the sub-image, constructing a Hessian matrix according to the gradient of the pixel point, taking the maximum characteristic value of the Hessian matrix as the scratch orthogonal direction characteristic value of the pixel point, taking the minimum characteristic value of the Hessian matrix as the scratch extending direction characteristic value of the pixel point, and taking the ratio of the scratch orthogonal direction characteristic value to the scratch extending direction characteristic value as the characteristic circle-like coefficient of the pixel point.
As an example, taking the pixel point i in the jth sub-image as an example, first calculating a second order gradient of the pixel point i, and then constructing a hessian matrix by using the second order gradient, where the acquisition of the hessian matrix is a known technology and is not described in detail in this scheme. The characteristic value of the Hessian matrix describes the concavity and convexity on the characteristic vector of the corresponding point, the existence condition of scratches in the sub-image can be reflected, namely when no scratch defect exists in the sub-image, the characteristic value of the Hessian matrix has consistency, the difference is not large, the contour line taking any pixel point as the center is approximately circular, when the scratch defect exists in the sub-image, the characteristic value of the Hessian matrix has obvious difference, the contour line taking any pixel point as the center is oval, therefore, for the two characteristic values of the Hessian matrix, the direction of the characteristic vector with a smaller characteristic value is the extending direction of the scratch defect on the surface of the milling cutter, the direction of the characteristic vector with a larger characteristic value is the direction perpendicular to the extending direction of the image on the surface of the milling cutter, and the characteristic value with a larger scratch is taken as the characteristic value of the scratch orthogonal direction of the pixel point i
Figure 656076DEST_PATH_IMAGE002
Taking the smaller characteristic value as the characteristic value of the scratch extending direction of the pixel point i
Figure DEST_PATH_IMAGE003
And then obtaining the characteristic circle-like coefficient of the pixel point i according to the scratch orthogonal direction characteristic value and the scratch extending direction characteristic value of the pixel point i, wherein the calculation formula of the characteristic circle-like coefficient is as follows:
Figure 6286DEST_PATH_IMAGE004
wherein the content of the first and second substances,
Figure DEST_PATH_IMAGE005
the characteristic circle-like coefficient of the pixel point i;
Figure 221236DEST_PATH_IMAGE003
the scratch extension direction characteristic value of the pixel point i is obtained;
Figure 871660DEST_PATH_IMAGE002
is the scratch orthogonal direction characteristic value.
It should be noted that, when there is no scratch defect on the surface of the milling cutter, the values of the eigenvalues calculated by the hessian matrix should have the consistency characteristic, so that the difference between the eigenvalues in the orthogonal direction and the extending direction is not large, that is, the eigenvalues in the orthogonal direction and the extending direction are not large
Figure 530174DEST_PATH_IMAGE005
The closer the value of (a) is to 1; on the contrary, when the surface of the milling cutter has scratch defects, the characteristic value of the vertical orthogonal direction
Figure 898839DEST_PATH_IMAGE002
Larger, characteristic value of extension direction
Figure 183058DEST_PATH_IMAGE003
Smaller, corresponding pixel point
Figure DEST_PATH_IMAGE007
Is characterized by a value of the circle-like coefficient of less than 1.
(2) Constructing a milling cutter surface scratch haar operator according to the characteristic circle-like coefficient of each pixel point, which specifically comprises the following steps: setting a characteristic circle-like coefficient threshold, counting the number of pixels of which the characteristic circle-like coefficient is smaller than the characteristic circle-like coefficient threshold as a first number, and calculating the ratio of the first number to the total number of pixels in the subimage and recording the ratio as a first ratio; the milling cutter surface scratch haar operator is composed of a black rectangle and a white rectangle, the milling cutter surface scratch haar operator is set to be a diagonal characteristic, and the direction of a characteristic vector corresponding to a characteristic value in the scratch orthogonal direction is the same as the distribution direction of the black rectangle in the milling cutter surface scratch haar operator; acquiring a difference value between a constant 1 and a first ratio, and taking the product of the side length of the sub-image and the difference value as the side length of a black rectangle in a milling cutter surface scratch haar operator; and acquiring an adjusting proportion coefficient according to the first ratio, and acquiring the size of the milling cutter surface scratch haar operator according to the product of the side length of a black rectangle in the milling cutter surface scratch haar operator and the adjusting proportion coefficient.
As an example, a haar operator (Harr feature descriptor) has black and white rectangle features, the size of the white rectangle is the same as that of the black rectangle, and the proportion and distribution direction of the black rectangle and the white rectangle affect the final extracted feature effect of the haar operator, so the scheme considers that there is a large difference in the gray distribution variation of the pixel points in the perpendicular orthogonal direction along the milling cutter scratch, and the difference in the gray distribution variation of the pixel points in the scratch direction along the milling cutter is small, and meanwhile, the haar operator includes three haar features: the milling cutter surface scratch haar operator in the embodiment of the invention uses the diagonal features, and then determines the ratio of black and white rectangles of the milling cutter surface scratch haar operator by using the characteristic circle-like coefficient of each pixel point in the subimage, so that the calculation formula of the side length of the black rectangle in the milling cutter surface scratch haar operator is as follows:
Figure 422410DEST_PATH_IMAGE008
wherein the content of the first and second substances,
Figure DEST_PATH_IMAGE009
the side length of a black rectangle in a haar operator for the scratch on the surface of the milling cutter is determined;
Figure 173197DEST_PATH_IMAGE010
is the side length of the sub-image;
Figure DEST_PATH_IMAGE011
the number of pixels in the sub-image with the characteristic circle-like coefficient smaller than the threshold value of the characteristic circle-like coefficient is 0.4, namely the first number;
Figure 497999DEST_PATH_IMAGE012
the total number of pixel points in the subimages;
Figure DEST_PATH_IMAGE013
is a first ratio.
It should be noted that, since the size of the characteristic circle-like coefficient can reflect whether the surface of the milling cutter has scratch defects, the first ratio of the number of pixels with the characteristic circle-like coefficient smaller than the threshold of the characteristic circle-like coefficient to the total number of pixels in the subimage is calculated
Figure 57681DEST_PATH_IMAGE013
The side length of the black rectangle in the milling cutter surface scratch haar operator is obtained by combining the first ratio and the side length of the subimage, the larger the first ratio is, the more serious the scratch defect is, the finer the division is, so that the side length of the black rectangle in the milling cutter surface scratch haar operator is smaller correspondingly, and the side length of the black rectangle in the milling cutter surface scratch haar operator is
Figure 417118DEST_PATH_IMAGE009
To the first ratio
Figure 683014DEST_PATH_IMAGE013
In a negative correlation relationship.
The size of the milling cutter surface scratch haar operator is set based on the side length of a black rectangle in the milling cutter surface scratch haar operator, namely the size of a detection window corresponding to the milling cutter surface scratch haar operator. In order to make the scratch defect more serious and the division finer, an adjusting scale factor is obtained according to a first ratio: and obtaining a difference value between the constant 1 and the first ratio, wherein when the difference value is smaller than a first threshold value, the adjusting proportion coefficient is a first set value, and when the difference value is larger than or equal to the first threshold value, the adjusting proportion coefficient is a second set value.
As an example, the calculation formula of the adjustment scaling factor is:
Figure 275539DEST_PATH_IMAGE014
wherein the content of the first and second substances,
Figure 917872DEST_PATH_IMAGE016
to adjust the proportionality coefficient; 0.3 is a first threshold; 3 is a first set value; and 9 is a second set value.
The first ratio is
Figure 397395DEST_PATH_IMAGE013
Smaller indicates less severe scratch defect, corresponding to the difference
Figure DEST_PATH_IMAGE017
The larger the difference value is, the larger the detection window corresponding to the milling cutter surface scratch haar operator is, and the smaller the division is, the larger the corresponding adjustment proportionality coefficient is.
Further, according to the side length of the black rectangle in the milling cutter surface scratch haar operator
Figure 552302DEST_PATH_IMAGE009
And adjusting the proportionality coefficient
Figure 117276DEST_PATH_IMAGE016
The product of the two parameters is used for obtaining the size of the milling cutter surface scratch haar operator, namely the side length of a black rectangle in the milling cutter surface scratch haar operator
Figure 297721DEST_PATH_IMAGE009
And adjusting the proportionality coefficient
Figure 631751DEST_PATH_IMAGE016
The product of the two is used as the side length of a detection window corresponding to a haar operator of the scratch on the surface of the milling cutter, and meanwhile, the characteristic value of the extension direction of the scratch is utilized
Figure 691979DEST_PATH_IMAGE003
Direction of corresponding eigenvector and scratch orthogonal direction eigenvalue
Figure 540987DEST_PATH_IMAGE002
The position of the haar operator of the surface scratch of the milling cutter is fixed by the direction of the corresponding characteristic vector, namely the characteristic value of the orthogonal direction of the scratch is enabled
Figure 259544DEST_PATH_IMAGE002
The direction of the corresponding feature vector is the same as the distribution direction of the black rectangle in the milling cutter surface scratch haar, as shown in fig. 2, which shows a schematic diagram of the milling cutter surface scratch haar,
Figure 713659DEST_PATH_IMAGE018
the side length of the detection window corresponding to the haar operator of the scratch on the surface of the milling cutter,
Figure 941859DEST_PATH_IMAGE009
the side length and the scratch extending direction characteristic value of a black rectangle in a scratch haar operator on the surface of the milling cutter
Figure DEST_PATH_IMAGE019
Direction of corresponding eigenvector and scratch orthogonal direction eigenvalue
Figure 950267DEST_PATH_IMAGE020
And fixing the position of a scratch haar operator on the surface of the milling cutter in the direction of the corresponding characteristic vector.
(3) The method comprises the following steps of obtaining a haar characteristic value of each pixel point in a subimage by using a milling cutter surface scratch haar operator, and specifically comprises the following steps: and for any pixel point in the sub-image, calculating the sum of gray values of all pixel points in a black rectangle in the milling cutter surface scratch haar operator corresponding to the pixel point, calculating the sum of gray values of all pixel points in a white rectangle in the milling cutter surface scratch haar operator corresponding to the pixel point, and taking the difference value between the sum of gray values of all pixel points in the black rectangle and the sum of gray values of all pixel points in the white rectangle as the haar characteristic value of the pixel point.
It should be noted that the haar operator of the milling cutter surface scratch traverses the jth sub-image by step 1.
(4) Obtaining a characteristic image according to the haar characteristic value: and normalizing the haar characteristic value of each pixel point in the subimage to obtain a corresponding normalized haar characteristic value, wherein an image formed by the normalized haar characteristic values of all the pixel points in the subimage is a characteristic image.
Specifically, a haar characteristic value of each pixel point in the jth sub-image is obtained, normalization processing is carried out on the haar characteristic value of each pixel point by utilizing a range normalization algorithm to obtain a normalized haar characteristic value of each pixel point, and an image formed by the normalized haar characteristic values of all the pixel points in the jth sub-image is used as a characteristic image
Figure DEST_PATH_IMAGE021
. The range normalization algorithm is a known technique, and is not described in detail in the scheme.
(5) Acquiring a surface roughness complex factor of the subimage according to the characteristic image, specifically: and constructing a Weber distribution model of the characteristic image, acquiring shape parameters and proportion parameters of the Weber distribution model by using a maximum likelihood estimation method, acquiring corresponding ratios by using the shape parameters as numerators and the proportion parameters as denominators, and recording results obtained by using the opposite numbers of the ratios as indexes of natural constants as surface roughness complex factors of the subimages.
As an example, a Weber distribution model is a distribution form for the wear-accumulation failure of mechanical products, and according to the distribution model, distribution parameters can be easily deduced by using probability values, and characteristic images are constructed
Figure 190624DEST_PATH_IMAGE021
The weber distribution model is:
Figure 499246DEST_PATH_IMAGE022
wherein the content of the first and second substances,
Figure DEST_PATH_IMAGE023
for characteristic images
Figure 166856DEST_PATH_IMAGE021
The center coordinate is
Figure 928139DEST_PATH_IMAGE024
The distribution probability density of the pixel values of the pixel points;
Figure DEST_PATH_IMAGE025
for characteristic images
Figure 988499DEST_PATH_IMAGE021
The center coordinate is
Figure 400894DEST_PATH_IMAGE024
The pixel value of the pixel point of (1), namely the normalized haar eigenvalue;
Figure DEST_PATH_IMAGE027
is a natural constant;
Figure 193401DEST_PATH_IMAGE028
in order to be a proportional parameter,
Figure DEST_PATH_IMAGE029
Figure 428598DEST_PATH_IMAGE030
in order to be a parameter of the shape,
Figure DEST_PATH_IMAGE031
utilizing a maximum likelihood estimation method to obtain a shape parameter and a proportion parameter of a Weber distribution model, and then combining the shape parameter and the proportion parameter to obtain a surface roughness complex factor of the jth sub-image, wherein the calculation formula of the surface roughness complex factor is as follows:
Figure 27069DEST_PATH_IMAGE032
wherein the content of the first and second substances,
Figure DEST_PATH_IMAGE033
the surface roughness complexity factor of the jth sub-image;
Figure 497234DEST_PATH_IMAGE027
is a natural constant;
Figure 319696DEST_PATH_IMAGE034
the shape parameter of the jth sub-image;
Figure DEST_PATH_IMAGE035
the scale parameter of the jth sub-image.
It should be noted that the ratio parameter
Figure 773680DEST_PATH_IMAGE035
Characteristic image of j sub-image
Figure 441422DEST_PATH_IMAGE021
The size of the pixel value in (1) is related to the characteristic image
Figure 313563DEST_PATH_IMAGE021
The larger the pixel value in (1), the more obvious the scratch defect is, the proportional parameter
Figure 41348DEST_PATH_IMAGE035
The larger, the surface roughness complexity factor
Figure 513786DEST_PATH_IMAGE033
The larger the image is, the more scratch defects exist in the jth sub-image, and the proportional parameter and the surface roughness complex factor are in positive correlation; shape parameter
Figure 719640DEST_PATH_IMAGE034
The shape parameter is related to the number of scratches in the jth sub-image, the larger the number of scratches is
Figure 711866DEST_PATH_IMAGE034
The smaller the value of (A), the more complicated the corresponding surface roughnessFactor(s)
Figure 610552DEST_PATH_IMAGE033
The larger the shape parameter, the inversely related to the surface roughness complexity factor.
Similarly, the surface roughness complex factor of each sub-image under each milling cutter gray scale image is obtained by using the method of the surface roughness complex factor of the jth sub-image of the ith milling cutter gray scale image.
Step S003, for any milling cutter gray level image, obtaining the surface scratch defect probability of the milling cutter gray level image according to the surface roughness complex factor of each sub-image under the milling cutter gray level image; and carrying out milling cutter scratch detection according to the surface scratch defect probability of each milling cutter gray level image.
Specifically, the surface roughness complex factor of each sub-image under each milling cutter gray level image is obtained according to the step S002, and since the surface roughness complex factor reflects the severity of the scratch defect in the corresponding sub-image, when the number of scratches is larger, the gray level difference between the pixel points in the scratch position region and the surrounding region is more obvious, and the shape parameter is more
Figure 528478DEST_PATH_IMAGE030
The smaller, the proportional parameter
Figure 803601DEST_PATH_IMAGE028
The larger the surface roughness complex factor is, the larger the corresponding surface roughness complex factor is, the larger the surface roughness complex factor is, for any milling cutter gray level image, the surface scratch defect probability of the milling cutter gray level image is obtained according to the surface roughness complex factor of each sub-image under the milling cutter gray level image, and specifically: constructing a rectangular coordinate system by taking the shape parameters as a longitudinal axis and the proportion parameters as a transverse axis, acquiring parameter points of each sub-image in the rectangular coordinate system, acquiring scratch defect parameter points by using the Otsu method based on the shape parameters and the proportion parameters corresponding to the parameter points, and counting the number of the scratch defect parameter points as a second number; calculating the ratio of the second number to the number of the sub-images, obtaining the addition result of the surface roughness complex factors of all the sub-images, and multiplying the addition result by the ratioAnd the probability of the surface scratch defects is used as the gray level image of the milling cutter.
As an example, taking an a-th milling cutter grayscale image as an example, since each sub-image under the a-th milling cutter grayscale image has a shape parameter and a proportion parameter, a rectangular coordinate system is constructed by taking the shape parameter as a vertical axis and the proportion parameter as a horizontal axis, the shape parameter and the proportion parameter corresponding to each sub-image are mapped in the rectangular coordinate system to form a parameter point, one sub-image corresponds to one parameter point, then based on the shape parameter and the proportion parameter corresponding to the parameter points, an ohkin method is used to respectively obtain a shape parameter segmentation threshold and a proportion parameter segmentation threshold, the parameter point corresponding to the shape parameter being smaller than the shape parameter segmentation threshold and the proportion parameter being larger than the proportion parameter segmentation threshold is taken as a scratch defect parameter point, the number of the scratch defect parameter points is counted, and the surface defect probability of the a-th milling cutter grayscale image is calculated according to the surface roughness complex factor of each sub-image and the number of the scratch defect parameter points, and the calculation formula of the surface scratch defect probability is:
Figure 915914DEST_PATH_IMAGE036
wherein the content of the first and second substances,
Figure DEST_PATH_IMAGE037
the probability of the surface scratch defect of the a-th milling cutter gray level image is shown;
Figure 438031DEST_PATH_IMAGE038
the number of scratch defect parameter points is also a second number;
Figure DEST_PATH_IMAGE039
the number of sub-images under the a-th milling cutter gray level image is obtained;
Figure 104636DEST_PATH_IMAGE040
the surface roughness complexity factor of the jth sub-image under the ith milling cutter gray scale image is obtained.
It should be noted that the scratch is countedThe number of the defect parameter points indirectly reflects the subimages with the scratch defects, and then the ratio of the number of the scratch defect parameter points to the number of the subimages is calculated
Figure DEST_PATH_IMAGE041
The proportion of the subimage with the scratch defects in the whole milling cutter gray level image is reflected, and then the sum of the surface roughness complex factors corresponding to the whole milling cutter gray level image is based
Figure 573663DEST_PATH_IMAGE042
And obtaining the proportion corresponding to the surface roughness complex factor of the sub-image with the scratch defect by using the ratio to explain the condition that the scratch defect exists in the milling cutter gray-scale image, wherein the larger the ratio is, the more the sub-image with the scratch defect exists, the more the corresponding milling cutter gray-scale image possibly has the scratch defect, and the probability of the corresponding surface scratch defect
Figure 540482DEST_PATH_IMAGE037
The larger.
Acquiring the surface scratch defect probability of each milling cutter gray level image based on a calculation formula of the surface scratch defect probability, and carrying out milling cutter scratch detection according to the surface scratch defect probability of each milling cutter gray level image: respectively carrying out normalization processing on the surface scratch defect probability of each milling cutter gray level image to obtain the corresponding normalized surface scratch defect probability; and setting a surface scratch defect probability threshold, and determining that the milling cutter has scratch defects when the normalized surface scratch defect probability of the milling cutter gray level image is greater than the surface scratch defect probability threshold.
As an example, the embodiment of the present invention uses a range normalization method to map the surface scratch defect probability of each milling cutter grayscale image into an interval [0,1], so as to obtain the normalized surface scratch defect probability of each milling cutter grayscale image, and set the threshold value of the surface scratch defect probability to be 0.75, when the normalized surface scratch defect probability of any milling cutter grayscale image is greater than the threshold value of the surface scratch defect probability, it is determined that the milling cutter has a scratch defect, and conversely, when the normalized surface scratch defect probability of each milling cutter grayscale image is less than or equal to the threshold value of the surface scratch defect probability, it is determined that the milling cutter does not have a scratch defect.
It should be noted that: the precedence order of the above embodiments of the present invention is only for description, and does not represent the merits of the embodiments. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing may also be possible or may be advantageous.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments.
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 of the present invention.

Claims (3)

1. A milling cutter scratch detection method based on computer vision is characterized by comprising the following steps:
acquiring at least two surface gray level images of the surface of the milling cutter; performing semantic segmentation on each surface gray level image by using a GrabCT algorithm to obtain a milling cutter gray level image, and uniformly dividing each milling cutter gray level image into at least two sub-images;
for any sub-image of any milling cutter gray level image, acquiring a characteristic circle-like coefficient of each pixel point according to the gradient of the pixel points in the sub-image; constructing a milling cutter surface scratch haar operator according to the characteristic circle-like coefficient of each pixel point, acquiring a haar characteristic value of each pixel point in the subimage by using the milling cutter surface scratch haar operator, and acquiring a characteristic image according to the haar characteristic value; acquiring a surface roughness complex factor of the subimage according to the characteristic image;
for any milling cutter gray level image, obtaining the surface scratch defect probability of the milling cutter gray level image according to the surface roughness complex factor and the characteristic image of each sub-image under the milling cutter gray level image; carrying out milling cutter scratch detection according to the surface scratch defect probability of each milling cutter gray level image;
the method for acquiring the characteristic circle-like coefficient of each pixel point according to the gradient of the pixel points in the sub-image comprises the following steps:
for any pixel point in the sub-image, constructing a Hessian matrix according to the gradient of the pixel point, taking the maximum characteristic value of the Hessian matrix as the scratch orthogonal direction characteristic value of the pixel point, taking the minimum characteristic value of the Hessian matrix as the scratch extending direction characteristic value of the pixel point, and taking the ratio of the scratch orthogonal direction characteristic value to the scratch extending direction characteristic value as the characteristic quasi-circle coefficient of the pixel point;
the method for constructing the milling cutter surface scratch haar operator according to the characteristic circle-like coefficient of each pixel point comprises the following steps:
setting a characteristic circle-like coefficient threshold, counting the number of pixels of which the characteristic circle-like coefficient is smaller than the characteristic circle-like coefficient threshold as a first number, calculating the ratio of the first number to the total number of pixels in the subimage, and recording the ratio as a first ratio;
the milling cutter surface scratch haar operator is composed of a black rectangle and a white rectangle, the milling cutter surface scratch haar operator is set to be a diagonal characteristic, and the direction of a characteristic vector corresponding to a characteristic value in the scratch orthogonal direction is the same as the distribution direction of the black rectangle in the milling cutter surface scratch haar operator;
acquiring a difference value between a constant 1 and a first ratio, and taking the product of the side length of the sub-image and the difference value as the side length of a black rectangle in a milling cutter surface scratch haar operator; acquiring an adjusting proportion coefficient according to the first ratio, and acquiring the size of the milling cutter surface scratch haar operator according to the product of the side length of a black rectangle in the milling cutter surface scratch haar operator and the adjusting proportion coefficient;
the method for obtaining the adjusting proportionality coefficient according to the first ratio comprises the following steps:
when the difference value between the constant 1 and the first ratio is smaller than a first threshold value, the adjusting proportion coefficient takes a first set value, and when the difference value between the constant 1 and the first ratio is larger than or equal to the first threshold value, the adjusting proportion coefficient takes a second set value;
the method for acquiring the characteristic image comprises the following steps:
normalizing the haar characteristic value of each pixel point in the subimage to obtain a corresponding normalized haar characteristic value, wherein an image formed by the normalized haar characteristic values of all the pixel points in the subimage is a characteristic image;
the method for acquiring the surface roughness complex factor of the sub-image according to the characteristic image comprises the following steps:
constructing a Weber distribution model of the characteristic image, acquiring shape parameters and proportion parameters of the Weber distribution model by using a maximum likelihood estimation method, acquiring corresponding ratios by using the shape parameters as numerators and the proportion parameters as denominators, and recording results obtained by using the opposite numbers of the ratios as indexes of natural constants as surface roughness complex factors of the subimages;
the method for acquiring the haar characteristic value of each pixel point in the subimage by using the milling cutter surface scratch haar operator comprises the following steps:
and for any pixel point in the sub-image, calculating the sum of gray values of all pixel points in a black rectangle in the milling cutter surface scratch haar operator corresponding to the pixel point, calculating the sum of gray values of all pixel points in a white rectangle in the milling cutter surface scratch haar operator corresponding to the pixel point, and taking the difference value between the sum of gray values of all pixel points in the black rectangle and the sum of gray values of all pixel points in the white rectangle as the haar characteristic value of the pixel point.
2. The milling cutter scratch detection method based on computer vision according to claim 1, wherein the obtaining method for obtaining the surface scratch defect probability of the milling cutter gray-scale image according to the surface roughness complexity factor and the feature image of each sub-image in the milling cutter gray-scale image comprises:
constructing a rectangular coordinate system by taking the shape parameters as a longitudinal axis and the proportion parameters as a transverse axis, acquiring parameter points of each sub-image in the rectangular coordinate system, acquiring scratch defect parameter points by using the Otsu method based on the shape parameters and the proportion parameters corresponding to the parameter points, and counting the number of the scratch defect parameter points as a second number;
and calculating the ratio of the second quantity to the quantity of the sub-images, acquiring the addition result of the surface roughness complex factors of all the sub-images, and taking the product of the addition result and the ratio as the surface scratch defect probability of the milling cutter gray level image.
3. The computer vision-based milling cutter scratch detection method according to claim 1, wherein the method for performing milling cutter scratch detection based on the probability of surface scratch defects of each milling cutter gray scale image comprises:
respectively carrying out normalization processing on the surface scratch defect probability of each milling cutter gray level image to obtain the corresponding normalized surface scratch defect probability; and setting a surface scratch defect probability threshold, and determining that the milling cutter has scratch defects when the normalized surface scratch defect probability of the milling cutter gray level image is greater than the surface scratch defect probability threshold.
CN202211718931.6A 2022-12-30 2022-12-30 Milling cutter scratch detection method based on computer vision Active CN115690105B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211718931.6A CN115690105B (en) 2022-12-30 2022-12-30 Milling cutter scratch detection method based on computer vision

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211718931.6A CN115690105B (en) 2022-12-30 2022-12-30 Milling cutter scratch detection method based on computer vision

Publications (2)

Publication Number Publication Date
CN115690105A true CN115690105A (en) 2023-02-03
CN115690105B CN115690105B (en) 2023-03-21

Family

ID=85057402

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211718931.6A Active CN115690105B (en) 2022-12-30 2022-12-30 Milling cutter scratch detection method based on computer vision

Country Status (1)

Country Link
CN (1) CN115690105B (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116309578A (en) * 2023-05-19 2023-06-23 山东硅科新材料有限公司 Plastic wear resistance image auxiliary detection method using silane coupling agent
CN116309602A (en) * 2023-05-24 2023-06-23 济南章力机械有限公司 Numerical control drilling and milling machine working state detection method based on machine vision
CN117554377A (en) * 2023-11-25 2024-02-13 广东博勒科技有限公司 Milling cutter scratch detection and repair device and application method thereof
CN117635609A (en) * 2024-01-25 2024-03-01 深圳市智宇精密五金塑胶有限公司 Visual inspection method for production quality of plastic products

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106338521A (en) * 2016-09-22 2017-01-18 华中科技大学 Additive manufacturing surface defect, internal defect and shape composite detection method and device
WO2019104767A1 (en) * 2017-11-28 2019-06-06 河海大学常州校区 Fabric defect detection method based on deep convolutional neural network and visual saliency
CN114332026A (en) * 2021-12-29 2022-04-12 深圳市前海研祥亚太电子装备技术有限公司 Visual detection method and device for scratch defects on surface of nameplate
CN114998216A (en) * 2022-05-06 2022-09-02 湖北文理学院 Method and device for rapidly detecting surface defects of transparent part
CN115147414A (en) * 2022-09-01 2022-10-04 南通三信塑胶装备科技股份有限公司 Method for detecting surface breakdown defect of bipolar power transistor

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106338521A (en) * 2016-09-22 2017-01-18 华中科技大学 Additive manufacturing surface defect, internal defect and shape composite detection method and device
WO2019104767A1 (en) * 2017-11-28 2019-06-06 河海大学常州校区 Fabric defect detection method based on deep convolutional neural network and visual saliency
CN114332026A (en) * 2021-12-29 2022-04-12 深圳市前海研祥亚太电子装备技术有限公司 Visual detection method and device for scratch defects on surface of nameplate
CN114998216A (en) * 2022-05-06 2022-09-02 湖北文理学院 Method and device for rapidly detecting surface defects of transparent part
CN115147414A (en) * 2022-09-01 2022-10-04 南通三信塑胶装备科技股份有限公司 Method for detecting surface breakdown defect of bipolar power transistor

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
章鹏: "多尺度特征检测:方法和应用研究" *

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116309578A (en) * 2023-05-19 2023-06-23 山东硅科新材料有限公司 Plastic wear resistance image auxiliary detection method using silane coupling agent
CN116309578B (en) * 2023-05-19 2023-08-04 山东硅科新材料有限公司 Plastic wear resistance image auxiliary detection method using silane coupling agent
CN116309602A (en) * 2023-05-24 2023-06-23 济南章力机械有限公司 Numerical control drilling and milling machine working state detection method based on machine vision
CN116309602B (en) * 2023-05-24 2023-08-04 济南章力机械有限公司 Numerical control drilling and milling machine working state detection method based on machine vision
CN117554377A (en) * 2023-11-25 2024-02-13 广东博勒科技有限公司 Milling cutter scratch detection and repair device and application method thereof
CN117554377B (en) * 2023-11-25 2024-04-30 广东博勒科技有限公司 Milling cutter scratch detection and repair device and application method thereof
CN117635609A (en) * 2024-01-25 2024-03-01 深圳市智宇精密五金塑胶有限公司 Visual inspection method for production quality of plastic products
CN117635609B (en) * 2024-01-25 2024-03-29 深圳市智宇精密五金塑胶有限公司 Visual inspection method for production quality of plastic products

Also Published As

Publication number Publication date
CN115690105B (en) 2023-03-21

Similar Documents

Publication Publication Date Title
CN115690105B (en) Milling cutter scratch detection method based on computer vision
CN114820773B (en) Silo transport vehicle carriage position detection method based on computer vision
CN113963042B (en) Metal part defect degree evaluation method based on image processing
CN116664559B (en) Machine vision-based memory bank damage rapid detection method
CN115861291B (en) Chip circuit board production defect detection method based on machine vision
CN114494210A (en) Plastic film production defect detection method and system based on image processing
CN109540925B (en) Complex ceramic tile surface defect detection method based on difference method and local variance measurement operator
CN112907519A (en) Metal curved surface defect analysis system and method based on deep learning
CN114998198A (en) Injection molding surface defect identification method
CN115578374A (en) Mechanical part casting quality evaluation method and system
CN116228768B (en) Method for detecting scratches on surface of electronic component
CN116740072B (en) Road surface defect detection method and system based on machine vision
CN115359053A (en) Intelligent detection method and system for defects of metal plate
CN114881915A (en) Symmetry-based mobile phone glass cover plate window area defect detection method
CN111415339B (en) Image defect detection method for complex texture industrial product
CN115096206B (en) High-precision part size measurement method based on machine vision
CN111354047B (en) Computer vision-based camera module positioning method and system
CN116385450A (en) PS sheet wear resistance detection method based on image processing
CN116152115B (en) Garbage image denoising processing method based on computer vision
CN115274486B (en) Semiconductor surface defect identification method
CN110186929A (en) A kind of real-time product defect localization method
CN116385440B (en) Visual detection method for arc-shaped blade
KR101151739B1 (en) System for color clustering based on tensor voting and method therefor
CN109934817A (en) The external contouring deformity detection method of one seed pod
CN109949245B (en) Cross laser detection positioning method and device, storage medium and computer equipment

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