CN102680494B - Based on arcuation face, the polishing metal flaw real-time detection method of machine vision - Google Patents

Based on arcuation face, the polishing metal flaw real-time detection method of machine vision Download PDF

Info

Publication number
CN102680494B
CN102680494B CN201210163710.7A CN201210163710A CN102680494B CN 102680494 B CN102680494 B CN 102680494B CN 201210163710 A CN201210163710 A CN 201210163710A CN 102680494 B CN102680494 B CN 102680494B
Authority
CN
China
Prior art keywords
image
sample image
sigma
histogram
gray
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
CN201210163710.7A
Other languages
Chinese (zh)
Other versions
CN102680494A (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.)
Jiangsu blue creative intelligent Polytron Technologies Inc
Original Assignee
Jiangnan 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 Jiangnan University filed Critical Jiangnan University
Priority to CN201210163710.7A priority Critical patent/CN102680494B/en
Publication of CN102680494A publication Critical patent/CN102680494A/en
Application granted granted Critical
Publication of CN102680494B publication Critical patent/CN102680494B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The present invention relates to a kind of arcuation face, polishing metal flaw real-time detection method based on machine vision, under it comprises the steps: step 1, off-line case, acquisition N opens the first sample image and M opens the second sample image, and carries out data fusion; Step 2, set up fused image histogram, obtain the linear relation between image background with corresponding gray-scale value; The reflecting component of step 3, selected first sample image of calculating, the second sample image; Step 4, set up qualified workpiece reflecting component standard deviation and the corresponding relation formula between corresponding gray-scale value; The detected image of step 5, online arcuation face, Real-time Obtaining polishing metal workpiece, calculates the first standard deviation and the second standard deviation; Step 6, carry out Threshold segmentation, obtain corresponding bianry image; Step 7, connected region area in bianry image to be compared with default judgment threshold, judge the flaw in arcuation face, polishing metal.The present invention is easy to operate, and accuracy of detection is high, detects adaptability good, reliable and stable.

Description

Based on arcuation face, the polishing metal flaw real-time detection method of machine vision
Technical field
The present invention relates to a kind of detection method, especially a kind of arcuation face, polishing metal flaw real-time detection method based on machine vision, belong to the technical field that arcuation face, polishing metal is detected.
Background technology
In the industrial production, along with improving constantly of industrial technology level, also improve the quality requirements of product, tradition mainly depends on artificial visually examine to the monitoring of workpiece quality thereupon.Due to the impact of the subjective factor of examinate person, be easy to occur flase drop and the situation such as undetected, and artificial visually examine also efficient low, accuracy rate is low and standardization degree inadequate, profile and the state of mind of testing result and supervisory personnel are closely related, stability and Reliability comparotive poor, in addition, detection Data classification can not be sent into computing machine in real time and carry out automatic quality control.The difficult problem that artificial visually examine's workload is large, efficiency is low in order to solve, loss is high, enterprise is badly in need of introducing a kind of Automatic Measurement Technique, with alternative manual operation, can realize again the strict control to product quality while reducing human cost.So, introduce the application of machine vision in workpiece quality monitoring.Replace traditional human eye to monitor product quality by machine vision, improve the quality of production efficiency and product.
At present, many scholars are also had both at home and abroad in the Defect Detection of research polishing arcuation metal surface, this kind of columniform metal works of such as bearing outside surface.Also there is following problem in the detection of this type of workpiece: (1), because the reflectivity of polishing arcuation surface of the work is high, the reflection angle of the reflected light that camera receives is different, so be difficult to obtain uniform illumination, and the image that breadth is wide; (2) the gradation of image skewness collected, effective coverage is narrow.During as adopted axis light as light source, effective coverage is narrow, detects a bearing need at least 60 images through experimental analysis.For solving the problem of uneven illumination, extraction background image can be adopted, then according to background image, image is strengthened, obtaining the image of uniform gray level.But when workpiece has large defect time, the extraction of background image will there will be error.
Summary of the invention
The object of the invention is to overcome the deficiencies in the prior art, provide a kind of arcuation face, polishing metal flaw real-time detection method based on machine vision, it is easy to operate, and accuracy of detection is high, detects adaptability good, reliable and stable.
According to technical scheme provided by the invention, a kind of arcuation face, polishing metal flaw real-time detection method based on machine vision, arcuation face, described polishing metal flaw real-time detection method comprises the steps:
Under step 1, off-line case, obtain first sample image of N opening and closing lattice workpiece under normal work illumination and M opening and closing lattice workpiece low light according under the second sample image, the first sample image is opened to N and carries out medium filtering respectively and obtain image sequence I n, n=1,2 ..., N, opens the second sample image to M and carries out medium filtering acquisition image sequence I respectively m, m=1,2 ..., M, to image sequence I n, image sequence I mimage g (x, y), h (x, y) is obtained after carrying out data fusion respectively;
Step 2, statistics fused image g (x, y), h (x, y) corresponding gray-scale value and number of pixels corresponding to gray-scale value in, obtain image g (x respectively, y), h (x, y) histogram, the linear relation that the gray-scale value corresponding according to the corresponding larger crest value of histogram is set up between image background I (x, the y) gray-scale value corresponding with crest value larger in histogram is
I(x,y)=a(x,y)*(Z max-Z h)+h(x,y)
Wherein, Z maxrepresent the gray-scale value that in histogram, larger crest value is corresponding, a (x, y) is slope matrix;
Step 3, from above-mentioned first sample image, the second sample image an all optional sample image, and set up the histogram of selected first sample image, the second sample image, obtain the gray-scale value that larger crest value in selected first sample image, the second sample image histogram is corresponding, according to the linear relation of described gray-scale value and step 2, obtain the reflecting component of selected first sample image, the second sample image respectively;
Step 4, obtain the reflecting component of selected first sample image, the second sample image according to step 3, the corresponding relation formula set up between the qualified workpiece reflecting component standard deviation gray-scale value corresponding with crest value larger in histogram is
σ ( Z max ) ≈ σ n - σ 0 Z max _ n - Z max _ 0 * ( Z max - Z max _ 0 ) + σ 0
Wherein, σ (Z max) represent the reflecting component standard deviation of qualified workpiece, Z max_nrepresent the gray-scale value that in selected first sample image histogram, maximum crest value is corresponding, Z max_0represent the gray-scale value that in selected second sample image histogram, maximum crest value is corresponding, σ nfor the standard deviation of selected first sample image, σ 0for the standard deviation of selected second sample image;
Step 5, the detected image of online arcuation face, Real-time Obtaining polishing metal workpiece under work illumination, carry out medium filtering to described detected image, set up the histogram of detected image; The gray-scale value corresponding according to crest value larger in histogram and above-mentioned steps obtain the reflecting component of detected image; Gaussian filtering is carried out to the reflecting component obtaining detected image, obtains the second reflecting component, and calculate the second standard deviation of the second reflecting component, and calculate first standard deviation of detected image at the qualified workpiece image of corresponding grey scale level according to step 4;
Step 6, compare the first standard deviation and the second standard deviation, to choose segmentation threshold, by segmentation threshold, Threshold segmentation is carried out to the second reflecting component, obtain corresponding bianry image;
Step 7, scan above-mentioned bianry image, and mark connected region different in bianry image, statistics connected region area, compares connected region area with default judgment threshold, judges the flaw in arcuation face, polishing metal.
Described step 1 comprises the steps:
Step 1.1, in off-line case, gathers first sample image of N opening and closing lattice workpiece under work illumination, is then reduced to required intensity of illumination, gathers second sample image of M opening and closing lattice workpiece under Low light intensity;
Step 1.2, the first sample image, the second sample image are carried out to medium filtering and obtain image sequence I respectively n, I m; Wherein, n=1,2 ..., N, m=1,2 ... M;
Step 1.3, basis by image sequence I ncarry out data fusion, wherein, (x, y) represents the location of pixels in image sequence;
Step 1.4, basis by image sequence I mcarry out data fusion.
Described step 2 comprises the steps:
Step 2.1, gradation of image get 0 ~ 255, statistical picture g (x, y) number of pixels of corresponding grey scale value, then divided by image g (x, y) total number of pixels, obtain histogram p (z) of image g (x, y), and obtain the gray-scale value Z reaching larger crest value g;
Step 2.2, according to step 2.1, obtain histogram q (z) of image h (x, y), and obtain the gray-scale value Z reaching larger peak value h;
Step 2.3, set up the linear gradient matrix between larger crest value corresponding grey scale value in image background I (x, y) and histogram, obtain
a ( x , y ) = g ( x , y ) - h ( x , y ) Z g - Z h ;
Step 2.4, the linear relationship obtaining in image background I (x, y) and histogram between larger crest value according to step 2.3, for
I(x,y)=a(x,y)*(Z max-Z h)+h(x,y),
Wherein, Z maxrepresent the gray-scale value that in histogram, larger crest value is corresponding.
Described step 3 comprises the steps:
Step 3.1, open the first sample image from above-mentioned N, M opens an all optional sample image the second sample image, the pixel count of corresponding grey scale value in selected first sample image of statistics, the second sample image, to set up the histogram of selected first sample image, the second sample image, obtain the gray-scale value that larger crest value in selected first sample image, the second sample image histogram is corresponding;
Step 3.2, according to step 2 and gray-scale value corresponding to larger crest value, obtain selected first sample image, background component I (x, y) that the second sample image is corresponding respectively;
Step 3.3, basis ask for the reflecting component of selected first sample image, the second sample image, wherein, k is constant, and f (x, y) is selected first sample image or the second sample image.
Described step 4 comprises the steps:
The average μ of the reflecting component of step 4.1, selected first sample image of calculating, obtains
μ = 1 n * m Σ x = 1 n Σ y = 1 m r ( x , y ) ,
Wherein, n*m represents the size of reflecting component image;
Step 4.2, calculate the standard deviation sigma of selected first sample image reflecting component according to step 4.1 n, obtain
σ n = 1 n * m Σ x = 1 n Σ y = 1 m ( r ( x , y ) - μ ) ) 2 ;
Step 4.3, calculate the standard deviation sigma of selected second sample image reflecting component according to step 4.1, step 4.2 0;
Step 4.4, set up the gray-scale value Z of larger crest value in qualified workpiece reflecting component standard deviation and histogram maxcorresponding relation formula, obtains,
σ ( Z max ) ≈ σ n - σ 0 Z max _ n - Z max _ 0 * ( Z max - Z max _ 0 ) + σ 0
Wherein, σ (Z max) represent the reflecting component standard deviation of qualified workpiece, Z max_nrepresent the gray-scale value that in selected first sample image histogram, maximum crest value is corresponding, Z max_0represent the gray-scale value that in selected second sample image histogram, maximum crest value is corresponding.
Described step 5 comprises the steps:
Step 5.1, under work illumination condition, gather workpiece sensing image t (x, y), and medium filtering is carried out to detected image t (x, y);
Step 5.2, set up medium filtering after, the histogram of detected image, according to the histogram of detected image, obtains the gray-scale value Z that larger crest value in histogram is corresponding t;
Step 5.3, according to gray-scale value Z tand step 2, obtain the background component I of detected image t(x, y);
Step 5.4, according to step 5.3 and step 3, obtain the reflecting component r of detected image t(x, y);
Step 5.5, to reflecting component r t(x, y) carries out gaussian filtering, generates the second reflecting component R (x, y);
Step 5.6, according to gray-scale value Z tand step 4.4 obtains the first standard deviation sigma (Z of detected image t);
Step 5.7, calculate second standard deviation sigma of the second reflecting component R (x, y) according to step 4.1 and step 4.2 t.
Described step 6 comprises the steps:
Step 6.1, compare the first standard deviation sigma (Z t) and the second standard deviation sigma trelation, obtain
sigma = 2 σ ( Z t ) , σ t > 2 σ ( Z t ) σ t , σ t ≤ 2 σ ( Z t )
Step 6.2, setting segmentation upper threshold value T 1, lower threshold value T 2, obtain
T 1 = Z t + λ * sigma T 2 = Z t - λ * sigma
Wherein, λ is adjustment factor;
Step 6.3, utilize upper threshold value T 1, lower threshold value T 2threshold segmentation is carried out to the second background component R (x, y), obtains bianry image b (x, y), obtain
b ( x , y ) = 0 , T 2 ≤ R ( x , y ) ≤ T 1 1
Wherein, 0 is background area, and 1 is pending region.
Described step 7 comprises the steps:
Step 7.1, scanning bianry image b (x, y), and the different connected regions in bianry image b (x, y) are marked;
In step 7.2, respectively statistics bianry image b (x, y), the area of different connected region, arranges required judgment threshold S; When the interior connected region area of bianry image b (x, y) is greater than judgment threshold S, then corresponding connected region is defect areas; When in bianry image b (x, y), connected region area is less than judgment threshold S, then corresponding connected region is normal region.
In described step 5.5, the convolution mask of gaussian filtering is
h = 1 16 * 1 2 1 2 4 2 1 2 1 .
Described adjustment factor λ is 3 ~ 4.
Advantage of the present invention: the first Luminance Distribution situation of study analysis measured workpiece under this duty under off-line state, and the statistical nature of qualified workpiece; Then, during on-line checkingi, effectively can extract the reflecting component of measured workpiece, and by the operation such as filtering, Threshold segmentation, workpiece is carried out in real time, Defect Detection accurately, easy to operate, accuracy of detection is high, detects adaptability good, reliable and stable.
Accompanying drawing explanation
Fig. 1 is that the present invention is for gathering the structural representation of image.
Fig. 2 is process flow diagram of the present invention.
Description of reference numerals: 100-industrial camera, 110-bracing frame, 120-measured workpiece, 130-diffusing plane light, 140-base and 150-hanger bracket.
Embodiment
Below in conjunction with concrete drawings and Examples, the invention will be further described.
The object of the invention is real-time detection arcuation face, polishing metal being carried out to flaw, due to arcuation face, polishing metal smooth surface, diffuse reflectance is low, and surface becomes arcuation, the light intensity that the face of different spatial is radiated differs, so be difficult to the image obtaining wide cut brightness uniformity.According to this problem, propose and a kind ofly detect arcuation face, polishing metal in real time based on off-line learning knowledge and the method for on-line real-time measuremen flaw can be carried out.
As shown in Figure 1, when gathering image, the present invention includes base 140, described base 140 is provided with the bracing frame 110 of vertically distribution, can support metal arcuation face by bracing frame 110; Base 140 is also provided with hanger bracket 150, industrial camera 100 can be hung by hanger bracket 150; Be provided with diffusing plane light 130 directly over bracing frame 110, irradiate tested metal arcuation face by diffusing plane light 130, so that required image can be gathered by industrial camera 100.Adopt X-Sight SV4-30m industrial camera 100 to gather cylindrical workpiece arcuation side surface image in the embodiment of the present invention, industrial camera 100 sampling unit is 1/3 inch of CMOS, and resolution is 640*480(pixel).Because the reflectivity on arcuation surface, polishing metal is high, detection faces is not on a space plane, and the mode of employing direct irradiation, coaxial illumination all can only obtain very narrow effective coverage.The mode that have employed blue diffusing plane LED light source and tested surface vertical irradiation is thrown light on; Because wavelength is shorter, the scattering on surface is better, so have selected the blue-light source of wavelength at 470nm.
As shown in Figure 2: the present invention comprises the steps: arcuation face, polishing metal flaw real-time detection method
Under step 1, off-line case, obtain first sample image of N opening and closing lattice workpiece under normal work illumination and M opening and closing lattice workpiece low light according under the second sample image, the first sample image is opened to N and carries out medium filtering respectively and obtain image sequence I n, n=1,2 ..., N, opens the second sample image to M and carries out medium filtering acquisition image sequence I respectively m, m=1,2 ..., M, to image sequence I n, image sequence I mimage g (x, y), h (x, y) is obtained after carrying out data fusion respectively;
Off-line case refers to the image first being gathered qualified workpiece by industrial camera, by obtaining required conclusion to mass data analysis, for on-line checkingi, the effect one of sample image is analysis background component, as foundation during on-line checkingi extraction reflecting component; Two is extract feature, uses when Threshold segmentation, decision-making as during detection.Obtain that N opens the first sample image, to open the second sample image be to carry out data fusion to sample image to M, thus obtain more reliable background component, wherein N can equal M.The scope of low light photograph preferably at average gray in value about 20, the chances are about 40 for the average gray value of normal illumination.
Step 1 comprises following concrete steps:
Step 1.1, in off-line case, gathers first sample image of N opening and closing lattice workpiece under work illumination, is then reduced to required intensity of illumination, gathers second sample image of M opening and closing lattice workpiece under Low light intensity;
Step 1.2, the first sample image, the second sample image are carried out to medium filtering and obtain image sequence I respectively n, I m; Wherein, n=1,2 ..., N, m=1,2 ... M;
During medium filtering, the gray-scale value of each pixel is set to the intermediate value of all pixel gray-scale values in this some neighborhood window, default window adopts the neighborhood window of 25*25, sample image size according to gathering can adjust accordingly, medium filtering is conventional filtering mode, known by the art personnel, no longer describe in detail herein;
Step 1.3, basis by image sequence I ncarry out data fusion, wherein, (x, y) represents the location of pixels in image sequence;
Step 1.4, basis by image sequence I mcarry out data fusion.
Step 2, statistics fused image g (x, y), h (x, y) corresponding gray-scale value and number of pixels corresponding to gray-scale value in, obtain image g (x respectively, y), h (x, y) histogram, the linear relation that the gray-scale value corresponding according to the corresponding larger crest value of histogram is set up between image background I (x, the y) gray-scale value corresponding with crest value larger in histogram is
I(x,y)=a(x,y)*(Z max-Z h)+h(x,y)
Wherein, Z maxrepresent the gray-scale value that in histogram, larger crest value is corresponding, a (x, y) is slope matrix;
Described step 2 comprises the steps:
Step 2.1, gradation of image get 0 ~ 255, statistical picture g (x, y) number of pixels of corresponding grey scale value, then divided by image g (x, y) total number of pixels, obtain histogram p (z) of image g (x, y), and obtain the gray-scale value Z reaching larger crest value g;
Setting up histogram is the technological means that the art is commonly used, and histogrammic horizontal ordinate is image intensity value, and ordinate is the number of pixels of certain gray-scale value and the ratio of the total number of phases number of image, no longer describes in detail herein; Z is image intensity value;
Step 2.2, according to step 2.1, obtain histogram q (z) of image h (x, y), and obtain the gray-scale value Z reaching larger peak value h;
Step 2.3, set up the linear gradient matrix between larger crest value corresponding grey scale value in image background I (x, y) and histogram, obtain
a ( x , y ) = g ( x , y ) - h ( x , y ) Z g - Z h ;
Step 2.4, the linear relationship obtaining in image background I (x, y) and histogram between larger crest value according to step 2.3, for
I(x,y)=a(x,y)*(Z max-Z h)+h(x,y),
Wherein, Z maxrepresent the gray-scale value that in histogram, larger crest value is corresponding.
Step 3, from above-mentioned first sample image, the second sample image an all optional sample image, and set up the histogram of selected first sample image, the second sample image, obtain the gray-scale value that larger crest value in selected first sample image, the second sample image histogram is corresponding, according to the linear relation of described gray-scale value and step 2, obtain the reflecting component of selected first sample image, the second sample image respectively;
Described step 3 comprises the steps:
Step 3.1, open the first sample image from above-mentioned N, M opens an all optional sample image the second sample image, the pixel count of corresponding grey scale value in selected first sample image of statistics, the second sample image, to set up the histogram of selected first sample image, the second sample image, obtain the gray-scale value that larger crest value in selected first sample image, the second sample image histogram is corresponding;
Step 3.2, according to step 2 and gray-scale value corresponding to larger crest value, obtain selected first sample image, background component I (x, y) that the second sample image is corresponding respectively;
Step 3.3, basis ask for the reflecting component of selected first sample image, the second sample image, wherein, k is constant, and f (x, y) is selected first sample image or the second sample image; K is the constant depending on reflecting component, and in order to make the average of reflecting component about 0.5, general k gets 0.5.
Step 4, obtain the reflecting component of selected first sample image, the second sample image according to step 3, the corresponding relation formula set up between the qualified workpiece reflecting component standard deviation gray-scale value corresponding with crest value larger in histogram is
σ ( Z max ) ≈ σ n - σ 0 Z max _ n - Z max _ 0 * ( Z max - Z max _ 0 ) + σ 0
Wherein, σ (Z max) represent the reflecting component standard deviation of qualified workpiece, Z max_nrepresent the gray-scale value that in selected first sample image histogram, maximum crest value is corresponding, Z max_0represent the gray-scale value that in selected second sample image histogram, maximum crest value is corresponding, σ nfor the standard deviation of selected first sample image, σ 0for the standard deviation of selected second sample image;
Described step 4 comprises the steps:
The average μ of the reflecting component of step 4.1, selected first sample image of calculating, obtains
μ = 1 n * m Σ x = 1 n Σ y = 1 m r ( x , y ) ,
Wherein, n*m represents the size of reflecting component image;
Step 4.2, calculate the standard deviation sigma of selected first sample image reflecting component according to step 4.1 n, obtain
σ n = 1 n * m Σ x = 1 n Σ y = 1 m ( r ( x , y ) - μ ) ) 2 ;
Step 4.3, calculate the standard deviation sigma of selected second sample image reflecting component according to step 4.1, step 4.2 0;
Step 4.4, set up the gray-scale value Z of larger crest value in qualified workpiece reflecting component standard deviation and histogram maxcorresponding relation formula, obtains,
σ ( Z max ) ≈ σ n - σ 0 Z max _ n - Z max _ 0 * ( Z max - Z max _ 0 ) + σ 0
Wherein, σ (Z max) represent the reflecting component standard deviation of qualified workpiece, Z max_nrepresent the gray-scale value that in selected first sample image histogram, maximum crest value is corresponding, Z max_0represent the gray-scale value that in selected second sample image histogram, maximum crest value is corresponding.
Step 5, the detected image of online arcuation face, Real-time Obtaining polishing metal workpiece under work illumination, carry out medium filtering to described detected image, set up the histogram of detected image; The gray-scale value corresponding according to crest value larger in histogram and above-mentioned steps obtain the reflecting component of detected image; Gaussian filtering is carried out to the reflecting component obtaining detected image, obtains the second reflecting component, and calculate the second standard deviation of the second reflecting component, and calculate first standard deviation of detected image at the qualified workpiece image of corresponding grey scale level according to step 4;
After on-line checkingi refers to and obtains detected image, judge whether metal arcuation face exists flaw by carrying out detection analysis to detected image; On-line checkingi needs the conclusion and the data that utilize offline inspection, when the technological means that on-line checkingi uses is consistent with offline inspection, and can with reference to computing formula during above-mentioned offline inspection and method.
Described step 5 comprises the steps:
Step 5.1, under work illumination condition, gather workpiece sensing image t (x, y), and medium filtering is carried out to detected image t (x, y);
Step 5.2, set up medium filtering after, the histogram of detected image, according to the histogram of detected image, obtains the gray-scale value Z that larger crest value in histogram is corresponding t;
Step 5.3, according to gray-scale value Z tand step 2, obtain the background component I of detected image t(x, y);
Step 5.4, according to step 5.3 and step 3, obtain the reflecting component r of detected image t(x, y);
Step 5.5, to reflecting component r t(x, y) carries out gaussian filtering denoising, generates the second reflecting component R (x, y), and wherein the convolution mask of gaussian filtering is
h = 1 16 * 1 2 1 2 4 2 1 2 1 .
Step 5.6, according to gray-scale value Z tand step 4.4 obtains the first standard deviation sigma (Z of detected image t);
Step 5.7, calculate second standard deviation sigma of the second reflecting component R (x, y) according to step 4.1 and step 4.2 t.
Step 6, compare the first standard deviation and the second standard deviation, to choose segmentation threshold, by segmentation threshold, Threshold segmentation is carried out to the second reflecting component, obtain corresponding bianry image;
Described step 6 comprises the steps:
Step 6.1, compare the first standard deviation sigma (Z t) and the second standard deviation sigma trelation, obtain
sigma = 2 σ ( Z t ) , σ t > 2 σ ( Z t ) σ t , σ t ≤ 2 σ ( Z t )
Step 6.2, setting segmentation upper threshold value T 1, lower threshold value T 2, obtain
T 1 = Z t + λ * sigma T 2 = Z t - λ * sigma
Wherein, λ is adjustment factor; Described adjustment factor λ is 3 ~ 4.
Step 6.3, utilize upper threshold value T 1, lower threshold value T 2threshold segmentation is carried out to the second background component R (x, y), obtains bianry image b (x, y), obtain
b ( x , y ) = 0 , T 2 ≤ R ( x , y ) ≤ T 1 1
Wherein, 0 is background area, and 1 is pending region.
Step 7, scan above-mentioned bianry image, and mark connected region different in bianry image, statistics connected region area, compares connected region area with default judgment threshold, judges the flaw in arcuation face, polishing metal.
Described step 7 comprises the steps:
Step 7.1, scanning bianry image b (x, y), and the different connected regions in bianry image b (x, y) are marked;
Recursion method can be adopted in the embodiment of the present invention to carry out zone marker;
In step 7.2, respectively statistics bianry image b (x, y), the area of different connected region, arranges required judgment threshold S; When the interior connected region area of bianry image b (x, y) is greater than judgment threshold S, then corresponding connected region is defect areas; When in bianry image b (x, y), connected region area is less than judgment threshold S, then corresponding connected region is normal region.By judging whether the interior connected region of bianry image b (x, y) is that defect areas judges whether metal arcuation face exists flaw, due to the processing request of medal polish face and different industries, judgment threshold S can relative set.
The present invention is the Luminance Distribution situation of study analysis measured workpiece under this duty under off-line state first, and the statistical nature of qualified workpiece; Then, during on-line checkingi, effectively can extract the reflecting component of measured workpiece, and by the operation such as filtering, Threshold segmentation, workpiece is carried out in real time, Defect Detection accurately.

Claims (4)

1. based on arcuation face, a polishing metal flaw real-time detection method for machine vision, it is characterized in that: arcuation face, described polishing metal flaw real-time detection method comprises the steps:
Under step 1, off-line case, obtain first sample image of N opening and closing lattice workpiece under normal work illumination and M opening and closing lattice workpiece low light according under the second sample image, the first sample image is opened to N and carries out medium filtering respectively and obtain image sequence I n, n=1,2 ..., N, opens the second sample image to M and carries out medium filtering acquisition image sequence I respectively m, m=1,2 ..., M, to image sequence I n, image sequence I mimage g (x, y), h (x, y) is obtained after carrying out data fusion respectively;
Step 2, statistics fused image g (x, y), h (x, y) corresponding gray-scale value and number of pixels corresponding to gray-scale value in, obtain image g (x respectively, y), h (x, y) histogram, the linear relation that the gray-scale value corresponding according to the corresponding larger crest value of histogram is set up between background component I (x, the y) gray-scale value corresponding with crest value larger in histogram is
I(x,y)=a(x,y)*(Z max-Z h)+h(x,y)
Wherein, variable Z maxthe gray-scale value that in the histogram of expression detected image, larger crest value is corresponding, a (x, y) is slope matrix, Z hthe gray-scale value that in the histogram of expression image h (x, y), larger crest value is corresponding;
Step 3, from above-mentioned first sample image, the second sample image an all optional sample image, and set up the histogram of selected first sample image, the second sample image, obtain the gray-scale value that larger crest value in selected first sample image, the second sample image histogram is corresponding, according to the linear relation of described gray-scale value and step 2, obtain the reflecting component of selected first sample image, the second sample image respectively;
Step 4, obtain the reflecting component of selected first sample image, the second sample image according to step 3, the corresponding relation formula set up between the qualified workpiece reflecting component standard deviation gray-scale value corresponding with crest value larger in histogram is
σ ( Z max ) ≈ σ n - σ 0 Z max _ n - Z max _ 0 * ( Z max - Z max _ 0 ) + σ 0
Wherein, σ (Z max) represent the reflecting component standard deviation of qualified workpiece, Z max_nrepresent the gray-scale value that in selected first sample image histogram, maximum crest value is corresponding, Z max_0represent the gray-scale value that in selected second sample image histogram, maximum crest value is corresponding, σ nfor the standard deviation of selected first sample image, σ 0for the standard deviation of selected second sample image;
Step 5, the detected image of online arcuation face, Real-time Obtaining polishing metal workpiece under work illumination, carry out medium filtering to described detected image, set up the histogram of detected image; The gray-scale value corresponding according to crest value larger in histogram and step 3 obtain the reflecting component of detected image; Gaussian filtering is carried out to the reflecting component obtaining detected image, obtains the second reflecting component, and calculate the second standard deviation of the second reflecting component, and calculate first standard deviation of detected image at the qualified workpiece image of corresponding grey scale level according to step 4;
Step 6, compare the first standard deviation and the second standard deviation, to choose segmentation threshold, by segmentation threshold, Threshold segmentation is carried out to the second reflecting component, obtain corresponding bianry image;
Step 7, scan above-mentioned bianry image, and mark connected region different in bianry image, statistics connected region area, compares connected region area with default judgment threshold, judges the flaw in arcuation face, polishing metal;
Described step 2 comprises the steps:
Step 2.1, gradation of image get 0 ~ 255, statistical picture g (x, y) number of pixels of corresponding grey scale value, then divided by image g (x, y) total number of pixels, obtain histogram p (z) of image g (x, y), and obtain the gray-scale value Z reaching larger crest value g;
Step 2.2, according to step 2.1, obtain histogram q (z) of image h (x, y), and obtain the gray-scale value Z reaching larger peak value h;
Step 2.3, set up the linear gradient matrix between larger crest value corresponding grey scale value in background component I (x, y) and histogram, obtain
a ( x , y ) = g ( x , y ) - h ( x , y ) Z g - Z h ;
Step 2.4, the linear relationship obtaining in background component I (x, y) and histogram between larger crest value according to step 2.3, for
I(x,y)=a(x,y)*(Z max-Z h)+h(x,y),
Wherein, variable Z maxthe gray-scale value that in the histogram of expression detected image, larger crest value is corresponding;
Described step 3 comprises the steps:
Step 3.1, open the first sample image from above-mentioned N, M opens an all optional sample image the second sample image, the pixel count of corresponding grey scale value in selected first sample image of statistics, the second sample image, to set up the histogram of selected first sample image, the second sample image, obtain the gray-scale value that larger crest value in selected first sample image, the second sample image histogram is corresponding;
Step 3.2, according to step 2 and gray-scale value corresponding to larger crest value, obtain selected first sample image, background component I (x, y) that the second sample image is corresponding respectively;
Step 3.3, basis ask for the reflecting component of selected first sample image, the second sample image, wherein, k is constant, and f (x, y) is selected first sample image or the second sample image;
Described step 4 comprises the steps:
The average μ of the reflecting component of step 4.1, selected first sample image of calculating, obtains
μ = 1 ν * μ Σ ξ = 1 ν Σ ψ = 1 μ ρ ( ξ , ψ ) ,
Wherein, n*m represents the size of reflecting component image;
Step 4.2, calculate the standard deviation sigma of selected first sample image reflecting component according to step 4.1 n, obtain
σ n = 1 n * m Σ x = 1 n Σ y = 1 m ( r ( x , y ) - μ ) ) 2 ;
Step 4.3, calculate the standard deviation sigma of selected second sample image reflecting component according to step 4.1, step 4.2 0;
Step 4.4, set up the gray-scale value Z of larger crest value in qualified workpiece reflecting component standard deviation and histogram maxcorresponding relation formula, obtains,
σ ( Z max ) ≈ σ n - σ 0 Z max _ n - Z max _ 0 * ( Z max - Z max _ 0 ) + σ 0
Wherein, σ (Z max) represent the reflecting component standard deviation of qualified workpiece, Z max_nrepresent the gray-scale value that in selected first sample image histogram, maximum crest value is corresponding, Z max_0represent the gray-scale value that in selected second sample image histogram, maximum crest value is corresponding;
Described step 5 comprises the steps:
Step 5.1, under work illumination condition, gather workpiece sensing image t (x, y), and medium filtering is carried out to detected image t (x, y);
Step 5.2, set up medium filtering after, the histogram of detected image, according to the histogram of detected image, obtains the gray-scale value Z that larger crest value in histogram is corresponding t;
Step 5.3, according to gray-scale value Z tand step 2, obtain the background component I of detected image t(x, y);
Step 5.4, according to step 5.3 and step 3, obtain the reflecting component r of detected image t(x, y);
Step 5.5, to reflecting component r t(x, y) carries out gaussian filtering, generates the second reflecting component R (x, y);
Step 5.6, according to gray-scale value Z tand step 4.4 obtains the first standard deviation sigma (Z of detected image t);
Step 5.7, calculate second standard deviation sigma of the second reflecting component R (x, y) according to step 4.1 and step 4.2 t;
Described step 6 comprises the steps:
Step 6.1, compare the first standard deviation sigma (Z t) and the second standard deviation sigma trelation, obtain
sigma = 2 σ ( Z t ) , σ t > 2 σ ( Z t ) σ t , σ t ≤ 2 σ ( Z t )
Step 6.2, setting segmentation upper threshold value T 1, lower threshold value T 2, obtain
T 1 = Z t + λ * sigma T 2 = Z t - λ * sigma
Wherein, λ is adjustment factor;
Step 6.3, utilize upper threshold value T 1, lower threshold value T 2threshold segmentation is carried out to the second background component R (x, y), obtains bianry image b (x, y), obtain
b ( x , y ) = 0 , T 2 ≤ R ( x , y ) ≤ T 1 1
Wherein, 0 is background area, and 1 is pending region;
Described step 7 comprises the steps:
Step 7.1, scanning bianry image b (x, y), and the different connected regions in bianry image b (x, y) are marked;
In step 7.2, respectively statistics bianry image b (x, y), the area of different connected region, arranges required judgment threshold S; When the interior connected region area of bianry image b (x, y) is greater than judgment threshold S, then corresponding connected region is defect areas; When in bianry image b (x, y), connected region area is less than judgment threshold S, then corresponding connected region is normal region.
2. arcuation face, the polishing metal flaw real-time detection method based on machine vision according to claim 1, it is characterized in that, described step 1 comprises the steps:
Step 1.1, in off-line case, gathers first sample image of N opening and closing lattice workpiece under work illumination, is then reduced to required intensity of illumination, gathers second sample image of M opening and closing lattice workpiece under Low light intensity;
Step 1.2, the first sample image, the second sample image are carried out to medium filtering and obtain image sequence I respectively n, I m; Wherein, n=1,2 ..., N, m=1,2 ... M;
Step 1.3, basis by image sequence I ncarry out data fusion, wherein, (x, y) represents the location of pixels in image sequence;
Step 1.4, basis by image sequence I mcarry out data fusion.
3. arcuation face, the polishing metal flaw real-time detection method based on machine vision according to claim 1, it is characterized in that: in described step 5.5, the convolution mask of gaussian filtering is:
h = 1 16 * 1 2 1 2 4 2 1 2 1 .
4. arcuation face, the polishing metal flaw real-time detection method based on machine vision according to claim 1, is characterized in that: described adjustment factor λ is 3 ~ 4.
CN201210163710.7A 2012-05-24 2012-05-24 Based on arcuation face, the polishing metal flaw real-time detection method of machine vision Active CN102680494B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201210163710.7A CN102680494B (en) 2012-05-24 2012-05-24 Based on arcuation face, the polishing metal flaw real-time detection method of machine vision

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201210163710.7A CN102680494B (en) 2012-05-24 2012-05-24 Based on arcuation face, the polishing metal flaw real-time detection method of machine vision

Publications (2)

Publication Number Publication Date
CN102680494A CN102680494A (en) 2012-09-19
CN102680494B true CN102680494B (en) 2015-08-26

Family

ID=46812752

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201210163710.7A Active CN102680494B (en) 2012-05-24 2012-05-24 Based on arcuation face, the polishing metal flaw real-time detection method of machine vision

Country Status (1)

Country Link
CN (1) CN102680494B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108827181A (en) * 2018-03-14 2018-11-16 浙江大学山东工业技术研究院 A kind of plate surface detection method of view-based access control model

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104458783B (en) * 2014-11-05 2017-08-29 深圳市华唯计量技术开发有限公司 Analytical instrument measurement result automatic judging method based on limitation management and control application
CN105741298B (en) * 2016-02-03 2018-08-14 浙江工商大学 A kind of image partition method for film label Defect Detection
CN106783580B (en) * 2016-12-29 2021-05-18 上海集成电路研发中心有限公司 Metal chemical mechanical polishing method
CN112763502B (en) * 2020-12-29 2024-03-12 华侨大学 Cambered surface gloss uniformity detection method
CN112834517B (en) * 2020-12-31 2024-01-16 慈溪迅蕾轴承有限公司 Image detection method for bearing appearance
CN113177924A (en) * 2021-05-10 2021-07-27 南通大学 Industrial production line product flaw detection method
EP4332553A1 (en) * 2021-11-30 2024-03-06 Contemporary Amperex Technology Co., Limited Machine vision inspection method, and inspection apparatus and inspection system therefor

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6061476A (en) * 1997-11-24 2000-05-09 Cognex Corporation Method and apparatus using image subtraction and dynamic thresholding
US6721461B1 (en) * 1997-11-24 2004-04-13 Cognex Technology And Investment Corporation Method and apparatus using image subtraction and dynamic thresholding
CN101153851B (en) * 2007-06-15 2011-06-08 中国农业大学 Apple detection classification method based on machine vision
CN101526484B (en) * 2009-04-13 2011-05-11 江南大学 Bearing defect detecting technique based on embedded-type machine vision

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108827181A (en) * 2018-03-14 2018-11-16 浙江大学山东工业技术研究院 A kind of plate surface detection method of view-based access control model

Also Published As

Publication number Publication date
CN102680494A (en) 2012-09-19

Similar Documents

Publication Publication Date Title
CN102680494B (en) Based on arcuation face, the polishing metal flaw real-time detection method of machine vision
CN105158258B (en) A kind of bamboo cane detection method of surface flaw based on computer vision
CN109115785B (en) Casting polishing quality detection method and device and use method thereof
CN108230324B (en) Visual detection method for microdefect on surface of magnetic shoe
CN101256157B (en) Method and apparatus for testing surface defect
KR101830679B1 (en) Apparatus for testing a display panel and method thereof
CN107845090A (en) A kind of silicon chip detection method and silicon chip detection means
CN107664644B (en) Object appearance automatic detection device and method based on machine vision
CN105046697B (en) A kind of beer bottleneck localization method assessed based on multiple random loop truss and degree of fitting
CN105738294B (en) The spike fruit automatic detection device and method of imaging are regarded based on monocular more
CN106248686A (en) Glass surface defects based on machine vision detection device and method
CN109886298A (en) A kind of detection method for quality of welding line based on convolutional neural networks
CN102374996B (en) Multicast detection device and method for full-depth tooth side face defects of bevel gear
CN104122271A (en) Automated optical inspection (AOI)-based bullet apparent defect detection method
CN104101600A (en) Method and apparatus for detecting fine cracks on cross section of continuous casting slab
CN109001224A (en) Welding seam detection method and detection device
CN111261079B (en) Method for detecting abnormal phenomena of bright and dark spots
CN110473194A (en) Fruit surface defect detection method based on more image block Threshold Segmentation Algorithms
CN114897908B (en) Machine vision-based method and system for analyzing defects of selective laser powder spreading sintering surface
CN109461156B (en) Threaded sealing plug assembly detection method based on vision
CN108802052A (en) A kind of detecting system and its detection method about slide fastener defect
CN107525768A (en) A kind of method of quality control of DNA ploidy body analytical equipment
CN113222937A (en) Detection method and detection device for appearance peripheral surface defects of nuclear fuel pellet
CN112862744A (en) Intelligent detection method for internal defects of capacitor based on ultrasonic image
CN103698333A (en) System and method for automatically and quantitatively analyzing coal rock ray plate fracture

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
C41 Transfer of patent application or patent right or utility model
TR01 Transfer of patent right

Effective date of registration: 20161122

Address after: 214029 floor, building A1, high wave East Road, Binhu District, Jiangsu, Wuxi, 9, China

Patentee after: Jiangsu blue creative intelligent Polytron Technologies Inc

Address before: 1800 No. 214122 Jiangsu city of Wuxi Province Li Lake Avenue

Patentee before: Jiangnan University

CP02 Change in the address of a patent holder

Address after: 214122 1-5 / F, building 8, 2018 Lihu Avenue, Wuxi City, Jiangsu Province

Patentee after: JIANGSU LANCHUANG INTELLIGENT TECHNOLOGY Co.,Ltd.

Address before: 214029 9th floor, building A1, 999 gaolang East Road, Binhu District, Wuxi City, Jiangsu Province

Patentee before: JIANGSU LANCHUANG INTELLIGENT TECHNOLOGY Co.,Ltd.

CP02 Change in the address of a patent holder