CN110009618B - Shaft part surface quality detection method and device - Google Patents

Shaft part surface quality detection method and device Download PDF

Info

Publication number
CN110009618B
CN110009618B CN201910261832.1A CN201910261832A CN110009618B CN 110009618 B CN110009618 B CN 110009618B CN 201910261832 A CN201910261832 A CN 201910261832A CN 110009618 B CN110009618 B CN 110009618B
Authority
CN
China
Prior art keywords
image
connected domain
defect
shaft part
value
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910261832.1A
Other languages
Chinese (zh)
Other versions
CN110009618A (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.)
Zhejiang University ZJU
Original Assignee
Zhejiang University ZJU
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 Zhejiang University ZJU filed Critical Zhejiang University ZJU
Priority to CN201910261832.1A priority Critical patent/CN110009618B/en
Publication of CN110009618A publication Critical patent/CN110009618A/en
Application granted granted Critical
Publication of CN110009618B publication Critical patent/CN110009618B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G01MEASURING; TESTING
    • G01NINVESTIGATING OR ANALYSING MATERIALS BY DETERMINING THEIR CHEMICAL OR PHYSICAL PROPERTIES
    • G01N21/00Investigating or analysing materials by the use of optical means, i.e. using sub-millimetre waves, infrared, visible or ultraviolet light
    • G01N21/84Systems specially adapted for particular applications
    • G01N21/88Investigating the presence of flaws or contamination
    • G01N21/8851Scan or image signal processing specially adapted therefor, e.g. for scan signal adjustment, for detecting different kinds of defects, for compensating for structures, markings, edges
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01NINVESTIGATING OR ANALYSING MATERIALS BY DETERMINING THEIR CHEMICAL OR PHYSICAL PROPERTIES
    • G01N21/00Investigating or analysing materials by the use of optical means, i.e. using sub-millimetre waves, infrared, visible or ultraviolet light
    • G01N21/84Systems specially adapted for particular applications
    • G01N21/88Investigating the presence of flaws or contamination
    • G01N21/95Investigating the presence of flaws or contamination characterised by the material or shape of the object to be examined
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • G06T7/0004Industrial image inspection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/11Region-based segmentation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/136Segmentation; Edge detection involving thresholding
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/194Segmentation; Edge detection involving foreground-background segmentation
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01NINVESTIGATING OR ANALYSING MATERIALS BY DETERMINING THEIR CHEMICAL OR PHYSICAL PROPERTIES
    • G01N21/00Investigating or analysing materials by the use of optical means, i.e. using sub-millimetre waves, infrared, visible or ultraviolet light
    • G01N21/84Systems specially adapted for particular applications
    • G01N21/88Investigating the presence of flaws or contamination
    • G01N21/8851Scan or image signal processing specially adapted therefor, e.g. for scan signal adjustment, for detecting different kinds of defects, for compensating for structures, markings, edges
    • G01N2021/8887Scan or image signal processing specially adapted therefor, e.g. for scan signal adjustment, for detecting different kinds of defects, for compensating for structures, markings, edges based on image processing techniques
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20081Training; Learning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30108Industrial image inspection
    • G06T2207/30164Workpiece; Machine component

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Pathology (AREA)
  • Chemical & Material Sciences (AREA)
  • Immunology (AREA)
  • General Health & Medical Sciences (AREA)
  • Biochemistry (AREA)
  • Analytical Chemistry (AREA)
  • Data Mining & Analysis (AREA)
  • Health & Medical Sciences (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Evolutionary Biology (AREA)
  • General Engineering & Computer Science (AREA)
  • Artificial Intelligence (AREA)
  • Evolutionary Computation (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Signal Processing (AREA)
  • Quality & Reliability (AREA)
  • Investigating Materials By The Use Of Optical Means Adapted For Particular Applications (AREA)
  • Image Processing (AREA)
  • Image Analysis (AREA)

Abstract

The invention discloses a method and a device for detecting the surface quality of shaft parts. Shooting the surface of the shaft part by an industrial high-speed line scanning camera, preprocessing an obtained industrial high-speed line scanning image of the shaft part, completing image segmentation by using an improved threshold value iterative algorithm, and extracting a defect image by removing background, noise points and interference; and then, by combining the area, the area ratio and the thickness of each connected domain of the segmented image and the depth information of the three-dimensional reconstruction of the image, extracting the defect characteristics, and training a classifier to identify the defect type. The method can detect the surface quality of the shaft parts, can automatically identify the surface defect types of the shaft parts, and has high defect identification rate and good robustness to water stain and other pseudo defects.

Description

Shaft part surface quality detection method and device
Technical Field
The invention belongs to the technical field of automatic detection, and particularly relates to a method and a device for detecting the surface quality of a shaft part.
Background
The metal shaft parts are basic parts of various devices and mainly play a role in transmitting torque and bearing load. The quality of the product directly affects the normal operation and safe production of the equipment. Traditional fluorescent magnetic particle testing relies on workman manual operation to accomplish, and not only workman intensity of labour is big, and inspection efficiency is low moreover, inevitable exist the condition that the mistake was picked up, is examined neglectly.
In recent years, with the development of machine vision and electro-optical technology, theoretical research for detecting surface defects by directly using images has been actively developed. Image-based defect detection techniques have attracted a great deal of attention in both academia and industry. Saridis, etc. scans an image for an industrial steel sheet in a fixed pattern, and determines whether or not there is a defect in the image after a front-back difference operation. Sayed et al propose a new textile industry fabric defect detection algorithm that has good performance in fabric defect detection by using entropy filtering and minimum error threshold segmentation. Li and the like improve the existing defect detection algorithm aiming at the cigarette label, and provide that the minimum external rectangle is applied to defect shape analysis, thereby obtaining better practicability and higher detection precision. Zhang et al propose a tire defect detection method based on wavelet multi-scale analysis for the detection of tire defects in multi-texture images, and detect edges by using a defect edge measurement model to distinguish defects from background textures. The wheel hub defect detection method based on defect characteristics and seed filling is provided, small defect pixel blocks are obtained through peak positioning, and a defect image is quickly obtained through a seed filling algorithm. Wangxiangyin and the like provide a surface defect detection algorithm based on multivariate image analysis, the influence of uneven illumination is small, and the accuracy and the robustness of an image detection system are improved. Plum blossom and the like provide a novel method for detecting the surface defects of the wood board by utilizing an image fusion technology aiming at the problem that the surface knot defects of the wood board are difficult to identify after being dyed by dye, and verify that the fusion effect based on the Laplacian pyramid algorithm is the best. In the field of defect detection of shaft parts, Lu and the like provide a method for rapidly detecting shaft surface defects, and the method comprises the steps of median filtering, OTSU threshold segmentation, mathematical morphology inspection of defect targets, extraction of contour features and classification of defects by using an SVM (support vector machine). A defect segmentation algorithm and a defect area marking algorithm are designed in Sunxueng and the like, and typical defects of surface trauma, sand holes, poor grinding and the like of the camshaft are judged.
In summary, the defect detection technology based on the image is particularly applied to the surface detection of the shaft workpiece in the starting stage, and the existing detection method has the problems of high image feature misjudgment rate, low detection efficiency and the like.
Disclosure of Invention
The invention provides a method and a device for detecting the surface quality of shaft parts, aiming at improving the accuracy and robustness of the defect detection of the shaft parts.
The invention adopts the following technical scheme:
a shaft part surface quality detection method comprises the following steps:
step 1) shooting the surface of the shaft part by adopting an industrial high-speed line scanning camera to obtain an industrial high-speed line scanning image of the shaft part, wherein the shaft part is provided with a hole and a key, and the axial direction of the shaft part in the image is along the horizontal direction of the image;
in specific implementation, the industrial high-speed line scanning camera scans the shaft parts by the high-speed lines parallel to the axial direction, and the shaft parts are spliced to form a complete image after scanning.
Step 2) shaft part industrial high-speed line scanning image threshold segmentation:
segmenting pixels of the obtained shaft part image according to gray levels by adopting an improved high-sensitivity image threshold iterative segmentation method, dividing the pixels into a foreground and a background, and performing binarization;
step 3), extracting a defect image of the shaft part:
firstly, removing the background of a segmented image;
then, obtaining an image connected domain through a binary image connected domain algorithm, judging the image connected domain satisfying the following formula L < τ n W < τ as noise, and removing the noise, wherein τ is a noise judgment threshold value, and L, W is the length and width of the minimum circumscribed rectangle of the image connected domain;
finally, removing interference parts of shaft part holes and keys on the image; if the defect image does not exist on the surface, the axis is a qualified product, and the defect image types of the unqualified product are classified.
Step 4), classifying surface defects of the shaft parts: and comprehensively utilizing the two-dimensional information of the defect image and the three-dimensional information obtained by three-dimensional reconstruction of the gray map to extract four characteristics for classifying the surface defects of the shaft parts.
In the step 2), the improved high-sensitivity image threshold value iterative segmentation method comprises the following steps:
2.1) setting the gray value of the image as g (x, y), and setting x and y as the horizontal and vertical coordinates of the pixel points of the image to find out the maximum and minimum gray value L of the pixelmaxAnd LminTaking the median value T1As an initial segmentation value of the image,
Figure BDA0002015540090000021
wherein i is initially 0;
2.2) Using the partitioning value T of the ith iterationiSegmenting an image into g (x, y)<TiAnd g (x, y)>TiRespectively calculating the respective pixel number N of the two areas1And N2And the respective average gray-scale value AoAnd Ab
Figure BDA0002015540090000022
2.3) recalculating the new segmentation value Ti+1=αAo+βAbAlpha and beta are first and second weight coefficients, alpha is not equal to beta;
if Ti-Ti+1|<Epsilon then the iteration stops, epsilon represents the iteration stop threshold, Ti+1 is the final threshold, otherwise Ti=Ti+1And returning to the step 2.1);
in specific implementation, the first and second weight coefficients α and β are used to adjust the weights of the foreground and the background in the partitioned threshold. The value of β is larger when more sensitive to the foreground and larger when more sensitive to the background.
2.4) repeating the steps for continuous iteration processing to stop iteration to obtain the final segmentation value TiThe image is divided into two areas of a foreground and a background, the foreground is set to be 0, the background is set to be 1, and binarization processing is carried out.
The step 3) of removing the background of the segmented image specifically comprises the following steps:
and 2) drawing a binary image vertical coordinate accumulated graph which is formed by drawing the vertical coordinate accumulated value of each column to form a curve according to the segmented result of the step 2), specifically adding the pixel values of all pixels of the same column of the image after binarization to form the vertical coordinate accumulated value of the column, wherein each column has one vertical coordinate accumulated value, and all the vertical coordinate accumulated value drawing curves form the binary image vertical coordinate accumulated graph. The accumulated value of the background portion after accumulation is significantly higher than the accumulated value of the holes, keys and defect sites, and there is a distinct limit where the curve changes abruptly. Two vertical boundary lines at the abrupt change position on the curve are taken as boundary lines, and the abscissa of the two boundary lines from left to right in the image is recorded as tlAnd t2For the image abscissa at t1+ Δ t and t2The part between-delta t is reserved, delta t is a safety margin value, and the rest part is used as background to be cut off.
Step 3), removing interference parts of holes and keys of the shaft parts on the image, specifically:
3.1) marking the image without the noise as an original image img, copying the original image img to obtain a reference image img _ m, performing closing operation on the reference image img _ m to remove internal spots, then performing opening operation to remove defects, and finally performing expansion processing on the reference image img _ m;
3.2) calculating the length L and the width W of the minimum circumscribed rectangle for each connected domain in the reference image img _ m obtained by the processing of the step 3.1); using an image connected domain satisfying a condition of | Ls _ k-L | < lambda · Ls _ k | < lambda · Ws _ k-W | < lambda · Ws _ k as a hole connected domain, and using an image connected domain satisfying a condition of | Ls _ j-L | < lambda · Ls _ j | < lambda · Ws _ j-W | < lambda · Ws _ j as a key connected domain, wherein Ls _ k and Ws _ k respectively represent the length and width of a circumscribed rectangle of the hole connected domain of a qualified axis in the image, Ls _ j and Ws _ j respectively represent the length and width of a circumscribed rectangle of the hole connected domain of the qualified key in the image, and λ represents shape determination acceptance;
according to the fact that the difference of vertical coordinates of the center positions of holes and key connected domains on the same row of the image is used as a period delta y in the vertical interference direction, the upper portion and the lower portion of a reference image img _ m are expanded to form pixel rows with the height delta y and 0 filling, the left side and the right side of the reference image img _ m are not expanded, the uppermost complete interference and the lowermost complete interference in the reference image img _ m are respectively moved upwards and downwards by a distance delta y, the uppermost complete interference refers to a plurality of connected domains with the largest vertical coordinate, and the lowermost complete interference refers to a plurality of connected domains with the smallest vertical coordinate; and finally, subtracting all connected domain parts in the reference image img _ m from the original image img to obtain a defect image.
The step 4) is specifically as follows:
combining the surface defect characteristics of the shaft parts, obtaining a defect connected domain by a binary image connected domain solving algorithm aiming at the shaft part image with the defects extracted, and constructing the following three two-dimensional characteristics: the area S of the connected region, the area ratio S/(LW) of the area of the connected region and the minimum circumscribed rectangle, and the thickness W/L, W, L are the short side and the long side of the minimum circumscribed rectangle;
because the two-dimensional characteristics of the image can not accurately identify the water stain pseudo-defect, the depth Z (x, y) of each pixel point in the defect connected domain is obtained by finding out the original gray level image corresponding to the defect connected domain in the binary image through a three-dimensional reconstruction algorithm, wherein x and y are horizontal and vertical coordinates of the image in the defect connected domain, the depth is utilized to judge the water stain and other pseudo-defects, and the depth reflection characteristics of the defect connected domain are obtained by adopting the following formula according to the characteristics of the water stain three-dimensional reconstruction image:
Figure BDA0002015540090000041
in the formula, gamma is a step function, T is a depth threshold, r is the slenderness of the minimum external rectangle of the connected domain, namely the ratio of the long side to the short side, S is the area of the connected domain, and D represents the depth reflection characteristic;
inputting all connected domain areas S corresponding to shaft parts with qualified known surface quality, the area ratio S/(LW) of the connected domain areas to the minimum external rectangle, the thickness W/L and the depth reflection characteristic D into a classifier for training, and performing defect classification detection on the shaft parts to be detected for surface quality by using the trained classifier.
II, a shaft part surface quality detection device:
the device comprises an imaging module, a driving module, a control module, a calculation module and a display module;
the imaging module is used for acquiring a high-quality surface image of the shaft part and comprises a light source and a camera, wherein the light source and the camera are arranged on one side of the shaft part;
the driving module is used for driving the shaft part to be detected to rotate around the central axis of the driving module and is responsible for loading and unloading the shaft part;
the control module is used for controlling the driving module and the imaging module, and splicing the images of the shaft parts acquired and shot by the camera to obtain a high-fidelity image;
the calculation module is used for carrying out threshold segmentation, defect image extraction and surface defect classification on the high-fidelity image;
and the display module is used for receiving and displaying the result of the calculation module and displaying the surface quality detection result of the shaft parts.
The light source is a linear light source.
The camera is an industrial line scanning CCD camera.
The invention has the beneficial effects that:
1. according to the method, threshold segmentation is completed by improving a threshold iteration method, a high-sensitivity image is obtained, and defects are extracted to the greatest extent. And finishing image segmentation by eliminating background, noise points and interference, and extracting a defect image.
2. The invention extracts two-dimensional characteristics of a defect image: the defect type identification method has the advantages that the defect classification is carried out by combining the area, the area ratio and the thickness with the depth reflection characteristics obtained by three-dimensional reconstruction, so that the defect type identification has strong robustness.
3. Compared with the traditional manual method, the method has the advantages of high automation degree, stable working state and high detection speed, and can realize non-contact detection.
Drawings
To further illustrate the description of the present invention, the following detailed description of the embodiments of the present invention is provided with reference to the accompanying drawings. It is appreciated that these drawings are merely exemplary and are not to be considered limiting of the scope of the invention.
FIG. 1 is an overall flow chart of the method of the present invention.
Fig. 2 is a schematic diagram of the detection device of the present invention.
FIG. 3 is a schematic diagram of an image obtained by the detecting device of the present invention.
FIG. 4 is a diagram illustrating threshold segmentation and inversion according to the present invention.
FIG. 5 is a graph of the accumulated value of the ordinate of the binary image according to the present invention.
FIG. 6 is a schematic diagram of the present invention with background removed.
FIG. 7 is a schematic diagram of the defect extraction process of the present invention.
Fig. 8 is a schematic diagram of a pit defect and a three-dimensional reconstruction diagram.
Fig. 8(a) is a gray scale diagram of pit defects.
Fig. 8(b) is a three-dimensional reconstruction map of pits.
FIG. 9 is a schematic view of a crack defect and a three-dimensional reconstruction map.
Fig. 9(a) is a grayscale chart of a crack defect.
Fig. 9(b) is a three-dimensional reconstruction diagram of a crack.
FIG. 10 is a schematic diagram of a pockmark defect and a three-dimensional reconstruction diagram.
FIG. 10(a) is a gray scale diagram of pockmark defects.
Fig. 10(b) is a three-dimensional reconstruction diagram of a pockmark.
FIG. 11 is a schematic diagram of water stain and three-dimensional reconstruction of a pseudo defect.
FIG. 11(a) is a gray scale diagram of water stain with false defect.
Fig. 11(b) is a three-dimensional reconstruction diagram of water stains.
Fig. 12 is a schematic view of a minimum circumscribed rectangle.
Fig. 13 is a graph showing the detection result of the defective axis.
Fig. 14 is a graph showing the result of detection of a normal axis.
Detailed Description
The embodiments of the present invention are described below with reference to specific embodiments, and other advantages and effects of the present invention will be readily apparent to those skilled in the art from the disclosure of the present specification. The invention is capable of other and different embodiments and of being practiced or of being carried out in various ways, and its several details are capable of modification in various respects, all without departing from the spirit and scope of the present invention.
As shown in fig. 1, an embodiment of the present invention includes the steps of:
as shown in fig. 2, the embodied apparatus includes an imaging module for acquiring a high-quality surface image of the shaft-like part, using a suitable light source, and a camera, the light source being placed on one side of the shaft-like part and the camera being placed on the other side. And the driving module is used for driving the shaft part to be detected to rotate by a specified angle so as to rotate along the axis, and is responsible for loading and unloading the shaft part. And the control module is used for controlling the driving module and the imaging module to splice the images acquired by the camera to acquire a high-fidelity image. An experimental platform of the detection device is set up, and the obtained image is shown in fig. 3.
The implementation process is mainly divided into three frame steps: threshold segmentation, defect image extraction and defect classification.
Step 1, taking pictures of the surfaces of the shaft parts by an industrial high-speed line scanning camera CA-HL02MX and the matching parts thereof to obtain industrial high-speed line scanning images of the shaft parts.
Step 2, threshold segmentation
2.1) setting the gray value of the image as g (x, y), and setting x and y as the horizontal and vertical coordinates of the pixel points of the image to find out the maximum and minimum gray value L of the pixelmaxAnd LminTaking the median value T1As an initial segmentation value of the image,
Figure BDA0002015540090000061
wherein i is initially 0;
2.2) Using the partitioning value T of the ith iterationiSegmenting an image into g (x, y)<TiAnd g (x, y)>TiRespectively calculating the respective pixel number N of the two areas1And N2And the respective average gray-scale value AoAnd Ab
Figure BDA0002015540090000062
2.3) recalculating the new segmentation value Ti+1=αAo+βAbAlpha and beta are first and second weight coefficients, alpha is not equal to beta;
if Ti-Ti+1|<Epsilon then the iteration stops, epsilon represents the iteration stop threshold, Ti+1 is the final threshold, otherwise Ti=Ti+1And returning to the step 2.1);
2.4) repeating the steps for continuous iteration processing to stop iteration to obtain the final segmentation value TiThe image is divided into two areas of a foreground and a background, the foreground is set to be 0, the background is set to be 1, and binarization processing is carried out.
In this example, β is specifically 0.995 and α is 0.005. The iteration stop threshold is taken to be 0.001.
Step 3, extracting a defect image
3.1) inverting the divided binary image, as shown in FIG. 4.
The white strips on the two sides are clamping parts at the two ends of the acquisition system and are backgrounds to be removed. The two-value graph ordinate accumulation is shown in fig. 5, where the background portion accumulation is significantly higher than the hole, key and defect site accumulation and there is a distinct boundary where the curve changes steeply. Two vertical boundary lines at the abrupt change position on the curve are taken as boundary lines, and the abscissa of the two boundary lines from left to right in the image is recorded as tlAnd t2For the image abscissa at t1+ Δ t and t2The part between-delta t is reserved, delta t is a safety margin value, and the rest part is used as background to be cut off. In this example, Δ t is 20, and the background is removed to obtain fig. 6.
3.2) through a binary image connected domain algorithm, a defect region with low gray value and small area is taken as a noise point, an image connected domain meeting the following formula L < τ n and W < τ is judged as the noise point, and the noise point is removed, wherein τ is a noise point judgment threshold value, and L, W is the length and width of the minimum circumscribed rectangle of the image connected domain; in this example, τ is 15.
3.3) surface regular interference rejection is next performed:
3.3.1) recording the image without the noise as an original image img, copying the original image img to obtain a reference image img _ m, carrying out closed operation on the reference image img _ m to remove internal spots, and selecting disk structural elements in the closed operation, wherein the size of the disk structural elements is 8. And then, opening operation is carried out to remove defects, and disk structure elements with the size of 30 are selected. Finally, performing expansion processing on the reference image img _ m, and selecting disk structural elements with the size of 5;
3.3.2) calculating the length L and the width W of the minimum circumscribed rectangle for each connected domain in the reference image img _ m obtained by the processing of the step 3.1); using an image connected domain satisfying a condition of | Ls _ k-L | < lambda · Ls _ k | < lambda · Ws _ k-W | < lambda · Ws _ k as a hole connected domain, and using an image connected domain satisfying a condition of | Ls _ j-L | < lambda · Ls _ j | < lambda · Ws _ j-W | < lambda · Ws _ j as a key connected domain, wherein Ls _ k and Ws _ k respectively represent the length and width of a circumscribed rectangle of the hole connected domain of a qualified axis in the image, Ls _ j and Ws _ j respectively represent the length and width of a circumscribed rectangle of the hole connected domain of the qualified key in the image, and λ represents shape determination acceptance; in this example Ls _ k is 118, Ws _ k is 118, Ls _ j is 674, Ws _ j is 214, and λ is 0.2.
According to the difference of vertical coordinates of the central positions of holes and key connected domains on the same row of the image, the difference is used as a period delta y in the vertical interference direction, wherein the period delta y is 833, the upper part and the lower part of a reference image img _ m are expanded to form a pixel row with the height delta y and the filling value of 0, the left side and the right side of the reference image img _ m are not expanded, the uppermost complete interference and the lowermost complete interference in the reference image img _ m are respectively moved upwards and downwards by a distance delta y, the uppermost complete interference refers to a plurality of connected domains with the largest vertical coordinate, and the lowermost complete interference refers to a plurality of connected domains with the smallest vertical coordinate; and finally, subtracting all connected domain parts in the reference image img _ m from the original image img to obtain a defect image. As shown in fig. 7. If the defect image does not exist on the surface, the axis is a qualified product, and the defect image types of the unqualified product are classified.
Step 4, classifying the defect image
The common defect types and three-dimensional reconstruction images thereof are shown in a pit image 8, a crack image 9, a pock mark image 10 and a false defect water stain image 11, wherein (a) is a defect image and (b) is a reconstruction result.
Defect features need to be extracted to achieve correct classification of defects. Combining the surface defect characteristics of the shaft parts, obtaining a defect connected domain by a binary image connected domain solving algorithm aiming at the shaft part image with the defects extracted, and further constructing the following two-dimensional characteristics: area of connected region: s, the area ratio (area ratio) of the connected domain to the minimum external rectangle is as follows: S/(LW), coarse and short: W/L. W, L are the short and long sides of the smallest circumscribed rectangle.
And finding out the original gray level image corresponding to each defect connected domain in the binary image, wherein the minimum circumscribed rectangle is shown in FIG. 12, and the minimum circumscribed rectangle is a short side W and a long side L. And obtaining the depth Z (x, y) of each pixel point in the defect connected domain through a three-dimensional reconstruction algorithm. Wherein x and y are horizontal and vertical coordinates of the image in the defect connected domain. Specifically, reconstitution can be performed Using the method described in the literature (Tsai P S, Shah M. shape From shaping Using Linear Approximation [ J ]. Image Vision Comp,1995,12(8): 487-. According to the characteristics of the water stain three-dimensional reconstruction image, the following depth reflection characteristics of the defect connected domain are provided:
Figure BDA0002015540090000081
in the formula, γ is a step function, T is a depth threshold, 2 is taken in this example, r is the minimum circumscribed rectangle slenderness of the connected domain, i.e. the ratio of the long side to the short side, S is the area of the connected domain, and D represents the depth reflection characteristic.
Inputting the area S of each connected domain of the defect image, the area ratio S/(LW) of the area of each connected domain and the minimum circumscribed rectangle of the connected domain, the thickness W/L and the depth reflection characteristic D into a logistic regression classifier for training, and carrying out defect classification detection on the shaft part to be detected with surface quality by using the trained logistic regression classifier.
In order to verify the accuracy of the method, 1000 shaft parts are taken to produce images, and a shaft with the problems of pits, cracks and pockmarks is defined as a defective product. Fig. 13 and 14 show the classification results of the shaft members for the defective products and the non-defective products. The weighted recognition rate is:
Figure BDA0002015540090000082
wherein P is precision ratio and R is recall ratio.
Figure BDA0002015540090000083
In the formula, TP represents the number of non-defective products identified as non-defective products, FN represents the number of non-defective products identified as defective products, FP represents the number of non-defective products identified as non-defective products, and TN represents the number of non-defective products identified as defective products.
As shown in table 1, the qualified shaft parts were identified as 955 qualified products, the qualified products were identified as 22 rejected products, the rejected products were identified as 1 qualified product, the rejected products were identified as 21 rejected products, and the weighted identification rate F was calculated as1The detection time is 98.86%, the average time consumption is 3.69 seconds, the detection time is reduced by 63.1% compared with the average detection time of 10 seconds, and the detection efficiency of the shaft parts is greatly improved.
TABLE 1 Defect axis identification results
Figure BDA0002015540090000091
And (4) defect classification, namely, taking 100 images to form a training set to train a regression classifier. And testing the trained network by using 20 images to form a test set. As shown in table 2. The accuracy of the training set is 82%, and the accuracy of the testing set is 75%.
TABLE 2 classifier experimental results
Figure BDA0002015540090000092
Therefore, the method can detect the surface quality of the shaft parts, can automatically identify the surface defect types of the shaft parts, has high defect identification rate, and has good robustness to water stain and other pseudo defects.
The foregoing embodiments are merely illustrative of the principles and effects of the present invention, and are not to be construed as limiting the invention. Any person skilled in the art can modify or change the above-mentioned embodiments without departing from the spirit and scope of the present invention. Accordingly, it is intended that all equivalent modifications or variations be covered by the claims without departing from the spirit and technical spirit of the present invention.

Claims (3)

1. The surface quality detection method of the shaft part is characterized by comprising the following steps:
step 1) shooting the surface of the shaft part by adopting an industrial high-speed line scanning camera to obtain an industrial high-speed line scanning image of the shaft part, wherein the shaft part is provided with a hole and a key, and the axial direction of the shaft part in the image is along the horizontal direction of the image;
step 2) shaft part industrial high-speed line scanning image threshold segmentation: the method comprises the following steps of segmenting pixels of an obtained shaft part image by adopting an improved high-sensitivity image threshold iterative segmentation method, dividing the pixels into a foreground and a background, and carrying out binarization, wherein the method specifically comprises the following steps:
2.1) setting the gray value of the image as g (x, y), and setting x and y as the horizontal and vertical coordinates of the pixel points of the image to find out the maximum and minimum gray value L of the pixelmaxAnd LminTaking the median value T1As an initial segmentation value of the image,
Figure FDA0002851551900000011
2.2) Using the partitioning value T of the ith iterationiSegmenting an image into g (x, y)<TiAnd g (x, y)>TiRespectively calculating the respective pixel number N of the two areas1And N2And the respective average gray-scale value AoAnd Ab
Figure FDA0002851551900000012
2.3) recalculating the new segmentation value Ti+1=αAo+βAbAlpha and beta are first and second weight coefficients, alpha is not equal to beta;
if Ti-Ti+1|<e then the iteration stops, ε represents the iteration stop threshold, Ti+1Is the final threshold, otherwise Ti=Ti+1And returning to the step 2.2);
2.4) repeating the steps for continuous iteration processing to stop iteration to obtain the final segmentation value TiDividing the image into two areas of a foreground and a background, setting the foreground as 0 and the background as 1, and carrying out binarization processing;
step 3), extracting a defect image of the shaft part:
firstly, removing the background of a segmented image;
then, obtaining an image connected domain through a binary image connected domain algorithm, judging the image connected domain satisfying the following formula L < τ n W < τ as noise, and removing the noise, wherein τ is a noise judgment threshold value, and L, W is the length and width of the minimum circumscribed rectangle of the image connected domain;
finally, removing interference parts of shaft part holes and keys on the image;
step 4), classifying surface defects of the shaft parts: the method comprehensively utilizes the two-dimensional information of the defect image and the three-dimensional information obtained by three-dimensional reconstruction of the gray map to extract four characteristics for classifying the surface defects of the shaft parts, and specifically comprises the following steps:
obtaining a defect connected domain by a binary image connected domain solving algorithm aiming at the shaft part image with the defects extracted, and constructing the following three two-dimensional characteristics: the area S of the connected region, the area ratio S/(LW) of the area of the connected region and the minimum circumscribed rectangle, and the thickness W/L, W, L are the short side and the long side of the minimum circumscribed rectangle;
the depth Z (x, y) of each pixel point in the defect connected domain is obtained through a three-dimensional reconstruction algorithm by finding out an original gray image corresponding to the defect connected domain in the binary image, wherein x and y are horizontal and vertical coordinates of the image in the defect connected domain, and the depth reflection characteristic of the defect connected domain is obtained by adopting the following formula:
Figure FDA0002851551900000021
in the formula, gamma is a step function, T is a depth threshold, r is the slenderness of the minimum external rectangle of the connected domain, namely the ratio of the long side to the short side, S is the area of the connected domain, and D represents the depth reflection characteristic;
inputting all connected domain areas S corresponding to shaft parts with qualified known surface quality, the area ratio S/(LW) of the connected domain areas to the minimum external rectangle, the thickness W/L and the depth reflection characteristic D into a classifier for training, and performing defect classification detection on the shaft parts to be detected for surface quality by using the trained classifier.
2. The shaft part surface quality detection method according to claim 1, characterized in that:
the step 3) of removing the background of the segmented image specifically comprises the following steps: drawing a binary image vertical coordinate accumulated graph which is formed by drawing the vertical coordinate accumulated value of each column to form a curve according to the result after the segmentation in the step 2), taking two vertical boundary lines at the abrupt change positions on the curve as boundary lines, and recording the horizontal coordinates of the two boundary lines from left to right in the image as tlAnd t2For the image abscissa at t1+ Δ t and t2The part between-delta t is reserved, delta t is a safety margin value, and the rest part is used as background to be cut off.
3. The shaft part surface quality detection method according to claim 1, characterized in that:
step 3), removing interference parts of holes and keys of the shaft parts on the image, specifically:
3.1) marking the image without the noise as an original image img, copying the original image img to obtain a reference image img _ m, performing closing operation on the reference image img _ m to remove internal spots, then performing opening operation to remove defects, and finally performing expansion processing on the reference image img _ m;
3.2) calculating the length L and the width W of the minimum circumscribed rectangle for each connected domain in the reference image img _ m obtained by the processing of the step 3.1); using an image connected domain satisfying a condition of | Ls _ k-L | < lambda · Ls _ k | < lambda · Ws _ k-W | < lambda · Ws _ k as a hole connected domain, and using an image connected domain satisfying a condition of | Ls _ j-L | < lambda · Ls _ j | < lambda · Ws _ j-W | < lambda · Ws _ j as a key connected domain, wherein Ls _ k and Ws _ k respectively represent the length and width of a circumscribed rectangle of the hole connected domain of a qualified axis in the image, Ls _ j and Ws _ j respectively represent the length and width of a circumscribed rectangle of the hole connected domain of the qualified key in the image, and λ represents shape determination acceptance;
according to the fact that the difference of vertical coordinates of the center positions of holes and key connected domains on the same row of the image is used as a period delta y in the interference vertical direction, the upper portion and the lower portion of a reference image img _ m are expanded to form pixel rows with the height delta y and the filling amount of 0, the uppermost complete interference and the lowermost complete interference in the reference image img _ m are respectively moved upwards and downwards by a distance delta y, the uppermost complete interference refers to a plurality of connected domains with the largest vertical coordinates, and the lowermost complete interference refers to a plurality of connected domains with the smallest vertical coordinates; and finally, subtracting the reference image img _ m from the original image img to obtain a defect image.
CN201910261832.1A 2019-04-02 2019-04-02 Shaft part surface quality detection method and device Active CN110009618B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910261832.1A CN110009618B (en) 2019-04-02 2019-04-02 Shaft part surface quality detection method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910261832.1A CN110009618B (en) 2019-04-02 2019-04-02 Shaft part surface quality detection method and device

Publications (2)

Publication Number Publication Date
CN110009618A CN110009618A (en) 2019-07-12
CN110009618B true CN110009618B (en) 2021-04-20

Family

ID=67169488

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910261832.1A Active CN110009618B (en) 2019-04-02 2019-04-02 Shaft part surface quality detection method and device

Country Status (1)

Country Link
CN (1) CN110009618B (en)

Families Citing this family (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110426180B (en) * 2019-08-05 2020-08-18 浙江大学 Three-dimensional scene drawing delay measurement system and method based on high-speed line scanning
CN110555839A (en) * 2019-09-06 2019-12-10 腾讯云计算(北京)有限责任公司 Defect detection and identification method and device, computer equipment and storage medium
CN110658213B (en) * 2019-09-30 2021-11-26 合肥公共安全技术研究院 Nondestructive testing device for detecting three-dimensional defects on surface of seamless steel pipe
CN111487192A (en) * 2020-04-26 2020-08-04 天津海融科技有限公司 Machine vision surface defect detection device and method based on artificial intelligence
CN111915581B (en) * 2020-07-27 2021-07-13 青岛大学 Method for detecting defects of smooth metal cambered surface
CN111882537B (en) * 2020-07-28 2023-12-15 研祥智能科技股份有限公司 Visual detection method and system
CN112122175B (en) * 2020-08-12 2021-08-10 浙江大学 Material enhanced feature recognition and selection method of color sorter
CN112308832B (en) * 2020-10-29 2022-07-22 常熟理工学院 Bearing quality detection method based on machine vision
CN112200805A (en) * 2020-11-11 2021-01-08 北京平恒智能科技有限公司 Industrial product image target extraction and defect judgment method
CN113096123B (en) * 2021-05-07 2022-08-16 湘潭大学 Multi-fuzzy reasoning cascaded primer side defect classification and damage degree analysis method
CN114419038A (en) * 2022-03-28 2022-04-29 深圳市信润富联数字科技有限公司 Method and device for identifying surface defects of hub, storage medium and electronic equipment
CN114998259A (en) * 2022-06-02 2022-09-02 苏州香农科技有限公司 Detection method and device for gravity casting hub

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN201331508Y (en) * 2009-01-14 2009-10-21 张颖 Automatic detection device for flaw detection of magnetic powder on metal shaft part surface
CN102680478A (en) * 2012-04-25 2012-09-19 华南农业大学 Detection method and device of surface defect of mechanical part based on machine vision
CN102854191A (en) * 2012-07-18 2013-01-02 湖南大学 Real-time visual detection and identification method for high speed rail surface defect
CN103729842A (en) * 2013-12-20 2014-04-16 中原工学院 Fabric defect detection method based on local statistical characteristics and overall significance analysis
CN104063873A (en) * 2014-07-08 2014-09-24 华东交通大学 Shaft sleeve part surface defect on-line detection method based on compressed sensing
CN105092598A (en) * 2015-09-28 2015-11-25 深圳大学 Method and system for rapidly recognizing defects of big-breadth PCB on basis of connected areas
CN107876425A (en) * 2017-11-10 2018-04-06 华东交通大学 A kind of bearing defect detecting system device of view-based access control model
CN107884413A (en) * 2017-10-24 2018-04-06 华东交通大学 A kind of device and detection method of automatic detection bearing roller missing
CN108714701A (en) * 2018-06-15 2018-10-30 广州大学 A kind of Machining of Shaft-type Parts device
CN108898585A (en) * 2018-06-15 2018-11-27 广州大学 A kind of axial workpiece detection method and its device
CN108921846A (en) * 2018-07-17 2018-11-30 北京航空航天大学 A kind of rail tread defect identification method combined based on gray level image and depth image

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8723115B2 (en) * 2012-03-27 2014-05-13 Kla-Tencor Corporation Method and apparatus for detecting buried defects
WO2018208791A1 (en) * 2017-05-08 2018-11-15 Aquifi, Inc. Systems and methods for inspection and defect detection using 3-d scanning
CN108021938A (en) * 2017-11-29 2018-05-11 中冶南方工程技术有限公司 A kind of Cold-strip Steel Surface defect online detection method and detecting system

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN201331508Y (en) * 2009-01-14 2009-10-21 张颖 Automatic detection device for flaw detection of magnetic powder on metal shaft part surface
CN102680478A (en) * 2012-04-25 2012-09-19 华南农业大学 Detection method and device of surface defect of mechanical part based on machine vision
CN102854191A (en) * 2012-07-18 2013-01-02 湖南大学 Real-time visual detection and identification method for high speed rail surface defect
CN103729842A (en) * 2013-12-20 2014-04-16 中原工学院 Fabric defect detection method based on local statistical characteristics and overall significance analysis
CN104063873A (en) * 2014-07-08 2014-09-24 华东交通大学 Shaft sleeve part surface defect on-line detection method based on compressed sensing
CN105092598A (en) * 2015-09-28 2015-11-25 深圳大学 Method and system for rapidly recognizing defects of big-breadth PCB on basis of connected areas
CN107884413A (en) * 2017-10-24 2018-04-06 华东交通大学 A kind of device and detection method of automatic detection bearing roller missing
CN107876425A (en) * 2017-11-10 2018-04-06 华东交通大学 A kind of bearing defect detecting system device of view-based access control model
CN108714701A (en) * 2018-06-15 2018-10-30 广州大学 A kind of Machining of Shaft-type Parts device
CN108898585A (en) * 2018-06-15 2018-11-27 广州大学 A kind of axial workpiece detection method and its device
CN108921846A (en) * 2018-07-17 2018-11-30 北京航空航天大学 A kind of rail tread defect identification method combined based on gray level image and depth image

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
Defects Detection Of Weld Image Based On Mathematical Morphology and Thresholding Segmentation;Tong Tong 等;《2012 8th International Conference on Wireless Communications,Networking and Mobile Computing》;20130314;第1-4页 *
基于缺陷特征与种子填充的轮毂缺陷检测方法;何再兴 等;《浙江大学学报(工学版)》;20090715;第43卷(第7期);第1230-1237页 *

Also Published As

Publication number Publication date
CN110009618A (en) 2019-07-12

Similar Documents

Publication Publication Date Title
CN110009618B (en) Shaft part surface quality detection method and device
CN109141232B (en) Online detection method for disc castings based on machine vision
CN110349126B (en) Convolutional neural network-based marked steel plate surface defect detection method
CN108629775B (en) Thermal state high-speed wire rod surface image processing method
CN115294113B (en) Quality detection method for wood veneer
Wang et al. Research on crack detection algorithm of the concrete bridge based on image processing
CN107437243B (en) Tire impurity detection method and device based on X-ray image
CN104458755A (en) Multi-type material surface defect detection method based on machine vision
CN108169236A (en) A kind of cracks of metal surface detection method of view-based access control model
CN110827235B (en) Steel plate surface defect detection method
CN109540925B (en) Complex ceramic tile surface defect detection method based on difference method and local variance measurement operator
CN116645367B (en) Steel plate cutting quality detection method for high-end manufacturing
CN109215009B (en) Continuous casting billet surface image defect detection method based on deep convolution neural network
CN115375686B (en) Glass edge flaw detection method based on image processing
CN115063423B (en) Self-adaptive identification method for cold and hot cracks of mechanical castings based on computer vision
CN113706490B (en) Wafer defect detection method
CN107240086B (en) A kind of fabric defects detection method based on integral nomography
CN103729856B (en) A kind of Fabric Defects Inspection detection method utilizing S-transformation signal extraction
CN104458764B (en) Curved uneven surface defect identification method based on large-field-depth stripped image projection
CN110781913B (en) Zipper cloth belt defect detection method
CN115690387A (en) Alloy surface detection system based on image recognition
CN108020554A (en) A kind of steel strip surface defect recognition detection method
CN110554052A (en) artificial board surface defect detection method and system
CN111445471A (en) Product surface defect detection method and device based on deep learning and machine vision
CN114049316A (en) Steel wire rope defect detection method based on metallic luster area

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