CN109141232B - Online detection method for disc castings based on machine vision - Google Patents

Online detection method for disc castings based on machine vision Download PDF

Info

Publication number
CN109141232B
CN109141232B CN201810890880.2A CN201810890880A CN109141232B CN 109141232 B CN109141232 B CN 109141232B CN 201810890880 A CN201810890880 A CN 201810890880A CN 109141232 B CN109141232 B CN 109141232B
Authority
CN
China
Prior art keywords
sample
image
point
circle
edge
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
CN201810890880.2A
Other languages
Chinese (zh)
Other versions
CN109141232A (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.)
CHANGZHOU HIDEA MACHINERY CO LTD
Jiangsu University
Original Assignee
CHANGZHOU HIDEA MACHINERY CO LTD
Jiangsu University
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 CHANGZHOU HIDEA MACHINERY CO LTD, Jiangsu University filed Critical CHANGZHOU HIDEA MACHINERY CO LTD
Priority to CN201810890880.2A priority Critical patent/CN109141232B/en
Publication of CN109141232A publication Critical patent/CN109141232A/en
Application granted granted Critical
Publication of CN109141232B publication Critical patent/CN109141232B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G01MEASURING; TESTING
    • G01BMEASURING LENGTH, THICKNESS OR SIMILAR LINEAR DIMENSIONS; MEASURING ANGLES; MEASURING AREAS; MEASURING IRREGULARITIES OF SURFACES OR CONTOURS
    • G01B11/00Measuring arrangements characterised by the use of optical techniques
    • 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
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/70Denoising; Smoothing
    • 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
    • G06T7/0008Industrial image inspection checking presence/absence
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/11Region-based segmentation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/13Edge detection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/155Segmentation; Edge detection involving morphological operators
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/60Analysis of geometric attributes
    • G06T7/62Analysis of geometric attributes of area, perimeter, diameter or volume
    • 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/20024Filtering details
    • G06T2207/20032Median filtering
    • 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/30116Casting

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Health & Medical Sciences (AREA)
  • Quality & Reliability (AREA)
  • Signal Processing (AREA)
  • Geometry (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Chemical & Material Sciences (AREA)
  • Analytical Chemistry (AREA)
  • Biochemistry (AREA)
  • General Health & Medical Sciences (AREA)
  • Immunology (AREA)
  • Pathology (AREA)
  • Image Analysis (AREA)

Abstract

The invention discloses an online detection method of a disc casting based on machine vision, which comprises the steps of acquiring an image of a disc casting sample, acquiring images of the front side and the back side of the disc casting sample, and preprocessing the images; detecting the size of the sample according to the collected sample image, preliminarily judging the defects, and carrying out the next detection; the notch is amplified through picture processing to extract coordinate characteristics, so that the notch of the sample is detected and marked; after the degree of the edge deviation from the reference is compared with a set threshold value, the burr defect of the sample is detected; finally, whether the sample is qualified or not is judged, the notch and the burr of the disc casting can be rapidly identified in real time, and the method is suitable for a high-speed online detection system.

Description

Online detection method for disc castings based on machine vision
Technical Field
The invention belongs to the field of machine vision, and particularly relates to a brake disc casting online detection method based on machine vision.
Background
In the production process of the casting, the defects of no flash, burr, defect and the like are difficult to avoid due to various reasons on the outer contour of the casting, and the defects seriously affect the surface quality and the physical and mechanical properties of the product; in terms of dimensional accuracy, the castings may suffer from insufficient casting, thin-wall deformation, and the like, resulting in disqualification of the overall dimensions and weight of the castings.
The quality detection link of the current casting factory mostly adopts on-line manual detection or off-line sampling detection. The manual online detection has strong dependence on the working capacity and the fatigue degree of workers, and the accuracy cannot be guaranteed. And the labor cost of manual detection occupies a considerable proportion in the casting cost, and great difficulty is brought to cost control of enterprises. Although offline sampling detection can obtain detection data with higher precision, the offline sampling detection has slow reaction, low efficiency and small sampling coverage, and is difficult to find faults in time and has less loss.
On-line detection of mechanical parts based on machine vision has non-contact property, safety objectivity and high efficiency, and becomes the mainstream direction of future industrial detection. However, the online visual inspection of small and medium-sized castings requires high precision and high speed, so that the inspection method still faces some technical problems:
(1) the system is influenced by multiple factors such as lens distortion, uneven lighting and surrounding environment, the signal-to-noise ratio of the detection system is not high, and edge micro defects are difficult to distinguish from noise and detect. How to accurately and completely extract the edge profile of the brake disc so as to adapt to the interference of external adverse environment is one of the problems to be solved.
(2) The brake disc casting is a mechanical part with circular characteristics, has defects of gaps, fash, flash, burrs and the like on the outer edge, and has certain influence on the circular fitting of the inner diameter and the outer diameter. The former method for detecting the circle mainly comprises a geometric center method, a least square method, circle Hough transformation and the like, wherein the geometric center method has a simple calculation process but requires that known points are uniformly distributed or used under the condition of low precision; the least square method is easily affected by missing parts and image noise on the boundary or curve of an actual object, and fitting has deviation; the traditional Hough circle detection has strong noise resistance and high precision, and the main defect is that the calculation and storage requirements of the algorithm are exponentially increased along with the increase of the dimension of the curve, so that the method is not suitable for a high-speed online detection system.
(3) The shape of the surface defect of the casting is complex, and the detection difficulty is high. How to rapidly identify two types of edge defects, namely a notch and a burr in real time under the condition of eliminating the interference of false defects (surface scratches, water marks, mark stains and the like) and quantifying the pixel size information of the defects.
Disclosure of Invention
The invention provides an online detection method of a disc casting based on machine vision according to the defects of the prior art, and aims to quickly detect the disc casting in real time and meet the precision requirement of the production technical standard.
A disc casting online detection method based on machine vision comprises the following steps:
step 1, collecting an image of a disc casting sample, and acquiring images of the front side and the back side of the disc casting sample;
step 2, detecting the size of the sample according to the collected sample image, preliminarily judging the defects, and carrying out the next detection;
step 3, detecting and marking the sample gap;
step 4, detecting burr defects of the sample;
and 5, finally finishing the judgment on whether the sample is qualified.
Further, the method for detecting the size of the sample specifically comprises the following steps:
step 2.1, preprocessing an image, carrying out median filtering on the sample image, eliminating image salt and pepper noise, and after retaining the outline, carrying out image segmentation by using a background difference method and an Ostu optimal threshold value method to obtain a binary image;
step 2.2, detecting the pixel level edge of the binary image by using a canny operator, obtaining a sub-pixel edge contour image through a gray moment method and pixel level edge fusion, and refining the edge positioning precision to the inside of the pixel from coarse to fine;
step 2.3, setting a roundness threshold TThreshold(s)If the roundness T is>TThreshold(s)Respectively adding the circular outlines into a linked list, and calling a least square method to perform circular fitting; if roundness T<TThreshold(s)Counting the votes of the coordinates and the radius of the circle center by adopting an improved Hough circle detection method, wherein the target point with the largest voting number is the target point, and respectively drawing a fitting circular curve;
further, the roundness T>TThreshold(s)And calling a least square method to perform circle fitting:
Figure BDA0001756926820000021
T<Tthreshold(s)For the obtained sub-pixel edgeSearch point, initial point P, clockwise of contour1The uppermost edge point has a step angle of 1 DEG, and the points are numbered P1,P2,...,Pn,...,P359
Selecting a distance P1The points are n points at intervals, and the points are connected in a line segment mode;
per Pn+1Dot line segment
Figure BDA0001756926820000022
Perpendicular to, in the point domain from point Pn+1Starting the search in the clockwise direction until finding the point P closest to the verticalmConnecting line segments
Figure BDA0001756926820000023
If n is selected such that
Figure BDA0001756926820000024
Just as a diameter, the corresponding point P cannot be foundmAt this time point PmAnd point Pn+1Overlapping;
from the properties of the circle, it can be seen that: the chord midpoint corresponding to the circumference angle of 90 degrees is the center of a circle, and the coordinate (x) of the center of the circleo,yo) Comprises the following steps:
Figure BDA0001756926820000025
wherein
Figure BDA0001756926820000026
Is P1The coordinates of the points are determined by the coordinates of the points,
Figure BDA0001756926820000027
is PmPoint coordinates, defining an allowable error limit:
Figure BDA0001756926820000031
setting two accumulators of x and y separately, storing the coordinates of the circle center separately and repeating the above stepsStep, completion point field (P)1,P2,...,Pn) The spatial transformation of the parameters of all the points,
counting the number of tickets, wherein coordinates (a and b) of the circle center are x, and y is the number with the largest occurrence frequency in the accumulated array;
calculating the distance from each point of the point domain to the center of the circle by taking the calculated center coordinates as the basis, and calculating the average value as the radius of the circle if the variance of all radius values is less than a threshold value tau; otherwise, determining the mode of the data set as a circle center radius value R, and detecting that the roundness of the part with the burrs exceeds a threshold value.
Step 2.4, the center coordinates of the inner diameter and the outer diameter are utilized to calculate the center distance to be used as coaxiality error estimation under orthographic projection, and when the coaxiality is less than 1mm, the sample is marked as a qualified product; otherwise, marking as a defective product;
further, the conditions for the preliminary defect detection determination are as follows: according to the obtained circle fitting curve as a reference model line, detecting edge points deviating from the reference model line for a certain distance in the sub-pixel edge contour image as bad points, if the distance is a negative value, continuing to detect and mark a sample notch, and if the distance is a positive value, jumping to detect the sample burr defect;
further, the method for detecting whether the image has the gap defect and marking the image comprises the following steps:
step 3.1, binarizing the sample image by using the OSTU optimal threshold value T to obtain a binary image;
step 3.2, opening operation is carried out to fill the cavities in the binary image, and interference of pseudo defects is eliminated;
step 3.3, obtaining a gap area through top hat transformation; step 3.4, performing expansion processing on the image by using a morphological serial segmentation mode, and amplifying the gap area;
and 3.5, marking a gap on the original sample image by utilizing the area and the central point coordinate characteristics of the region counted by the regionoprop operator of MATLAB, and judging whether the sample is qualified.
Further, the method for detecting the burr defect of the sample after comparing the degree of the edge deviation from the standard with the set threshold value comprises the following steps:
step 4.1, according to the comparison of the degree of the edge deviating from the reference line and a threshold value, if the degree of the edge deviating from the reference line is less than the threshold value, the edge is determined to be a qualified product, and if the degree of the edge deviating from the reference line is greater than the threshold value, the following steps are carried out;
step 4.2, establishing a mask g (x, y) according to the obtained reference circle, and performing logic and operation on the original image and the mask to obtain a burr area;
4.3, binarizing the burr area, tracking the edge of the binary connected area, acquiring the burr outline, identifying the burr outline by different colors, measuring the perimeter and the area of the burr by adopting a regionprops operator, and coloring the area of the burr;
4.4, determining whether the current sample needs to be finely processed or not according to the processed image;
the invention has the beneficial effects that:
(1) the testing environment established by the invention is uniform in lighting and not influenced by multiple factors such as the surrounding environment, the signal-to-noise ratio of the detection system is high, and the edge micro defects and the noise are easier to distinguish and detect. The edge profile of the disc-shaped casting can be accurately and completely extracted.
(2) The disc-shaped casting is a mechanical part with circular characteristics, and the outer edge of the disc-shaped casting has defects such as gaps, fakes, flashes and burrs, and the like, so that the disc-shaped casting has certain influence on the circle fitting of the inner diameter and the outer diameter. In order to meet the requirements on precision and speed, the improved Hough circle centering algorithm is designed, the dimension reduction of the traditional Hough parameter space is realized according to the characteristics of a three-point circle and a circle inscribed triangle, two one-dimensional parameter spaces of circle center coordinates x and y are only needed to be preset, and high-order power operation and evolution operation are not needed, so that a good optimization effect can be generated on the calculation complexity of the algorithm. In order to ensure the robustness of the algorithm and eliminate the boundary lattice point noise, an allowable error limit is specifiedwcAnd a radius variance threshold value tau, so that the rapid circle detection of the sample part with the roundness exceeding the limit error limit can be realized. The experimental result shows that the deviation of the detection value of the algorithm and the actual value is within 1mm (namely +/-0.3%), and the average time for detecting one part is 9.006447 s.
(3) The method adopted by the invention can not be influenced by the form of the surface defect of the casting, can quickly identify two types of edge defects of the gap and the burr in real time under the condition of eliminating the interference of false defects (surface scratches, water marks, mark stains and the like), and quantizes the pixel size information of the defects. The experimental result shows that the defect detection positive detection rate of the algorithm reaches 95%, and the average detection time is 3.60049 s.
Drawings
FIG. 1 is a block diagram of a machine vision system of the present invention;
FIG. 2 is a diagram of the visual inspection hardware platform of the present invention;
FIG. 3a is a brake disc image with a notch defect collected on site in an actual inspection application case;
FIG. 3b is a brake disc image with burr defect collected on site in practical inspection application case;
FIG. 4a is a median filtered brake disc image with a notch defect;
FIG. 4b is a median filtered brake disc image with a burr defect;
FIG. 5 is a background image of the roller table collected on site in an actual inspection application case;
FIG. 6a is an image of a brake disc with a notch defect obtained by a background subtraction method;
FIG. 6b is an image of a brake disc with burr defects obtained by a background subtraction method;
FIG. 7a is a brake disc binary image with a notch defect;
FIG. 7b is a brake disc binary image with a burr defect;
FIG. 8a is a pixel edge contour image with notch defect extracted based on canny operator;
FIG. 8b is a pixel edge profile image with burr defect extracted based on canny operator;
FIG. 8c is a sub-pixel edge profile image with a notch defect based on the gray moment method;
FIG. 8d is a sub-pixel edge profile image with a burr defect based on the grayscale moments method;
FIG. 9 is a schematic flow chart of a dimension measurement algorithm employed in the present invention;
FIG. 10 is a graph of the results of a circle fit of a brake disc part based on a least squares method;
FIG. 11 is a diagram of a circle detection result of a brake disc part based on improved Hough transform;
fig. 12a is a schematic diagram of improved hough transform in circle center positioning;
FIG. 12b is a radius parameter spatial voting statistical curve for improving Hough transform;
FIG. 13 is a schematic view of a notch defect detection algorithm employed in the present invention;
FIG. 14a is a graph of the result of filling holes in a region based on morphological opening operation;
FIG. 14b is an actual edge notch extraction image based on top-hat transformation;
FIG. 14c is an enlarged image of an actual edge notch based on a serial segmentation operation;
FIG. 14d is a graph showing the results of the combined detection of the notch defect signatures;
FIG. 15 is a schematic flow chart of a glitch defect detection algorithm employed in the present invention;
FIG. 16a is a mask template of a reference circle;
FIG. 16b is a diagram illustrating the result of the logical operation between the original image and the mask template;
FIG. 16c is a graph showing coloring results of burr defects based on the connected component method;
FIG. 17 is a drawing of a brake disc part containing technical requirements in a specific application case.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
FIG. 1 is a block diagram of a machine vision system of the invention, including a feeding mechanical system, an illumination system, an optical acquisition system, an image processing and analyzing system, and a human-computer interface, wherein the mutual information transmission between the feeding mechanical system and the human-computer interface is realized through an electrical interface and an information interfaceDelivery; fig. 2 is a diagram of a visual inspection hardware platform according to the present invention, in a darkroom environment, a feeding mechanical system is used for transmitting a sample, an illumination system adopts an LED strip light source to highlight edge characteristics of an object, the edge characteristics can be freely combined according to the size of the object when in use, and simultaneously, dark field illumination is adopted to eliminate interference of external ambient light, so that the illuminance of the object to be detected is uniform, and defects are clearly visible. The optical acquisition system selects an area array CCD camera, in the embodiment, the working distance between the camera and the part to be measured is about 700mm, and the maximum diameter of the brake disc to be measured is
Figure BDA0001756926820000051
The imaging size is determined by the model of the camera
Figure BDA0001756926820000052
The initial calculation according to the formula f ═ uM/(M +1) is as follows:
M=11/300=0.036 (1)
f=700×0.036/(0.036+1)=25.2 (2)
where u is the lens-to-object distance, i.e., the working distance; f is the focal length of the lens; and M is an object image scale factor. Therefore, a fixed-focus telecentric lens with the focal length of 25mm is finally selected, and the working distance can be finely adjusted.
The invention relates to a machine vision-based online detection method for a disc casting, which adopts the following technical scheme:
step 1, acquiring images of the front side and the back side of a brake disc sample through an optical acquisition system, wherein the images are the brake disc image with a notch defect acquired on site as shown in fig. 3a, and the image 3b is the brake disc image with a burr defect acquired on site.
Step 2, as shown in fig. 9, detecting the size of the sample according to the collected sample image, preliminarily judging the defects, and carrying out the next detection; the specific process is as follows:
step 2.1, image preprocessing: carrying out median filtering on the collected sample image by adopting a 5X5 sliding window, eliminating image salt and pepper noise, and keeping the contour better at the same time after the contour is kept; carrying out image segmentation by using a background difference method and an OSTU optimal threshold value method, extracting a target brake disc Region (ROI) and obtaining a binary image; specifically, the method comprises the following steps:
2.1.1 median filtering: the method comprises the steps that a sliding window with the size of 9X9 is used for scanning an image f (X, y), the gray value of each pixel point in a window (2N +1) is sorted according to the size, and the output pixel value of a filtering result is the median of the sequence; finally obtaining a filtered image f1(x, y) As shown in FIGS. 4a and 4b,
yk=med(xk-N,xk-N+1,...xk,...,xk+N-1,xk+N) (3)
where med represents the 5X5 neighborhood median operation, ykFiltered central pixel value, x, for the kth domainkThe k-th domain is the central pixel value before filtering, N in this example is 12.
2.1.2 image segmentation: firstly, the background of the roller way is divided by a background difference method as shown in figure 5, and a part image f with a single background is obtained2(x, y) is shown in FIGS. 6a, 6 b; and carrying out binarization on the image by using an OSTU maximum inter-class variance method. The maximum variance between the two classes is:
σ2(T)=Waa-μ)2+Wbb-μ)2(4)
in the formula WaIs class A probability, μaIs a class A average gray scale, WbIs class B probability, μbAnd μ is the average grayscale of the B class, and μ is the overall average grayscale of the image. So that sigma2(T) dividing the image into A, B parts by taking the threshold value T of the maximum value to obtain a binary image f3(x, y), black is the area to be detected of the brake disc, as shown in fig. 7a, 7 b:
Figure BDA0001756926820000061
step 2.2, as shown in fig. 8a and 8b, pixel level edges of the binary image are detected by using a canny operator, template calculation is performed by adopting the 5X5 field, 1,2 and 3-order gray moments are solved, and then the gray moments are fused with the pixel edges to obtain sub-pixel edge contour outlineImage f4(x, y) as shown in FIGS. 8c and 8 d.
Step 2.3, roundness threshold TThreshold(s)0.90, if T>TThreshold(s)Then, the sub-pixel edge contour image f4And (x, y) respectively adding the inner and outer circle contour points into the linked lists, and calling a least square method to pixels in each linked list to perform circle fitting:
Figure BDA0001756926820000071
order partial derivation
Figure BDA0001756926820000072
(omega is a sample point set of the edge of the circle), minimum values of the formula (6) can be obtained through simultaneous connection, and the minimum value is obtained through comparing function values of all the minimum value points, so that a circular deformation equation R is obtained2=x2+y2-2ax-2ay+a2+b2The polynomial coefficient of (2) can obtain the coordinates (a, b) of the circle center and the radius R according to the corresponding relation, the roundness of the part with the notch is qualified after detection, and the least square fitting circle is shown as figure 10. Wherein x isi、yiIs the x, y pixel coordinate of the sub-pixel edge contour point.
If T<TThreshold(s)The invention provides an improved round centering algorithm based on Hough transformation, which reduces the dimension of a parameter space from three-dimension to one-dimension, has no high-order power operation and evolution operation, and can generate good optimization effect on the calculation complexity of the algorithm, for example, the specific algorithm shown in fig. 12a and 12b is as follows:
a, searching for a point in the clockwise direction of the obtained sub-pixel edge outline, and an initial point P1The uppermost edge point has a step angle of 1 DEG, and the points are numbered P1,P2,...,Pn,...,P359
b selecting the distance P1The points are n points apart from each other, and the two points are connected by a line segment.
c passing Pn+1Dot line segment
Figure BDA0001756926820000073
Perpendicular to (b), from point P in the point domain in step an+1Starting the search in the clockwise direction until finding the point P closest to the verticalmConnecting line segments
Figure BDA0001756926820000074
If n is selected such that
Figure BDA0001756926820000075
Just as a diameter, the corresponding point P cannot be foundmAt this time point PmAnd point Pn+1And (4) overlapping.
d is known from the nature of the circle: the chord midpoint corresponding to the circumference angle of 90 degrees is the center of a circle, and the coordinate (x) of the center of the circleo,yo) Comprises the following steps:
Figure BDA0001756926820000076
wherein
Figure BDA0001756926820000077
Is P1The coordinates of the points are determined by the coordinates of the points,
Figure BDA0001756926820000078
is PmPoint coordinates. In order to ensure the robustness of the algorithm and eliminate the noise of the boundary lattice points, the measuring points which do not meet the requirements are hopefully eliminated, and an allowable error limit is specified:
Figure BDA0001756926820000079
e, setting x and y accumulators respectively, and storing the obtained circle center coordinates respectively. And repeating the above steps b-d to complete the point field (P)1,P2,...,Pn) The parameters at all points are spatially transformed.
f, counting the number of the votes, wherein the coordinates (a and b) of the circle center are the number with the maximum occurrence frequency in the x and y accumulation array.
g, calculating the distance from each point of the point domain to the center of the circle according to the calculated center coordinates, and calculating the average value as the radius of the circle if the variance of all radius values is less than a threshold value tau; otherwise, the mode of the data set is determined as the circle center radius value R. The improved Hough circle transform detection result of the detected part with burrs exceeds the threshold value is shown in figure 11.
Step 2.4, calculating the center distance by utilizing the obtained coordinates of the centers of the inner diameter and the outer diameter to be used as coaxiality error estimation under orthographic projection, and marking the sample as a qualified product when the coaxiality is less than 1 mm; otherwise, marking as a defective product;
further, the conditions for the preliminary defect determination are: according to the obtained circle fitting curve as a reference model line, detecting edge points deviating from the reference model line for a certain distance as bad points, if the distance is a negative value, continuing to detect and mark a sample notch, and if the distance is a positive value, jumping to detect the sample burr defect;
further, as shown in fig. 13, according to the binary image obtained after the image segmentation, median filtering and optimal OSTU thresholding, the method for detecting whether the image has a notch defect and performing detection marking on the image comprises the following steps:
step 3.1, filling internal holes: because the surface of the part has scratch, mark and other pseudo defects, small holes are contained in the binary image obtained by threshold segmentation, and local bright spots need to be filled in order to avoid influencing the extraction of edge gaps, the invention uses a disc-shaped structural element A with the radius of 15 to obtain the binary image f3(x, y) an on operation is performed and the resulting image is shown in FIG. 14 a.
Figure BDA0001756926820000081
Wherein the symbol "Θ" represents a corrosion operation in mathematical morphology, the symbol
Figure BDA0001756926820000082
Indicating an expansion operation;
step 3.2, gap area extraction: the invention uses a circular disk-shaped structural element B with a radius of 60 to heighten the processed imageThe hat conversion is performed by first enlarging the crack or the local low-luminance area as a result of the division operation, and then subtracting the image after the division operation from the original image to highlight the brighter area around the contour, i.e., the edge notch area h2(x, y) as shown in FIG. 14 b.
Figure BDA0001756926820000085
Step 3.3, enlarging the gap area: for the uncompressed large image used in the embodiment, the operation speed can be greatly improved by performing the dilation operation on the image in a morphological serial segmentation mode, so that the invention uses the structural elements
Figure BDA0001756926820000083
The picture is expanded to obtain an enlarged notch region h3(x, y), as shown in FIG. 14 c:
Figure BDA0001756926820000084
step 3.4, marking the notch area: counting the area of the region and the coordinate characteristics of the central point, marking a gap on the filtered image, wherein the radius of the circle is in direct proportion to the area of the gap, and the marked image is shown in fig. 14d, so that the judgment on whether the sample is qualified is realized.
As shown in fig. 15, the method of detecting the burr defect of the sample after comparing the degree of the edge deviation from the reference with the set area threshold value is:
step 4.1, carrying out binarization processing and morphological closed operation according to the sample image,
step 4.2, establishing a mask g (x, y) according to the reference circle obtained in the step 4, and carrying out logical AND operation on the original image and the mask to obtain an image g only with a burr area1(x, y). Fig. 16a shows a mask template, and fig. 16b shows a mask operation result.
g1(x,y)=f2(x,y)&g(x,y) (12)
And 4.3, binarizing the burr area, tracking the edge of the binary connected area, acquiring the burr outline, identifying the burr outline by different colors, measuring the perimeter and the area of the burr by adopting a regionprops operator, coloring the area of the burr, and displaying the colored area of the burr on an original image, wherein the detection result is shown in fig. 16 c.
4.4, determining whether the current sample needs to be finely processed or not according to the processed image;
in the present embodiment, as shown in fig. 17, the measured dimensions of 5 sample brake disc parts were obtained and compared with the actual dimensions, respectively, to draw a dimension measurement result table as shown in table one. The tolerance of the outer diameter of the first type of parts (1#,2#,3#) is known as: 269 ± 1mm, internal diameter tolerance: 57 +/-0.5 mm; the tolerance of the outer diameter of the second type of parts (4#,5#) is as follows: 285 +/-1 mm, and the tolerance of the inner diameter is as follows: 57 +/-0.5 mm. The coaxiality requirements are all +/-1 mm.
Table 1: results of size detection
Figure BDA0001756926820000091
In the actual detection process, the defect detection is easily influenced by uneven ambient light and illuminance, a certain degree of false picking or missed detection is generated, in order to truly reflect the fault tolerance of the visual detection result, a sample part passes through a detection platform at different positions and rotation angles, and the defect detection data shown in the table II is recorded: (Note: Positive detection rate is the accuracy of detection)
Table 2: defect detection results
Figure BDA0001756926820000101
And finally, judging the parts to be qualified products, unqualified products or parts to be finish machined according to the casting technical standard. The defect detection and acceptance criteria were:
allowing the existence of casting surface defects within the machining allowance range on the machined surface of the casting,
the non-machined surface of the casting is allowed to have 3 holes with the diameter of 2.5mm multiplied by 1.5mm, the casting repair adhesive is allowed to be used for filling and repairing the holes, and the repaired position is leveled with the base surface and then is subjected to rust prevention treatment.
The casting is cleaned, the height of the flash, burr, flash and residual amount of a casting head is not more than 0.5mm, and the casting is free of residual sand (such as an opening between an upper braking surface and a lower braking surface of a brake disc) and oxide skin.
The above embodiments are only used for illustrating the design idea and features of the present invention, and the purpose of the present invention is to enable those skilled in the art to understand the content of the present invention and implement the present invention accordingly, and the protection scope of the present invention is not limited to the above embodiments. Therefore, all equivalent changes and modifications made in accordance with the principles and concepts disclosed herein are intended to be included within the scope of the present invention.

Claims (6)

1. A disc casting online detection method based on machine vision is characterized by comprising the following steps:
step 1, collecting an image of a disc casting sample, and acquiring images of the front side and the back side of the disc casting sample;
step 2, detecting the size of the sample according to the collected sample image, preliminarily judging the defects, and carrying out the next detection;
step 3, detecting and marking the sample gap;
step 4, detecting burr defects of the sample;
step 5, finally finishing the judgment on whether the sample is qualified;
the method for detecting the size of the sample comprises the following steps:
step 2.1, preprocessing the collected sample image to obtain a binary image;
step 2.2, detecting the pixel level edge of the binary image, and fusing the pixel level edge by a gray moment method to obtain a sub-pixel edge contour image;
step 2.3, setting a roundness threshold TThreshold(s)According to the roundness T and the threshold value TThreshold(s)Drawing a fitting circular curve; if roundness T>TThreshold(s)Respectively adding the sub-pixel edge contour images into the linked lists, and calling a least square method for pixels in each linked list to perform circle fitting; if roundness T<TThreshold(s)An improved Hough circle detection method is adopted,respectively drawing a fitting circular curve;
step 2.4, the center coordinates of the inner diameter and the outer diameter are utilized to calculate the center distance to be used as coaxiality error estimation under orthographic projection, and when the coaxiality is less than 1mm, the sample is marked as a qualified product; otherwise, marking as unqualified product.
2. The online detection method for the disc castings based on the machine vision is characterized in that the preprocessing of the sample images comprises the following steps: and carrying out median filtering on the sample image, and carrying out image segmentation by using a background difference method and an OSTU optimal threshold value method after retaining the outline.
3. The online detection method for the disc castings based on the machine vision as claimed in claim 1, wherein if T is T>TThreshold(s)And calling a least square method to perform circle fitting:
Figure FDA0002617106340000011
if T<TThreshold(s)Searching the obtained sub-pixel edge contour clockwise for a point, an initial point P1The top edge point has a step angle of 1 degree, and the searched points are sequentially numbered as P1,P2,...,Pn,...,P359(ii) a a and b are respectively circle center coordinates, R is a circle center radius value, and M (a, b and R) is expressed as a fitted circle; omega is a sample point set of the circular edge;
selecting a distance P1The points are n points at intervals, and the points are connected in a line segment mode;
per Pn+1Dot line segment
Figure FDA0002617106340000012
Perpendicular to, in the point domain from point Pn+1Starting the search in the clockwise direction until finding the point P closest to the verticalmConnecting line segments
Figure FDA0002617106340000021
If n is selected such that
Figure FDA0002617106340000022
Just as a diameter, the corresponding point P cannot be foundmAt this time point PmAnd point Pn+1Overlapping;
circle center coordinate (x)o,yo) Comprises the following steps:
Figure FDA0002617106340000023
wherein
Figure FDA0002617106340000024
Is P1The coordinates of the points are determined by the coordinates of the points,
Figure FDA0002617106340000025
is PmPoint coordinates, defining an allowable error limit:
Figure FDA0002617106340000026
setting two accumulators of x and y separately, storing the obtained coordinates of the circle center separately, and repeating the above steps to complete the point domain (P)1,P2,...,Pn) Performing parameter space conversion on all the points;
counting the number of tickets, wherein coordinates (a and b) of the circle center are x, and y is the number with the largest occurrence frequency in the accumulated array;
calculating the distance from each point of the point domain to the center of the circle by taking the calculated center coordinates as the basis, and calculating the average value as the radius of the circle if the variance of all radius values is less than a threshold value tau; otherwise, determining the mode of the data set as a circle center radius value R, and detecting that the roundness of the part with the burrs exceeds a threshold value.
4. The online detection method for the disc castings based on the machine vision as claimed in claim 1, wherein the conditions for the preliminary defect judgment are as follows: and according to the obtained circle fitting curve as a reference model line, detecting edge points deviating from the reference model line for a certain distance in the sub-pixel edge contour image as bad points, if the distance is a negative value, continuing to detect and mark the sample notch, and if the distance is a positive value, jumping to detect the sample burr defect.
5. The online detection method for the disc castings based on the machine vision is characterized in that the method for detecting and marking the sample notches comprises the following steps:
step 3.1, binarizing the sample image by using the OSTU optimal threshold value T to obtain a binary image;
step 3.2, opening operation is carried out to fill the cavities in the binary image, and interference of pseudo defects is eliminated;
step 3.3, obtaining a gap area through top hat transformation;
step 3.4, performing expansion processing on the image by using a morphological serial segmentation mode, and amplifying the gap area;
and 3.5, counting the area of the region and the coordinate characteristics of the central point, and marking a gap on the original sample image to judge whether the sample is qualified.
6. The online detection method for the disc castings based on the machine vision is characterized in that the method for detecting the burr defects of the samples comprises the following steps:
step 4.1, according to the comparison of the degree of the edge deviating from the reference line and a threshold value, if the degree of the edge deviating from the reference line is less than the threshold value, the edge is determined to be a qualified product, and if the degree of the edge deviating from the reference line is greater than the threshold value, the following steps are carried out;
step 4.2, establishing a mask according to the obtained reference circle, and performing logic and operation on the original image and the mask to obtain a burr area;
4.3, binarizing the burr area, tracking the edge of the binary connected area, acquiring the burr outline, identifying the burr outline by different colors, measuring the perimeter and the area of the burr by adopting a regionprops operator, and coloring the area of the burr;
and 4.4, determining whether the current sample needs to be finished or not according to the processed image.
CN201810890880.2A 2018-08-07 2018-08-07 Online detection method for disc castings based on machine vision Active CN109141232B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810890880.2A CN109141232B (en) 2018-08-07 2018-08-07 Online detection method for disc castings based on machine vision

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810890880.2A CN109141232B (en) 2018-08-07 2018-08-07 Online detection method for disc castings based on machine vision

Publications (2)

Publication Number Publication Date
CN109141232A CN109141232A (en) 2019-01-04
CN109141232B true CN109141232B (en) 2020-09-25

Family

ID=64791812

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810890880.2A Active CN109141232B (en) 2018-08-07 2018-08-07 Online detection method for disc castings based on machine vision

Country Status (1)

Country Link
CN (1) CN109141232B (en)

Families Citing this family (32)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109580633A (en) * 2018-11-30 2019-04-05 佛山职业技术学院 A kind of method of plank automatic contacting face production equipment and plank automatic contacting face
CN109622926B (en) * 2019-01-09 2020-12-18 湖南师范大学 Ingot block edge detection method for ingot casting process
CN111768357B (en) * 2019-03-29 2024-03-01 银河水滴科技(北京)有限公司 Image detection method and device
CN109900711A (en) * 2019-04-02 2019-06-18 天津工业大学 Workpiece, defect detection method based on machine vision
CN110006911B (en) * 2019-04-19 2021-07-27 天津工业大学 Method for detecting multiple scratches on metal surface containing screw
CN110097548B (en) * 2019-05-08 2021-01-15 北华航天工业学院 Drilling defect detection system based on machine vision and detection method thereof
CN110163853B (en) * 2019-05-14 2021-05-25 广东奥普特科技股份有限公司 Edge defect detection method
CN110887455B (en) * 2019-11-20 2021-11-19 山东农业大学 Tree electronic altimeter jitter error eliminating method based on mode
CN111062959B (en) * 2019-11-28 2022-04-12 重庆大学 Extraction and characterization method for bottom edge burr cutting characteristics of aviation thin-wall micro-structural part
CN111145154B (en) * 2019-12-25 2022-04-01 西北工业大学 Machine vision-based serial steel wire anti-loosening structure detection method
CN111257348B (en) * 2020-03-27 2023-02-17 河海大学常州校区 LED light guide plate defect detection method based on machine vision
CN111982921B (en) * 2020-05-21 2023-11-03 北京安视中电科技有限公司 Method and device for detecting hole defects, conveying platform and storage medium
CN111899296B (en) * 2020-06-24 2023-07-25 广西大学 Log volume detection method and device based on computer vision
CN111912846A (en) * 2020-07-13 2020-11-10 苏州亚朴智能科技有限公司 Machine vision-based surface defect and edge burr detection method
CN112304217B (en) * 2020-10-15 2022-04-08 浙江大学台州研究院 Dimension measurement scoring device and scoring method based on machine vision
CN113129268B (en) * 2021-03-19 2023-06-27 江苏航空职业技术学院 Quality detection method for riveting pier head of airplane
CN113267139B (en) * 2021-07-19 2021-10-29 江苏中科云控智能工业装备有限公司 Die casting deformation amount detection system with big data analysis
CN113284143B (en) * 2021-07-20 2021-10-29 江苏中科云控智能工业装备有限公司 Die casting deburring precision detection system based on image data processing
CN113379744B (en) * 2021-08-12 2021-11-19 山东大拇指喷雾设备有限公司 Nozzle device surface defect detection method and system based on image processing
CN113740345B (en) * 2021-08-27 2024-03-22 电子科技大学(深圳)高等研究院 Burr detection method and system under high-speed sampling rate
CN113916892B (en) * 2021-09-28 2022-10-28 南京理工大学 Multi-view vision-based brake disc gluing defect detection device and method
CN113804125A (en) * 2021-09-29 2021-12-17 镇江福坤船舶配件有限公司 Method for inspecting surface linear deviation of propeller shaft bracket casting
CN114113112B (en) * 2021-11-29 2023-08-18 哈尔滨工业大学 Surface micro defect positioning and identifying method based on three-light-source microscopic system
CN114998204A (en) * 2022-04-24 2022-09-02 启东亦大通自动化设备有限公司 Self-adaptive adjustment method for processing quality of fisheye gasket
CN115077387B (en) * 2022-08-22 2022-10-28 成都岁生科技有限责任公司 Wedge detection method based on point cloud technology
CN115311291B (en) * 2022-10-12 2023-04-21 南通虎神金属制品有限公司 Cleaning method for hole blockage for hole processing
CN115930833B (en) * 2023-03-13 2023-05-30 山东微晶自动化有限公司 Quality detection and correction method for large cavity casting
CN116523882B (en) * 2023-05-05 2023-11-24 苏州如涵科技有限公司 Vision-based optical target area accuracy detection method and system
CN116385472B (en) * 2023-06-07 2023-08-08 深圳市锦红兴科技有限公司 Hardware stamping part deburring effect evaluation method
CN117953032A (en) * 2023-12-12 2024-04-30 钛玛科(北京)工业科技有限公司 Defect size calibration method for correcting large-breadth material
CN117575986B (en) * 2024-01-05 2024-07-09 大连亚明汽车部件股份有限公司 Method, device, equipment and medium for monitoring finished products of vehicle die-casting fittings
CN118096898B (en) * 2024-04-26 2024-06-25 万灵帮桥医疗器械(广州)有限责任公司 Feature point calibration method, device, equipment and medium based on placido image

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102135416B (en) * 2010-12-30 2012-10-03 天津普达软件技术有限公司 Online image detecting system and method for bottle covers
CN105279756B (en) * 2015-10-19 2018-06-12 天津理工大学 Notch circular arc accessory size visible detection method based on adaptive region segmentation
CN105865344A (en) * 2016-06-13 2016-08-17 长春工业大学 Workpiece dimension measuring method and device based on machine vision
CN106404793B (en) * 2016-09-06 2020-02-28 中国科学院自动化研究所 Bearing sealing element defect detection method based on vision
CN106289186B (en) * 2016-09-21 2019-04-19 南京航空航天大学 The airborne visual detection of rotor wing unmanned aerial vehicle and multi-target positioning system and implementation method
CN106871786A (en) * 2017-03-23 2017-06-20 杭州兆深科技有限公司 A kind of detection method and system for liquid-transfering sucker port

Also Published As

Publication number Publication date
CN109141232A (en) 2019-01-04

Similar Documents

Publication Publication Date Title
CN109141232B (en) Online detection method for disc castings based on machine vision
CN110163853B (en) Edge defect detection method
CN105334219B (en) A kind of bottle mouth defect detection method of residual analysis dynamic threshold segmentation
CN110286124B (en) Machine vision-based refractory brick measuring system
CN105067638B (en) Tire fetal membrane face character defect inspection method based on machine vision
CN109900711A (en) Workpiece, defect detection method based on machine vision
CN105160652A (en) Handset casing testing apparatus and method based on computer vision
CN108765402B (en) Non-woven fabric defect detection and classification method
CN108257171A (en) Car radar assembling aperture detection method based on light vision
CN115222733A (en) Metal component surface defect detection method based on image recognition
CN109900719B (en) Visual detection method for blade surface knife lines
CN112037203A (en) Side surface defect detection method and system based on complex workpiece outer contour registration
CN102441581A (en) Machine vision-based device and method for online detection of structural steel section size
CN106780526A (en) A kind of ferrite wafer alligatoring recognition methods
CN112001917A (en) Machine vision-based geometric tolerance detection method for circular perforated part
CN109239073A (en) A kind of detection method of surface flaw for body of a motor car
Fu et al. Medicine glass bottle defect detection based on machine vision
CN106529551B (en) Intelligent recognition counting detection method for round-like objects in packaging industry
CN115082410A (en) Clamp spring defect detection method based on image processing
CN112669295A (en) Lithium battery pole piece defect detection method based on secondary threshold segmentation theory
CN113222955A (en) Gear size parameter automatic measurement method based on machine vision
CN106989672A (en) A kind of workpiece measuring based on machine vision
CN113705564B (en) Pointer type instrument identification reading method
CN111815575B (en) Bearing steel ball part detection method based on machine vision
CN111833350A (en) Machine vision detection method and system

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